diff --git a/public/config/config.json b/public/config/config.json index e27644a..f2effa1 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,8 +1,8 @@ { "title":"计量业务系统", "versionByEqpt":"1.3.1.2", - "baseUrl": "http://111.198.10.15:21611", - "baseUrlBusiness": "http://111.198.10.15:21606", + "baseUrl": "http://192.168.206.127:5909", + "baseUrlBusiness": "http://111.198.10.15:21611", "baseUrlLaboratory": "http://111.198.10.15:21610", "pathDict": { "fbfpsbgl":"/reviewpage/detail", diff --git a/public/config/config.json b/public/config/config.json index e27644a..f2effa1 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,8 +1,8 @@ { "title":"计量业务系统", "versionByEqpt":"1.3.1.2", - "baseUrl": "http://111.198.10.15:21611", - "baseUrlBusiness": "http://111.198.10.15:21606", + "baseUrl": "http://192.168.206.127:5909", + "baseUrlBusiness": "http://111.198.10.15:21611", "baseUrlLaboratory": "http://111.198.10.15:21610", "pathDict": { "fbfpsbgl":"/reviewpage/detail", diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts new file mode 100644 index 0000000..d62adc2 --- /dev/null +++ b/src/utils/keepQuery.ts @@ -0,0 +1,16 @@ +// 保存页面查询等参数 +import useKeepAliveStore from '@/store/modules/keepAlive' + +const keepAliveStore = useKeepAliveStore() +// 操作 +const needKeep = ['edit', 'detail', 'update', 'add', 'create', 'trainPlanApprove', 'solveDetail', 'certPrintDetail'] +export function keepSearchParams(to: any, componentName: string) { + if (needKeep.some((item: string) => to.includes(item))) { + keepAliveStore.add(componentName) + console.log(keepAliveStore.list) + } + else { + keepAliveStore.remove(componentName) + console.log(keepAliveStore.list) + } +} diff --git a/public/config/config.json b/public/config/config.json index e27644a..f2effa1 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,8 +1,8 @@ { "title":"计量业务系统", "versionByEqpt":"1.3.1.2", - "baseUrl": "http://111.198.10.15:21611", - "baseUrlBusiness": "http://111.198.10.15:21606", + "baseUrl": "http://192.168.206.127:5909", + "baseUrlBusiness": "http://111.198.10.15:21611", "baseUrlLaboratory": "http://111.198.10.15:21610", "pathDict": { "fbfpsbgl":"/reviewpage/detail", diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts new file mode 100644 index 0000000..d62adc2 --- /dev/null +++ b/src/utils/keepQuery.ts @@ -0,0 +1,16 @@ +// 保存页面查询等参数 +import useKeepAliveStore from '@/store/modules/keepAlive' + +const keepAliveStore = useKeepAliveStore() +// 操作 +const needKeep = ['edit', 'detail', 'update', 'add', 'create', 'trainPlanApprove', 'solveDetail', 'certPrintDetail'] +export function keepSearchParams(to: any, componentName: string) { + if (needKeep.some((item: string) => to.includes(item))) { + keepAliveStore.add(componentName) + console.log(keepAliveStore.list) + } + else { + keepAliveStore.remove(componentName) + console.log(keepAliveStore.list) + } +} diff --git a/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue b/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue index c1cb2d0..751cef4 100644 --- a/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue +++ b/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue @@ -10,6 +10,8 @@ import { getAdminDept, getUserDept, getUserDeptSon } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' +import { getGroupList } from '@/api/eqpt/device/group' +import { getLocationList } from '@/api/system/installation' const props = defineProps({ measureCompany: { type: String, @@ -33,9 +35,14 @@ useSign: '', certificateValidStart: '', certificateValidEnd: '', - directorName: '', + directorName: userStore.name, companyId: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 }) watch(() => props.measureCompany, () => { listQuery.value.measureCompany = props.measureCompany @@ -141,6 +148,11 @@ companyId: '', directorName: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 } search() } @@ -191,11 +203,20 @@ // 取消 const resetForm = () => { dialogFormVisible.value = false - reset() + // reset() } // 初始化 -const initDialog = (isMulti: boolean) => { +const initDialog = (isMulti: boolean, type: string) => { + // 检定去向 + if (type === 'plan') { + // 计量室 + listQuery.value.checkDestination = '1' + } + else { + // 外送 + listQuery.value.checkDestination = '2' + } multi.value = isMulti // reset() dialogFormVisible.value = true @@ -213,10 +234,30 @@ const usePositionList = ref([]) // 部门 const deptList = ref([]) +// 计量标识 +const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() +// 分组 +const groupList = ref<{ id: string; value: string; name: string }[]>() +// 安装位置 +const installLocationList = ref([]) // 获取使用状态列表 const useStatusList = ref<{ id: string; value: string; name: string }[]>() const companyList = ref<{ id: string; value: string; name: string }[]>([]) const fetchDeptTree = () => { + // 分组 + getGroupList({ offset: 1, limit: 99999 }).then((res) => { + // console.log(res.data, '分组') + groupList.value = res.data.rows.map((item: any) => ({ name: item.groupName, id: item.id, value: item.id })) + }) + getDictByCode('eqptMeterIdentify').then((res) => { + meterIdentifyList.value = res.data + meterIdentifyList.value?.push({ name: '空', id: '1', value: '66' }) + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) // 在用信息 getDictByCode('eqptDeviceInUse').then((res) => { inUseList.value = res.data @@ -268,6 +309,7 @@ ] } }) + // } fetchDeptTree() @@ -328,20 +370,39 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/config/config.json b/public/config/config.json index e27644a..f2effa1 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,8 +1,8 @@ { "title":"计量业务系统", "versionByEqpt":"1.3.1.2", - "baseUrl": "http://111.198.10.15:21611", - "baseUrlBusiness": "http://111.198.10.15:21606", + "baseUrl": "http://192.168.206.127:5909", + "baseUrlBusiness": "http://111.198.10.15:21611", "baseUrlLaboratory": "http://111.198.10.15:21610", "pathDict": { "fbfpsbgl":"/reviewpage/detail", diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts new file mode 100644 index 0000000..d62adc2 --- /dev/null +++ b/src/utils/keepQuery.ts @@ -0,0 +1,16 @@ +// 保存页面查询等参数 +import useKeepAliveStore from '@/store/modules/keepAlive' + +const keepAliveStore = useKeepAliveStore() +// 操作 +const needKeep = ['edit', 'detail', 'update', 'add', 'create', 'trainPlanApprove', 'solveDetail', 'certPrintDetail'] +export function keepSearchParams(to: any, componentName: string) { + if (needKeep.some((item: string) => to.includes(item))) { + keepAliveStore.add(componentName) + console.log(keepAliveStore.list) + } + else { + keepAliveStore.remove(componentName) + console.log(keepAliveStore.list) + } +} diff --git a/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue b/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue index c1cb2d0..751cef4 100644 --- a/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue +++ b/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue @@ -10,6 +10,8 @@ import { getAdminDept, getUserDept, getUserDeptSon } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' +import { getGroupList } from '@/api/eqpt/device/group' +import { getLocationList } from '@/api/system/installation' const props = defineProps({ measureCompany: { type: String, @@ -33,9 +35,14 @@ useSign: '', certificateValidStart: '', certificateValidEnd: '', - directorName: '', + directorName: userStore.name, companyId: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 }) watch(() => props.measureCompany, () => { listQuery.value.measureCompany = props.measureCompany @@ -141,6 +148,11 @@ companyId: '', directorName: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 } search() } @@ -191,11 +203,20 @@ // 取消 const resetForm = () => { dialogFormVisible.value = false - reset() + // reset() } // 初始化 -const initDialog = (isMulti: boolean) => { +const initDialog = (isMulti: boolean, type: string) => { + // 检定去向 + if (type === 'plan') { + // 计量室 + listQuery.value.checkDestination = '1' + } + else { + // 外送 + listQuery.value.checkDestination = '2' + } multi.value = isMulti // reset() dialogFormVisible.value = true @@ -213,10 +234,30 @@ const usePositionList = ref([]) // 部门 const deptList = ref([]) +// 计量标识 +const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() +// 分组 +const groupList = ref<{ id: string; value: string; name: string }[]>() +// 安装位置 +const installLocationList = ref([]) // 获取使用状态列表 const useStatusList = ref<{ id: string; value: string; name: string }[]>() const companyList = ref<{ id: string; value: string; name: string }[]>([]) const fetchDeptTree = () => { + // 分组 + getGroupList({ offset: 1, limit: 99999 }).then((res) => { + // console.log(res.data, '分组') + groupList.value = res.data.rows.map((item: any) => ({ name: item.groupName, id: item.id, value: item.id })) + }) + getDictByCode('eqptMeterIdentify').then((res) => { + meterIdentifyList.value = res.data + meterIdentifyList.value?.push({ name: '空', id: '1', value: '66' }) + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) // 在用信息 getDictByCode('eqptDeviceInUse').then((res) => { inUseList.value = res.data @@ -268,6 +309,7 @@ ] } }) + // } fetchDeptTree() @@ -328,20 +370,39 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue b/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue index 44ad9fd..f842866 100644 --- a/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue +++ b/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue @@ -10,6 +10,8 @@ import { getAdminDept, getUserDept, getUserDeptSon } from '@/api/system/user' import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { toTreeList } from '@/utils/structure' +import { getGroupList } from '@/api/eqpt/device/group' +import { getLocationList } from '@/api/system/installation' const props = defineProps({ measureCompany: { type: String, @@ -34,8 +36,13 @@ certificateValidStart: '', certificateValidEnd: '', companyId: '', - directorName: '', + directorName: userStore.name, measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 }) watch(() => props.measureCompany, () => { listQuery.value.measureCompany = props.measureCompany @@ -140,6 +147,11 @@ directorName: '', companyId: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 } search() } @@ -168,10 +180,19 @@ // 取消 const resetForm = () => { dialogFormVisible.value = false - reset() + // reset() } // 初始化 -const initDialog = () => { +const initDialog = (type: string) => { + // 检定去向 + if (type === 'plan') { + // 计量室 + listQuery.value.checkDestination = '1' + } + else { + // 外送 + listQuery.value.checkDestination = '2' + } // reset() dialogFormVisible.value = true fetchData() // 获取人员列表 @@ -188,10 +209,30 @@ const usePositionList = ref([]) // 部门 const deptList = ref([]) +// 计量标识 +const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() +// 分组 +const groupList = ref<{ id: string; value: string; name: string }[]>() +// 安装位置 +const installLocationList = ref([]) // 获取使用状态列表 const useStatusList = ref<{ id: string; value: string; name: string }[]>() const companyList = ref<{ id: string; value: string; name: string }[]>([]) const fetchDeptTree = () => { + // 分组 + getGroupList({ offset: 1, limit: 99999 }).then((res) => { + // console.log(res.data, '分组') + groupList.value = res.data.rows.map((item: any) => ({ name: item.groupName, id: item.id, value: item.id })) + }) + getDictByCode('eqptMeterIdentify').then((res) => { + meterIdentifyList.value = res.data + meterIdentifyList.value?.push({ name: '空', id: '1', value: '66' }) + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) // 在用信息 getDictByCode('eqptDeviceInUse').then((res) => { inUseList.value = res.data @@ -302,20 +343,39 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/config/config.json b/public/config/config.json index e27644a..f2effa1 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,8 +1,8 @@ { "title":"计量业务系统", "versionByEqpt":"1.3.1.2", - "baseUrl": "http://111.198.10.15:21611", - "baseUrlBusiness": "http://111.198.10.15:21606", + "baseUrl": "http://192.168.206.127:5909", + "baseUrlBusiness": "http://111.198.10.15:21611", "baseUrlLaboratory": "http://111.198.10.15:21610", "pathDict": { "fbfpsbgl":"/reviewpage/detail", diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts new file mode 100644 index 0000000..d62adc2 --- /dev/null +++ b/src/utils/keepQuery.ts @@ -0,0 +1,16 @@ +// 保存页面查询等参数 +import useKeepAliveStore from '@/store/modules/keepAlive' + +const keepAliveStore = useKeepAliveStore() +// 操作 +const needKeep = ['edit', 'detail', 'update', 'add', 'create', 'trainPlanApprove', 'solveDetail', 'certPrintDetail'] +export function keepSearchParams(to: any, componentName: string) { + if (needKeep.some((item: string) => to.includes(item))) { + keepAliveStore.add(componentName) + console.log(keepAliveStore.list) + } + else { + keepAliveStore.remove(componentName) + console.log(keepAliveStore.list) + } +} diff --git a/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue b/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue index c1cb2d0..751cef4 100644 --- a/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue +++ b/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue @@ -10,6 +10,8 @@ import { getAdminDept, getUserDept, getUserDeptSon } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' +import { getGroupList } from '@/api/eqpt/device/group' +import { getLocationList } from '@/api/system/installation' const props = defineProps({ measureCompany: { type: String, @@ -33,9 +35,14 @@ useSign: '', certificateValidStart: '', certificateValidEnd: '', - directorName: '', + directorName: userStore.name, companyId: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 }) watch(() => props.measureCompany, () => { listQuery.value.measureCompany = props.measureCompany @@ -141,6 +148,11 @@ companyId: '', directorName: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 } search() } @@ -191,11 +203,20 @@ // 取消 const resetForm = () => { dialogFormVisible.value = false - reset() + // reset() } // 初始化 -const initDialog = (isMulti: boolean) => { +const initDialog = (isMulti: boolean, type: string) => { + // 检定去向 + if (type === 'plan') { + // 计量室 + listQuery.value.checkDestination = '1' + } + else { + // 外送 + listQuery.value.checkDestination = '2' + } multi.value = isMulti // reset() dialogFormVisible.value = true @@ -213,10 +234,30 @@ const usePositionList = ref([]) // 部门 const deptList = ref([]) +// 计量标识 +const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() +// 分组 +const groupList = ref<{ id: string; value: string; name: string }[]>() +// 安装位置 +const installLocationList = ref([]) // 获取使用状态列表 const useStatusList = ref<{ id: string; value: string; name: string }[]>() const companyList = ref<{ id: string; value: string; name: string }[]>([]) const fetchDeptTree = () => { + // 分组 + getGroupList({ offset: 1, limit: 99999 }).then((res) => { + // console.log(res.data, '分组') + groupList.value = res.data.rows.map((item: any) => ({ name: item.groupName, id: item.id, value: item.id })) + }) + getDictByCode('eqptMeterIdentify').then((res) => { + meterIdentifyList.value = res.data + meterIdentifyList.value?.push({ name: '空', id: '1', value: '66' }) + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) // 在用信息 getDictByCode('eqptDeviceInUse').then((res) => { inUseList.value = res.data @@ -268,6 +309,7 @@ ] } }) + // } fetchDeptTree() @@ -328,20 +370,39 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue b/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue index 44ad9fd..f842866 100644 --- a/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue +++ b/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue @@ -10,6 +10,8 @@ import { getAdminDept, getUserDept, getUserDeptSon } from '@/api/system/user' import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { toTreeList } from '@/utils/structure' +import { getGroupList } from '@/api/eqpt/device/group' +import { getLocationList } from '@/api/system/installation' const props = defineProps({ measureCompany: { type: String, @@ -34,8 +36,13 @@ certificateValidStart: '', certificateValidEnd: '', companyId: '', - directorName: '', + directorName: userStore.name, measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 }) watch(() => props.measureCompany, () => { listQuery.value.measureCompany = props.measureCompany @@ -140,6 +147,11 @@ directorName: '', companyId: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 } search() } @@ -168,10 +180,19 @@ // 取消 const resetForm = () => { dialogFormVisible.value = false - reset() + // reset() } // 初始化 -const initDialog = () => { +const initDialog = (type: string) => { + // 检定去向 + if (type === 'plan') { + // 计量室 + listQuery.value.checkDestination = '1' + } + else { + // 外送 + listQuery.value.checkDestination = '2' + } // reset() dialogFormVisible.value = true fetchData() // 获取人员列表 @@ -188,10 +209,30 @@ const usePositionList = ref([]) // 部门 const deptList = ref([]) +// 计量标识 +const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() +// 分组 +const groupList = ref<{ id: string; value: string; name: string }[]>() +// 安装位置 +const installLocationList = ref([]) // 获取使用状态列表 const useStatusList = ref<{ id: string; value: string; name: string }[]>() const companyList = ref<{ id: string; value: string; name: string }[]>([]) const fetchDeptTree = () => { + // 分组 + getGroupList({ offset: 1, limit: 99999 }).then((res) => { + // console.log(res.data, '分组') + groupList.value = res.data.rows.map((item: any) => ({ name: item.groupName, id: item.id, value: item.id })) + }) + getDictByCode('eqptMeterIdentify').then((res) => { + meterIdentifyList.value = res.data + meterIdentifyList.value?.push({ name: '空', id: '1', value: '66' }) + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) // 在用信息 getDictByCode('eqptDeviceInUse').then((res) => { inUseList.value = res.data @@ -302,20 +343,39 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/tested/MeasurementPlan/task/components/tableList.vue b/src/views/tested/MeasurementPlan/task/components/tableList.vue index 861e656..60fb839 100644 --- a/src/views/tested/MeasurementPlan/task/components/tableList.vue +++ b/src/views/tested/MeasurementPlan/task/components/tableList.vue @@ -218,7 +218,7 @@ // 单选设备 const select = (text: string, index: any) => { if (text === '设备名称') { - deviceSingeRef.value.initDialog() + deviceSingeRef.value.initDialog('plan') selectRow.value = index } } @@ -226,7 +226,7 @@ const batch = () => { if (!checkCertificateList()) { return } setAllRowReadable() - deviceRef.value.initDialog(true) + deviceRef.value.initDialog(true, 'plan') } // 确认选择设备 const confirm = (device: any) => { diff --git a/public/config/config.json b/public/config/config.json index e27644a..f2effa1 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,8 +1,8 @@ { "title":"计量业务系统", "versionByEqpt":"1.3.1.2", - "baseUrl": "http://111.198.10.15:21611", - "baseUrlBusiness": "http://111.198.10.15:21606", + "baseUrl": "http://192.168.206.127:5909", + "baseUrlBusiness": "http://111.198.10.15:21611", "baseUrlLaboratory": "http://111.198.10.15:21610", "pathDict": { "fbfpsbgl":"/reviewpage/detail", diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts new file mode 100644 index 0000000..d62adc2 --- /dev/null +++ b/src/utils/keepQuery.ts @@ -0,0 +1,16 @@ +// 保存页面查询等参数 +import useKeepAliveStore from '@/store/modules/keepAlive' + +const keepAliveStore = useKeepAliveStore() +// 操作 +const needKeep = ['edit', 'detail', 'update', 'add', 'create', 'trainPlanApprove', 'solveDetail', 'certPrintDetail'] +export function keepSearchParams(to: any, componentName: string) { + if (needKeep.some((item: string) => to.includes(item))) { + keepAliveStore.add(componentName) + console.log(keepAliveStore.list) + } + else { + keepAliveStore.remove(componentName) + console.log(keepAliveStore.list) + } +} diff --git a/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue b/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue index c1cb2d0..751cef4 100644 --- a/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue +++ b/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue @@ -10,6 +10,8 @@ import { getAdminDept, getUserDept, getUserDeptSon } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' +import { getGroupList } from '@/api/eqpt/device/group' +import { getLocationList } from '@/api/system/installation' const props = defineProps({ measureCompany: { type: String, @@ -33,9 +35,14 @@ useSign: '', certificateValidStart: '', certificateValidEnd: '', - directorName: '', + directorName: userStore.name, companyId: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 }) watch(() => props.measureCompany, () => { listQuery.value.measureCompany = props.measureCompany @@ -141,6 +148,11 @@ companyId: '', directorName: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 } search() } @@ -191,11 +203,20 @@ // 取消 const resetForm = () => { dialogFormVisible.value = false - reset() + // reset() } // 初始化 -const initDialog = (isMulti: boolean) => { +const initDialog = (isMulti: boolean, type: string) => { + // 检定去向 + if (type === 'plan') { + // 计量室 + listQuery.value.checkDestination = '1' + } + else { + // 外送 + listQuery.value.checkDestination = '2' + } multi.value = isMulti // reset() dialogFormVisible.value = true @@ -213,10 +234,30 @@ const usePositionList = ref([]) // 部门 const deptList = ref([]) +// 计量标识 +const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() +// 分组 +const groupList = ref<{ id: string; value: string; name: string }[]>() +// 安装位置 +const installLocationList = ref([]) // 获取使用状态列表 const useStatusList = ref<{ id: string; value: string; name: string }[]>() const companyList = ref<{ id: string; value: string; name: string }[]>([]) const fetchDeptTree = () => { + // 分组 + getGroupList({ offset: 1, limit: 99999 }).then((res) => { + // console.log(res.data, '分组') + groupList.value = res.data.rows.map((item: any) => ({ name: item.groupName, id: item.id, value: item.id })) + }) + getDictByCode('eqptMeterIdentify').then((res) => { + meterIdentifyList.value = res.data + meterIdentifyList.value?.push({ name: '空', id: '1', value: '66' }) + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) // 在用信息 getDictByCode('eqptDeviceInUse').then((res) => { inUseList.value = res.data @@ -268,6 +309,7 @@ ] } }) + // } fetchDeptTree() @@ -328,20 +370,39 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue b/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue index 44ad9fd..f842866 100644 --- a/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue +++ b/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue @@ -10,6 +10,8 @@ import { getAdminDept, getUserDept, getUserDeptSon } from '@/api/system/user' import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { toTreeList } from '@/utils/structure' +import { getGroupList } from '@/api/eqpt/device/group' +import { getLocationList } from '@/api/system/installation' const props = defineProps({ measureCompany: { type: String, @@ -34,8 +36,13 @@ certificateValidStart: '', certificateValidEnd: '', companyId: '', - directorName: '', + directorName: userStore.name, measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 }) watch(() => props.measureCompany, () => { listQuery.value.measureCompany = props.measureCompany @@ -140,6 +147,11 @@ directorName: '', companyId: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 } search() } @@ -168,10 +180,19 @@ // 取消 const resetForm = () => { dialogFormVisible.value = false - reset() + // reset() } // 初始化 -const initDialog = () => { +const initDialog = (type: string) => { + // 检定去向 + if (type === 'plan') { + // 计量室 + listQuery.value.checkDestination = '1' + } + else { + // 外送 + listQuery.value.checkDestination = '2' + } // reset() dialogFormVisible.value = true fetchData() // 获取人员列表 @@ -188,10 +209,30 @@ const usePositionList = ref([]) // 部门 const deptList = ref([]) +// 计量标识 +const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() +// 分组 +const groupList = ref<{ id: string; value: string; name: string }[]>() +// 安装位置 +const installLocationList = ref([]) // 获取使用状态列表 const useStatusList = ref<{ id: string; value: string; name: string }[]>() const companyList = ref<{ id: string; value: string; name: string }[]>([]) const fetchDeptTree = () => { + // 分组 + getGroupList({ offset: 1, limit: 99999 }).then((res) => { + // console.log(res.data, '分组') + groupList.value = res.data.rows.map((item: any) => ({ name: item.groupName, id: item.id, value: item.id })) + }) + getDictByCode('eqptMeterIdentify').then((res) => { + meterIdentifyList.value = res.data + meterIdentifyList.value?.push({ name: '空', id: '1', value: '66' }) + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) // 在用信息 getDictByCode('eqptDeviceInUse').then((res) => { inUseList.value = res.data @@ -302,20 +343,39 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/tested/MeasurementPlan/task/components/tableList.vue b/src/views/tested/MeasurementPlan/task/components/tableList.vue index 861e656..60fb839 100644 --- a/src/views/tested/MeasurementPlan/task/components/tableList.vue +++ b/src/views/tested/MeasurementPlan/task/components/tableList.vue @@ -218,7 +218,7 @@ // 单选设备 const select = (text: string, index: any) => { if (text === '设备名称') { - deviceSingeRef.value.initDialog() + deviceSingeRef.value.initDialog('plan') selectRow.value = index } } @@ -226,7 +226,7 @@ const batch = () => { if (!checkCertificateList()) { return } setAllRowReadable() - deviceRef.value.initDialog(true) + deviceRef.value.initDialog(true, 'plan') } // 确认选择设备 const confirm = (device: any) => { diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index ee51d09..1a8f0cc 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -7,6 +7,7 @@ import { getAdminDept, getUserDept, getUserDeptSon, getUserList } from '@/api/system/user' import { getDeptList, getDeptTree, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' import showPhoto from '@/views/tested/device/info/components/showPhotoSinge.vue' +import { getPhotoUrl } from '@/api/system/tool' import { getPostList } from '@/api/system/post' const { proxy } = getCurrentInstance() as any const listQuery = reactive({ @@ -61,16 +62,19 @@ text: '校准(检定)日期', value: 'checkDate', align: 'center', + width: '130', }, { text: '证书编号', value: 'certificateNo', align: 'center', + width: '140', }, { text: '证书有效期', value: 'certificateValid', align: 'center', + width: '130', }, ]) const list = ref([]) @@ -109,12 +113,9 @@ const $router = useRouter() // 新建编辑操作 const handler = (row: any, type: string) => { - $router.push({ - path: `/certificate/${type}`, - query: { - row: JSON.stringify(row), - id: row.id, - }, +// row.minioFileName + getPhotoUrl(row.minioFileName).then((res) => { + window.open(res.data, '_blank') }) } const range = ref() @@ -319,12 +320,12 @@ :is-showmulti-select="true" @change="changePage" > diff --git a/public/config/config.json b/public/config/config.json index e27644a..f2effa1 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,8 +1,8 @@ { "title":"计量业务系统", "versionByEqpt":"1.3.1.2", - "baseUrl": "http://111.198.10.15:21611", - "baseUrlBusiness": "http://111.198.10.15:21606", + "baseUrl": "http://192.168.206.127:5909", + "baseUrlBusiness": "http://111.198.10.15:21611", "baseUrlLaboratory": "http://111.198.10.15:21610", "pathDict": { "fbfpsbgl":"/reviewpage/detail", diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts new file mode 100644 index 0000000..d62adc2 --- /dev/null +++ b/src/utils/keepQuery.ts @@ -0,0 +1,16 @@ +// 保存页面查询等参数 +import useKeepAliveStore from '@/store/modules/keepAlive' + +const keepAliveStore = useKeepAliveStore() +// 操作 +const needKeep = ['edit', 'detail', 'update', 'add', 'create', 'trainPlanApprove', 'solveDetail', 'certPrintDetail'] +export function keepSearchParams(to: any, componentName: string) { + if (needKeep.some((item: string) => to.includes(item))) { + keepAliveStore.add(componentName) + console.log(keepAliveStore.list) + } + else { + keepAliveStore.remove(componentName) + console.log(keepAliveStore.list) + } +} diff --git a/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue b/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue index c1cb2d0..751cef4 100644 --- a/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue +++ b/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue @@ -10,6 +10,8 @@ import { getAdminDept, getUserDept, getUserDeptSon } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' +import { getGroupList } from '@/api/eqpt/device/group' +import { getLocationList } from '@/api/system/installation' const props = defineProps({ measureCompany: { type: String, @@ -33,9 +35,14 @@ useSign: '', certificateValidStart: '', certificateValidEnd: '', - directorName: '', + directorName: userStore.name, companyId: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 }) watch(() => props.measureCompany, () => { listQuery.value.measureCompany = props.measureCompany @@ -141,6 +148,11 @@ companyId: '', directorName: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 } search() } @@ -191,11 +203,20 @@ // 取消 const resetForm = () => { dialogFormVisible.value = false - reset() + // reset() } // 初始化 -const initDialog = (isMulti: boolean) => { +const initDialog = (isMulti: boolean, type: string) => { + // 检定去向 + if (type === 'plan') { + // 计量室 + listQuery.value.checkDestination = '1' + } + else { + // 外送 + listQuery.value.checkDestination = '2' + } multi.value = isMulti // reset() dialogFormVisible.value = true @@ -213,10 +234,30 @@ const usePositionList = ref([]) // 部门 const deptList = ref([]) +// 计量标识 +const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() +// 分组 +const groupList = ref<{ id: string; value: string; name: string }[]>() +// 安装位置 +const installLocationList = ref([]) // 获取使用状态列表 const useStatusList = ref<{ id: string; value: string; name: string }[]>() const companyList = ref<{ id: string; value: string; name: string }[]>([]) const fetchDeptTree = () => { + // 分组 + getGroupList({ offset: 1, limit: 99999 }).then((res) => { + // console.log(res.data, '分组') + groupList.value = res.data.rows.map((item: any) => ({ name: item.groupName, id: item.id, value: item.id })) + }) + getDictByCode('eqptMeterIdentify').then((res) => { + meterIdentifyList.value = res.data + meterIdentifyList.value?.push({ name: '空', id: '1', value: '66' }) + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) // 在用信息 getDictByCode('eqptDeviceInUse').then((res) => { inUseList.value = res.data @@ -268,6 +309,7 @@ ] } }) + // } fetchDeptTree() @@ -328,20 +370,39 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue b/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue index 44ad9fd..f842866 100644 --- a/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue +++ b/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue @@ -10,6 +10,8 @@ import { getAdminDept, getUserDept, getUserDeptSon } from '@/api/system/user' import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { toTreeList } from '@/utils/structure' +import { getGroupList } from '@/api/eqpt/device/group' +import { getLocationList } from '@/api/system/installation' const props = defineProps({ measureCompany: { type: String, @@ -34,8 +36,13 @@ certificateValidStart: '', certificateValidEnd: '', companyId: '', - directorName: '', + directorName: userStore.name, measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 }) watch(() => props.measureCompany, () => { listQuery.value.measureCompany = props.measureCompany @@ -140,6 +147,11 @@ directorName: '', companyId: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 } search() } @@ -168,10 +180,19 @@ // 取消 const resetForm = () => { dialogFormVisible.value = false - reset() + // reset() } // 初始化 -const initDialog = () => { +const initDialog = (type: string) => { + // 检定去向 + if (type === 'plan') { + // 计量室 + listQuery.value.checkDestination = '1' + } + else { + // 外送 + listQuery.value.checkDestination = '2' + } // reset() dialogFormVisible.value = true fetchData() // 获取人员列表 @@ -188,10 +209,30 @@ const usePositionList = ref([]) // 部门 const deptList = ref([]) +// 计量标识 +const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() +// 分组 +const groupList = ref<{ id: string; value: string; name: string }[]>() +// 安装位置 +const installLocationList = ref([]) // 获取使用状态列表 const useStatusList = ref<{ id: string; value: string; name: string }[]>() const companyList = ref<{ id: string; value: string; name: string }[]>([]) const fetchDeptTree = () => { + // 分组 + getGroupList({ offset: 1, limit: 99999 }).then((res) => { + // console.log(res.data, '分组') + groupList.value = res.data.rows.map((item: any) => ({ name: item.groupName, id: item.id, value: item.id })) + }) + getDictByCode('eqptMeterIdentify').then((res) => { + meterIdentifyList.value = res.data + meterIdentifyList.value?.push({ name: '空', id: '1', value: '66' }) + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) // 在用信息 getDictByCode('eqptDeviceInUse').then((res) => { inUseList.value = res.data @@ -302,20 +343,39 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/tested/MeasurementPlan/task/components/tableList.vue b/src/views/tested/MeasurementPlan/task/components/tableList.vue index 861e656..60fb839 100644 --- a/src/views/tested/MeasurementPlan/task/components/tableList.vue +++ b/src/views/tested/MeasurementPlan/task/components/tableList.vue @@ -218,7 +218,7 @@ // 单选设备 const select = (text: string, index: any) => { if (text === '设备名称') { - deviceSingeRef.value.initDialog() + deviceSingeRef.value.initDialog('plan') selectRow.value = index } } @@ -226,7 +226,7 @@ const batch = () => { if (!checkCertificateList()) { return } setAllRowReadable() - deviceRef.value.initDialog(true) + deviceRef.value.initDialog(true, 'plan') } // 确认选择设备 const confirm = (device: any) => { diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index ee51d09..1a8f0cc 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -7,6 +7,7 @@ import { getAdminDept, getUserDept, getUserDeptSon, getUserList } from '@/api/system/user' import { getDeptList, getDeptTree, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' import showPhoto from '@/views/tested/device/info/components/showPhotoSinge.vue' +import { getPhotoUrl } from '@/api/system/tool' import { getPostList } from '@/api/system/post' const { proxy } = getCurrentInstance() as any const listQuery = reactive({ @@ -61,16 +62,19 @@ text: '校准(检定)日期', value: 'checkDate', align: 'center', + width: '130', }, { text: '证书编号', value: 'certificateNo', align: 'center', + width: '140', }, { text: '证书有效期', value: 'certificateValid', align: 'center', + width: '130', }, ]) const list = ref([]) @@ -109,12 +113,9 @@ const $router = useRouter() // 新建编辑操作 const handler = (row: any, type: string) => { - $router.push({ - path: `/certificate/${type}`, - query: { - row: JSON.stringify(row), - id: row.id, - }, +// row.minioFileName + getPhotoUrl(row.minioFileName).then((res) => { + window.open(res.data, '_blank') }) } const range = ref() @@ -319,12 +320,12 @@ :is-showmulti-select="true" @change="changePage" > diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 23d38b5..755d7ea 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -290,29 +290,41 @@ if (!($route.path.includes('detail') || isFrist.value)) { ruleForm.value.helpInstruction = '' } - if (newVal && ruleForm.value.equipmentName) { + setTimeout(() => { + if (newVal && ruleForm.value.equipmentName) { // 修改规格型号和辅助字段列表 - helpList.value = Array.from(new Set(allList.value.filter(item => item.helpInstruction).filter(item => item.equipmentName === ruleForm.value.equipmentName && item.model === newVal).map(item => item.helpInstruction))) - if ((helpList.value.length === 0 || (helpList.value.length === 1)) && ruleForm.value.model && ruleForm.value.equipmentName) { - const arr = allList.value.filter((item: any) => item.model === ruleForm.value.model && item.equipmentName === ruleForm.value.equipmentName) - if (arr.length) { - const data = arr[0] - ruleForm.value.category = data.category - // ruleForm.value.remark = data.remark - ruleForm.value.technicalTargetList = data.technicalTargetList - ruleForm.value.checkCycle = data.checkCycle - ruleForm.value.modelId = data.id - ruleForm.value.helpInstruction = arr[0].helpInstruction + helpList.value = Array.from(new Set(allList.value.filter(item => item.helpInstruction).filter(item => item.equipmentName === ruleForm.value.equipmentName && item.model === newVal).map(item => item.helpInstruction))) + if ((helpList.value.length === 1) && ruleForm.value.model && ruleForm.value.equipmentName) { + const arr = allList.value.filter((item: any) => item.model === ruleForm.value.model && item.equipmentName === ruleForm.value.equipmentName) + // helpList.value = arr + if (arr.length) { + const data = arr[0] + ruleForm.value.category = data.category + // ruleForm.value.remark = data.remark + ruleForm.value.technicalTargetList = data.technicalTargetList + ruleForm.value.checkCycle = data.checkCycle + ruleForm.value.modelId = data.id + ruleForm.value.helpInstruction = arr[0].helpInstruction + } } } - } - else if (newVal) { - helpList.value = Array.from(new Set(allList.value.filter(item => item.helpInstruction).filter(item => item.model === newVal).map(item => item.helpInstruction))).sort() - } - else { - helpList.value = Array.from(new Set(allList.value.filter(item => item.helpInstruction).map(item => item.helpInstruction))).sort() - } + else if (newVal) { + helpList.value = Array.from(new Set(allList.value.filter(item => item.helpInstruction).filter(item => item.model === newVal).map(item => item.helpInstruction))).sort() + } + else { + helpList.value = Array.from(new Set(allList.value.filter(item => item.helpInstruction).map(item => item.helpInstruction))).sort() + } + }) }) + +// watch(() => ruleForm.value.helpInstruction, (newVal) => { +// if (newVal && ruleForm.value.equipmentName && ruleForm.value.model) { +// const arr = allList.value.filter((item: any) => item.model === ruleForm.value.model && item.equipmentName === ruleForm.value.equipmentName && item.helpInstruction === newVal) +// if (arr.length) { +// ruleForm.value.modelId = data.id +// } +// } +// }) // 设备相关,填充数据 watch(() => ruleForm.value, (newVal, oldVal) => { if ($route.path.includes('detail') || isFrist.value) { @@ -399,6 +411,7 @@ } getuser() // 弹窗初始化 +const directorId = ref() const initDialog = () => { dialogStatus.value = $route.params.type as string || 'detail' ruleFormRef.value?.resetFields() @@ -483,6 +496,7 @@ ruleForm.value.createUserName = userStore.name ruleForm.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间 } + directorId.value = ruleForm.value.directorId openSubmission() fetchDept() }) @@ -490,6 +504,7 @@ else { getApprovalDetail({ id: $route.query.id as string }).then((res) => { ruleForm.value = res.data + directorId.value = ruleForm.value.directorId openSubmission() fetchDept() }) @@ -536,6 +551,9 @@ // 特种设备 ruleForm.value.certificateList = certificateRef.value.list } + if (!$route.path.includes('detail') && ruleForm.value.directorId !== directorId.value) { + ruleForm.value.directorName = userList.value.filter((item: { id: string }) => item.id === ruleForm.value.directorId)[0]?.name + } // 计量室需要具备对受检设备中设备信息变更的权限,不走审批流,但是要留下变更记录 if ($route.path.includes('update') && userStore.deptName.includes('计量室')) { editInfoNoApproval(ruleForm.value).then((res) => { diff --git a/public/config/config.json b/public/config/config.json index e27644a..f2effa1 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,8 +1,8 @@ { "title":"计量业务系统", "versionByEqpt":"1.3.1.2", - "baseUrl": "http://111.198.10.15:21611", - "baseUrlBusiness": "http://111.198.10.15:21606", + "baseUrl": "http://192.168.206.127:5909", + "baseUrlBusiness": "http://111.198.10.15:21611", "baseUrlLaboratory": "http://111.198.10.15:21610", "pathDict": { "fbfpsbgl":"/reviewpage/detail", diff --git a/src/utils/keepQuery.ts b/src/utils/keepQuery.ts new file mode 100644 index 0000000..d62adc2 --- /dev/null +++ b/src/utils/keepQuery.ts @@ -0,0 +1,16 @@ +// 保存页面查询等参数 +import useKeepAliveStore from '@/store/modules/keepAlive' + +const keepAliveStore = useKeepAliveStore() +// 操作 +const needKeep = ['edit', 'detail', 'update', 'add', 'create', 'trainPlanApprove', 'solveDetail', 'certPrintDetail'] +export function keepSearchParams(to: any, componentName: string) { + if (needKeep.some((item: string) => to.includes(item))) { + keepAliveStore.add(componentName) + console.log(keepAliveStore.list) + } + else { + keepAliveStore.remove(componentName) + console.log(keepAliveStore.list) + } +} diff --git a/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue b/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue index c1cb2d0..751cef4 100644 --- a/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue +++ b/src/views/tested/MeasurementPlan/task/components/selectDeviceMultiple.vue @@ -10,6 +10,8 @@ import { getAdminDept, getUserDept, getUserDeptSon } from '@/api/system/user' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' +import { getGroupList } from '@/api/eqpt/device/group' +import { getLocationList } from '@/api/system/installation' const props = defineProps({ measureCompany: { type: String, @@ -33,9 +35,14 @@ useSign: '', certificateValidStart: '', certificateValidEnd: '', - directorName: '', + directorName: userStore.name, companyId: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 }) watch(() => props.measureCompany, () => { listQuery.value.measureCompany = props.measureCompany @@ -141,6 +148,11 @@ companyId: '', directorName: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 } search() } @@ -191,11 +203,20 @@ // 取消 const resetForm = () => { dialogFormVisible.value = false - reset() + // reset() } // 初始化 -const initDialog = (isMulti: boolean) => { +const initDialog = (isMulti: boolean, type: string) => { + // 检定去向 + if (type === 'plan') { + // 计量室 + listQuery.value.checkDestination = '1' + } + else { + // 外送 + listQuery.value.checkDestination = '2' + } multi.value = isMulti // reset() dialogFormVisible.value = true @@ -213,10 +234,30 @@ const usePositionList = ref([]) // 部门 const deptList = ref([]) +// 计量标识 +const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() +// 分组 +const groupList = ref<{ id: string; value: string; name: string }[]>() +// 安装位置 +const installLocationList = ref([]) // 获取使用状态列表 const useStatusList = ref<{ id: string; value: string; name: string }[]>() const companyList = ref<{ id: string; value: string; name: string }[]>([]) const fetchDeptTree = () => { + // 分组 + getGroupList({ offset: 1, limit: 99999 }).then((res) => { + // console.log(res.data, '分组') + groupList.value = res.data.rows.map((item: any) => ({ name: item.groupName, id: item.id, value: item.id })) + }) + getDictByCode('eqptMeterIdentify').then((res) => { + meterIdentifyList.value = res.data + meterIdentifyList.value?.push({ name: '空', id: '1', value: '66' }) + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) // 在用信息 getDictByCode('eqptDeviceInUse').then((res) => { inUseList.value = res.data @@ -268,6 +309,7 @@ ] } }) + // } fetchDeptTree() @@ -328,20 +370,39 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue b/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue index 44ad9fd..f842866 100644 --- a/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue +++ b/src/views/tested/MeasurementPlan/task/components/selectDeviceSinge.vue @@ -10,6 +10,8 @@ import { getAdminDept, getUserDept, getUserDeptSon } from '@/api/system/user' import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { toTreeList } from '@/utils/structure' +import { getGroupList } from '@/api/eqpt/device/group' +import { getLocationList } from '@/api/system/installation' const props = defineProps({ measureCompany: { type: String, @@ -34,8 +36,13 @@ certificateValidStart: '', certificateValidEnd: '', companyId: '', - directorName: '', + directorName: userStore.name, measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 }) watch(() => props.measureCompany, () => { listQuery.value.measureCompany = props.measureCompany @@ -140,6 +147,11 @@ directorName: '', companyId: '', measureCompany: props.measureCompany, + installLocationId: '', // 安装位置 + installLocation: '', // 详细位置 + checkOrganization: '', // 检定机构 + meterIdentify: '', // 计量标识 + groupId: '', // 分组 } search() } @@ -168,10 +180,19 @@ // 取消 const resetForm = () => { dialogFormVisible.value = false - reset() + // reset() } // 初始化 -const initDialog = () => { +const initDialog = (type: string) => { + // 检定去向 + if (type === 'plan') { + // 计量室 + listQuery.value.checkDestination = '1' + } + else { + // 外送 + listQuery.value.checkDestination = '2' + } // reset() dialogFormVisible.value = true fetchData() // 获取人员列表 @@ -188,10 +209,30 @@ const usePositionList = ref([]) // 部门 const deptList = ref([]) +// 计量标识 +const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() +// 分组 +const groupList = ref<{ id: string; value: string; name: string }[]>() +// 安装位置 +const installLocationList = ref([]) // 获取使用状态列表 const useStatusList = ref<{ id: string; value: string; name: string }[]>() const companyList = ref<{ id: string; value: string; name: string }[]>([]) const fetchDeptTree = () => { + // 分组 + getGroupList({ offset: 1, limit: 99999 }).then((res) => { + // console.log(res.data, '分组') + groupList.value = res.data.rows.map((item: any) => ({ name: item.groupName, id: item.id, value: item.id })) + }) + getDictByCode('eqptMeterIdentify').then((res) => { + meterIdentifyList.value = res.data + meterIdentifyList.value?.push({ name: '空', id: '1', value: '66' }) + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) // 在用信息 getDictByCode('eqptDeviceInUse').then((res) => { inUseList.value = res.data @@ -302,20 +343,39 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/tested/MeasurementPlan/task/components/tableList.vue b/src/views/tested/MeasurementPlan/task/components/tableList.vue index 861e656..60fb839 100644 --- a/src/views/tested/MeasurementPlan/task/components/tableList.vue +++ b/src/views/tested/MeasurementPlan/task/components/tableList.vue @@ -218,7 +218,7 @@ // 单选设备 const select = (text: string, index: any) => { if (text === '设备名称') { - deviceSingeRef.value.initDialog() + deviceSingeRef.value.initDialog('plan') selectRow.value = index } } @@ -226,7 +226,7 @@ const batch = () => { if (!checkCertificateList()) { return } setAllRowReadable() - deviceRef.value.initDialog(true) + deviceRef.value.initDialog(true, 'plan') } // 确认选择设备 const confirm = (device: any) => { diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index ee51d09..1a8f0cc 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -7,6 +7,7 @@ import { getAdminDept, getUserDept, getUserDeptSon, getUserList } from '@/api/system/user' import { getDeptList, getDeptTree, getDeptTreeList, getDeptTreeListByPid } from '@/api/system/dept' import showPhoto from '@/views/tested/device/info/components/showPhotoSinge.vue' +import { getPhotoUrl } from '@/api/system/tool' import { getPostList } from '@/api/system/post' const { proxy } = getCurrentInstance() as any const listQuery = reactive({ @@ -61,16 +62,19 @@ text: '校准(检定)日期', value: 'checkDate', align: 'center', + width: '130', }, { text: '证书编号', value: 'certificateNo', align: 'center', + width: '140', }, { text: '证书有效期', value: 'certificateValid', align: 'center', + width: '130', }, ]) const list = ref([]) @@ -109,12 +113,9 @@ const $router = useRouter() // 新建编辑操作 const handler = (row: any, type: string) => { - $router.push({ - path: `/certificate/${type}`, - query: { - row: JSON.stringify(row), - id: row.id, - }, +// row.minioFileName + getPhotoUrl(row.minioFileName).then((res) => { + window.open(res.data, '_blank') }) } const range = ref() @@ -319,12 +320,12 @@ :is-showmulti-select="true" @change="changePage" > diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 23d38b5..755d7ea 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -290,29 +290,41 @@ if (!($route.path.includes('detail') || isFrist.value)) { ruleForm.value.helpInstruction = '' } - if (newVal && ruleForm.value.equipmentName) { + setTimeout(() => { + if (newVal && ruleForm.value.equipmentName) { // 修改规格型号和辅助字段列表 - helpList.value = Array.from(new Set(allList.value.filter(item => item.helpInstruction).filter(item => item.equipmentName === ruleForm.value.equipmentName && item.model === newVal).map(item => item.helpInstruction))) - if ((helpList.value.length === 0 || (helpList.value.length === 1)) && ruleForm.value.model && ruleForm.value.equipmentName) { - const arr = allList.value.filter((item: any) => item.model === ruleForm.value.model && item.equipmentName === ruleForm.value.equipmentName) - if (arr.length) { - const data = arr[0] - ruleForm.value.category = data.category - // ruleForm.value.remark = data.remark - ruleForm.value.technicalTargetList = data.technicalTargetList - ruleForm.value.checkCycle = data.checkCycle - ruleForm.value.modelId = data.id - ruleForm.value.helpInstruction = arr[0].helpInstruction + helpList.value = Array.from(new Set(allList.value.filter(item => item.helpInstruction).filter(item => item.equipmentName === ruleForm.value.equipmentName && item.model === newVal).map(item => item.helpInstruction))) + if ((helpList.value.length === 1) && ruleForm.value.model && ruleForm.value.equipmentName) { + const arr = allList.value.filter((item: any) => item.model === ruleForm.value.model && item.equipmentName === ruleForm.value.equipmentName) + // helpList.value = arr + if (arr.length) { + const data = arr[0] + ruleForm.value.category = data.category + // ruleForm.value.remark = data.remark + ruleForm.value.technicalTargetList = data.technicalTargetList + ruleForm.value.checkCycle = data.checkCycle + ruleForm.value.modelId = data.id + ruleForm.value.helpInstruction = arr[0].helpInstruction + } } } - } - else if (newVal) { - helpList.value = Array.from(new Set(allList.value.filter(item => item.helpInstruction).filter(item => item.model === newVal).map(item => item.helpInstruction))).sort() - } - else { - helpList.value = Array.from(new Set(allList.value.filter(item => item.helpInstruction).map(item => item.helpInstruction))).sort() - } + else if (newVal) { + helpList.value = Array.from(new Set(allList.value.filter(item => item.helpInstruction).filter(item => item.model === newVal).map(item => item.helpInstruction))).sort() + } + else { + helpList.value = Array.from(new Set(allList.value.filter(item => item.helpInstruction).map(item => item.helpInstruction))).sort() + } + }) }) + +// watch(() => ruleForm.value.helpInstruction, (newVal) => { +// if (newVal && ruleForm.value.equipmentName && ruleForm.value.model) { +// const arr = allList.value.filter((item: any) => item.model === ruleForm.value.model && item.equipmentName === ruleForm.value.equipmentName && item.helpInstruction === newVal) +// if (arr.length) { +// ruleForm.value.modelId = data.id +// } +// } +// }) // 设备相关,填充数据 watch(() => ruleForm.value, (newVal, oldVal) => { if ($route.path.includes('detail') || isFrist.value) { @@ -399,6 +411,7 @@ } getuser() // 弹窗初始化 +const directorId = ref() const initDialog = () => { dialogStatus.value = $route.params.type as string || 'detail' ruleFormRef.value?.resetFields() @@ -483,6 +496,7 @@ ruleForm.value.createUserName = userStore.name ruleForm.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间 } + directorId.value = ruleForm.value.directorId openSubmission() fetchDept() }) @@ -490,6 +504,7 @@ else { getApprovalDetail({ id: $route.query.id as string }).then((res) => { ruleForm.value = res.data + directorId.value = ruleForm.value.directorId openSubmission() fetchDept() }) @@ -536,6 +551,9 @@ // 特种设备 ruleForm.value.certificateList = certificateRef.value.list } + if (!$route.path.includes('detail') && ruleForm.value.directorId !== directorId.value) { + ruleForm.value.directorName = userList.value.filter((item: { id: string }) => item.id === ruleForm.value.directorId)[0]?.name + } // 计量室需要具备对受检设备中设备信息变更的权限,不走审批流,但是要留下变更记录 if ($route.path.includes('update') && userStore.deptName.includes('计量室')) { editInfoNoApproval(ruleForm.value).then((res) => { diff --git a/src/views/tested/device/info/components/infoTable.vue b/src/views/tested/device/info/components/infoTable.vue index 0b98060..c654641 100644 --- a/src/views/tested/device/info/components/infoTable.vue +++ b/src/views/tested/device/info/components/infoTable.vue @@ -15,12 +15,14 @@ value: 'operateUserName', required: true, isSelect: false, // 是否下拉框 + width: '180', }, { text: '变更时间', value: 'operateTime', required: true, isSelect: false, // 是否下拉框 + width: '180', }, { text: '变更内容', @@ -112,7 +114,7 @@