Pārlūkot izejas kodu

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!552
黄梓星 1 gadu atpakaļ
vecāks
revīzija
f60fb50e48

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

@@ -175,6 +175,7 @@
         this.visible = false;
         this.params = this.$init.params([...TabColumns, ...TableColumns]);
         this.$emit("success");
+        this.delDemandItemList = []
       },
       //
       async onRowAdd(prop, pushParams = {}) {
@@ -224,7 +225,7 @@
               param.priceApplyItems.forEach((item, index) => {
                 item.$index = index
               });
-              let tishi = param.priceApplyItems.filter(item => {return (item.priceDiffer && item.priceDiffer !== 0)})
+              let tishi = param.priceApplyItems.filter(item => {return (item.priceDiffer && item.delFlag == '0' && item.priceDiffer !== 0)})
               // console.log('筛选', tishi)
               let tishiMsg = tishi.map(item => {
                 return `第${item.$index+1}行为价格调整`

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

@@ -220,6 +220,7 @@
         this.visible = false;
         this.params = this.$init.params([...TabColumns, ...TableColumns]);
         this.$emit("success");
+        this.delDemandItemList = []
       },
       //
       async onRowAdd(prop, pushParams = {}) {
@@ -270,7 +271,7 @@
               param.priceApplyItems.forEach((item, index) => {
                 item.$index = index
               });
-              let tishi = param.priceApplyItems.filter(item => {return (item.priceDiffer && item.priceDiffer !== 0)})
+              let tishi = param.priceApplyItems.filter(item => {return (item.priceDiffer && item.delFlag == '0' && item.priceDiffer !== 0)})
               console.log('筛选', tishi)
               let tishiMsg = tishi.map(item => {
                 return `第${item.$index+1}行为价格调整`

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

@@ -230,6 +230,7 @@
         this.visible = false;
         this.params = this.$init.params([...TabColumns, ...TableColumns]);
         this.$emit("success");
+        this.delDemandItemList = []
       },
       //
       async onRowAdd(prop, pushParams = {}) {
@@ -286,7 +287,7 @@
               let param = JSON.parse(JSON.stringify(this.params))
               // console.log('深拷贝对象',param);
               param.priceApplyItems = list
-              let tishi = param.priceApplyItems.filter(item => {return (item.priceDiffer && item.priceDiffer !== 0)})
+              let tishi = param.priceApplyItems.filter(item => {return (item.priceDiffer && item.delFlag == '0' && item.priceDiffer !== 0)})
               console.log('筛选', tishi)
               let tishiMsg = tishi.map(item => {
                 return `第${item.$index+1}行为价格调整`

+ 0 - 1055
src/views/purchase/purchase-order/add/columnCopy.js

@@ -1,1055 +0,0 @@
-export const Columns = [
-  {
-    key: "puOrgName",
-    title: "采购组织",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "ORG_PARAM",
-    dataMapping: {
-      puOrg: "id",
-      puOrgName: "name",
-    },
-    queryParams: () => ({}),
-    require: true,
-    isShow:true,
-  },
-  {
-    key: "billType",
-    title: "订单类型",
-    inputType: "Select",
-    referName: "sys_order_type", // 字典名
-    isShow:true,
-    require: true,
-  },
-  { 
-    key: "oaDemandNo", 
-    title: "OA需求单号", 
-    inputType: "Input",  
-    isShow:true,
-    
-  },
-  { 
-    key: "erpOrderCode", 
-    title: "erp订单编号", 
-    inputType: "Input",  
-    readonly: true,
-    disabled: true,
-    isShow:true,
-  },
-  {
-    key: "code",
-    title: "订单编号",
-    inputType: "Input",
-    readonly: true,
-    disabled: true,
-    isShow:true,
-  },
-  {
-    key: "billDate",
-    title: "订单日期",
-    inputType: "DatePicker",
-    valueFormat: "yyyy-MM-dd",
-    width: 200, 
-    require: true,
-    isShow:true,
-  },
-  {
-    key: "supplierName",
-    title: "供应商",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "SUPPLIER_PARAM",
-    dataMapping: {
-      supplier: "id",
-      supplierName: "name",
-      paymentAgreement: 'paymentId',
-      paymentAgreementName: 'paymentName',
-    },
-    queryParams: () => ({}),
-    require: true,
-    isShow:true,
-  },
-  {
-    key: "paymentAgreementName",
-    title: "付款协议",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "PAYAGREEMENT_PARAM",
-    dataMapping: {
-      paymentAgreement: 'id',
-      paymentAgreementName: 'name'
-    },
-    queryParams: () => ({}),
-    isShow:true,
-    disabled:true,
-    require: true,
-  },
-  {
-    key: "finalTypeName",
-    title: "结算方式",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "BALATYPE_PARAM",
-    dataMapping: {
-      finalType: 'id',
-      finalTypeName: 'name'
-    },
-    queryParams: () => ({}),
-    isShow:true,
-    disabled:true,
-  },
-  {
-    key: "buyerName",
-    title: "采购员",
-    inputType: "PopoverSelect",
-    valueKey: "code",
-    referName: "CONTACTS_PARAM",
-    dataMapping: {
-      buyer: 'code',
-      buyerName: 'name'
-    },
-    queryParams: () => ({}),
-    require: true,
-    isShow:true,
-  },
-  {
-    key: "puDeptName",
-    title: "采购部门",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "DEPT_PARAM",
-    dataMapping: {
-      puDept: 'id',
-      puDeptName: 'name'
-    },
-    queryParams: () => ({}),
-    require: true,
-    isShow:true,
-  },
-  {
-    key: "customerName",
-    title: "收货客户",
-    inputType: "PopoverSelect",
-    width: 200,
-    valueKey: "id",
-    referName: "CUSTOMER_PARAM",
-    dataMapping: {
-      customer: 'id',
-      customerName: 'name'
-    },
-    queryParams: () => ({}),
-    isShow:true,
-  },
-  {
-    key: "qty",
-    title: "总数量",
-    inputType: "InputNumber",
-    controlsPosition: "right",
-    isShow:true,
-    disabled:true,
-  },
-  {
-    key: "originalQty",
-    title: "原始总数量",
-    inputType: "InputNumber",
-    controlsPosition: "right",
-    isShow:true,
-    disabled:true,
-  },
-  { 
-    key: "money", 
-    title: "价税合计", 
-    inputType: "InputNumber",
-    controlsPosition: "right", 
-    // precision:2,
-    isShow:true, 
-    disabled:true,
-  },
-  { 
-    key: "originalMoney", 
-    title: "原始总金额", 
-    inputType: "InputNumber",
-    controlsPosition: "right", 
-    // precision:2,
-    isShow:true, 
-    disabled:true,
-  },
-  { 
-    key: "notaxMoney", 
-    title: "无税金额", 
-    inputType: "InputNumber",  
-    controlsPosition: "right",
-    // precision:2,
-    isShow:true, 
-    disabled:true,
-  },
-  {
-    key: "status",
-    title: "单据状态",
-    inputType: "Select",
-    referName: "documents_status", // 字典名
-    disabled: true,
-    isShow:true,
-  },
-  // { key: "freezeCause", title: "冻结原因", inputType: "Checkbox", isShow:true, },
-  { key: "isBack", title: "退货", inputType: "Input", inputType: "Checkbox",  isShow:true,},
-  // { key: "isMarketing", title: "已协同生成销售订单", inputType: "Checkbox",  isShow:true,},
-  // { key: "isMarketingSource", title: "由销售订单协同生成", inputType: "Checkbox",  isShow:true,},
-  {
-    key: "warehouseName",
-    title: "WMS入库仓库", 
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "WAREHOUSE_PARAM",
-    dataMapping: {
-      warehouse: 'id',
-      warehouseName: 'name',
-    },
-    queryParams: (params) => ({
-      pkOrg: params.puOrg,
-    }),
-    isShow:true,
-    
-    // require: true,
-  },
-  {
-    key: "goodsAllocationName",
-    title: "货位",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "ALLOCATION_PARAM",
-    dataMapping: {
-      goodsAllocation: 'id',
-      goodsAllocationName: 'name',
-      
-    },
-     isShow:true,
-    queryParams: (params) => ({
-      stordocId: params.warehouse,
-    }),
-    width: 200,
-  },
-  // { key: "isSendSrm", title: "是否同步SRM", inputType: "Checkbox",isShow:true, },
-  { 
-    key: "isInvoice", 
-    title: "发票标识", 
-    inputType: "Checkbox", 
-    isShow:true,
-    disabled:true,
-  },
-  { key: "supplierOrderNo", title: "供应商订单号", inputType: "Input",isShow:true, },
-  { 
-    key: "rebateMoney", 
-    title: "订单使用返利金额", 
-    inputType: "InputNumber",
-    controlsPosition: "right",
-    // precision:2,
-    isShow:true, 
-    require: true,
-  },
-  { 
-    key: "deductionMoney", 
-    title: "订单抵扣余款金额", 
-    inputType: "InputNumber",
-    controlsPosition: "right",
-    // precision:2,
-    isShow:true, 
-    require: true,
-  },
-  { 
-    key: "goodsWarehouseName",
-    title: "收货仓库",
-    inputType: "Input",
-    isShow:true,
-    disabled:true,
-    require: true,
-  },
-  { 
-    key: "address",
-    title: "收货地址",
-    inputType: "PopoverSelect",
-    valueKey: "address",
-    referName: "ADDRESS_PARAM",
-    require: true,
-    isShow:true,
-    dataMapping: {
-      // address: 'address',
-      // addressName: '',
-      goodsWarehouse:'id',
-      goodsWarehouseName:'name',
-      contacts:'contactsName',
-      contactsPhone:'contactsPhone'
-    },
-    queryParams: () => ({}),
-    width: 180
-  },
-  { 
-    key: "contacts", 
-    title: "收货联系人", 
-    inputType: "Input",
-    isShow:true, 
-    disabled:true,
-  },
-  { 
-    key: "contactsPhone", 
-    title: "收货联系人电话", 
-    inputType: "Input",
-    isShow:true, 
-    disabled:true,
-  },
-  {
-    key: "customerDeptName",
-    title: "客户部门",
-    inputType: "PopoverSelect",
-    width: 200,
-    valueKey: "id",
-    referName: "CUSTOMERDEPT_PARAM",
-    dataMapping: {
-      customerDept: 'id',
-      customerDeptName: 'name'
-    },
-     isShow:true,
-    queryParams: () => ({}),
-
-  },
-  {
-    key: "supplierContactsName",
-    title: "供应商业务联系人",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "SUPPLIERCONTACTS_PARAM",
-    dataMapping: {
-      supplierContacts: 'id',
-      supplierContactsName: 'name'
-    },
-     isShow:true,
-    queryParams: (params) => ({
-      supplierId:params.supplier
-    }),
-    width: 200,
-  },
-  { 
-    key: "isUrgency", 
-    title: "紧急程度", 
-    inputType: "Checkbox",
-    isShow:true,
-    disabled:true,
-   },
-  { 
-    key: "isSendWms", 
-    title: "已同步WMS", 
-    inputType: "Checkbox",
-    isShow:true,
-    disabled:true,
-   },
-  // { key: "agent", title: "代理人", inputType: "Input", }, // 建议删除
-  // {
-  //   key: "agentName",
-  //   title: "代理人",
-  //   inputType: "PopoverSelect",
-  //   valueKey: "code",
-  //   referName: "CONTACTS_PARAM",
-  //   dataMapping: {
-  //     agent: 'code',
-  //     agentName: 'name'
-  //   },
-  //    isShow:true,
-  //   queryParams: () => ({}),
-  //   width: 200,
-  // },
-
-  { 
-    key: "isClose", 
-    title: "最终关闭", 
-    inputType: "Checkbox", 
-    isShow:true,
-    disabled:true,
-   },
-  {
-    key: "closeTime",
-    title: "最终关闭日期",
-    inputType: "DatePicker",
-    valueFormat: "yyyy-MM-dd",
-    isShow:true,
-    disabled:true,
-  },
-  { 
-    key: "applyPaymentMoney", 
-    title: "累计付款申请金额", 
-    inputType: "InputNumber", 
-    controlsPosition: "right",
-    // precision:2,
-    isShow:true,
-    disabled:true,
-  },
-  { 
-    key: "paymentMoney", 
-    title: "累计付款金额", 
-    inputType: "InputNumber", 
-    controlsPosition: "right",
-    // precision:2,
-    isShow:true,
-  },
-  { 
-    key: "invoiceMoney", 
-    title: "发票金额", 
-    inputType: "InputNumber",
-    controlsPosition: "right",
-    // precision:2,
-    isShow:true,
-   },
-  {
-    key: "supplierPersonalName",
-    title: "供应商业务员",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    // referName: "SUPPLIERCONTACTS_PARAM",
-    referName: "PSNLICENSE_PARAM",
-    dataMapping: {
-      supplierPersonal: 'id',
-      supplierPersonalName: 'name'
-    },
-     isShow:true,
-    queryParams: (params) => ({
-      // 组织、供应商id
-      pkOrg: params.puOrg,
-      supplierId:params.supplier
-    }),
-  },
-  // { key: "isDeliver", title: "是否发货", inputType: "Checkbox",  isShow:true,},
-  {
-    key: "retReasonName",
-    title: "退换原因",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "RETREASON_PARAM",
-    dataMapping: {
-      retReason: 'id',
-      retReasonName: 'name'
-    },
-     isShow:true,
-    queryParams: () => ({}),
-  },
-  {
-    key: "processTypeName",
-    title: "处理方式",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "PROCESSTYPE_PARAM",
-    dataMapping: {
-      processType: 'id',
-      processTypeName: 'name'
-    },
-     isShow:true,
-    queryParams: () => ({}),
-  },
-  { key: "isEnd", title: "整单关闭标识", inputType: "Checkbox", isShow:true, },
-  {
-    key: "projectNowName",
-    title: "在建工程项目",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "PROJECT_PARAM",
-    dataMapping: {
-      projectNow: 'id',
-      projectNowName: 'name'
-    },
-     isShow:true,
-    queryParams: () => ({}),
-  },
-  {
-    key: "operatingItemsName",
-    title: "经营性项目",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "OPERATING_PARAM",
-    dataMapping: {
-      operatingItems: 'id',
-      operatingItemsName: 'name'
-    },
-     isShow:true,
-    queryParams: () => ({}),
-
-  },
-  { key: "isArrivalReson", title: "到货超期原因", inputType: "Input", isShow:true, },
-  // { key: "midOrderNo", title: "中台采购订单号", inputType: "Input", isShow:true, },
-  { key: "marketingCode", title: "销售订单号", inputType: "Input", isShow:true, },
-  { key: "isArrival", title: "到货超期", inputType: "Checkbox",  isShow:true,},
-  { key: "createByName", title: "创建人", inputType: "Input", isShow:false, },
-  {
-    key: "approveTime",
-    title: "提交时间",
-    inputType: "DatePicker",
-    valueFormat: "yyyy-MM-dd",
-    isShow:false,
-  },
-  { key: "approverName", title: "审批人", inputType: "Input", isShow:false, },
-  {
-    key: "approverFinishTime",
-    title: "审批时间",
-    inputType: "DatePicker",
-    valueFormat: "yyyy-MM-dd",
-    isShow:false,
-  },
-  { key: "updateByName", title: "更新人", inputType: "Input", isShow:false, },
-  // { key: "flowId", title: "OA流程ID", inputType: "Input", isShow:false, },
-  {
-    key: "sysFileRecordList",
-    title: "附件",
-    inputType: "Upload",
-    // fileType: ["pdf",""],
-    span: 24,
-    isShow:true,
-  },
-  { 
-    key: "remark",
-    title: "备注",
-    inputType: "Textarea",
-    isShow:true,
-   },
-
-];
-
-// export const initColumns = () => columns;
-
-export const TabColumns = [
-  {
-    title: '物料信息',
-    key: 'puOrderItemList',
-    tableColumns: [
-      { 
-        key: "rowNo", 
-        title: "行号", 
-        inputType: "Input", 
-        disabled:true,
-        require:false,
-      },
-      { 
-        key: "demandCode",
-        title:"采购需求单号",
-        inputType: "Input", 
-        width: 180,
-        disabled:true,
-        require:false,
-      },
-      { 
-        key: "contractNo",
-        title:"合同编号",
-        inputType: "Input", 
-        width: 180,
-        disabled:true,
-        require:false,
-      },
-      // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
-      // {key: "material",title: "物料",inputType: "Input",   },
-      {
-        key: "materialName",
-        title: "物料",
-        inputType: "PopoverSelect",
-        width: 180,
-        require: true,
-        valueKey: "id",
-        referName: "MATERIAL_PARAM",
-        dataMapping: {
-          material: "id",
-          materialName: "name",
-          materialCode: "code",
-          // materialClassify:'classifyIdName',
-          materialManufacturersCode:'manufacturersMaterialCode',
-          specification:'specification',
-          model:'model',
-          isMedcine:'isMedicineYN',
-          manufacturer:'manufacturerId',
-          manufacturerName:'manufacturerIdName',
-          unit:'unitId',
-          unitName:'unitIdName',
-          // tax:'materialRateName',
-          storageCondition:'storageCondition',
-          carriageCondition:'transportationCondition',
-          materialClassifyOneName:'oneClass',
-          materialClassifyTwoName:'twoClass',
-          materialClassifyThreeName:'threeClass',
-          materialClassifyFourName:'fourClass',
-          registration:'registrationNo',
-          isDrug:'isDrug',
-        },
-        queryParams: () => ({}),
-      },
-      {
-        key: "materialCode",
-        title: "物料编码",
-        inputType: "Input",
-        require: true,
-        width: 180,
-        disabled:true,
-        readonly:true,
-      },
-      // { //classifyIdName   classifyId
-      //   key: "materialClassify",
-      //   title: "物料分类", 
-      //   inputType: "Input",
-      //   width: 180,
-      //   disabled:true,
-      //   readonly:true, 
-      // },
-      { // manufacturersMaterialCode  manufacturersMaterialName
-        key: "materialManufacturersCode",
-         title: "厂家物料编码", 
-         inputType: "Input",
-          width: 180,
-          disabled:true,
-        readonly:true,
-         },
-      { //specification
-        key: "specification",
-        title: "规格", 
-        inputType: "Input",
-        width: 180 ,
-        disabled:true,
-        readonly:true,
-        },
-      { //model
-        key: "model",
-        title: "型号", 
-        inputType: "Input",
-        disabled:true,
-        readonly:true,
-      },
-      { //isMedicine  isMedicineValue
-        key: "isMedcine",
-        title: "医药物料", 
-        inputType: "Checkbox", 
-        disabled:true,
-        readonly:true,
-        },
-      { // manufacturerId  manufacturerIdName
-        key: "manufacturerName",
-        title: "生产厂家代理人",
-        inputType: "Input",
-        width: 180,
-        disabled:true,
-        readonly:true,
-      },
-      { 
-        key: "isDrug",
-         title: "物料药品属性", 
-         inputType: "Checkbox", 
-         disabled:true,
-      },
-      { //unitId  unitIdName
-        key: "unitName", 
-        title: "单位", 
-        inputType: "Input",
-        disabled:true,
-        readonly:true,
-       },
-      {
-        key: "qty",
-        title: "数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 120,
-        require: true,
-      },
-      {
-        key: "currencyName",
-        title: "币种",
-        inputType: "PopoverSelect",
-        valueKey: "id",
-        referName: "CURRENCY_PARAM",
-        dataMapping: {
-          currency: 'id',
-          currencyName: 'name'
-        },
-        queryParams: () => ({}),
-        width: 180,
-      },
-      {
-        key: "priceType",
-        title: "价格类型",
-        inputType: "Select",
-        referName: "sys_price_type", // 字典名
-        width: 180,
-      },
-      { 
-        key: "taxPrice", 
-        title: "含税单价", 
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        // precision:2,
-        require: true,
-        disabled:true,
-        width: 180,
-       },
-      { 
-        key: "money", 
-        title: "价税合计", 
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        // precision:2,
-        disabled:true,
-        width: 180,
-       },
-      { //materialRate  materialRateName
-        key: "tax", 
-        title: "税率",
-        // inputType: "Input",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        // precision:2,
-        disabled:true,
-        width: 180,
-      },
-      { 
-        key: "taxDeductMoneya", 
-        title: "折扣金额", 
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        // precision:2,
-        disabled:true,
-        width: 180,
-       },
-      { 
-        key: "nitemdiscountrate", 
-        title: "折扣(%)", 
-        inputType: "Input",
-        // precision:2,
-        disabled:true,
-        width: 180,
-       },
-      { 
-        key: "ntaxnetprice", 
-        title: "含税净价", 
-        inputType: "Input",
-        controlsPosition: "right",
-        // precision:2,
-        disabled:true,
-        width: 180,
-       },
-      { 
-        key: "arrivalQty",
-        title: "已到货数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        disabled:true,
-        width: 180,
-      },
-      { 
-        key: "unarrivedQty", 
-        title: "未到货数量", 
-        inputType: "InputNumber", 
-        controlsPosition: "right",
-        disabled:true,
-        width: 180,
-      },
-      { 
-        key: "price",
-        title: "无税单价",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        // precision:2,
-        disabled:true,
-        width: 180,
-      },
-      { 
-        key: "notaxMoney", 
-        title: "无税金额", 
-        inputType: "InputNumber", 
-        controlsPosition: "right",
-        // precision:2,
-        disabled:true,
-        width: 180,
-      },
-      // { key: "priceSource", title: "价格目录ID", inputType: "Input", },
-      { key: "isStorage", title: "入库关闭", inputType: "Checkbox", disabled:true, },
-      { key: "isInvoice", title: "开票关闭", inputType: "Checkbox", disabled:true, },
-      { key: "isArrival", title: "到货关闭", inputType: "Checkbox", disabled:true,},
-      { key: "isPayment", title: "付款关闭", inputType: "Checkbox", disabled:true, },
-      { key: "isGift", title: "赠品", inputType: "Checkbox", },
-      {
-        key: "goodsWarehouseName",
-        title: "收货仓库", 
-        inputType: "Input",
-        width: 200,
-        disabled:true,
-      },
-      // { key: "place", title: "收货地点", inputType: "Input", width: 180 },
-      { 
-        key: "address",
-        title: "收货地址",
-        inputType: "PopoverSelect",
-        valueKey: "address",
-        referName: "ADDRESS_PARAM",
-        width: 180,
-        dataMapping:{
-          // address: 'address',
-          // addressName: '',
-          goodsWarehouse:'id',
-          goodsWarehouseName:'name',
-          contacts:'contactsName',
-          contactsPhone:'contactsPhone'
-        }
-      },
-      { 
-        key: "customerName",
-        title: "收货客户", 
-        inputType: "PopoverSelect",
-        valueKey: "id",
-        referName: "CUSTOMER_PARAM",
-        width: 180,
-        dataMapping:{
-          customer:'id',
-          customerName:'name',
-        },
-      },
-      { key: "productBatch", title: "产品批号", inputType: "Input", width: 180 },
-      { key: "manufactureDate", title: "生产日期", inputType: "Input", width: 180 },
-      { 
-        key: "efficacyLoseDate", 
-        title: "有效期至/失效日期", 
-        inputType: "Input",
-         width: 180
-         },
-      { 
-        key: "approvalNumber",
-         title: "批准文号",
-          inputType: "Input", 
-          width: 180
-         },
-      { 
-        key: "registration",
-         title: "注册证号", 
-         inputType: "Input", 
-         width: 180 ,
-         disabled:true,
-        },
-
-      { //storageCondition storageConditionName
-        key: "storageCondition",
-        title: "存储条件",
-        inputType: "Select",
-        referName: "sys_storage_condition", // 字典名
-        width: 180,
-        disabled:true,
-        readonly:true,
-      },
-      { // transportationCondition  transportationConditionName
-        key: "carriageCondition",
-        title: "运输条件",
-        inputType: "Select",
-        referName: "sys_conditions_carriage", // 字典名
-        width: 180,
-        disabled:true,
-        readonly:true,
-      },
-
-      { key: "isBatchLock", title: "批号锁定标识", inputType: "Checkbox", },
-      { key: "isReplenishment", title: "补单标识", inputType: "Checkbox", },
-      { key: "isUrgency", title: "紧急标识", inputType: "Checkbox", },
-      { 
-        key: "originalQty", 
-        title: "原始数量", 
-        inputType: "InputNumber", 
-        controlsPosition: "right",
-        disabled:true,
-        width: 180 ,
-      },
-      { 
-        key: "originalMoney", 
-        title: "原始金额", 
-        inputType: "InputNumber", 
-        controlsPosition: "right",
-        // precision:2,
-        disabled:true,
-        width: 180,
-      },
-      { key: "directProductBatch", title: "直运产品批号", inputType: "Input", width: 180 },
-      { key: "discountRule", title: "折扣规则编码", inputType: "Input", width: 180 },
-      { 
-        key: "reservedQty", 
-        title: "预留数量", 
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180 ,
-       },
-      { key: "reservedPeriod", title: "预留周期", inputType: "Input", },
-      { 
-        key: "taxDeductClassify", 
-        title: "扣税类别", 
-        inputType: "Select",
-        referName: "tax_deduction_category", // 字典名
-        width: 180,
-       },
-      { key: "exchangeRate", title: "折本汇率", inputType: "Input", },
-      { key: "source", title: "上游单据号", inputType: "Input", width: 180 },
-      // { key: "sourceId", title: "上游单据ID", inputType: "Input", width: 180 },
-      // { key: "demandCode", title: "采购需求单号", inputType: "Input", width: 180 },
-      { key: "arrivalDatePlan", title: "计划到货日期", inputType: "Input", width: 180 },
-     
-      { key: "isDistributionPrice", title: "配送价", inputType: "Checkbox", },
-     
-      { //threeClass
-        key: "materialClassifyOneName", 
-        title: "物料一级分类", 
-        inputType: "Input",
-        width: 180,
-        disabled:true,
-        readonly:true, 
-      },
-      { //twoClass
-        key: "materialClassifyTwoName",
-        title: "物料二级分类", 
-        inputType: "Input",
-        width: 180,
-        disabled:true,
-        readonly:true, 
-      },
-      { //threeClass
-        key: "materialClassifyThreeName", 
-        title: "物料三级分类", 
-        inputType: "Input", 
-        width: 180,
-        disabled:true,
-        readonly:true,
-      },
-      { //fourClass
-        key: "materialClassifyFourName", 
-        title: "物料四级分类",
-        inputType: "Input", 
-        width: 180,
-        disabled:true,
-        readonly:true,
-      },
-      // { key: "createByName", title: "创建人", inputType: "Input", },
-      // { key: "updateByName", title: "更新人", inputType: "Input", },
-      
-    ]
-  },
-  {
-    title: '执行结果',
-    key: 'puOrderExecuteList',
-    tableColumns: [
-      // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
-      { 
-        key: "rowno", 
-        title: "行号", 
-        inputType: "Input", 
-        disabled:true,
-        require:false,
-      },
-      {
-        key: "materialName",
-        title: "物料",
-        inputType: "PopoverSelect",
-        width: 180,
-        require: true,
-        valueKey: "id",
-        referName: "MATERIAL_PARAM",
-        dataMapping: {
-          material: "id",
-          materialName: "name",
-          materialCode: "code",
-          // materialClassify:'classifyIdName',
-          materialManufacturersCode:'manufacturersMaterialCode',
-          specification:'specification',
-          model:'model',
-          isMedcine:'isMedicine',
-          manufacturer:'manufacturerId',
-          manufacturerName:'manufacturerIdName',
-          unit:'unitId',
-          unitName:'unitIdName',
-          // tax:'materialRateName',
-          storageCondition:'storageCondition',
-          carriageCondition:'transportationCondition',
-          materialClassifyOneName:'oneClass',
-          materialClassifyTwoName:'twoClass',
-          materialClassifyThreeName:'threeClass',
-          materialClassifyFourName:'fourClass',
-          registration:'registrationNo',
-          isDrug:'isDrug',
-        },
-        queryParams: () => ({}),
-        width:180,
-      },
-      { 
-        key: "specification",
-        title: "规格", 
-        inputType: "Input", 
-        disabled:true,
-        readonly:true, 
-      },
-      {
-        key: "qty",
-        title: "数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        require: true,
-      },
-      { 
-        key: "stroageQty", 
-        title: "累计到货主数量", 
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180, 
-      },
-      { 
-        key: "stockQty", 
-        title: "累计入库主数量", 
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180, 
-      },
-      { 
-        key: "invoiceQty", 
-        title: "累计开票主数量", 
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180, 
-      },
-      { 
-        key: "rollbackQty", 
-        title: "累计退货主数量", 
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180, 
-      },
-      { 
-        key: "backStockQty", 
-        title: "累计退库主数量", 
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180, 
-      },
-      { 
-        key: "floatQty", 
-        title: "未到货数量", 
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180, 
-      },
-      // { 
-      //   key: "createByName", 
-      //   title: "创建人", 
-      //   inputType: "Input", 
-      //   width: 120 
-      // },
-      // { 
-      //   key: "updateByName", 
-      //   title: "更新人", 
-      //   inputType: "Input", 
-      //   width: 120 
-      // },
-    ]
-  },
-];
-
-
-// 集采中心
-const PurColumns =[];
-const PurchaseTabColumns =[];
-
-// 事业发展部
-const CauseColumns =[];
-const CauseTabColumns =[];
-// export const initTabColumns = () => tabColumns;

+ 0 - 1036
src/views/purchase/purchase-order/add/index copy.vue

@@ -1,1036 +0,0 @@
-<script>
-import orderApi from "@/api/business/purchase/purchase-order";
-import { initColumns, initDicts, initRules, initParams } from "@/utils/init/index.js";
-// import { Columns, TabColumns } from "./column";
-import judgeColumns from "./column";
-import { tax, currency } from "@/components/popover-select-v2/fetch";
-import VirtualScroll from 'el-table-virtual-scroll';
-import { VirtualColumn } from 'el-table-virtual-scroll';
-
-const {Columns,TabColumns} = judgeColumns();
-    
-const NewColumns = initColumns(Columns);
-const NewTabColumns = TabColumns.map((element) => ({
-  ...element,
-  tableColumns: initColumns(element.tableColumns),
-}));
-
-const SelectColumns = NewColumns.filter(
-  (column) => column.inputType === "Select"
-);
-NewTabColumns.forEach((column) => {
-  SelectColumns.push(
-    ...column.tableColumns.filter((cColumn) => cColumn.inputType === "Select")
-  );
-});
-
-export default {
-  name: "AddPurchaseOrderDrawer",
-  props:{
-    // roles:{
-    //   type:[Array,String,Object],
-    //   require:true,
-    // }
-  },
-  dicts: initDicts(SelectColumns),
-  components: {
-    'virtual-scroll':VirtualScroll,VirtualColumn,
-    FileUploadCenter: () => import("../components/FileUploadCenter/index.vue"),
-    popDialog: () => import("@/components/PopDialog/index.vue"),
-    BatchImport: () => import("@/components/BatchImport/index.vue"),
-  },
-  
-
-  data() {
-
-    return {
-      visible: false,
-      loading:false,
-      tabLoading:false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
-      count:0,
-      params: {
-        ...initParams(NewColumns),
-        puOrderItemList: [],
-        puOrderExecuteList: [],
-      },
-      tabColumns: NewTabColumns,
-      tabName: "puOrderItemList",
-      isCopy:false,
-      tableData:[],  //虚拟滚动加载显示的数据
-    };
-  },
-  computed: {
-    role:{
-      get(){
-        let {roles} = this.$store.state.user;
-        return roles.find(item => item === "syfz-purchaseorder") || "procurementManager";
-        
-      },
-      set(){}
-    }
-  },
-  watch: {
-    "params.puOrderItemList": {
-      handler(nVal, oVal) {
-        this.visible &&  
-          this.handleSynchronousMaterial(
-            "puOrderItemList",
-            "puOrderExecuteList"
-          );
-      },
-      deep: true,
-    },
-    "params.puOrderExecuteList": {
-      handler(nVal, oVal) {
-        this.visible &&
-          this.handleSynchronousMaterial(
-            "puOrderExecuteList",
-            "puOrderItemList"
-          );
-      },
-      deep: true,
-    },
-    "params.billType":{
-      handler(nVal, oVal){
-
-        let billList = ['21-Cxx-02','21-Cxx-04','21-Cxx-10','21-Cxx-14','21-Cxx-09','21-Cxx-17','21-Cxx-18'];
-        
-        if(billList.find(item => item === nVal)){
-          this.rules.warehouseName = [
-            { required: true, message: "WMS入库仓库不能为空", trigger: "change" },
-          ];
-        }else{
-          this.rules.warehouseName = null;
-        }
-
-        this.count++;
-      }
-    }
-  },
-  methods: {
-    beforeOpen() {
-      if(!this.isCopy){
-
-        const { deptName, deptId, name, nickName, orgName, orgId } = this.$store.state.user;
-        this.params.puOrg = orgId;
-        this.params.puOrgName = orgName;
-        this.params.buyer = name;
-        this.params.buyerName = nickName;
-        this.params.puDept = deptId;
-        this.params.puDeptName = deptName;
-        this.params.billDate = new Date().Format('yyyy-MM-dd');
-        this.params.createTime = new Date().Format('yyyy-MM-dd HH:mm:ss');
-        console.log(this.params,'this.params');
-        // this.addTableRow();
-      }
-    },
-    setVisible(prop,iscopy) {
-      this.visible = prop;
-
-      this.isCopy = iscopy;
-
-      if(!this.visible){
-        this.$refs['orderAddForm'].clearValidate();
-      }
-    },
-    // 复制赋值
-    async setCopyParams(id) {
-
-      try {
-        this.loading = true;
-        const { code, msg, data } = await orderApi.details(id);
-
-        if (code === 200) {
-
-          this.params = {
-            ...data,
-            id: "",
-            code: "",
-            isEnd:'N',
-            status: "0",
-            source: "3",
-            isClose:'N',
-            billDate: new Date().Format('yyyy-MM-dd'),
-            createTime : new Date().Format('yyyy-MM-dd HH:mm:ss'),
-            closeTime:'',
-            oaDemandNo:'',
-            isInvoice:'N',
-            isSendWms:'N',
-            rebateMoney:'',
-            invoiceMoney:'',
-            paymentMoney:'',
-            applyPaymentMoney:'',
-            erpOrderCode:'',
-
-          };
-
-          try {
-            const { code, rows} = await orderApi.REFER(
-              {
-                type:'WAREHOUSE_PARAM',
-                search:  this.params.warehouseName,
-                isPage: true,
-              }, {pageNum: 1 , pageSize: 10} );
-
-              if(code ==200){
-                this.judgeGoodsAllocation(rows[0].csFlag);
-              }
-
-
-          } catch (error) {
-            
-          }
-
-          for (const key in this.params) {
-            // if (Array.isArray(this.params[key])) {
-            if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
-              this.params[key].forEach((v) => {
-                v.id = "";
-                v.demandCode = "";
-                v['isInvoice'] && (v['isInvoice'] = 'N');
-                v['isStorage'] && (v['isStorage'] = 'N');
-                v['isArrival'] && (v['isArrival'] = 'N');
-                v['isPayment'] && (v['isPayment'] = 'N');
-              });
-
-            }
-          }
-          // 清空   累计本币开票金额、
-          // 累计付款金额、累计付款申请金额、累计开票主数量、最终关闭时间
-          // 、最终关闭、已同步WMS 、订单抵扣余额金额、订单使用返利金额、 发票标识
-          
-
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
-    // 增行
-    addTableRow(prop) {
-      for (const key in this.params) {
-
-        // if (Array.isArray(this.params[key])) {
-        if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
-
-          const arr = this.tabColumns.find(
-
-            (element) => element.key === key
-
-          ).tableColumns;
-
-          let rowData = initParams(arr, "key", "value");
-         
-
-          "rowno" in rowData &&
-            (rowData["rowno"] = this.params[key].length ? 
-              this.params[key][this.params[key].length - 1]['rowno'] +1 :
-               this.params[key].length + 1
-            );
-
-            // 物料
-            if("rowNo" in rowData){
-              
-              rowData["rowNo"] = this.params[key].length ? 
-              this.params[key][this.params[key].length - 1]['rowNo'] +1 :
-               this.params[key].length + 1;
-              // 扣税类别
-              rowData["taxDeductClassify"] = '1';
-              // 折本汇率
-              rowData["exchangeRate"] = '1';
-              // 价格类型
-              rowData["priceType"] = 'order';
-              // 币种
-              rowData["currency"] = '1002Z0100000000001K1';
-              rowData["currencyName"] = '人民币';
-            }
-          
-
-          // 是否完成询价,新增明细行需默认明细为false
-          // rowData["whetherCompleteInquiry"] = false;
-          this.params[key].push(rowData);
-        }
-      }
-
-      // const arr = this.tabColumns.find(
-      //   (element) => element.key === this.tabName
-      // ).tableColumns;
-      // prop.push(initParams(arr, "key", "value"));
-    },
-    // 删行
-    async delTableRow(prop, index) {
-
-     
-      for (const key in this.params) {
-        // if (Array.isArray(this.params[key])) {
-        if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
-          this.params[key].splice(index, 1);
-        }
-      }
-
-      await this.handleGetPrice();
-      // prop.splice(index, 1);
-    },
-    // 同步子表物料
-    handleSynchronousMaterial(tableOne, tableTwo) {
-      let _this = this;
-      // this.params[tableOne]-- -> this.params[tableTwo]
-      this.params[tableOne] &&
-
-        this.params[tableOne].forEach((item, index) => {
-
-          for (const key in item) {
-
-            if(!_this.params[tableTwo][index]){
-
-               const arr = _this.tabColumns.find(
-                  (element) => element.key === tableTwo
-                ).tableColumns;
-
-                _this.params[tableTwo].push(initParams(arr, "key", "value"));
-            }
-            
-            if (key in _this.params[tableTwo][index]) {
-
-              _this.params[tableTwo][index].material = item.material;
-
-              key !== 'id' && ( _this.params[tableTwo][index][key] = item[key]);
-
-            }
-          }
-        });
-    },
-    // 取消
-    handleCancel() {
-      this.params = {
-        ...initParams(this.columns),
-        puOrderItemList: [],
-        puOrderExecuteList: [],
-      };
-      this.setVisible(false);
-    },
-    // 判断保存条件
-    judgeSaveCondition(cb){
-      this.$refs['orderAddForm'].validate(async (valid) => {
-        if (valid) {
-
-          if(!this.params['puOrderItemList'].length || !this.params['puOrderExecuteList'].length){
-            this.$notify.error({
-              title: '错误',
-              message: '请填写订单行!'
-            });
-            return false;
-          }
-
-          // puOrderItemList
-        //  let isPrice =  this.params.puOrderItemList.filter(item => !item.whetherCompleteInquiry);
-
-         
-
-        //  if(isPrice.length && this.role === 'procurementManager'){
-
-        //     this.$notify.error({
-        //       title: '错误',
-        //       message: '询价失败!'
-        //     });
-        //     return false
-
-        //  }
-        //  console.log(isPrice,'isPrice');
-          cb();
-        } else {
-          this.$notify.error({
-              title: '错误',
-              message: '存在必填项未填写'
-            });
-          console.log('error submit!!');
-          return false;
-        }
-      });
-    },
-    // 保存
-     handleSava() {
-     console.log(this.params,'this.params---------');
-      this.judgeSaveCondition(async()=>{
-        try {
-            this.loading = true;
-            const { code, msg } = await orderApi.create(this.params);
-            if (code === 200) {
-              this.handleCancel();
-            }
-          } catch (err) {
-            //
-          } finally {
-            this.loading = false;
-          }
-      })
-    },
-    judgeGoodsAllocation(porp){
-      if(porp === 'Y'){
-        this.rules.goodsAllocationName = [
-          { required: true, message: "货位不能为空", trigger: "change" },
-        ];
-      } else{ 
-        this.rules.goodsAllocationName = null;
-      }
-      this.count++;
-   },
-    // 主表参照改变之后
-   async handleReferChange(val, type, source){
-     let page = { pageNum: 1 , pageSize: 10 };
-      // 供应商选择  
-      if( type === 'SUPPLIER_PARAM' ){
-
-
-        let relevanceRefer = [
-          {
-            // 供应商联系人
-            key:'supplierContacts',
-            params:{
-              type:'SUPPLIERCONTACTS_PARAM',
-              supplierId:val.id,
-            }
-          },
-          {
-            // 供应商业务员
-            key:'supplierPersonal',
-            params:{
-              type:'PSNLICENSE_PARAM',
-              supplierId:val.id,
-              pkOrg: source.puOrg,
-            }
-          }
-        ]
-        
-        try {
-
-          let promiseArr =  relevanceRefer.map( (refer) =>{
-
-            return new Promise((resolve,reject)=>{
-
-               orderApi.REFER(
-                {
-                  ...refer.params,
-                  search: "",
-                  isPage: true,
-                }, page ).then(res=>{
-
-                  let {code,rows} = res;
-                  if (code === 200) {
-                    
-                    source[refer.key] = rows[0]? rows[0].id :'';
-                    
-                    source[`${refer.key}Name`] = rows[0] ? rows[0].name :'';
-                    
-                    resolve();
-                  }
-              })
-            })
-          })
-
-          Promise.all(promiseArr).then(async()=>{
-            // 明细不为空的情况下进行询价
-            let detailList = this.params['puOrderItemList'].filter(item => (
-                item.material && item.material != '' 
-              ))
-              
-              if(detailList.length){
-
-                await this.handleGetPrice();
-              }
-          })
-        } catch (error) {}
-      }
-
-      // 组织
-      if(type === 'ORG_PARAM'){
-
-          for (const key in this.params) {
-
-            // if (Array.isArray(this.params[key])) {
-            if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
-
-              this.params[key] = [];
-
-            }
-            else if(key === 'sysFileRecordList'){
-              this.params[key] = [];
-            }
-             else if (
-              key != "puOrg" &&
-              key != "puOrgName" &&
-              key != "buyer" &&
-              key != "buyerName" &&
-              key != "puDept" &&
-              key != "puDeptName" &&
-              key != "status" &&
-              key != "billDate" &&
-              key != "createTime" 
-            ) {
-              this.params[key] = "";
-            } else {
-            }
-          }
-        
-
-      }
-
-      // WMS仓库
-      if(type === 'WAREHOUSE_PARAM'){
-        this.judgeGoodsAllocation(val.csFlag);
-        source.goodsAllocation = ''
-        source.goodsAllocationName = ''
-        // this.count++
-      }
-    },
-
-    // 下拉框选择改变
-    handleSelectChange(val,typeName){
-
-      if(val === 'billType'){
-
-      this.params['billTypeName'] = this.dict.type[typeName].find(item => item.value == this.params[val]).label;
-
-      }
-
-    },
-
-
-    // 子表参照改变之后
-   async handleTabReferChange(val,  type, source) {
-
-      // 触发物料参照询价 
-      if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
-
-        source['qty'] = 0;
-
-        // source['whetherCompleteInquiry'] = false;
-
-        source['taxPrice'] = 0;
-
-        source['money'] = 0;
-
-        source['taxDeductMoneya'] = 0;
-
-        source['price'] = 0;
-        
-        source['notaxMoney'] = 0;
-
-        source['tax'] = 0;
-
-        this.params['qty'] = 0;
-        this.params['originalQty'] = 0;
-        this.params['money'] = 0;
-        this.params['originalMoney'] = 0;
-        this.params['notaxMoney'] = 0;
-        source.isDrug = val.materialMedcine.isDrug  == '0' ? 'Y' : 'N';
-
-        // await this.handleGetPrice();
-
-      }
-
-      // 物料触发税率
-      if( type == "MATERIAL_PARAM"){
-        let {rateCode} = source;
-        try {
-          // try
-          this.loading = true;
-          const { ntaxrate } = await tax(rateCode);
-          source.tax = ntaxrate === "0E-8" ? 0 : ntaxrate;
-        } catch (err) {
-          // catch
-          console.error(err);
-        } finally {
-          // finally
-          this.loading = false;
-        }
-      }
-
-    },
-
-    // 子表下拉框改变
-    async handleTabSelectChange(type,row){
-     
-      if(type == 'priceType' && row.material && row.qty && row.qty != ""){
-
-        // row['whetherCompleteInquiry'] = false;
-
-        await this.handleGetPrice();
-      }
-    },
-
-    // 子表inputNumber
-    handleInputChange(row, type) {
-      // 物料数量变化----询价
-      if ((type == "qty" || type == "taxPrice" || type == 'taxDeductMoneya')&& row.material) {
-
-        // row['whetherCompleteInquiry'] = false;
-
-        
-       this.handleGetPrice();
-
-      }
-
-      // if(this.role === 'syfz-purchaseorder' && row.material && (type == "qty" ||type === "taxPrice" )){
-
-      //   row.money = row.qty * row.taxPrice;
-      // }
-
-    },
-
-    // 子表多选框改变
-    handleTabCheckbox(type,source){
-
-      // 勾选赠品,价税合计更新为0,含税单价、无税单价更新为0
-      if(type === 'isGift' && source.material && source.qty && source.qty != ""){
-
-        // source['whetherCompleteInquiry'] = false;
-
-        this.handleGetPrice()
-      }
-
-    },
-    // 询价 getPrice
-    async handleGetPrice() {
-
-        try {
-          
-          // action:insert(新增)、revise(修订)、update(编辑)
-          let { code, data } = await orderApi.getPrice({ ...this.params,action: 'insert' });
-  
-          if (code == 200) {
-  
-            this.params = data;
-  
-          }
-  
-        } catch (error) {} 
-      
-
-    
-    },
-
-    async handelImport(fileList){
-
-      try {
-
-        let formData = new FormData();
-
-        formData.append('file',fileList[0].raw);
-
-        this.$modal.loading("正在上传文件,请稍候...");
-
-        let {code,data} = await orderApi.orderImport(formData);
-
-        if(code == 200) {
-          this.tabLoading = true;
-          // puOrderExecuteList puOrderItemList
-
-          // let size = 20;
-          // let num = 1;
-          // let total = Math.ceil(data['puOrderItemList'].length / size);
-
-          // let resultData = {...data};
-          
-          // let intervalPush = setInterval(()=>{
-
-          //   if(num > total){
-              
-          //     clearInterval(intervalPush);
-
-          //     this.tabLoading = false;
-            
-          //     this.handleGetPrice();
-          //   } 
-    
-          //   for (const key in resultData) {
-
-          //     resultData[key].slice(size*(num-1), (size*num) ).forEach(item =>{
-            
-
-          //       this.params[key].push(item);
-
-          //     })
-
-          //   }
-
-          //   num++;
-
-          // },200);
-
-          for (const key in data) {
-
-            this.params[key].push(...data[key]);
-
-          }
-
-          
-          let {setVisible} =  this.$refs.batchImport;
-          
-          setVisible(false);
-          
-            
-          
-        }
-        
-      } catch (error) {
-        
-      }finally{
-        this.$modal.closeLoading();
-        
-      }
-      
-    },
-    
-    async handleTemDownload(){
-
-      this.download('/pu/order/downloadFailData',{}, `采购订单物料信息模板${new Date().getTime()}.xlsx`);
-    },
-
-    // judgeRole(){
-    //   let {roles} = this.$store.state.user;
-    //   let role =  roles.find(item => item === "syfz-purchaseorder") || "procurementManager";
-    //   return role;
-    // },
-
-
-  },
-  created() {
-    console.log("ADD CREATED", this.params);
-  },
-  mounted() {},
-  destroyed() {},
-};
-</script>
-<template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    @open="beforeOpen"
-    @close="$emit('close')"
-    v-loading="loading"
-  >
-    <el-form
-      size="mini"
-      label-position="right"
-      ref="orderAddForm"
-      label-width="140px"
-      :model="params"
-      :rules="rules"
-      :key="count"
-    >
-      <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" 
-              type="primary"
-              @click="handleSava"
-            >保存</el-button>
-            <el-button size="mini" @click="handleCancel">取消</el-button>
-          </div>
-        </div>
-        <el-row style="display: flex; flex-wrap: wrap">
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
-          >
-            <el-form-item
-              :prop="column.key"
-              :label="column.title"
-              v-if="column.isShow"
-            >
-              <el-input
-                v-if="column.inputType === 'Input'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%;"
-              >
-              </el-input>
-              <dr-popover-select
-                v-if="column.inputType === 'PopoverSelect'"
-                v-model="params[column.key]"
-                :value-key="column.valueKey"
-                :source.sync="params"
-                :title="column.title"
-                :type="column.referName"
-                :disabled="column.disabled"
-                :multiple="column.multiple"
-                :placeholder="column.placeholder"
-                :data-mapping="column.dataMapping"
-                :query-params="column.queryParams"
-                @change="handleReferChange"
-              ></dr-popover-select>
-
-              <el-input
-                v-if="column.inputType === '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.inputType === 'InputNumber'"
-                v-model="params[column.key]"
-                :precision="column.precision"
-                :controls-position="column.controlsPosition"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
-              </el-input-number>
-              <el-select
-                v-if="column.inputType === 'Select'"
-                v-model="params[column.key]"
-                :disabled="column.disabled"
-                :clearable="column.clearable"
-                :placeholder="column.placeholder"
-                style="width: 100%"
-                filterable
-                @change="handleSelectChange(column.key,column.referName)"
-              >
-                <el-option
-                  v-for="item in dict.type[column.referName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                ></el-option>
-              </el-select>
-              <el-select
-                v-if="column.inputType === '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.inputType === 'DatePicker'"
-                v-model="params[column.key]"
-                :type="column.type"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :picker-options="column.pickerOptions"
-                style="width: 100%"
-              ></el-date-picker>
-              <el-checkbox
-                v-if="column.inputType === 'Checkbox'"
-                v-model="params[column.key]"
-                :disabled="column.disabled"
-                true-label="Y"
-                false-label="N"
-              ></el-checkbox>
-              <file-upload-center
-                v-if="column.inputType === 'Upload'"
-                v-model="params[column.key]"
-                :file-type="column.fileType"
-              ></file-upload-center>
-            </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%" v-loading="tabLoading">
-          <el-tab-pane
-            v-for="(column, index) in tabColumns"
-            :key="index"
-            :label="column.title"
-            :name="column.key"
-          >
-
-          <virtual-scroll :data="resultData" 
-                    :item-size="53" 
-                    key-prop="id" 
-                    @change="(virtualList) => tableData = virtualList" 
-                    :virtualized="true" @selection-change="handleSelectionChange">
-      <!-- row-key绑定列唯一值,height一定要设置否则会滚动条滚动位置不对且数据滚动全部加载完后会出现白板-->
-          </virtual-scroll>
-
-
-            <el-table 
-              :data="params[column.key]" 
-              style="width: 100%"
-              :height="params[column.key].length ? 300 : 100"
-              border
-            >
-              <el-table-column
-                v-for="(cColumn, cIndex) in column.tableColumns"
-                :key="cIndex"
-                :label="cColumn.title"
-                :width="cColumn.width || 80"
-              >
-              <template slot="header" slot-scope="scope">
-                <span v-if="cColumn.require" style="color: #ff4949">*</span>
-                <span>
-                  {{ cColumn.title }}
-                </span>
-              </template>
-                <template slot-scope="scope">
-                  <el-form-item 
-                    label-width="0" 
-                    :prop="`${column.key}.${scope.$index}.${[cColumn.key]}`"
-                    :rules="{ required: cColumn.require || false, message: `${cColumn.title}不能为空`, trigger: 'change' }"
-                  >
-                    <el-tag v-if="cColumn.key === 'index'" >
-                      {{ scope.$index + 1 }}
-                    </el-tag>
-                    <el-input
-                      v-if="cColumn.inputType === 'Input'"
-                      v-model="scope.row[cColumn.key]"
-                      :placeholder="cColumn.placeholder"
-                      :clearable="cColumn.clearable"
-                      :disabled="cColumn.disabled"
-                      size="mini"
-                      style="width: 100%"
-                    ></el-input>
-
-                    <!--  -->
-                    <dr-popover-select
-                      v-if="cColumn.inputType === 'PopoverSelect'"
-                      v-model="scope.row[cColumn.key]"
-                      :source.sync="scope.row"
-                      :title="cColumn.title"
-                      :value-key="cColumn.valueKey"
-                      :type="cColumn.referName"
-                      :disabled="cColumn.disabled"
-                      :multiple="cColumn.multiple"
-                      :placeholder="cColumn.placeholder"
-                      :data-mapping="cColumn.dataMapping"
-                      :query-params="cColumn.queryParams"
-                      @change="handleTabReferChange"
-                      size="mini"
-                    >
-                    </dr-popover-select>
-
-                    <el-input-number
-                      v-if="cColumn.inputType === 'InputNumber'"
-                      v-model="scope.row[cColumn.key]"
-                      :precision="cColumn.precision"
-                      :controls-position="cColumn.controlsPosition"
-                      :placeholder="cColumn.placeholder"
-                      @change="handleInputChange(scope.row, cColumn.key)"
-                      :clearable="cColumn.clearable"
-                      :disabled="cColumn.disabled"
-                      :min="cColumn.key === 'reservedQty' ? 0 : -Infinity"
-                      size="mini"
-                      style="width: 100%"
-                    ></el-input-number>
-
-                    <el-select
-                      v-if="cColumn.inputType === 'Select'"
-                      v-model="scope.row[cColumn.key]"
-                      filterable
-                      size="mini"
-                      :disabled="cColumn.disabled"
-                      :clearable="cColumn.clearable"
-                      :placeholder="cColumn.placeholder"
-                      style="width: 100%"
-                      @change="handleTabSelectChange(cColumn.key,scope.row)"
-                    >
-                      <el-option
-                        v-for="item in dict.type[cColumn.referName]"
-                        :key="item.value"
-                        :label="item.label"
-                        :value="item.value"
-                      ></el-option>
-                    </el-select>
-
-                    <el-checkbox
-                      v-if="cColumn.inputType === 'Checkbox'"
-                      v-model="scope.row[cColumn.key]"
-                      :disabled="cColumn.disabled"
-                      true-label="Y"
-                      false-label="N"
-                      @change="handleTabCheckbox(cColumn.key,scope.row)"
-                    ></el-checkbox>
-                  </el-form-item>
-                </template>
-              </el-table-column>
-
-              <el-table-column fixed="right" label="操作" width="80">
-                <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="mini" @click="addTableRow(params[tabName])"
-            >增行</el-button>
-         
-            <!-- v-if="role === 'procurementManager'" -->
-          <BatchImport
-            ref="batchImport"
-            @import="handelImport"
-            @temDownload="handleTemDownload"
-          ></BatchImport>
-        </el-row>
-      </el-card>
-    </el-form>
-  </el-drawer>
-</template>
-

+ 0 - 2
src/views/purchase/purchase-order/add/index.vue

@@ -735,7 +735,6 @@ export default {
           if (sumColumn.length) {
             means[columnIndex] = values.reduce((prev, curr) => {
               const value = Number(curr);
-              console.log(value, "value", !isNaN(value));
               if (!isNaN(value)) {
                 return prev + curr;
               } else {
@@ -761,7 +760,6 @@ export default {
       this.$refs.puOrderExecuteList &&
         this.$refs.puOrderExecuteList[0].doLayout();
       this.$refs.puOrderItemList && this.$refs.puOrderItemList[0].doLayout();
-      console.log(this.$refs.puOrderItemList, "this.$refs.puOrderItemList");
     });
   },
   destroyed() {},

+ 0 - 1
src/views/purchase/purchase-order/column.js

@@ -696,7 +696,6 @@ const CauseColumns = [
 
 const CommonTabColumns = [
 
-
   {
     title: '物料信息',
     key: 'puOrderItemList',

+ 10 - 17
src/views/purchase/purchase-order/index.vue

@@ -452,7 +452,6 @@ export default {
     },
     //流程收回
     async handleBack(row) {
-      console.log("xxxx", this.dict.type);
       try {
         const { msg, code } = await orderApi.oaBack({
           fdTemplateId: this.dict.type.oa_templete_id.find((item) => {
@@ -528,17 +527,13 @@ export default {
             baskCause: value,
           };
 
-          console.log(data);
-
           try {
             let { code, msg } = await orderApi.documentsReturn(data);
 
             if (code === 200) {
               this.handleRefreshList();
             }
-          } catch (error) {
-            console.log(error, "error------------");
-          }
+          } catch (error) {}
         })
         .catch(() => {});
     },
@@ -596,8 +591,6 @@ export default {
     // 主表Select框
     handleSelect(selection, row) {
       this.checkedList = selection;
-
-      console.log(this.checkedList, "this.checkedList");
     },
     handleSelectionChange(selection) {
       this.checkedList = selection;
@@ -605,8 +598,6 @@ export default {
     // 子表Select框
     handleTabSelect(selection, row) {
       this.checkedTabList = selection;
-
-      console.log(this.checkedTabList, "this.checkedTabList");
     },
     handleTabSelectionChange(selection) {
       this.checkedTabList = selection;
@@ -717,10 +708,10 @@ export default {
     <!-- 操作 -->
     <el-row :gutter="24" type="flex" justify="end" style="margin: 20px 0 12px">
       <el-col :span="24" style="text-align: right">
-        <!-- <query-scheme
+        <query-scheme
           :candidate="candidate"
           @submit="queryScheme"
-        ></query-scheme> -->
+        ></query-scheme>
         <el-button
           :size="size"
           type="primary"
@@ -793,15 +784,16 @@ export default {
       :dict="dict"
       :height="400"
       convenitentOperation
-      @select="handleSelect"
       :columns="tableColumns"
       :selectable="setSelectable"
+      storage-key="PuchaseOrderSuperTable1"
+      @select="handleSelect"
       @row-click="handleDetailsData"
       @row-dblclick="handleOpenSeeDrawer"
       @pagination="fetchList(params, page)"
       @selection-change="handleSelectionChange"
     >
-      <ux-table-column fixed="right" title="操作" width="160">
+      <ux-table-column fixed="right" title="操作" width="180">
         <template slot-scope="scope">
           <el-button
             v-if="judgeIsOption('revise', scope.row)"
@@ -883,15 +875,16 @@ export default {
         >
           <el-super-ux-table
             v-model="tabTableDatas[column.key]"
-            :ref="column.key"
+            showSummary
+            convenitentOperation
             :dict="dict"
+            :ref="column.key"
             :height="tabHeight"
             :columns="column.tableColumns"
             :selectable="setTabSelectable"
             :checkbox="setTabSelectable()"
-            convenitentOperation
-            showSummary
             :size="size"
+            :storage-key="'PuchaseOrder' + column.key"
             @select="handleTabSelect"
             @selection-change="handleTabSelectionChange"
           >

+ 7 - 7
src/views/purchase/task/index.vue

@@ -32,8 +32,7 @@ export default {
       SearchColumns: SearchColumns,
     };
   },
-  computed: {
-  },
+  computed: {},
   watch: {},
   created() {
     this.params = {
@@ -175,15 +174,16 @@ export default {
     </div>
     <el-super-ux-table
       v-model="tableData"
-      :size="size"
-      :dict="dict"
-      :page="page"
-      :columns="TableColumns"
       index
       checkbox
       pagination
-      convenitentOperation
       showSummary
+      :size="size"
+      :dict="dict"
+      :page="page"
+      convenitentOperation
+      :columns="TableColumns"
+      storage-key="PuchaseTaskSuperTable"
       @row-select="useSelect"
       @pagination="useQuery(params, page)"
     >