Explorar el Código

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!317
黄梓星 hace 1 año
padre
commit
dde915371c

+ 1 - 0
package.json

@@ -45,6 +45,7 @@
     "clipboard": "2.0.8",
     "core-js": "^3.25.3",
     "echarts": "^5.4.0",
+    "el-table-infinite-scroll": "^2.0.0",
     "element-ui": "2.15.12",
     "file-saver": "2.0.5",
     "fuse.js": "6.4.3",

+ 25 - 25
src/main.js

@@ -96,31 +96,31 @@ Vue.use(Print); //注册
 DictData.install();
 
 // el-table无限滚动解决页面渲染卡死
-Vue.directive("myscroll", {
-  bind(el, bind, vnode) {
-    const self = vnode.context;
-    let target = el.querySelector('.el-table__body-wrapper');
-    target.addEventListener("scroll", () => {
-      // 检测触底
-      if (target.scrollTop + target.clientHeight >= target.scrollHeight) {
-        if (self.over >= self.basicForm.puDemandItemList) {
-          return;
-        }
-        self.over +=15
-      }
-    })
-  }
-})
-Vue.mixin({
-  data() {
-    return {
-      // scrollTop: 0,
-      // tableHeight: 300
-      start: 0,
-      over: 15
-    }
-  }
-})
+// Vue.directive("myscroll", {
+//   bind(el, bind, vnode) {
+//     const self = vnode.context;
+//     let target = el.querySelector('.el-table__body-wrapper');
+//     target.addEventListener("scroll", () => {
+//       // 检测触底
+//       if (target.scrollTop + target.clientHeight >= target.scrollHeight) {
+//         if (self.over >= self.basicForm.puDemandItemList) {
+//           return;
+//         }
+//         self.over +=15
+//       }
+//     })
+//   }
+// })
+// Vue.mixin({
+//   data() {
+//     return {
+//       // scrollTop: 0,
+//       // tableHeight: 300
+//       start: 0,
+//       over: 15
+//     }
+//   }
+// })
 /**
  * If you don't want to use mock-server
  * you want to use MockJs for mock api

+ 129 - 0
src/views/material/basicFile/columns.js

@@ -0,0 +1,129 @@
+export const SearchColumns = [
+
+  {
+    item:{
+      key: "code",
+      title: "物料编码",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "code",
+      referName: "MATERIAL_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "name",
+      title: "物料名称",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "name",
+      referName: "MATERIAL_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "isEnable",
+      title: "启用状态",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "material_enable",
+    },
+  },
+  {
+    item:{
+      key: "isSync",
+      title: "是否同步NC",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_number_yes_no",
+    },
+  },
+  {
+    item:{
+      key: "registrant",
+      title: "生产厂家/代理人",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "name",
+      referName: "MANUFACTURER_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "storageCondition",
+      title: "存储条件",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_storage_condition",
+    },
+  },
+  {
+    item:{
+      key: "transportationCondition",
+      title: "运输条件",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_conditions_carriage",
+    },
+  },
+  {
+    item:{
+      key: "isMedicine",
+      title: "是否医药物料",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_number_yes_no",
+    },
+  },
+  {
+    item:{
+      key:'classifyAbc',
+      title:'ABC分类',
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "abc_type",
+    }
+  },
+];
+
+export const OtherDictColumns = [
+  {
+    item:{
+      key:"expiryUnitId",
+      title:'效期管理',
+    },
+    attr:{
+      is: "el-select",
+      dictName: "period_unit",
+    }
+  },
+  {
+    item:{
+      key:'usefulLifeUnitId',
+      title:'有效期至单位',
+    },
+    attr:{
+      is: "el-select",
+      dictName: "expiry_date",
+    }
+  },
+  
+]

+ 1 - 1
src/views/material/basicFile/details.vue

@@ -114,7 +114,7 @@
 
     </div>
     
-      <div class="md-content">
+      <div class="md-content" :key="basicData.value.id">
         <el-form :inline="true" label-position="right" :model="basicData.value">
           <!-- <el-form-item label="所属组织"></el-form-item> -->
           <el-form-item label="物料编码">

+ 80 - 17
src/views/material/basicFile/index.vue

@@ -6,10 +6,18 @@
     <!-- 主体列表 -->
     <el-card class="material-list" v-loading="loading">
 
-      <!-- 操作栏 -->
+      
     <div style="margin: 0 0 10px 0;">
       <!-- 查询条件 -->
-      <el-row :gutter="10">
+      <el-super-search
+        v-model="params"
+        :size="size"
+        :dict="dict"
+        :columns="SearchColumns"
+        @reset="handleResetQuery"
+        @submit="handleQuery"
+      ></el-super-search>
+      <!-- <el-row :gutter="10">
         <el-col :span="1.5">
           <el-form :inline="true" :model="queryForm" class="mb-query" @submit.native.prevent>
             <el-form-item label="物料编码">
@@ -19,14 +27,12 @@
               <el-input size="small" v-model="queryForm.name" placeholder="物料名称" clearable></el-input>
             </el-form-item>
             <el-form-item label="启用状态">
-              <!-- 0=已启用,2=已停用 -->
               <el-select size="small" v-model="queryForm.isEnable" placeholder="请选择" clearable>
                 <el-option key="0" label="已启用" value="0"></el-option>
                 <el-option key="2" label="已停用" value="2"></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="是否同步NC">
-              <!-- 是否同步;2=否,0=是 -->
               <el-select size="small" v-model="queryForm.isSync" placeholder="请选择" clearable>
                 <el-option key="0" label="是" value="0"></el-option>
                 <el-option key="2" label="否" value="2"></el-option>
@@ -40,8 +46,9 @@
           </el-form>
         </el-col>
 
-      </el-row>
+      </el-row> -->
     </div>
+    <!-- 操作栏 -->
       <el-row 
         :gutter="10" 
         class="mb10"
@@ -101,9 +108,11 @@
       </el-row>
 
       <el-table 
+        v-if="tableHeader.length"
         border 
         :data="taskList" 
         ref="materialTable" 
+        max-height="550"
         @cell-dblclick="handledbClick" 
         :row-key="getRowKey"
         @selection-change="handleSelectionChange" 
@@ -111,7 +120,7 @@
         @select-all="handleSelectAll"
       >
         <!--  -->
-        <el-table-column type="selection" width="45" :reserve-selection="true"/>
+        <el-table-column type="selection" width="45" :reserve-selection="true" fixed/>
         <el-table-column type="index" label="序号" width="55" align="center"/>
         <el-table-column 
           width="150" 
@@ -120,13 +129,27 @@
           align="center"
           show-overflow-tooltip
         >
-          <!-- :prop="h.attribute == 'select' ? `${h.prop}Name` : h.prop" -->
           <template slot-scope="scope">
-            {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
+            <span v-if="h.apiUrl">{{scope.row[`${h.prop}Name`]}}</span>
+            <el-checkbox 
+              v-else-if="h.attribute == 'checkbox'"
+              v-model="scope.row[h.prop]"
+              disabled
+              true-label="0" 
+              false-label="2"
+            ></el-checkbox>
+            <el-dict-tag
+              v-else-if="h.dictId"
+              :value="scope.row[h.prop]"
+              :options="dict.type[h.dictId]"
+            ></el-dict-tag>
+
+            <span v-else>{{ scope.row[h.prop] || '--' }}</span>
+            <!-- {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
             (h.attribute == 'checkbox' ?
             (scope.row[h.prop] == '0' ? '√' : '')
             : scope.row[h.prop])
-            }}
+            }} -->
           </template>
         </el-table-column>
       </el-table>
@@ -174,12 +197,24 @@
 <script>
   import './style/index.scss';
   import materialApi from '@/api/material/basic';
+  import { SearchColumns,OtherDictColumns } from './columns';
+  import { initDicts } from "@/utils/init.js";
 
   export default {
     name: "material-basic",
+    dicts:[...initDicts([...SearchColumns,...OtherDictColumns])],
+    // dicts:[],
+    components: {
+      ElSuperSearch: () => import("@/components/super-search/index.vue"),
+      ElDictTag: () => import("@/components/DictTag/index.vue"),
+    },
     data() {
+      const params = this.$init.params(SearchColumns);
       return {
         failLoad: false,
+        params:params,
+        SearchColumns:SearchColumns,
+        size:'mini',
         // 物料基本信息数据
         taskList: [],
         // 查询表单字段
@@ -289,17 +324,25 @@
       },
       // 重置查询条件
       handleResetQuery() {
-        for (const key in this.queryForm) {
+        // for (const key in this.queryForm) {
 
-          this.queryForm[key] = '';
-        }
+        //   this.queryForm[key] = '';
+        // }
+
+        this.queryParams.pageNum = 1;
+      
+        this.queryParams.pageSize = 10;
+
+        this.params = this.$init.params(SearchColumns);
+
+        this.handleQuery();
       },
       // 刷新
       handleRefresh() {
         this.getMaterialList('material');
-        for (const key in this.queryForm) {
-          this.queryForm[key] = '';
-        }
+        // for (const key in this.queryForm) {
+        //   this.queryForm[key] = '';
+        // }
       },
       // 过滤
       handleFilter(e) {
@@ -495,6 +538,7 @@
       },
       // 获取物料列表信息
       getMaterialList(templateCode, query) {
+        // (params, page)
         let _this = this;
         this.loading = true;
         let page = {
@@ -504,7 +548,8 @@
 
         let param = {
           templateCode,
-          ...this.queryForm
+          ...this.params
+          // ...this.queryForm
         }
         // console.log(param, 'param');
         materialApi.materialList(param, page).then((res) => {
@@ -523,6 +568,24 @@
         materialApi.tagList({templateCode}).then(res => {
           console.log(res, '获取物料列表表头');
           if (res.code == 200) {
+
+            // let dictList = []
+            // res.data.forEach(item =>{
+            //   if(item.dictId){
+            //     // 字典
+            //     dictList.push({
+            //       item:{...item},
+            //       attr:{
+            //         dictName:item.dictId
+            //       }
+            //     });
+                
+            //   }
+            // })
+            // console.log(dictList,'dictList');
+            // console.log(this,'this');
+            // this.dict =[...initDicts([...SearchColumns,...dictList])]
+
             this.tableHeader = res.data;
           }
         })
@@ -565,7 +628,7 @@
 
 <style lang="scss">
   .material-list {
-    height: calc(100vh - 70px);
+    // height: calc(100vh - 70px);
 
 
     .el-card__body {

+ 1 - 1
src/views/purchase/DemandSummary/index.vue

@@ -595,7 +595,7 @@ export default {
         // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
         // var name = fileName.split(";")[0]; //切割成文件名
         downloadElement.href = href;  //下载地址
-        downloadElement.download = '采购需求处理导出明细'+ this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
+        downloadElement.download = '采购需求处理导出'+ this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
         document.body.appendChild(downloadElement);
         downloadElement.click(); // 点击下载
         document.body.removeChild(downloadElement); // 下载完成移除元素

+ 220 - 385
src/views/purchase/PurchaseDemandList/add.vue

@@ -168,8 +168,7 @@
 
       <el-table
           v-loading="loading"
-          v-myscroll
-          :data="basicForm.puDemandItemList.slice(0, over)"
+          :data="basicForm.puDemandItemList"
           fit
           border
           highlight-current-row
@@ -183,12 +182,14 @@
           :cell-class-name="cellClassName"
           :row-key="getRowKeys"
           ref="table"
+          v-el-table-infinite-scroll="load"
+          :infinite-scroll-disabled="loadDisabled"
         >
           <el-table-column show-overflow-tooltip type="selection" :reserve-selection="true"/>
           <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px"/>
           <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo">
             <template slot-scope="scope">
-              {{ scope.$index + 1 + '0' }}
+              {{ scope.row.rowNo = scope.$index + 1 + "0" }}
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>
@@ -212,7 +213,7 @@
           <el-table-column show-overflow-tooltip label="实际(业务)需求量" align="center"  prop="qty" width="150px" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :show-message="false" :rules="{ required: true, message: '请填写实际(业务)需求量', trigger: 'blur' }">
-                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.qty" @input="getYLSL(scope)"/>
+                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.qty" @input="getYLSL(scope)" @paste.native="pasteMe($event, scope, scope.$index)"/>
               </el-form-item>
             </template>
           </el-table-column>
@@ -526,7 +527,11 @@ import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand,
 import {getRefer} from '@/api/purchase/basic.js'
 // 明细行选择物料参照
 import popDialog from '@/components/PopDialog/index.vue'
+import ElTableInfiniteScroll from "el-table-infinite-scroll";
 export default {
+  directives: {
+    "el-table-infinite-scroll": ElTableInfiniteScroll,
+  },
   name: 'addDemandList',
   props: ['pageStu','row', 'disable'],
   dicts: ['sys_processing_mode', 'sys_plan_type', 'sys_status', 'sys_bill_source', 'sys_business','sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
@@ -625,7 +630,117 @@ export default {
         contactsPhone: '',
         address: ''
       },
-      purchaseManOptions: []
+      purchaseManOptions: [],
+      sonModel: {
+        rowNo: null,
+        contacts: null,
+        id: null,
+        demandId: null,
+        status: null,
+        materialCategory: null,
+        buyer: null,
+        buyerName: null,
+        mateiralClassifyOne: null,
+        materialClassifyOneName: null,
+        materialClassifyTwo: null,
+        materialClassifyTwoName: null,
+        materialClassifyThree: null,
+        materialClassifyThreeName: null,
+        materialClassifyFour: null,
+        materialClassifyFourName: null,
+        materialCode: null,
+        material: null,
+        materialName: null,
+        classifyId: null,
+        specification: null,
+        unit: null,
+        unitName: null,
+        manufacturerName: null,
+        registrant: null,
+        puPeriod: null,
+        expiryUnit: null,
+        expiry: null,
+        minPackage: null,
+        minOrderQty: null,
+        minBatch: null,
+        safeStock: null,
+        averageQtyMonth: null,
+        qty: null,
+        adjustmentPersonal: null,
+        adjustmentTime: null,
+        manualRegulation: null,
+        updateCause: null,
+        reservedProportion: null,
+        reservedPeriod: null,
+        reservedQty: null,
+        demandPeriod: null,
+        forecastClassify: null,
+        onemonthAvgVolume: null,
+        threemonthAvgVolume: null,
+        puFreight: null,
+        deliveryDate: null,
+        isUrgency: 'N',
+        isReplenishment: 'N',
+        isBatchLock: 'N',
+        isCustomerSpecified: '',
+        remark: null,
+        puRemark: null,
+        lastWarehouseQty: null,
+        resDemandQty: null,
+        lastWarehouse: null,
+        lastWarehouseName: null,
+        deliveryWarehouse: null,
+        deliveryWarehouseName: null,
+        lastAllocation: null,
+        lastAllocationName: null,
+        deliveryAllocation: null,
+        deliveryAllocationName: null,
+        passageOn: null,
+        puOrg: null,
+        purOrgName: null,
+        lastStockQty: null,
+        superiorCenterQty: null,
+        superiorAllotQty: null,
+        availableQty: null,
+        statusAllot: 'N',
+        additionalSupplier: null,
+        additionalSupplierName: null,
+        periodUnit: null,
+        demandCustomer: null,
+        demandCustomerName: null,
+        lastStockOrg: null,
+        lastStockOrgName: null,
+        superiorStockOrg: null,
+        superiorStockOrgName: null,
+        allotCode: null,
+        deliveryAddress: null,
+        deliveryAddressName: null,
+        contacts: null,
+        contactsPhone: null,
+        address: null,
+        source: null,
+        priceType: 'order',
+        puManagerApprover: null,
+        puManagerApproverName: null,
+        processTime: null,
+        affirmer: null,
+        tenantId: null,
+        revision: null,
+        createBy: null,
+        createByName: null,
+        createTime: null,
+        updateBy: null,
+        updateByName: null,
+        updateTime: null,
+        delFlag: 0,
+        // 新增字段
+        model: null,
+        storageCondition: null,
+        transportationCondition: null,
+      },
+      loadDisabled: true,
+      page: 0,
+      total: 5,
     }
   },
   created() {
@@ -643,6 +758,18 @@ export default {
     }
   },
   methods: {
+    load() {
+      if (this.loadDisabled) return;
+
+      this.page++;
+      if (this.page <= this.total) {
+        this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.concat(this.basicForm.puDemandItemList);
+      }
+
+      if (this.page === this.total) {
+        this.loadDisabled = true;
+      }  
+    },
     // 改变单据日期时清空子表的调拨日期
     changeDemandDate() {
       this.basicForm.puDemandItemList.forEach(item => {
@@ -844,116 +971,11 @@ export default {
     },
     // 增行
     addLine() {
-      const newLine = {
-        contacts: null,
-        id: null,
-        demandId: null,
-        status: null,
-        businessDept: null,
-        businessDeptName: null,
-        materialCategory: null,
-        buyer: null,
-        buyerName: null,
-        mateiralClassifyOne: null,
-        materialClassifyOneName: null,
-        materialClassifyTwo: null,
-        materialClassifyTwoName: null,
-        materialClassifyThree: null,
-        materialClassifyThreeName: null,
-        materialClassifyFour: null,
-        materialClassifyFourName: null,
-        materialCode: null,
-        material: null,
-        materialName: null,
-        classifyId: null,
-        specification: null,
-        unit: null,
-        unitName: null,
-        manufacturerName: null,
-        registrant: null,
-        puPeriod: null,
-        expiryUnit: null,
-        expiry: null,
-        minPackage: null,
-        minOrderQty: null,
-        minBatch: null,
-        safeStock: null,
-        averageQtyMonth: null,
-        qty: null,
-        adjustmentPersonal: null,
-        adjustmentTime: null,
-        manualRegulation: null,
-        updateCause: null,
-        reservedProportion: null,
-        reservedPeriod: null,
-        reservedQty: null,
-        demandPeriod: null,
-        forecastClassify: null,
-        onemonthAvgVolume: null,
-        threemonthAvgVolume: null,
-        puFreight: null,
-        deliveryDate: null,
-        isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
-        isReplenishment: this.basicForm.billType == 'BDXQ'? 'Y': 'N',
-        isBatchLock: 'N',
-        isCustomerSpecified: '',
-        remark: null,
-        puRemark: null,
-        lastWarehouseQty: null,
-        resDemandQty: null,
-        lastWarehouse: null,
-        lastWarehouseName: null,
-        deliveryWarehouse: null,
-        deliveryWarehouseName: null,
-        lastAllocation: null,
-        lastAllocationName: null,
-        deliveryAllocation: null,
-        deliveryAllocationName: null,
-        passageOn: null,
-        puOrg: null,
-        purOrgName: null,
-        lastStockQty: null,
-        superiorCenterQty: null,
-        superiorAllotQty: null,
-        availableQty: null,
-        statusAllot: 'N',
-        additionalSupplier: null,
-        additionalSupplierName: null,
-        periodUnit: null,
-        demandCustomer: this.basicForm.customer,
-        demandCustomerName: this.basicForm.customerName,
-        businessDept: this.basicForm.demandDept,
-        businessDeptName: null,
-        lastStockOrg: null,
-        lastStockOrgName: null,
-        superiorStockOrg: null,
-        superiorStockOrgName: null,
-        allotCode: null,
-        deliveryAddress: null,
-        deliveryAddressName: null,
-        contacts: null,
-        contactsPhone: null,
-        address: null,
-        source: null,
-        priceType: 'order',
-        puManagerApprover: null,
-        puManagerApproverName: null,
-        processTime: null,
-        affirmer: null,
-        tenantId: null,
-        revision: null,
-        createBy: null,
-        createByName: null,
-        createTime: null,
-        updateBy: null,
-        updateByName: null,
-        updateTime: null,
-        delFlag: 0,
-        // 新增字段
-        model: null,
-        storageCondition: null,
-        transportationCondition: null,
-      }
+      const newLine = {...this.sonModel}
+      newLine.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+      newLine.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+      newLine.demandCustomer = this.basicForm.customer
+      newLine.demandCustomerName = this.basicForm.customerName
       this.basicForm.puDemandItemList.push(newLine)
       // 补单需求状态改变
       if (this.basicForm.billType == 'BDXQ') {
@@ -1170,176 +1192,98 @@ export default {
       e.preventDefault() //阻止默认粘贴事件
       let source = e.clipboardData.getData("Text");
       console.log('scope', scope.column.property)
-      console.log('eee:', source)
       // 首先对源头进行解析
       let rows = source.split("\r\n"); // 拆成一个数组
       // 数组去除空字符串
       rows = rows.filter(item => {
         return item && item.trim()
       })
-      console.log('复制的数组',rows);
-      console.log('列表的数组',this.basicForm.puDemandItemList)
+
       if (rows.length < 100) {
-        await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
-          if (res.code === 200) {
-            let rowList = res.rows
-            let newLine = []
-            for (let i = 0; i<rowList.length; i++) {
-            let line = {
-              contacts: null,
-              id: null,
-              demandId: null,
-              status: null,
-              businessDept: null,
-              businessDeptName: null,
-              materialCategory: null,
-              buyer: null,
-              buyerName: null,
-              mateiralClassifyOne: null,
-              materialClassifyOneName: null,
-              materialClassifyTwo: null,
-              materialClassifyTwoName: null,
-              materialClassifyThree: null,
-              materialClassifyThreeName: null,
-              materialClassifyFour: null,
-              materialClassifyFourName: null,
-              materialCode: null,
-              material: null,
-              materialName: null,
-              classifyId: null,
-              specification: null,
-              unit: null,
-              unitName: null,
-              manufacturerName: null,
-              registrant: null,
-              puPeriod: null,
-              expiryUnit: null,
-              expiry: null,
-              minPackage: null,
-              minOrderQty: null,
-              minBatch: null,
-              safeStock: null,
-              averageQtyMonth: null,
-              qty: null,
-              adjustmentPersonal: null,
-              adjustmentTime: null,
-              manualRegulation: null,
-              updateCause: null,
-              reservedProportion: null,
-              reservedPeriod: null,
-              reservedQty: null,
-              demandPeriod: null,
-              forecastClassify: null,
-              onemonthAvgVolume: null,
-              threemonthAvgVolume: null,
-              puFreight: null,
-              deliveryDate: null,
-              isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
-              isReplenishment: this.basicForm.billType == 'BDXQ' ? 'Y' : 'N',
-              isBatchLock: 'N',
-              isCustomerSpecified: '',
-              remark: null,
-              puRemark: null,
-              lastWarehouseQty: null,
-              resDemandQty: null,
-              lastWarehouse: null,
-              lastWarehouseName: null,
-              deliveryWarehouse: null,
-              deliveryWarehouseName: null,
-              lastAllocation: null,
-              lastAllocationName: null,
-              deliveryAllocation: null,
-              deliveryAllocationName: null,
-              passageOn: null,
-              puOrg: null,
-              purOrgName: null,
-              lastStockQty: null,
-              superiorCenterQty: null,
-              superiorAllotQty: null,
-              availableQty: null,
-              statusAllot: 'N',
-              additionalSupplier: null,
-              additionalSupplierName: null,
-              periodUnit: null,
-              demandCustomer: this.basicForm.customer,
-              demandCustomerName: this.basicForm.customerName,
-              businessDept: this.basicForm.demandDept,
-              businessDeptName: null,
-              lastStockOrg: null,
-              lastStockOrgName: null,
-              superiorStockOrg: null,
-              superiorStockOrgName: null,
-              allotCode: null,
-              deliveryAddress: null,
-              deliveryAddressName: null,
-              contacts: null,
-              contactsPhone: null,
-              address: null,
-              source: null,
-              priceType: 'order',
-              puManagerApprover: null,
-              puManagerApproverName: null,
-              processTime: null,
-              affirmer: null,
-              tenantId: null,
-              revision: null,
-              createBy: null,
-              createByName: null,
-              createTime: null,
-              updateBy: null,
-              updateByName: null,
-              updateTime: null,
-              delFlag: 0,
-              // 新增字段
-              model: null,
-              storageCondition: null,
-              transportationCondition: null,
+
+        if(scope.column.property == 'materialCode') {
+          await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
+            this.$modal.closeLoading();
+            if (res.code === 200) {
+              let rowList = res.rows
+              let newLine = []
+              for (let i = 0; i<rowList.length; i++) {
+                let line = {...this.sonModel}
+                line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+                line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+                line.demandCustomer = this.basicForm.customer
+                line.demandCustomerName = this.basicForm.customerName
+                line.materialCode = rowList[i].code
+                line.material = rowList[i].id
+                line.materialName = rowList[i].name
+                line.classifyId = rowList[i].classifyId
+                line.materialClassifyOneName = rowList[i].oneClass
+                line.materialClassifyTwoName = rowList[i].twoClass
+                line.materialClassifyThreeName = rowList[i].threeClass
+                line.materialClassifyFourName = rowList[i].fourClass
+                line.specification = rowList[i].specification
+                line.model = rowList[i].model
+                line.unit = rowList[i].unitId
+                line.unitName = rowList[i].unitIdName
+                line.registrant = rowList[i].registrant
+                line.manufacturerName = rowList[i].manufacturerIdName
+                line.puPeriod = rowList[i].deliveryPeriod
+                line.expiry = rowList[i].usefulLife
+                line.expiryUnit = rowList[i].expiryUnitIdName
+                // line.minPackage = rowList[i].usefulLife
+                line.minPackage = rowList[i].minPackQty
+                line.minOrderQty = rowList[i].minOrderQty
+                line.minBatch = rowList[i].minBatchQty
+                line.safeStock = rowList[i].safeStock
+                line.purOrgName = rowList[i].purchasingOrganizationName
+                line.puOrg = rowList[i].purchasingOrganization
+                // 物料存储条件和运输条件
+                line.transportationCondition = rowList[i].transportationCondition
+                line.storageCondition = rowList[i].storageCondition
+                newLine.push(line)
+                console.log('临时数组', newLine)
+              }
+              // 删除指定下标
+              this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
+              this.$modal.notifySuccess("共粘贴" + rowList.length + '条数据');
             }
-              line.businessDept = rowList[i].businessDepartment
-              line.businessDeptName = rowList[i].businessDepartmentName
-              line.materialCode = rowList[i].code
-              line.material = rowList[i].id
-              line.materialName = rowList[i].name
-              line.classifyId = rowList[i].classifyId
-              line.materialClassifyOneName = rowList[i].oneClass
-              line.materialClassifyTwoName = rowList[i].twoClass
-              line.materialClassifyThreeName = rowList[i].threeClass
-              line.materialClassifyFourName = rowList[i].fourClass
-              line.specification = rowList[i].specification
-              line.model = rowList[i].model
-              line.unit = rowList[i].unitId
-              line.unitName = rowList[i].unitIdName
-              line.registrant = rowList[i].registrant
-              line.manufacturerName = rowList[i].manufacturerIdName
-              line.puPeriod = rowList[i].deliveryPeriod
-              line.expiry = rowList[i].usefulLife
-              line.expiryUnit = rowList[i].expiryUnitIdName
-              // line.minPackage = rowList[i].usefulLife
-              line.minPackage = rowList[i].minPackQty
-              line.minOrderQty = rowList[i].minOrderQty
-              line.minBatch = rowList[i].minBatchQty
-              line.safeStock = rowList[i].safeStock
-              line.purOrgName = rowList[i].purchasingOrganizationName
-              line.puOrg = rowList[i].purchasingOrganization
-              // 物料存储条件和运输条件
-              line.transportationCondition = rowList[i].transportationCondition
-              line.storageCondition = rowList[i].storageCondition
+          }).then(() => {
+            this.$refs.table.doLayout()
+          }).catch(err => {
+            this.$modal.closeLoading();
+          })
+
+        }else if(scope.column.property == 'qty') {
+          console.log('复制内容:', rows)
+          let newLine = []
+          if(this.basicForm.puDemandItemList.length <= 1) {
+            for (let i = 0; i<rows.length; i++) {
+              let line = {...this.sonModel}
+              line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+              line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+              line.demandCustomer = this.basicForm.customer
+              line.demandCustomerName = this.basicForm.customerName
+              line.qty = rows[i]
               newLine.push(line)
-              console.log('临时数组', newLine)
             }
             // 删除指定下标
-            this.basicForm.puDemandItemList.splice(index,1,...newLine)
-            this.$modal.notifySuccess("共粘贴" + rowList.length + '条数据');
+            this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
+            this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
+            this.$refs.table.doLayout()
+            this.$modal.closeLoading();
+          } else {
+            this.basicForm.puDemandItemList.forEach(item => {
+              for (let i = 0; i<rows.length; i++) {
+                item.qty = rows[i]
+              }
+            })
           }
-        }).then(() => {
-          this.$refs.table.doLayout()
-        }).catch(err => {
-          this.$modal.closeLoading();
-        })
-        this.$modal.closeLoading();
-      console.log('列表', this.basicForm.puDemandItemList)
+        }
+
+
       } else {
         this.$modal.notifyWarning("复制长度不能超过100!");
+        this.$modal.closeLoading();
       }
     },
     // 明细行选择物料编码带出数据
@@ -1392,8 +1336,6 @@ export default {
           this.basicForm.puDemandItemList[this.tableIndex].buyerName = res.rows[0].buyerName
         }
       })
-      this.basicForm.puDemandItemList[this.tableIndex].businessDept = selection[0].businessDepartment
-      this.basicForm.puDemandItemList[this.tableIndex].businessDeptName = selection[0].businessDepartmentName
       this.basicForm.puDemandItemList[this.tableIndex].materialCode = selection[0].code
       this.basicForm.puDemandItemList[this.tableIndex].material = selection[0].id
       this.basicForm.puDemandItemList[this.tableIndex].materialName = selection[0].name
@@ -1426,116 +1368,11 @@ export default {
         console.log('xxxxx', selection)
         let newLine = []
         for (let i = 0;i<selection.length;i++) {
-          let line = {
-            contacts: null,
-            id: null,
-            demandId: null,
-            status: null,
-            businessDept: null,
-            businessDeptName: null,
-            materialCategory: null,
-            buyer: null,
-            buyerName: null,
-            mateiralClassifyOne: null,
-            materialClassifyOneName: null,
-            materialClassifyTwo: null,
-            materialClassifyTwoName: null,
-            materialClassifyThree: null,
-            materialClassifyThreeName: null,
-            materialClassifyFour: null,
-            materialClassifyFourName: null,
-            materialCode: null,
-            material: null,
-            materialName: null,
-            classifyId: null,
-            specification: null,
-            unit: null,
-            unitName: null,
-            manufacturerName: null,
-            registrant: null,
-            puPeriod: null,
-            expiryUnit: null,
-            expiry: null,
-            minPackage: null,
-            minOrderQty: null,
-            minBatch: null,
-            safeStock: null,
-            averageQtyMonth: null,
-            qty: null,
-            adjustmentPersonal: null,
-            adjustmentTime: null,
-            manualRegulation: null,
-            updateCause: null,
-            reservedProportion: null,
-            reservedPeriod: null,
-            reservedQty: null,
-            demandPeriod: null,
-            forecastClassify: null,
-            onemonthAvgVolume: null,
-            threemonthAvgVolume: null,
-            puFreight: null,
-            deliveryDate: null,
-            isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
-            isReplenishment: this.basicForm.billType == 'BDXQ' ? 'Y' : 'N',
-            isBatchLock: 'N',
-            isCustomerSpecified: '',
-            remark: null,
-            puRemark: null,
-            lastWarehouseQty: null,
-            resDemandQty: null,
-            lastWarehouse: null,
-            lastWarehouseName: null,
-            deliveryWarehouse: null,
-            deliveryWarehouseName: null,
-            lastAllocation: null,
-            lastAllocationName: null,
-            deliveryAllocation: null,
-            deliveryAllocationName: null,
-            passageOn: null,
-            puOrg: null,
-            purOrgName: null,
-            lastStockQty: null,
-            superiorCenterQty: null,
-            superiorAllotQty: null,
-            availableQty: null,
-            statusAllot: 'N',
-            additionalSupplier: null,
-            additionalSupplierName: null,
-            periodUnit: null,
-            demandCustomer: this.basicForm.customer,
-            demandCustomerName: this.basicForm.customerName,
-            businessDept: this.basicForm.demandDept,
-            businessDeptName: null,
-            lastStockOrg: null,
-            lastStockOrgName: null,
-            superiorStockOrg: null,
-            superiorStockOrgName: null,
-            allotCode: null,
-            deliveryAddress: null,
-            deliveryAddressName: null,
-            contacts: null,
-            contactsPhone: null,
-            address: null,
-            source: null,
-            priceType: 'order',
-            puManagerApprover: null,
-            puManagerApproverName: null,
-            processTime: null,
-            affirmer: null,
-            tenantId: null,
-            revision: null,
-            createBy: null,
-            createByName: null,
-            createTime: null,
-            updateBy: null,
-            updateByName: null,
-            updateTime: null,
-            delFlag: 0,
-            // 新增字段
-            model: null,
-            storageCondition: null,
-            transportationCondition: null,
-          }
+          let line = {...this.sonModel}
+          line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+          line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+          line.demandCustomer = this.basicForm.customer
+          line.demandCustomerName = this.basicForm.customerName
                 // 通过选择物料查询采购员
           queryMan(selection[i].id).then(res => {
             if (res.code === 200 && res.rows.length !== 0) {
@@ -1543,8 +1380,6 @@ export default {
               line.buyerName = res.rows[0].buyerName
             }
           })
-          line.businessDept = selection[i].businessDepartment
-          line.businessDeptName = selection[i].businessDepartmentName
           line.materialCode = selection[i].code
           line.material = selection[i].id
           line.materialName = selection[i].name

+ 1 - 1
src/views/purchase/task/columns.js

@@ -203,7 +203,7 @@ export default function useColumns() {
     {
       item: {
         key: "documentsCodes",
-        title: "需求来源",
+        title: "采购需求单号",
         span: 12,
       },
       attr: {