diff --git a/src/views/business/lab/deptMeasure/deptMeasureList.vue b/src/views/business/lab/deptMeasure/deptMeasureList.vue index 4d1b5c0..72623a6 100644 --- a/src/views/business/lab/deptMeasure/deptMeasureList.vue +++ b/src/views/business/lab/deptMeasure/deptMeasureList.vue @@ -6,46 +6,44 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import RollbackDialog from './../components/rollbackDialog.vue' import DistributeDialog from './../components/distributeDialog.vue' -import type { ITaskList, ITaskQuery } from '@/views/business/schedule/task/task-interface' +import type { ILabQuery, ITaskList, ITaskQuery } from '@/views/business/schedule/task/task-interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import { printJSON } from '@/utils/printUtils' import { exportFile } from '@/utils/exportUtils' import { getDictByCode } from '@/api/system/dict' -import { exportTaskList, getTaskList } from '@/api/business/task' +import { exportTaskList, getDeptMeasureList, getTaskList } from '@/api/business/task' import type { dictType } from '@/global' const { proxy } = getCurrentInstance() as any const $router = useRouter() // 右上角按钮 const menus = [ - { name: '待检测', value: '1' }, + { name: '待检测', value: '2' }, { name: '检测中', value: '3' }, { name: '检测完', value: '4' }, ] -const currentMenu = ref('1') // 当前选中状态 +const currentMenu = ref('2') // 当前选中状态 // 查询条件 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) -const listQuery: Ref = ref({ +const listQuery: Ref = ref({ sampleNo: '', // 样品编号 sampleName: '', // 样品名称 orderNo: '', // 委托书编号 customerNo: '', // 委托方代码 customerName: '', // 委托方名称 isUrgent: '', // 是否加急 - sampleAttr: '', // 样品属性 + sampleBelong: '', // 样品属性 startTime: '', // 应检完时间-开始 endTime: '', // 应检完时间-结束 - sendState: '1', // 分发状态 - outState: '', // 超期状态 - formId: 'jlglsygfsp', // 任务分发formId + measureStatus: '2', // 检测状态 offset: 1, limit: 20, }) // --------------获取所需字典值---------------- -const sampleAttrList = ref([]) // 样品属性列表 +const sampleBelongList = ref([]) // 样品属性列表 function getDict() { // 获取样品属性 getDictByCode('sampleBelong').then((response) => { - sampleAttrList.value = response.data + sampleBelongList.value = response.data }) } getDict() @@ -59,9 +57,9 @@ { text: '委托书编号', value: 'orderNo', align: 'center' }, { text: '委托方代码', value: 'customerNo', align: 'center' }, { text: '委托方名称', value: 'customerName', align: 'center' }, - { text: '是否加急', value: 'isUrgent', align: 'center', width: '55px', filter: (row: ITaskList) => { return row.isUrgent == '1' ? '是' : '否' }, styleFilter: (row: ITaskList) => { return row.isUrgent == '1' ? 'color: red' : '' } }, + { text: '是否加急', value: 'isUrgentName', align: 'center', width: '55px', styleFilter: (row: ITaskList) => { return row.isUrgentName == '是' ? 'color: red' : '' } }, { text: '应检完时间', value: 'requireOverTime', align: 'center', width: '110px' }, - { text: '样品属性', value: 'sampleAttrName', align: 'center' }, + { text: '样品属性', value: 'sampleBelongName', align: 'center' }, { text: '当前检定环节', value: 'currentMeasureStateName', align: 'center', width: '80px' }, // { text: '证书出具', value: 'certificationState', align: 'center', filter: (row: ITaskList) => { return `${row.currentCertifications}/${row.requireCertifications}` } }, ]) @@ -81,18 +79,14 @@ // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } - // 模拟数据 - list.value = [ - { orderId: '1', sampleNo: '1yp123456', sampleName: '压力表', orderNo: 'wtd123456', customerNo: 'kh123456', customerName: '北京无线电测量研究所', isUrgent: '1', sampleAttr: '1', sampleAttrName: '客户样品', sampleModel: 'JBT-011', manufacturingNo: '24432231124', requireOverTime: '2023-02-01', sampleId: '1', currentMeasureState: '1', currentMeasureStateName: '待检测', currentCertifications: 0, requireCertifications: 0, labelBind: '', distributeState: '1', distributeStateName: '初次分发' }, - { orderId: '1', sampleNo: '1yp123457', sampleName: '压力表', orderNo: 'wtd123456', customerNo: 'kh123456', customerName: '北京无线电测量研究所', isUrgent: '0', sampleAttr: '1', sampleAttrName: '客户样品', sampleModel: 'JBT-011', manufacturingNo: '24432231124', requireOverTime: '2023-02-01', sampleId: '1', currentMeasureState: '1', currentMeasureStateName: '待检测', currentCertifications: 0, requireCertifications: 0, labelBind: '', distributeState: '2', distributeStateName: '退回分发' }, - ] - loadingTable.value = false - console.log(listQuery.value) - // getTaskList(listQuery.value).then((response) => { - // list.value = response.data.rows - // total.value = parseInt(response.data.total) - // loadingTable.value = false - // }) + getDeptMeasureList(listQuery.value).then((res) => { + list.value = res.data.rows.map((item: ITaskList) => { + item.isUrgentName = item.isUrgent == 1 ? '是' : '否' + return item + }) + total.value = res.total + loadingTable.value = false + }) } // 多选发生改变时 function handleSelectionChange(e: any) { @@ -112,10 +106,10 @@ customerNo: '', // 委托方代码 customerName: '', // 委托方名称 isUrgent: '', // 是否加急 - sampleAttr: '', // 样品属性 - formId: 'jlglsygfsp', - sendState: '1', // 分发状态 - outState: '', // 超期状态 + sampleBelong: '', // 样品属性 + startTime: '', // 应检完时间-开始 + endTime: '', // 应检完时间-结束 + measureStatus: listQuery.value.measureStatus, // 检测状态 offset: 1, limit: 20, } @@ -228,7 +222,7 @@ // 选择按钮变更 watch(currentMenu, (val: string) => { - listQuery.value.sendState = val + listQuery.value.measureStatus = val fetchData(false) }) @@ -300,14 +294,14 @@ - - + + @@ -321,10 +315,10 @@ 详情 - + 任务分发 - + 退回 diff --git a/src/views/business/lab/deptMeasure/deptMeasureList.vue b/src/views/business/lab/deptMeasure/deptMeasureList.vue index 4d1b5c0..72623a6 100644 --- a/src/views/business/lab/deptMeasure/deptMeasureList.vue +++ b/src/views/business/lab/deptMeasure/deptMeasureList.vue @@ -6,46 +6,44 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import RollbackDialog from './../components/rollbackDialog.vue' import DistributeDialog from './../components/distributeDialog.vue' -import type { ITaskList, ITaskQuery } from '@/views/business/schedule/task/task-interface' +import type { ILabQuery, ITaskList, ITaskQuery } from '@/views/business/schedule/task/task-interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import { printJSON } from '@/utils/printUtils' import { exportFile } from '@/utils/exportUtils' import { getDictByCode } from '@/api/system/dict' -import { exportTaskList, getTaskList } from '@/api/business/task' +import { exportTaskList, getDeptMeasureList, getTaskList } from '@/api/business/task' import type { dictType } from '@/global' const { proxy } = getCurrentInstance() as any const $router = useRouter() // 右上角按钮 const menus = [ - { name: '待检测', value: '1' }, + { name: '待检测', value: '2' }, { name: '检测中', value: '3' }, { name: '检测完', value: '4' }, ] -const currentMenu = ref('1') // 当前选中状态 +const currentMenu = ref('2') // 当前选中状态 // 查询条件 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) -const listQuery: Ref = ref({ +const listQuery: Ref = ref({ sampleNo: '', // 样品编号 sampleName: '', // 样品名称 orderNo: '', // 委托书编号 customerNo: '', // 委托方代码 customerName: '', // 委托方名称 isUrgent: '', // 是否加急 - sampleAttr: '', // 样品属性 + sampleBelong: '', // 样品属性 startTime: '', // 应检完时间-开始 endTime: '', // 应检完时间-结束 - sendState: '1', // 分发状态 - outState: '', // 超期状态 - formId: 'jlglsygfsp', // 任务分发formId + measureStatus: '2', // 检测状态 offset: 1, limit: 20, }) // --------------获取所需字典值---------------- -const sampleAttrList = ref([]) // 样品属性列表 +const sampleBelongList = ref([]) // 样品属性列表 function getDict() { // 获取样品属性 getDictByCode('sampleBelong').then((response) => { - sampleAttrList.value = response.data + sampleBelongList.value = response.data }) } getDict() @@ -59,9 +57,9 @@ { text: '委托书编号', value: 'orderNo', align: 'center' }, { text: '委托方代码', value: 'customerNo', align: 'center' }, { text: '委托方名称', value: 'customerName', align: 'center' }, - { text: '是否加急', value: 'isUrgent', align: 'center', width: '55px', filter: (row: ITaskList) => { return row.isUrgent == '1' ? '是' : '否' }, styleFilter: (row: ITaskList) => { return row.isUrgent == '1' ? 'color: red' : '' } }, + { text: '是否加急', value: 'isUrgentName', align: 'center', width: '55px', styleFilter: (row: ITaskList) => { return row.isUrgentName == '是' ? 'color: red' : '' } }, { text: '应检完时间', value: 'requireOverTime', align: 'center', width: '110px' }, - { text: '样品属性', value: 'sampleAttrName', align: 'center' }, + { text: '样品属性', value: 'sampleBelongName', align: 'center' }, { text: '当前检定环节', value: 'currentMeasureStateName', align: 'center', width: '80px' }, // { text: '证书出具', value: 'certificationState', align: 'center', filter: (row: ITaskList) => { return `${row.currentCertifications}/${row.requireCertifications}` } }, ]) @@ -81,18 +79,14 @@ // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } - // 模拟数据 - list.value = [ - { orderId: '1', sampleNo: '1yp123456', sampleName: '压力表', orderNo: 'wtd123456', customerNo: 'kh123456', customerName: '北京无线电测量研究所', isUrgent: '1', sampleAttr: '1', sampleAttrName: '客户样品', sampleModel: 'JBT-011', manufacturingNo: '24432231124', requireOverTime: '2023-02-01', sampleId: '1', currentMeasureState: '1', currentMeasureStateName: '待检测', currentCertifications: 0, requireCertifications: 0, labelBind: '', distributeState: '1', distributeStateName: '初次分发' }, - { orderId: '1', sampleNo: '1yp123457', sampleName: '压力表', orderNo: 'wtd123456', customerNo: 'kh123456', customerName: '北京无线电测量研究所', isUrgent: '0', sampleAttr: '1', sampleAttrName: '客户样品', sampleModel: 'JBT-011', manufacturingNo: '24432231124', requireOverTime: '2023-02-01', sampleId: '1', currentMeasureState: '1', currentMeasureStateName: '待检测', currentCertifications: 0, requireCertifications: 0, labelBind: '', distributeState: '2', distributeStateName: '退回分发' }, - ] - loadingTable.value = false - console.log(listQuery.value) - // getTaskList(listQuery.value).then((response) => { - // list.value = response.data.rows - // total.value = parseInt(response.data.total) - // loadingTable.value = false - // }) + getDeptMeasureList(listQuery.value).then((res) => { + list.value = res.data.rows.map((item: ITaskList) => { + item.isUrgentName = item.isUrgent == 1 ? '是' : '否' + return item + }) + total.value = res.total + loadingTable.value = false + }) } // 多选发生改变时 function handleSelectionChange(e: any) { @@ -112,10 +106,10 @@ customerNo: '', // 委托方代码 customerName: '', // 委托方名称 isUrgent: '', // 是否加急 - sampleAttr: '', // 样品属性 - formId: 'jlglsygfsp', - sendState: '1', // 分发状态 - outState: '', // 超期状态 + sampleBelong: '', // 样品属性 + startTime: '', // 应检完时间-开始 + endTime: '', // 应检完时间-结束 + measureStatus: listQuery.value.measureStatus, // 检测状态 offset: 1, limit: 20, } @@ -228,7 +222,7 @@ // 选择按钮变更 watch(currentMenu, (val: string) => { - listQuery.value.sendState = val + listQuery.value.measureStatus = val fetchData(false) }) @@ -300,14 +294,14 @@ - - + + @@ -321,10 +315,10 @@ 详情 - + 任务分发 - + 退回 diff --git a/src/views/measure/measureDept/components/addDialog.vue b/src/views/measure/measureDept/components/addDialog.vue index 4eb62ec..9d75cff 100644 --- a/src/views/measure/measureDept/components/addDialog.vue +++ b/src/views/measure/measureDept/components/addDialog.vue @@ -8,6 +8,7 @@ import { getStaffDetail, getStaffList } from '@/api/measure/person' import type { userType } from '@/views/system/user/user-interface' import { getpDeptApi, listPageApi, standardlistPageApi, updateApi } from '@/api/measure/measureDept' +import type { dictType } from '@/global' const $route = useRoute() const $router = useRouter() const ruleFormRef = ref() // from组件 @@ -19,9 +20,12 @@ director: '', // 负责人 administrationJob: '', // 行政职务 technologyJob: '', // 技术职务 + meterMajor: '', // 计量专业 remark: '', // 备注 - pDeptId: '', - pDeptName: '', + pDeptId: '', // 父级 + pDeptName: '', // 父级 + isLab: '1', // 是否为实验室 + labCapacity: [], // 实验室能力 }) // 表单 // 展示父级组织 const pDept = ref({ @@ -33,10 +37,11 @@ const title = ref('') const path = ref('') const rules = ref({ - organizeName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], - director: [{ required: true, message: '负责人不能为空', trigger: 'blur' }], - administrationJob: [{ required: true, message: '行政职务不能为空', trigger: 'blur' }], - technologyJob: [{ required: true, message: '技术职务不能为空', trigger: 'blur' }], + organizeName: [{ required: true, message: '名称不能为空', trigger: ['blur', 'change'] }], + director: [{ required: true, message: '负责人不能为空', trigger: ['blur', 'change'] }], + administrationJob: [{ required: true, message: '行政职务不能为空', trigger: ['blur', 'change'] }], + technologyJob: [{ required: true, message: '技术职务不能为空', trigger: ['blur', 'change'] }], + isLab: [{ required: true, message: '是否为实验室不能为空', trigger: ['blur', 'change'] }], }) // 表单验证规则 const userList = ref([]) // 用户列表 // 获取计量人员列表 @@ -53,13 +58,26 @@ } }) } -const technologyJobList = ref<{ id: string;name: string;value: string }[]>([]) -// 获取技术职务列表 -const getTechnologyJobList = () => { +const measureTypeList = ref([]) // 实验室能力 +const measureMajorList = ref([]) // 计量专业 +const technologyJobList = ref([]) +// 获取字典值 +function getDict() { + // 获取技术职务列表 getDictByCode('technologyJob').then((response) => { technologyJobList.value = response.data }) + // 获取检校类型 + getDictByCode('checkType').then((response) => { + measureTypeList.value = response.data + }) + // 获取计量专业 + getDictByCode('measureMajor').then((response) => { + measureMajorList.value = response.data + }) } +getDict() + const administrationJobList = ref<{ id: string;name: string;value: string }[]>([]) // 获取行政职务列表 const getAdministrationJob = () => { @@ -91,7 +109,8 @@ type: 'warning', }, ).then((res) => { - updateApi({ ...ruleForm.value, title: undefined }).then((res) => { + const form = { ...ruleForm.value, labCapacity: ruleForm.value.labCapacity.join(',') } + updateApi(form).then((res) => { if (res.code == 200) { formEl?.resetFields() ElMessage.success('提交成功') @@ -117,6 +136,8 @@ ruleForm.value.administrationJob = '' // 行政职务 ruleForm.value.technologyJob = '' // 技术职务 ruleForm.value.remark = '' // 备注 + ruleForm.value.isLab = '' + ruleForm.value.labCapacity = [] } const multipleTableRef = ref() const current = ref('') @@ -141,7 +162,7 @@ }, { label: '计量专业', - data: 'meterMajor', + data: 'meterMajorName', }, { label: '创建时间', @@ -196,7 +217,7 @@ }, { label: '计量专业', - data: 'meterMajor', + data: 'meterMajorName', }, { label: '创建时间', @@ -434,10 +455,12 @@ reset() title.value = row.title path.value = row.path + ruleForm.value = row ruleForm.value.organizeType = row.organizeType ruleForm.value.deptId = row.deptId + ruleForm.value.labCapacity = row.labCapacity ? row.labCapacity.split(',') : [] + ruleForm.value.meterMajor = row.meterMajor getuser() - getTechnologyJobList() getAdministrationJob() getDepartmentList() getuserInfoList() @@ -445,7 +468,6 @@ getInstrumentInfo() getDeviceInfo() } - ruleForm.value = row console.log(row, 'row') // 不同组织来判断展示的列表 if (title.value.split('-')[1] === '部门') { @@ -538,6 +560,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -586,13 +655,5 @@ diff --git a/src/views/business/lab/deptMeasure/deptMeasureList.vue b/src/views/business/lab/deptMeasure/deptMeasureList.vue index 4d1b5c0..72623a6 100644 --- a/src/views/business/lab/deptMeasure/deptMeasureList.vue +++ b/src/views/business/lab/deptMeasure/deptMeasureList.vue @@ -6,46 +6,44 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import RollbackDialog from './../components/rollbackDialog.vue' import DistributeDialog from './../components/distributeDialog.vue' -import type { ITaskList, ITaskQuery } from '@/views/business/schedule/task/task-interface' +import type { ILabQuery, ITaskList, ITaskQuery } from '@/views/business/schedule/task/task-interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import { printJSON } from '@/utils/printUtils' import { exportFile } from '@/utils/exportUtils' import { getDictByCode } from '@/api/system/dict' -import { exportTaskList, getTaskList } from '@/api/business/task' +import { exportTaskList, getDeptMeasureList, getTaskList } from '@/api/business/task' import type { dictType } from '@/global' const { proxy } = getCurrentInstance() as any const $router = useRouter() // 右上角按钮 const menus = [ - { name: '待检测', value: '1' }, + { name: '待检测', value: '2' }, { name: '检测中', value: '3' }, { name: '检测完', value: '4' }, ] -const currentMenu = ref('1') // 当前选中状态 +const currentMenu = ref('2') // 当前选中状态 // 查询条件 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) -const listQuery: Ref = ref({ +const listQuery: Ref = ref({ sampleNo: '', // 样品编号 sampleName: '', // 样品名称 orderNo: '', // 委托书编号 customerNo: '', // 委托方代码 customerName: '', // 委托方名称 isUrgent: '', // 是否加急 - sampleAttr: '', // 样品属性 + sampleBelong: '', // 样品属性 startTime: '', // 应检完时间-开始 endTime: '', // 应检完时间-结束 - sendState: '1', // 分发状态 - outState: '', // 超期状态 - formId: 'jlglsygfsp', // 任务分发formId + measureStatus: '2', // 检测状态 offset: 1, limit: 20, }) // --------------获取所需字典值---------------- -const sampleAttrList = ref([]) // 样品属性列表 +const sampleBelongList = ref([]) // 样品属性列表 function getDict() { // 获取样品属性 getDictByCode('sampleBelong').then((response) => { - sampleAttrList.value = response.data + sampleBelongList.value = response.data }) } getDict() @@ -59,9 +57,9 @@ { text: '委托书编号', value: 'orderNo', align: 'center' }, { text: '委托方代码', value: 'customerNo', align: 'center' }, { text: '委托方名称', value: 'customerName', align: 'center' }, - { text: '是否加急', value: 'isUrgent', align: 'center', width: '55px', filter: (row: ITaskList) => { return row.isUrgent == '1' ? '是' : '否' }, styleFilter: (row: ITaskList) => { return row.isUrgent == '1' ? 'color: red' : '' } }, + { text: '是否加急', value: 'isUrgentName', align: 'center', width: '55px', styleFilter: (row: ITaskList) => { return row.isUrgentName == '是' ? 'color: red' : '' } }, { text: '应检完时间', value: 'requireOverTime', align: 'center', width: '110px' }, - { text: '样品属性', value: 'sampleAttrName', align: 'center' }, + { text: '样品属性', value: 'sampleBelongName', align: 'center' }, { text: '当前检定环节', value: 'currentMeasureStateName', align: 'center', width: '80px' }, // { text: '证书出具', value: 'certificationState', align: 'center', filter: (row: ITaskList) => { return `${row.currentCertifications}/${row.requireCertifications}` } }, ]) @@ -81,18 +79,14 @@ // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } - // 模拟数据 - list.value = [ - { orderId: '1', sampleNo: '1yp123456', sampleName: '压力表', orderNo: 'wtd123456', customerNo: 'kh123456', customerName: '北京无线电测量研究所', isUrgent: '1', sampleAttr: '1', sampleAttrName: '客户样品', sampleModel: 'JBT-011', manufacturingNo: '24432231124', requireOverTime: '2023-02-01', sampleId: '1', currentMeasureState: '1', currentMeasureStateName: '待检测', currentCertifications: 0, requireCertifications: 0, labelBind: '', distributeState: '1', distributeStateName: '初次分发' }, - { orderId: '1', sampleNo: '1yp123457', sampleName: '压力表', orderNo: 'wtd123456', customerNo: 'kh123456', customerName: '北京无线电测量研究所', isUrgent: '0', sampleAttr: '1', sampleAttrName: '客户样品', sampleModel: 'JBT-011', manufacturingNo: '24432231124', requireOverTime: '2023-02-01', sampleId: '1', currentMeasureState: '1', currentMeasureStateName: '待检测', currentCertifications: 0, requireCertifications: 0, labelBind: '', distributeState: '2', distributeStateName: '退回分发' }, - ] - loadingTable.value = false - console.log(listQuery.value) - // getTaskList(listQuery.value).then((response) => { - // list.value = response.data.rows - // total.value = parseInt(response.data.total) - // loadingTable.value = false - // }) + getDeptMeasureList(listQuery.value).then((res) => { + list.value = res.data.rows.map((item: ITaskList) => { + item.isUrgentName = item.isUrgent == 1 ? '是' : '否' + return item + }) + total.value = res.total + loadingTable.value = false + }) } // 多选发生改变时 function handleSelectionChange(e: any) { @@ -112,10 +106,10 @@ customerNo: '', // 委托方代码 customerName: '', // 委托方名称 isUrgent: '', // 是否加急 - sampleAttr: '', // 样品属性 - formId: 'jlglsygfsp', - sendState: '1', // 分发状态 - outState: '', // 超期状态 + sampleBelong: '', // 样品属性 + startTime: '', // 应检完时间-开始 + endTime: '', // 应检完时间-结束 + measureStatus: listQuery.value.measureStatus, // 检测状态 offset: 1, limit: 20, } @@ -228,7 +222,7 @@ // 选择按钮变更 watch(currentMenu, (val: string) => { - listQuery.value.sendState = val + listQuery.value.measureStatus = val fetchData(false) }) @@ -300,14 +294,14 @@ - - + + @@ -321,10 +315,10 @@ 详情 - + 任务分发 - + 退回 diff --git a/src/views/measure/measureDept/components/addDialog.vue b/src/views/measure/measureDept/components/addDialog.vue index 4eb62ec..9d75cff 100644 --- a/src/views/measure/measureDept/components/addDialog.vue +++ b/src/views/measure/measureDept/components/addDialog.vue @@ -8,6 +8,7 @@ import { getStaffDetail, getStaffList } from '@/api/measure/person' import type { userType } from '@/views/system/user/user-interface' import { getpDeptApi, listPageApi, standardlistPageApi, updateApi } from '@/api/measure/measureDept' +import type { dictType } from '@/global' const $route = useRoute() const $router = useRouter() const ruleFormRef = ref() // from组件 @@ -19,9 +20,12 @@ director: '', // 负责人 administrationJob: '', // 行政职务 technologyJob: '', // 技术职务 + meterMajor: '', // 计量专业 remark: '', // 备注 - pDeptId: '', - pDeptName: '', + pDeptId: '', // 父级 + pDeptName: '', // 父级 + isLab: '1', // 是否为实验室 + labCapacity: [], // 实验室能力 }) // 表单 // 展示父级组织 const pDept = ref({ @@ -33,10 +37,11 @@ const title = ref('') const path = ref('') const rules = ref({ - organizeName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], - director: [{ required: true, message: '负责人不能为空', trigger: 'blur' }], - administrationJob: [{ required: true, message: '行政职务不能为空', trigger: 'blur' }], - technologyJob: [{ required: true, message: '技术职务不能为空', trigger: 'blur' }], + organizeName: [{ required: true, message: '名称不能为空', trigger: ['blur', 'change'] }], + director: [{ required: true, message: '负责人不能为空', trigger: ['blur', 'change'] }], + administrationJob: [{ required: true, message: '行政职务不能为空', trigger: ['blur', 'change'] }], + technologyJob: [{ required: true, message: '技术职务不能为空', trigger: ['blur', 'change'] }], + isLab: [{ required: true, message: '是否为实验室不能为空', trigger: ['blur', 'change'] }], }) // 表单验证规则 const userList = ref([]) // 用户列表 // 获取计量人员列表 @@ -53,13 +58,26 @@ } }) } -const technologyJobList = ref<{ id: string;name: string;value: string }[]>([]) -// 获取技术职务列表 -const getTechnologyJobList = () => { +const measureTypeList = ref([]) // 实验室能力 +const measureMajorList = ref([]) // 计量专业 +const technologyJobList = ref([]) +// 获取字典值 +function getDict() { + // 获取技术职务列表 getDictByCode('technologyJob').then((response) => { technologyJobList.value = response.data }) + // 获取检校类型 + getDictByCode('checkType').then((response) => { + measureTypeList.value = response.data + }) + // 获取计量专业 + getDictByCode('measureMajor').then((response) => { + measureMajorList.value = response.data + }) } +getDict() + const administrationJobList = ref<{ id: string;name: string;value: string }[]>([]) // 获取行政职务列表 const getAdministrationJob = () => { @@ -91,7 +109,8 @@ type: 'warning', }, ).then((res) => { - updateApi({ ...ruleForm.value, title: undefined }).then((res) => { + const form = { ...ruleForm.value, labCapacity: ruleForm.value.labCapacity.join(',') } + updateApi(form).then((res) => { if (res.code == 200) { formEl?.resetFields() ElMessage.success('提交成功') @@ -117,6 +136,8 @@ ruleForm.value.administrationJob = '' // 行政职务 ruleForm.value.technologyJob = '' // 技术职务 ruleForm.value.remark = '' // 备注 + ruleForm.value.isLab = '' + ruleForm.value.labCapacity = [] } const multipleTableRef = ref() const current = ref('') @@ -141,7 +162,7 @@ }, { label: '计量专业', - data: 'meterMajor', + data: 'meterMajorName', }, { label: '创建时间', @@ -196,7 +217,7 @@ }, { label: '计量专业', - data: 'meterMajor', + data: 'meterMajorName', }, { label: '创建时间', @@ -434,10 +455,12 @@ reset() title.value = row.title path.value = row.path + ruleForm.value = row ruleForm.value.organizeType = row.organizeType ruleForm.value.deptId = row.deptId + ruleForm.value.labCapacity = row.labCapacity ? row.labCapacity.split(',') : [] + ruleForm.value.meterMajor = row.meterMajor getuser() - getTechnologyJobList() getAdministrationJob() getDepartmentList() getuserInfoList() @@ -445,7 +468,6 @@ getInstrumentInfo() getDeviceInfo() } - ruleForm.value = row console.log(row, 'row') // 不同组织来判断展示的列表 if (title.value.split('-')[1] === '部门') { @@ -538,6 +560,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -586,13 +655,5 @@ diff --git a/src/views/measure/measureDept/measureDept-interface.ts b/src/views/measure/measureDept/measureDept-interface.ts index f7911fa..0528cc7 100644 --- a/src/views/measure/measureDept/measureDept-interface.ts +++ b/src/views/measure/measureDept/measureDept-interface.ts @@ -7,7 +7,7 @@ organizeType?: string // 类型 createTime?: string // 创建时间 director?: string // 负责人 - meterMajor?: string // 专业 + meterMajor: string // 专业 pDeptId?: string // 所属科室 createEndTime?: string createStartTime?: string @@ -45,4 +45,6 @@ technologyJobName: string updateTime: string title?: string + isLab: string // 是否为实验室 + labCapacity: string | string[] }