Browse Source

Merge commit '88f4f8cf13e59bfcca11f42c166d1a26a9edd183' into HEAD

gitadmin 2 years ago
parent
commit
bcbd709aa5
24 changed files with 891 additions and 129 deletions
  1. 1 1
      public/version.json
  2. 43 1
      src/api/shelf.js
  3. 25 7
      src/libs/JGPrint.js
  4. 4 4
      src/libs/exportExcel.js
  5. 1 1
      src/views/numsGoodsShelves/recallManagement/recallModal.vue
  6. 15 5
      src/views/numsGoodsShelves/recallStockManagement/editStock.vue
  7. 1 1
      src/views/numsGoodsShelves/replenishmentManagement/confirmModal.vue
  8. 8 4
      src/views/numsGoodsShelves/replenishmentManagement/list.vue
  9. 5 4
      src/views/numsGoodsShelves/replenishmentManagement/outWarehousingModal.vue
  10. 1 1
      src/views/numsGoodsShelves/replenishmentManagement/printStickerModal.vue
  11. 11 23
      src/views/numsGoodsShelves/replenishmentManagement/printView.vue
  12. 2 2
      src/views/numsGoodsShelves/replenishmentManagement/putWarehousingModal.vue
  13. 2 0
      src/views/numsGoodsShelves/shelfMonitoring/addModal.vue
  14. 1 1
      src/views/numsGoodsShelves/shelfMonitoring/warehouseDetail.vue
  15. 234 0
      src/views/numsGoodsShelves/shelfSet/addHwModal.vue
  16. 23 12
      src/views/numsGoodsShelves/shelfSet/basicInfoModal.vue
  17. 27 39
      src/views/numsGoodsShelves/shelfSet/bindProductModal.vue
  18. 206 0
      src/views/numsGoodsShelves/shelfSet/chooseShelfImportModal.vue
  19. 198 0
      src/views/numsGoodsShelves/shelfSet/importHuoweiModal.vue
  20. 1 1
      src/views/numsGoodsShelves/shelfSet/list.vue
  21. 75 18
      src/views/numsGoodsShelves/shelfSet/set.vue
  22. 3 0
      src/views/purchasingManagement/purchaseOrder/list.vue
  23. 2 2
      src/views/purchasingManagement/purchaseReturnApplyForm/chooseImportModal.vue
  24. 2 2
      vue.config.js

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1662011361581
+  "version": 1662628868446
 }

+ 43 - 1
src/api/shelf.js

@@ -66,6 +66,23 @@ export const shelfProductParseProducts = params => {
     data: params,
     method: 'post'
   })
+}
+ // POST 解析货位的导入模板
+export const shelfPlaceReadExcel = params => {
+  return axios({
+    url: '/shelf/place/readExcel',
+    data: params,
+    method: 'post'
+  })
+}
+// POST 导出错误项
+export const shelfPlaceFailExcel = params => {
+  return axios({
+    url: '/shelf/place/downloadFailExcel',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
 }
 // 货架  货位产品  批量插入
 export const shelfProductBatchInsert = params => {
@@ -75,6 +92,14 @@ export const shelfProductBatchInsert = params => {
     method: 'post'
   })
 }
+// 批量保存货位
+export const shelfSaveBatchExcel = params => {
+  return axios({
+    url: '/shelf/place/saveBatchExcel',
+    data: params,
+    method: 'post'
+  })
+}
 // 货架 箭冠产品  分页
 export const shelfDealerProductList = (params) => {
   const url = `/product/queryPageForXPRH/${params.pageNo}/${params.pageSize}`
@@ -109,8 +134,25 @@ export const shelfPutOutDetailList = (params) => {
 // 修改完成标识
 export const modifFinishFlag = (params) => {
   return axios({
-    url: `/shelf/modifFinishFlag `,
+    url: `/shelf/modifFinishFlag`,
     data: params,
     method: 'post'
   })
 }
+
+// 新增货位
+export const addPlaceAndProduct = (params) => {
+  return axios({
+    url: `/shelf/placeAndProduct/save`,
+    data: params,
+    method: 'post'
+  })
+}
+// 删除货位
+export const delShelfPlaceSn = (params) => {
+  return axios({
+    url: `/shelf/place/deleteBySn/${params.shelfPlaceSn}`,
+    data: params,
+    method: 'post'
+  })
+}

+ 25 - 7
src/libs/JGPrint.js

@@ -5,7 +5,7 @@ import store from '@/store'
 import { getLodop } from '@/libs/LodopFuncs'
 import moment from 'moment'
 // 打印页签,支持批量打印
-export const JGPrintTag = function (html, width, height, data) {
+export const JGPrintTag = function (width, height, data) {
   const LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'))
   if (!LODOP) {
     confirm({
@@ -26,16 +26,34 @@ export const JGPrintTag = function (html, width, height, data) {
     })
     return
   }
-  LODOP.PRINT_INIT("")
+  LODOP.PRINT_INITA("0mm","0mm",width,height,"标签");
   LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', 1) //  隐藏底图上有模拟走纸板的条纹线
   LODOP.SET_PRINT_MODE('POS_BASEON_PAPER', true) // 可使输出以纸张边缘为基点
-  LODOP.ADD_PRINT_HTM(0, 0, '100%', '100%', html)
-  LODOP.ADD_PRINT_BARCODE('36%','65%',90,90,"QRCode",data.qrCodeContent)
-  LODOP.SET_PRINT_STYLEA(0,"QRCodeVersion",5)
-  // LODOP.SET_PRINT_STYLEA(0,"QRCodeErrorLevel",'H')
+  const top = data.dealerName.length > 12 ? '5mm' : '7mm';
+  const top1 = data.dealerName.length > 12 ? '17mm' : '15mm';
+  const top2 = data.dealerName.length > 12 ? '29mm' : '27mm';
+  // 经销商名称
+  LODOP.SET_PRINT_STYLE("TextNeatRow",true);
+  LODOP.SET_PRINT_STYLE("FontSize",11);
+  LODOP.ADD_PRINT_TEXT(top,"5mm","50mm","10mm",data.dealerName);
+  LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
+  LODOP.SET_PRINT_STYLEA(0,"Horient",2);
+  // 货位号
+  LODOP.SET_PRINT_STYLE("TextNeatRow",true);
+  LODOP.SET_PRINT_STYLE("FontSize",32);
+  LODOP.ADD_PRINT_TEXT(top1,"50%","28mm","15mm",data.shelfPlaceCode);
+  // 产品编码
+  LODOP.SET_PRINT_STYLE("TextNeatRow",true);
+  LODOP.SET_PRINT_STYLE("FontSize",11);
+  LODOP.ADD_PRINT_TEXT(top2,"50%","30mm","15mm",data.productCode);
+  // 二维码
+  LODOP.ADD_PRINT_BARCODE(top1,'7mm',90,90,"QRCode",data.qrCodeContent)
+  LODOP.SET_PRINT_STYLE("QRCodeVersion",5)
+  // LODOP.SET_PRINT_STYLE("QRCodeErrorLevel",'H')
   LODOP.SET_PRINT_COPIES(data.printQty)// 指定份数
   LODOP.SET_PRINT_PAGESIZE(1, width, height)
-  LODOP.PRINTA()
+  // LODOP.PREVIEW()
+  LODOP.PRINT()
 }
  
 export const demoGetBASE64 = function (dataArray) {

+ 4 - 4
src/libs/exportExcel.js

@@ -8,7 +8,7 @@ import moment from 'moment'
   *fileName: 导出文件名称
   *callback: 回调函数
 */
-export const hdExportExcel = function (url, params, fileName, callback) {
+export const hdExportExcel = function (url, params, fileName, callback, showDate) {
   url(params).then(res => {
     if (res.type == 'application/json') {
       var reader = new FileReader()
@@ -23,16 +23,16 @@ export const hdExportExcel = function (url, params, fileName, callback) {
       })
       reader.readAsText(res)
     } else {
-      downloadExcel(res, fileName)
+      downloadExcel(res, fileName, showDate)
     }
     callback()
   })
 }
 // 导出下载excel
-export const downloadExcel = function (data, fileName) {
+export const downloadExcel = function (data, fileName, showDate) {
   if (!data) { return }
   const a = moment().format('YYYYMMDDHHmmss')
-  const fname = fileName + a
+  const fname = !showDate ? (fileName + a) : fileName
   const blob = new Blob([data], { type: 'application/vnd.ms-excel' })
   if (window.navigator && window.navigator.msSaveOrOpenBlob) {
     navigator.msSaveBlob(blob, fname + '.xlsx')

+ 1 - 1
src/views/numsGoodsShelves/recallManagement/recallModal.vue

@@ -104,7 +104,7 @@ export default {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '调回产品将退回至经销商仓库,确认退库吗?',
+        content: '此操作将会扣减数字货架的库存,确认退库吗?',
         centered: true,
         onOk () {
           // _this.$emit('close')

+ 15 - 5
src/views/numsGoodsShelves/recallStockManagement/editStock.vue

@@ -115,13 +115,23 @@ export default {
   methods: {
     handleBack (val) {
       if (val == 1) {
-        confirmPutStock({ stockPutSn: this.$route.params.stockPutSn }).then(res => {
-          this.$message.warning(res.message)
+        const _this = this
+        this.$confirm({
+          title: '提示',
+          content: '经销商库存将增加,确认入库吗?',
+          centered: true,
+          onOk () {
+            _this.spinning = true
+            confirmPutStock({ stockPutSn: _this.$route.params.stockPutSn }).then(res => {
+              _this.$message.warning(res.message)
+              _this.spinning = false
+              _this.$router.push({ path: '/numsGoodsShelves/recallStockManagement/list' })
+            })
+          }
         })
-      }
-      setTimeout(() => {
+      } else {
         this.$router.push({ path: '/numsGoodsShelves/recallStockManagement/list' })
-      }, 300)
+      }
     },
     // 入库信息的查询
     getStockInfo () {

+ 1 - 1
src/views/numsGoodsShelves/replenishmentManagement/confirmModal.vue

@@ -33,7 +33,7 @@
             v-model="record.confirmQty"
             :precision="0"
             :min="0"
-            :max="record.qty"
+            :max="999999"
             placeholder="请输入"
             style="width: 100%" />
         </template>

+ 8 - 4
src/views/numsGoodsShelves/replenishmentManagement/list.vue

@@ -77,11 +77,11 @@
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button v-if="record.billState=='WAIT_CONFIRM'" size="small" type="link" class="button-primary" @click.stop="handleConfirm(record)">确认</a-button>
-          <a-button v-if="record.billState=='WAIT_OUT_STOCK'" size="small" type="link" class="button-primary" @click.stop="handlePrintSticker(record)">打印贴签</a-button>
           <a-button v-if="record.billState=='WAIT_OUT_STOCK'" size="small" type="link" class="button-primary" @click.stop="handleOutWarehousing(record)">出库</a-button>
           <a-button v-if="record.billState=='WAIT_CHECK'" size="small" type="link" class="button-primary" @click.stop="handlePutWarehousing(record)">签收</a-button>
           <a-button v-if="record.billState=='WAIT_CONFIRM' || record.billState=='WAIT_OUT_STOCK'" size="small" type="link" class="button-primary" @click.stop="handleCancelOrder(record)">取消补货单</a-button>
-          <a-button v-if="record.billState=='CANCEL'" size="small" type="link" class="button-primary" @click.stop="handleDelete(record)">删除</a-button>
+          <a-button v-if="record.billState=='CANCEL'" size="small" type="link" class="button-error" @click.stop="handleDelete(record)">删除</a-button>
+          <a-button v-if="record.billState!='CANCEL'&&record.billState!='WAIT_CONFIRM'" size="small" type="link" class="button-primary" @click.stop="handlePrintSticker(record)">打印贴签</a-button>
         </template>
       </s-table>
       <!-- 确认 -->
@@ -146,12 +146,12 @@ export default {
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '补货单号', dataIndex: 'replenishBillNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '货架名称', dataIndex: 'shelfInfo.shelfName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '货架名称', dataIndex: 'shelfInfo.shelfName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '状态', dataIndex: 'billStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '补货应发总量', dataIndex: 'totalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '实发总量', dataIndex: 'totalConfirmQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '签收总量', dataIndex: 'totalPutQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'left' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '17%', align: 'left' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -266,6 +266,7 @@ export default {
       this.queryByTypeSum(true)
     },
     handleValidate (type, params) {
+      this.spinning = true
       // 校验产品库存是否足够
       shelfReplenishDetailStock(params).then(res => {
         if (res.status == 200) {
@@ -290,6 +291,7 @@ export default {
           this.$refs.table.refresh()
           this.handleCancel()
         }
+        this.spinning = false
       })
     },
     // 签收
@@ -408,6 +410,7 @@ export default {
     queryByTypeSum (flag) {
       const params = JSON.parse(JSON.stringify(this.queryParam))
       delete params.bizType
+      this.spinning = true
       shelfReplenishStateCount(params).then(res => {
         if (res.data && res.status == 200) {
           this.tabPaneData[1].countNum = res.data.WAIT_CONFIRM || 0
@@ -418,6 +421,7 @@ export default {
           this.queryParam.bizType = this.curBizType
           this.$refs.table.refresh(!flag)
         }
+        this.spinning = false
       })
     },
     setTableH () {

+ 5 - 4
src/views/numsGoodsShelves/replenishmentManagement/outWarehousingModal.vue

@@ -23,14 +23,14 @@
           <a-col :md="12" :sm="24">
             <a-form-model-item label="创建时间">{{ basicInfoData && basicInfoData.createDate || '--' }}</a-form-model-item>
           </a-col>
-          <a-col :md="12" :sm="24">
+          <!-- <a-col :md="12" :sm="24">
             <a-form-model-item label="配送方式" prop="dispatchType" style="margin: 0;">
               <a-radio-group v-model="form.dispatchType">
                 <a-radio v-for="(item,index) in dispatchTypeList" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
               </a-radio-group>
             </a-form-model-item>
-          </a-col>
-          <a-col :md="12" :sm="24">
+          </a-col> -->
+          <a-col :md="24" :sm="24">
             <a-form-model-item label="出库备注">
               <a-input id="replenishmentManagement-outWarehousing-remarks" v-model.trim="form.remarks" allowClear placeholder="请输入出库备注"/>
             </a-form-model-item>
@@ -206,10 +206,11 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.$refs.table.clearTable()
+        this.form.remarks = ''
         this.$refs.ruleForm.resetFields()
       } else {
         const _this = this
-        this.getLookUpItem()
+        // this.getLookUpItem()
         this.getDetail()
         this.$nextTick(() => { // 页面渲染完成后的回调
           _this.$refs.table.refresh(true)

+ 1 - 1
src/views/numsGoodsShelves/replenishmentManagement/printStickerModal.vue

@@ -20,7 +20,7 @@
         size="small"
         :rowKey="(record) => record.id"
         rowKeyName="id"
-        :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.confirmQty} }) }"
+        :row-selection="{ columnWidth: 40 }"
         @rowSelection="rowSelectionFun"
         :columns="columns"
         :data="loadData"

+ 11 - 23
src/views/numsGoodsShelves/replenishmentManagement/printView.vue

@@ -14,28 +14,20 @@
         v-for="(item,index) in list"
         :key="index"
         class="print-pages"
-        style="font-size: 12px;padding:3pt 5pt;">
-        <div class="storeName" style="text-align: center;margin: 2pt 0 4pt;">
+        style="font-size: 12px;padding:10pt 15pt;width:300px;margin:0 auto;">
+        <div class="storeName" style="text-align: center;margin: 5pt 0 10pt;">
           {{ nowData.dealerName }}
         </div>
         <div style="overflow: hidden;">
-          <div style="float: left;width:65%;padding-top: 5pt;">
-            <div class="shelfName" style="margin-bottom: 3pt;">
-              {{ nowData.shelfInfo.shelfName }}
-            </div>
-            <div class="productCode" style="margin-bottom: 2pt;">{{ item.productCode }}</div>
-            <div class="productName">{{ item.product.name }}</div>
-            <div class="userName" style="margin-top: 4pt;">
-              <span style="margin: 0 5pt 0 0;">{{ moment().format('YYYY-MM-DD HH:mm') }}</span>
-              <span>{{ nowData.parintUser }}</span>
-            </div>
-          </div>
-          <div style="float: right;width: 34%;">
-            <div class="productSno" style="font-size: 15pt;text-align: center;">{{ item.shelfPlaceCode }}</div>
+          <div style="float: left;">
             <div class="qrcode" ref="qrCodeUrl" style="text-align: center;">
               <vue-qr :text="`${item.shelfSn}&${item.productCode}&${item.productSn}&${item.shelfPlaceSn}`" :margin="0" :size="70"></vue-qr>
             </div>
           </div>
+          <div style="float: left;padding-left:10pt;">
+            <div class="productSno" style="font-size: 30pt;height:30pt;line-height:30pt;">{{ item.shelfPlaceCode }}</div>
+            <div class="productCode" style="margin-top: 2pt;font-size:12pt;">{{ item.productCode }}</div>
+          </div>
         </div>
       </div>
     </div>
@@ -73,15 +65,11 @@ export default {
     moment: moment,
     //  开始打印
     handleSave () {
-      const printBox = document.querySelectorAll('.print-pages')
-      console.log(printBox)
-      for (let i = 0; i < printBox.length; i++) {
-        // const htmlStr = printBox[i].outerHTML
-        const htmlStr = printBox[i].outerHTML.replace(/<\s?img[^>]*>/gi, '')
+      for (let i = 0; i < this.list.length; i++) {
         const item = this.list[i]
-        // `dealerSn=${nowData.dealerSn}&shelfSn=${item.shelfSn}&productSn=${item.productSn}&productCode=${item.productCode}&shelfPlaceCode=${item.shelfPlaceCode}&shelfPlaceSn=${item.shelfPlaceSn}&replenishBillDetailSn=${item.replenishBillDetailSn}`
-        this.list[i].qrCodeContent = `${item.shelfSn}&${item.productCode}&${item.productSn}&${item.shelfPlaceSn}`
-        JGPrintTag(htmlStr, '60mm', '40mm', this.list[i])
+        item.dealerName = this.nowData.dealerName
+        item.qrCodeContent = `${item.shelfSn}&${item.productCode}&${item.productSn}&${item.shelfPlaceSn}`
+        JGPrintTag('60mm', '40mm', item)
       }
     },
     setData (nowData, list) {

+ 2 - 2
src/views/numsGoodsShelves/replenishmentManagement/putWarehousingModal.vue

@@ -12,7 +12,7 @@
       <a-descriptions>
         <a-descriptions-item label="补货单号">{{ basicInfoData && basicInfoData.replenishBillNo || '--' }}</a-descriptions-item>
         <a-descriptions-item label="创建时间">{{ basicInfoData && basicInfoData.createDate || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="配送方式">{{ basicInfoData && basicInfoData.dispatchTypeDictValue || '--' }}</a-descriptions-item>
+        <!-- <a-descriptions-item label="配送方式">{{ basicInfoData && basicInfoData.dispatchTypeDictValue || '--' }}</a-descriptions-item> -->
       </a-descriptions>
       <div style="padding-bottom: 16px;display: flex;">
         <p style="margin: 0;display: inline-block;flex-shrink: 0;">出库备注:</p>
@@ -46,7 +46,7 @@
             v-model="record.putQty"
             :precision="0"
             :min="0"
-            :max="record.confirmQty"
+            :max="999999"
             placeholder="请输入"
             style="width: 100%" />
           <span v-else>--</span>

+ 2 - 0
src/views/numsGoodsShelves/shelfMonitoring/addModal.vue

@@ -103,6 +103,7 @@ export default {
       const _this = this
       const arr = []
       const arrInd = []
+      this.spinning = true
       this.listData.map((item, index) => {
         if (item.confirmQty) {
           arr.push({
@@ -127,6 +128,7 @@ export default {
         detailList: arr
       }
       shelfRecallSave(params).then(res => {
+        _this.spinning = false
         if (res.status == 200) {
           _this.$emit('ok')
           _this.isShow = false

+ 1 - 1
src/views/numsGoodsShelves/shelfMonitoring/warehouseDetail.vue

@@ -59,7 +59,7 @@
           :defaultLoadData="false"
           bordered>
           <template slot="qty" slot-scope="text, record">
-            {{ (record.bizType == 'PUT_REPLENISH_BILL' || record.bizType == 'MONTH') ? '+' : (record.bizType == 'OUT_RECALL_BILL' || record.bizType == 'OUT_ORDER_BILL') ? '-':'' }}
+            {{ (record.bizType == 'PUT_REPLENISH_BILL' || record.bizType == 'MONTH') ? '+' : (record.bizType == 'OUT_RECALL_BILL' || record.bizType == 'OUT_ORDER_BILL' || record.bizType == 'OUT_STOCK_CHECK') ? '-':'' }}
             {{ (record.qty || record.qty==0) ? record.qty : '--' }}
           </template>
         </s-table>

+ 234 - 0
src/views/numsGoodsShelves/shelfSet/addHwModal.vue

@@ -0,0 +1,234 @@
+<template>
+  <a-modal
+    centered
+    class="shelfSet-newHw-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="modalTit"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="shelfSet-newHw-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol">
+        <a-form-model-item label="货架名称">{{ nowData&&nowData.shelfName || '--' }}</a-form-model-item>
+        <a-form-model-item label="货位号" prop="shelfPlaceCode">
+          <a-input v-model="form.shelfPlaceCode" @input="placeCodeBlur" placeholder="请输入货位号(字母+数字格式)"></a-input>
+        </a-form-model-item>
+        <a-form-model-item label="绑定产品" v-if="type=='add'">
+          <productJqList ref="productJqList" :params="{customerSn:nowData&&nowData.customerSn}" @change="productJqChange"></productJqList>
+        </a-form-model-item>
+        <a-form-model-item label="产品名称" v-if="form.productSn">{{ productName || '--' }}</a-form-model-item>
+        <a-form-model-item v-if="form.productSn" label="销售价" prop="price">
+          <a-input-number
+            id="shelfSet-newHw-price"
+            v-model="form.price"
+            :precision="2"
+            :min="0"
+            :max="999999"
+            placeholder="请输入销售价(最多允许两位小数)"
+            suffix="元"
+            style="width: 80%;display: inline-block;" /> 元
+        </a-form-model-item>
+        <a-form-model-item v-if="form.productSn" label="结算价" prop="cost">
+          <a-input-number
+            id="shelfSet-newHw-cost"
+            v-model="form.cost"
+            :precision="2"
+            :min="0"
+            :max="999999"
+            placeholder="请输入结算价(最多允许两位小数)"
+            style="width: 80%;display: inline-block;" /> 元
+        </a-form-model-item>
+        <a-form-model-item v-if="form.productSn" label="最大库容" prop="maxQty">
+          <a-input-number
+            id="shelfSet-newHw-maxQty"
+            v-model="form.maxQty"
+            :precision="0"
+            :min="0"
+            :max="999999"
+            placeholder="请输入最大库容(正整数或0)"
+            suffix="元"
+            style="width: 100%;display: inline-block;" />
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="shelfSet-newHw-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="shelfSet-newHw-modal-back" @click="isShow=false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import productJqList from '@/views/common/productJqList.vue'
+import { addPlaceAndProduct } from '@/api/shelf'
+export default {
+  name: 'AddHwModal',
+  components: { VSelect, productJqList },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    type: {
+      type: String,
+      default: ''
+    },
+    nowData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        shelfPlaceCode: '',
+        productSn: undefined,
+        productCode: undefined,
+        price: '',
+        cost: '',
+        maxQty: ''
+      },
+      rules: {
+        shelfPlaceCode: [
+          { required: true, message: '请输入货位号', trigger: 'blur' },
+          {
+          	pattern: /^[a-zA-Z]{1}[0-9]{1,29}$/g,
+          	message: '货位号必需字母+数字,且不能超过30个字符'
+          }
+        ],
+        price: [{ required: true, message: '请输入销售价', trigger: 'blur' }],
+        cost: [{ required: true, message: '请输入结算价', trigger: 'blur' }],
+        maxQty: [{ required: true, message: '请输入最大库容', trigger: 'blur' }]
+      },
+      productName: ''
+    }
+  },
+  computed: {
+    modalTit () {
+      let title = ''
+      if (this.type == 'edit') {
+        title = '编辑货位'
+      } else if (this.type == 'add') {
+        title = '新增货位'
+      }
+      return title
+    }
+  },
+  methods: {
+    // 产品 change
+    productJqChange (obj) {
+      this.form.productSn = obj.key || undefined
+      this.form.productCode = obj && obj.row && obj.row.code || ''
+      this.form.price = obj && obj.row && obj.row.price || ''
+      this.form.cost = obj && obj.row && obj.row.cost || ''
+      this.productName = obj && obj.row && obj.row.name || ''
+    },
+    placeCodeBlur (v) {
+    	this.$nextTick(() => {
+    		this.form.shelfPlaceCode = this.form.shelfPlaceCode.toLocaleUpperCase()
+    	})
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = {}
+          const form = JSON.parse(JSON.stringify(_this.form))
+          params.shelfSn = _this.nowData && _this.nowData.shelfSn
+          params.shelfPlaceCode = form.shelfPlaceCode.toLocaleUpperCase()
+          if (this.type == 'edit') {
+            params.id = this.nowData.id
+          }
+          // 绑定了产品
+          if (form.productSn) {
+            params.shelfProductApiEntity = {
+              productSn: form.productSn,
+              productCode: form.productCode,
+              price: form.price,
+              cost: form.cost,
+              maxQty: form.maxQty
+            }
+          }
+          // 开始提交数据
+          _this.spinning = true
+          addPlaceAndProduct(params).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.isShow = false
+              _this.$emit('ok', res.data)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    resetData () {
+      this.form.productSn = undefined
+      this.form.productCode = undefined
+      this.form.price = ''
+      this.form.cost = ''
+      this.form.maxQty = ''
+      if (this.$refs.productJqList) {
+        this.$refs.productJqList.resetForm()
+      }
+      this.$refs.ruleForm.resetFields(['productSn'])
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetData()
+        this.productName = ''
+      } else {
+        if (this.type == 'edit') {
+          this.form.shelfPlaceCode = this.nowData.shelfPlaceCode
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.shelfSet-newHw-modal {
+	.ant-modal-body {
+		padding: 40px 40px 24px;
+	}
+  .ant-form-item{
+    margin-bottom: 15px;
+  }
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 23 - 12
src/views/numsGoodsShelves/shelfSet/basicInfoModal.vue

@@ -9,7 +9,7 @@
     @cancel="isShow = false"
     :width="600">
     <a-spin :spinning="spinning" tip="Loading...">
-      <p style="text-align: center;margin: 0 0 20px;font-size: 14px;font-weight: bold;">{{ nowData && nowData.shelfName || '--' }}</p>
+      <p v-if="type==0" style="text-align: center;margin: 0 0 20px;font-size: 14px;font-weight: bold;">{{ nowData && nowData.shelfName || '--' }}</p>
       <a-form-model
         id="shelfSet-basicInfo-form"
         ref="ruleForm"
@@ -17,6 +17,9 @@
         :rules="rules"
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol">
+        <a-form-model-item label="货架名称" v-if="type==1" prop="shelfName">
+          <a-input v-model="form.shelfName" placeholder="请输入货架名称"></a-input>
+        </a-form-model-item>
         <a-form-model-item prop="customerSn">
           <template slot="label">
             <a-tooltip placement="top">
@@ -57,6 +60,10 @@ export default {
       default: () => {
         return {}
       }
+    },
+    type: {
+      type: [String, Number],
+      default: '1'
     }
   },
   data () {
@@ -68,9 +75,11 @@ export default {
         wrapperCol: { span: 17 }
       },
       form: {
-        customerSn: undefined
+        customerSn: undefined,
+        shelfName: ''
       },
       rules: {
+        shelfName: [{ required: true, message: '请输入货架名称', trigger: 'change' }],
         customerSn: [{ required: true, message: '请选择关联客户', trigger: 'change' }]
       }
     }
@@ -95,7 +104,7 @@ export default {
                 _this.isShow = false
                 _this.$emit('ok', res.data)
                 _this.spinning = false
-              }, 1000)
+              }, 100)
             } else {
               _this.spinning = false
             }
@@ -119,18 +128,20 @@ export default {
         this.$refs.ruleForm.resetFields()
         this.$refs.custList.resetForm()
       } else {
-        if (this.nowData.customerSn) {
-          const _this = this
-          this.$nextTick(() => {
-            _this.form.customerSn = _this.nowData.customerEntity && _this.nowData.customerEntity.customerSn
-            _this.$refs.custList.fetchUser(_this.nowData.customerEntity && _this.nowData.customerEntity.customerName)
+        const _this = this
+        this.$nextTick(() => {
+          _this.form.shelfName = _this.nowData.shelfName
+          const custome = _this.nowData.customerEntity
+          if (custome) {
+            _this.form.customerSn = custome.customerSn || ''
+            _this.$refs.custList.fetchUser(custome.customerName || '')
             _this.$refs.custList.dealerName = {
-              key: _this.nowData.customerEntity && _this.nowData.customerEntity.customerSn,
-              label: _this.nowData.customerEntity && _this.nowData.customerEntity.customerName,
+              key: custome.customerSn,
+              label: custome.customerName,
               row: _this.nowData
             }
-          })
-        }
+          }
+        })
       }
     }
   }

+ 27 - 39
src/views/numsGoodsShelves/shelfSet/bindProductModal.vue

@@ -22,44 +22,29 @@
           {{ productInfo&&productInfo.productCode }}
           <p style="margin: 0;">{{ productInfo&&productInfo.productName || '--' }}</p>
         </a-form-model-item>
-        <a-form-model-item label="绑定产品" prop="productSn" v-if="type == 'bind'">
-          <productJqList ref="productJqList" :params="{customerSn:nowData&&nowData.customerSn}" @change="productJqChange"></productJqList>
-        </a-form-model-item>
-        <a-form-model-item label="新绑定产品" prop="productSn" v-if="type == 'replace'">
+        <a-form-model-item :label="type!='bind'?'新绑定产品':'绑定产品'" prop="productSn" v-if="type!='edit'">
           <productJqList ref="productJqList" :params="{customerSn:nowData&&nowData.customerSn}" @change="productJqChange"></productJqList>
           <span v-if="form.productSn">{{ productName || '--' }}</span>
         </a-form-model-item>
         <a-form-model-item label="销售价" prop="price">
-          <a-row>
-            <a-col :span="20">
-              <a-input-number
-                id="shelfSet-bindProduct-price"
-                v-model="form.price"
-                :precision="2"
-                :min="0.01"
-                :max="999999"
-                placeholder="请输入正数(最多允许两位小数)"
-                suffix="元"
-                style="width: 100%;display: inline-block;" />
-            </a-col>
-            <a-col :span="4"><span style="margin-left: 10px;">元</span></a-col>
-          </a-row>
+          <a-input-number
+            id="shelfSet-bindProduct-price"
+            v-model="form.price"
+            :precision="2"
+            :min="0"
+            :max="999999"
+            placeholder="请输入销售价(最多允许两位小数)"
+            style="width: 80%;display: inline-block;" /> 元
         </a-form-model-item>
         <a-form-model-item label="结算价" prop="cost">
-          <a-row>
-            <a-col :span="20">
-              <a-input-number
-                id="shelfSet-bindProduct-cost"
-                v-model="form.cost"
-                :precision="2"
-                :min="0"
-                :max="999999"
-                placeholder="请输入正数(最多允许两位小数)"
-                suffix="元"
-                style="width: 100%;display: inline-block;" />
-            </a-col>
-            <a-col :span="4"><span style="margin-left: 10px;">元</span></a-col>
-          </a-row>
+          <a-input-number
+            id="shelfSet-bindProduct-cost"
+            v-model="form.cost"
+            :precision="2"
+            :min="0"
+            :max="999999"
+            placeholder="请输入结算价(最多允许两位小数)"
+            style="width: 80%;display: inline-block;" /> 元
         </a-form-model-item>
         <a-form-model-item label="最大库容" prop="maxQty">
           <a-input-number
@@ -123,9 +108,9 @@ export default {
       },
       rules: {
         productSn: [{ required: true, message: '请选择绑定产品', trigger: 'change' }],
-        price: [{ required: true, message: '请输入销售价', trigger: 'blur' }],
-        cost: [{ required: true, message: '请输入结算价', trigger: 'blur' }],
-        maxQty: [{ required: true, message: '请输入最大库容', trigger: 'blur' }]
+        price: [{ required: true, message: '请输入销售价', trigger: 'change' }],
+        cost: [{ required: true, message: '请输入结算价', trigger: 'change' }],
+        maxQty: [{ required: true, message: '请输入最大库容', trigger: 'change' }]
       },
       productName: '',
       productInfo: null
@@ -152,6 +137,7 @@ export default {
       this.form.price = obj && obj.row && obj.row.price || ''
       this.form.cost = obj && obj.row && obj.row.cost || ''
       this.productName = obj && obj.row && obj.row.name || ''
+      this.$refs.ruleForm.validate()
     },
     //  保存
     handleSave () {
@@ -202,6 +188,8 @@ export default {
       })
     },
     resetData () {
+      this.productName = ''
+      this.productInfo = null
       this.form.productSn = undefined
       this.form.productCode = undefined
       this.form.price = ''
@@ -210,7 +198,9 @@ export default {
       if (this.$refs.productJqList) {
         this.$refs.productJqList.resetForm()
       }
-      this.$refs.ruleForm.resetFields(['productSn'])
+      if (this.$refs.ruleForm) {
+        this.$refs.ruleForm.resetFields(['productSn'])
+      }
     }
   },
   watch: {
@@ -221,10 +211,8 @@ export default {
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
       if (!newValue) {
-        this.$emit('close')
         this.resetData()
-        this.productName = ''
-        this.productInfo = null
+        this.$emit('close')
       } else {
         if (this.type != 'bind') { // 修改信息、更换产品
           this.getProductInfo()

+ 206 - 0
src/views/numsGoodsShelves/shelfSet/chooseShelfImportModal.vue

@@ -0,0 +1,206 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="确认导入货位"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="900">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.allocateSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :disabled="disabled"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          :disabled="disabled"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+        <a-button
+          type="primary"
+          id="chooseImport-error"
+          size="large"
+          :disabled="disabled"
+          class="button-error"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { hdExportExcel } from '@/libs/exportExcel'
+import { shelfPlaceReadExcel, shelfSaveBatchExcel, shelfPlaceFailExcel } from '@/api/shelf'
+export default {
+  name: 'ChooseImportModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      nowColumns: [
+        { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '45%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结算价', dataIndex: 'cost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      loadData: [],
+      nowUnColumns: [
+        { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结算价', dataIndex: 'cost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '错误原因', dataIndex: 'remarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      unLoadData: [],
+      loading: false,
+      disabled: false
+    }
+  },
+  methods: {
+    getData () {
+      const _this = this
+      this.loading = true
+      const params = {
+        shelfSn: this.paramsData.shelfSn,
+        path: this.paramsData.path
+      }
+      this.disabled = true
+      shelfPlaceReadExcel(params).then(res => {
+        this.loading = false
+        this.disabled = false
+        if (res.status == 200) {
+          if (res.data.successList && res.data.successList.length > 0) {
+            res.data.successList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          if (res.data.failList && res.data.failList.length > 0) {
+            res.data.failList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          _this.loadData = res.data.successList || []
+          _this.unLoadData = res.data.failList || []
+        }
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.loadData.length == 0) {
+        this.$message.warning('无可导入产品!')
+      } else {
+        this.disabled = true
+        shelfSaveBatchExcel(this.loadData).then(res => {
+          if (res.status == 200) {
+            this.$emit('ok', this.loadData)
+            this.isShow = false
+          }
+          this.disabled = false
+        })
+      }
+    },
+    // 导出
+    handleError () {
+      const _this = this
+      if (_this.unLoadData.length < 1) {
+        _this.$message.info('暂无可导出错误项~')
+        return
+      }
+      _this.disabled = true
+      hdExportExcel(shelfPlaceFailExcel, _this.unLoadData, '货位绑定产品错误项导出', function () {
+        _this.disabled = false
+      }, true)
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 198 - 0
src/views/numsGoodsShelves/shelfSet/importHuoweiModal.vue

@@ -0,0 +1,198 @@
+<template>
+  <a-modal
+    centered
+    class="importHuoweiModal-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="批量导入货位"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="750">
+    <div class="importHuoweiModal-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>下载导入模板
+            <p>请按照下载的Excel模板填写数据</p>
+            <a :href="filePath" style="padding: 5px 0 0 23px;display: block;">
+              <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+            </a>
+          </div>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>准备导入数据
+          </div>
+          <ul>
+            <li>1) 导入的Excel文件中必须包含名为“货位号”、“产品编码”、“销售价”、“结算价”、“最大库容”的列,且名称必须相同,其他列可自定义,不影响数据导入。</li>
+            <li>2) 如果“产品编码”列为空,则表示此货位暂时不绑定产品,也可以正常导入货位。</li>
+            <li>3) 当“销售价”和“结算价”都为空,系统会自动取该产品的车主价和终端会员价,作为销售价和结算价。</li>
+            <li>4) 如果货位已经绑定产品,则不会导入该行。</li>
+          </ul>
+
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>3</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importHuoweiModal-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="import"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="添加文件"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importHuoweiModal-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importHuoweiModal-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseShelfImportModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'ImportHuoweiModalModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    shelfSn: {
+      type: [String, Number],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      filePath: 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/template/importProductToShelfTpl.xlsx', // 文件地址
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      }
+    }
+  },
+  methods: {
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      if (file) {
+        this.paramsData = {
+          shelfSn: this.shelfSn || '',
+          path: file
+        }
+        console.log(this.paramsData, 'this.paramsData')
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paramsData = null
+        this.$refs.importUpload.setFileList('')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importHuoweiModal-modal{
+    .importHuoweiModal-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importHuoweiModal-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 1 - 1
src/views/numsGoodsShelves/shelfSet/list.vue

@@ -77,7 +77,7 @@
       </s-table>
     </a-spin>
     <!-- 基础设置 -->
-    <basic-info-modal :openModal="openModal" :nowData="nowData" @ok="handleOk" @close="openModal=false" />
+    <basic-info-modal :type="0" :openModal="openModal" :nowData="nowData" @ok="handleOk" @close="openModal=false" />
   </a-card>
 </template>
 

+ 75 - 18
src/views/numsGoodsShelves/shelfSet/set.vue

@@ -5,7 +5,7 @@
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
           <a id="shelfSet-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-          <span class="store-info">{{ (basicInfoData&&basicInfoData.shelfName) || '--' }}</span>
+          <span class="store-info">货架名称:{{ basicInfoData&&basicInfoData.shelfName || '--' }}</span>
         </template>
       </a-page-header>
       <!-- 内容 -->
@@ -14,9 +14,9 @@
           <a-collapse-panel key="1">
             <template slot="header">
               <span>基础信息</span>
-              <a-button icon="edit" size="small" type="link" style="margin-left: 20px;color: #39f;" @click.stop="handleInfoEdit">编辑</a-button>
+              <a-button icon="edit" size="small" type="link" style="margin-left: 20px;color: #39f;" @click.stop="openInfoModal = true">编辑</a-button>
             </template>
-            <a-descriptions :column="3">
+            <a-descriptions :column="1">
               <a-descriptions-item label="关联客户">{{ (basicInfoData&&basicInfoData.customerEntity&&basicInfoData.customerEntity.customerName) || '--' }}</a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
@@ -48,6 +48,8 @@
         </div>
         <!-- 操作按钮 -->
         <div class="table-operator">
+          <a-button id="shelfSet-addHW" type="primary" class="button-error" @click="addHW(1)">新增货位</a-button>
+          <a-button id="shelfSet-impoort" type="primary" class="button-info" @click="addHW(0)">批量导入货位</a-button>
           <a-button id="shelfSet-import" type="primary" class="button-error" @click="openGuideModal=true">导入绑定产品</a-button>
           <a-tooltip placement="top">
             <template slot="title">
@@ -73,29 +75,39 @@
               size="small"
               type="link"
               class="button-primary"
-              v-if="!!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
-              @click="handleProduct(record, 'edit')"
-              id="shelfMonitoringList-edit-btn">修改信息</a-button>
+              v-if="!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
+              @click="handleProduct(record, 'bind')"
+            >绑定产品</a-button>
             <a-button
               size="small"
               type="link"
               class="button-primary"
-              v-if="!!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
+              v-else
               @click="handleReplace(record)"
-              id="shelfMonitoringList-replace-btn">更换产品</a-button>
+            >更换产品</a-button>
             <a-button
               size="small"
               type="link"
               class="button-primary"
+              @click="editHW(record)"
+            >编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-error"
               v-if="!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
-              @click="handleProduct(record, 'bind')"
-              id="shelfMonitoringList-bind-btn">绑定产品</a-button>
+              @click="handleDel(record)"
+            >删除</a-button>
           </template>
         </s-table>
       </a-card>
     </a-spin>
+    <!-- 基础设置 -->
+    <basic-info-modal :openModal="openInfoModal" :nowData="basicInfoData" @ok="handleInfoOk" @close="openInfoModal=false" />
     <!-- 修改信息/绑定产品/更换产品 -->
     <bind-product-modal :openModal="openModal" :type="modalType" :nowData="nowData" @ok="$refs.table.refresh()" @close="handleCancel" />
+    <!-- 编辑、新增货位 -->
+    <addHwModal :openModal="openHwModal" :type="modalType" :nowData="nowData" @ok="$refs.table.refresh()" @close="handleCancel" />
     <!-- 更换产品 -->
     <common-modal
       :openModal="openTipsModal"
@@ -106,8 +118,8 @@
       @close="openTipsModal=false" />
     <!-- 导入产品 -->
     <importGuideModal :openModal="openGuideModal" :params="{shelfSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" />
-    <!-- 基础设置 -->
-    <basic-info-modal :openModal="openInfoModal" :nowData="basicInfoData" @ok="handleInfoOk" @close="openInfoModal=false" />
+    <!-- 导入货位模板 -->
+    <importHuoweiModal :openModal="openImportModal" @close="openImportModal=false" @ok="$refs.table.refresh(true)" :shelfSn="$route.params.sn"></importHuoweiModal>
   </div>
 </template>
 
@@ -115,13 +127,15 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import commonModal from '@/views/common/commonModal.vue'
+import addHwModal from './addHwModal.vue'
 import bindProductModal from './bindProductModal.vue'
 import ImportGuideModal from './importGuideModal.vue'
 import basicInfoModal from './basicInfoModal.vue'
-import { shelfDetail, shelfProductList, shelfProductBatchInsert } from '@/api/shelf'
+import importHuoweiModal from './importHuoweiModal.vue'
+import { shelfDetail, shelfProductList, shelfProductBatchInsert, delShelfPlaceSn } from '@/api/shelf'
 export default {
   name: 'ShelfMonitoringWarehousing',
-  components: { STable, VSelect, commonModal, bindProductModal, ImportGuideModal, basicInfoModal },
+  components: { STable, VSelect, commonModal, bindProductModal, addHwModal, ImportGuideModal, basicInfoModal, importHuoweiModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -167,13 +181,35 @@ export default {
       nowData: null,
       openGuideModal: false,
       modalType: null,
-      openInfoModal: false
+      openInfoModal: false,
+      openHwModal: false,
+      openImportModal: false
     }
   },
   methods: {
-    // 编辑基本信息
-    handleInfoEdit () {
-      this.openInfoModal = true
+    // 导入或新增货位
+    addHW (type) {
+      // 导入货位
+      if (type == 0) {
+        this.openImportModal = true
+      } else {
+        // 新增货位
+        this.nowData = this.basicInfoData
+        this.modalType = 'add'
+        this.openHwModal = true
+      }
+    },
+    // 编辑货位
+    editHW (row) {
+      // 已绑定产品,不能编辑货位号,只能编辑已绑定产品的销售价、结算价、最大库容
+      if (row.shelfProductApiEntity && row.shelfProductApiEntity.productSn) {
+        this.handleProduct(row, 'edit')
+      } else {
+        // 货位没有绑定产品,仅编辑货位号
+        this.nowData = Object.assign(this.basicInfoData, row)
+        this.modalType = 'edit'
+        this.openHwModal = true
+      }
     },
     // 基本信息
     getDetail () {
@@ -185,6 +221,25 @@ export default {
         }
       })
     },
+    // 删除货位
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '删除后无法恢复,确认删除?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          delShelfPlaceSn({ shelfPlaceSn: row.shelfPlaceSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
     // 更换产品
     handleReplace (row) {
       if (row.shelfProductApiEntity.qty) {
@@ -204,8 +259,10 @@ export default {
       this.openModal = true
     },
     handleCancel () {
+      this.modalType = null
       this.nowData = null
       this.openModal = false
+      this.openHwModal = false
     },
     // 导入成功
     handleGuideOk (obj) {

+ 3 - 0
src/views/purchasingManagement/purchaseOrder/list.vue

@@ -250,6 +250,9 @@ export default {
       const ind = this.supplierList.findIndex(item => item.purchaseTargetSn == val)
       if (ind != -1) {
         this.queryParam.purchaseTargetType = this.supplierList[ind].purchaseTargetType
+      } else {
+        this.queryParam.purchaseTargetSn = undefined
+        this.queryParam.purchaseTargetType = undefined
       }
     },
     //  时间  change

+ 2 - 2
src/views/purchasingManagement/purchaseReturnApplyForm/chooseImportModal.vue

@@ -154,9 +154,9 @@ export default {
         return
       }
       _this.spinning = true
-      hdExportExcel(exportErrorExcel, _this.unLoadData, '采购退货申请单导出错误项', function () {
+      hdExportExcel(exportErrorExcel, _this.unLoadData, '采购退货申请单错误项导出', function () {
         _this.spinning = false
-      })
+      }, true)
     }
   },
   watch: {

+ 2 - 2
vue.config.js

@@ -211,8 +211,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.0.182:8503/qpls-md',
-        // target: 'http://p.iscm.360arrow.com/qpls-md',
+        // target: 'http://192.168.0.182:8503/qpls-md',
+        target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,
         changeOrigin: true,