|
@@ -61,8 +61,7 @@
|
|
|
:formatter="(row) => dictDataEcho(row.goodsType, productTypeList)"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="单位12312312" prop="goodsUnit">
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column label="单位" prop="goodsUnit"> </el-table-column>
|
|
|
|
|
|
<el-table-column label="采购数量" prop="quantity">
|
|
|
</el-table-column>
|
|
@@ -113,7 +112,7 @@
|
|
|
|
|
|
<script>
|
|
|
import labelTitle from "@/components/label-title/index.vue";
|
|
|
-import * as API from "@/api/purchase-management/purchase/index.js";
|
|
|
+import { getSupplierPrice } from "@/api/purchase-management/purchase/index.js";
|
|
|
import { supplyPriceList } from "@/api/product-material/supply/priceMaintenance.js";
|
|
|
|
|
|
import { getToken } from "@/util/auth";
|
|
@@ -175,6 +174,7 @@ export default {
|
|
|
materialType: "",
|
|
|
},
|
|
|
tableList: [],
|
|
|
+ priceData: {},
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -205,7 +205,25 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handleChangeSupply(val) {
|
|
|
- // const current = this.tableList.find((x) => x.supplierId === val);
|
|
|
+ const productIdList = this.form.goodsList.map((x) => {
|
|
|
+ return x.goodsId;
|
|
|
+ });
|
|
|
+ getSupplierPrice({ supplierId: val, productIdList }).then((res) => {
|
|
|
+ const priceData = res.data.data;
|
|
|
+ for (let i = 0; i < this.form.goodsList.length; i++) {
|
|
|
+ const x = this.form.goodsList[i];
|
|
|
+ if (Object.keys(priceData).length > 0) {
|
|
|
+ for (const key in priceData) {
|
|
|
+ if (x.goodsId === key) {
|
|
|
+ this.form.goodsList[i].unitPrice = priceData[key];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.form.goodsList[i].unitPrice = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
};
|