소스 검색

销售采购 打印预览 对接

chenrui 4 년 전
부모
커밋
12f23ccff1

+ 8 - 0
src/api/purchase.js

@@ -125,3 +125,11 @@ export const getParentDealer = (params) => {
     method: 'get'
   })
 }
+// 采购 详情  打印
+export const purchaseDetailPrint = params => {
+  return axios.request({
+    url: `purchase/print/${params.sn}/${params.type}`,
+    method: 'get',
+    responseType: 'blob'
+  })
+}

+ 8 - 0
src/api/sales.js

@@ -131,3 +131,11 @@ export const supperCodeByVin = (params) => {
     method: 'get'
   })
 }
+// 销售 详情  打印
+export const salesDetailPrint = params => {
+  return axios.request({
+    url: `sales/print/${params.sn}/${params.type}`,
+    method: 'get',
+    responseType: 'blob'
+  })
+}

+ 45 - 4
src/views/purchasingManagement/purchaseOrder/detail.vue

@@ -10,8 +10,12 @@
       </template>
       <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
-        <a-button key="2" id="purchaseOrderDetail-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="purchaseOrderDetail-print-btn">快速打印</a-button>
+        <a-radio-group key="3" v-model="printerType">
+          <a-radio value="INK">针式</a-radio>
+          <a-radio value="NEEDLE">喷墨</a-radio>
+        </a-radio-group>
+        <a-button key="2" id="purchaseOrderDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+        <a-button key="1" type="primary" id="purchaseOrderDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
       </template>
     </a-page-header>
     <!-- 基础信息 -->
@@ -124,12 +128,14 @@
         </a-collapse-panel>
       </a-collapse>
     </a-card>
+    <!-- 打印 -->
+    <div id="print"></div>
   </div>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
-import { purchaseDetailBySn } from '@/api/purchase'
+import { purchaseDetailBySn, purchaseDetailPrint } from '@/api/purchase'
 import { purchaseDetailList } from '@/api/purchaseDetail'
 export default {
   components: { STable, VSelect },
@@ -162,11 +168,14 @@ export default {
             const cancelQty = data.list[i].cancelQty ? data.list[i].cancelQty : 0
             data.list[i].receivingOty = Number(qty) - Number(putQty) - Number(cancelQty)
           }
+          this.localDataSource = data.list
           this.disabled = false
           return data
         })
       },
-      detail: null //  详情数据
+      detail: null, //  详情数据
+      localDataSource: [],
+      printerType: 'INK' //  打印机类型
     }
   },
   computed: {
@@ -197,6 +206,38 @@ export default {
           this.detail = null
         }
       })
+    },
+    // 打印预览/快捷打印
+    handlePrint (type) {
+      const _this = this
+      purchaseDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            _this.$notification.error({
+              message: '提示',
+              description: obj.message
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.print(res, type)
+        }
+      })
+    },
+    print (data, type) {
+      if (!data) {
+        return
+      }
+      const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
+      document.getElementById('print').innerHTML = '<iframe id="printf" name="printf" src="' + url + '" hidden></iframe>'
+      if (type == 'preview') { //  预览
+        window.open(url)
+      } else if (type == 'print') { //  打印
+        window.frames['printf'].focus()
+        window.frames['printf'].print()
+      }
     }
   },
   mounted () {

+ 51 - 10
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -8,8 +8,12 @@
       </template>
       <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
-        <a-button key="2" id="purchaseOrderEdit-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="purchaseOrderEdit-print-btn">快速打印</a-button>
+        <a-radio-group key="3" v-model="printerType">
+          <a-radio value="INK">针式</a-radio>
+          <a-radio value="NEEDLE">喷墨</a-radio>
+        </a-radio-group>
+        <a-button key="2" id="purchaseOrderEdit-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+        <a-button key="1" type="primary" id="purchaseOrderEdit-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
       </template>
     </a-page-header>
     <!-- 基础信息 -->
@@ -102,7 +106,7 @@
               :rowKey="(record) => record.id"
               :columns="columns"
               :data="loadData"
-              :scroll="{ x: 1370, y:300 }"
+              :scroll="{ x: 1190, y:300 }"
               :defaultLoadData="false"
               bordered>
               <!-- 采购数量 -->
@@ -136,7 +140,7 @@
         <a-collapse-panel key="1">
           <template slot="header">
             已选产品
-            <a-button size="small" class="import-btn" id="purchaseOrderEdit-import-btn" @click.stop="handleImport">导入明细</a-button>
+            <!-- <a-button size="small" class="import-btn" id="purchaseOrderEdit-import-btn" @click.stop="handleImport">导入明细</a-button> -->
           </template>
           <!-- 已选产品 -->
           <div>
@@ -154,7 +158,7 @@
               :rowKey="(record) => record.id"
               :columns="chooseColumns"
               :data="chooseLoadData"
-              :scroll="{ x: 970, y: 300 }"
+              :scroll="{ x: 1070, y: 300 }"
               bordered>
               <!-- 采购数量 -->
               <template slot="storageQuantity" slot-scope="text, record">
@@ -196,6 +200,8 @@
     </a-affix>
     <!-- 选择基本信息弹框 -->
     <basic-info-modal ref="baseInfo" :openModal="openModal" @ok="handleOk" @cancel="openModal=false" />
+    <!-- 打印 -->
+    <div id="print"></div>
   </div>
 </template>
 
@@ -204,7 +210,7 @@ import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
-import { purchaseDetailBySn, purchaseWriteSubmit } from '@/api/purchase'
+import { purchaseDetailBySn, purchaseWriteSubmit, purchaseDetailPrint } from '@/api/purchase'
 import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel, purchaseDetailCount } from '@/api/purchaseDetail'
 import { productListPurchase } from '@/api/product'
 export default {
@@ -232,9 +238,9 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'code', width: 200, align: 'center', sorter: true },
+        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', sorter: true },
         { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'origCode', width: 200, align: 'center', customRender: function (text) { return text == ' ' ? '--' : text } },
+        { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text == ' ' ? '--' : text } },
         { title: '箱/单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '采购单价', dataIndex: 'purchasePrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) }, fixed: 'right' },
         { title: '采购数量', dataIndex: 'qty', scopedSlots: { customRender: 'storageQuantity' }, width: 150, align: 'center', fixed: 'right' },
@@ -260,7 +266,7 @@ export default {
       // 表头
       chooseColumns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 140, align: 'center', sorter: true },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center', sorter: true },
         { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '采购单价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
         { title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: 150, align: 'center' },
@@ -280,10 +286,13 @@ export default {
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
+          this.localDataSource = data.list
           this.disabled = false
           return data
         })
-      }
+      },
+      localDataSource: [],
+      printerType: 'INK' //  打印机类型
     }
   },
   methods: {
@@ -408,6 +417,38 @@ export default {
         _this.subLoading = false
       })
     },
+    // 打印预览/快捷打印
+    handlePrint (type) {
+      const _this = this
+      purchaseDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            _this.$notification.error({
+              message: '提示',
+              description: obj.message
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.print(res, type)
+        }
+      })
+    },
+    print (data, type) {
+      if (!data) {
+        return
+      }
+      const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
+      document.getElementById('print').innerHTML = '<iframe id="printf" name="printf" src="' + url + '" hidden></iframe>'
+      if (type == 'preview') { //  预览
+        window.open(url)
+      } else if (type == 'print') { //  打印
+        window.frames['printf'].focus()
+        window.frames['printf'].print()
+      }
+    },
     //  返回列表
     handleBack () {
       this.$router.push({ name: 'purchaseOrderList' })

+ 54 - 20
src/views/salesManagement/salesQuery/detail.vue

@@ -3,19 +3,30 @@
     <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
       <template slot="subTitle">
         <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+        <a-button
+          v-if="detailData&&detailData.billStatus !== 'CANCEL' && detailData.billStatus !== 'FINISH' && detailData.billStatus != 'WAIT_OUT_WAREHOUSE'"
+          type="primary"
+          size="small"
+          style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
+          id="salesDetail-edit-btn"
+          @click.stop="handleEdit">编辑</a-button>
       </template>
       <template slot="extra">
-        <span>打印字段:</span>
+        <!-- <span>打印字段:</span>
         <a-select key="1" style="width:150px" id="salesDetail-pritKey" placeholder="请选择打印字段" allowClear>
           <a-select-option v-for="item in pritKey" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
         </a-select>
         <span><i style="color: red;">*</i>打印模板:</span>
         <a-select key="2" style="width:150px" id="salesDetail-pritKey" placeholder="请选择打印模板" allowClear>
           <a-select-option v-for="item in pritModal" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-        </a-select>
-        <a-button key="3" id="salesDetail-preview-btn">打印预览</a-button>
-        <a-button key="4" type="primary" id="salesDetail-print-btn">快速打印</a-button>
+        </a-select> -->
         <!-- <a-button key="5" id="salesDetail-export-btn">导出</a-button> -->
+        <a-radio-group key="3" v-model="printerType">
+          <a-radio value="INK">针式</a-radio>
+          <a-radio value="NEEDLE">喷墨</a-radio>
+        </a-radio-group>
+        <a-button key="2" id="salesDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+        <a-button key="1" type="primary" id="salesDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
       </template>
     </a-page-header>
     <!-- 基础信息 -->
@@ -57,23 +68,15 @@
         bordered>
       </s-table>
     </a-card>
-    <a-card size="small" :bordered="false" class="footer-cont">
-      <a-button
-        type="primary"
-        class="button-info"
-        size="large"
-        style="width: 150px;"
-        v-if="detailData&&detailData.billStatus !== 'CANCEL' && detailData.billStatus !== 'FINISH' && detailData.billStatus != 'WAIT_OUT_WAREHOUSE'"
-        @click="handleEdit()"
-        id="salesDetail-edit-btn">编辑</a-button>
-    </a-card>
+    <!-- 打印 -->
+    <div id="print"></div>
   </div>
 </template>
 
 <script>
 import { getOperationalPrecision } from '@/libs/tools.js'
 import { STable, VSelect } from '@/components'
-import { salesDetailBySn } from '@/api/sales'
+import { salesDetailBySn, salesDetailPrint } from '@/api/sales'
 import { salesDetailList } from '@/api/salesDetail'
 export default {
   name: 'SalesDetail',
@@ -130,11 +133,14 @@ export default {
             // 售价小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
             data.list[i].salePriceSubtotal = getOperationalPrecision(data.list[i].price, data.list[i].qty)
           }
+          this.localDataSource = data.list
           this.disabled = false
           return data
         })
       },
-      detailData: null //  详情数据
+      localDataSource: [],
+      detailData: null, //  详情数据
+      printerType: 'INK' //  打印机类型
     }
   },
   methods: {
@@ -157,6 +163,38 @@ export default {
           this.detailData = null
         }
       })
+    },
+    // 打印预览/快捷打印
+    handlePrint (type) {
+      const _this = this
+      salesDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            _this.$notification.error({
+              message: '提示',
+              description: obj.message
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.print(res, type)
+        }
+      })
+    },
+    print (data, type) {
+      if (!data) {
+        return
+      }
+      const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
+      document.getElementById('print').innerHTML = '<iframe id="printf" name="printf" src="' + url + '" hidden></iframe>'
+      if (type == 'preview') { //  预览
+        window.open(url)
+      } else if (type == 'print') { //  打印
+        window.frames['printf'].focus()
+        window.frames['printf'].print()
+      }
     }
   },
   mounted () {
@@ -170,9 +208,5 @@ export default {
     .salesDetail-cont{
       margin-bottom: 15px;
     }
-    .footer-cont{
-      margin-top: 5px;
-      text-align: center;
-    }
   }
 </style>

+ 52 - 14
src/views/salesManagement/salesQuery/edit.vue

@@ -5,12 +5,15 @@
       <template slot="subTitle">
         <a id="salesEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         <span style="margin: 0 15px;color: #666;">客户名称:{{ detailData&&detailData.buyerName }}</span>
-        <!-- <a-button id="salesEdit-edit-btn" size="small" @click="handleEdit" style="margin-left:10px" key="0">编辑</a-button> -->
       </template>
       <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
-        <a-button key="2" id="salesEdit-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="salesEdit-print-btn">快速打印</a-button>
+        <a-radio-group key="3" v-model="printerType">
+          <a-radio value="INK">针式</a-radio>
+          <a-radio value="NEEDLE">喷墨</a-radio>
+        </a-radio-group>
+        <a-button key="2" id="salesEdit-preview-btn" :disabled="dataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+        <a-button key="1" type="primary" id="salesEdit-print-btn" :disabled="dataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
       </template>
     </a-page-header>
     <a-card size="small" :bordered="false" class="salesEdit-cont">
@@ -58,7 +61,7 @@
         </a-col>
         <a-col :span="6">
           <div style="float:right;overflow: hidden;">
-            <a-button size="small" id="salesEdit-dru">导入明细</a-button>
+            <!-- <a-button size="small" id="salesEdit-dru">导入明细</a-button> -->
             <a-button
               size="small"
               type="primary"
@@ -77,7 +80,7 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1560, y: 300 }"
+        :scroll="{ x: 1940, y: 300 }"
         :rowClassName="(record, index) => record.cost > record.price ? 'redBg-row':''"
         bordered>
         <!-- 产品编码 -->
@@ -136,6 +139,8 @@
     </a-affix>
     <!-- 选择客户弹框 -->
     <choose-custom-modal ref="custModal" :show="openModal" @updateData="updateData" @cancel="openModal=false" />
+    <!-- 打印 -->
+    <div id="print"></div>
   </div>
 </template>
 
@@ -143,7 +148,7 @@
 import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
-import { salesDetail, salesWriteSubmit, salesWriteDiscount } from '@/api/sales'
+import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint } from '@/api/sales'
 import EditableCell from '@/views/common/editInput.js'
 import { salesDetailList, salesDetailInsert, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll } from '@/api/salesDetail'
 export default {
@@ -166,18 +171,18 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', scopedSlots: { customRender: 'productCode' }, width: 140, align: 'center', sorter: true },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: 100, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseEntity.name', width: 100, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', scopedSlots: { customRender: 'productCode' }, width: 220, align: 'center', sorter: true },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseEntity.name', width: 150, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '售价', dataIndex: 'price', scopedSlots: { customRender: 'price' }, width: 150, align: 'center' },
         { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: 150, align: 'center' },
         { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '售价小计', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
         { title: '折后小计', dataIndex: 'discountedAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 170, align: 'center', fixed: 'right' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -193,7 +198,8 @@ export default {
           this.dataSource = data.list
           return data
         })
-      }
+      },
+      printerType: 'INK' //  打印机类型
     }
   },
   methods: {
@@ -229,6 +235,38 @@ export default {
         })
       }
     },
+    // 打印预览/快捷打印
+    handlePrint (type) {
+      const _this = this
+      salesDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            _this.$notification.error({
+              message: '提示',
+              description: obj.message
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.print(res, type)
+        }
+      })
+    },
+    print (data, type) {
+      if (!data) {
+        return
+      }
+      const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
+      document.getElementById('print').innerHTML = '<iframe id="printf" name="printf" src="' + url + '" hidden></iframe>'
+      if (type == 'preview') { //  预览
+        window.open(url)
+      } else if (type == 'print') { //  打印
+        window.frames['printf'].focus()
+        window.frames['printf'].print()
+      }
+    },
     // 编辑客户信息
     handleEdit () {
       this.openModal = true

+ 8 - 7
src/views/salesManagement/salesQuery/queryPart.vue

@@ -231,19 +231,19 @@ export default {
       warehouseList: [], // 仓库列表
       columnsBak: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'brandName', width: 100, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'brandName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 150, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
         { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '成本价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
         { title: '市级价', dataIndex: 'dealerProduct.cityPrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
         { title: '售价', dataIndex: 'salePrice', scopedSlots: { customRender: 'salePrice' }, width: 150, align: 'center' },
         { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: 150, align: 'center' },
-        { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
+        { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 170, align: 'center', fixed: 'right' }
       ],
       columns: [],
       // 加载数据方法 必须为 Promise 对象
@@ -322,6 +322,7 @@ export default {
       let w = 0
       for (let i = 0; i < r.length; i++) {
         const row = this.columnsBak.find(item => item.dataIndex == r[i])
+        console.log(row)
         if (row) {
           w = w + row.width
           d.push(row)