diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue
index c9585eff..b33ef433 100644
--- a/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue
+++ b/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue
@@ -345,11 +345,13 @@ export default {
async getPageParams (isValidate = true) {
// 去除备注必填
this.validatorRules.remarks.rules[0].required = false
- if (this.$refs.inspectionPlanTable.dataSource.length === 0) {
+ if (isValidate && this.$refs.inspectionPlanTable.dataSource.length === 0) {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
throw new Error('base')
}
const params = {}
+ // 业务表信息
+ params.processEsInspectPlanList = this.$refs.inspectionPlanTable.dataSource
// 收集所有表单信息
let formDataList = []
if (isValidate) {
diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanDrawer.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanDrawer.vue
index c2891442..e3df4580 100644
--- a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanDrawer.vue
+++ b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanDrawer.vue
@@ -28,7 +28,7 @@
@@ -52,7 +52,7 @@
@@ -64,19 +64,20 @@
@@ -104,7 +105,6 @@ 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'
import { EsInspectionPlan, StandardSource } from '@/enums/commonEnums'
export default {
@@ -228,7 +228,9 @@ export default {
}
]
}
- }
+ },
+ // 如果是编辑用到下标记录数据
+ index: -1
}
},
created () {
@@ -244,6 +246,16 @@ export default {
}
},
methods: {
+ // 选择人员回调
+ nameChangeCallback (name, field) {
+ console.log(name, field)
+ this.model[field] = name
+ },
+ // 选择部门回调
+ backDepartCallback (data, field) {
+ console.log(data, field)
+ this.model[field] = data ? data.map(item => item.text).join(',') : ''
+ },
add () {
const obj = {}
// 如果是节点2,征求意见对象默认回显自己,并且禁用
@@ -253,7 +265,8 @@ export default {
}
this.edit(obj)
},
- edit (record) {
+ edit (record, index) {
+ this.index = index
this.visible = true
this.form.resetFields()
this.model = Object.assign({}, record)
@@ -265,22 +278,26 @@ export default {
if (this.confirmLoading) return
this.form.validateFields((err, values) => {
if (!err) {
- const params = Object.assign({
- projectId: this.projectId
- }, this.model, values)
- this.confirmLoading = true
- 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
- })
+ // 调整前端存储
+ const row = Object.assign({}, this.model, values)
+ this.$emit('ok', row, this.index)
+ this.close()
+ // const params = Object.assign({
+ // projectId: this.projectId
+ // }, this.model, values)
+ // this.confirmLoading = true
+ // 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
+ // })
}
})
},
@@ -288,6 +305,7 @@ export default {
this.close()
},
close () {
+ this.index = -1
this.model = {}
this.visible = false
},
diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue
index 9f0b2b42..0c84835f 100644
--- a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue
+++ b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue
@@ -59,9 +59,9 @@
-
+
-
+
@@ -274,6 +274,22 @@ export default {
this.filters.taskId = this.$route.query.taskId
},
methods: {
+ // 编辑弹框
+ handleEdit (record, index) {
+ this.$refs.modalForm.edit(record, index)
+ this.$refs.modalForm.title = this.$t('edit')
+ this.$refs.modalForm.disableSubmit = false
+ },
+ // 添加回调
+ handleAddOrEditCallback (row, index) {
+ console.log(row, index)
+ // index -1就是添加
+ if (index === -1) {
+ this.dataSource.push(row)
+ } else {
+ this.dataSource.splice(index, 1, row)
+ }
+ },
// 是否显示意见
isShowOpinion (record) {
const list = record.processEsInspectPlanOpinionList || []
@@ -315,8 +331,16 @@ export default {
this.$refs.writeOpinionModal.show(record)
},
// 填写意见
- handleWriteOpinion (record) {
- this.$refs.writeOpinionModal.show(record)
+ handleWriteOpinion (record, index) {
+ this.$refs.writeOpinionModal.show(record, index)
+ },
+ // 填写意见回调
+ handleWriteOpinionCallback (data, index) {
+ this.dataSource.splice(index, 1, {
+ ...this.dataSource[index],
+ // 填写意见的数据
+ processEsInspectPlanOpinion: data
+ })
},
// 查看所属部门意见
showDepartOpinion (record) {
diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/WriteOpinionModal.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/WriteOpinionModal.vue
index 4f797d9b..dbf0f637 100644
--- a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/WriteOpinionModal.vue
+++ b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/WriteOpinionModal.vue
@@ -34,7 +34,7 @@
-
@@ -45,13 +45,11 @@