|
@@ -89,7 +89,7 @@
|
89
|
89
|
:rules="tableRules.contacts"
|
90
|
90
|
>
|
91
|
91
|
<el-input
|
92
|
|
- v-model="scope.row.supply_count"
|
|
92
|
+ v-model="scope.row.name"
|
93
|
93
|
style="width: 80px; margin-top: 3px"
|
94
|
94
|
></el-input>
|
95
|
95
|
</el-form-item>
|
|
@@ -99,7 +99,7 @@
|
99
|
99
|
<el-table-column label="手机" align="center" width="100px">
|
100
|
100
|
<template slot-scope="scope">
|
101
|
101
|
<el-input
|
102
|
|
- v-model="scope.row.supply_price"
|
|
102
|
+ v-model="scope.row.phone"
|
103
|
103
|
style="width: 80px"
|
104
|
104
|
></el-input>
|
105
|
105
|
<div style="visibility: hidden">/</div>
|
|
@@ -109,7 +109,7 @@
|
109
|
109
|
<el-table-column label="联系地址" align="center" width="130px">
|
110
|
110
|
<template slot-scope="scope">
|
111
|
111
|
<el-input
|
112
|
|
- v-model="scope.row.supply_license_number"
|
|
112
|
+ v-model="scope.row.address"
|
113
|
113
|
style="width: 115px"
|
114
|
114
|
></el-input>
|
115
|
115
|
<div style="visibility: hidden">/</div>
|
|
@@ -124,7 +124,7 @@
|
124
|
124
|
<el-form-item :prop="'tableList.' + scope.$index + '.name'">
|
125
|
125
|
<!-- :prop="'tableList.' + scope.$index + '.name'" 如需添加可在上方标签加入 -->
|
126
|
126
|
<el-select
|
127
|
|
- v-model="scope.row.name"
|
|
127
|
+ v-model="scope.row.is_first"
|
128
|
128
|
style="width: 90px"
|
129
|
129
|
placeholder="请选择"
|
130
|
130
|
@change="changeName($event, scope)"
|
|
@@ -280,9 +280,7 @@ export default {
|
280
|
280
|
name: "",
|
281
|
281
|
};
|
282
|
282
|
},
|
283
|
|
- created() {
|
284
|
|
-
|
285
|
|
- },
|
|
283
|
+ created() {},
|
286
|
284
|
methods: {
|
287
|
285
|
show(data, type) {
|
288
|
286
|
if (type == 1) {
|
|
@@ -312,6 +310,7 @@ export default {
|
312
|
310
|
this.supplier.number = "";
|
313
|
311
|
this.supplier.bank = "";
|
314
|
312
|
this.supplier.bankAccount = "";
|
|
313
|
+ this.recordInfo.tableList = [{}];
|
315
|
314
|
},
|
316
|
315
|
|
317
|
316
|
// 获取供应商编码接口
|
|
@@ -398,15 +397,34 @@ export default {
|
398
|
397
|
|
399
|
398
|
// 首次打开新增页面判断是否有首要联系人
|
400
|
399
|
getcontacts(val) {
|
401
|
|
- getsupplyandcontactone({id:val}).then((res) => {
|
402
|
|
- console.log(res, "oo");
|
403
|
|
- });
|
404
|
400
|
let data = {
|
405
|
401
|
value: 0,
|
406
|
402
|
label: "是",
|
407
|
403
|
};
|
|
404
|
+ getsupplyandcontactone({ id: val }).then((res) => {
|
|
405
|
+ console.log(res, "oo");
|
|
406
|
+ if (res.data.code == 0) {
|
|
407
|
+ this.recordInfo.tableList = res.data.data.contact;
|
|
408
|
+ if (this.recordInfo.tableList.length == 0) {
|
|
409
|
+ this.recordInfo.tableList = [{}];
|
|
410
|
+ this.recordInfo.tableList[0].is_first = data;
|
|
411
|
+ this.$forceUpdate();
|
|
412
|
+ } else {
|
|
413
|
+ this.recordInfo.tableList.forEach((o) => {
|
|
414
|
+ if (o.is_first == 0) {
|
|
415
|
+ o.is_first = "否";
|
|
416
|
+ } else if (o.is_first == 1) {
|
|
417
|
+ o.is_first = "是";
|
|
418
|
+ }
|
|
419
|
+ });
|
|
420
|
+ }
|
|
421
|
+
|
|
422
|
+ console.log(this.recordInfo.tableList, "this.recordInfo.tableList");
|
|
423
|
+ }
|
|
424
|
+ });
|
|
425
|
+
|
408
|
426
|
if (this.recordInfo.tableList.length == 1) {
|
409
|
|
- this.recordInfo.tableList[0].name = data;
|
|
427
|
+ this.recordInfo.tableList[0].is_first = data;
|
410
|
428
|
this.$forceUpdate();
|
411
|
429
|
}
|
412
|
430
|
},
|
|
@@ -429,19 +447,19 @@ export default {
|
429
|
447
|
}
|
430
|
448
|
this.recordInfo.tableList.forEach((el, index) => {
|
431
|
449
|
if (scope.$index == index) {
|
432
|
|
- el.name = data;
|
|
450
|
+ el.is_first = data;
|
433
|
451
|
// console.log(scope);
|
434
|
452
|
this.$forceUpdate();
|
435
|
453
|
} else {
|
436
|
|
- el.name = data1;
|
|
454
|
+ el.is_first = data1;
|
437
|
455
|
this.$forceUpdate();
|
438
|
456
|
}
|
439
|
|
- arr.push(el.name.value);
|
|
457
|
+ arr.push(el.is_first.value);
|
440
|
458
|
});
|
441
|
459
|
if (arr.includes(0)) {
|
442
|
460
|
return;
|
443
|
461
|
} else {
|
444
|
|
- this.recordInfo.tableList[0].name = data2;
|
|
462
|
+ this.recordInfo.tableList[0].is_first = data2;
|
445
|
463
|
}
|
446
|
464
|
},
|
447
|
465
|
|