diff --git a/src/api/workCenter.js b/src/api/workCenter.js index f93533d4..ab502e61 100644 --- a/src/api/workCenter.js +++ b/src/api/workCenter.js @@ -213,6 +213,10 @@ const approvalInspectPlan = (params) => postAction('/process/esInspectPlanFlow/f const transferInspectPlan = (params) => postAction('/process/esInspectPlanFlow/flowTransfer', params) // 保存 const saveInspectPlan = (params) => postAction('/process/esInspectPlanFlow/flowSave', params) +// 稽查计划表-添加 +const addInspectPlanTable = (params) => postAction('/process/processEsInspectPlan/add', params) +// 稽查计划表-编辑 +const editInspectPlanTable = (params) => postAction('/process/processEsInspectPlan/edit', params) export { getProcessNodeList, @@ -321,5 +325,7 @@ export { refusalInspectPlan, approvalInspectPlan, transferInspectPlan, - saveInspectPlan + saveInspectPlan, + addInspectPlanTable, + editInspectPlanTable } diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue index 5d510d79..65ba139d 100644 --- a/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue +++ b/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue @@ -55,7 +55,7 @@
{{ $t('basicServiceInformation') }}
- + @@ -288,9 +288,7 @@ export default { } } // 获取表格数据 - const params = { - processEsInspectPlanList: this.$refs.inspectionPlanTable.getData() - } + const params = {} if (isValidate) { this.validateFormList( this.processInfoForm, @@ -298,7 +296,7 @@ export default { this.approvalInfoForm ).then(res => { params.processAll = res[0] - if (params.processAll.dueTime && params.processAll.dueTime.includes(' 00:00:00')) { + if (params.processAll.dueTime && !params.processAll.dueTime.includes(' 00:00:00')) { params.processAll.dueTime = params.processAll.dueTime + ' 00:00:00' } params.processAll.projectId = this.projectId diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanDrawer.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanDrawer.vue index c20fbf48..f15ded22 100644 --- a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanDrawer.vue +++ b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanDrawer.vue @@ -104,9 +104,17 @@ import StandardSelection from '@comp/selection/StandardSelection' import UserSelection from '@comp/selection/UserSelection' import { getWorkGroupTreeList } from '@api/api' import WorkGroupSelection from '@comp/selection/WorkGroupSelection' +import { addInspectPlanTable, editInspectPlanTable } from '@api/workCenter' export default { name: 'InspectionPlanDrawer', + props: { + // 项目id + projectId: { + type: String, + required: true + } + }, components: { WorkGroupSelection, UserSelection, StandardSelection }, data () { return { @@ -240,11 +248,22 @@ export default { if (this.confirmLoading) return this.form.validateFields((err, values) => { if (!err) { - const value = Object.assign({}, this.model, values) + const params = Object.assign({ + projectId: this.projectId + }, this.model, values) this.confirmLoading = true - this.$emit('ok', value) - this.confirmLoading = false - this.close() + const fn = params.id ? editInspectPlanTable : addInspectPlanTable + fn(params).then(res => { + if (res.success) { + this.$emit('ok', params) + this.$message.success(res.message) + this.close() + } else { + this.$message.warn(res.message) + } + }).finally(() => { + this.confirmLoading = false + }) } }) }, diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue index 04a524ca..8913134f 100644 --- a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue +++ b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue @@ -61,7 +61,7 @@ - + @@ -86,6 +86,11 @@ export default { currentNode: { type: String, required: true + }, + // 项目id + projectId: { + type: String, + required: true } }, data () { @@ -93,7 +98,10 @@ export default { EsInspectionPlan, disableMixinCreated: true, url: { - list: '/process/processEsInspectPlan/page' + list: '/process/processEsInspectPlan/page', + delete: '/process/processEsInspectPlan/delete', + importExcelUrl: '/process/processEsInspectPlan/importExcel', + deleteBatch: '/process/processEsInspectPlan/deleteBatch' }, model: {}, dataSource: [], @@ -168,7 +176,7 @@ export default { title: this.$t('workCenter.esInspectionPlan.departmentPersonnel'), align: 'center', width: 120, - dataIndex: 'departmentPersonnel', + dataIndex: 'objectOfConsultation', showCodeList: [EsInspectionPlan.initiate.value], scopedSlots: { customRender: 'text' } }, @@ -217,6 +225,12 @@ export default { ] } }, + watch: { + // 列表查询带上项目id + projectId () { + this.filters.projectId = this.projectId + } + }, computed: { // 是否发起节点和联络人汇总节点 isInitiateOrLiaisonCollect () { @@ -242,23 +256,6 @@ export default { getData () { return this.dataSource }, - // 表单提交 - addOrEditOk (formData) { - console.log(formData) - if (formData.id) { - // 编辑 - for (let i = 0; i < this.dataSource.length; i++) { - if (this.dataSource[i].id === formData.id) { - this.dataSource.splice(i, 1, formData) - return - } - } - } else { - // 添加 - formData.id = this.dataSource.length - this.dataSource.push(formData) - } - }, // 更新表格数据 updateData (list) { this.dataSource = list || []