|
|
@@ -614,32 +614,30 @@ export default {
|
|
|
return this.form.tableList;
|
|
|
},
|
|
|
async setTableValue(val) {
|
|
|
- const tableList = JSON.parse(JSON.stringify(val));
|
|
|
- for (let i = 0; i < tableList.length; i++) {
|
|
|
- const item = tableList[i];
|
|
|
- // if (!item.feeType) {
|
|
|
- // item.feeType = '1';
|
|
|
- // }
|
|
|
-
|
|
|
- item.feeType = (item.feeType || '1').toString();
|
|
|
- item.categoryCode = item.categoryCode || item.code;
|
|
|
- item.categoryName = item.categoryName || item.name;
|
|
|
- if (item.typeId == 2) {
|
|
|
- const warehouseList = await getIdWarehouseList({
|
|
|
- categoryId: item.categoryId
|
|
|
- });
|
|
|
- item.warehouseList = warehouseList;
|
|
|
- if (item.warehouseId) {
|
|
|
- item.warehouseNum = await getWarehouseOutStock({
|
|
|
- warehouseId: item.warehouseId,
|
|
|
- code: item.categoryCode
|
|
|
- });
|
|
|
- }
|
|
|
+ const tableList = JSON.parse(JSON.stringify(val));
|
|
|
+ for (let i = 0; i < tableList.length; i++) {
|
|
|
+ const item = tableList[i];
|
|
|
+ item.feeType = (item.feeType || '1').toString();
|
|
|
+ item.categoryCode = item.categoryCode || item.code;
|
|
|
+ item.categoryName = item.categoryName || item.name;
|
|
|
+ if (item.typeId == 2) {
|
|
|
+ const warehouseList = await getIdWarehouseList({ categoryId: item.categoryId });
|
|
|
+ item.warehouseList = warehouseList;
|
|
|
+ if (item.warehouseId) {
|
|
|
+ const matchedWarehouse = warehouseList.find(wh => wh.warehouseId === item.warehouseId);
|
|
|
+ if (matchedWarehouse) {
|
|
|
+ item.warehouseName = matchedWarehouse.warehouseName; // 同步仓库名
|
|
|
}
|
|
|
+ item.warehouseNum = await getWarehouseOutStock({
|
|
|
+ warehouseId: item.warehouseId,
|
|
|
+ code: item.categoryCode
|
|
|
+ });
|
|
|
}
|
|
|
- this.$set(this.form, 'tableList', tableList);
|
|
|
- this.calculatePrice();
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$set(this.form, 'tableList', tableList);
|
|
|
+ this.calculatePrice();
|
|
|
+},
|
|
|
totalCountChange(index, data, name) {
|
|
|
data[name] = data[name].replace(/[^\d]/g, '').replace(/^0+/, '') || '0';
|
|
|
let row = this.form.tableList[index];
|