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