销售合同流程
parent
bbe3398982
commit
be0cbceee2
|
@ -143,7 +143,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
|
<el-cascader :options="applyDeptSectorOptions" clearable v-model="processForm.applyDept"
|
||||||
:props="{ expandTrigger: 'click', label:'name', value: 'id'}" @change="applyDeptSelected"></el-cascader>
|
:props="{ expandTrigger: 'click', label:'name', value: 'id'}" @change="applyDeptSelected"></el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
@ -285,6 +285,7 @@
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
<#-- 供应商比选材料 -->
|
||||||
<div class="am-u-sm-12 am-u-md-12 supplierChoose" v-if="isProcurementContractMode">
|
<div class="am-u-sm-12 am-u-md-12 supplierChoose" v-if="isProcurementContractMode">
|
||||||
<el-alert title="供应商比选材料" type="success" center :closable="false"></el-alert>
|
<el-alert title="供应商比选材料" type="success" center :closable="false"></el-alert>
|
||||||
|
|
||||||
|
@ -731,43 +732,45 @@
|
||||||
applyDeptSelected(value) {
|
applyDeptSelected(value) {
|
||||||
console.log(value)
|
console.log(value)
|
||||||
const sectorOptions = this.applyDeptSectorOptions
|
const sectorOptions = this.applyDeptSectorOptions
|
||||||
|
if (value.length === 0) {
|
||||||
|
this.processForm['applyDept'] = null
|
||||||
|
this.processForm['applyDeptId'] = null
|
||||||
|
this.processForm['applyDeptLeaderId'] = null
|
||||||
|
this.processForm['applyDeptLeaderName'] = null
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
let opt;
|
||||||
|
|
||||||
const find = (options, value) => {
|
const find = (options, value) => {
|
||||||
for (let option in options) {
|
return options.find(option => option.id === value)
|
||||||
if (option.id === value) {
|
|
||||||
return option
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const leveled = []
|
const leveled = []
|
||||||
for (let options in sectorOptions) {
|
let selected = find(sectorOptions, level1Value)
|
||||||
let op = find(options, level1Value)
|
leveled.push(selected)
|
||||||
leveled.push(op)
|
if (selected && level2Value) {
|
||||||
if (op && level2Value) {
|
selected = find(selected.children, level2Value)
|
||||||
op = find(op.children, level1Value)
|
if (selected && level3Value) {
|
||||||
leveled.push(op)
|
leveled.push(selected)
|
||||||
if (op && level3Value) {
|
selected = find(selected.children, level3Value)
|
||||||
op = find(op.children, level1Value)
|
if (selected) {
|
||||||
leveled.push(op)
|
leveled.push(selected)
|
||||||
if (op) {
|
opt = selected
|
||||||
opt = op
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
opt = op
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
opt = op
|
opt = selected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
opt = selected
|
||||||
|
}
|
||||||
|
|
||||||
this.processForm['applyDept'] = 2
|
this.processForm['applyDept'] = leveled.map(level => level.name).join(',')
|
||||||
this.processForm['applyDeptId'] = opt.id
|
this.processForm['applyDeptId'] = opt.id
|
||||||
this.processForm['applyDeptLeaderId'] = opt.leaderId
|
this.processForm['applyDeptLeaderId'] = opt.leaderId
|
||||||
this.processForm['applyDeptLeaderName'] = opt.leaderName
|
this.processForm['applyDeptLeaderName'] = opt.leaderName
|
||||||
|
@ -818,8 +821,6 @@
|
||||||
methods,
|
methods,
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.newProcurementContractClick();
|
|
||||||
this.handleSelectProject({ id: 135, name: '' })
|
|
||||||
this.applyDeptSectorOptions = JSON.parse('${applyDeptSectorOptions}')
|
this.applyDeptSectorOptions = JSON.parse('${applyDeptSectorOptions}')
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue