Эх сурвалжийг харах

优化代码,整理列表字段

002390 2 жил өмнө
parent
commit
09d8371e1d

+ 1 - 53
src/views/purchase/purchase-order/add/index.vue

@@ -1,7 +1,6 @@
 <script>
 <script>
 import orderApi from "@/api/business/purchase/purchase-order";
 import orderApi from "@/api/business/purchase/purchase-order";
 import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
 import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
-import { async } from "q";
 import { Columns, TabColumns } from "./column";
 import { Columns, TabColumns } from "./column";
 
 
 const NewColumns = initColumns(Columns);
 const NewColumns = initColumns(Columns);
@@ -65,33 +64,6 @@ export default {
       },
       },
       deep: true,
       deep: true,
     },
     },
-    // "params.puOrg": {
-    //   handler(nVal, oVal) {
-    //     console.log('nVal', nVal, 'oVal',oVal);
-    //     console.log(this.isCopy, 'this.isCopy');
-    //     // 组织变化
-    //     // if (this.visible && nVal.puOrg != oVal.puOrg) {
-    //     if (this.visible && oVal && nVal != oVal) {
-    //       for (const key in this.params) {
-    //         if (Array.isArray(this.params[key])) {
-    //           this.params[key] = [];
-    //         } else if (
-    //           key != "puOrg" &&
-    //           key != "puOrgName" &&
-    //           key != "buyer" &&
-    //           key != "buyerName" &&
-    //           key != "puDept" &&
-    //           key != "puDeptName" &&
-    //           key != "status"
-    //         ) {
-    //           this.params[key] = "";
-    //         } else {
-    //         }
-    //       }
-    //     }
-    //   },
-    //   deep: true,
-    // },
   },
   },
   methods: {
   methods: {
     beforeOpen() {
     beforeOpen() {
@@ -307,31 +279,7 @@ export default {
           }
           }
       })
       })
     },
     },
-    // 保存并新增
-    async handleSubmit() {
-      this.judgeSaveCondition(async()=>{
-        try {
-          const createById = this.params.buyer;
-          const createByName = this.params.buyerName;
-          const updateById = this.$store.state.user.id;
-          const updateByName = this.$store.state.user.name;
-          const { code, msg } = await orderApi.create({
-            createById,
-            createByName,
-            updateById,
-            updateByName,
-            ...this.params,
-          });
-          if (code === 200) {
-            this.setVisible(false);
-          }
-        } catch (err) {
-          this.$notify.error({ title: "error", message: err });
-        } finally {
-          // this.setVisible(false);
-        }
-      })
-    },
+   
     // 主表参照改变之后
     // 主表参照改变之后
    async handleReferChange(val, type, source){
    async handleReferChange(val, type, source){
       // 供应商选择  
       // 供应商选择  

+ 51 - 67
src/views/purchase/purchase-order/column.js

@@ -1,12 +1,9 @@
 import {
 import {
-  initPage,
-  initParams,
   initColumns,
   initColumns,
   initDicts,
   initDicts,
 } from "@/utils/init";
 } from "@/utils/init";
 
 
 export const TableColumns = [
 export const TableColumns = [
-  // { key: "id", title: "主键" },
   // { key: "puOrg", title: "采购组织" },
   // { key: "puOrg", title: "采购组织" },
   { key: "puOrgName", title: "采购组织", inputType: "Input" },
   { key: "puOrgName", title: "采购组织", inputType: "Input" },
   {
   {
@@ -24,7 +21,6 @@ export const TableColumns = [
     referName: "documents_status", // 字典名
     referName: "documents_status", // 字典名
   },
   },
   { key: "billDate", title: "订单日期",width:100,},
   { key: "billDate", title: "订单日期",width:100,},
-  // { key: "supplier", title: "供应商" },
   { key: "supplierName", title: "供应商", inputType: "Input" },
   { key: "supplierName", title: "供应商", inputType: "Input" },
   { key: "paymentAgreementName", title: "付款协议" },
   { key: "paymentAgreementName", title: "付款协议" },
   {
   {
@@ -36,11 +32,8 @@ export const TableColumns = [
   },
   },
   // { key: "paymentAgreement", title: "付款协议" },
   // { key: "paymentAgreement", title: "付款协议" },
   
   
-  // { key: "buyer", title: "采购员" },ut
   { key: "buyerName", title: "采购员" ,width:100,},
   { key: "buyerName", title: "采购员" ,width:100,},
-  // { key: "puDept", title: "采购部门" },
   { key: "puDeptName", title: "采购部门" },
   { key: "puDeptName", title: "采购部门" },
-  // { key: "customer", title: "收货客户" },
   { key: "customerName", title: "收货客户" },
   { key: "customerName", title: "收货客户" },
   // { 
   // { 
   //   key: "isDeliver", 
   //   key: "isDeliver", 
@@ -73,7 +66,6 @@ export const TableColumns = [
   //   title: "由销售订单协同生成",
   //   title: "由销售订单协同生成",
   //   inputType: 'Checkbox',
   //   inputType: 'Checkbox',
   // },
   // },
-  // { key: "personal", title: "人员" },
   { key: "personalName", title: "人员" ,width:120,},
   { key: "personalName", title: "人员" ,width:120,},
   // { key: "isSendSrm", title: "是否同步SRM" },
   // { key: "isSendSrm", title: "是否同步SRM" },
   {
   {
@@ -86,11 +78,8 @@ export const TableColumns = [
   { key: "deductionMoney", title: "订单抵扣余款金额" ,},
   { key: "deductionMoney", title: "订单抵扣余款金额" ,},
   // { key: "warehouse", title: "WMS入库仓库" },
   // { key: "warehouse", title: "WMS入库仓库" },
   { key: "warehouseName", title: "收货仓库" }, //WMS入库仓库名称
   { key: "warehouseName", title: "收货仓库" }, //WMS入库仓库名称
-  // { key: "goodsAllocation", title: "货位" },
   { key: "goodsAllocationName", title: "货位" },
   { key: "goodsAllocationName", title: "货位" },
-  // { key: "customerDept", title: "客户部门" },
   { key: "customerDeptName", title: "客户部门" },
   { key: "customerDeptName", title: "客户部门" },
-  // { key: "supplierContacts", title: "供应商业务联系人" },
   { key: "supplierContactsName", title: "供应商业务联系人" },
   { key: "supplierContactsName", title: "供应商业务联系人" },
   {
   {
     key: "isUrgency",
     key: "isUrgency",
@@ -98,7 +87,6 @@ export const TableColumns = [
     inputType: 'Checkbox',
     inputType: 'Checkbox',
     width:80,
     width:80,
   },
   },
-  // { key: "agent", title: "代理人" }, // 建议删除
   { key: "agentName", title: "代理人" },
   { key: "agentName", title: "代理人" },
   {
   {
     key: "isClose",
     key: "isClose",
@@ -148,37 +136,37 @@ export const TabColumns = [
       { key: "rowNo", title: "行号",width:80, },
       { key: "rowNo", title: "行号",width:80, },
       // { key: "orderId", title: "采购订单ID" },
       // { key: "orderId", title: "采购订单ID" },
       { key: "material", title: "物料ID" },
       { key: "material", title: "物料ID" },
-      { key: "materialName", title: "物料名称", width: 180 },
-      { key: "materialCode", title: "物料编码", width: 180 },
-      // { key: "materialClassify", title: "物料分类", width: 180 },
-      { key: "materialManufacturersCode", title: "厂家物料编码", width: 180 },
-      { key: "specification", title: "规格", width: 180 },
-      { key: "model", title: "型号", width: 180 },
+      { key: "materialName", title: "物料名称",  },
+      { key: "materialCode", title: "物料编码",  },
+      // { key: "materialClassify", title: "物料分类",  },
+      { key: "materialManufacturersCode", title: "厂家物料编码",  },
+      { key: "specification", title: "规格",  },
+      { key: "model", title: "型号",  },
       {
       {
         key: "isMedcine",
         key: "isMedcine",
         title: "医药物料",
         title: "医药物料",
         inputType: 'Checkbox',
         inputType: 'Checkbox',
         width:80,
         width:80,
       },
       },
-      { key: "manufacturerName", title: "生产厂家代理人", width: 180 },
+      { key: "manufacturerName", title: "生产厂家代理人",  },
       { 
       { 
         key: "isDrug", 
         key: "isDrug", 
         title: "物料药品属性",
         title: "物料药品属性",
         inputType: 'Checkbox',
         inputType: 'Checkbox',
         width:80, 
         width:80, 
       },
       },
-      { key: "unitName", title: "单位", width: 180 },
-      { key: "qty", title: "数量" },
+      { key: "unitName", title: "单位", width: 120 },
+      { key: "qty", title: "数量",width:120, },
       // { key: "currency", title: "币种" },
       // { key: "currency", title: "币种" },
       { key: "currencyName", title: "币种" },
       { key: "currencyName", title: "币种" },
-      { key: "taxPrice", title: "含税单价" },
-      { key: "money", title: "价税合计" },
-      { key: "tax", title: "税率" },
-      { key: "taxDeductMoneya", title: "折扣金额" },
-      { key: "arrivalQty", title: "已到货数量" },
-      { key: "unarrivedQty", title: "未到货数量" },
-      { key: "price", title: "无税单价" },
-      { key: "notaxMoney", title: "无税金额" },
+      { key: "taxPrice", title: "含税单价" ,width:120,},
+      { key: "money", title: "价税合计" ,width:120,},
+      { key: "tax", title: "税率" ,width:120,},
+      { key: "taxDeductMoneya", title: "折扣金额",width:120, },
+      { key: "arrivalQty", title: "已到货数量" ,width:120,},
+      { key: "unarrivedQty", title: "未到货数量" ,width:120,},
+      { key: "price", title: "无税单价" ,width:120,},
+      { key: "notaxMoney", title: "无税金额" ,width:120,},
       { key: "priceSource", title: "价格目录ID" },
       { key: "priceSource", title: "价格目录ID" },
       {
       {
         key: "isStorage",
         key: "isStorage",
@@ -210,14 +198,14 @@ export const TabColumns = [
         inputType: 'Checkbox',
         inputType: 'Checkbox',
         width:80,
         width:80,
       },
       },
-      { key: "warehouse", title: "收货仓库", width: 180 },
-      { key: "place", title: "收货地点", width: 180 },
-      { key: "address", title: "收货地址", width: 180 },
-      { key: "productBatch", title: "产品批号", width: 180 },
-      { key: "manufactureDate", title: "生产日期", width: 180 },
-      { key: "efficacyLoseDate", title: "有效期至/失效日期", width: 180 },
-      { key: "approvalNumber", title: "批准文号", width: 180 },
-      { key: "registration", title: "注册证号", width: 180 },
+      { key: "warehouse", title: "收货仓库",  },
+      { key: "place", title: "收货地点",  },
+      { key: "address", title: "收货地址",  },
+      { key: "productBatch", title: "产品批号",  },
+      { key: "manufactureDate", title: "生产日期",  },
+      { key: "efficacyLoseDate", title: "有效期至/失效日期",  },
+      { key: "approvalNumber", title: "批准文号",  },
+      { key: "registration", title: "注册证号",  },
       {
       {
         key: "storageCondition",
         key: "storageCondition",
         title: "存储条件",
         title: "存储条件",
@@ -248,18 +236,18 @@ export const TabColumns = [
         inputType: 'Checkbox',
         inputType: 'Checkbox',
         width:80,
         width:80,
       },
       },
-      { key: "originalQty", title: "原始数量" },
-      { key: "originalMoney", title: "原始金额" },
-      { key: "directProductBatch", title: "直运产品批号", width: 180 },
-      { key: "discountRule", title: "折扣规则编码", width: 180 },
-      { key: "reservedQty", title: "预留数量" },
-      { key: "reservedPeriod", title: "预留周期", width: 180 },
+      { key: "originalQty", title: "原始数量" ,width:120,},
+      { key: "originalMoney", title: "原始金额" ,width:120,},
+      { key: "reservedQty", title: "预留数量",width:120, },
+      { key: "reservedPeriod", title: "预留周期",  },
       { key: "taxDeductClassify", title: "扣税类别" },
       { key: "taxDeductClassify", title: "扣税类别" },
-      { key: "exchangeRate", title: "折本汇率" },
-      { key: "source", title: "上游单据号", width: 180 },
-      { key: "sourceId", title: "上游单据ID", width: 180 },
-      { key: "demandCode", title: "采购需求单号", width: 180 },
-      { key: "arrivalDatePlan", title: "计划到货日期", width: 180 },
+      { key: "exchangeRate", title: "折本汇率" ,width:100,},
+      { key: "directProductBatch", title: "直运产品批号",  },
+      { key: "discountRule", title: "折扣规则编码",  },
+      { key: "source", title: "上游单据号",  },
+      { key: "sourceId", title: "上游单据ID",  },
+      { key: "demandCode", title: "采购需求单号",  },
+      { key: "arrivalDatePlan", title: "计划到货日期",  },
       {
       {
         key: "priceType",
         key: "priceType",
         title: "价格类型",
         title: "价格类型",
@@ -272,10 +260,10 @@ export const TabColumns = [
         inputType: 'Checkbox',
         inputType: 'Checkbox',
         width:80,
         width:80,
        },
        },
-      { key: "materialClassifyOneName", title: "物料一级分类", width: 180 },
-      { key: "materialClassifyTwoName", title: "物料二级分类", width: 180 },
-      { key: "materialClassifyThreeName", title: "物料三级分类", width: 180 },
-      { key: "materialClassifyFourName", title: "物料四级分类", width: 180 },
+      { key: "materialClassifyOneName", title: "物料一级分类",  },
+      { key: "materialClassifyTwoName", title: "物料二级分类",  },
+      { key: "materialClassifyThreeName", title: "物料三级分类",  },
+      { key: "materialClassifyFourName", title: "物料四级分类",  },
       { key: "createByName", title: "创建人",width:100, },
       { key: "createByName", title: "创建人",width:100, },
       { key: "updateByName", title: "更新人" ,width:100,},
       { key: "updateByName", title: "更新人" ,width:100,},
       
       
@@ -285,24 +273,20 @@ export const TabColumns = [
     title: '执行结果',
     title: '执行结果',
     key: 'puOrderExecuteList',
     key: 'puOrderExecuteList',
     tableColumns: [
     tableColumns: [
-      // { key: "id", title: "主键" },
-      // { key: "orderId", title: "采购订单ID", width: 180 },
+      // { key: "orderId", title: "采购订单ID",  },
       { key: "rowno", title: "行号",width:80, },
       { key: "rowno", title: "行号",width:80, },
-      { key: "material", title: "物料ID", width: 180 },
-      { key: "materialName", title: "物料名称", width: 180 },
+      { key: "material", title: "物料ID", },
+      { key: "materialName", title: "物料名称", },
       { key: "specification", title: "规格" },
       { key: "specification", title: "规格" },
-      { key: "qty", title: "数量" },
-      { key: "stroageQty", title: "累计到货主数量" },
-      { key: "stockQty", title: "累计入库主数量" },
-      { key: "invoiceQty", title: "累计开票主数量" },
-      { key: "rollbackQty", title: "累计退货主数量" },
-      { key: "backStockQty", title: "累计退库主数量" },
+      { key: "qty", title: "数量",width:120, },
+      { key: "stroageQty", title: "累计到货主数量",width:120,  },
+      { key: "stockQty", title: "累计入库主数量",width:120,  },
+      { key: "invoiceQty", title: "累计开票主数量",width:120,  },
+      { key: "rollbackQty", title: "累计退货主数量",width:120,  },
+      { key: "backStockQty", title: "累计退库主数量",width:120,  },
       { key: "floatQty", title: "未到货数量" },
       { key: "floatQty", title: "未到货数量" },
-      // { key: "tenantId", title: "租户号" },
-      // { key: "revision", title: "乐观锁" },
-      { key: "createByName", title: "创建人名称", width: 180 },
-      { key: "updateByName", title: "更新人名称", width: 180 },
-      // { key: "delFlag", title: "删除标记" }
+      { key: "createByName", title: "创建人名称", },
+      { key: "updateByName", title: "更新人名称", },
     ]
     ]
   },
   },
 ];
 ];

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

@@ -1,8 +1,7 @@
 <script>
 <script>
-// import { Columns, TabColumns } from "../add/column";
 import { editColumns, editTabColumns, forbidden, SelectColumns } from "./initColumn";
 import { editColumns, editTabColumns, forbidden, SelectColumns } from "./initColumn";
 import orderApi from "@/api/business/purchase/purchase-order";
 import orderApi from "@/api/business/purchase/purchase-order";
-import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
+import {  initDicts, initRules, initParams } from "@/utils/init";
 
 
 export default {
 export default {
   name: "EditPurchaseOrderDrawer",
   name: "EditPurchaseOrderDrawer",

+ 6 - 3
src/views/purchase/purchase-order/index.vue

@@ -5,10 +5,8 @@ import orderApi from "@/api/business/purchase/purchase-order";
 import {
 import {
   initPage,
   initPage,
   initParams,
   initParams,
-  initColumns,
   initDicts,
   initDicts,
 } from "@/utils/init";
 } from "@/utils/init";
-import { clearTimeout } from "timers";
 
 
 
 
 export default {
 export default {
@@ -23,6 +21,7 @@ export default {
     const initTabColumns = () => TabColumns;
     const initTabColumns = () => TabColumns;
     return {
     return {
       loading: false,
       loading: false,
+      tabLoading:false,
       isSimpleSearch: true,
       isSimpleSearch: true,
       pageSizes: [10, 20, 50, 100],
       pageSizes: [10, 20, 50, 100],
       page: initPage(),
       page: initPage(),
@@ -154,6 +153,7 @@ export default {
       this.timeOut = setTimeout(async () =>{
       this.timeOut = setTimeout(async () =>{
 
 
         try {
         try {
+          this.tabLoading = true;
           this.primaryResource = row;
           this.primaryResource = row;
           this.checkedTabList = [];
           this.checkedTabList = [];
           const { code, msg, data } = await orderApi.details(row.id);
           const { code, msg, data } = await orderApi.details(row.id);
@@ -164,6 +164,9 @@ export default {
             }
             }
           }
           }
         } catch (err) {}
         } catch (err) {}
+        finally{
+          this.tabLoading = false;
+        }
       },this.timer)
       },this.timer)
       
       
     },
     },
@@ -599,7 +602,7 @@ export default {
       @pagination="fetchList(params, page)"
       @pagination="fetchList(params, page)"
     />
     />
    
    
-    <div style="position: relative; padding-top: 10px;">
+    <div style="position: relative; padding-top: 10px;" v-loading="tabLoading">
       <el-row style="position: absolute; top: 30px; right: 20px;z-index: 10;">
       <el-row style="position: absolute; top: 30px; right: 20px;z-index: 10;">
         <el-button 
         <el-button 
           size="mini" 
           size="mini"