|
@@ -13,13 +13,13 @@ const categoryMixins = function () {
|
|
|
list: [],
|
|
|
total: 0,
|
|
|
layout:'total, prev, pager, next, jumper',
|
|
|
- shopsRadio: null,
|
|
|
+ productSelRadio: null,
|
|
|
isLoading: true
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
disabled() {
|
|
|
- return this.shopsRadio === null
|
|
|
+ return this.productSelRadio === null
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
@@ -43,7 +43,17 @@ const categoryMixins = function () {
|
|
|
SupplierApi.getShopProductList(this.listQuery, function (res) {
|
|
|
if (res.code === 0) {
|
|
|
const data = res.data
|
|
|
+ if(_this.disguiseForm.products.length>0){
|
|
|
+ data.results.forEach((item) => {
|
|
|
+ // 在disguiseForm.products数组中查找是否存在与当前元素的productId匹配的元素
|
|
|
+ const prosItem = _this.disguiseForm.products.find((prosItem) => prosItem.productId === item.productId);
|
|
|
+ if (prosItem) {
|
|
|
+ item.flag = false; // 如果找到匹配的productId,将flag设置为false
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
_this.list = data.results
|
|
|
+ console.log('list',_this.list)
|
|
|
_this.total = data.totalRecord
|
|
|
_this.isLoading = false
|
|
|
}
|
|
@@ -51,12 +61,12 @@ const categoryMixins = function () {
|
|
|
},
|
|
|
// 选择供应商
|
|
|
handleSelectionChange(row) {
|
|
|
- this.shopsRadio = row
|
|
|
+ this.productSelRadio = row
|
|
|
console.log('row', row)
|
|
|
},
|
|
|
// 确认选择供应商
|
|
|
handleConfirm() {
|
|
|
- this.disguiseForm.products = this.shopsRadio
|
|
|
+ this.disguiseForm.products =[...this.disguiseForm.products, ...this.productSelRadio]
|
|
|
this.handleCanle()
|
|
|
},
|
|
|
handleCanle() {
|