From d4faf4f8691bdeedec2c24ecbf8bf1a7d5c9cd40 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Tue, 20 Jan 2026 18:14:06 +0800 Subject: [PATCH] =?UTF-8?q?2026-01-20=20=E6=94=B6=E8=B4=A7=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E4=BB=BB=E5=8A=A1=E9=80=9A=E7=9F=A5=E5=92=8C=E6=8B=A3?= =?UTF-8?q?=E8=B4=A7=E5=87=BA=E5=BA=93=E4=BB=BB=E5=8A=A1=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=83=A8=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qc/Inbound_notification.js | 2 + src/api/qc/outbound_notification.js | 2 + src/views/modules/qc/inboundNotification.vue | 153 ++++++++++++----- src/views/modules/qc/outboundNotification.vue | 155 +++++++++++++----- 4 files changed, 223 insertions(+), 89 deletions(-) diff --git a/src/api/qc/Inbound_notification.js b/src/api/qc/Inbound_notification.js index c33bcd6..893c90e 100644 --- a/src/api/qc/Inbound_notification.js +++ b/src/api/qc/Inbound_notification.js @@ -27,4 +27,6 @@ export const updateInboundDetail = data => createAPI('/inbound/updateInboundDeta export const getInboundDetail2 = data => createAPI('/inbound/getInboundDetail2','post',data) // 查询入库类别列表 export const getInboundCategoryList = data => createAPI('/inbound/getInboundCategoryList','post',data) +// 查询部门列表 +export const getDepartmentList = data => createAPI('/inbound/getDepartmentList','post',data) diff --git a/src/api/qc/outbound_notification.js b/src/api/qc/outbound_notification.js index 27a8824..7255b1a 100644 --- a/src/api/qc/outbound_notification.js +++ b/src/api/qc/outbound_notification.js @@ -28,4 +28,6 @@ export const updateOutboundDetail = data => createAPI('/outbound/updateOutboundD export const getOutboundDetail2 = data => createAPI('/outbound/getOutboundDetail2','post',data) // 查询出库类别列表 export const getOutboundCategoryList = data => createAPI('/outbound/getOutboundCategoryList','post',data) +// 查询部门列表 +export const getDepartmentList = data => createAPI('/outbound/getDepartmentList','post',data) diff --git a/src/views/modules/qc/inboundNotification.vue b/src/views/modules/qc/inboundNotification.vue index bdbbbd8..615038b 100644 --- a/src/views/modules/qc/inboundNotification.vue +++ b/src/views/modules/qc/inboundNotification.vue @@ -123,7 +123,7 @@ - + - - + + - + 供应商 - + + + + + + + @@ -674,6 +684,7 @@ updateInboundDetail, // 批量编辑明细 getInboundDetail2, // 获取入库明细 getInboundCategoryList, // 查询入库类别列表 + getDepartmentList, // 查询部门列表 } from "@/api/qc/Inbound_notification.js" import { getSiteAndBuByUserName, @@ -753,6 +764,7 @@ category: '', // 入库类别 }, categoryList: [], // 入库类别列表 + departmentList: [], // 部门列表 dataList: [], detailList: [], userBuList: [], @@ -891,6 +903,24 @@ fixed: '', columnWidth: 100, }, + { + userId: this.$store.state.user.name, + functionId: 610, + serialNumber: '610Table1DepartmentName', + tableId: "610Table1", + tableName: "收货入库任务表", + columnProp: 'departmentName', + headerAlign: "center", + align: "center", + columnLabel: '部门', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120, + }, { userId: this.$store.state.user.name, functionId: 610, @@ -1145,6 +1175,20 @@ message: ' ', trigger: ['blur','change'] } + ], + category: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + departmentNo: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } ] }, searchLoading: false, @@ -1280,16 +1324,24 @@ orderNo: '', orderType: '', orderStatus: '草稿', - requiredInboundDate: '', + requiredInboundDate: this.dayjs().format('YYYY-MM-DD'), // 默认为当天 supplierId: '', supplierName: '', remarks: '', createdBy: this.$store.state.user.name, category: '', // 入库类别 + departmentNo: '', // 部门 } this.modalDisableFlag = false this.loadCategoryList() // 加载入库类别列表 + this.loadDepartmentList() // 加载部门列表 this.modalFlag = true + // 重置表单验证状态 + this.$nextTick(() => { + if (this.$refs.modalForm) { + this.$refs.modalForm.clearValidate() + } + }) }, updateModal (row) { @@ -1310,51 +1362,55 @@ remarks: row.remarks, updatedBy: this.$store.state.user.name, category: row.category || '', // 入库类别 + departmentNo: row.departmentNo || '', // 部门 } this.modalDisableFlag = true this.loadCategoryList() // 加载入库类别列表 + this.loadDepartmentList() // 加载部门列表 this.modalFlag = true + // 重置表单验证状态 + this.$nextTick(() => { + if (this.$refs.modalForm) { + this.$refs.modalForm.clearValidate() + } + }) }, saveData () { - if (this.modalData.bu === '' || this.modalData.bu == null) { - this.$message.warning('请选择BU!') - return - } - if (this.modalData.orderType === '' || this.modalData.orderType == null) { - this.$message.warning('请选择单据类型!') - return - } - if (this.modalData.requiredInboundDate === '' || this.modalData.requiredInboundDate == null) { - this.$message.warning('请选择要求入库日期!') - return - } - this.saveLoading = true - if (this.modalData.flag === '1') { // 新增 - saveInboundNotification(this.modalData).then(({data}) => { - if (data && data.code === 0) { - this.getDataList() - this.modalFlag = false - this.$message.success('操作成功') - } else { - this.$message.error(data.msg) - } - }).finally(()=>{ - this.saveLoading = false - }) - } else { // 修改 - updateInboundNotification(this.modalData).then(({data}) => { - if (data && data.code === 0) { - this.getDataList() - this.modalFlag = false - this.$message.success('操作成功') - } else { - this.$message.error(data.msg) - } - }).finally(()=>{ - this.saveLoading = false - }) - } + // 使用表单验证 + this.$refs.modalForm.validate((valid) => { + if (!valid) { + this.$message.warning('请填写完整的必填项!') + return false + } + + this.saveLoading = true + if (this.modalData.flag === '1') { // 新增 + saveInboundNotification(this.modalData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.modalFlag = false + this.$message.success('操作成功') + } else { + this.$message.error(data.msg) + } + }).finally(()=>{ + this.saveLoading = false + }) + } else { // 修改 + updateInboundNotification(this.modalData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.modalFlag = false + this.$message.success('操作成功') + } else { + this.$message.error(data.msg) + } + }).finally(()=>{ + this.saveLoading = false + }) + } + }) }, // 删除 @@ -1896,6 +1952,15 @@ } }) }, + + // 加载部门列表 + loadDepartmentList () { + getDepartmentList({}).then(({data}) => { + if (data && data.code === 0) { + this.departmentList = data.rows || [] + } + }) + }, } } diff --git a/src/views/modules/qc/outboundNotification.vue b/src/views/modules/qc/outboundNotification.vue index b3b0326..2cfcb31 100644 --- a/src/views/modules/qc/outboundNotification.vue +++ b/src/views/modules/qc/outboundNotification.vue @@ -124,7 +124,7 @@ - + - - + + - + 供应商 - + 直接客户 - + + + + + + + @@ -641,6 +651,7 @@ updateOutboundDetail, // 批量编辑明细 getOutboundDetail2, // 获取出库明细 getOutboundCategoryList, // 查询出库类别列表 + getDepartmentList, // 查询部门列表 } from "@/api/qc/outbound_notification.js" import { getSiteAndBuByUserName, @@ -721,6 +732,7 @@ category: '', // 出库类别 }, categoryList: [], // 出库类别列表 + departmentList: [], // 部门列表 dataList: [], detailList: [], userBuList: [], @@ -877,6 +889,24 @@ fixed: '', columnWidth: 100, }, + { + userId: this.$store.state.user.name, + functionId: 620, + serialNumber: '620Table1DepartmentName', + tableId: "620Table1", + tableName: "拣货出库任务表", + columnProp: 'departmentName', + headerAlign: "center", + align: "center", + columnLabel: '部门', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120, + }, { userId: this.$store.state.user.name, functionId: 620, @@ -1092,6 +1122,20 @@ message: ' ', trigger: ['blur','change'] } + ], + category: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + departmentNo: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } ] }, searchLoading: false, @@ -1214,16 +1258,24 @@ orderNo: '', orderType: '采购退货', // 默认为采购退货 orderStatus: '草稿', - requiredOutboundDate: '', + requiredOutboundDate: this.dayjs().format('YYYY-MM-DD'), // 默认为当天 customerId: '', customerName: '', remarks: '', createdBy: this.$store.state.user.name, category: '', // 出库类别 + departmentNo: '', // 部门 } this.modalDisableFlag = false this.loadCategoryList() // 加载出库类别列表 + this.loadDepartmentList() // 加载部门列表 this.modalFlag = true + // 重置表单验证状态 + this.$nextTick(() => { + if (this.$refs.modalForm) { + this.$refs.modalForm.clearValidate() + } + }) }, updateModal (row) { @@ -1244,51 +1296,55 @@ remarks: row.remarks, updatedBy: this.$store.state.user.name, category: row.category || '', // 出库类别 + departmentNo: row.departmentNo || '', // 部门 } this.modalDisableFlag = true this.loadCategoryList() // 加载出库类别列表 + this.loadDepartmentList() // 加载部门列表 this.modalFlag = true + // 重置表单验证状态 + this.$nextTick(() => { + if (this.$refs.modalForm) { + this.$refs.modalForm.clearValidate() + } + }) }, saveData () { - if (this.modalData.bu === '' || this.modalData.bu == null) { - this.$message.warning('请选择BU!') - return - } - if (this.modalData.orderType === '' || this.modalData.orderType == null) { - this.$message.warning('请选择单据类型!') - return - } - if (this.modalData.requiredOutboundDate === '' || this.modalData.requiredOutboundDate == null) { - this.$message.warning('请选择要求出库日期!') - return - } - this.saveLoading = true - if (this.modalData.flag === '1') { // 新增 - saveOutboundNotification(this.modalData).then(({data}) => { - if (data && data.code === 0) { - this.getDataList() - this.modalFlag = false - this.$message.success('操作成功') - } else { - this.$message.error(data.msg) - } - }).finally(()=>{ - this.saveLoading = false - }) - } else { // 修改 - updateOutboundNotification(this.modalData).then(({data}) => { - if (data && data.code === 0) { - this.getDataList() - this.modalFlag = false - this.$message.success('操作成功') - } else { - this.$message.error(data.msg) - } - }).finally(()=>{ - this.saveLoading = false - }) - } + // 使用表单验证 + this.$refs.modalForm.validate((valid) => { + if (!valid) { + this.$message.warning('请填写完整的必填项!') + return false + } + + this.saveLoading = true + if (this.modalData.flag === '1') { // 新增 + saveOutboundNotification(this.modalData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.modalFlag = false + this.$message.success('操作成功') + } else { + this.$message.error(data.msg) + } + }).finally(()=>{ + this.saveLoading = false + }) + } else { // 修改 + updateOutboundNotification(this.modalData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.modalFlag = false + this.$message.success('操作成功') + } else { + this.$message.error(data.msg) + } + }).finally(()=>{ + this.saveLoading = false + }) + } + }) }, // 删除 @@ -1919,6 +1975,15 @@ } }) }, + + // 加载部门列表 + loadDepartmentList () { + getDepartmentList({}).then(({data}) => { + if (data && data.code === 0) { + this.departmentList = data.rows || [] + } + }) + }, } }