Prechádzať zdrojové kódy

🐞 fix([drp-价格申报单]): 预计年采购额

	重新提报20240314191、20240304084  【无税单价、单价差、涨幅、预计年影响金额】这些字段是前端计算,滚动条没有拉动到对应字段的位置,前端没有加载计算,导致没有取到值。 临时解决方案:价格申报单新增填写好,拉动向滚动条往右边走一遍。这样字段都能取到值。  永久解决方案:字段取值由前端改后端计算

增加预计年采购额     20240506187                  ——v2
002390 1 rok pred
rodič
commit
2cb22236b2

+ 9 - 0
src/api/business/purchase/apply.js

@@ -74,4 +74,13 @@ export function PRICE(data) {
     method: "POST",
     data: data,
   });
+}
+
+// 复制批量获取调价类型、单价差、涨幅、预计年影响金额
+export function BATCHPRICE(data) {
+  return request({
+    url: `/pu/price/catalogue/batchGetPriceData`,
+    method: "POST",
+    data: data,
+  });
 }

+ 4 - 4
src/views/purchase/apply/add/columns.js

@@ -316,10 +316,10 @@ export default function useColumns() {
         {
           item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
           attr: {
-            formatter: (prop) => {
-              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
-            },
+            // formatter: (prop) => {
+            //   const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
+            //   return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
+            // },
           },
         },
         {

+ 16 - 1
src/views/purchase/apply/add/index.vue

@@ -1,7 +1,7 @@
 <script>
 import useColumns from "./columns";
 import { EXIST } from "@/api/business/purchase/catalogue";
-import { SAVE,PRICE} from "@/api/business/purchase/apply";
+import { SAVE, PRICE, BATCHPRICE } from "@/api/business/purchase/apply";
 import { tax, unit, currency } from "@/components/popover-select-v2/fetch";
 // 用于回显参照框数据
 import { getRefer } from "@/api/purchase/basic.js";
@@ -395,6 +395,7 @@ export default {
             // console.log(this.params[prop])
             this.$modal.closeLoading();
           }
+          await this.batchPrice(this.params.priceApplyItems);
         } else if (scope.column.property == "supplierName") {
           if (this.params[prop].length <= 1) {
             this.params[prop][index].supplierName = rows[0];
@@ -491,6 +492,19 @@ export default {
         this.$modal.closeLoading();
       }
     },
+    // 复制含税单价,查询价格
+    async batchPrice(prop) {
+      try {
+        this.loading = true;
+        let { code, data } = await BATCHPRICE(prop);
+        if (code === 200) {
+          this.params.priceApplyItems = data;
+        }
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
+    },
     // 含税单价
     async changeTaxPrice(val, prop) {
       try {
@@ -508,6 +522,7 @@ export default {
           prop.increase = data.increase;
           prop.priceDiffer = data.priceDiffer;
           prop.yAffectedAmount = data.yAffectedAmount;
+          prop.yPurchaseVolume = data.yPurchaseVolume;
         }
       } catch (error) {
       } finally {

+ 4 - 4
src/views/purchase/apply/copy/columns.js

@@ -316,10 +316,10 @@ export default function useColumns() {
         {
           item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
           attr: {
-            formatter: (prop) => {
-              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
-            },
+            // formatter: (prop) => {
+            //   const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
+            //   return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
+            // },
           },
         },
         {

+ 18 - 1
src/views/purchase/apply/copy/index.vue

@@ -1,7 +1,7 @@
 <script>
 import useColumns from "./columns";
 import { EXIST } from "@/api/business/purchase/catalogue";
-import { ITEM, SAVE, PRICE } from "@/api/business/purchase/apply";
+import { ITEM, SAVE, PRICE, BATCHPRICE } from "@/api/business/purchase/apply";
 import { tax, unit, currency } from "@/components/popover-select-v2/fetch";
 // 用于回显参照框数据
 import { getRefer } from "@/api/purchase/basic.js";
@@ -446,6 +446,8 @@ export default {
             // console.log(this.params[prop])
             this.$modal.closeLoading();
           }
+
+          await this.batchPrice(this.params.priceApplyItems);
         } else if (scope.column.property == "supplierName") {
           if (this.params[prop].length <= 1) {
             this.params[prop][index].supplierName = rows[0];
@@ -542,6 +544,20 @@ export default {
         this.$modal.closeLoading();
       }
     },
+
+    // 复制含税单价,查询价格
+    async batchPrice(prop) {
+      try {
+        this.loading = true;
+        let { code, data } = await BATCHPRICE(prop);
+        if (code === 200) {
+          this.params.priceApplyItems = data;
+        }
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
+    },
     // 含税单价
     async changeTaxPrice(val, prop) {
       try {
@@ -559,6 +575,7 @@ export default {
           prop.increase = data.increase;
           prop.priceDiffer = data.priceDiffer;
           prop.yAffectedAmount = data.yAffectedAmount;
+          prop.yPurchaseVolume = data.yPurchaseVolume;
         }
       } catch (error) {
       } finally {

+ 4 - 4
src/views/purchase/apply/edit/columns.js

@@ -316,10 +316,10 @@ export default function useColumns() {
         {
           item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
           attr: {
-            formatter: (prop) => {
-              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
-            },
+            // formatter: (prop) => {
+            //   const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
+            //   return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
+            // },
           },
         },
         {

+ 16 - 1
src/views/purchase/apply/edit/index.vue

@@ -1,7 +1,7 @@
 <script>
 import useColumns from "./columns";
 import { EXIST } from "@/api/business/purchase/catalogue";
-import { ITEM, SAVE, PRICE } from "@/api/business/purchase/apply";
+import { ITEM, SAVE, PRICE, BATCHPRICE } from "@/api/business/purchase/apply";
 import { tax, unit, currency } from "@/components/popover-select-v2/fetch";
 // 用于回显参照框数据
 import { getRefer } from "@/api/purchase/basic.js";
@@ -462,6 +462,7 @@ export default {
             // console.log(this.params[prop])
             this.$modal.closeLoading();
           }
+          await this.batchPrice(this.params.priceApplyItems);
         } else if (scope.column.property == "supplierName") {
           if (this.params[prop].length <= 1) {
             this.params[prop][index].supplierName = rows[0];
@@ -558,6 +559,19 @@ export default {
         this.$modal.closeLoading();
       }
     },
+    // 复制含税单价,查询价格
+    async batchPrice(prop) {
+      try {
+        this.loading = true;
+        let { code, data } = await BATCHPRICE(prop);
+        if (code === 200) {
+          this.params.priceApplyItems = data;
+        }
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
+    },
     // 含税单价
     async changeTaxPrice(val, prop) {
       try {
@@ -575,6 +589,7 @@ export default {
           prop.increase = data.increase;
           prop.priceDiffer = data.priceDiffer;
           prop.yAffectedAmount = data.yAffectedAmount;
+          prop.yPurchaseVolume = data.yPurchaseVolume;
         }
       } catch (error) {
       } finally {