销售合同流程 优化 申请部门验证问题
parent
314b59cf91
commit
5d0e48ea6b
|
@ -91,7 +91,7 @@
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<el-form-item label="申请部门" :rules="[{ required: true, message: '申请部门不能为空'}]" prop="applyDept">
|
<el-form-item label="申请部门" :rules="[{ required: true, message: '申请部门不能为空'}]" prop="applyDept">
|
||||||
<el-cascader :options="applyDeptSectorOptions" clearable v-model="selectedDepts"
|
<el-cascader :options="applyDeptSectorOptions" clearable v-model="processForm.applyDeptId"
|
||||||
:props="{ expandTrigger: 'hover', label:'name', value: 'id'}" @change="applyDeptSelected"></el-cascader>
|
:props="{ expandTrigger: 'hover', label:'name', value: 'id'}" @change="applyDeptSelected"></el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
@ -512,7 +512,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!processForm.applyDeptLeaderId) {
|
if (!processForm.applyDeptId) {
|
||||||
this.$message.error("申请部门还未选择");
|
this.$message.error("申请部门还未选择");
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -524,8 +524,11 @@
|
||||||
background: 'rgba(0, 0, 0, 0.7)'
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const applyDeptId = processForm.applyDeptId.map(level => level.id).join(',') // (逗号分割)
|
||||||
|
|
||||||
const form = {
|
const form = {
|
||||||
...this.processForm,
|
...this.processForm,
|
||||||
|
applyDeptId,
|
||||||
attachments: fileList.map(file => {
|
attachments: fileList.map(file => {
|
||||||
if (file.url) {
|
if (file.url) {
|
||||||
return {
|
return {
|
||||||
|
@ -612,7 +615,6 @@
|
||||||
const level1Value = value[0]
|
const level1Value = value[0]
|
||||||
const level2Value = value.length >= 2 && value[1]
|
const level2Value = value.length >= 2 && value[1]
|
||||||
const level3Value = value.length === 3 && value[2]
|
const level3Value = value.length === 3 && value[2]
|
||||||
let opt;
|
|
||||||
|
|
||||||
const find = (options, value) => {
|
const find = (options, value) => {
|
||||||
return options.find(option => option.id === value)
|
return options.find(option => option.id === value)
|
||||||
|
@ -623,27 +625,20 @@
|
||||||
leveled.push(selected)
|
leveled.push(selected)
|
||||||
if (selected && level2Value) {
|
if (selected && level2Value) {
|
||||||
selected = find(selected.children, level2Value)
|
selected = find(selected.children, level2Value)
|
||||||
if (selected && level3Value) {
|
|
||||||
leveled.push(selected)
|
leveled.push(selected)
|
||||||
|
if (selected && level3Value) {
|
||||||
selected = find(selected.children, level3Value)
|
selected = find(selected.children, level3Value)
|
||||||
if (selected) {
|
if (selected) {
|
||||||
leveled.push(selected)
|
leveled.push(selected)
|
||||||
opt = selected
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
opt = selected
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
opt = selected
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.selectedDepts = leveled.map(level => level.id)
|
this.selectedDepts = leveled.map(level => level.id)
|
||||||
this.processForm['applyDept'] = leveled.map(level => level.name).join(',') // (逗号分割)
|
this.processForm['applyDept'] = leveled.map(level => level.name).join(',') // (逗号分割)
|
||||||
this.processForm['applyDeptId'] = leveled.map(level => level.id).join(',') // (逗号分割)
|
this.processForm['applyDeptId'] = leveled.map(level => level.id).join(',') // (逗号分割)
|
||||||
this.processForm['applyDeptLeaderId'] = opt.leaderId
|
this.processForm['applyDeptLeaderId'] = selected.leaderId
|
||||||
this.processForm['applyDeptLeaderName'] = opt.leaderName
|
this.processForm['applyDeptLeaderName'] = selected.leaderName
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
<#-- 新增销售合同流程 -->
|
<#-- 新增销售合同流程 -->
|
||||||
|
|
||||||
<div class="am-u-sm-12 am-u-md-12" v-cloak v-if="isSalesContractMode || isProcurementContractMode">
|
<div class="am-u-sm-12 am-u-md-12" v-cloak v-if="isSalesContractMode || isProcurementContractMode">
|
||||||
<el-form :inline="true" ref="saleContractProcessForm" :model="processForm" label-position="right" label-width="110px">
|
<el-form :inline="true" ref="contractProcessForm" :model="processForm" label-position="right" label-width="110px">
|
||||||
|
|
||||||
<div class="am-form-inline">
|
<div class="am-form-inline">
|
||||||
<el-tooltip :disabled="projectSelected" effect="light" content="项目编号或名称,支持模糊查询" placement="top-end">
|
<el-tooltip :disabled="projectSelected" effect="light" content="项目编号或名称,支持模糊查询" placement="top-end">
|
||||||
|
@ -142,8 +142,8 @@
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<el-form-item label="申请部门" :rules="[{ required: true, message: '申请部门不能为空'}]" prop="applyDept">
|
<el-form-item label="申请部门" prop="applyDeptId" :rules="[{ required: true, message: '申请部门不能为空'}]">
|
||||||
<el-cascader :options="applyDeptSectorOptions" clearable v-model="selectedDepts"
|
<el-cascader :options="applyDeptSectorOptions" clearable v-model="processForm.applyDeptId"
|
||||||
:props="{ expandTrigger: 'hover', label:'name', value: 'id'}" @change="applyDeptSelected"></el-cascader>
|
:props="{ expandTrigger: 'hover', label:'name', value: 'id'}" @change="applyDeptSelected"></el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
@ -479,7 +479,6 @@
|
||||||
// 销售合同收入明细
|
// 销售合同收入明细
|
||||||
incomeDetails: [],
|
incomeDetails: [],
|
||||||
processType: "",
|
processType: "",
|
||||||
selectedDepts: []
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -602,7 +601,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
submit() {
|
submit() {
|
||||||
this.$refs["saleContractProcessForm"].validate((valid) => {
|
this.$refs["contractProcessForm"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const fileList = this.fileList
|
const fileList = this.fileList
|
||||||
if (fileList.length === 0) {
|
if (fileList.length === 0) {
|
||||||
|
@ -646,7 +645,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!processForm.applyDeptLeaderId) {
|
if (!processForm.applyDeptId) {
|
||||||
this.$message.error("申请部门还未选择");
|
this.$message.error("申请部门还未选择");
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -659,9 +658,11 @@
|
||||||
background: 'rgba(0, 0, 0, 0.7)'
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const applyDeptId = processForm.applyDeptId.map(level => level.id).join(',') // (逗号分割)
|
||||||
const form = {
|
const form = {
|
||||||
...processForm,
|
...processForm,
|
||||||
processType,
|
processType,
|
||||||
|
applyDeptId,
|
||||||
projectTitle: this.projectTitle,
|
projectTitle: this.projectTitle,
|
||||||
attachments: fileList.map(file => ({
|
attachments: fileList.map(file => ({
|
||||||
uri: file.response.data.url,
|
uri: file.response.data.url,
|
||||||
|
@ -746,7 +747,6 @@
|
||||||
const level1Value = value[0]
|
const level1Value = value[0]
|
||||||
const level2Value = value.length >= 2 && value[1]
|
const level2Value = value.length >= 2 && value[1]
|
||||||
const level3Value = value.length === 3 && value[2]
|
const level3Value = value.length === 3 && value[2]
|
||||||
let opt;
|
|
||||||
|
|
||||||
const find = (options, value) => {
|
const find = (options, value) => {
|
||||||
return options.find(option => option.id === value)
|
return options.find(option => option.id === value)
|
||||||
|
@ -757,27 +757,19 @@
|
||||||
leveled.push(selected)
|
leveled.push(selected)
|
||||||
if (selected && level2Value) {
|
if (selected && level2Value) {
|
||||||
selected = find(selected.children, level2Value)
|
selected = find(selected.children, level2Value)
|
||||||
if (selected && level3Value) {
|
|
||||||
leveled.push(selected)
|
leveled.push(selected)
|
||||||
|
if (selected && level3Value) {
|
||||||
selected = find(selected.children, level3Value)
|
selected = find(selected.children, level3Value)
|
||||||
if (selected) {
|
if (selected) {
|
||||||
leveled.push(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['applyDept'] = leveled.map(level => level.name).join(',') // (逗号分割)
|
||||||
this.processForm['applyDeptId'] = leveled.map(level => level.id).join(',') // (逗号分割)
|
this.processForm['applyDeptLeaderId'] = selected.leaderId
|
||||||
this.processForm['applyDeptLeaderId'] = opt.leaderId
|
this.processForm['applyDeptLeaderName'] = selected.leaderName
|
||||||
this.processForm['applyDeptLeaderName'] = opt.leaderName
|
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue