ソースを参照

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002390 1 年間 前
コミット
521ad1fe05

+ 54 - 5
src/components/super-table/index.vue

@@ -52,6 +52,10 @@ export default {
       type: Function,
       default: () => {},
     },
+    //
+    storageKey: {
+      type: String,
+    },
   },
   components: {
     ElDictTag: () => import("@/components/DictTag/index.vue"),
@@ -72,11 +76,15 @@ export default {
     IconFilter: () => import("./once/filters.vue"),
   },
   data() {
-    const { columns } = this.$props;
-    const innerColumns = columns.map(({ item, attr }) => ({
-      attr,
-      item: { hidden: true, ...item },
-    }));
+    const { columns, storageKey } = this.$props;
+    const localColumns = localStorage.getItem(storageKey);
+    const innerColumns =
+      storageKey && localColumns
+        ? JSON.parse(localColumns)
+        : columns.map(({ item, attr }) => ({
+            attr,
+            item: { hidden: true, ...item },
+          }));
     return {
       innerColumns: innerColumns,
       rowKey: "id",
@@ -160,10 +168,32 @@ export default {
         );
       }
     },
+    // 宽度
+    onWidth(newProp, oldProp, column) {
+      this.innerColumns = this.innerColumns.map(({ item, attr }) => ({
+        attr,
+        item: {
+          ...item,
+          width: item.key === column.property ? newProp : item.width,
+        },
+      }));
+      if (this.$props.storageKey) {
+        localStorage.setItem(
+          this.$props.storageKey,
+          JSON.stringify(this.innerColumns)
+        );
+      }
+    },
     // 冻结
     onHide(prop) {
       this.$nextTick(() => {
         this.$refs.superTable.doLayout();
+        if (this.$props.storageKey) {
+          localStorage.setItem(
+            this.$props.storageKey,
+            JSON.stringify(this.innerColumns)
+          );
+        }
       });
     },
     // 排序
@@ -172,18 +202,36 @@ export default {
       this.$nextTick(() => {
         this.$refs.superTable.sort(key, sort);
         this.$refs.superTable.doLayout();
+        if (this.$props.storageKey) {
+          localStorage.setItem(
+            this.$props.storageKey,
+            JSON.stringify(this.innerColumns)
+          );
+        }
       });
     },
     // 冻结
     onFreeze() {
       this.$nextTick(() => {
         this.$refs.superTable.doLayout();
+        if (this.$props.storageKey) {
+          localStorage.setItem(
+            this.$props.storageKey,
+            JSON.stringify(this.innerColumns)
+          );
+        }
       });
     },
     // 过滤
     onFilter() {
       this.$nextTick(() => {
         this.$refs.superTable.doLayout();
+        if (this.$props.storageKey) {
+          localStorage.setItem(
+            this.$props.storageKey,
+            JSON.stringify(this.innerColumns)
+          );
+        }
       });
     },
     onFilters(value) {
@@ -232,6 +280,7 @@ export default {
       :highlight-current-row="radio"
       @row-click="onRowClick"
       @selection-change="onSelectionChange"
+      @header-dragend="onWidth"
       v-bind="$attrs"
       v-on="$listeners"
       style="flex: 1"

+ 1 - 1
src/views/purchase/PurchaseDemandList/add.vue

@@ -609,7 +609,7 @@ export default {
       customerOptions: [],
       pickerOptionsEnd: {
         disabledDate: (time) => {
-          return time.getTime() < Date.now() - 1 * 24 * 60 * 60 * 1000
+          return time.getTime() < new Date(this.basicForm.demandDate).getTime() - 8.64e7
         }
       },
       isBDXQ: false,

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

@@ -314,7 +314,7 @@ export default function useColumns() {
               const { taxPrice = 0, recentlyPrice = 0 } = prop;
               return (prop.priceDiffer = (
                 Number(taxPrice) - Number(recentlyPrice)
-              ).toFixed(CONFIG.precision));
+              ));
             },
           },
         },
@@ -338,7 +338,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -349,7 +349,7 @@ export default function useColumns() {
               const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
               return (prop.yAffectedAmount = (
                 Number(priceDiffer) * Number(yPurchaseQuantity)
-              ).toFixed(CONFIG.precision));
+              ));
             },
           },
         },

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

@@ -103,9 +103,10 @@ export default {
           recentlyPrice,
           isApprovalFirst,
           isPriceAdjustment,
-          tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate).toFixed(6),
+          tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
           createByName: createByName,
           updateByName: createByName,
+          id: null,
         });
       }
     },

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

@@ -314,7 +314,7 @@ export default function useColumns() {
               const { taxPrice = 0, recentlyPrice = 0 } = prop;
               return (prop.priceDiffer = (
                 Number(taxPrice) - Number(recentlyPrice)
-              ).toFixed(CONFIG.precision));
+              ));
             },
           },
         },
@@ -338,7 +338,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -349,7 +349,7 @@ export default function useColumns() {
               const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
               return (prop.yAffectedAmount = (
                 Number(priceDiffer) * Number(yPurchaseQuantity)
-              ).toFixed(CONFIG.precision));
+              ));
             },
           },
         },

+ 7 - 4
src/views/purchase/apply/copy/index.vue

@@ -119,9 +119,10 @@ export default {
           recentlyPrice,
           isApprovalFirst,
           isPriceAdjustment,
-          tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate).toFixed(6),
+          tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
           createByName: createByName,
           updateByName: createByName,
+          id: null,
         });
       }
     },
@@ -141,13 +142,13 @@ export default {
             ...this.$init.params(TableColumns),
             ...item,
           }));
-          return true;
         } else {
-          return false;
+          this.visible = false;
         }
       } catch (err) {
         // catch
         console.error(err);
+        this.visible = false;
       } finally {
         // finally
         this.loading = false;
@@ -155,10 +156,10 @@ export default {
     },
     //
     async onOpen() {
+      this.visible = true;
       const {
         selectData: [{ id }],
       } = this.$props;
-      this.visible = await this.fetchItem(id);
       this.params.id = null;
       this.params.createBy = null;
       this.params.priceCode = null;
@@ -173,6 +174,7 @@ export default {
         updateByName: null,
         delFlag: 0,
       }));
+      await this.fetchItem(id);
     },
     //
     async onHide() {
@@ -214,6 +216,7 @@ export default {
         if (valid) {
           try {
             this.loading = true;
+            this.params.priceApplyOrgs = [];
             const { msg, code } = await SAVE(this.params);
             if (code === 200) {
               this.onHide();

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

@@ -314,7 +314,7 @@ export default function useColumns() {
               const { taxPrice = 0, recentlyPrice = 0 } = prop;
               return (prop.priceDiffer = (
                 Number(taxPrice) - Number(recentlyPrice)
-              ).toFixed(CONFIG.precision));
+              ));
             },
           },
         },
@@ -338,7 +338,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -349,7 +349,7 @@ export default function useColumns() {
               const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
               return (prop.yAffectedAmount = (
                 Number(priceDiffer) * Number(yPurchaseQuantity)
-              ).toFixed(CONFIG.precision));
+              ));
             },
           },
         },

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

@@ -142,9 +142,10 @@ export default {
           recentlyPrice,
           isApprovalFirst,
           isPriceAdjustment,
-          tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate).toFixed(6),
+          tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
           createByName: createByName,
           updateByName: createByName,
+          id: null,
         });
       }
     },

+ 6 - 1
src/views/purchase/apply/index.vue

@@ -103,7 +103,11 @@ export default {
     ></el-super-search>
     <el-row class="my-4" style="text-align: right">
       <el-button-group>
-        <add-button :size="size" :dict="dict" @success="useQuery(params, page)"></add-button>
+        <add-button
+          :size="size"
+          :dict="dict"
+          @success="useQuery(params, page)"
+        ></add-button>
         <copy-button
           :size="size"
           :dict="dict"
@@ -152,6 +156,7 @@ export default {
       checkbox
       pagination
       convenitentOperation
+      storage-key="PuchaseApplySuperTable1"
       @row-dblclick="useSee"
       @row-select="useSelect"
       @pagination="useQuery(params, page)"

+ 17 - 17
src/views/purchase/apply/see/columns.js

@@ -100,7 +100,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -109,7 +109,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -118,7 +118,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -127,7 +127,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -199,7 +199,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -209,7 +209,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -219,7 +219,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -228,7 +228,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -242,7 +242,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -251,7 +251,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -260,7 +260,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -274,7 +274,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -283,7 +283,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -292,7 +292,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -306,7 +306,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -315,7 +315,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -324,7 +324,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },

+ 2 - 2
src/views/purchase/catalogue/columns.js

@@ -28,7 +28,7 @@ export default function useColumns() {
       attr: {
         formatter: (prop) => {
           const { taxPrice = 0 } = prop;
-          return (taxPrice * 1).toFixed(CONFIG.precision);
+          return taxPrice * 1;
         },
       },
     },
@@ -45,7 +45,7 @@ export default function useColumns() {
       attr: {
         formatter: (prop) => {
           const { convertRate = 0 } = prop;
-          return (convertRate * 1).toFixed(CONFIG.precision);
+          return convertRate * 1;
         },
       },
     },

+ 1 - 1
src/views/purchase/catalogue/export/index.vue

@@ -30,7 +30,7 @@ export default {
               await this.download(
                 "/pu/price/catalogue/exportByIds",
                 { ids: ids },
-                `catalogue_${new Date().getTime()}.xlsx`
+                `价格目录_${new Date().getTime()}.xlsx`
               );
               await done();
             } catch (err) {

+ 1 - 0
src/views/purchase/catalogue/index.vue

@@ -147,6 +147,7 @@ export default {
       checkbox
       pagination
       convenitentOperation
+      storage-key="PuchaseCatalogueSuperTable1"
       @row-dblclick="useSee"
       @selection-change="useSelect"
       @pagination="useQuery(params, page)"

+ 2 - 2
src/views/purchase/catalogue/see/columns.js

@@ -22,7 +22,7 @@ export default function useColumns() {
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          return (prop * 1);
         },
       },
     },
@@ -36,7 +36,7 @@ export default function useColumns() {
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          return (prop * 1);
         },
       },
     },

+ 2 - 2
src/views/purchase/contract/add/columns.js

@@ -414,7 +414,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { qty = 0, taxPrice = 0 } = prop;
-              prop.taxMoney = (qty * taxPrice * 1).toFixed(CONFIG.precision);
+              prop.taxMoney = (qty * taxPrice * 1);
               return prop.taxMoney;
             },
           },
@@ -440,7 +440,7 @@ export default function useColumns() {
                 qty *
                 (taxPrice / (tax / 100 + 1)) *
                 1
-              ).toFixed(CONFIG.precision);
+              );
               return prop.taxFreeMoney;
             },
           },

+ 3 - 3
src/views/purchase/contract/columns.js

@@ -13,7 +13,7 @@ export default function useColumns() {
       attr: {
         formatter: (prop) => {
           const { lastPuMoney = 0 } = prop;
-          return (lastPuMoney * 1).toFixed(CONFIG.precision);
+          return (lastPuMoney * 1);
         },
       },
     },
@@ -31,7 +31,7 @@ export default function useColumns() {
       attr: {
         formatter: (prop) => {
           const { puMoneyYear = 0 } = prop;
-          return (puMoneyYear * 1).toFixed(CONFIG.precision);
+          return (puMoneyYear * 1);
         },
       },
     },
@@ -237,7 +237,7 @@ export default function useColumns() {
       attr: {
         formatter: (prop) => {
           const { taxPrice = 0 } = prop;
-          return (taxPrice * 1).toFixed(CONFIG.precision);
+          return (taxPrice * 1);
         },
       },
     },

+ 2 - 2
src/views/purchase/contract/edit/columns.js

@@ -413,7 +413,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { qty = 0, taxPrice = 0 } = prop;
-              prop.taxMoney = (qty * taxPrice * 1).toFixed(CONFIG.precision);
+              prop.taxMoney = (qty * taxPrice * 1);
               return prop.taxMoney;
             },
           },
@@ -439,7 +439,7 @@ export default function useColumns() {
                 qty *
                 (taxPrice / (tax / 100 + 1)) *
                 1
-              ).toFixed(CONFIG.precision);
+              );
               return prop.taxFreeMoney;
             },
           },

+ 1 - 1
src/views/purchase/contract/export/index.vue

@@ -38,7 +38,7 @@ export default {
               await this.download(
                 "pu/contract/export",
                 { ...data, pageNum, pageSize },
-                `contract_${new Date().getTime()}.xlsx`
+                `采购合同_${new Date().getTime()}.xlsx`
               );
               await done();
             } catch (err) {

+ 1 - 0
src/views/purchase/contract/index.vue

@@ -182,6 +182,7 @@ export default {
       checkbox
       pagination
       convenitentOperation
+      storage-key="PuchaseContractSuperTable1"
       @row-dblclick="useSee"
       @selection-change="useSelect"
       @pagination="useQuery(params, page)"

+ 2 - 2
src/views/purchase/contract/see/columns.js

@@ -411,7 +411,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { qty = 0, taxPrice = 0 } = prop;
-              prop.taxMoney = (qty * taxPrice * 1).toFixed(CONFIG.precision);
+              prop.taxMoney = (qty * taxPrice * 1);
               return prop.taxMoney;
             },
           },
@@ -437,7 +437,7 @@ export default function useColumns() {
                 qty *
                 (taxPrice / (tax / 100 + 1)) *
                 1
-              ).toFixed(CONFIG.precision);
+              );
               return prop.taxFreeMoney;
             },
           },

+ 3 - 3
src/views/purchase/task/xie-yi-zhi-cai/column.js

@@ -44,7 +44,7 @@ export const TableColumns = [
     attr: {
       is: "el-computed-input-v2",
       formatter: (prop) => {
-        return (prop * 1).toFixed(CONFIG.precision);
+        return (prop * 1);
       },
     },
   },
@@ -53,7 +53,7 @@ export const TableColumns = [
     attr: {
       is: "el-computed-input-v2",
       formatter: (prop) => {
-        return (prop * 1).toFixed(CONFIG.precision);
+        return (prop * 1);
       },
     },
   },
@@ -62,7 +62,7 @@ export const TableColumns = [
     attr: {
       is: "el-computed-input-v2",
       formatter: (prop) => {
-        return (prop * 1).toFixed(CONFIG.precision);
+        return (prop * 1);
       },
     },
   },