黄梓星 1 rok temu
rodzic
commit
bba3d85e99

+ 11 - 15
src/views/purchase/apply/add/columns.js

@@ -336,40 +336,36 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, recentlyPrice = 0 } = prop;
-              return (prop.increase = recentlyPrice
-                ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(
-                    2
-                  )
-                : "0.00");
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%' : "0.0%");
             },
           },
         },
 
         {
-          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "ypurchaseQuantity", title: "预计年采购量" },
           attr: {
-            is: "el-computed-input-v2",
+            // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : prop * 1;
+              return prop.ypurchaseQuantity
             },
           },
         },
         {
-          item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
+          item: { width: 100, key: "ypurchaseVolume", title: "预计年采购额" },
           attr: {
             formatter: (prop) => {
-              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
+              const { taxPrice = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.ypurchaseVolume = (Number(taxPrice) * Number(ypurchaseQuantity)).toFixed(2));
             },
           },
         },
         {
-          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
+          item: { width: 100, key: "yaffectedAmount", title: "预计年影响金额" },
           attr: {
             formatter: (prop) => {
-              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yAffectedAmount =
-                Number(priceDiffer) * Number(yPurchaseQuantity));
+              const { priceDiffer = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.yaffectedAmount =
+                Number(priceDiffer) * Number(ypurchaseQuantity));
             },
           },
         },

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

@@ -336,36 +336,36 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, recentlyPrice = 0 } = prop;
-              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(2) : "0.00");
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%' : "0.0%");
             },
           },
         },
 
         {
-          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "ypurchaseQuantity", title: "预计年采购量" },
           attr: {
-            is: "el-computed-input-v2",
+            // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
+              return prop.ypurchaseQuantity
             },
           },
         },
         {
-          item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
+          item: { width: 100, key: "ypurchaseVolume", title: "预计年采购额" },
           attr: {
             formatter: (prop) => {
-              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
+              const { taxPrice = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.ypurchaseVolume = (Number(taxPrice) * Number(ypurchaseQuantity)).toFixed(2));
             },
           },
         },
         {
-          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
+          item: { width: 100, key: "yaffectedAmount", title: "预计年影响金额" },
           attr: {
             formatter: (prop) => {
-              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yAffectedAmount = (
-                Number(priceDiffer) * Number(yPurchaseQuantity)
+              const { priceDiffer = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.yaffectedAmount = (
+                Number(priceDiffer) * Number(ypurchaseQuantity)
               ));
             },
           },

+ 12 - 16
src/views/purchase/apply/edit/columns.js

@@ -87,7 +87,7 @@ export default function useColumns() {
     },
     {
       item: { key: "sourceType", title: "来源单据类型" },
-      attr: { is: "el-input", disabled: true, readonly: true },
+      attr: { is: "el-select", dictName: "price_source", disabled: true, readonly: true },
     },
     {
       item: { key: "status", title: "单据状态" },
@@ -336,40 +336,36 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, recentlyPrice = 0 } = prop;
-              return (prop.increase = recentlyPrice
-                ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(
-                    2
-                  )
-                : "0.00");
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%': "0.0%");
             },
           },
         },
 
         {
-          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "ypurchaseQuantity", title: "预计年采购量" },
           attr: {
-            is: "el-computed-input-v2",
+            // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
+              return prop.ypurchaseQuantity
             },
           },
         },
         {
-          item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
+          item: { width: 100, key: "ypurchaseVolume", title: "预计年采购额" },
           attr: {
             formatter: (prop) => {
-              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
+              const { taxPrice = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.ypurchaseVolume = (Number(taxPrice) * Number(ypurchaseQuantity)).toFixed(2));
             },
           },
         },
         {
-          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
+          item: { width: 100, key: "yaffectedAmount", title: "预计年影响金额" },
           attr: {
             formatter: (prop) => {
-              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yAffectedAmount = (
-                Number(priceDiffer) * Number(yPurchaseQuantity)
+              const { priceDiffer = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.yaffectedAmount = (
+                Number(priceDiffer) * Number(ypurchaseQuantity)
               ));
             },
           },

+ 13 - 10
src/views/purchase/apply/see/columns.js

@@ -51,7 +51,10 @@ export default function useColumns() {
     },
     {
       item: { width: 100, key: "sourceType", title: "来源单据类型" },
-      attr: {},
+      attr: {
+        is: "el-dict-tag",
+        dictName: "price_source",
+      },
     },
     {
       item: { width: 100, key: "status", title: "单据状态" },
@@ -213,33 +216,33 @@ export default function useColumns() {
         {
           item: { width: 100, key: "increase", title: "涨幅" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
+              const { priceDiffer = 0, recentlyPrice = 0 } = prop;
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%' : "0.0%");
             },
           },
         },
 
         {
-          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "ypurchaseQuantity", title: "预计年采购量" },
           attr: {
-            is: "el-computed-input-v2",
+            // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
+              return prop.ypurchaseQuantity
             },
           },
         },
         {
-          item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
+          item: { width: 100, key: "ypurchaseVolume", title: "预计年采购额" },
           attr: {
             formatter: (prop) => {
-              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
+              const { taxPrice = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.ypurchaseVolume = (Number(taxPrice) * Number(ypurchaseQuantity)).toFixed(2));
             },
           },
         },
         {
-          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
+          item: { width: 100, key: "yaffectedAmount", title: "预计年影响金额" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {

+ 4 - 1
src/views/purchase/catalogue/see/columns.js

@@ -30,7 +30,10 @@ export default function useColumns() {
     { item: { width:100,key: "effectiveDate", title: "价格生效日期" }, attr: {} },
     { item: { width:100,key: "endDate", title: "价格失效日期" }, attr: {} },
     { item: { width:100,key: "buyerName", title: "采购员" }, attr: {} },
-    { item: { width:100,key: "source", title: "来源单据" }, attr: {} },
+    { item: { width:100,key: "source", title: "来源单据" }, attr: {
+      is: "el-dict-tag",
+      dictName: "price_source",
+    } },
     {
       item: { width:100,key: "convertRate", title: "换算率" },
       attr: {