diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 9f8c8ff..9214173 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -1166,6 +1166,56 @@ }, children: [ { + path: '/post', + component: Layout, + redirect: '/post/postlist', + name: 'PostManage', + meta: { + title: '岗位管理', + icon: 'ep:key', + auth: '/sys/post', + }, + children: [ + { + path: 'postlist', + name: 'PostList', + component: () => import('@/views/system/post/list.vue'), + meta: { + title: '岗位管理', + auth: '/sys/post', + sidebar: false, + breadcrumb: false, + activeMenu: '/post', + }, + }, + ], + }, + { + path: '/installation', + component: Layout, + redirect: '/installation/installationlist', + name: 'InstallationManage', + meta: { + title: '安装位置管理', + icon: 'ep:key', + auth: '/sys/installation', + }, + children: [ + { + path: 'installationlist', + name: 'InstallationList', + component: () => import('@/views/system/installation/list.vue'), + meta: { + title: '安装位置管理', + auth: '/sys/installation', + sidebar: false, + breadcrumb: false, + activeMenu: '/installation', + }, + }, + ], + }, + { path: '/label', component: Layout, redirect: '/label/labellist', diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 9f8c8ff..9214173 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -1166,6 +1166,56 @@ }, children: [ { + path: '/post', + component: Layout, + redirect: '/post/postlist', + name: 'PostManage', + meta: { + title: '岗位管理', + icon: 'ep:key', + auth: '/sys/post', + }, + children: [ + { + path: 'postlist', + name: 'PostList', + component: () => import('@/views/system/post/list.vue'), + meta: { + title: '岗位管理', + auth: '/sys/post', + sidebar: false, + breadcrumb: false, + activeMenu: '/post', + }, + }, + ], + }, + { + path: '/installation', + component: Layout, + redirect: '/installation/installationlist', + name: 'InstallationManage', + meta: { + title: '安装位置管理', + icon: 'ep:key', + auth: '/sys/installation', + }, + children: [ + { + path: 'installationlist', + name: 'InstallationList', + component: () => import('@/views/system/installation/list.vue'), + meta: { + title: '安装位置管理', + auth: '/sys/installation', + sidebar: false, + breadcrumb: false, + activeMenu: '/installation', + }, + }, + ], + }, + { path: '/label', component: Layout, redirect: '/label/labellist', diff --git a/src/views/system/installation/editDialog.vue b/src/views/system/installation/editDialog.vue new file mode 100644 index 0000000..637c07b --- /dev/null +++ b/src/views/system/installation/editDialog.vue @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 9f8c8ff..9214173 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -1166,6 +1166,56 @@ }, children: [ { + path: '/post', + component: Layout, + redirect: '/post/postlist', + name: 'PostManage', + meta: { + title: '岗位管理', + icon: 'ep:key', + auth: '/sys/post', + }, + children: [ + { + path: 'postlist', + name: 'PostList', + component: () => import('@/views/system/post/list.vue'), + meta: { + title: '岗位管理', + auth: '/sys/post', + sidebar: false, + breadcrumb: false, + activeMenu: '/post', + }, + }, + ], + }, + { + path: '/installation', + component: Layout, + redirect: '/installation/installationlist', + name: 'InstallationManage', + meta: { + title: '安装位置管理', + icon: 'ep:key', + auth: '/sys/installation', + }, + children: [ + { + path: 'installationlist', + name: 'InstallationList', + component: () => import('@/views/system/installation/list.vue'), + meta: { + title: '安装位置管理', + auth: '/sys/installation', + sidebar: false, + breadcrumb: false, + activeMenu: '/installation', + }, + }, + ], + }, + { path: '/label', component: Layout, redirect: '/label/labellist', diff --git a/src/views/system/installation/editDialog.vue b/src/views/system/installation/editDialog.vue new file mode 100644 index 0000000..637c07b --- /dev/null +++ b/src/views/system/installation/editDialog.vue @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue new file mode 100644 index 0000000..0eec641 --- /dev/null +++ b/src/views/system/installation/list.vue @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 9f8c8ff..9214173 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -1166,6 +1166,56 @@ }, children: [ { + path: '/post', + component: Layout, + redirect: '/post/postlist', + name: 'PostManage', + meta: { + title: '岗位管理', + icon: 'ep:key', + auth: '/sys/post', + }, + children: [ + { + path: 'postlist', + name: 'PostList', + component: () => import('@/views/system/post/list.vue'), + meta: { + title: '岗位管理', + auth: '/sys/post', + sidebar: false, + breadcrumb: false, + activeMenu: '/post', + }, + }, + ], + }, + { + path: '/installation', + component: Layout, + redirect: '/installation/installationlist', + name: 'InstallationManage', + meta: { + title: '安装位置管理', + icon: 'ep:key', + auth: '/sys/installation', + }, + children: [ + { + path: 'installationlist', + name: 'InstallationList', + component: () => import('@/views/system/installation/list.vue'), + meta: { + title: '安装位置管理', + auth: '/sys/installation', + sidebar: false, + breadcrumb: false, + activeMenu: '/installation', + }, + }, + ], + }, + { path: '/label', component: Layout, redirect: '/label/labellist', diff --git a/src/views/system/installation/editDialog.vue b/src/views/system/installation/editDialog.vue new file mode 100644 index 0000000..637c07b --- /dev/null +++ b/src/views/system/installation/editDialog.vue @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue new file mode 100644 index 0000000..0eec641 --- /dev/null +++ b/src/views/system/installation/list.vue @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/views/system/post/editDialog.vue b/src/views/system/post/editDialog.vue new file mode 100644 index 0000000..b38e652 --- /dev/null +++ b/src/views/system/post/editDialog.vue @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 9f8c8ff..9214173 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -1166,6 +1166,56 @@ }, children: [ { + path: '/post', + component: Layout, + redirect: '/post/postlist', + name: 'PostManage', + meta: { + title: '岗位管理', + icon: 'ep:key', + auth: '/sys/post', + }, + children: [ + { + path: 'postlist', + name: 'PostList', + component: () => import('@/views/system/post/list.vue'), + meta: { + title: '岗位管理', + auth: '/sys/post', + sidebar: false, + breadcrumb: false, + activeMenu: '/post', + }, + }, + ], + }, + { + path: '/installation', + component: Layout, + redirect: '/installation/installationlist', + name: 'InstallationManage', + meta: { + title: '安装位置管理', + icon: 'ep:key', + auth: '/sys/installation', + }, + children: [ + { + path: 'installationlist', + name: 'InstallationList', + component: () => import('@/views/system/installation/list.vue'), + meta: { + title: '安装位置管理', + auth: '/sys/installation', + sidebar: false, + breadcrumb: false, + activeMenu: '/installation', + }, + }, + ], + }, + { path: '/label', component: Layout, redirect: '/label/labellist', diff --git a/src/views/system/installation/editDialog.vue b/src/views/system/installation/editDialog.vue new file mode 100644 index 0000000..637c07b --- /dev/null +++ b/src/views/system/installation/editDialog.vue @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue new file mode 100644 index 0000000..0eec641 --- /dev/null +++ b/src/views/system/installation/list.vue @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/views/system/post/editDialog.vue b/src/views/system/post/editDialog.vue new file mode 100644 index 0000000..b38e652 --- /dev/null +++ b/src/views/system/post/editDialog.vue @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue new file mode 100644 index 0000000..bfbc209 --- /dev/null +++ b/src/views/system/post/list.vue @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 9f8c8ff..9214173 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -1166,6 +1166,56 @@ }, children: [ { + path: '/post', + component: Layout, + redirect: '/post/postlist', + name: 'PostManage', + meta: { + title: '岗位管理', + icon: 'ep:key', + auth: '/sys/post', + }, + children: [ + { + path: 'postlist', + name: 'PostList', + component: () => import('@/views/system/post/list.vue'), + meta: { + title: '岗位管理', + auth: '/sys/post', + sidebar: false, + breadcrumb: false, + activeMenu: '/post', + }, + }, + ], + }, + { + path: '/installation', + component: Layout, + redirect: '/installation/installationlist', + name: 'InstallationManage', + meta: { + title: '安装位置管理', + icon: 'ep:key', + auth: '/sys/installation', + }, + children: [ + { + path: 'installationlist', + name: 'InstallationList', + component: () => import('@/views/system/installation/list.vue'), + meta: { + title: '安装位置管理', + auth: '/sys/installation', + sidebar: false, + breadcrumb: false, + activeMenu: '/installation', + }, + }, + ], + }, + { path: '/label', component: Layout, redirect: '/label/labellist', diff --git a/src/views/system/installation/editDialog.vue b/src/views/system/installation/editDialog.vue new file mode 100644 index 0000000..637c07b --- /dev/null +++ b/src/views/system/installation/editDialog.vue @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue new file mode 100644 index 0000000..0eec641 --- /dev/null +++ b/src/views/system/installation/list.vue @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/views/system/post/editDialog.vue b/src/views/system/post/editDialog.vue new file mode 100644 index 0000000..b38e652 --- /dev/null +++ b/src/views/system/post/editDialog.vue @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue new file mode 100644 index 0000000..bfbc209 --- /dev/null +++ b/src/views/system/post/list.vue @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/views/tested/device/info/components/certificateTable.vue b/src/views/tested/device/info/components/certificateTable.vue index a701125..3b98d41 100644 --- a/src/views/tested/device/info/components/certificateTable.vue +++ b/src/views/tested/device/info/components/certificateTable.vue @@ -180,7 +180,7 @@ *{{ item.text }} - {{ scope.row[item.value] }} + {{ scope.row[item.value] }} - + {{ scope.row[item.value] ? '更换' : '上传' }} diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 9f8c8ff..9214173 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -1166,6 +1166,56 @@ }, children: [ { + path: '/post', + component: Layout, + redirect: '/post/postlist', + name: 'PostManage', + meta: { + title: '岗位管理', + icon: 'ep:key', + auth: '/sys/post', + }, + children: [ + { + path: 'postlist', + name: 'PostList', + component: () => import('@/views/system/post/list.vue'), + meta: { + title: '岗位管理', + auth: '/sys/post', + sidebar: false, + breadcrumb: false, + activeMenu: '/post', + }, + }, + ], + }, + { + path: '/installation', + component: Layout, + redirect: '/installation/installationlist', + name: 'InstallationManage', + meta: { + title: '安装位置管理', + icon: 'ep:key', + auth: '/sys/installation', + }, + children: [ + { + path: 'installationlist', + name: 'InstallationList', + component: () => import('@/views/system/installation/list.vue'), + meta: { + title: '安装位置管理', + auth: '/sys/installation', + sidebar: false, + breadcrumb: false, + activeMenu: '/installation', + }, + }, + ], + }, + { path: '/label', component: Layout, redirect: '/label/labellist', diff --git a/src/views/system/installation/editDialog.vue b/src/views/system/installation/editDialog.vue new file mode 100644 index 0000000..637c07b --- /dev/null +++ b/src/views/system/installation/editDialog.vue @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue new file mode 100644 index 0000000..0eec641 --- /dev/null +++ b/src/views/system/installation/list.vue @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/views/system/post/editDialog.vue b/src/views/system/post/editDialog.vue new file mode 100644 index 0000000..b38e652 --- /dev/null +++ b/src/views/system/post/editDialog.vue @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue new file mode 100644 index 0000000..bfbc209 --- /dev/null +++ b/src/views/system/post/list.vue @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/views/tested/device/info/components/certificateTable.vue b/src/views/tested/device/info/components/certificateTable.vue index a701125..3b98d41 100644 --- a/src/views/tested/device/info/components/certificateTable.vue +++ b/src/views/tested/device/info/components/certificateTable.vue @@ -180,7 +180,7 @@ *{{ item.text }} - {{ scope.row[item.value] }} + {{ scope.row[item.value] }} - + {{ scope.row[item.value] ? '更换' : '上传' }} diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index a1f4561..81adc08 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -101,7 +101,10 @@ // 自动填充 证书有效日期 watch(() => ruleForm.value, (newVal) => { if (newVal.checkDate && newVal.checkCycle && !newVal.certificateValid) { - ruleForm.value.certificateValid = dayjs(newVal.checkDate).add(Number(newVal.checkCycle) * 30, 'day').format('YYYY-MM-DD') + // ruleForm.value.certificateValid = dayjs(newVal.checkDate).add(Number(newVal.checkCycle) * 30, 'day').format('YYYY-MM-DD') + const date = dayjs(newVal.checkDate).add(Number(newVal.checkCycle) * 30, 'day').format('YYYY-MM') + const day = Number(newVal.checkDate.split('-')[2]) <= 1 ? Number(newVal.checkDate.split('-')[2]) : Number(newVal.checkDate.split('-')[2]) - 1 + ruleForm.value.certificateValid = dayjs(`${date}-${day}`).format('YYYY-MM-DD') } }, { deep: true, @@ -143,6 +146,7 @@ const deviceTypeList = ref<{ id: string; value: string; name: string }[]>() // 设备分类 const inUseList = ref<{ id: string; value: string; name: string }[]>() // 设备在用信息 const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() // 计量标识 +const deviceQualityList = ref<{ id: string; value: string; name: string }[]>() // 质量状况 // 设备名称 const deviceNameList = ref([]) // 规格型号 @@ -150,10 +154,14 @@ // 辅助字段 const helpList = ref([]) const allList = ref([]) -const fetchSelectData = () => { - getDictByCode('eqptDeviceUseStatus').then((res) => { - useStatusList.value = res.data - }) +const fetchSelectData = async () => { + // 规格型号及辅助字段 + const res = await getModelAllList({}) + allList.value = res.data + modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) + helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + const res1 = await getDictByCode('eqptDeviceUseStatus') + useStatusList.value = res1.data getDictByCode('eqptDeviceLevel').then((res) => { levelList.value = res.data }) @@ -166,30 +174,27 @@ getDictByCode('eqptMeterIdentify').then((res) => { meterIdentifyList.value = res.data }) + getDictByCode('eqptDeviceQuality').then((res) => { + deviceQualityList.value = res.data + }) // 设备名称 getDeviceNameList().then((res) => { deviceNameList.value = res.data - }) - // 规格型号及辅助字段 - getModelAllList({}).then((res) => { - allList.value = res.data - modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) - helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + console.log(res.data, '设备名称') }) } -fetchSelectData() // 监听设备名称下拉框,修改规格型号和辅助字段 watch(() => ruleForm.value.equipmentName, (newVal) => { - if ($route.path.includes('detail') || isFrist.value) { - return + if (!($route.path.includes('detail') || isFrist.value)) { + ruleForm.value.helpInstruction = '' + ruleForm.value.model = '' } - ruleForm.value.helpInstruction = '' - ruleForm.value.model = '' if (newVal) { // 修改规格型号和辅助字段列表 const data = allList.value.filter(item => item.equipmentName === newVal) modelList.value = Array.from(new Set(data.filter(item => item.model).map(item => item.model))) helpList.value = Array.from(new Set(data.filter(item => item.helpInstruction).map(item => item.helpInstruction))) + console.log(modelList.value, helpList.value) } else { modelList.value = Array.from(new Set(allList.value.filter(item => item.model).map(item => item.model))) @@ -198,10 +203,9 @@ }) // 监听规格型号下拉框,修改辅助字段 watch(() => ruleForm.value.model, (newVal) => { - if ($route.path.includes('detail') || isFrist.value) { - return + if (!($route.path.includes('detail') || isFrist.value)) { + ruleForm.value.helpInstruction = '' } - ruleForm.value.helpInstruction = '' 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))) @@ -303,7 +307,6 @@ if (statusName === '全部') { getInfoDetail({ equipmentId: $route.query.id as string }).then((res) => { ruleForm.value = res.data - console.log(res.data, 'res.data1111') // if (ruleForm.value.testTask) { // if (ruleForm.value.testTask.includes(',')) { // testTask.value = ruleForm.value.testTask.split(',') @@ -351,7 +354,8 @@ } } } -onMounted(() => { +onMounted(async () => { + await fetchSelectData() initDialog() }) // 关闭弹窗 @@ -705,7 +709,10 @@ --> - + + + + diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 9f8c8ff..9214173 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -1166,6 +1166,56 @@ }, children: [ { + path: '/post', + component: Layout, + redirect: '/post/postlist', + name: 'PostManage', + meta: { + title: '岗位管理', + icon: 'ep:key', + auth: '/sys/post', + }, + children: [ + { + path: 'postlist', + name: 'PostList', + component: () => import('@/views/system/post/list.vue'), + meta: { + title: '岗位管理', + auth: '/sys/post', + sidebar: false, + breadcrumb: false, + activeMenu: '/post', + }, + }, + ], + }, + { + path: '/installation', + component: Layout, + redirect: '/installation/installationlist', + name: 'InstallationManage', + meta: { + title: '安装位置管理', + icon: 'ep:key', + auth: '/sys/installation', + }, + children: [ + { + path: 'installationlist', + name: 'InstallationList', + component: () => import('@/views/system/installation/list.vue'), + meta: { + title: '安装位置管理', + auth: '/sys/installation', + sidebar: false, + breadcrumb: false, + activeMenu: '/installation', + }, + }, + ], + }, + { path: '/label', component: Layout, redirect: '/label/labellist', diff --git a/src/views/system/installation/editDialog.vue b/src/views/system/installation/editDialog.vue new file mode 100644 index 0000000..637c07b --- /dev/null +++ b/src/views/system/installation/editDialog.vue @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue new file mode 100644 index 0000000..0eec641 --- /dev/null +++ b/src/views/system/installation/list.vue @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/views/system/post/editDialog.vue b/src/views/system/post/editDialog.vue new file mode 100644 index 0000000..b38e652 --- /dev/null +++ b/src/views/system/post/editDialog.vue @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue new file mode 100644 index 0000000..bfbc209 --- /dev/null +++ b/src/views/system/post/list.vue @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/views/tested/device/info/components/certificateTable.vue b/src/views/tested/device/info/components/certificateTable.vue index a701125..3b98d41 100644 --- a/src/views/tested/device/info/components/certificateTable.vue +++ b/src/views/tested/device/info/components/certificateTable.vue @@ -180,7 +180,7 @@ *{{ item.text }} - {{ scope.row[item.value] }} + {{ scope.row[item.value] }} - + {{ scope.row[item.value] ? '更换' : '上传' }} diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index a1f4561..81adc08 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -101,7 +101,10 @@ // 自动填充 证书有效日期 watch(() => ruleForm.value, (newVal) => { if (newVal.checkDate && newVal.checkCycle && !newVal.certificateValid) { - ruleForm.value.certificateValid = dayjs(newVal.checkDate).add(Number(newVal.checkCycle) * 30, 'day').format('YYYY-MM-DD') + // ruleForm.value.certificateValid = dayjs(newVal.checkDate).add(Number(newVal.checkCycle) * 30, 'day').format('YYYY-MM-DD') + const date = dayjs(newVal.checkDate).add(Number(newVal.checkCycle) * 30, 'day').format('YYYY-MM') + const day = Number(newVal.checkDate.split('-')[2]) <= 1 ? Number(newVal.checkDate.split('-')[2]) : Number(newVal.checkDate.split('-')[2]) - 1 + ruleForm.value.certificateValid = dayjs(`${date}-${day}`).format('YYYY-MM-DD') } }, { deep: true, @@ -143,6 +146,7 @@ const deviceTypeList = ref<{ id: string; value: string; name: string }[]>() // 设备分类 const inUseList = ref<{ id: string; value: string; name: string }[]>() // 设备在用信息 const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() // 计量标识 +const deviceQualityList = ref<{ id: string; value: string; name: string }[]>() // 质量状况 // 设备名称 const deviceNameList = ref([]) // 规格型号 @@ -150,10 +154,14 @@ // 辅助字段 const helpList = ref([]) const allList = ref([]) -const fetchSelectData = () => { - getDictByCode('eqptDeviceUseStatus').then((res) => { - useStatusList.value = res.data - }) +const fetchSelectData = async () => { + // 规格型号及辅助字段 + const res = await getModelAllList({}) + allList.value = res.data + modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) + helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + const res1 = await getDictByCode('eqptDeviceUseStatus') + useStatusList.value = res1.data getDictByCode('eqptDeviceLevel').then((res) => { levelList.value = res.data }) @@ -166,30 +174,27 @@ getDictByCode('eqptMeterIdentify').then((res) => { meterIdentifyList.value = res.data }) + getDictByCode('eqptDeviceQuality').then((res) => { + deviceQualityList.value = res.data + }) // 设备名称 getDeviceNameList().then((res) => { deviceNameList.value = res.data - }) - // 规格型号及辅助字段 - getModelAllList({}).then((res) => { - allList.value = res.data - modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) - helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + console.log(res.data, '设备名称') }) } -fetchSelectData() // 监听设备名称下拉框,修改规格型号和辅助字段 watch(() => ruleForm.value.equipmentName, (newVal) => { - if ($route.path.includes('detail') || isFrist.value) { - return + if (!($route.path.includes('detail') || isFrist.value)) { + ruleForm.value.helpInstruction = '' + ruleForm.value.model = '' } - ruleForm.value.helpInstruction = '' - ruleForm.value.model = '' if (newVal) { // 修改规格型号和辅助字段列表 const data = allList.value.filter(item => item.equipmentName === newVal) modelList.value = Array.from(new Set(data.filter(item => item.model).map(item => item.model))) helpList.value = Array.from(new Set(data.filter(item => item.helpInstruction).map(item => item.helpInstruction))) + console.log(modelList.value, helpList.value) } else { modelList.value = Array.from(new Set(allList.value.filter(item => item.model).map(item => item.model))) @@ -198,10 +203,9 @@ }) // 监听规格型号下拉框,修改辅助字段 watch(() => ruleForm.value.model, (newVal) => { - if ($route.path.includes('detail') || isFrist.value) { - return + if (!($route.path.includes('detail') || isFrist.value)) { + ruleForm.value.helpInstruction = '' } - ruleForm.value.helpInstruction = '' 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))) @@ -303,7 +307,6 @@ if (statusName === '全部') { getInfoDetail({ equipmentId: $route.query.id as string }).then((res) => { ruleForm.value = res.data - console.log(res.data, 'res.data1111') // if (ruleForm.value.testTask) { // if (ruleForm.value.testTask.includes(',')) { // testTask.value = ruleForm.value.testTask.split(',') @@ -351,7 +354,8 @@ } } } -onMounted(() => { +onMounted(async () => { + await fetchSelectData() initDialog() }) // 关闭弹窗 @@ -705,7 +709,10 @@ --> - + + + + diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index 3045f69..3c07855 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -33,6 +33,8 @@ 未通过: '5', 已取消: '6', }) +// 切换表格标识 true:普通表格 false:聚合表格 +const tableFlage = ref(true) const normalTableRef = ref() const { proxy } = getCurrentInstance() as any const listQuery = reactive({ @@ -143,8 +145,18 @@ align: 'center', }, ]) -// 切换表格标识 true:普通表格 false:聚合表格 -const tableFlage = ref(true) +const togetherColums = ref([ + { + text: '设备名称', + value: 'equipmentName', + align: 'center', + }, + { + text: '数量', + value: 'count', + align: 'center', + }, +]) // 聚合表格实例 const togetherTableRef = ref() // 展开表格实例 @@ -243,10 +255,6 @@ modelList.value = Array.from(new Set(allList.value.filter(item => item.model).map(item => item.model))) } }) -// 查询数据 -const search = () => { - fetchData(false) -} // 证书有效期开始结束时间 const datetimerange = ref() watch(() => datetimerange.value, (newVal) => { @@ -271,7 +279,7 @@ } }) // 重置 -const reset = () => { +const reset = (refresh = true) => { datetimerange.value = [] datetimerange1.value = [] listQuery.equipmentNo = '' @@ -297,7 +305,9 @@ modelList.value = Array.from(new Set(allList.value.filter(item => item.model).map(item => item.model))) listQuery.offset = 1 listQuery.limit = 20 - search() + if (refresh) { + search() + } } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size: number; page: number }) => { @@ -344,6 +354,19 @@ const getRowKeys = (row: any) => { // 获取当前行id return row.equipmentName // 这里看这一行中需要根据哪个属性值是id } +// 查询数据 +function search() { + if (tableFlage.value) { + // 普通表格 + fetchData(false) + } + else { + // 聚合表格 + // if (listQuery.equipmentName) { + // togetherList.value = togetherList.value.filter((item: any) => item.equipmentName.includes(listQuery.equipmentName)) + // } + } +} // 监听聚合表格多选 // watch(() => togetherTableRef.value?.getSelectionRows(), (newVal, oldVal) => { // console.log(newVal, 'newVal') @@ -642,6 +665,7 @@ const changeTable = () => { tableFlage.value = !tableFlage.value + reset(false) if (tableFlage.value) { // 获取普通表格数据 fetchData() @@ -837,16 +861,16 @@ - + --> - + diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 9f8c8ff..9214173 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -1166,6 +1166,56 @@ }, children: [ { + path: '/post', + component: Layout, + redirect: '/post/postlist', + name: 'PostManage', + meta: { + title: '岗位管理', + icon: 'ep:key', + auth: '/sys/post', + }, + children: [ + { + path: 'postlist', + name: 'PostList', + component: () => import('@/views/system/post/list.vue'), + meta: { + title: '岗位管理', + auth: '/sys/post', + sidebar: false, + breadcrumb: false, + activeMenu: '/post', + }, + }, + ], + }, + { + path: '/installation', + component: Layout, + redirect: '/installation/installationlist', + name: 'InstallationManage', + meta: { + title: '安装位置管理', + icon: 'ep:key', + auth: '/sys/installation', + }, + children: [ + { + path: 'installationlist', + name: 'InstallationList', + component: () => import('@/views/system/installation/list.vue'), + meta: { + title: '安装位置管理', + auth: '/sys/installation', + sidebar: false, + breadcrumb: false, + activeMenu: '/installation', + }, + }, + ], + }, + { path: '/label', component: Layout, redirect: '/label/labellist', diff --git a/src/views/system/installation/editDialog.vue b/src/views/system/installation/editDialog.vue new file mode 100644 index 0000000..637c07b --- /dev/null +++ b/src/views/system/installation/editDialog.vue @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue new file mode 100644 index 0000000..0eec641 --- /dev/null +++ b/src/views/system/installation/list.vue @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/views/system/post/editDialog.vue b/src/views/system/post/editDialog.vue new file mode 100644 index 0000000..b38e652 --- /dev/null +++ b/src/views/system/post/editDialog.vue @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue new file mode 100644 index 0000000..bfbc209 --- /dev/null +++ b/src/views/system/post/list.vue @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/views/tested/device/info/components/certificateTable.vue b/src/views/tested/device/info/components/certificateTable.vue index a701125..3b98d41 100644 --- a/src/views/tested/device/info/components/certificateTable.vue +++ b/src/views/tested/device/info/components/certificateTable.vue @@ -180,7 +180,7 @@ *{{ item.text }} - {{ scope.row[item.value] }} + {{ scope.row[item.value] }} - + {{ scope.row[item.value] ? '更换' : '上传' }} diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index a1f4561..81adc08 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -101,7 +101,10 @@ // 自动填充 证书有效日期 watch(() => ruleForm.value, (newVal) => { if (newVal.checkDate && newVal.checkCycle && !newVal.certificateValid) { - ruleForm.value.certificateValid = dayjs(newVal.checkDate).add(Number(newVal.checkCycle) * 30, 'day').format('YYYY-MM-DD') + // ruleForm.value.certificateValid = dayjs(newVal.checkDate).add(Number(newVal.checkCycle) * 30, 'day').format('YYYY-MM-DD') + const date = dayjs(newVal.checkDate).add(Number(newVal.checkCycle) * 30, 'day').format('YYYY-MM') + const day = Number(newVal.checkDate.split('-')[2]) <= 1 ? Number(newVal.checkDate.split('-')[2]) : Number(newVal.checkDate.split('-')[2]) - 1 + ruleForm.value.certificateValid = dayjs(`${date}-${day}`).format('YYYY-MM-DD') } }, { deep: true, @@ -143,6 +146,7 @@ const deviceTypeList = ref<{ id: string; value: string; name: string }[]>() // 设备分类 const inUseList = ref<{ id: string; value: string; name: string }[]>() // 设备在用信息 const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() // 计量标识 +const deviceQualityList = ref<{ id: string; value: string; name: string }[]>() // 质量状况 // 设备名称 const deviceNameList = ref([]) // 规格型号 @@ -150,10 +154,14 @@ // 辅助字段 const helpList = ref([]) const allList = ref([]) -const fetchSelectData = () => { - getDictByCode('eqptDeviceUseStatus').then((res) => { - useStatusList.value = res.data - }) +const fetchSelectData = async () => { + // 规格型号及辅助字段 + const res = await getModelAllList({}) + allList.value = res.data + modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) + helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + const res1 = await getDictByCode('eqptDeviceUseStatus') + useStatusList.value = res1.data getDictByCode('eqptDeviceLevel').then((res) => { levelList.value = res.data }) @@ -166,30 +174,27 @@ getDictByCode('eqptMeterIdentify').then((res) => { meterIdentifyList.value = res.data }) + getDictByCode('eqptDeviceQuality').then((res) => { + deviceQualityList.value = res.data + }) // 设备名称 getDeviceNameList().then((res) => { deviceNameList.value = res.data - }) - // 规格型号及辅助字段 - getModelAllList({}).then((res) => { - allList.value = res.data - modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) - helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + console.log(res.data, '设备名称') }) } -fetchSelectData() // 监听设备名称下拉框,修改规格型号和辅助字段 watch(() => ruleForm.value.equipmentName, (newVal) => { - if ($route.path.includes('detail') || isFrist.value) { - return + if (!($route.path.includes('detail') || isFrist.value)) { + ruleForm.value.helpInstruction = '' + ruleForm.value.model = '' } - ruleForm.value.helpInstruction = '' - ruleForm.value.model = '' if (newVal) { // 修改规格型号和辅助字段列表 const data = allList.value.filter(item => item.equipmentName === newVal) modelList.value = Array.from(new Set(data.filter(item => item.model).map(item => item.model))) helpList.value = Array.from(new Set(data.filter(item => item.helpInstruction).map(item => item.helpInstruction))) + console.log(modelList.value, helpList.value) } else { modelList.value = Array.from(new Set(allList.value.filter(item => item.model).map(item => item.model))) @@ -198,10 +203,9 @@ }) // 监听规格型号下拉框,修改辅助字段 watch(() => ruleForm.value.model, (newVal) => { - if ($route.path.includes('detail') || isFrist.value) { - return + if (!($route.path.includes('detail') || isFrist.value)) { + ruleForm.value.helpInstruction = '' } - ruleForm.value.helpInstruction = '' 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))) @@ -303,7 +307,6 @@ if (statusName === '全部') { getInfoDetail({ equipmentId: $route.query.id as string }).then((res) => { ruleForm.value = res.data - console.log(res.data, 'res.data1111') // if (ruleForm.value.testTask) { // if (ruleForm.value.testTask.includes(',')) { // testTask.value = ruleForm.value.testTask.split(',') @@ -351,7 +354,8 @@ } } } -onMounted(() => { +onMounted(async () => { + await fetchSelectData() initDialog() }) // 关闭弹窗 @@ -705,7 +709,10 @@ --> - + + + + diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index 3045f69..3c07855 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -33,6 +33,8 @@ 未通过: '5', 已取消: '6', }) +// 切换表格标识 true:普通表格 false:聚合表格 +const tableFlage = ref(true) const normalTableRef = ref() const { proxy } = getCurrentInstance() as any const listQuery = reactive({ @@ -143,8 +145,18 @@ align: 'center', }, ]) -// 切换表格标识 true:普通表格 false:聚合表格 -const tableFlage = ref(true) +const togetherColums = ref([ + { + text: '设备名称', + value: 'equipmentName', + align: 'center', + }, + { + text: '数量', + value: 'count', + align: 'center', + }, +]) // 聚合表格实例 const togetherTableRef = ref() // 展开表格实例 @@ -243,10 +255,6 @@ modelList.value = Array.from(new Set(allList.value.filter(item => item.model).map(item => item.model))) } }) -// 查询数据 -const search = () => { - fetchData(false) -} // 证书有效期开始结束时间 const datetimerange = ref() watch(() => datetimerange.value, (newVal) => { @@ -271,7 +279,7 @@ } }) // 重置 -const reset = () => { +const reset = (refresh = true) => { datetimerange.value = [] datetimerange1.value = [] listQuery.equipmentNo = '' @@ -297,7 +305,9 @@ modelList.value = Array.from(new Set(allList.value.filter(item => item.model).map(item => item.model))) listQuery.offset = 1 listQuery.limit = 20 - search() + if (refresh) { + search() + } } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size: number; page: number }) => { @@ -344,6 +354,19 @@ const getRowKeys = (row: any) => { // 获取当前行id return row.equipmentName // 这里看这一行中需要根据哪个属性值是id } +// 查询数据 +function search() { + if (tableFlage.value) { + // 普通表格 + fetchData(false) + } + else { + // 聚合表格 + // if (listQuery.equipmentName) { + // togetherList.value = togetherList.value.filter((item: any) => item.equipmentName.includes(listQuery.equipmentName)) + // } + } +} // 监听聚合表格多选 // watch(() => togetherTableRef.value?.getSelectionRows(), (newVal, oldVal) => { // console.log(newVal, 'newVal') @@ -642,6 +665,7 @@ const changeTable = () => { tableFlage.value = !tableFlage.value + reset(false) if (tableFlage.value) { // 获取普通表格数据 fetchData() @@ -837,16 +861,16 @@ - + --> - + diff --git a/src/views/tested/device/info/components/reportTable.vue b/src/views/tested/device/info/components/reportTable.vue index e98dfe1..fb70439 100644 --- a/src/views/tested/device/info/components/reportTable.vue +++ b/src/views/tested/device/info/components/reportTable.vue @@ -1,5 +1,6 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue new file mode 100644 index 0000000..0eec641 --- /dev/null +++ b/src/views/system/installation/list.vue @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/views/system/post/editDialog.vue b/src/views/system/post/editDialog.vue new file mode 100644 index 0000000..b38e652 --- /dev/null +++ b/src/views/system/post/editDialog.vue @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue new file mode 100644 index 0000000..bfbc209 --- /dev/null +++ b/src/views/system/post/list.vue @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + diff --git a/src/views/tested/device/info/components/certificateTable.vue b/src/views/tested/device/info/components/certificateTable.vue index a701125..3b98d41 100644 --- a/src/views/tested/device/info/components/certificateTable.vue +++ b/src/views/tested/device/info/components/certificateTable.vue @@ -180,7 +180,7 @@ *{{ item.text }} - {{ scope.row[item.value] }} + {{ scope.row[item.value] }} - + {{ scope.row[item.value] ? '更换' : '上传' }} diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index a1f4561..81adc08 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -101,7 +101,10 @@ // 自动填充 证书有效日期 watch(() => ruleForm.value, (newVal) => { if (newVal.checkDate && newVal.checkCycle && !newVal.certificateValid) { - ruleForm.value.certificateValid = dayjs(newVal.checkDate).add(Number(newVal.checkCycle) * 30, 'day').format('YYYY-MM-DD') + // ruleForm.value.certificateValid = dayjs(newVal.checkDate).add(Number(newVal.checkCycle) * 30, 'day').format('YYYY-MM-DD') + const date = dayjs(newVal.checkDate).add(Number(newVal.checkCycle) * 30, 'day').format('YYYY-MM') + const day = Number(newVal.checkDate.split('-')[2]) <= 1 ? Number(newVal.checkDate.split('-')[2]) : Number(newVal.checkDate.split('-')[2]) - 1 + ruleForm.value.certificateValid = dayjs(`${date}-${day}`).format('YYYY-MM-DD') } }, { deep: true, @@ -143,6 +146,7 @@ const deviceTypeList = ref<{ id: string; value: string; name: string }[]>() // 设备分类 const inUseList = ref<{ id: string; value: string; name: string }[]>() // 设备在用信息 const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>() // 计量标识 +const deviceQualityList = ref<{ id: string; value: string; name: string }[]>() // 质量状况 // 设备名称 const deviceNameList = ref([]) // 规格型号 @@ -150,10 +154,14 @@ // 辅助字段 const helpList = ref([]) const allList = ref([]) -const fetchSelectData = () => { - getDictByCode('eqptDeviceUseStatus').then((res) => { - useStatusList.value = res.data - }) +const fetchSelectData = async () => { + // 规格型号及辅助字段 + const res = await getModelAllList({}) + allList.value = res.data + modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) + helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + const res1 = await getDictByCode('eqptDeviceUseStatus') + useStatusList.value = res1.data getDictByCode('eqptDeviceLevel').then((res) => { levelList.value = res.data }) @@ -166,30 +174,27 @@ getDictByCode('eqptMeterIdentify').then((res) => { meterIdentifyList.value = res.data }) + getDictByCode('eqptDeviceQuality').then((res) => { + deviceQualityList.value = res.data + }) // 设备名称 getDeviceNameList().then((res) => { deviceNameList.value = res.data - }) - // 规格型号及辅助字段 - getModelAllList({}).then((res) => { - allList.value = res.data - modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) - helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + console.log(res.data, '设备名称') }) } -fetchSelectData() // 监听设备名称下拉框,修改规格型号和辅助字段 watch(() => ruleForm.value.equipmentName, (newVal) => { - if ($route.path.includes('detail') || isFrist.value) { - return + if (!($route.path.includes('detail') || isFrist.value)) { + ruleForm.value.helpInstruction = '' + ruleForm.value.model = '' } - ruleForm.value.helpInstruction = '' - ruleForm.value.model = '' if (newVal) { // 修改规格型号和辅助字段列表 const data = allList.value.filter(item => item.equipmentName === newVal) modelList.value = Array.from(new Set(data.filter(item => item.model).map(item => item.model))) helpList.value = Array.from(new Set(data.filter(item => item.helpInstruction).map(item => item.helpInstruction))) + console.log(modelList.value, helpList.value) } else { modelList.value = Array.from(new Set(allList.value.filter(item => item.model).map(item => item.model))) @@ -198,10 +203,9 @@ }) // 监听规格型号下拉框,修改辅助字段 watch(() => ruleForm.value.model, (newVal) => { - if ($route.path.includes('detail') || isFrist.value) { - return + if (!($route.path.includes('detail') || isFrist.value)) { + ruleForm.value.helpInstruction = '' } - ruleForm.value.helpInstruction = '' 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))) @@ -303,7 +307,6 @@ if (statusName === '全部') { getInfoDetail({ equipmentId: $route.query.id as string }).then((res) => { ruleForm.value = res.data - console.log(res.data, 'res.data1111') // if (ruleForm.value.testTask) { // if (ruleForm.value.testTask.includes(',')) { // testTask.value = ruleForm.value.testTask.split(',') @@ -351,7 +354,8 @@ } } } -onMounted(() => { +onMounted(async () => { + await fetchSelectData() initDialog() }) // 关闭弹窗 @@ -705,7 +709,10 @@ --> - + + + + diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index 3045f69..3c07855 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -33,6 +33,8 @@ 未通过: '5', 已取消: '6', }) +// 切换表格标识 true:普通表格 false:聚合表格 +const tableFlage = ref(true) const normalTableRef = ref() const { proxy } = getCurrentInstance() as any const listQuery = reactive({ @@ -143,8 +145,18 @@ align: 'center', }, ]) -// 切换表格标识 true:普通表格 false:聚合表格 -const tableFlage = ref(true) +const togetherColums = ref([ + { + text: '设备名称', + value: 'equipmentName', + align: 'center', + }, + { + text: '数量', + value: 'count', + align: 'center', + }, +]) // 聚合表格实例 const togetherTableRef = ref() // 展开表格实例 @@ -243,10 +255,6 @@ modelList.value = Array.from(new Set(allList.value.filter(item => item.model).map(item => item.model))) } }) -// 查询数据 -const search = () => { - fetchData(false) -} // 证书有效期开始结束时间 const datetimerange = ref() watch(() => datetimerange.value, (newVal) => { @@ -271,7 +279,7 @@ } }) // 重置 -const reset = () => { +const reset = (refresh = true) => { datetimerange.value = [] datetimerange1.value = [] listQuery.equipmentNo = '' @@ -297,7 +305,9 @@ modelList.value = Array.from(new Set(allList.value.filter(item => item.model).map(item => item.model))) listQuery.offset = 1 listQuery.limit = 20 - search() + if (refresh) { + search() + } } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size: number; page: number }) => { @@ -344,6 +354,19 @@ const getRowKeys = (row: any) => { // 获取当前行id return row.equipmentName // 这里看这一行中需要根据哪个属性值是id } +// 查询数据 +function search() { + if (tableFlage.value) { + // 普通表格 + fetchData(false) + } + else { + // 聚合表格 + // if (listQuery.equipmentName) { + // togetherList.value = togetherList.value.filter((item: any) => item.equipmentName.includes(listQuery.equipmentName)) + // } + } +} // 监听聚合表格多选 // watch(() => togetherTableRef.value?.getSelectionRows(), (newVal, oldVal) => { // console.log(newVal, 'newVal') @@ -642,6 +665,7 @@ const changeTable = () => { tableFlage.value = !tableFlage.value + reset(false) if (tableFlage.value) { // 获取普通表格数据 fetchData() @@ -837,16 +861,16 @@ - + --> - + diff --git a/src/views/tested/device/info/components/reportTable.vue b/src/views/tested/device/info/components/reportTable.vue index e98dfe1..fb70439 100644 --- a/src/views/tested/device/info/components/reportTable.vue +++ b/src/views/tested/device/info/components/reportTable.vue @@ -1,5 +1,6 @@