Browse Source

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!563
黄梓星 1 year ago
parent
commit
a0013d0461

+ 8 - 0
src/api/purchase/equipmentData.js

@@ -31,4 +31,12 @@ export function getEquipmentDetail(id) {
     url: `/device/origin/${id}`,
     method: 'get',
   })
+}
+// 设备产品数据库删除
+export function deleteEquipments(data) {
+  return request({
+    url: `/device/origin/delete`,
+    method: 'post',
+    data: data
+  })
 }

+ 8 - 0
src/api/requisition/basic.js

@@ -185,4 +185,12 @@ export const REFER = (data, params) => {
     data: data,
     params: params,
   });
+}
+
+export function classifyDetails(params) {
+  return request({
+    url: `/system/classify/details`,
+    method: 'get',
+    params: params,
+  })
 }

+ 37 - 45
src/components/popover-select/index.vue

@@ -75,11 +75,11 @@ export default {
         return false;
       },
     },
-    copy:{
-      type:Boolean,
-      default:() =>{
-        return false
-      }
+    copy: {
+      type: Boolean,
+      default: () => {
+        return false;
+      },
     },
     // 需映射源数据
     source: Object,
@@ -134,7 +134,7 @@ export default {
     },
     // open dialog
     async open() {
-      if(!this.disabled){
+      if (!this.disabled) {
         this.visible = true;
         await this.useReset();
       }
@@ -157,19 +157,15 @@ export default {
           // 处理新增字段无法映射
           let that = this;
 
-          this.TableColumnTemp.forEach(({item,attr}) =>{
-
-            that.data = that.data.map(d =>{
-
-              if(!attr.is && attr.formatter){
+          this.TableColumnTemp.forEach(({ item, attr }) => {
+            that.data = that.data.map((d) => {
+              if (!attr.is && attr.formatter) {
                 d[item.key] = attr.formatter(d);
               }
 
               return d;
-
-            })
-
-          })
+            });
+          });
           this.page.total = total;
         }
       } catch (err) {
@@ -188,6 +184,7 @@ export default {
         search: "",
         ...queryParams(source),
       };
+      console.log(source, "source");
       await this.fetchList(this.model, this.page);
     },
     // query
@@ -204,18 +201,16 @@ export default {
     },
     // confirm
     useConfirm(prop) {
-      
       const { multiple } = this.$props;
 
       this.selectData = [...prop];
-      console.log(this.selectData,'this.selectData');
-   
+      console.log(this.selectData, "this.selectData");
+
       this.useUpdate(multiple ? prop : prop[0]);
 
       this.emitChange(this.selectData);
       this.lastSelectData = deepCopy(this.selectData);
       this.hide();
-      
     },
     // delete
     useDelete(prop) {
@@ -270,43 +265,37 @@ export default {
 
         this.model = {
           ...this.model,
-          search:prop,
-          type:type,
+          search: prop,
+          type: type,
           ...queryParams(source),
-        }
-        // 
+        };
+        //
         await this.fetchList(this.model, this.page);
         await cb(this.data);
       } else {
         cb([]);
       }
     },
-    async handleChange(){
+    async handleChange() {
       // 物料赋值'MATERIAL_PARAM'
       const { type, source } = this.$props;
-      if(type === 'MATERIAL_PARAM'){
-
+      if (type === "MATERIAL_PARAM") {
         let materialCodeList = this.innerValue.split(/,|,|\s+/);
-        
+
         try {
-          let { code, rows } = await REFER( {
+          let { code, rows } = await REFER({
             materialCodeList,
-              type,
-            })
+            type,
+          });
 
-          if(code == 200){
+          if (code == 200) {
             // this.$emit("change",rows, type, source);
           }
-        } catch (error) {
-          
-        }
+        } catch (error) {}
       }
-    }
-    
-  },
-  created() {
-
+    },
   },
+  created() {},
   mounted() {},
   destroyed() {},
 };
@@ -325,7 +314,7 @@ export default {
       @change="handleChange"
       @keyup.enter.native="handleChange"
     >
-    <!-- suffix -->
+      <!-- suffix -->
       <!-- <el-button
         :disabled="disabled"
         slot="append"
@@ -370,7 +359,7 @@ export default {
         </p>
       </template>
     </el-autocomplete>
-    
+
     <el-dialog
       :title="`${title}(${multiple ? '多选' : '单选'})`"
       :width="width"
@@ -396,8 +385,12 @@ export default {
           </el-input>
         </el-form-item>
         <el-form-item>
-          <el-button @click="useQuery" size="mini" >搜 索</el-button>
-          <el-button icon="el-icon-refresh" @click="useReset" size="mini"></el-button>
+          <el-button @click="useQuery" size="mini">搜 索</el-button>
+          <el-button
+            icon="el-icon-refresh"
+            @click="useReset"
+            size="mini"
+          ></el-button>
         </el-form-item>
         <el-table
           ref="multipleTable"
@@ -418,7 +411,7 @@ export default {
           >
           </el-table-column>
           <el-table-column
-            v-for="({item,attr}, index) in TableColumnTemp"
+            v-for="({ item, attr }, index) in TableColumnTemp"
             :key="index"
             :prop="item.key"
             :label="item.title"
@@ -452,7 +445,6 @@ export default {
         <el-button :size="size" @click="useCancel(lastSelectData)">
           取 消
         </el-button>
-        
       </div>
     </el-dialog>
     <div

+ 6 - 0
src/views/material/basicFile/details.vue

@@ -2417,6 +2417,12 @@ export default {
       let confirm = true;
 
       if (this.MoreDataDialog.target.name == "basicData") {
+        // 四级分类
+        if (this.MoreDataDialog.target.prop == "classifyId") {
+          if (this.MoreDataDialog.value.childrens.length > 0) {
+            return this.$modal.notifyWarning("请选择最末级!");
+          }
+        }
         //  基本信息
         this.basicData.value[this.MoreDataDialog.target.prop] =
           this.MoreDataDialog.value.id;

+ 7 - 1
src/views/material/changeApply/columns.js

@@ -37,7 +37,13 @@ export default function useColumns() {
    
   ].map(({ item, attr }) => ({
     attr,
-    item: { ...item, hidden: true, fixed: false },
+    item: { 
+      ...item, 
+      sortabled: true,
+      fixedabled: true,
+      filterabled: true,
+      hiddenabled: true, 
+    },
   }));
 
   const SearchColumns = [

+ 7 - 1
src/views/material/requisition/columns.js

@@ -56,7 +56,13 @@ export default function useColumns (){
    
   ].map(({ item, attr }) => ({
     attr,
-    item: { ...item, hidden: true, fixed: false },
+    item: { 
+      ...item, 
+      sortabled: true,
+      fixedabled: true,
+      filterabled: true,
+      hiddenabled: true,
+    },
   }));
 
   const SearchColumns = [

+ 2 - 1
src/views/material/requisition/details/columns.js

@@ -127,7 +127,8 @@ export default function useColumns(){
               children: "children",
             },
             dataMapping: {
-              classifyId:'id'
+              classifyId:'id',
+              
             }
           },
         },

+ 117 - 13
src/views/material/requisition/details/index.vue

@@ -6,6 +6,7 @@ import {
   editReq,
   saveAndToOa,
   betchSubmit,
+  classifyDetails,
 } from "@/api/requisition/basic";
 import { REFER } from "@/components/popover-select/api/index";
 export default {
@@ -115,7 +116,6 @@ export default {
             });
 
             if (code == 200) {
-              console.log(rows, "rows");
               let { id, code, name } = rows[0];
               this.params.sysMaterialMedcineItemApply = [
                 {
@@ -162,6 +162,11 @@ export default {
             },
           ];
         } else {
+          let { sysMaterialApply } = this.params;
+          sysMaterialApply.expiryUnitId = "";
+          sysMaterialApply.usefulLife = "";
+          sysMaterialApply.usefulLifeUnitId = "";
+          sysMaterialApply.recentWarningPeriod = "";
           this.rules.expiryUnitId = null;
           this.rules.usefulLife = null;
           this.rules.usefulLifeUnitId = null;
@@ -452,13 +457,46 @@ export default {
       open();
     },
     materialReferenceChange(prop, { source }) {
-      console.log(prop, "prop");
-      console.log(source, "source");
       this.params.sysMaterialApply = {
         ...this.params.sysMaterialApply,
         ...source,
       };
     },
+    // 四级分类带出一二三级分类
+    async classifyNameChange(prop, { source }) {
+      console.log(source, "source");
+      let { classifyId } = source;
+      try {
+        let {
+          code,
+          msg,
+          data: { oneClass, twoClass, threeClass },
+        } = await classifyDetails({ id: classifyId });
+        if (code == 200) {
+          source.oneClass = oneClass;
+          source.twoClass = twoClass;
+          source.threeClass = threeClass;
+        }
+      } catch (error) {}
+    },
+    // 批号及库存状态管理
+    isInventoryStatusChange(prop) {
+      let { sysMaterialApply } = this.params;
+      if (prop !== "0") {
+        sysMaterialApply.expiryDateManagerment = "2";
+        sysMaterialApply.serialNoManager = "2";
+      }
+    },
+    // 效期管理
+    expiryDateManagermentChange(prop) {
+      let { sysMaterialApply } = this.params;
+      if (prop !== "0") {
+        sysMaterialApply.expiryUnitId = "";
+        sysMaterialApply.usefulLife = "";
+        sysMaterialApply.usefulLifeUnitId = "";
+        sysMaterialApply.recentWarningPeriod = "";
+      }
+    },
   },
   created() {},
   mounted() {},
@@ -581,6 +619,19 @@ export default {
               </el-button>
             </component>
           </template>
+          <!-- 四级分类 -->
+          <template slot="classifyName" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              :disabled="addType === 'see'"
+              @change="classifyNameChange"
+              style="width: 100%"
+            >
+            </component>
+          </template>
           <!-- 药品 -->
           <template slot="isDrug" slot-scope="scope">
             <component
@@ -602,8 +653,69 @@ export default {
               </el-option>
             </component>
           </template>
-          <!-- 效期管理:expiryDateManagerment
-             近效期管理:nearOnsetManagerment -->
+          <!--  近效期管理:nearOnsetManagerment -->
+          <!-- 批号及库存状态管理 -->
+          <template slot="isInventoryStatus" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              :disabled="addType === 'see'"
+              @change="isInventoryStatusChange"
+            >
+              <el-option
+                v-for="item in dict.type[scope.attr.dictName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </component>
+          </template>
+          <!-- 效期管理 -->
+          <template slot="expiryDateManagerment" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              :disabled="
+                params.sysMaterialApply.isInventoryStatus !== '0' ||
+                addType === 'see'
+              "
+              @change="expiryDateManagermentChange"
+            >
+              <el-option
+                v-for="item in dict.type[scope.attr.dictName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </component>
+          </template>
+          <!-- 序列号管理 -->
+          <template slot="serialNoManager" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              :disabled="
+                params.sysMaterialApply.isInventoryStatus !== '0' ||
+                addType === 'see'
+              "
+            >
+              <el-option
+                v-for="item in dict.type[scope.attr.dictName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </component>
+          </template>
           <!-- 有效期 -->
           <template slot="usefulLife" slot-scope="scope">
             <component
@@ -747,14 +859,6 @@ export default {
               >
                 删除
               </el-button>
-              <!-- <AmendantRecord
-                v-if="
-                  tabName === 'materialBasic' &&
-                  addType === 'edit' &&
-                  scope.row.id
-                "
-                v-model="scope.row"
-              ></AmendantRecord> -->
             </template>
           </ux-table-column>
         </component>

+ 9 - 11
src/views/material/requisition/index.vue

@@ -140,24 +140,22 @@ export default {
       if (!filterList.length && this.selectData.length) {
         this.handleConfirmTips(async () => {
           try {
-            this.failLoad = true;
-
+            this.loading = true;
             let ids = this.selectData.map((item) => Number(item.id));
-
             let { code, msg } = await betchSubmit({ ids });
-
             if (code == 200) {
+              this.$notify.success({
+                message: msg,
+              });
               this.reset();
+            } else {
+              this.$notify.error({
+                message: msg,
+              });
             }
-
-            this.$notify({
-              title: code == 200 ? msg : "error",
-              type: code == 200 ? "success" : "error",
-              message: code == 200 ? "" : msg,
-            });
           } catch (error) {
           } finally {
-            this.failLoad = false;
+            this.loading = false;
           }
         });
       } else {

+ 0 - 247
src/views/purchase/DemandSummary/colTol.vue

@@ -1,247 +0,0 @@
-<template>
-  <div class="colTol">
-    <el-drawer
-      title="隐藏列"
-      :visible.sync="open"
-      direction="rtl"
-      @close='upIsShow'
-      size="20%">
-      <transition name="fade">
-        <div class="columnOption">
-          <div class="content">
-            <el-row v-for="(item, index) in arrs" :key="index" style="font-size: 14px;font-weight: bold;margin-bottom: 10px;padding: 0 20px;">
-              <el-col :span="18">
-                <span>{{item.label}}</span>
-              </el-col>
-              <el-col :span="6">
-                <el-switch size="mini" v-model="prop[item.prop]"></el-switch>
-              </el-col>
-            </el-row>
-              <!-- <el-switch v-model="prop.materialClassifyOneName">一级品类</el-switch>
-              <el-switch v-model="prop.materialCode">物料编码</el-switch>
-              <el-switch v-model="prop.materialName">品名</el-switch>
-              <el-switch v-model="prop.specification">规格</el-switch>
-              <el-switch v-model="prop.unit">单位</el-switch>
-              <el-switch v-model="prop.manufacturer">生产厂家/代理人</el-switch>
-              <el-switch v-model="prop.demandNum">需求单位数</el-switch>
-              <el-switch v-model="prop.evensalesforyear">近1月月均需求</el-switch>
-              <el-switch v-model="prop.evensalesforthrmonth">近3月月均需求</el-switch>
-              <el-switch v-model="prop.netDemandNum">总最终净需求量</el-switch>
-              <el-switch v-model="prop.totalMonthlySales">总月销量</el-switch>
-              <el-switch v-model="prop.demandCycle">需求可用周期</el-switch>
-              <el-switch v-model="prop.dullQut">呆滞量</el-switch>
-              <el-switch v-model="prop.buyPeriod">采购周期</el-switch>
-              <el-switch v-model="prop.centralPublicStock">中心公共库存</el-switch>
-              <el-switch v-model="prop.centralWarehouse">中心仓专属货位</el-switch>
-              <el-switch v-model="prop.regionPublicStock">区域分仓公共库存</el-switch>
-              <el-switch v-model="prop.eachWarehouseStock">各项目仓库存</el-switch>
-              <el-switch v-model="prop.commerceWarehouse">电商仓库</el-switch>
-              <el-switch v-model="prop.buyTransit">采购在途</el-switch>
-              <el-switch v-model="prop.lendTransit">借出在途</el-switch>
-              <el-switch v-model="prop.transferTransit">调拨在途</el-switch>
-              <el-switch v-model="prop.stockTotal">库存总计</el-switch>
-              <el-switch v-model="prop.minPackage">最小包装量</el-switch>
-              <el-switch v-model="prop.minOrder">最小订货量</el-switch>
-              <el-switch v-model="prop.minBatch">最小批量</el-switch>
-              <el-switch v-model="prop.artificialAdjust">人工调整数</el-switch>
-              <el-switch v-model="prop.modifyReason">修改原因</el-switch>
-              <el-switch v-model="prop.suggestionPurchase">建议采购量</el-switch>
-              <el-switch v-model="prop.finalBuyQty">最终采购量</el-switch>
-              <el-switch v-model="prop.materialClassifyTwoName">二级品类</el-switch>
-              <el-switch v-model="prop.materialClassifyThreeName">三级品类</el-switch>
-              <el-switch v-model="prop.materialClassifyFourName">四级品类</el-switch>
-              <el-switch v-model="prop.buyerName">采购员</el-switch>
-              <el-switch v-model="prop.purchaseOrgName">默认采购组织</el-switch>
-              <el-switch v-model="prop.validityPeriod">有效期</el-switch>
-              <el-switch v-model="prop.validityPeriodUnit">有效期单位</el-switch>
-              <el-switch v-model="prop.businessType">业务类型</el-switch>
-              <el-switch v-model="prop.safetyStock">安全库存量</el-switch>
-              <el-switch v-model="prop.billSource">单据来源</el-switch>
-              <el-switch v-model="prop.registrant">注册人</el-switch>
-              <el-switch v-model="prop.buyDiscrepancy">总需与终采差异</el-switch>
-              <el-switch v-model="prop.forecastClassification">集团预测分类</el-switch>
-              <el-switch v-model="prop.centerBinPossession">中心仓占有量</el-switch>
-              <el-switch v-model="prop.centralWarehouseAvailable">中心仓可用量</el-switch>
-              <el-switch v-model="prop.puManagerAuditor">采购经理审核人</el-switch> -->
-            </div>
-            <!-- <div class="footer">
-              <el-button size="mini" type="primary" plain @click="saveColumn"
-                >确认</el-button
-              >
-            </div> -->
-        </div>
-      </transition>
-    </el-drawer>
-  </div>
-</template>
-
-<script>
-export default {
-  props: {
-    isVisible: {
-      type: Boolean,
-      default: false
-    },
-    showColumn: {
-      type: Object,
-      default: {}
-    },
-    arrs: {
-      type: Array,
-      default: []
-    }
-  },
-  data() {
-    return {
-      open: false,
-      // 列的配置化对象,存储配置信息
-      prop: {},
-      column: {
-        status: true,
-        materialClassifyOneName: true,
-        materialCode: true,
-        materialName: true,
-        specification: true,
-        unit: true,
-        manufacturer: true,
-        demandNum: true,
-        evensalesforyear: true,
-        evensalesforthrmonth: true,
-        netDemandNum: true,
-        totalMonthlySales: true,
-        demandCycle: true,
-        dullQut: true,
-        buyPeriod: true,
-        centralPublicStock: true,
-        centralWarehouse: true,
-        regionPublicStock: true,
-        eachWarehouseStock: true,
-        commerceWarehouse: true,
-        buyTransit: true,
-        lendTransit: true,
-        transferTransit: true,
-        stockTotal: true,
-        minPackage: true,
-        minOrder: true,
-        minBatch: true,
-        artificialAdjust: true,
-        modifyReason: true,
-        suggestionPurchase: true,
-        finalBuyQty: true,
-        materialClassifyTwoName: true,
-        materialClassifyThreeName: true,
-        materialClassifyFourName: true,
-        buyerName: true,
-        purchaseOrgName: true,
-        validityPeriod: true,
-        validityPeriodUnit: true,
-        businessType: true,
-        safetyStock: true,
-        billSource: true,
-        registrant: true,
-        buyDiscrepancy: true,
-        forecastClassification: true,
-        centerBinPossession: true,
-        centralWarehouseAvailable: true,
-        puManagerAuditor: true,
-      },
-    }
-  },
-  mounted() {
-    // 发请求得到checkListInitData的列的名字
-    if(localStorage.getItem("columnSet")){
-      this.prop = JSON.parse(localStorage.getItem("columnSet"))
-    }else{
-      this.prop = {
-        status: true,
-        materialClassifyOneName: true,
-        materialCode: true,
-        materialName: true,
-        specification: true,
-        unit: true,
-        manufacturer: true,
-        demandNum: true,
-        evensalesforyear: true,
-        evensalesforthrmonth: true,
-        netDemandNum: true,
-        totalMonthlySales: true,
-        demandCycle: true,
-        dullQut: true,
-        buyPeriod: true,
-        centralPublicStock: true,
-        centralWarehouse: true,
-        regionPublicStock: true,
-        eachWarehouseStock: true,
-        commerceWarehouse: true,
-        buyTransit: true,
-        lendTransit: true,
-        transferTransit: true,
-        stockTotal: true,
-        minPackage: true,
-        minOrder: true,
-        minBatch: true,
-        artificialAdjust: true,
-        modifyReason: true,
-        suggestionPurchase: true,
-        finalBuyQty: true,
-        materialClassifyTwoName: true,
-        materialClassifyThreeName: true,
-        materialClassifyFourName: true,
-        buyerName: true,
-        purchaseOrgName: true,
-        validityPeriod: true,
-        validityPeriodUnit: true,
-        businessType: true,
-        safetyStock: true,
-        billSource: true,
-        registrant: true,
-        buyDiscrepancy: true,
-        forecastClassification: true,
-        centerBinPossession: true,
-        centralWarehouseAvailable: true,
-        puManagerAuditor: true,
-      };
-    }
-  },
-  methods: {
-    upIsShow() {
-      this.$emit('update:isVisible',false)//修改isDrawer的值
-    },
-    //设置列的 显示/隐藏
-	  changeShow(item) {
-      item.show = !item.show
-    },
-    // showColumnOption() {
-    //   this.isShowColumn = true;
-    // },
-    saveColumn() {
-      localStorage.setItem("columnSet",JSON.stringify(this.prop))
-      // this.isShowColumn = false;
-      this.upIsShow()
-    },
-  },
-  watch: {
-    isVisible: {
-      handler(newValue) {
-        this.open = newValue
-      }
-    },
-    // 监听复选框配置列所有的变化
-    prop: {
-      handler: function (newnew, oldold) {
-        console.log('新值',newnew);
-        console.log('获取到表头没有?', this.arrs)
-        this.column = newnew;
-        this.$emit('update:showColumn', this.column)
-        // 这里需要让表格重新绘制一下,否则会产生固定列错位的情况
-        this.$nextTick(() => {
-          // this.$refs.table.doLayout();
-          this.$emit('reDraw')
-        });
-      },
-      deep: true,
-      immediate: true
-    },
-  }
-}
-</script>

+ 163 - 111
src/views/purchase/DemandSummary/index-bak.vue → src/views/purchase/DemandSummary/index - 副本.vue

@@ -132,11 +132,12 @@
                 <el-form-item label="物料编码">
                   <el-popover
                     placement="top-start"
-                    width="200"
+                    width="500"
                     trigger="hover"
+                    :title="'数量:'+ queryParams.materialCodeList.length"
                     :content="queryParams.names">
                   <el-input slot="reference" clearable size="mini" v-model="queryParams.names" @clear="clearMaterial" style="width: 200px" @paste.native="pasteMe($event)">
-                    <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
+                    <el-button size="mini" slot="append" @click="chooseMaterial">数量:{{queryParams.materialCodeList.length}}</el-button>
                   </el-input>
                   </el-popover>
                 </el-form-item>
@@ -211,6 +212,14 @@
                   </el-select>
                 </el-form-item>
               </el-col>
+
+            <el-col :span="1.5">
+              <el-form-item label="补单供应商">
+                <el-select clearable size="mini" v-model="queryParams.additionalSupplier" @focus="chooseRefer('SUPPLIER_PARAM', true, '供应商')" style="width: 200px">
+                  <el-option v-for="item in supplierOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
             </el-row>
           </div>
           </CollapseTransition>
@@ -234,7 +243,13 @@
 
           <!-- <el-button type="primary" size="mini">转请购</el-button> -->
         </div>
-        <el-table
+        <vxe-toolbar ref="xToolbar1" custom>
+        </vxe-toolbar>
+
+        <vxe-table
+          id="toolbar_demo5"
+          :custom-config="{storage: true, checkMethod: checkColumnMethod}"
+          @resizable-change="resizableChangeEvent"
           v-loading="loading"
           :data="tableList" 
           :cell-style="{ borderColor: '#c0c0c0' }"
@@ -242,138 +257,141 @@
           class="exporttable"
           border
           show-summary
-          :summary-method="getSummaries"
+          show-footer
+          :footer-method="getSummaries"
           highlight-current-row
           max-height="620"
           style="font-size: 12px;"
           :cell-class-name="cellClassName"
-          @selection-change="handleSelectionChange"
-          @row-click="rowSelect"
-          @row-dblclick="doubleClick"
+          @checkbox-all="selectAllEvent"
+          @checkbox-change="handleSelectionChange"
+          @cell-dblclick="doubleClick"
           ref="table"
+          :checkbox-config="{trigger:'row', highlight: true, range: true}"
+          :column-config="{resizable: true}"
         >
-          <el-table-column type="selection" width="60" fixed="left"/>
-          <el-table-column show-overflow-tooltip  label="序号" type="index" align="center" width="50px" fixed="left"/>
-          <!-- <el-table-column show-overflow-tooltip v-if="showColumn.status" label="行号" align="center" prop="rowNo"/> -->
-          <el-table-column show-overflow-tooltip v-if="showColumn.status" label="行状态" align="center" prop="status" width="50px" :formatter="hangStatus"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.finalBuyQty" label="最终采购量" align="center" prop="finalBuyQty" width="80px">
+          <vxe-column type="checkbox" width="50"/>
+          <vxe-column show-header-overflow show-overflow  title="序号" type="seq" align="center" width="50px"/>
+          <!-- <vxe-column show-header-overflow show-overflow title="行号" align="center" field="rowNo"/> -->
+          <vxe-column show-header-overflow show-overflow title="行状态" align="center" field="status" width="50px" :formatter="hangStatus"/>
+          <vxe-column show-header-overflow show-overflow title="最终采购量" align="center" field="finalBuyQty" width="80px">
             <template slot-scope="scope">
-                <el-input size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty" @change="jilu(scope.$index)"/>
+                <el-input size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty" @change="jilu(scope.$rowIndex)"/>
             </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.artificialAdjust" label="人工调整数" align="center" prop="artificialAdjust" width="50px">
+          </vxe-column>
+          <vxe-column show-header-overflow show-overflow title="关闭数量" align="center" field="closeQty" width="50px"/>
+          <vxe-column show-header-overflow show-overflow title="人工调整数" align="center" field="artificialAdjust" width="50px">
             <template slot-scope="scope">
               {{scope.row.artificialAdjust = scope.row.finalBuyQty - scope.row.suggestionPurchase}}
             </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyOneName" label="一级品类" align="center" prop="materialClassifyOneName" width="50"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.materialCode" label="物料编码" align="center" prop="materialCode" width="50px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.materialName" label="品名" align="center" prop="materialName" width="50px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.specification" label="规格" align="center" prop="specification" width="50px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.unit" label="单位" align="center" prop="unit" width="50"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.manufacturer" label="生产厂家/代理人" align="center" prop="manufacturer" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.demandNum" label="需求单位数" align="center" prop="demandNum" width="50px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.netDemandNum" label="总最终净需求量" align="center" prop="netDemandNum" width="80px">
+          </vxe-column>
+          <vxe-column show-header-overflow show-overflow title="一级品类" align="center" field="materialClassifyOneName" width="80"/>
+          <vxe-column show-header-overflow show-overflow title="物料编码" align="center" field="materialCode" width="100px"/>
+          <vxe-column show-header-overflow show-overflow title="品名" align="center" field="materialName" width="100px"/>
+          <vxe-column show-header-overflow show-overflow title="规格" align="center" field="specification" width="100px"/>
+          <vxe-column show-header-overflow show-overflow title="单位" align="center" field="unit" width="50"/>
+          <vxe-column show-header-overflow show-overflow title="生产厂家/代理人" align="center" field="manufacturer" width="100px"/>
+          <vxe-column show-header-overflow show-overflow title="需求单位数" align="center" field="demandNum" width="50px"/>
+          <vxe-column show-header-overflow show-overflow title="总最终净需求量" align="center" field="netDemandNum" width="80px">
             <template slot-scope="scope">
               {{scope.row.netDemandNum ? parseFloat(scope.row.netDemandNum).toFixed(2) : '0.00'}}
             </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforyear" label="近1月月均需求" align="center" prop="evensalesforyear" width="50">
+          </vxe-column>
+          <vxe-column show-header-overflow show-overflow title="近1月月均需求" align="center" field="evensalesforyear" width="50">
             <template slot-scope="scope">
               {{scope.row.evensalesforyear ? parseFloat(scope.row.evensalesforyear).toFixed(2) : '0.00'}}
             </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforthrmonth" label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="50">
+          </vxe-column>
+          <vxe-column show-header-overflow show-overflow title="近3月月均需求" align="center" field="evensalesforthrmonth" width="50">
             <template slot-scope="scope">
               {{scope.row.evensalesforthrmonth ? parseFloat(scope.row.evensalesforthrmonth).toFixed(2) : '0.00'}}
             </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.totalMonthlySales" label="总月销量" align="center" prop="totalMonthlySales" width="50">
+          </vxe-column>
+          <vxe-column show-header-overflow show-overflow title="总月销量" align="center" field="totalMonthlySales" width="50">
             <template slot-scope="scope">
               {{scope.row.totalMonthlySales ? parseFloat(scope.row.totalMonthlySales).toFixed(2) : '0.00'}}
             </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.demandCycle" label="需求可用周期" align="center" prop="demandCycle" width="50px">
+          </vxe-column>
+          <vxe-column show-header-overflow show-overflow title="需求可用周期" align="center" field="demandCycle" width="50px">
             <template slot-scope="scope">
               {{scope.row.demandCycle ? parseFloat(scope.row.demandCycle).toFixed(1) : '-'}}
             </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.dullQut" label="呆滞量" align="center" prop="dullQut" width="50px">
+          </vxe-column>
+          <vxe-column show-header-overflow show-overflow title="呆滞量" align="center" field="dullQut" width="50px">
             <template slot-scope="scope">
               {{parseFloat(scope.row.dullQut).toFixed(2)}}
             </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.buyPeriod" label="采购周期" align="center" prop="buyPeriod" width="50px" />
-          <el-table-column show-overflow-tooltip v-if="showColumn.centralPublicStock" label="中心公共库存" align="center" prop="centralPublicStock" width="50"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.centralWarehouse" label="中心仓专属货位" align="center" prop="centralWarehouse" width="50"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.eachWarehouseStock" label="各项目仓库存" align="center" prop="eachWarehouseStock" width="50"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.commerceWarehouse" label="电商仓库" align="center" prop="commerceWarehouse"  width="50" />
-          <el-table-column show-overflow-tooltip v-if="showColumn.regionPublicStock" label="区域分仓公共库存" align="center" prop="regionPublicStock" width="50"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.buyTransit" label="采购在途" align="center" prop="buyTransit"  width="80px" />
-          <el-table-column show-overflow-tooltip v-if="showColumn.lendTransit" label="借出在途" align="center" prop="lendTransit"  width="80px" />
-          <el-table-column show-overflow-tooltip v-if="showColumn.transferTransit" label="调拨在途" align="center" prop="transferTransit"  width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.stockTotal" label="库存总计" align="center" prop="stockTotal" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.minPackage" label="最小包装量" align="center" prop="minPackage"  width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.minOrder" label="最小订货量" align="center" prop="minOrder"  width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.minBatch" label="最小批量" align="center" prop="minBatch"  width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.modifyReason" label="修改原因" align="center" prop="modifyReason" width="150px">
+          </vxe-column>
+          <vxe-column show-header-overflow show-overflow title="采购周期" align="center" field="buyPeriod" width="50px" />
+          <vxe-column show-header-overflow show-overflow title="中心公共库存" align="center" field="centralPublicStock" width="50"/>
+          <vxe-column show-header-overflow show-overflow title="中心仓专属货位" align="center" field="centralWarehouse" width="50"/>
+          <vxe-column show-header-overflow show-overflow title="各项目仓库存" align="center" field="eachWarehouseStock" width="50"/>
+          <vxe-column show-header-overflow show-overflow title="电商仓库" align="center" field="commerceWarehouse"  width="50" />
+          <vxe-column show-header-overflow show-overflow title="区域分仓公共库存" align="center" field="regionPublicStock" width="50"/>
+          <vxe-column show-header-overflow show-overflow title="采购在途" align="center" field="buyTransit"  width="80px" />
+          <vxe-column show-header-overflow show-overflow title="借出在途" align="center" field="lendTransit"  width="80px" />
+          <vxe-column show-header-overflow show-overflow title="调拨在途" align="center" field="transferTransit"  width="80px"/>
+          <vxe-column show-header-overflow show-overflow title="库存总计" align="center" field="stockTotal" width="80px"/>
+          <vxe-column show-header-overflow show-overflow title="最小包装量" align="center" field="minPackage"  width="80px"/>
+          <vxe-column show-header-overflow show-overflow title="最小订货量" align="center" field="minOrder"  width="80px"/>
+          <vxe-column show-header-overflow show-overflow title="最小批量" align="center" field="minBatch"  width="80px"/>
+          <vxe-column show-header-overflow show-overflow title="修改原因" align="center" field="modifyReason" width="150px">
             <template slot-scope="scope">
-                <el-input size="mini" :disabled="scope.row.status !== '1'|| lineDisable || scope.row.artificialAdjust == '0'" v-model="scope.row.modifyReason" @change="jilu(scope.$index)"/>
+                <el-input size="mini" :disabled="scope.row.status !== '1'|| lineDisable || scope.row.artificialAdjust == '0'" v-model="scope.row.modifyReason" @change="jilu(scope.$rowIndex)"/>
             </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.suggestionPurchase" label="建议采购量" align="center" prop="suggestionPurchase"  width="80px"/>
-          <!-- <el-table-column show-overflow-tooltip v-if="showColumn.status" label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/> -->
-          <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyTwoName" label="二级品类" align="center" prop="materialClassifyTwoName" width="120px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyThreeName" label="三级品类" align="center" prop="materialClassifyThreeName" width="120px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyFourName" label="四级品类" align="center" prop="materialClassifyFourName" width="120px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.buyerName" label="采购员" align="center" prop="buyerName" width="150px">
+          </vxe-column>
+          <vxe-column show-header-overflow show-overflow title="建议采购量" align="center" field="suggestionPurchase"  width="80px"/>
+          <!-- <vxe-column show-header-overflow show-overflow title="建议净采购量" align="center" field="suggestBuyQty" width="100px"/> -->
+          <vxe-column show-header-overflow show-overflow title="二级品类" align="center" field="materialClassifyTwoName" width="120px"/>
+          <vxe-column show-header-overflow show-overflow title="三级品类" align="center" field="materialClassifyThreeName" width="120px"/>
+          <vxe-column show-header-overflow show-overflow title="四级品类" align="center" field="materialClassifyFourName" width="120px"/>
+          <vxe-column show-header-overflow show-overflow title="采购员" align="center" field="buyerName" width="150px">
             <template slot-scope="scope">
                 <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.buyerName">
-                  <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '明细采购员')"></el-button>
+                  <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$rowIndex, 'CONTACTS_PARAM', true, '明细采购员')"></el-button>
                 </el-input>
             </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.purchaseOrgName" label="默认采购组织" align="center" prop="purchaseOrgName" width="150px">
+          </vxe-column>
+          <vxe-column show-header-overflow show-overflow title="默认采购组织" align="center" field="purchaseOrgName" width="150px">
             <!-- <template slot-scope="scope">
                 <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.purchaseOrgName">
                   <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '明细默认采购组织')"></el-button>
                 </el-input>
             </template> -->
-          </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.validityPeriod" label="有效期" align="center" prop="validityPeriod"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.validityPeriodUnit" label="有效期单位" align="center" prop="validityPeriodUnit" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.businessType" label="业务类型" align="center" prop="businessType" :formatter="formatterBusinessType"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.safetyStock" label="安全库存量" align="center" prop="safetyStock" width="80px">
+          </vxe-column>
+          <vxe-column show-header-overflow show-overflow title="有效期" align="center" field="validityPeriod"/>
+          <vxe-column show-header-overflow show-overflow title="有效期单位" align="center" field="validityPeriodUnit" width="80px"/>
+          <vxe-column show-header-overflow show-overflow title="业务类型" align="center" field="businessType" :formatter="formatterBusinessType"/>
+          <vxe-column show-header-overflow show-overflow title="安全库存量" align="center" field="safetyStock" width="80px">
             <template slot-scope="scope">
               {{scope.row.safetyStock ? parseFloat(scope.row.safetyStock).toFixed(2) : '0.00'}}
             </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.billSource" label="单据来源" align="center" prop="billSource" :formatter="formatterSource"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.registrant" label="注册人" align="center" prop="registrant" width="120px"/>
-          <!-- <el-table-column label="可用量" align="center" prop="qty"/> -->
-          <el-table-column show-overflow-tooltip v-if="showColumn.buyDiscrepancy" label="总需与终采差异" align="center" prop="buyDiscrepancy" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.forecastClassification" label="集团预测分类" align="center" prop="forecastClassification" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.centerBinPossession" label="中心仓占有量" align="center" prop="centerBinPossession" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.centralWarehouseAvailable" label="中心仓可用量" align="center" prop="centralWarehouseAvailable" width="80px"/>
-          <!-- <el-table-column label="物料类别" align="center" prop="materialCategory" width="150px"/> -->
-          <!-- <el-table-column label="业务部门" align="center" prop="departmentName" width="150px"/> -->
-          <!-- <el-table-column show-overflow-tooltip v-if="showColumn.status" label="需求单位" align="center" prop="demandUnit"/> -->
-          <el-table-column show-overflow-tooltip v-if="showColumn.puManagerAuditor" label="采购经理审核人" align="center" prop="puManagerAuditor" width="120px"/>
-          <el-table-column
-          fixed="right"
-          label="操作"
+          </vxe-column>
+          <vxe-column show-header-overflow show-overflow title="单据来源" align="center" field="billSource" :formatter="formatterSource"/>
+          <vxe-column show-header-overflow show-overflow title="注册人" align="center" field="registrant" width="120px"/>
+          <!-- <vxe-column title="可用量" align="center" field="qty"/> -->
+          <vxe-column show-header-overflow show-overflow title="总需与终采差异" align="center" field="buyDiscrepancy" width="80px"/>
+          <vxe-column show-header-overflow show-overflow title="集团预测分类" align="center" field="forecastClassification" width="80px"/>
+          <vxe-column show-header-overflow show-overflow title="中心仓占有量" align="center" field="centerBinPossession" width="80px"/>
+          <vxe-column show-header-overflow show-overflow title="中心仓可用量" align="center" field="centralWarehouseAvailable" width="80px"/>
+          <!-- <vxe-column title="物料类别" align="center" field="materialCategory" width="150px"/> -->
+          <!-- <vxe-column title="业务部门" align="center" field="departmentName" width="150px"/> -->
+          <!-- <vxe-column show-header-overflow show-overflow title="需求单位" align="center" field="demandUnit"/> -->
+          <vxe-column show-header-overflow show-overflow title="采购经理审核人" align="center" field="puManagerAuditor" width="120px"/>
+          <vxe-column
+          title="操作"
           align="center"
-          width="100"
+          width="50"
           >
           <template slot-scope="scope">
             <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
           </template>
-        </el-table-column>
-        </el-table>
+        </vxe-column>
+        </vxe-table>
 
-        <el-button size="mini" style="position: absolute;left: 20px;bottom: 20px;" @click="tols.open = true">隐藏列</el-button>
+        <!-- <el-button size="mini" style="position: absolute;left: 20px;bottom: 20px;" @click="tols.open = true">隐藏列</el-button> -->
 
-        <colTol :isVisible.sync="tols.open" @reDraw="reDraw" :showColumn.sync="showColumn" :arrs.sync="arrs"/>
+        <!-- <colTol :isVisible.sync="tols.open" @reDraw="reDraw" :showColumn.sync="showColumn" :arrs.sync="arrs"/> -->
 
         <el-pagination
           background
@@ -400,7 +418,7 @@
 
 <script>
 import Add from './add'
-import colTol from './colTol.vue'
+// import colTol from './colTol.vue'
 import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import popDialog from '@/components/PopDialog/index.vue'
@@ -413,7 +431,7 @@ export default {
   dicts: ['sys_row_status', 'predictive_classify', 'sys_period_unit', 'sys_business', 'sys_bill_source'],
   components: {
     Add,
-    colTol,
+    // colTol,
     CollapseTransition,
     Refers,
     TreeRefers,
@@ -428,7 +446,7 @@ export default {
         open: false
       },
       hangStatus(row) {
-        switch (row.status) {
+        switch (row.row.status) {
           case '0':
             return '需补货'
           case '1':
@@ -444,7 +462,7 @@ export default {
         }
       },
       formatterBusinessType(row) {
-        switch (row.businessType) {
+        switch (row.row.businessType) {
           case 'ZQBH':
             return '周期备货'
           case 'FXXQ':
@@ -462,7 +480,7 @@ export default {
         }
       },
       formatterSource(row) {
-        switch (row.billSource) {
+        switch (row.row.billSource) {
           case '1':
             return '手工导入'
           case '2':
@@ -503,6 +521,7 @@ export default {
         approverFinishTime: '',
         isCustomerSpecified: '',
         isUrgency: '',
+        additionalSupplier: '',
         pageNum: 1,
         pageSize: 50
       },
@@ -514,6 +533,7 @@ export default {
       lastWarehouseOptions: [],
       lastAllocationOptions: [],
       orgOptions: [],
+      supplierOptions: [],
       options: [{
         value: 'Y', label: '是',
       }, {
@@ -543,15 +563,34 @@ export default {
     }
   },
   created() {
-    this.getList(this.queryParams)
+    this.$nextTick(() => {
+      // 手动将表格和工具栏进行关联
+      this.$refs.table.connect(this.$refs.xToolbar1)
+      this.getList(this.queryParams)
+    })
   },
   methods: {
+    checkColumnMethod ({ column }) {
+      if (column.property === 'role') {
+        return false
+      }
+      return true
+    },
+    resizableChangeEvent () {
+      const columns = this.$refs.table.getColumns()
+      const customData = columns.map(column => {
+        return {
+          width: column.renderWidth
+        }
+      })
+      console.log(customData)
+    },
     reDraw() {
-      this.$refs.table.doLayout();
+      // this.$refs.table.doLayout();
     },
     // 单元格标红
     cellClassName({row, column, rowIndex, columnIndex}) {
-      if(column.label == "需求可用周期" && Number(row.demandCycle) > 1.5 ) {
+      if(column.title == "需求可用周期" && Number(row.demandCycle) > 1.5 ) {
         return 'success-row';
       }
     },
@@ -561,7 +600,7 @@ export default {
       const sums = [];
       columns.forEach((column, index) => {
         if (index === 0) {
-          sums[index] = '合计';
+          sums.push('合计');
           return;
         }
         const values = data.map(item => Number(item[column.property]));
@@ -578,7 +617,7 @@ export default {
 
         }
       });
-      return sums
+      return [sums]
     },
     // 搜索
     search() {
@@ -610,6 +649,7 @@ export default {
         approverFinishTime: '',
         isCustomerSpecified: '',
         isUrgency: '',
+        additionalSupplier: '',
         pageNum: 1,
         pageSize: 50
       }
@@ -620,17 +660,16 @@ export default {
         if (res.code === 200) {
           this.tableList = res.rows
           this.total = res.total
-          let arrs = []
-          this.$refs.table.$children.forEach(item => {
-            if (item.label != undefined && item.prop != undefined) {
-              arrs.push({
-                label: item.label,
-                prop: item.prop
-              })
-            }
-          })
-          this.arrs = arrs
-          console.log('获取表头数据', arrs)
+          // let arrs = []
+          // this.$refs.table.$children.forEach(item => {
+          //   if (item.label != undefined && item.prop != undefined) {
+          //     arrs.push({
+          //       label: item.label,
+          //       prop: item.prop
+          //     })
+          //   }
+          // })
+          // this.arrs = arrs
         }
       }).then(() => {
         // 合计不显示重绘
@@ -640,7 +679,15 @@ export default {
         this.loading = false
       })
     },
-    handleSelectionChange(selection) {
+    selectAllEvent({checked}) {
+      const selection = this.$refs.table.getCheckboxRecords()
+      console.log('选中', selection)
+      this.allSelection = selection
+      this.ids = selection.map(item => item.demandItemId)
+      console.log('选中数组', this.ids.join())
+    },
+    handleSelectionChange({checked}) {
+      const selection = this.$refs.table.getCheckboxRecords()
       console.log('选中', selection)
       this.allSelection = selection
       this.ids = selection.map(item => item.demandItemId)
@@ -674,7 +721,7 @@ export default {
       this.rowDetail = row
       this.disable = true
     },
-    doubleClick(row) {
+    doubleClick({row}) {
       this.isList = false
       this.page = 'check'
       this.rowDetail = row
@@ -682,7 +729,8 @@ export default {
     },
     // 表格选中数据
     rowSelect(row) {
-      this.$refs.table.toggleRowSelection(row);
+      // console.log(row)
+      this.$refs.table.toggleCheckboxRow(row.row);
     },
     handleSizeChange(val) {
       console.log(`每页 ${val} 条`);
@@ -847,6 +895,10 @@ export default {
         this.tableList[this.tableIndex].buyer = selection[0].code
         this.tableList[this.tableIndex].buyerName = selection[0].name
       }
+      if (this.referCondition.type == 'SUPPLIER_PARAM') {
+        this.supplierOptions = selection
+        this.queryParams.additionalSupplier = selection[0].id
+      }
       // if (this.referCondition.title == '明细默认采购组织') {
       //   console.log('选择进了吗',this.tableList)
       //   this.tableList[this.tableIndex].purchaseOrg = selection[0].id
@@ -962,13 +1014,13 @@ export default {
   margin-top: 10px;
   text-align: right;
 }
-::v-deep .el-table__row > td {
+::v-deep .vxe-body--row > td {
   border-right: none;
 }
  ::v-deep .el-card .el-form-item {
   margin-bottom: 3px;
 }
-::v-deep .el-table__row .success-row {
+::v-deep .vxe-body--row .success-row {
   background-color: #ff8a8a!important;
 }
 </style>

+ 51 - 85
src/views/purchase/DemandSummary/index.vue

@@ -269,115 +269,105 @@
           ref="table"
           :checkbox-config="{trigger:'row', highlight: true, range: true}"
           :column-config="{resizable: true}"
+          :sort-config="{multiple: true, trigger: 'cell'}"
         >
           <vxe-column type="checkbox" width="50"/>
-          <vxe-column show-header-overflow show-overflow  title="序号" type="seq" align="center" width="50px"/>
-          <!-- <vxe-column show-header-overflow show-overflow title="行号" align="center" field="rowNo"/> -->
-          <vxe-column show-header-overflow show-overflow title="行状态" align="center" field="status" width="50px" :formatter="hangStatus"/>
-          <vxe-column show-header-overflow show-overflow title="最终采购量" align="center" field="finalBuyQty" width="80px">
+          <vxe-column show-header-overflow show-overflow sortable title="序号" type="seq" align="center" width="50px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="行状态" align="center" field="status" width="50px" :formatter="hangStatus"/>
+          <vxe-column show-header-overflow show-overflow sortable title="最终采购量" align="center" field="finalBuyQty" width="80px">
             <template slot-scope="scope">
                 <el-input size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty" @change="jilu(scope.$rowIndex)"/>
             </template>
           </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="关闭数量" align="center" field="closeQty" width="50px"/>
-          <vxe-column show-header-overflow show-overflow title="人工调整数" align="center" field="artificialAdjust" width="50px">
+          <vxe-column show-header-overflow show-overflow sortable title="关闭数量" align="center" field="closeQty" width="50px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="人工调整数" align="center" field="artificialAdjust" width="50px">
             <template slot-scope="scope">
               {{scope.row.artificialAdjust = scope.row.finalBuyQty - scope.row.suggestionPurchase}}
             </template>
           </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="一级品类" align="center" field="materialClassifyOneName" width="80"/>
-          <vxe-column show-header-overflow show-overflow title="物料编码" align="center" field="materialCode" width="100px"/>
-          <vxe-column show-header-overflow show-overflow title="品名" align="center" field="materialName" width="100px"/>
-          <vxe-column show-header-overflow show-overflow title="规格" align="center" field="specification" width="100px"/>
-          <vxe-column show-header-overflow show-overflow title="单位" align="center" field="unit" width="50"/>
-          <vxe-column show-header-overflow show-overflow title="生产厂家/代理人" align="center" field="manufacturer" width="100px"/>
-          <vxe-column show-header-overflow show-overflow title="需求单位数" align="center" field="demandNum" width="50px"/>
-          <vxe-column show-header-overflow show-overflow title="总最终净需求量" align="center" field="netDemandNum" width="80px">
+          <vxe-column show-header-overflow show-overflow sortable title="一级品类" align="center" field="materialClassifyOneName" width="80"/>
+          <vxe-column show-header-overflow show-overflow sortable title="物料编码" align="center" field="materialCode" width="100px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="品名" align="center" field="materialName" width="100px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="规格" align="center" field="specification" width="100px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="单位" align="center" field="unit" width="50"/>
+          <vxe-column show-header-overflow show-overflow sortable title="生产厂家/代理人" align="center" field="manufacturer" width="100px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="需求单位数" align="center" field="demandNum" width="50px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="总最终净需求量" align="center" field="netDemandNum" width="80px">
             <template slot-scope="scope">
               {{scope.row.netDemandNum ? parseFloat(scope.row.netDemandNum).toFixed(2) : '0.00'}}
             </template>
           </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="近1月月均需求" align="center" field="evensalesforyear" width="50">
+          <vxe-column show-header-overflow show-overflow sortable title="近1月月均需求" align="center" field="evensalesforyear" width="50">
             <template slot-scope="scope">
               {{scope.row.evensalesforyear ? parseFloat(scope.row.evensalesforyear).toFixed(2) : '0.00'}}
             </template>
           </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="近3月月均需求" align="center" field="evensalesforthrmonth" width="50">
+          <vxe-column show-header-overflow show-overflow sortable title="近3月月均需求" align="center" field="evensalesforthrmonth" width="50">
             <template slot-scope="scope">
               {{scope.row.evensalesforthrmonth ? parseFloat(scope.row.evensalesforthrmonth).toFixed(2) : '0.00'}}
             </template>
           </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="总月销量" align="center" field="totalMonthlySales" width="50">
+          <vxe-column show-header-overflow show-overflow sortable title="总月销量" align="center" field="totalMonthlySales" width="50">
             <template slot-scope="scope">
               {{scope.row.totalMonthlySales ? parseFloat(scope.row.totalMonthlySales).toFixed(2) : '0.00'}}
             </template>
           </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="需求可用周期" align="center" field="demandCycle" width="50px">
+          <vxe-column show-header-overflow show-overflow sortable title="需求可用周期" align="center" field="demandCycle" width="50px">
             <template slot-scope="scope">
               {{scope.row.demandCycle ? parseFloat(scope.row.demandCycle).toFixed(1) : '-'}}
             </template>
           </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="呆滞量" align="center" field="dullQut" width="50px">
+          <vxe-column show-header-overflow show-overflow sortable title="呆滞量" align="center" field="dullQut" width="50px">
             <template slot-scope="scope">
               {{parseFloat(scope.row.dullQut).toFixed(2)}}
             </template>
           </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="采购周期" align="center" field="buyPeriod" width="50px" />
-          <vxe-column show-header-overflow show-overflow title="中心公共库存" align="center" field="centralPublicStock" width="50"/>
-          <vxe-column show-header-overflow show-overflow title="中心仓专属货位" align="center" field="centralWarehouse" width="50"/>
-          <vxe-column show-header-overflow show-overflow title="各项目仓库存" align="center" field="eachWarehouseStock" width="50"/>
-          <vxe-column show-header-overflow show-overflow title="电商仓库" align="center" field="commerceWarehouse"  width="50" />
-          <vxe-column show-header-overflow show-overflow title="区域分仓公共库存" align="center" field="regionPublicStock" width="50"/>
-          <vxe-column show-header-overflow show-overflow title="采购在途" align="center" field="buyTransit"  width="80px" />
-          <vxe-column show-header-overflow show-overflow title="借出在途" align="center" field="lendTransit"  width="80px" />
-          <vxe-column show-header-overflow show-overflow title="调拨在途" align="center" field="transferTransit"  width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="库存总计" align="center" field="stockTotal" width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="最小包装量" align="center" field="minPackage"  width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="最小订货量" align="center" field="minOrder"  width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="最小批量" align="center" field="minBatch"  width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="修改原因" align="center" field="modifyReason" width="150px">
+          <vxe-column show-header-overflow show-overflow sortable title="采购周期" align="center" field="buyPeriod" width="50px" />
+          <vxe-column show-header-overflow show-overflow sortable title="中心公共库存" align="center" field="centralPublicStock" width="50"/>
+          <vxe-column show-header-overflow show-overflow sortable title="中心仓专属货位" align="center" field="centralWarehouse" width="50"/>
+          <vxe-column show-header-overflow show-overflow sortable title="各项目仓库存" align="center" field="eachWarehouseStock" width="50"/>
+          <vxe-column show-header-overflow show-overflow sortable title="电商仓库" align="center" field="commerceWarehouse"  width="50" />
+          <vxe-column show-header-overflow show-overflow sortable title="区域分仓公共库存" align="center" field="regionPublicStock" width="50"/>
+          <vxe-column show-header-overflow show-overflow sortable title="采购在途" align="center" field="buyTransit"  width="80px" />
+          <vxe-column show-header-overflow show-overflow sortable title="借出在途" align="center" field="lendTransit"  width="80px" />
+          <vxe-column show-header-overflow show-overflow sortable title="调拨在途" align="center" field="transferTransit"  width="80px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="库存总计" align="center" field="stockTotal" width="80px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="最小包装量" align="center" field="minPackage"  width="80px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="最小订货量" align="center" field="minOrder"  width="80px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="最小批量" align="center" field="minBatch"  width="80px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="修改原因" align="center" field="modifyReason" width="150px">
             <template slot-scope="scope">
                 <el-input size="mini" :disabled="scope.row.status !== '1'|| lineDisable || scope.row.artificialAdjust == '0'" v-model="scope.row.modifyReason" @change="jilu(scope.$rowIndex)"/>
             </template>
           </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="建议采购量" align="center" field="suggestionPurchase"  width="80px"/>
-          <!-- <vxe-column show-header-overflow show-overflow title="建议净采购量" align="center" field="suggestBuyQty" width="100px"/> -->
-          <vxe-column show-header-overflow show-overflow title="二级品类" align="center" field="materialClassifyTwoName" width="120px"/>
-          <vxe-column show-header-overflow show-overflow title="三级品类" align="center" field="materialClassifyThreeName" width="120px"/>
-          <vxe-column show-header-overflow show-overflow title="四级品类" align="center" field="materialClassifyFourName" width="120px"/>
-          <vxe-column show-header-overflow show-overflow title="采购员" align="center" field="buyerName" width="150px">
+          <vxe-column show-header-overflow show-overflow sortable title="建议采购量" align="center" field="suggestionPurchase"  width="80px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="二级品类" align="center" field="materialClassifyTwoName" width="120px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="三级品类" align="center" field="materialClassifyThreeName" width="120px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="四级品类" align="center" field="materialClassifyFourName" width="120px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="采购员" align="center" field="buyerName" width="150px">
             <template slot-scope="scope">
                 <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.buyerName">
                   <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$rowIndex, 'CONTACTS_PARAM', true, '明细采购员')"></el-button>
                 </el-input>
             </template>
           </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="默认采购组织" align="center" field="purchaseOrgName" width="150px">
-            <!-- <template slot-scope="scope">
-                <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.purchaseOrgName">
-                  <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '明细默认采购组织')"></el-button>
-                </el-input>
-            </template> -->
+          <vxe-column show-header-overflow show-overflow sortable title="默认采购组织" align="center" field="purchaseOrgName" width="150px">
           </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="有效期" align="center" field="validityPeriod"/>
-          <vxe-column show-header-overflow show-overflow title="有效期单位" align="center" field="validityPeriodUnit" width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="业务类型" align="center" field="businessType" :formatter="formatterBusinessType"/>
-          <vxe-column show-header-overflow show-overflow title="安全库存量" align="center" field="safetyStock" width="80px">
+          <vxe-column show-header-overflow show-overflow sortable title="有效期" align="center" field="validityPeriod"/>
+          <vxe-column show-header-overflow show-overflow sortable title="有效期单位" align="center" field="validityPeriodUnit" width="80px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="业务类型" align="center" field="businessType" :formatter="formatterBusinessType"/>
+          <vxe-column show-header-overflow show-overflow sortable title="安全库存量" align="center" field="safetyStock" width="80px">
             <template slot-scope="scope">
               {{scope.row.safetyStock ? parseFloat(scope.row.safetyStock).toFixed(2) : '0.00'}}
             </template>
           </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="单据来源" align="center" field="billSource" :formatter="formatterSource"/>
-          <vxe-column show-header-overflow show-overflow title="注册人" align="center" field="registrant" width="120px"/>
-          <!-- <vxe-column title="可用量" align="center" field="qty"/> -->
-          <vxe-column show-header-overflow show-overflow title="总需与终采差异" align="center" field="buyDiscrepancy" width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="集团预测分类" align="center" field="forecastClassification" width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="中心仓占有量" align="center" field="centerBinPossession" width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="中心仓可用量" align="center" field="centralWarehouseAvailable" width="80px"/>
-          <!-- <vxe-column title="物料类别" align="center" field="materialCategory" width="150px"/> -->
-          <!-- <vxe-column title="业务部门" align="center" field="departmentName" width="150px"/> -->
-          <!-- <vxe-column show-header-overflow show-overflow title="需求单位" align="center" field="demandUnit"/> -->
-          <vxe-column show-header-overflow show-overflow title="采购经理审核人" align="center" field="puManagerAuditor" width="120px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="单据来源" align="center" field="billSource" :formatter="formatterSource"/>
+          <vxe-column show-header-overflow show-overflow sortable title="注册人" align="center" field="registrant" width="120px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="总需与终采差异" align="center" field="buyDiscrepancy" width="80px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="集团预测分类" align="center" field="forecastClassification" width="80px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="中心仓占有量" align="center" field="centerBinPossession" width="80px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="中心仓可用量" align="center" field="centralWarehouseAvailable" width="80px"/>
+          <vxe-column show-header-overflow show-overflow sortable title="采购经理审核人" align="center" field="puManagerAuditor" width="120px"/>
           <vxe-column
           title="操作"
           align="center"
@@ -389,10 +379,6 @@
         </vxe-column>
         </vxe-table>
 
-        <!-- <el-button size="mini" style="position: absolute;left: 20px;bottom: 20px;" @click="tols.open = true">隐藏列</el-button> -->
-
-        <colTol :isVisible.sync="tols.open" @reDraw="reDraw" :showColumn.sync="showColumn" :arrs.sync="arrs"/>
-
         <el-pagination
           background
           @size-change="handleSizeChange"
@@ -418,7 +404,6 @@
 
 <script>
 import Add from './add'
-import colTol from './colTol.vue'
 import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import popDialog from '@/components/PopDialog/index.vue'
@@ -431,7 +416,6 @@ export default {
   dicts: ['sys_row_status', 'predictive_classify', 'sys_period_unit', 'sys_business', 'sys_bill_source'],
   components: {
     Add,
-    colTol,
     CollapseTransition,
     Refers,
     TreeRefers,
@@ -440,11 +424,6 @@ export default {
   data() {
     return {
       loading: true,
-      showColumn: {},
-      arrs:[],
-      tols: {
-        open: false
-      },
       hangStatus(row) {
         switch (row.row.status) {
           case '0':
@@ -583,10 +562,7 @@ export default {
           width: column.renderWidth
         }
       })
-      console.log(customData)
-    },
-    reDraw() {
-      // this.$refs.table.doLayout();
+      // console.log(customData)
     },
     // 单元格标红
     cellClassName({row, column, rowIndex, columnIndex}) {
@@ -660,16 +636,6 @@ export default {
         if (res.code === 200) {
           this.tableList = res.rows
           this.total = res.total
-          // let arrs = []
-          // this.$refs.table.$children.forEach(item => {
-          //   if (item.label != undefined && item.prop != undefined) {
-          //     arrs.push({
-          //       label: item.label,
-          //       prop: item.prop
-          //     })
-          //   }
-          // })
-          // this.arrs = arrs
         }
       }).then(() => {
         // 合计不显示重绘

+ 10 - 34
src/views/purchase/equipmentData/add.vue

@@ -47,33 +47,6 @@
             </el-form-item>
           </el-col>
 
-          <!-- <el-col :span="1.5">
-            <el-form-item label="省份" prop="province">
-              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.province">
-              </el-input>
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="1.5">
-            <el-form-item label="大区负责人" prop="largeZoneCommander">
-              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.largeZoneCommander">
-              </el-input>
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="1.5">
-            <el-form-item label="业务经理" prop="serviceManager">
-              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.serviceManager">
-              </el-input>
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="1.5">
-            <el-form-item label="售后工程师" prop="afterSalesEngineer">
-              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.afterSalesEngineer">
-              </el-input>
-            </el-form-item>
-          </el-col> -->
         </el-row>
 
         <el-row>
@@ -86,10 +59,11 @@
 
         <el-row>
           <el-col :span="12">
-            <el-form-item label="文件上传" prop="fileIds">
+            <el-form-item label="文件上传" prop="sysMaterialDeviceOriginFileList">
             <el-upload
               class="upload-demo"
-              :action="url + basicForm.id"
+              :action="url"
+              :headers="headers"
               :on-preview="handlePreview"
               :on-success='handleSuccess'
               :on-remove="handleRemove"
@@ -97,7 +71,7 @@
               multiple
               :limit="1"
               :on-exceed="handleExceed"
-              :file-list="basicForm.fileIds">
+              :file-list="basicForm.sysMaterialDeviceOriginFileList">
               <el-button size="small" type="primary">点击上传</el-button>
               <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
             </el-upload>
@@ -189,6 +163,7 @@
 </template>
 
 <script>
+import { getToken } from "@/utils/auth";
 import { addEquipment, getEquipmentDetail } from '@/api/purchase/equipmentData.js'
 export default {
   components: {
@@ -213,7 +188,7 @@ export default {
         referencePrice: '',
         parameters: '',
         sysMaterialDeviceOriginItemList: [],
-        fileIds: [],
+        sysMaterialDeviceOriginFileList: [],
         isProjectOrFactoryEmpower: '',
         remark: '',
       },
@@ -226,7 +201,8 @@ export default {
       basicRules: {},
       ids:[],
       delDemandItemList:[],
-      url: process.env.VUE_APP_BASE_API + '/device/origin/upload?deviceOriginId='
+      headers: { Authorization: "Bearer " + getToken() },
+      url: process.env.VUE_APP_BASE_API + '/device/origin/upload'
     }
   },
   created() {
@@ -291,14 +267,14 @@ export default {
     },
     handleRemove(file, fileList) {
       console.log(file, fileList);
-      this.basicForm.fileIds = []
+      this.basicForm.sysMaterialDeviceOriginFileList = []
     },
     handlePreview(file) {
       console.log(file);
     },
     handleSuccess(response, file, fileList) {
       console.log(response)
-      this.basicForm.fileIds = response.data
+      this.basicForm.sysMaterialDeviceOriginFileList = response.data
     },
     handleExceed(files, fileList) {
       this.$message.warning(`当前限制选择1个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);

+ 48 - 3
src/views/purchase/equipmentData/index.vue

@@ -29,11 +29,14 @@
 
       <div class="btn_grooup">
         <el-button type="primary" size="mini" @click="addDivision">新增</el-button>
+        <el-button type="primary" size="mini" @click="delItems">删除</el-button>
         <el-button type="primary" size="mini" @click="downLoadMb">下载模板</el-button>
         <el-button type="primary" size="mini" @click="upload.open = true">导入数据</el-button>
       </div>
       <el-super-ux-table
         v-model="tableData"
+        index
+        checkbox
         :size="size"
         :dict="dict"
         :page="pageInfo"
@@ -44,7 +47,10 @@
         storage-key="equipmentDataSuperTable"
         @row-dblclick="useSee"
         @row-select="useSelect"
+        @selection-change="handleSelectionChange"
+        @row-click="rowSelect"
         @pagination="useQuery(params, pageInfo)"
+        ref="tables"
       >
         <ux-table-column
           fixed="right"
@@ -100,7 +106,7 @@
 <script>
 // 导入的token
 import { getToken } from "@/utils/auth";
-import { getEquipmentDataList, downLoadMb} from '@/api/purchase/equipmentData.js'
+import { getEquipmentDataList, downLoadMb, deleteEquipments} from '@/api/purchase/equipmentData.js'
 export default {
   name: "equipmentData",
   dicts: [],
@@ -157,7 +163,17 @@ export default {
         { item: { key: "isProjectOrFactoryEmpower", title: "是否项目/厂家年度授权", width: 150 }, attr: {} },
         { item: { key: "parameters", title: "参数", width: 150 }, attr: {} },
         { item: { key: "remark", title: "备注", width: 150 }, attr: {} },
-      ],
+      ].map(({ item, attr }) => ({
+      attr,
+      item: {
+        ...item,
+        sortabled: true,
+        fixedabled: true,
+        filterabled: true,
+        hiddenabled: true,
+      },
+      })),
+      ids: []
     }
   },
   created() {
@@ -166,6 +182,14 @@ export default {
   methods: {
     useSee() {},
     useSelect() {},
+    handleSelectionChange(selection) {
+      console.log('选中', selection)
+      this.ids = selection.map(item => item.id)
+      console.log('选中数组', this.ids)
+    },
+    rowSelect(row) {
+      this.$refs.tables.toggleRowSelection([{row: row}]);
+    },
     // 加载列表
     async useQuery(prop, page) {
       let params = {...prop, ...page}
@@ -182,6 +206,18 @@ export default {
       this.page = 'add'
       this.disable = false
     },
+    delItems() {
+      if (this.ids.length <= 0) {
+        this.$modal.notifyWarning("至少勾选一条数据");
+      } else {
+        deleteEquipments(this.ids).then(res => {
+          if(res.code === 200) {
+            this.$modal.notifySuccess("删除成功");
+            this.useQuery(this.params, this.pageInfo)
+          }
+       })
+      }
+    },
     // 下载模板
     async downLoadMb() {
       this.$modal.loading("正在下载模板,请稍后...");
@@ -245,7 +281,16 @@ export default {
       this.rowDetail = row
       this.disable = true
     },
-    delItem(row) {},
+    delItem(row) {
+      console.log(row)
+      const param = [row.id]
+      deleteEquipments(param).then(res => {
+        if(res.code === 200) {
+          this.$modal.notifySuccess("删除成功");
+          this.useQuery(this.params, this.pageInfo)
+        }
+      })
+    },
   }
 }
 </script>

+ 39 - 36
src/views/purchase/purchase-order/add/column.js

@@ -109,24 +109,7 @@ const PurColumns =[
 
     // require: true,
   },
-  {
-    key: "goodsAllocationName",
-    title: "货位",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "ALLOCATION_PARAM",
-    dataMapping: {
-      goodsAllocation: 'id',
-      goodsAllocationName: 'name',
-
-    },
-     isShow:true,
-    queryParams: (params) => ({
-      stordocId: params.warehouse,
-      pkOrg: params.puOrg,
-    }),
-    width: 200,
-  },
+ 
   {
     key: "originalQty",
     title: "原始总数量",
@@ -614,6 +597,25 @@ const PurchaseTabColumns =[
         width: 180,
         isSummary:true,
       },
+      {
+        key: "goodsAllocationName",
+        title: "货位",
+        inputType: "PopoverSelect",
+        valueKey: "id",
+        referName: "ALLOCATION_PARAM",
+        dataMapping: {
+          goodsAllocation: 'id',
+          goodsAllocationName: 'name',
+    
+        },
+         isShow:true,
+        queryParams: (params) => ({
+          stordocId: params.warehouse,
+          pkOrg: params.puOrg,
+        }),
+        width: 180,
+      },
+    
     ]
   },
   // {
@@ -947,24 +949,7 @@ const CauseColumns =[
 
     // require: true,
   },
-  {
-    key: "goodsAllocationName",
-    title: "货位",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "ALLOCATION_PARAM",
-    dataMapping: {
-      goodsAllocation: 'id',
-      goodsAllocationName: 'name',
-
-    },
-     isShow:true,
-    queryParams: (params) => ({
-      stordocId: params.warehouse,
-      pkOrg: params.puOrg,
-    }),
-    width: 200,
-  },
+  
   {
     key: "customerDeptName",
     title: "客户部门",
@@ -1404,6 +1389,24 @@ const CauseTabColumns =[
       { key: "discountRule", title: "折扣规则编码", inputType: "Input", width: 180 },
       { key: "demandCode", title: "采购需求单号", inputType: "Input", width: 180 },
       { key: "remark", title: "备注", inputType: "Input", width: 200 },
+      {
+        key: "goodsAllocationName",
+        title: "货位",
+        inputType: "PopoverSelect",
+        valueKey: "id",
+        referName: "ALLOCATION_PARAM",
+        dataMapping: {
+          goodsAllocation: 'id',
+          goodsAllocationName: 'name',
+
+        },
+        isShow:true,
+        queryParams: (params) => ({
+          stordocId: params.warehouse,
+          pkOrg: params.puOrg,
+        }),
+        width: 180,
+      },
 
     ]
   },

+ 20 - 5
src/views/purchase/purchase-order/add/index.vue

@@ -526,10 +526,18 @@ export default {
 
       // WMS仓库
       if (type === "WAREHOUSE_PARAM") {
-        this.judgeGoodsAllocation(val.csFlag);
-        source.goodsAllocation = "";
-        source.goodsAllocationName = "";
-        // this.count++
+        // 货位在表头
+        // this.judgeGoodsAllocation(val.csFlag);
+        // source.goodsAllocation = "";
+        // source.goodsAllocationName = "";
+        // 货位在表体
+        this.params.puOrderItemList = this.params.puOrderItemList.map(
+          (item) => ({
+            ...item,
+            goodsAllocation: "",
+            goodsAllocationName: "",
+          })
+        );
       }
     },
 
@@ -1034,7 +1042,14 @@ export default {
                       :multiple="cColumn.multiple"
                       :placeholder="cColumn.placeholder"
                       :data-mapping="cColumn.dataMapping"
-                      :query-params="cColumn.queryParams"
+                      :query-params="
+                        cColumn.key !== 'goodsAllocationName'
+                          ? cColumn.queryParams
+                          : () => ({
+                              stordocId: params.warehouse,
+                              pkOrg: params.puOrg,
+                            })
+                      "
                       @change="handleTabReferChange"
                     >
                     </dr-popover-select>

+ 43 - 11
src/views/purchase/purchase-order/column.js

@@ -273,7 +273,13 @@ const PurColumns = [
   },
 ].map(({ item, attr }) => ({
   attr,
-  item: { ...item, hidden: true, fixed: false },
+  item: { 
+    ...item, 
+    sortabled: true,
+    fixedabled: true,
+    filterabled: true,
+    hiddenabled: true, 
+  },
 }));
 
 // 事业发展部(原本格式)
@@ -506,13 +512,7 @@ const CauseColumns = [
     },
     width:100,
   }, //WMS入库仓库名称
-  { 
-    item:{ key: "goodsAllocationName", title: "货位",},
-    attr:{
-      isHidden:true,
-    },
-    width:100,
-  },
+  
   { 
     item:{key: "customerDeptName", title: "客户部门" ,},
     attr:{
@@ -783,7 +783,13 @@ const CauseColumns = [
   // { item:{key: "midOrderNo", title: "中台采购订单号" },
 ].map(({ item, attr }) => ({
   attr,
-  item: { ...item, hidden: true, fixed: false },
+  item: { 
+    ...item, 
+    sortabled: true,
+    fixedabled: true,
+    filterabled: true,
+    hiddenabled: true, 
+  },
 }));
 
 // 集采中心
@@ -1068,10 +1074,23 @@ const PurTabColumns = [
           isSummary:true,
         },
       },
+      { 
+        item:{ key: "goodsAllocationName", title: "货位",width:100,},
+        attr:{
+          isHidden:true,
+        },
+        
+      },
       
     ].map(({ item, attr }) => ({
       attr,
-      item: { ...item, hidden: true, fixed: false },
+      item: { 
+        ...item,
+        sortabled: true,
+        fixedabled: true,
+        filterabled: true,
+        hiddenabled: true, 
+      },
     }))
   },
   
@@ -1636,12 +1655,25 @@ const CommonTabColumns = [
           isHidden:true,
         },
       },
+      { 
+        item:{ key: "goodsAllocationName", title: "货位",width:100,},
+        attr:{
+          isHidden:true,
+        },
+        
+      },
       // { item:{key: "createByName", title: "创建人",width:100, },
       // { item:{key: "updateByName", title: "更新人" ,width:100,},
       
     ].map(({ item, attr }) => ({
       attr,
-      item: { ...item, hidden: true, fixed: false },
+      item: { 
+        ...item, 
+        sortabled: true,
+        fixedabled: true,
+        filterabled: true,
+        hiddenabled: true,
+       },
     }))
   },
   // {

+ 23 - 32
src/views/purchase/purchase-order/edit/index.vue

@@ -453,9 +453,16 @@ export default {
 
       // WMS仓库
       if (type === "WAREHOUSE_PARAM") {
-        this.judgeGoodsAllocation(val.csFlag);
-        source.goodsAllocation = "";
-        source.goodsAllocationName = "";
+        // this.judgeGoodsAllocation(val.csFlag);
+        // source.goodsAllocation = "";
+        // source.goodsAllocationName = "";
+        this.params.puOrderItemList = this.params.puOrderItemList.map(
+          (item) => ({
+            ...item,
+            goodsAllocation: "",
+            goodsAllocationName: "",
+          })
+        );
         // this.count++
       }
     },
@@ -939,24 +946,6 @@ export default {
             :label="column.title"
             :name="column.key"
           >
-            <!-- <virtual-scroll 
-              :data="params[column.key].filter(item => item.delFlag === '0')" 
-              :item-size="53" 
-              :key-prop="column.key === 'puOrderItemList' ? 'rowNo' :'rowno'" 
-              @change="(virtualList) => tableData = virtualList" 
-              :virtualized="true"
-            >
-              <template slot-scope="{ headerCellFixedStyle, cellFixedStyle }"> -->
-            <!-- row-key绑定列唯一值,height一定要设置否则会滚动条滚动位置不对且数据滚动全部加载完后会出现白板-->
-            <!-- <el-table 
-                  border
-                  :ref="column.key"
-                  :data="tableData" 
-                  style="width: 100%"
-                  :headerCellStyle="headerCellFixedStyle"
-                  :cellStyle="cellFixedStyle"
-                  :height="tabHeight"
-                > -->
             <ux-grid
               border
               use-virtual
@@ -974,16 +963,11 @@ export default {
                 color: '#515a6e',
               }"
             >
-              <ux-table-column title="序号" type="index" width="60">
-                <!-- <template slot-scope="scope">
-                      {{ scope.row.$index + 1 }}
-                    </template> -->
-              </ux-table-column>
-              <!-- <el-table-column label="序号">
-                    <template slot-scope="scope">
-                      {{ scope.$index + 1 }}
-                    </template>
-                  </el-table-column> -->
+              <ux-table-column
+                title="序号"
+                type="index"
+                width="60"
+              ></ux-table-column>
               <ux-table-column
                 v-for="(cColumn, cIndex) in column.tableColumns"
                 :key="cIndex"
@@ -1025,7 +1009,14 @@ export default {
                       :multiple="cColumn.multiple"
                       :placeholder="cColumn.placeholder"
                       :data-mapping="cColumn.dataMapping"
-                      :query-params="cColumn.queryParams"
+                      :query-params="
+                        cColumn.key !== 'goodsAllocationName'
+                          ? cColumn.queryParams
+                          : () => ({
+                              stordocId: params.warehouse,
+                              pkOrg: params.puOrg,
+                            })
+                      "
                       size="mini"
                       @change="handleTabReferChange"
                     ></dr-popover-select>

+ 40 - 28
src/views/purchase/purchase-order/index.vue

@@ -417,33 +417,40 @@ export default {
           if (code == 200) {
             _this.handleRefreshList();
           } else if (code == 10000) {
-            _this.$alert(msg, "提示", {
-              showCancelButton: true,
-              confirmButtonText: "继续提交",
-              cancelButtonText: "取消",
-              beforeClose: async (action, instance, done) => {
-                if (action === "confirm") {
-                  instance.confirmButtonLoading = true;
-                  instance.confirmButtonText = "执行中...";
-                  try {
-                    let { code, msg } = await orderApi.submit({
-                      puOrderIds,
-                      checkAmount: false,
-                    });
-                    if (code == 200) {
-                      done();
-                      _this.handleRefreshList();
+            _this.$alert(
+              "<div style='overflow: auto;overflow-x: hidden;max-height: 65vh;padding: 10px 20px 0;'>" +
+                msg +
+                "</div>",
+              "提示",
+              {
+                showCancelButton: true,
+                dangerouslyUseHTMLString: true,
+                confirmButtonText: "继续提交",
+                cancelButtonText: "取消",
+                beforeClose: async (action, instance, done) => {
+                  if (action === "confirm") {
+                    instance.confirmButtonLoading = true;
+                    instance.confirmButtonText = "执行中...";
+                    try {
+                      let { code, msg } = await orderApi.submit({
+                        puOrderIds,
+                        checkAmount: false,
+                      });
+                      if (code == 200) {
+                        done();
+                        _this.handleRefreshList();
+                      }
+                    } catch (error) {
+                      instance.confirmButtonText = "确认";
+                    } finally {
+                      instance.confirmButtonLoading = false;
                     }
-                  } catch (error) {
-                    instance.confirmButtonText = "确认";
-                  } finally {
-                    instance.confirmButtonLoading = false;
+                  } else {
+                    done();
                   }
-                } else {
-                  done();
-                }
-              },
-            });
+                },
+              }
+            );
           }
         } catch (error) {
         } finally {
@@ -893,6 +900,11 @@ export default {
   </el-card>
 </template>
 
-<style lang="scss">
-
-</style>
+<!-- <style scoped>
+>>> .el-message-box__content {
+  max-height: 350px;
+  overflow-y: scroll;
+  overflow-x: auto;
+  box-sizing: border-box;
+}
+</style> -->

+ 2 - 2
vue.config.js

@@ -37,10 +37,10 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://172.16.100.107:8080/drp-admin`, //测试
-        // target: `http://test-sy.derom.com/drp-admin`, //测试
+        target: `http://test-sy.derom.com/drp-admin`, //测试
         // target: `http://release-sy.derom.com/drp-admin`, //预发
         // target: `http://sy.derom.com/drp-admin`, //生产
-        target: `http://172.16.63.202:8000/drp-admin`, // D本地
+        // target: `http://172.16.63.202:8000/drp-admin`, // D本地
         // target: `http://172.16.62.241:8000/drp-admin`, //笑寒本地
         // target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
         // target: `http://172.16.13.47:8000/drp-admin`, //这是一个美女的本地