@@ -142,8 +142,8 @@
-
-
+
@@ -479,7 +479,6 @@
// 销售合同收入明细
incomeDetails: [],
processType: "",
- selectedDepts: []
}
}
@@ -602,7 +601,7 @@
},
submit() {
- this.$refs["saleContractProcessForm"].validate((valid) => {
+ this.$refs["contractProcessForm"].validate((valid) => {
if (valid) {
const fileList = this.fileList
if (fileList.length === 0) {
@@ -646,7 +645,7 @@
}
}
- if (!processForm.applyDeptLeaderId) {
+ if (!processForm.applyDeptId) {
this.$message.error("申请部门还未选择");
return false
}
@@ -659,9 +658,11 @@
background: 'rgba(0, 0, 0, 0.7)'
})
+ const applyDeptId = processForm.applyDeptId.map(level => level.id).join(',') // (逗号分割)
const form = {
...processForm,
processType,
+ applyDeptId,
projectTitle: this.projectTitle,
attachments: fileList.map(file => ({
uri: file.response.data.url,
@@ -746,7 +747,6 @@
const level1Value = value[0]
const level2Value = value.length >= 2 && value[1]
const level3Value = value.length === 3 && value[2]
- let opt;
const find = (options, value) => {
return options.find(option => option.id === value)
@@ -757,27 +757,19 @@
leveled.push(selected)
if (selected && level2Value) {
selected = find(selected.children, level2Value)
+ leveled.push(selected)
if (selected && level3Value) {
- leveled.push(selected)
selected = find(selected.children, level3Value)
if (selected) {
leveled.push(selected)
- opt = selected
}
}
- else {
- opt = selected
- }
- }
- else {
- opt = selected
}
- this.selectedDepts = leveled.map(level => level.id)
+ // applyDeptId 提交时处理
this.processForm['applyDept'] = leveled.map(level => level.name).join(',') // (逗号分割)
- this.processForm['applyDeptId'] = leveled.map(level => level.id).join(',') // (逗号分割)
- this.processForm['applyDeptLeaderId'] = opt.leaderId
- this.processForm['applyDeptLeaderName'] = opt.leaderName
+ this.processForm['applyDeptLeaderId'] = selected.leaderId
+ this.processForm['applyDeptLeaderName'] = selected.leaderName
},
}