diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index a58b89e..ec522cf 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -16,6 +16,7 @@ import { addStatus, detailStatus } from '@/api/device/stateManage' import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' import useUserStore from '@/store/modules/user' + const userInfo = useUserStore() const $router = useRouter() const $route = useRoute() @@ -24,6 +25,9 @@ const title = ref('') const name = ref('') const borrowList = ref([]) +interface EquipmentListRow { + equipmentId: string +} const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 applyDesc: '', // 申请说明 @@ -37,7 +41,7 @@ equipmentSpecifications: '', // 设备规格 manufacturingNo: '', // 出厂编号 manufacturer: '', // 生产厂家 - equipmentList: [], + equipmentList: [] as EquipmentListRow[], id: '', }) // 表单 const ruleForm2 = ref({ @@ -206,6 +210,10 @@ if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { ruleForm1.value = res.data + ruleForm1.value.applyUnit = res.data.applyUnit + ruleForm1.value.equipmentNo = res.data.applyNo + ruleForm1.value.equipmentName = res.data.applyTypeName + ruleForm1.value.time = res.data.time }) } } @@ -520,6 +528,10 @@ ruleForm1.value.manufacturingNo = device.manufacturingNo ruleForm1.value.manufacturer = device.manufacturer ruleFormRef1.value.clearValidate('equipmentNo') + // 赋值 + ruleForm1.value.equipmentList = [{ + equipmentId: row[0].id, + }] } } // row.forEach((element) => { @@ -603,6 +615,7 @@ 关闭 + @@ -660,7 +673,7 @@ diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index a58b89e..ec522cf 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -16,6 +16,7 @@ import { addStatus, detailStatus } from '@/api/device/stateManage' import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' import useUserStore from '@/store/modules/user' + const userInfo = useUserStore() const $router = useRouter() const $route = useRoute() @@ -24,6 +25,9 @@ const title = ref('') const name = ref('') const borrowList = ref([]) +interface EquipmentListRow { + equipmentId: string +} const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 applyDesc: '', // 申请说明 @@ -37,7 +41,7 @@ equipmentSpecifications: '', // 设备规格 manufacturingNo: '', // 出厂编号 manufacturer: '', // 生产厂家 - equipmentList: [], + equipmentList: [] as EquipmentListRow[], id: '', }) // 表单 const ruleForm2 = ref({ @@ -206,6 +210,10 @@ if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { ruleForm1.value = res.data + ruleForm1.value.applyUnit = res.data.applyUnit + ruleForm1.value.equipmentNo = res.data.applyNo + ruleForm1.value.equipmentName = res.data.applyTypeName + ruleForm1.value.time = res.data.time }) } } @@ -520,6 +528,10 @@ ruleForm1.value.manufacturingNo = device.manufacturingNo ruleForm1.value.manufacturer = device.manufacturer ruleFormRef1.value.clearValidate('equipmentNo') + // 赋值 + ruleForm1.value.equipmentList = [{ + equipmentId: row[0].id, + }] } } // row.forEach((element) => { @@ -603,6 +615,7 @@ 关闭 + @@ -660,7 +673,7 @@ diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index 0bdbd3a..1cc56b2 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -7,6 +7,7 @@ import { getDictByCode } from '@/api/system/dict' import { printJSON } from '@/utils/printUtils' import type { TableColumn } from '@/components/NormalTable/table_interface' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { @@ -26,6 +27,13 @@ default: '', }, }) +const formIdList = ref({ + 设备闲置申请: 'DEVICE_UNUSED_APPROVAL', + 设备封存申请: 'DEVICE_SEALED_APPROVAL', + 设备启封申请: 'DEVICE_UNSEALED_APPROVAL', + 设备报废申请: 'DEVICE_SCRAPPED_ROVAL', + 设备处置申请: 'DEVICE_HANDLE_APPROVAL', +}) const $router = useRouter() const searchQuery = reactive({ applyNo: '', // 申请编号 @@ -39,6 +47,7 @@ limit: 20, offset: 1, applyType: props.applyType, // 申请类型 + formId: SCHEDULE[formIdList.value[props.name]], }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index a58b89e..ec522cf 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -16,6 +16,7 @@ import { addStatus, detailStatus } from '@/api/device/stateManage' import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' import useUserStore from '@/store/modules/user' + const userInfo = useUserStore() const $router = useRouter() const $route = useRoute() @@ -24,6 +25,9 @@ const title = ref('') const name = ref('') const borrowList = ref([]) +interface EquipmentListRow { + equipmentId: string +} const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 applyDesc: '', // 申请说明 @@ -37,7 +41,7 @@ equipmentSpecifications: '', // 设备规格 manufacturingNo: '', // 出厂编号 manufacturer: '', // 生产厂家 - equipmentList: [], + equipmentList: [] as EquipmentListRow[], id: '', }) // 表单 const ruleForm2 = ref({ @@ -206,6 +210,10 @@ if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { ruleForm1.value = res.data + ruleForm1.value.applyUnit = res.data.applyUnit + ruleForm1.value.equipmentNo = res.data.applyNo + ruleForm1.value.equipmentName = res.data.applyTypeName + ruleForm1.value.time = res.data.time }) } } @@ -520,6 +528,10 @@ ruleForm1.value.manufacturingNo = device.manufacturingNo ruleForm1.value.manufacturer = device.manufacturer ruleFormRef1.value.clearValidate('equipmentNo') + // 赋值 + ruleForm1.value.equipmentList = [{ + equipmentId: row[0].id, + }] } } // row.forEach((element) => { @@ -603,6 +615,7 @@ 关闭 + @@ -660,7 +673,7 @@ diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index 0bdbd3a..1cc56b2 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -7,6 +7,7 @@ import { getDictByCode } from '@/api/system/dict' import { printJSON } from '@/utils/printUtils' import type { TableColumn } from '@/components/NormalTable/table_interface' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { @@ -26,6 +27,13 @@ default: '', }, }) +const formIdList = ref({ + 设备闲置申请: 'DEVICE_UNUSED_APPROVAL', + 设备封存申请: 'DEVICE_SEALED_APPROVAL', + 设备启封申请: 'DEVICE_UNSEALED_APPROVAL', + 设备报废申请: 'DEVICE_SCRAPPED_ROVAL', + 设备处置申请: 'DEVICE_HANDLE_APPROVAL', +}) const $router = useRouter() const searchQuery = reactive({ applyNo: '', // 申请编号 @@ -39,6 +47,7 @@ limit: 20, offset: 1, applyType: props.applyType, // 申请类型 + formId: SCHEDULE[formIdList.value[props.name]], }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 diff --git a/src/views/system/tool/autograph/addDDialog.vue b/src/views/system/tool/autograph/addDDialog.vue index 0f594af..eca5e7f 100644 --- a/src/views/system/tool/autograph/addDDialog.vue +++ b/src/views/system/tool/autograph/addDDialog.vue @@ -21,6 +21,7 @@ signNo: '', createTime: '', id: '', + signUserId: '', // 可使用人id }) // 表单 const title = ref('') const rules = ref({ @@ -28,6 +29,7 @@ signName: [{ required: true, message: '签名名称不能为空', trigger: 'blur' }], signDirector: [{ required: true, message: '签名负责人不能为空', trigger: 'blur' }], minioFileName: [{ required: true, message: '上传附件不能为空', trigger: 'blur' }], + signUserId: [{ required: true, message: '签名人员不能为空', trigger: 'blur' }], }) // 表单验证规则 const dialogVisible = ref(false) // 弹窗显示 const userList = ref([]) // 可使用人列表 @@ -53,24 +55,24 @@ ruleFormRef.value?.resetFields() ruleForm.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') } + // 修改 else if (row.title === '编辑') { ruleForm.signNo = row.signNo ruleForm.signName = row.signName - // ruleForm.createTime = row.createTime ruleForm.signDesc = row.signDesc ruleForm.minioFileName = row.minioFileName ruleForm.userIdList = row.userIdList ruleForm.signDirector = row.signDirector ruleForm.id = row.id ruleForm.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + ruleForm.signUserId = row.signUserId // 获取详情列表 - listPageDetailApi({ ...row }).then((res) => { - ruleForm.id = res.data.id - res.data.userList.forEach((element: userType) => { - ruleForm.userIdList?.push(element.id) - }) - }) - // 修改 + // listPageDetailApi({ ...row }).then((res) => { + // ruleForm.id = res.data.id + // res.data.userList.forEach((element: userType) => { + // ruleForm.userIdList?.push(element.id) + // }) + // }) } else { // 详情 @@ -81,12 +83,13 @@ ruleForm.minioFileName = row.minioFileName ruleForm.userIdList = row.userIdList ruleForm.signDirector = row.signDirector + ruleForm.signUserId = row.signUserId // 获取详情列表 - listPageDetailApi({ ...row }).then((res) => { - res.data.userList.forEach((element: userType) => { - ruleForm.userIdList?.push(element.id) - }) - }) + // listPageDetailApi({ ...row }).then((res) => { + // res.data.userList.forEach((element: userType) => { + // ruleForm.userIdList?.push(element.id) + // }) + // }) } ruleForm.signType = row.signType getuser() @@ -103,6 +106,14 @@ await formEl.validate((valid, fields) => { if (valid) { if (title.value === '新增') { + userList.value.map((item) => { + if (item.id === ruleForm.signUserId) { + // 后台去掉校验去除赋值操作 + ruleForm.signDirector = item.name + ruleForm.signName = item.name + ruleForm.userIdList = [ruleForm.signUserId] + } + }) addApi(ruleForm).then((res) => { if (res.code === 200) { ElMessage.success('新增成功') @@ -111,6 +122,14 @@ }) } else { + userList.value.map((item) => { + if (item.id === ruleForm.signUserId) { + // 后台去掉校验去除赋值操作 + ruleForm.signDirector = item.name + ruleForm.signName = item.name + ruleForm.userIdList = [ruleForm.signUserId] + } + }) updateApi(ruleForm).then((res) => { if (res.code === 200) { ElMessage.success('更新成功') @@ -155,8 +174,8 @@ + @@ -660,7 +673,7 @@ diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index 0bdbd3a..1cc56b2 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -7,6 +7,7 @@ import { getDictByCode } from '@/api/system/dict' import { printJSON } from '@/utils/printUtils' import type { TableColumn } from '@/components/NormalTable/table_interface' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { @@ -26,6 +27,13 @@ default: '', }, }) +const formIdList = ref({ + 设备闲置申请: 'DEVICE_UNUSED_APPROVAL', + 设备封存申请: 'DEVICE_SEALED_APPROVAL', + 设备启封申请: 'DEVICE_UNSEALED_APPROVAL', + 设备报废申请: 'DEVICE_SCRAPPED_ROVAL', + 设备处置申请: 'DEVICE_HANDLE_APPROVAL', +}) const $router = useRouter() const searchQuery = reactive({ applyNo: '', // 申请编号 @@ -39,6 +47,7 @@ limit: 20, offset: 1, applyType: props.applyType, // 申请类型 + formId: SCHEDULE[formIdList.value[props.name]], }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 diff --git a/src/views/system/tool/autograph/addDDialog.vue b/src/views/system/tool/autograph/addDDialog.vue index 0f594af..eca5e7f 100644 --- a/src/views/system/tool/autograph/addDDialog.vue +++ b/src/views/system/tool/autograph/addDDialog.vue @@ -21,6 +21,7 @@ signNo: '', createTime: '', id: '', + signUserId: '', // 可使用人id }) // 表单 const title = ref('') const rules = ref({ @@ -28,6 +29,7 @@ signName: [{ required: true, message: '签名名称不能为空', trigger: 'blur' }], signDirector: [{ required: true, message: '签名负责人不能为空', trigger: 'blur' }], minioFileName: [{ required: true, message: '上传附件不能为空', trigger: 'blur' }], + signUserId: [{ required: true, message: '签名人员不能为空', trigger: 'blur' }], }) // 表单验证规则 const dialogVisible = ref(false) // 弹窗显示 const userList = ref([]) // 可使用人列表 @@ -53,24 +55,24 @@ ruleFormRef.value?.resetFields() ruleForm.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') } + // 修改 else if (row.title === '编辑') { ruleForm.signNo = row.signNo ruleForm.signName = row.signName - // ruleForm.createTime = row.createTime ruleForm.signDesc = row.signDesc ruleForm.minioFileName = row.minioFileName ruleForm.userIdList = row.userIdList ruleForm.signDirector = row.signDirector ruleForm.id = row.id ruleForm.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + ruleForm.signUserId = row.signUserId // 获取详情列表 - listPageDetailApi({ ...row }).then((res) => { - ruleForm.id = res.data.id - res.data.userList.forEach((element: userType) => { - ruleForm.userIdList?.push(element.id) - }) - }) - // 修改 + // listPageDetailApi({ ...row }).then((res) => { + // ruleForm.id = res.data.id + // res.data.userList.forEach((element: userType) => { + // ruleForm.userIdList?.push(element.id) + // }) + // }) } else { // 详情 @@ -81,12 +83,13 @@ ruleForm.minioFileName = row.minioFileName ruleForm.userIdList = row.userIdList ruleForm.signDirector = row.signDirector + ruleForm.signUserId = row.signUserId // 获取详情列表 - listPageDetailApi({ ...row }).then((res) => { - res.data.userList.forEach((element: userType) => { - ruleForm.userIdList?.push(element.id) - }) - }) + // listPageDetailApi({ ...row }).then((res) => { + // res.data.userList.forEach((element: userType) => { + // ruleForm.userIdList?.push(element.id) + // }) + // }) } ruleForm.signType = row.signType getuser() @@ -103,6 +106,14 @@ await formEl.validate((valid, fields) => { if (valid) { if (title.value === '新增') { + userList.value.map((item) => { + if (item.id === ruleForm.signUserId) { + // 后台去掉校验去除赋值操作 + ruleForm.signDirector = item.name + ruleForm.signName = item.name + ruleForm.userIdList = [ruleForm.signUserId] + } + }) addApi(ruleForm).then((res) => { if (res.code === 200) { ElMessage.success('新增成功') @@ -111,6 +122,14 @@ }) } else { + userList.value.map((item) => { + if (item.id === ruleForm.signUserId) { + // 后台去掉校验去除赋值操作 + ruleForm.signDirector = item.name + ruleForm.signName = item.name + ruleForm.userIdList = [ruleForm.signUserId] + } + }) updateApi(ruleForm).then((res) => { if (res.code === 200) { ElMessage.success('更新成功') @@ -155,8 +174,8 @@ + @@ -660,7 +673,7 @@ diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index 0bdbd3a..1cc56b2 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -7,6 +7,7 @@ import { getDictByCode } from '@/api/system/dict' import { printJSON } from '@/utils/printUtils' import type { TableColumn } from '@/components/NormalTable/table_interface' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ name: { @@ -26,6 +27,13 @@ default: '', }, }) +const formIdList = ref({ + 设备闲置申请: 'DEVICE_UNUSED_APPROVAL', + 设备封存申请: 'DEVICE_SEALED_APPROVAL', + 设备启封申请: 'DEVICE_UNSEALED_APPROVAL', + 设备报废申请: 'DEVICE_SCRAPPED_ROVAL', + 设备处置申请: 'DEVICE_HANDLE_APPROVAL', +}) const $router = useRouter() const searchQuery = reactive({ applyNo: '', // 申请编号 @@ -39,6 +47,7 @@ limit: 20, offset: 1, applyType: props.applyType, // 申请类型 + formId: SCHEDULE[formIdList.value[props.name]], }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 diff --git a/src/views/system/tool/autograph/addDDialog.vue b/src/views/system/tool/autograph/addDDialog.vue index 0f594af..eca5e7f 100644 --- a/src/views/system/tool/autograph/addDDialog.vue +++ b/src/views/system/tool/autograph/addDDialog.vue @@ -21,6 +21,7 @@ signNo: '', createTime: '', id: '', + signUserId: '', // 可使用人id }) // 表单 const title = ref('') const rules = ref({ @@ -28,6 +29,7 @@ signName: [{ required: true, message: '签名名称不能为空', trigger: 'blur' }], signDirector: [{ required: true, message: '签名负责人不能为空', trigger: 'blur' }], minioFileName: [{ required: true, message: '上传附件不能为空', trigger: 'blur' }], + signUserId: [{ required: true, message: '签名人员不能为空', trigger: 'blur' }], }) // 表单验证规则 const dialogVisible = ref(false) // 弹窗显示 const userList = ref([]) // 可使用人列表 @@ -53,24 +55,24 @@ ruleFormRef.value?.resetFields() ruleForm.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') } + // 修改 else if (row.title === '编辑') { ruleForm.signNo = row.signNo ruleForm.signName = row.signName - // ruleForm.createTime = row.createTime ruleForm.signDesc = row.signDesc ruleForm.minioFileName = row.minioFileName ruleForm.userIdList = row.userIdList ruleForm.signDirector = row.signDirector ruleForm.id = row.id ruleForm.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + ruleForm.signUserId = row.signUserId // 获取详情列表 - listPageDetailApi({ ...row }).then((res) => { - ruleForm.id = res.data.id - res.data.userList.forEach((element: userType) => { - ruleForm.userIdList?.push(element.id) - }) - }) - // 修改 + // listPageDetailApi({ ...row }).then((res) => { + // ruleForm.id = res.data.id + // res.data.userList.forEach((element: userType) => { + // ruleForm.userIdList?.push(element.id) + // }) + // }) } else { // 详情 @@ -81,12 +83,13 @@ ruleForm.minioFileName = row.minioFileName ruleForm.userIdList = row.userIdList ruleForm.signDirector = row.signDirector + ruleForm.signUserId = row.signUserId // 获取详情列表 - listPageDetailApi({ ...row }).then((res) => { - res.data.userList.forEach((element: userType) => { - ruleForm.userIdList?.push(element.id) - }) - }) + // listPageDetailApi({ ...row }).then((res) => { + // res.data.userList.forEach((element: userType) => { + // ruleForm.userIdList?.push(element.id) + // }) + // }) } ruleForm.signType = row.signType getuser() @@ -103,6 +106,14 @@ await formEl.validate((valid, fields) => { if (valid) { if (title.value === '新增') { + userList.value.map((item) => { + if (item.id === ruleForm.signUserId) { + // 后台去掉校验去除赋值操作 + ruleForm.signDirector = item.name + ruleForm.signName = item.name + ruleForm.userIdList = [ruleForm.signUserId] + } + }) addApi(ruleForm).then((res) => { if (res.code === 200) { ElMessage.success('新增成功') @@ -111,6 +122,14 @@ }) } else { + userList.value.map((item) => { + if (item.id === ruleForm.signUserId) { + // 后台去掉校验去除赋值操作 + ruleForm.signDirector = item.name + ruleForm.signName = item.name + ruleForm.userIdList = [ruleForm.signUserId] + } + }) updateApi(ruleForm).then((res) => { if (res.code === 200) { ElMessage.success('更新成功') @@ -155,8 +174,8 @@