|
@@ -92,7 +92,7 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="供应商方式">
|
|
|
- <el-radio-group v-model="item.supply_type" @change="changeSupply" :disabled="item.is_js">
|
|
|
+ <el-radio-group v-model="item.supply_type" :disabled="item.is_js">
|
|
|
<el-radio label="0">自运</el-radio>
|
|
|
<el-radio label="1">供应商</el-radio>
|
|
|
<el-radio label="2">第三方单位</el-radio>
|
|
@@ -109,13 +109,31 @@
|
|
|
|
|
|
<span v-else-if="item.supply_type == '1'">
|
|
|
<el-form-item label="供应商">
|
|
|
- <el-select v-model="item.client" placeholder="供应商" @change="changeClient" :disabled="item.is_js">
|
|
|
+ <el-select
|
|
|
+ v-model="item.client"
|
|
|
+ placeholder="供应商"
|
|
|
+ @change="
|
|
|
+ val => {
|
|
|
+ changeClient(val, index);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ :disabled="item.is_js"
|
|
|
+ >
|
|
|
<el-option v-for="item in supClientList" :key="item.label" :label="item.name" :value="item.id"> </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="合同">
|
|
|
- <el-select v-model="item.treaty" placeholder="合同" @change="changeTreaty" :disabled="item.is_js">
|
|
|
+ <el-select
|
|
|
+ v-model="item.treaty"
|
|
|
+ placeholder="合同"
|
|
|
+ @change="
|
|
|
+ val => {
|
|
|
+ changeTreaty(val, index);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ :disabled="item.is_js"
|
|
|
+ >
|
|
|
<el-option v-for="item in treatyList" :key="item.label" :label="item.number" :value="item.id"> </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -429,48 +447,42 @@ export default {
|
|
|
const obj = this.userList.find(i => i.id === data);
|
|
|
if (obj) return obj.name;
|
|
|
},
|
|
|
- // 选择运输类型
|
|
|
- // 选择自运&第三方时,路线赋值
|
|
|
- changeSupply(value) {
|
|
|
- // if (value == 0 || value == 2) {
|
|
|
- // this.$set(this.form, `route`, this.depositRoute);
|
|
|
- // }
|
|
|
- console.log(value);
|
|
|
- },
|
|
|
// 选择供应商,查询合同
|
|
|
- async changeClient(value) {
|
|
|
+ async changeClient(value, index) {
|
|
|
let res = await this.treatyQuery({ client: value });
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$set(this, `treatyList`, res.data);
|
|
|
}
|
|
|
+ if (index === true) return;
|
|
|
+ this.detailForm.out_bill[index].treaty = '';
|
|
|
+ this.detailForm.out_bill[index].item = '';
|
|
|
+ this.detailForm.out_bill[index].taxes = '';
|
|
|
},
|
|
|
// 选择合同,查询项目
|
|
|
- async changeTreaty(value) {
|
|
|
+ async changeTreaty(value, index) {
|
|
|
let res = await this.projectQuery({ treaty: value });
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$set(this, `itemList`, res.data);
|
|
|
}
|
|
|
+ if (index === true) return;
|
|
|
+ this.detailForm.out_bill[index].item = '';
|
|
|
+ this.detailForm.out_bill[index].taxes = '';
|
|
|
},
|
|
|
// 选择项目,赋值税率
|
|
|
async changeItem(value, index) {
|
|
|
- if (index) {
|
|
|
+ if (typeof index === 'number') {
|
|
|
const projects = this.itemList.find(item => item.id === value);
|
|
|
let outBill = this.detailForm.out_bill[index];
|
|
|
this.$set(outBill, `taxes`, projects.taxes);
|
|
|
- }
|
|
|
- return;
|
|
|
- },
|
|
|
- //选择供应商方式
|
|
|
- getSupStyle(value) {
|
|
|
- console.log(value);
|
|
|
+ } else return;
|
|
|
},
|
|
|
//是否有供应商
|
|
|
async isTreaty() {
|
|
|
let outList = this.detailForm.out_bill;
|
|
|
for (let item of outList) {
|
|
|
- if (item.client) this.changeClient(item.client);
|
|
|
- if (item.treaty) this.changeTreaty(item.treaty);
|
|
|
- if (item.item) this.changeItem(item.item);
|
|
|
+ if (item.client) this.changeClient(item.client, true);
|
|
|
+ if (item.treaty) this.changeTreaty(item.treaty, true);
|
|
|
+ if (item.item) this.changeItem(item.item, true);
|
|
|
}
|
|
|
},
|
|
|
},
|