diff --git a/src/views/modules/srmPart/com_part_Approval.vue b/src/views/modules/srmPart/com_part_Approval.vue index 32802c6..95f2455 100644 --- a/src/views/modules/srmPart/com_part_Approval.vue +++ b/src/views/modules/srmPart/com_part_Approval.vue @@ -24,7 +24,7 @@ - + + + + + + + + + + + @@ -254,6 +264,12 @@ import suppliers from './com_part_Suppliers' import approval from './com_part_Approval' import attachments from './com_part_Attachments' +import { + approveNodeInstance, + getFlowPreview, + restartFlowInstance +} from '@/api/workFlow/workFlow.js' + export default { watch: { searchData: { @@ -558,6 +574,24 @@ export default { sortLv: 0, status: true, fixed: false + }, + { + userId: this.$store.state.user.name, + functionId: this.functionId, + serialNumber: 'partTableFlowStatus', + tableId: 'partTable', + tableName: '产品信息', + columnProp: 'flowStatus', + headerAlign: 'center', + align: 'center', + columnLabel: '审批状态', + columnWidth: '100', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false } ], exportName: '产品信息' + this.dayjs().format('YYYYMMDDHHmmss'), @@ -633,10 +667,10 @@ export default { if (this.tagNo === 510) { strVal = this.currentpart.unit } - if (val === 522) { + if (val === 529) { strVal = this.currentpart.buyerName } - if (val === 523) { + if (val === 528) { strVal = this.currentpart.sourcingName } @@ -660,11 +694,11 @@ export default { if (this.tagNo === 510) { this.currentpart.unit = val.UMID } - if (this.tagNo === 522) { - this.currentpart.buyerName = val.buyer_name + if (this.tagNo === 529) { + this.currentpart.buyerName = val.UserName } - if (this.tagNo === 523) { - this.currentpart.sourcingName = val.sourcing_name + if (this.tagNo === 528) { + this.currentpart.sourcingName = val.UserName } if (this.tagNo === 527) { @@ -677,7 +711,23 @@ export default { this.searchData.page = this.pageIndex searchPartList(this.searchData).then(({data}) => { if (data.code === 0) { - this.mainDataList = data.page.list + // 处理列表数据,确保可以正确显示嵌套属性 + this.mainDataList = data.page.list.map(item => { + // 方式1:将嵌套属性提取到顶层 + if (item.flowNodeInstanceData) { + item.departmentName = item.flowNodeInstanceData.departmentName; + item.assigneeName = item.flowNodeInstanceData.assigneeName; + + } else { + item.departmentName = ''; + item.assigneeName = ''; + + } + return item; + }); + + + // this.mainDataList = data.page.list this.pageIndex = data.page.currPage this.pageSize = data.page.pageSize this.totalPage = data.page.totalCount @@ -880,15 +930,13 @@ export default { openApproveDialog(row) { this.approveData = { applyNo: row.flowNodeInstanceData.applyNo, - // nodeCode: row.nodeCode, - // nodeName: row.nodeName, - // departmentName: row.departmentName || '', // 审批部门 - rqrq - // assigneeName: row.assigneeName, site: row.flowNodeInstanceData.site, orderType: row.flowNodeInstanceData.orderType, - comment: '', flowCode: row.flowNodeInstanceData.flowCode, - flowVersion: row.flowNodeInstanceData.flowVersion + flowVersion: row.flowNodeInstanceData.flowVersion, + nodeCode: row.flowNodeInstanceData.nodeCode, + comment: '' + } this.approveDialogVisible = true }, @@ -900,18 +948,19 @@ export default { } this.approveLoading = true approveNodeInstance({ - applyNo: row.flowNodeInstanceData.applyNo, - nodeCode: row.flowNodeInstanceData.nodeCode, - site: row.flowNodeInstanceData.site, - orderType: row.flowNodeInstanceData.orderType, + applyNo: this.approveData.applyNo, + nodeCode: this.approveData.nodeCode, + site: this.approveData.site, + orderType: this.approveData.orderType, + specialRelease: this.approveData.specialRelease, action: action, comment: this.approveData.comment }).then(({ data }) => { if (data && data.code === 0) { this.$message.success(action === 'APPROVED' ? '审批通过成功' : '驳回成功') this.approveDialogVisible = false - this.getInstanceList() - this.getNodeInstanceList() + //刷新列表 + this.getMainData() } else { this.$message.error(data.msg || '操作失败') } @@ -934,8 +983,6 @@ export default { }).then(({ data }) => { if (data && data.code === 0) { this.$message.success('重新审批成功') - this.getInstanceList() - this.nodeInstanceList = [] this.currentInstance = null } else { this.$message.error(data.msg || '操作失败')