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

采购需求处理列表排序加入,删除之前无用文件

黄梓星 1 жил өмнө
parent
commit
29936ddc25

+ 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(() => {
         // 合计不显示重绘