| | |
| | | // 编辑 |
| | | this.$nextTick(() => { |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | console.log(key) |
| | | // if (key !== 'saveDuSolutionDTOList') { |
| | | this.form[key] = target[key] |
| | | // } |
| | | } |
| | | console.log(this.form) |
| | | }) |
| | | }, |
| | | // 确认新建 |
| | | __confirmCreate () { |
| | | this.$refs.form.validate((valid) => { |
| | | if (!valid) { |
| | | return |
| | | } |
| | | for (let i = 0; i < this.form.saveDuSolutionDTOList.length; i++) { |
| | | if (!this.form.saveDuSolutionDTOList[i].solutionId) { |
| | | this.$message.warning(`第${i + 1}项保险方案为空!`) |
| | | return |
| | | } |
| | | for (let a = 0; a < this.form.saveDuSolutionDTOList[i].saveDuWorkTypeDTOList.length; a++) { |
| | | if (!this.form.saveDuSolutionDTOList[i].saveDuWorkTypeDTOList[a].workTypeId) { |
| | | this.$message.warning(`第${i + 1}项保险方案第${a + 1}项工种为空!`) |
| | | return |
| | | } |
| | | } |
| | | } |
| | | // 调用新建接口 |
| | | this.isWorking = true |
| | | this.api.create(this.form) |
| | | .then(() => { |
| | | this.visible = false |
| | | this.$tip.apiSuccess('新建成功') |
| | | this.$emit('success') |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }) |
| | | }, |
| | | // 确认修改 |
| | | __confirmEdit () { |
| | | this.$refs.form.validate((valid) => { |