|
@@ -41,13 +41,15 @@ Component({
|
|
|
icon: "none"
|
|
icon: "none"
|
|
|
})
|
|
})
|
|
|
res.data = res.data.map(value => {
|
|
res.data = res.data.map(value => {
|
|
|
- if (value.attinfos.length == 0) return value;
|
|
|
|
|
- value.attinfos = file.fileList(value.attinfos)
|
|
|
|
|
- let image = value.attinfos.find(v => v.fileType == "image");
|
|
|
|
|
- value.cover = image ? image.cover : "";
|
|
|
|
|
|
|
+ if (value.attinfos.length != 0) {
|
|
|
|
|
+ value.attinfos = file.fileList(value.attinfos)
|
|
|
|
|
+ let image = value.attinfos.find(v => v.fileType == "image");
|
|
|
|
|
+ value.cover = image ? image.cover : "";
|
|
|
|
|
+ }
|
|
|
value.className = value.itemclass.length == 0 ? "暂无类目" : value.itemclass.map(v => v.itemclassname);
|
|
value.className = value.itemclass.length == 0 ? "暂无类目" : value.itemclass.map(v => v.itemclassname);
|
|
|
value.brandName = value.brand.length == 0 ? "暂无品牌" : value.brand.map(v => v.brandname);
|
|
value.brandName = value.brand.length == 0 ? "暂无品牌" : value.brand.map(v => v.brandname);
|
|
|
- value.discountrate = value.discountrate * 100;
|
|
|
|
|
|
|
+ value.discountrate = (value.discountrate * 100).toFixed(2);
|
|
|
|
|
+ value.price = (value.price - 0).toFixed(2);
|
|
|
return value;
|
|
return value;
|
|
|
})
|
|
})
|
|
|
this.setData({
|
|
this.setData({
|
|
@@ -90,7 +92,6 @@ Component({
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
- console.log("添加产品", params)
|
|
|
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
|
url: '/packageA/select/product/select?params=' + JSON.stringify(params)
|
|
url: '/packageA/select/product/select?params=' + JSON.stringify(params)
|
|
|
})
|
|
})
|
|
@@ -153,12 +154,8 @@ Component({
|
|
|
changeQueue({
|
|
changeQueue({
|
|
|
detail
|
|
detail
|
|
|
}) {
|
|
}) {
|
|
|
- let i = queue.findIndex(v => v.itemid == detail.itemid);
|
|
|
|
|
- if (i == -1) {
|
|
|
|
|
- queue.push(detail)
|
|
|
|
|
- } else {
|
|
|
|
|
- queue[i] = detail;
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ let i = queue.findIndex(v => v.sa_contract_itemsid == detail.sa_contract_itemsid);
|
|
|
|
|
+ i == -1 ? queue.push(detail) : queue[i] = detail;
|
|
|
clearTimeout(downCounter)
|
|
clearTimeout(downCounter)
|
|
|
downCounter = setTimeout(() => {
|
|
downCounter = setTimeout(() => {
|
|
|
this.changeItem(queue)
|
|
this.changeItem(queue)
|
|
@@ -175,7 +172,26 @@ Component({
|
|
|
}
|
|
}
|
|
|
}, false).then(res => {
|
|
}, false).then(res => {
|
|
|
console.log("合同批量修改产品清单", res)
|
|
console.log("合同批量修改产品清单", res)
|
|
|
- // if (res.msg != '成功') console
|
|
|
|
|
|
|
+ queue = [];
|
|
|
|
|
+ let list = this.data.list;
|
|
|
|
|
+ if (res.msg != '成功') {
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ title: res.msg,
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ })
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ list
|
|
|
|
|
+ })
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ items.forEach(v => {
|
|
|
|
|
+ v.discountrate = (v.discountrate * 100).toFixed(2);
|
|
|
|
|
+ let i = list.findIndex(value => v.sa_contract_itemsid == value.sa_contract_itemsid);
|
|
|
|
|
+ if (i != -1) this.data.list[i] = {
|
|
|
|
|
+ ...list[i],
|
|
|
|
|
+ ...v
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|