瀏覽代碼

配置采购订单修订页面参照以及字典

002390 2 年之前
父節點
當前提交
6b3c7697ec

+ 24 - 0
src/views/input-dialog/components/ALLOCATION_PARAM.js

@@ -0,0 +1,24 @@
+// 货位
+export default [
+  // 树
+  // {
+  //   key: "warehouse",
+  //   title: "仓库ID",
+  //   type: "Input",
+  //   search: true,
+  // },
+  // {
+  //   key: "warehouse_name",
+  //   title: "仓库名称",
+  //   type: "Input",
+  //   search: true,
+  // },
+  // {
+  //   key: "",
+  //   title: "备注",
+  // },
+  // {
+  //   key: "",
+  //   title: "助记码",
+  // },
+];

+ 22 - 0
src/views/input-dialog/components/CUSTOMERDEPT_PARAM.js

@@ -0,0 +1,22 @@
+// 客户部门
+export default [
+  {
+    key: "id",
+    title: "客户部门ID",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "code",
+    title: "客户部门编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "客户部门名称",
+    type: "Input",
+    search: true,
+  },
+];
+

+ 21 - 0
src/views/input-dialog/components/CUSTOMER_PARAM.js

@@ -0,0 +1,21 @@
+// 收货客户
+export default [
+  {
+    key: "id",
+    title: "收货客户ID",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "code",
+    title: "收货客户编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "收货客户名称",
+    type: "Input",
+    search: true,
+  },
+];

+ 21 - 0
src/views/input-dialog/components/OPERATING_PARAM.js

@@ -0,0 +1,21 @@
+// 经营性项目
+export default [
+  {
+    key: "id",
+    title: "经营性项目ID",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "code",
+    title: "经营性项目编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "经营性项目名称",
+    type: "Input",
+    search: true,
+  },
+];

+ 21 - 0
src/views/input-dialog/components/PROCESSTYPE_PARAM.js

@@ -0,0 +1,21 @@
+// 处理方式
+export default [
+  {
+    key: "id",
+    title: "处理方式ID",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "code",
+    title: "处理方式编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "处理方式名称",
+    type: "Input",
+    search: true,
+  },
+];

+ 21 - 0
src/views/input-dialog/components/PROJECT_PARAM.js

@@ -0,0 +1,21 @@
+// 在建工程项目
+export default [
+  {
+    key: "id",
+    title: "在建工程项目ID",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "code",
+    title: "在建工程项目编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "在建工程项目名称",
+    type: "Input",
+    search: true,
+  },
+];

+ 21 - 0
src/views/input-dialog/components/RETREASON_PARAM.js

@@ -0,0 +1,21 @@
+// 退换原因
+export default [
+  {
+    key: "id",
+    title: "退换原因ID",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "code",
+    title: "退换原因编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "退换原因",
+    type: "Input",
+    search: true,
+  },
+];

+ 21 - 0
src/views/input-dialog/components/SUPPLIERCONTACTS_PARAM.js

@@ -0,0 +1,21 @@
+// 供应商联系人
+export default [
+  {
+    key: "id",
+    title: " 供应商联系人ID",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "code",
+    title: " 供应商联系人编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: " 供应商联系人名称",
+    type: "Input",
+    search: true,
+  },
+];

+ 23 - 0
src/views/input-dialog/components/WAREHOUSE_PARAM.js

@@ -0,0 +1,23 @@
+// 收货仓库
+export default [
+  {
+    key: "warehouse",
+    title: "仓库ID",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "warehouse_name",
+    title: "仓库名称",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "",
+    title: "备注",
+  },
+  {
+    key: "",
+    title: "助记码",
+  },
+];

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

@@ -136,6 +136,7 @@ export default {
         // this.setVisible(false);
       }
     },
+    beforeOpen(){},
   },
   created() {
     console.log("ADD CREATED");

+ 174 - 74
src/views/purchase/purchase-order/add/column.js

@@ -1,23 +1,24 @@
 export const Columns = [
-  // { key: "id", title: "主键",type: "Input", },
   {
-    key: "puOrg",
+    key: "puOrgName",
     title: "采购组织",
     type: "InputDialog",
     config: {
-      componentName: "Organization",
-      dataMapping: { puOrg: "deptName" },
+      componentName: "ORG_PARAM",
+      dataMapping: {
+        puOrg: "code",
+        puOrgName: "name",
+      },
     },
     require: true,
   },
-  // { key: "puOrgName", title: "采购组织名称", },
   {
     key: "billType",
     title: "订单类型",
     type: "Select",
     require: true,
     config: {
-      optionsName: "", // 字典名
+      optionsName: "sys_order_type", // 字典名
     },
   },
   // { key: "billTypeName", title: "订单类型名称", },
@@ -30,70 +31,83 @@ export const Columns = [
     config: { type: "date" },
   },
   {
-    key: "supplier",
+    key: "supplierName",
     title: "供应商",
     type: "InputDialog",
     config: {
-      componentName: "Supplier",
-      dataMapping: { supplier: "name" },
+      componentName: "SUPPLIER_PARAM",
+      dataMapping: {
+        supplier: "code",
+        supplierName: "name",
+      },
     },
     require: true,
   },
-  // { key: "supplierName", title: "供应商名称", },
   {
-    key: "paymentAgreement",
+    key: "paymentAgreementName",
     title: "付款协议",
     type: "InputDialog",
     config: {
-      componentName: "PaymentPlan",
+      componentName: "PAYAGREEMENT_PARAM",
       dataMapping: {
-        buyer: "userName",
-        puDept: "deptName",
+        paymentAgreement: "code",
+        paymentAgreementName: "name",
       },
     },
   },
   { key: "finalType", title: "结算方式", type: "Input", },
   {
-    key: "currency",
+    key: "currencyName",
     title: "币种",
     type: "InputDialog",
     config: {
-      componentName: "Currency",
+      componentName: "CURRENCY_PARAM",
       dataMapping: {
-        currency: "name",
+        currency: "code",
+        currencyName: "name",
       },
     },
   },
-  // { key: "currencyName", title: "币种名称", },
   {
-    key: "buyer",
+    key: "buyerName",
     title: "采购员",
     type: "InputDialog",
     config: {
-      componentName: "User",
+      componentName: "ORG_PARAM",
       dataMapping: {
-        buyer: "userName",
-        puDept: "deptName",
+        buyer: "userId",
+        buyerName: "userName",
+        puDept: "deptId",
+        puDeptName: "deptName",
       },
     },
     require: true,
   },
-  // { key: "buyerName", title: "采购员名称", },
   {
-    key: "puDept",
+    key: "puDeptName",
     title: "采购部门",
     type: "InputDialog",
-    config: { componentName: "Department" },
+    config: {
+      componentName: "DEPT_PARAM",
+      dataMapping: {
+        puDept: "code",
+        puDeptName: "name",
+      },
+    },
     require: true,
   },
-  // { key: "puDeptName", title: "采购部门名称", },
-  // { key: "customer", title: "收货客户", type: "Input", },
   {
     key: "customerName",
-    title: "收货客户名称",
+    title: "收货客户",
     type: "InputDialog",
-    config: { componentName: "Customer" },
     width: 200,
+    config: {
+      componentName: "CUSTOMER_PARAM",
+      dataMapping: {
+        customer: "code",
+        customerName: "name",
+      },
+    },
   },
   {
     key: "qty",
@@ -116,20 +130,30 @@ export const Columns = [
   { key: "isMarketing", title: "已协同生成销售订单", type: "Checkbox", },
   { key: "isMarketingSource", title: "由销售订单协同生成", type: "Checkbox", },
   {
-    key: "warehouse",
+    key: "warehouseName",
     title: "WMS入库仓库", // 收货仓库
     type: "InputDialog",
-    config: { componentName: "Warehouse" },
+    config: {
+      componentName: "WAREHOUSE_PARAM",
+      dataMapping: {
+        warehouse: "code",
+        warehouseName: "name",
+      }
+    },
   },
-  // { key: "warehouseName", title: "WMS入库仓库名称", },
   {
-    key: "goodsAllocation",
+    key: "goodsAllocationName",
     title: "货位",
     type: "InputDialog",
-    config: { componentName: "Allocation" },
+    config: {
+      componentName: "ALLOCATION_PARAM",
+      dataMapping: {
+        goodsAllocation: "code",
+        goodsAllocationName: "name",
+      }
+    },
     width: 200,
   },
-  // { key: "goodsAllocationName", title: "货位名称", },
   { key: "isSendSrm", title: "是否同步SRM", type: "Checkbox", },
   { key: "isInvoice", title: "发票标识", type: "Input", },
   { key: "supplierOrderNo", title: "供应商订单号", type: "Input", },
@@ -137,16 +161,32 @@ export const Columns = [
   { key: "deductionMoney", title: "订单抵扣余款金额", type: "Input", },
   { key: "address", title: "收货地址", type: "Input", },
   { key: "contacts", title: "收货联系人", type: "Input", },
-  { key: "customerDept", title: "客户部门", type: "Input", },
-  // { key: "customerDeptName", title: "客户部门名称", },
   {
-    key: "supplierContacts",
+    key: "customerDeptName",
+    title: "客户部门",
+    type: "InputDialog",
+    width: 200,
+    config: {
+      componentName: "CUSTOMERDEPT_PARAM",
+      dataMapping: {
+        customerDept: "code",
+        customerDeptName: "name",
+      },
+    },
+  },
+  {
+    key: "supplierContactsName",
     title: "供应商业务联系人",
     type: "InputDialog",
-    config: { componentName: "" },
+    config: {
+      componentName: "SUPPLIERCONTACTS_PARAM",
+      dataMapping: {
+        supplierContacts: "code",
+        supplierContactsName: "name",
+      },
+    },
     width: 200,
   },
-  // { key: "supplierContactsName", title: "供应商业务联系人名称", },
   { key: "isUrgency", title: "紧急程度", type: "Input", },
   { key: "isSendWms", title: "已同步WMS", type: "Checkbox", },
   // { key: "agent", title: "代理人", type: "Input", }, // 建议删除
@@ -156,50 +196,69 @@ export const Columns = [
   { key: "applyPaymentMoney", title: "累计付款申请金额", type: "Input", },
   { key: "paymentMoney", title: "累计付款金额", type: "Input", },
   { key: "invoiceMoney", title: "发票金额", type: "Input", },
-  {
-    key: "supplierPersonal",
-    title: "供应商业务员",
-    type: "InputDialog",
-    config: { componentName: "" },
-    width: 200,
-  },
-  // { key: "supplierPersonalName", title: "供应商业务员名称", },
+  // {
+  //   key: "supplierPersonal",
+  //   title: "供应商业务员",
+  //   type: "Input",
+  //   // type: "InputDialog",
+  // },
+  { key: "supplierPersonalName", title: "供应商业务员名称",  type: "Input",},
   { key: "isDeliver", title: "是否发货", type: "Input", },
   {
     key: "retReason",
     title: "退换原因",
     type: "InputDialog",
-    config: { componentName: "" },
+    config: {
+      componentName: "RETREASON_PARAM",
+      dataMapping: {
+        retReason: "code",
+        // retReasonName: "name",
+      },
+    },
   },
   {
     key: "processType",
     title: "处理方式",
     type: "InputDialog",
-    config: { componentName: "" },
+    config: {
+      componentName: "PROCESSTYPE_PARAM",
+      dataMapping: {
+        processType: "code",
+        // processTypeName: "name",
+      },
+    },
   },
   { key: "isEnd", title: "整单关闭标识", type: "Input", },
   {
     key: "projectNow",
     title: "在建工程项目",
     type: "InputDialog",
-    config: { componentName: "" },
+    config: {
+      componentName: "PROJECT_PARAM",
+      dataMapping: {
+        projectNow: "code",
+        // processTypeName: "name",
+      },
+    },
   },
   {
     key: "operatingItems",
     title: "经营性项目",
-    type: "Input",
     type: "InputDialog",
-    config: { componentName: "" },
+    config: {
+      componentName: "OPERATING_PARAM",
+      dataMapping: {
+        operatingItems: "code",
+        // processTypeName: "name",
+      },
+    },
   },
   { key: "isArrivalReson", title: "到货超期原因", type: "Input", },
   { key: "midOrderNo", title: "中台采购订单号", type: "Input", },
   { key: "marketingCode", title: "销售订单号", type: "Input", },
   { key: "isArrival", title: "到货超期", type: "Input", },
-  // { key: "tenantId", title: "租户号", },
-  // { key: "revision", title: "乐观锁", },
   { key: "createByName", title: "创建人名称", type: "Input", },
   { key: "updateByName", title: "更新人名称", type: "Input", },
-  // { key: "delFlag", title: "删除标记", },
   { key: "flowId", title: "OA流程ID", type: "Input", },
   { key: "approver", title: "审批人", type: "Input", },
   {
@@ -222,15 +281,21 @@ export const TabColumns = [
       // { key: "id", title: "主键" },
       { key: "rowNo", title: "行号", type: "Input", },
       { key: "orderId", title: "采购订单ID", type: "Input", },
-      // { key: "material", title: "物料", type: "Input", },
+      // {key: "material",title: "物料",type: "Input",   },
+      { key: "materialName", title: "物料名称", type: "Input", },
       {
-        key: "materialName",
-        title: "物料名称",
+        key: "materialCode",
+        title: "物料编码",
         type: "InputDialog",
-        config: { componentName: "" },
-        width: 200,
+        config: {
+          componentName: "MATERIAL_PARAM",
+          dataMapping: {
+            material: "id",
+            materialName: "name",
+            materialCode: "code",
+          },
+        },
       },
-      { key: "materialCode", title: "物料编码", type: "Input", },
       { key: "materialClassify", title: "物料分类", type: "Input", },
       { key: "materialManufacturersCode", title: "厂家物料编码", type: "Input", },
       { key: "specification", title: "规格", type: "Input", },
@@ -254,10 +319,16 @@ export const TabColumns = [
       { key: "isPayment", title: "付款关闭", type: "Input", },
       { key: "isGift", title: "赠品", type: "Input", },
       {
-        key: "warehouse",
+        key: "warehouseName",
         title: "收货仓库", //WMS入库仓库
         type: "InputDialog",
-        config: { componentName: "Warehouse" },
+        config: {
+          componentName: "WAREHOUSE_PARAM",
+          dataMapping: {
+            warehouse: "code",
+            warehouseName: "name",
+          }
+        },
         width: 200,
       },
       { key: "place", title: "收货地点", type: "Input", },
@@ -267,8 +338,24 @@ export const TabColumns = [
       { key: "efficacyLoseDate", title: "有效期至/失效日期", type: "Input", },
       { key: "approvalNumber", title: "批准文号", type: "Input", },
       { key: "registration", title: "注册证号", type: "Input", },
-      { key: "storageCondition", title: "存储条件", type: "Input", },
-      { key: "carriageCondition", title: "运输条件", type: "Input", },
+
+      {
+        key: "storageCondition",
+        title: "存储条件",
+        type: "Select",
+        config: {
+          optionsName: "sys_storage_condition",
+        },
+      },
+      {
+        key: "carriageCondition",
+        title: "运输条件",
+        type: "Select",
+        config: {
+          optionsName: "sys_conditions_carriage",
+        },
+      },
+
       { key: "isBatchLock", title: "批号锁定标识", type: "Input", },
       { key: "isReplenishment", title: "补单标识", type: "Input", },
       { key: "isUrgency", title: "紧急标识", type: "Input", },
@@ -284,13 +371,17 @@ export const TabColumns = [
       { key: "sourceId", title: "上游单据ID", type: "Input", },
       { key: "demandCode", title: "采购需求单号", type: "Input", },
       { key: "arrivalDatePlan", title: "计划到货日期", type: "Input", },
-      { key: "priceType", title: "价格类型", type: "Input", },
+      {
+        key: "priceType",
+        title: "价格类型",
+        type: "Select",
+        config: {
+          optionsName: "sys_price_type",
+        },
+      },
       { key: "isDistributionPrice", title: "配送价", type: "Input", },
-      // { key: "tenantId", title: "租户号",type: "Input", },
-      // { key: "revision", title: "乐观锁",type: "Input", },
       { key: "createByName", title: "创建人名称", type: "Input", },
       { key: "updateByName", title: "更新人名称", type: "Input", },
-      // { key: "delFlag", title: "删除标记",type: "Input", },
       // { key: "materialClassifyOne", title: "物料一级分类",type: "Input", },
       { key: "materialClassifyOneName", title: "物料一级分类名称", type: "Input", },
       // { key: "materialClassifyTwo", title: "物料二级分类",type: "Input", },
@@ -309,7 +400,19 @@ export const TabColumns = [
       // { key: "id", title: "主键",type: "Input", },
       { key: "orderId", title: "采购订单ID", type: "Input", },
       { key: "rowno", title: "行号", type: "Input", },
-      { key: "material", title: "物料", type: "Input", },
+      {
+        key: "materialName",
+        title: "物料",
+        type: "InputDialog",
+        config: {
+          componentName: "MATERIAL_PARAM",
+          dataMapping: {
+            material: "id",
+            materialName: "name",
+            // materialCode: "code",
+          },
+        },
+      },
       // { key: "materialName", title: "物料名称", type: "Input", },
       { key: "specification", title: "规格", type: "Input", },
       { key: "qty", title: "数量", type: "Input", },
@@ -319,11 +422,8 @@ export const TabColumns = [
       { key: "rollbackQty", title: "累计退货主数量", type: "Checkbox", },
       { key: "backStockQty", title: "累计退库主数量", type: "Input", },
       { key: "floatQty", title: "未到货数量", type: "Input", },
-      // { key: "tenantId", title: "租户号",type: "Input", },
-      // { key: "revision", title: "乐观锁",type: "Input", },
       { key: "createByName", title: "创建人名称", type: "Input", },
       { key: "updateByName", title: "更新人名称", type: "Input", },
-      // { key: "delFlag", title: "删除标记" }
     ]
   },
 ];

+ 3 - 3
src/views/purchase/purchase-order/column.js

@@ -1,12 +1,12 @@
 export const TableColumns = [
    // { key: "id", title: "主键" },
       // { key: "puOrg", title: "采购组织" },
-      { key: "puOrgName", title: "采购组织名称" },
+      { key: "puOrgName", title: "采购组织名称",search: true, type: "Input"  },
       { key: "billType", title: "订单类型" },
-      { key: "code", title: "订单编号" },
+      { key: "code", title: "订单编号",search: true, type: "Input"  },
       { key: "billDate", title: "订单日期" },
       // { key: "supplier", title: "供应商" },
-      { key: "supplierName", title: "供应商名称" },
+      { key: "supplierName", title: "供应商名称",search: true, type: "Input" },
       { key: "paymentAgreement", title: "付款协议" },
       // { key: "currency", title: "币种" },
       { key: "currencyName", title: "币种名称" },

+ 268 - 0
src/views/purchase/purchase-order/edit/index.vue

@@ -0,0 +1,268 @@
+<script>
+import { Columns, TabColumns } from "../add/column";
+import {
+  edit,
+  item,
+  itemTableList,
+} from "@/api/business/purchase/purchase-contract";
+import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
+
+const NewColumns = initColumns(Columns);
+const NewTabColumns = TabColumns.map((element) => ({
+  ...element,
+  tableColumns: initColumns(element.tableColumns),
+}));
+
+export default {
+  name: "EditPurchaseContractDrawer",
+  dicts: initDicts(NewColumns),
+  components: {
+    DrInputDialog: () => import("@/views/input-dialog/index.vue"),
+  },
+  data() {
+    return {
+      size: "mini",
+      visible: false,
+      loading: false,
+      columns: NewColumns,
+      rules: initRules(NewColumns),
+      params: {
+        ...initParams(NewColumns),
+        contractItemList: [],
+        contractClauseList: [],
+        contractExpenseList: [],
+        contractAgreementList: [],
+        contractApplyOrgList: [],
+      },
+
+      tabColumns: NewTabColumns,
+      tabName: "contractItemList",
+    };
+  },
+  computed: {},
+  watch: {
+    "params.contractType": function (newProp) {
+      this.tabColumns = NewTabColumns.filter((element) =>
+        newProp === "1" ? element.key !== "contractItemList" : element
+      );
+      this.tabName = this.tabColumns[0].key;
+    },
+    tabName: function (newProp) {
+      const { id } = this.params;
+      this.fetchTable(id, newProp);
+    },
+  },
+  methods: {
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    // 查询详细
+    async fetchItem(prop) {
+      try {
+        this.loading = true;
+        const { code, msg, data } = await item(prop);
+        if (code === 200) {
+          this.params = data;
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 查询详情关联TABLE
+    async fetchTable(prop, name) {
+      try {
+        this.loading = true;
+        const { code, msg, rows } = await itemTableList({ id: prop }, name);
+        if (code === 200) {
+          this.params[name] = rows;
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 新增行
+    addTableRow(prop) {
+      const arr = this.tabColumns.find(
+        (element) => element.key === this.tabName
+      ).tableColumns;
+      prop.push(initParams(arr, "key", "value"));
+    },
+    // 删除行
+    delTableRow(prop, index) {
+      prop.splice(index, 1);
+    },
+    // 取消
+    handleCancel() {
+      this.setVisible(false);
+      this.params = initParams(this.columns, "key", "value");
+    },
+    // 保存
+    handleSava() {
+      this.setVisible(false);
+    },
+    // 保存并新增
+    async handleSubmit() {
+      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 edit({
+          createById,
+          createByName,
+          updateById,
+          updateByName,
+          ...this.params,
+        });
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.setVisible(false);
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        // this.setVisible(false);
+      }
+    },
+    beforeOpen() { },
+  },
+  created() {
+    console.log("ADD CREATED");
+  },
+  mounted() { },
+  destroyed() { },
+};
+</script>
+<template>
+  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+    @close="$emit('close')">
+    <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+      }" style="margin: 10px">
+        <div slot="header" style="
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+          ">
+          <h3>编辑</h3>
+          <div style="text-align: right">
+            <el-button :size="size" @click="handleCancel">取 消</el-button>
+            <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
+          </div>
+        </div>
+        <el-row>
+          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
+            <el-form-item :prop="column.key" :label="column.title">
+              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
+              <dr-input-dialog v-if="column.type === 'InputDialog'" v-model="params[column.key]"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
+                :data-mapping="column.config.dataMapping" :source.sync="params">
+              </dr-input-dialog>
+              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%"></el-input>
+              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
+                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
+              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%">
+                <template #prefix>
+                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
+                </template>
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+                </el-option>
+              </el-select>
+              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :picker-options="column.pickerOptions" style="width: 100%">
+              </el-date-picker>
+              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
+                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
+                <i class="el-icon-upload"></i>
+                <div class="el-upload__text">
+                  将文件拖到此处,或<em>点击上传</em>
+                </div>
+                <!-- <div class="el-upload__tip" slot="tip">
+                  只能上传jpg/png文件,且不超过500kb
+                </div> -->
+              </el-upload>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-card>
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+        position: 'relative',
+      }" style="margin: 10px">
+        <el-tabs v-model="tabName" style="width: 100%">
+          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+            <el-table :data="params[column.key]" style="width: 100%">
+              <el-table-column label="序号">
+                <template slot-scope="scope">
+                  {{ scope.$index + 1 }}
+                </template>
+              </el-table-column>
+              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+                :label="cColumn.title" :width="cColumn.width">
+                <template slot-scope="scope">
+                  <span v-if="!cColumn.type">
+                    {{ scope.row[cColumn.key] }}</span>
+                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :size="size" style="width: 100%"></el-input>
+                  <dr-input-dialog v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
+                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
+                  </dr-input-dialog>
+                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
+                    style="width: 100%"></el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column fixed="right" label="操作" width="120">
+                <template slot-scope="scope">
+                  <el-button @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
+                    删行
+                  </el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-tab-pane>
+        </el-tabs>
+        <el-row style="position: absolute; top: 20px; right: 20px">
+          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
+        </el-row>
+      </el-card>
+    </el-form>
+  </el-drawer>
+</template>

+ 27 - 119
src/views/purchase/purchase-order/index.vue

@@ -3,116 +3,20 @@
 import { TableColumns, SearchColumns } from "./column";
 import orderApi from "@/api/business/purchase/purchase-order";
 import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
-import AddPurchaseOrderDrawer from "./add/index.vue";
-import SeePurchaseOrderDrawer from "./see/index.vue";
-// import DirectSourcingTable from "./direct-sourcing.vue";
 export default {
   name: "PuchaseTask",
   components: {
-    AddPurchaseOrderDrawer,
-    SeePurchaseOrderDrawer,
-    // DirectSourcingTable,
+    AddDrawer: () => import('./add/index.vue'),
+    SeeDrawer: () => import('./see/index.vue'),
+    EditDrawer: () => import('./edit/index.vue'),
   },
   data() {
-    const arr2Obj = function (data, keyName, valueName) {
-      return Object.fromEntries(
-        data.map((item) => [item[keyName], item[valueName]])
-      );
-    };
-    // const searchColumns = [
-    //   { key: "puOrg", title: "采购组织", type: "Input" },
-    //   { key: "billDate", title: "订单日期", type: "DatePicker" },
-    //   { key: "code", title: "订单编号", type: "Input" },
-    //   { key: "status", title: "单据状态", type: "Input" },
-    //   { key: "buyerName", title: "采购员", type: "Input" },
-    //   { key: "supplierName", title: "供应商名称", type: "Input" },
 
-    // ];
-    // const initSearchColumns = () => searchColumns;
-    // const initSearchParams = () => arr2Obj(initSearchColumns(), "key", "value");
-    // const tableColumns = [
-    //   // { key: "id", title: "主键" },
-    //   // { key: "puOrg", title: "采购组织" },
-    //   { key: "puOrgName", title: "采购组织名称" },
-    //   { key: "billType", title: "订单类型" },
-    //   { key: "code", title: "订单编号" },
-    //   { key: "billDate", title: "订单日期" },
-    //   // { key: "supplier", title: "供应商" },
-    //   { key: "supplierName", title: "供应商名称" },
-    //   { key: "paymentAgreement", title: "付款协议" },
-    //   // { key: "currency", title: "币种" },
-    //   { key: "currencyName", title: "币种名称" },
-    //   // { key: "buyer", title: "采购员" },
-    //   { key: "buyerName", title: "采购员" },
-    //   // { key: "puDept", title: "采购部门" },
-    //   { key: "puDeptName", title: "采购部门名称" },
-    //   // { key: "customer", title: "收货客户" },
-    //   { key: "customerName", title: "收货客户名称" },
-    //   { key: "isDeliver", title: "是否发货" },
-    //   { key: "isArrival", title: "到货超期" },
-    //   { key: "isBack", title: "退货" },
-    //   // { key: "freezeCause", title: "冻结原因" },
-    //   { key: "qty", title: "总数量" },
-    //   { key: "money", title: "总数量" },
-    //   { key: "isMarketing", title: "已协同生成销售订单" },
-    //   { key: "isMarketingSource", title: "由销售订单协同生成" },
-    //   // { key: "personal", title: "人员" },
-    //   { key: "personalName", title: "人员名称" },
-    //   // { key: "isSendSrm", title: "是否同步SRM" },
-    //   { key: "isInvoice", title: "发票标识" },
-    //   { key: "rebateMoney", title: "订单使用返利金额" },
-    //   { key: "deductionMoney", title: "订单抵扣余款金额" },
-    //   // { key: "warehouse", title: "WMS入库仓库" },
-    //   { key: "warehouseName", title: "收货仓库" }, //WMS入库仓库名称
-    //   // { key: "goodsAllocation", title: "货位" },
-    //   { key: "goodsAllocationName", title: "货位名称" },
-    //   // { key: "customerDept", title: "客户部门" },
-    //   { key: "customerDeptName", title: "客户部门名称" },
-    //   // { key: "supplierContacts", title: "供应商业务联系人" },
-    //   { key: "supplierContactsName", title: "供应商业务联系人名称" },
-    //   { key: "isUrgency", title: "紧急程度" },
-    //   // { key: "agent", title: "代理人" }, // 建议删除
-    //   { key: "agentName", title: "代理人名称" },
-    //   { key: "isClose", title: "最终关闭" },
-    //   { key: "applyPaymentMoney", title: "累计付款申请金额" },
-    //   { key: "paymentMoney", title: "累计付款金额" },
-    //   { key: "invoiceMoney", title: "发票金额" },
-    //   // { key: "supplierPersonal", title: "供应商业务员" },
-    //   { key: "supplierPersonalName", title: "供应商业务员名称" },
-    //   { key: "marketingCode", title: "销售订单号" },
-    //   // { key: "tenantId", title: "租户号" },
-    //   // { key: "revision", title: "乐观锁" },
-    //   { key: "createByName", title: "创建人名称" },
-    //   { key: "updateByName", title: "更新人名称" },
-    //   // { key: "delFlag", title: "删除标记" },
-    //   { key: "flowId", title: "OA流程ID" },
-    //   { key: "approver", title: "审批人" },
-    //   { key: "approverFinishTime", title: "审批时间" },
-    //   { key: "approveTime", title: "提交时间" },
-    //   { key: "createTime", title: "制单日期/创建时间" },
-    //   { key: "remark", title: "备注" },
-    //   { key: "updateTime", title: "最后修改时间" },
-    //   { key: "status", title: "单据状态" },
-    //   { key: "oaDemandNo", title: "OA需求单号" },
-    //   { key: "address", title: "收货地址" },
-    //   { key: "contacts", title: "收获联系人" },
-    //   { key: "isSendWms", title: "已同步WMS" },
-    //   { key: "retReason", title: "退换原因" },
-    //   { key: "closeTime", title: "最终关闭日期" },
-    //   { key: "processType", title: "处理方式" },
-    //   { key: "isEnd", title: "整单关闭标识" },
-    //   { key: "projectNow", title: "在建工程项目" },
-    //   { key: "operatingItems", title: "经营性项目" },
-    //   { key: "isArrivalReson", title: "到货超期原因" },
-    //   { key: "midOrderNo", title: "中台采购订单号" }
-    // ];
-    // const initTableColumns = () => tableColumns;
     const tabColumns = [
       {
         title: '物料信息',
         key: 'first',
         tableColumns: [
-          // { key: "id", title: "主键" },
           { key: "rowNo", title: "行号" },
           { key: "orderId", title: "采购订单ID" },
           { key: "material", title: "物料" },
@@ -219,29 +123,19 @@ export default {
       params: initParams(SearchColumns),
 
       tableColumns: TableColumns,
-      // searchColumns: initSearchColumns(),
-      // searchParams: {
-      //   isAsc: "desc",
-      //   reasonable: "",
-      //   orderByColumn: "",
-      //   ...initSearchParams(),
-      // },
-      // tableColumns: initTableColumns(),
-      tableData: [{ puOrgName: 1 }],
+      tableData: [],
       tabColumns: initTabColumns(),
       tabName: "first",
       tabTableDatas: {
         first: [],
         second: [],
       },
-      // page: { pageNum: 1, pageSize: 25 },
-      // total: 0,
-      // pageSizes: [25, 50, 100],
       detailsData: {}
     };
   },
   computed: {
     showSearchColumns() {
+      console.log(this.searchColumns,'this.searchColumns');
       return this.isSimpleSearch
         ? this.searchColumns.slice(0, 4)
         : this.searchColumns;
@@ -268,7 +162,7 @@ export default {
           ...this.searchParams,
         });
         if (code === 200) {
-          this.total = total;
+          this.page.total = total;
           this.tableData = rows;
           this.$notify.success({ title: msg });
         } else {
@@ -303,6 +197,13 @@ export default {
         this.$notify.info("Open See Drawer");
       }, 250);
     },
+    handleOpenEditDrawer() {
+      const { setVisible } = this.$refs.editDrawerFef;
+      setVisible(true);
+      setTimeout(() => {
+        this.$notify.info("Open Edit Drawer");
+      }, 250);
+    },
     // 获取子表信息
     async handleDetailsData(row) {
       console.log(row, '获取详情信息');
@@ -323,29 +224,36 @@ export default {
         // this.loading = false;
       }
     },
+    // 重置操作
+    handleResetList() {
+      this.page = initPage();
+      this.params = initParams();
+      this.fetchList(this.params, this.page);
+    },
   },
 };
 </script>
 
 <template>
   <el-card v-loading="loading" style="width: calc(100% - 24px); height: 100%; margin: 10px" :body-style="{ padding: 0 }">
-    <AddPurchaseOrderDrawer ref="addDrawerFef"></AddPurchaseOrderDrawer>
-    <SeePurchaseOrderDrawer ref="seeDrawerFef"></SeePurchaseOrderDrawer>
+    <SeeDrawer ref="seeDrawerFef"></SeeDrawer>
+    <AddDrawer ref="addDrawerFef" @close="handleResetList"></AddDrawer>
+    <EditDrawer ref="editDrawerFef" @close="handleResetList"></EditDrawer>
 
-    <el-form size="mini" label-position="right" label-width="85px" :model="params" style="padding: 20px 0 0 0">
+    <el-form size="mini" label-position="right" label-width="100px" :model="params" style="padding: 20px 0 0 0">
       <el-row :gutter="24">
         <el-col :span="20">
           <el-row :gutter="20">
             <el-col v-for="column in showSearchColumns" :key="column.title" :xl="6" :lg="6" :md="8" :sm="12" :xs="24">
               <el-form-item :prop="column.key" :label="column.title">
-                <el-input v-model="searchParams[column.key]" :placeholder="column.placeholder"></el-input>
+                <el-input v-model="params[column.key]" :placeholder="column.placeholder"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
         </el-col>
         <el-col :span="3" :offset="1" style="text-align: right; padding-right: 40px">
           <el-button type="primary" size="mini">搜索</el-button>
-          <el-button size="mini">重置</el-button>
+          <el-button size="mini" @click="handleResetList">重置</el-button>
         </el-col>
       </el-row>
     </el-form>
@@ -388,13 +296,13 @@ export default {
       <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
           <el-button @click="handleOpenSeeDrawer(scope.row)" type="text" size="small">查看</el-button>
-          <el-button type="text" size="small" @click="handleOpenAddDrawer(scope.row)">编辑</el-button>
+          <el-button type="text" size="small" @click="handleOpenEditDrawer(scope.row)">编辑</el-button>
           <el-button type="text" size="small">删除</el-button>
         </template>
       </el-table-column>
 
     </el-table>
-    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="total"
+    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="page.total"
       :page-sizes="pageSizes" :page-size="page.pageSize" :current-page="page.pageNum" hide-on-single-page
       :layout="layout">
     </el-pagination>

+ 1 - 215
src/views/purchase/purchase-order/see/index.vue

@@ -19,214 +19,6 @@ export default {
   name: "SeePurchaseContractDrawer",
   dicts: initDicts(NewColumns),
   data() {
-    // const arr2Obj = function (data, keyName, valueName) {
-    //   return Object.fromEntries(
-    //     data.map((item) => [item[keyName], item[valueName]])
-    //   );
-    // };
-    // const columns = [
-    //   // { key: "id", title: "主键" },
-    //   { key: "puOrg", title: "采购组织" },
-    //   { key: "puOrgName", title: "采购组织名称" },
-    //   { key: "billType", title: "订单类型" },
-    //   { key: "billTypeName", title: "订单类型名称" },
-    //   { key: "oaDemandNo", title: "OA需求单号" },
-    //   { key: "code", title: "订单编号" },
-    //   { key: "billDate", title: "订单日期" },
-    //   { key: "supplier", title: "供应商" },
-    //   { key: "supplierName", title: "供应商名称" },
-    //   { key: "paymentAgreement", title: "付款协议" },
-    //   { key: "finalType", title: "结算方式" },
-    //   { key: "currency", title: "币种" },
-    //   { key: "currencyName", title: "币种名称" },
-    //   { key: "buyer", title: "采购员" },
-    //   { key: "buyerName", title: "采购员名称" },
-    //   { key: "puDept", title: "采购部门" },
-    //   { key: "puDeptName", title: "采购部门名称" },
-    //   { key: "customer", title: "收货客户" },
-    //   { key: "customerName", title: "收货客户名称" },
-    //   { key: "qty", title: "总数量" },
-    //   { key: "originalQty", title: "原始总数量" },
-    //   { key: "money", title: "价税合计" },
-    //   { key: "originalMoney", title: "原始总金额" },
-    //   { key: "notaxMoney", title: "无税金额" },
-    //   { key: "status", title: "单据状态" },
-    //   { key: "freezeCause", title: "冻结原因" },
-    //   { key: "isBack", title: "退货" },
-    //   { key: "isMarketing", title: "已协同生成销售订单" },
-    //   { key: "isMarketingSource", title: "由销售订单协同生成" },
-    //   { key: "warehouse", title: "WMS入库仓库" },
-    //   { key: "warehouseName", title: "WMS入库仓库名称" },
-    //   { key: "goodsAllocation", title: "货位" },
-    //   { key: "goodsAllocationName", title: "货位名称" },
-    //   { key: "isSendSrm", title: "是否同步SRM" },
-    //   { key: "isInvoice", title: "发票标识" },
-    //   { key: "supplierOrderNo", title: "供应商订单号" },
-    //   { key: "rebateMoney", title: "订单使用返利金额" },
-    //   { key: "deductionMoney", title: "订单抵扣余款金额" },
-    //   { key: "address", title: "收货地址" },
-    //   { key: "contacts", title: "收货联系人" },
-    //   { key: "customerDept", title: "客户部门" },
-    //   { key: "customerDeptName", title: "客户部门名称" },
-    //   { key: "supplierContacts", title: "供应商业务联系人" },
-    //   { key: "supplierContactsName", title: "供应商业务联系人名称" },
-    //   { key: "isUrgency", title: "紧急程度" },
-    //   { key: "isSendWms", title: "已同步WMS" },
-    //   { key: "agent", title: "代理人" },
-    //   { key: "agentName", title: "代理人名称" },
-    //   { key: "isClose", title: "最终关闭" },
-    //   { key: "closeTime", title: "最终关闭日期" },
-    //   { key: "applyPaymentMoney", title: "累计付款申请金额" },
-    //   { key: "paymentMoney", title: "累计付款金额" },
-    //   { key: "invoiceMoney", title: "发票金额" },
-    //   { key: "supplierPersonal", title: "供应商业务员" },
-    //   { key: "supplierPersonalName", title: "供应商业务员名称" },
-    //   { key: "isDeliver", title: "是否发货" },
-    //   { key: "retReason", title: "退换原因" },
-    //   { key: "processType", title: "处理方式" },
-    //   { key: "isEnd", title: "整单关闭标识" },
-    //   { key: "projectNow", title: "在建工程项目" },
-    //   { key: "operatingItems", title: "经营性项目" },
-    //   { key: "isArrivalReson", title: "到货超期原因" },
-    //   { key: "midOrderNo", title: "中台采购订单号" },
-    //   { key: "marketingCode", title: "销售订单号" },
-    //   { key: "isArrival", title: "到货超期" },
-    //   // { key: "tenantId", title: "租户号" },
-    //   // { key: "revision", title: "乐观锁" },
-    //   { key: "createByName", title: "创建人名称" },
-    //   { key: "updateByName", title: "更新人名称" },
-    //   // { key: "delFlag", title: "删除标记" },
-    //   { key: "flowId", title: "OA流程ID" },
-    //   { key: "approver", title: "审批人" },
-    //   { key: "approverFinishTime", title: "审批时间" },
-    //   { key: "approveTime", title: "提交时间" },
-
-    // ];
-    // const initColumns = () =>
-    //   columns.map((column) => {
-    //     const clearable = column.clearable || true;
-    //     if (column.type === "InputNumber") {
-    //       return {
-    //         ...column,
-    //         clearable,
-    //         config: { controlsPosition: "right" },
-    //       };
-    //     }
-    //     if (column.type === "DatePicker") {
-    //       return {
-    //         ...column,
-    //         clearable,
-    //         config: { type: "date" },
-    //       };
-    //     }
-    //     return {
-    //       ...column,
-    //       clearable,
-    //     };
-    //   });
-    // const initParams = () => arr2Obj(initColumns(), "key", "value");
-    // const tabColumns = [
-    //   {
-    //     title: '物料信息',
-    //     key: 'first',
-    //     tableColumns: [
-    //       // { key: "id", title: "主键" },
-    //       { key: "rowNo", title: "行号" },
-    //       { key: "orderId", title: "采购订单ID" },
-    //       { key: "material", title: "物料" },
-    //       { key: "materialName", title: "物料名称" },
-    //       { key: "materialCode", title: "物料编码" },
-    //       { key: "materialClassify", title: "物料分类" },
-    //       { key: "materialManufacturersCode", title: "厂家物料编码" },
-    //       { key: "specification", title: "规格" },
-    //       { key: "model", title: "型号" },
-    //       { key: "isMedcine", title: "医药物料" },
-    //       { key: "manufacturer", title: "生产厂家代理人" },
-    //       { key: "isDrug", title: "物料药品属性" },
-    //       { key: "unit", title: "单位" },
-    //       { key: "qty", title: "数量" },
-    //       { key: "taxPrice", title: "含税单价" },
-    //       { key: "money", title: "价税合计" },
-    //       { key: "tax", title: "税率" },
-    //       { key: "taxDeductMoneya", title: "折扣金额" },
-    //       { key: "arrivalQty", title: "已到货数量" },
-    //       { key: "unarrivedQty", title: "未到货数量" },
-    //       { key: "notaxMoney", title: "无税金额" },
-    //       { key: "priceSource", title: "价格目录ID" },
-    //       { key: "isStorage", title: "入库关闭" },
-    //       { key: "isInvoice", title: "开票关闭" },
-    //       { key: "isArrival", title: "到货关闭" },
-    //       { key: "isPayment", title: "付款关闭" },
-    //       { key: "isGift", title: "赠品" },
-    //       { 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", title: "存储条件" },
-    //       { key: "carriageCondition", title: "运输条件" },
-    //       { key: "isBatchLock", title: "批号锁定标识" },
-    //       { key: "isReplenishment", title: "补单标识" },
-    //       { key: "isUrgency", title: "紧急标识" },
-    //       { key: "originalQty", title: "原始数量" },
-    //       { key: "originalMoney", title: "原始金额" },
-    //       { key: "directProductBatch", title: "直运产品批号" },
-    //       { key: "discountRule", title: "折扣规则编码" },
-    //       { key: "reservedQty", title: "预留数量" },
-    //       { key: "reservedPeriod", title: "预留周期" },
-    //       { key: "taxDeductClassify", title: "扣税类别" },
-    //       { key: "exchangeRate", title: "折本汇率" },
-    //       { key: "source", title: "上游单据号" },
-    //       { key: "sourceId", title: "上游单据ID" },
-    //       { key: "demandCode", title: "采购需求单号" },
-    //       { key: "arrivalDatePlan", title: "计划到货日期" },
-    //       { key: "priceType", title: "价格类型" },
-    //       { key: "isDistributionPrice", title: "配送价" },
-    //       // { key: "tenantId", title: "租户号" },
-    //       // { key: "revision", title: "乐观锁" },
-    //       { key: "createByName", title: "创建人名称" },
-    //       { key: "updateByName", title: "更新人名称" },
-    //       // { key: "delFlag", title: "删除标记" },
-    //       // { key: "materialClassifyOne", title: "物料一级分类" },
-    //       { key: "materialClassifyOneName", title: "物料一级分类名称" },
-    //       // { key: "materialClassifyTwo", title: "物料二级分类" },
-    //       { key: "materialClassifyTwoName", title: "物料二级分类名称" },
-    //       // { key: "materialClassifyThree", title: "物料三级分类" },
-    //       { key: "materialClassifyThreeName", title: "物料三级分类名称" },
-    //       // { key: "materialClassifyFour", title: "物料四级分类" },
-    //       { key: "materialClassifyFourName", title: "物料四级分类名称" },
-    //       { key: "price", title: "无税单价" }
-    //     ]
-    //   },
-    //   {
-    //     title: '执行结果',
-    //     key: 'second',
-    //     tableColumns: [
-    //       // { key: "id", title: "主键" },
-    //       { key: "orderId", title: "采购订单ID" },
-    //       { key: "rowno", title: "行号" },
-    //       { key: "material", title: "物料" },
-    //       { key: "materialName", title: "物料名称" },
-    //       { key: "specification", title: "规格" },
-    //       { key: "qty", title: "数量" },
-    //       { key: "stroageQty", title: "累计到货主数量" },
-    //       { key: "stockQty", title: "累计入库主数量" },
-    //       { key: "invoiceQty", title: "累计开票主数量" },
-    //       { key: "rollbackQty", title: "累计退货主数量" },
-    //       { key: "backStockQty", title: "累计退库主数量" },
-    //       { key: "floatQty", title: "未到货数量" },
-    //       // { key: "tenantId", title: "租户号" },
-    //       // { key: "revision", title: "乐观锁" },
-    //       { key: "createByName", title: "创建人名称" },
-    //       { key: "updateByName", title: "更新人名称" },
-    //       // { key: "delFlag", title: "删除标记" }
-    //     ]
-    //   },
-    // ];
-    // const initTabColumns = () => tabColumns;
     return {
       visible: false,
       columns: NewColumns,
@@ -239,13 +31,6 @@ export default {
 
       tabColumns: NewTabColumns,
       tabName: "puOrderItemList",
-      // tabTableDatas: {
-      //   first: [],
-      //   second: [],
-      //   // third: [],
-      //   // fourth: [],
-      //   // fifth: [],
-      // },
     };
   },
   computed: {},
@@ -276,6 +61,7 @@ export default {
       this.setVisible(false);
       this.params = initParams(Columns);
     },
+    beforeOpen(){},
   },
   created() { },
   mounted() { },

+ 43 - 139
src/views/purchase/purchase-task/add-purchase-task.vue

@@ -60,38 +60,27 @@ export default {
         this.params[key] = prop[dataMapping[key]];
       }
     },
+    beforeOpen() { },
   },
   created() {
     console.log(this.params);
   },
-  mounted() {},
-  destroyed() {},
+  mounted() { },
+  destroyed() { },
 };
 </script>
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    @open="beforeOpen"
-  >
-    <el-card
-      :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }"
-      style="margin: 10px"
-    >
-      <div
-        slot="header"
-        style="
+  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen">
+    <el-card :body-style="{
+      padding: '20px',
+      display: 'flex',
+      'flex-wrap': 'wrap',
+    }" style="margin: 10px">
+      <div slot="header" style="
           display: flex;
           justify-content: space-between;
           align-items: center;
-        "
-      >
+        ">
         <h3>新增</h3>
         <div style="text-align: right">
           <el-button size="mini" @click="cancel">取消</el-button>
@@ -101,135 +90,50 @@ export default {
           </el-button>
         </div>
       </div>
-      <component
-        v-if="currentComponent.name"
-        :is="currentComponent.name"
-        :ref="currentComponent.name"
-        :title="currentComponent.title"
-        :value="currentComponent.value"
-        @confirm="updateParams"
-      ></component>
+      <component v-if="currentComponent.name" :is="currentComponent.name" :ref="currentComponent.name"
+        :title="currentComponent.title" :value="currentComponent.value" @confirm="updateParams"></component>
       <el-row>
-        <el-form
-          size="mini"
-          label-position="right"
-          label-width="135px"
-          :model="params"
-          :rules="rules"
-        >
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
-          >
+        <el-form size="mini" label-position="right" label-width="135px" :model="params" :rules="rules">
+          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
             <el-form-item :prop="column.key" :label="column.title">
-              <el-input
-                v-if="column.type === 'Input'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <el-input
-                v-if="column.type === 'InputDialog'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-                @blur="openAsyncInputDialog(column, 'change')"
-                @change="openAsyncInputDialog(column, 'change')"
-              >
+              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
+              <el-input v-if="column.type === 'InputDialog'" v-model="params[column.key]"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%" @blur="openAsyncInputDialog(column, 'change')"
+                @change="openAsyncInputDialog(column, 'change')">
                 <template #suffix>
-                  <el-icon
-                    class="el-icon-s-operation"
-                    style="cursor: pointer"
-                    @click.native.stop="openAsyncInputDialog(column, 'click')"
-                  ></el-icon>
+                  <el-icon class="el-icon-s-operation" style="cursor: pointer"
+                    @click.native.stop="openAsyncInputDialog(column, 'click')"></el-icon>
                 </template>
               </el-input>
-              <el-input
-                v-if="column.type === 'Textarea'"
-                v-model="params[column.key]"
-                type="textarea"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <el-input-number
-                v-if="column.type === 'InputNumber'"
-                v-model="params[column.key]"
-                :controls-position="
-                  column.config && column.config.controlsPosition
-                "
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input-number>
-              <el-select
-                v-if="column.type === 'Select'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="item in dict.type[column.config.optionsName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%"></el-input>
+              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]" :controls-position="column.config && column.config.controlsPosition
+                " :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%"></el-input-number>
+              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
+                  :value="item.value">
                 </el-option>
               </el-select>
-              <el-select
-                v-if="column.type === 'TagSelect'"
-                v-model="params[column.key]"
-                multiple
-                clearable
-                collapse-tags
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
+              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%">
                 <template #prefix>
-                  <el-icon
-                    class="el-icon-s-operation"
-                    style="cursor: pointer"
-                    @click.stop="$message.info(234)"
-                  ></el-icon>
+                  <el-icon class="el-icon-s-operation" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
                 </template>
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
-              <el-date-picker
-                v-if="column.type === 'DatePicker'"
-                v-model="params[column.key]"
-                :type="column.config.type"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :picker-options="column.pickerOptions"
-                style="width: 100%"
-              >
+              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :picker-options="column.pickerOptions" style="width: 100%">
               </el-date-picker>
-              <el-upload
-                v-if="column.type === 'Upload'"
-                :file-list="params[column.key]"
-                :disabled="column.disabled"
-                drag
-                action="https://jsonplaceholder.typicode.com/posts/"
-                multiple
-              >
+              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
+                action="https://jsonplaceholder.typicode.com/posts/" multiple>
                 <i class="el-icon-upload"></i>
                 <div class="el-upload__text">
                   将文件拖到此处,或<em>点击上传</em>