浏览代码

Merge branch 'develop_szhj07' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into pre-release

# Conflicts:
#	public/version.json
#	src/views/numsGoodsShelves/replenishmentManagement/outWarehousingModal.vue
lilei 2 年之前
父节点
当前提交
fee6faaa2b
共有 40 个文件被更改,包括 2506 次插入325 次删除
  1. 1 1
      public/version.json
  2. 8 0
      src/api/salesDetail.js
  3. 33 0
      src/api/shelf.js
  4. 9 0
      src/api/shelfRecall.js
  5. 40 0
      src/api/shelfReplenish.js
  6. 5 4
      src/components/index.less
  7. 1 1
      src/layouts/BasicLayout.vue
  8. 1 0
      src/store/getters.js
  9. 1 1
      src/store/modules/app.js
  10. 3 2
      src/views/Home.vue
  11. 5 2
      src/views/common/commonModal.vue
  12. 1 0
      src/views/common/outInDetialModal.vue
  13. 10 39
      src/views/common/returnReason.js
  14. 55 50
      src/views/inventoryManagement/inventoryChecking/selfDisk.vue
  15. 1 1
      src/views/notice/detailModal.vue
  16. 1 1
      src/views/notice/list.vue
  17. 409 0
      src/views/numsGoodsShelves/recallManagement/addRecallBillModal.vue
  18. 131 0
      src/views/numsGoodsShelves/recallManagement/basicInfoModal.vue
  19. 308 0
      src/views/numsGoodsShelves/recallManagement/detailModal.vue
  20. 37 3
      src/views/numsGoodsShelves/recallManagement/list.vue
  21. 6 1
      src/views/numsGoodsShelves/recallManagement/recallModal.vue
  22. 32 8
      src/views/numsGoodsShelves/recallStockManagement/editStock.vue
  23. 216 64
      src/views/numsGoodsShelves/replenishmentManagement/creatReplenishmentOrder.vue
  24. 260 0
      src/views/numsGoodsShelves/replenishmentManagement/detailModal.vue
  25. 104 47
      src/views/numsGoodsShelves/replenishmentManagement/list.vue
  26. 20 14
      src/views/numsGoodsShelves/replenishmentManagement/outWarehousingModal.vue
  27. 7 10
      src/views/numsGoodsShelves/replenishmentManagement/printStickerModal.vue
  28. 3 4
      src/views/numsGoodsShelves/replenishmentManagement/putWarehousingModal.vue
  29. 168 0
      src/views/numsGoodsShelves/replenishmentManagement/slodOutModal.vue
  30. 9 7
      src/views/numsGoodsShelves/shelfMonitoring/addModal.vue
  31. 31 2
      src/views/numsGoodsShelves/shelfMonitoring/list.vue
  32. 7 1
      src/views/numsGoodsShelves/shelfSet/addHwModal.vue
  33. 6 0
      src/views/numsGoodsShelves/shelfSet/bindProductModal.vue
  34. 11 3
      src/views/salesManagement/salesQuery/chooseCustomModal.vue
  35. 433 0
      src/views/salesManagement/salesQuery/chooseShelfProduct.vue
  36. 3 3
      src/views/salesManagement/salesQuery/detail.vue
  37. 80 18
      src/views/salesManagement/salesQuery/edit.vue
  38. 26 15
      src/views/salesManagement/salesQuery/list.vue
  39. 23 22
      src/views/salesManagement/salesReturn/list.vue
  40. 1 1
      vue.config.js

+ 1 - 1
public/version.json

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

+ 8 - 0
src/api/salesDetail.js

@@ -19,6 +19,14 @@ export const salesDetailInsert = (params) => {
     method: 'post'
   })
 }
+// 批量新增
+export const salesDetailInsertBatch = (params) => {
+  return axios({
+    url: '/salesDetail/insertBatch',
+    data: params,
+    method: 'post'
+  })
+}
 //  销售详情 修改价格
 export const salesDetailUpdatePrice = (params) => {
   return axios({

+ 33 - 0
src/api/shelf.js

@@ -19,6 +19,30 @@ export const shelfDetail = (params) => {
     method: 'post'
   })
 }
+// 查询客户关联的货架
+export const queryByCustomerSn = (params) => {
+  return axios({
+    url: `/shelf/queryByCustomerSn/${params.sn}`,
+    data: params,
+    method: 'post'
+  })
+}
+//待补货产品列表
+export const queryListForReplenish = (params) => {
+  return axios({
+    url: `/shelf/queryListForReplenish`,
+    data: params,
+    method: 'post'
+  })
+}
+// 补货产品明细
+export const queryProductListForReplenish = (params) => {
+  return axios({
+    url: `/shelf/queryProductListForReplenish `,
+    data: params,
+    method: 'post'
+  })
+}
 //  货架  保存
 export const shelfSave = (params) => {
   return axios({
@@ -146,6 +170,15 @@ export const shelfPutOutDetailList = (params) => {
     method: 'post'
   })
 }
+// 货架监控 导出
+export const exportShelfControlReport = (params) => {
+  return axios({
+    url: `/shelf/control/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
 
 // 修改完成标识
 export const modifFinishFlag = (params) => {

+ 9 - 0
src/api/shelfRecall.js

@@ -68,6 +68,15 @@ export const shelfRecallDetail = params => {
   })
 }
 
+// 生成销售退货单
+export const generateSaleReturnBill = params => {
+  return axios({
+    url: `/shelfRecall/generateSaleReturnBill`,
+    data: params,
+    method: 'post'
+  })
+}
+
 // 调回入库列表
 export const recallStockList = (params) => {
   const url = `/shelfRecall/queryStockPutPage/${params.pageNo}/${params.pageSize}`

+ 40 - 0
src/api/shelfReplenish.js

@@ -34,6 +34,14 @@ export const shelfReplenishDetailList = (params) => {
     method: 'post'
   })
 }
+// 保存补货单和明细
+export const saveMainAndDetail = (params) => {
+  return axios({
+    url: '/shelfReplenish/saveMainAndDetail',
+    data: params,
+    method: 'post'
+  })
+}
 // 出库单详情列表
 export const queryListForOutStock = (params) => {
   return axios({
@@ -42,6 +50,21 @@ export const queryListForOutStock = (params) => {
     method: 'post'
   })
 }
+// 查询关联的销售单
+export const queryRelationSalesBill = (params) => {
+  return axios({
+    url: `/shelfReplenish/queryRelationSalesBill/${params.replenishBillSn}`,
+    method: 'get'
+  })
+}
+// 生成销售单
+export const createSalesBill = (params) => {
+  return axios({
+    url: `/shelfReplenish/createSalesBill/${params.replenishBillSn}`,
+    data: params,
+    method: 'post'
+  })
+}
 //  补货单 取消补货单
 export const shelfReplenishCancel = (params) => {
   return axios({
@@ -124,3 +147,20 @@ export const shelfReplenishTaskInsertBill = (params) => {
     method: 'post'
   })
 }
+
+// 待补货产品 
+export const queryWaitReplenish = (params) => {
+  return axios({
+    url: '/shelfProduct/queryWaitReplenish',
+    data: params,
+    method: 'post'
+  })
+}
+// 货架产品
+export const queryShelfProduct = (params) => {
+  return axios({
+    url: '/shelfProduct/queryShelfProduct',
+    data: params,
+    method: 'post'
+  })
+}

+ 5 - 4
src/components/index.less

@@ -396,7 +396,7 @@
   }
   .ant-table-row{
     td{
-      > div:empty::after{
+      > div:not(.ant-table-row-expand-icon):empty::after{
         content: '--';
       }
       .ant-select-search__field__mirror{
@@ -408,7 +408,7 @@
     margin: 0;
     tr:hover{
       td{
-        > div:empty::after{
+        > div:not(.ant-table-row-expand-icon):empty::after{
           content: '--';
         }
       }
@@ -430,7 +430,7 @@
         }
       }
     }
-    td > div:empty{
+    td > div:not(.ant-table-row-expand-icon):empty{
       &::after{
         content:'--'
       }
@@ -456,9 +456,10 @@
 .ant-alert-message, .ant-card-head{
   color: #000000!important;
 }
-.ant-input-number-disabled,.ant-input-disabled,.ant-select-disabled .ant-select-selection,.ant-input[disabled]{
+.ant-input-number-disabled,.ant-input-disabled,.ant-select-disabled .ant-select-selection,.ant-input[disabled],.ant-input-number input[readonly]{
   background-color: #F8F8F8!important;
   color: #333!important;
+  cursor: not-allowed;
 }
 .ant-cascader-picker-disabled .ant-cascader-picker-label{
   color: #333!important;

+ 1 - 1
src/layouts/BasicLayout.vue

@@ -374,7 +374,7 @@ export default {
       }
       // 补货订单
       if (data.notice.extInfo.bizType == 'SHELF_REPLENISH') {
-        this.$router.push({ name: 'replenishmentManagement', query: { bizType: 'WAIT_CONFIRM' } })
+        this.$router.push({ name: 'replenishmentManagement', query: { bizType: 'ALL' } })
       }
       // 货架订单
       if (data.notice.extInfo.bizType == 'SHELF_ORDER') {

+ 1 - 0
src/store/getters.js

@@ -27,6 +27,7 @@ const getters = {
   printDefInk:state => state.app.printDefInk,
   printUseing:state => state.app.printUseing,
   printSettingType:state => state.app.printSettingType,
+  returnReason: state => state.app.returnReason
 }
 
 export default getters

+ 1 - 1
src/store/modules/app.js

@@ -246,7 +246,7 @@ const app = {
     SetWinHeight ({ commit }, val) {
       commit('SET_WIN_HEIGHT', val)
     },
-    getLookUpData({ commit }, code, isEnable) {
+    getReturnReasonData({ commit }, code, isEnable) {
       getLookUpData({
         pageNo: 1,
         pageSize: 1000,

+ 3 - 2
src/views/Home.vue

@@ -787,9 +787,8 @@ export default {
     }
   },
   methods: {
-    ...mapActions(['getLookUpData']),
+    ...mapActions(['getReturnReasonData']),
     hasNewProduct () {
-      this.getLookUpData('RETURN_REASON')
       queryNewProductPage({ pageNo: 1, pageSize: 20, onlineFalg: this.onlineFalg }).then(res => {
         if (res.status == 200) {
           if (res.data.count > 0) {
@@ -901,6 +900,8 @@ export default {
       } else {
         vm.openResetPwd = true
       }
+      // 退货原因列表
+      vm.getReturnReasonData('RETURN_REASON')
     })
   }
 }

+ 5 - 2
src/views/common/commonModal.vue

@@ -13,7 +13,7 @@
       <div class="common-main" v-html="modalHtml"></div>
       <slot></slot>
       <div class="btn-box">
-        <a-button type="primary" class="button-warning" @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
+        <a-button type="default" class="button-warning" @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
         <a-button type="primary" class="button-info" @click="handleCommonOk">{{ okText }}</a-button>
       </div>
     </a-spin>
@@ -107,7 +107,10 @@ export default {
     }
     .btn-box{
       text-align: center;
-      margin-top: 20px;
+      margin-top: 40px;
+      button{
+        margin: 0 10px;
+      }
     }
   }
 </style>

+ 1 - 0
src/views/common/outInDetialModal.vue

@@ -7,6 +7,7 @@
     title="出库明细"
     v-model="isShow"
     @cancel="isShow = false"
+    :zIndex="1010"
     :width="1024">
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="baseInfo" v-if="baseData">

+ 10 - 39
src/views/common/returnReason.js

@@ -17,8 +17,8 @@ const ReturnReason = {
             @select="open=false"
             :open="open"
           >
-            <a-select-option v-for="item in list" :key="item" :value="item">
-              {{item}}
+            <a-select-option v-for="item in list" :key="item.code" :value="item.dispName">
+              {{item.dispName}}
             </a-select-option>
           </a-select>
     `,
@@ -33,7 +33,7 @@ const ReturnReason = {
     },
     placeholder: {
       type: String,
-      default: '请输入退货原因'
+      default: '请输入退货原因(最多50字符)'
     },
     size: {
       type: String,
@@ -44,41 +44,11 @@ const ReturnReason = {
     return {
       defaultVal: this.value,
       open: false,
-      list: [
-        '漏油或者不上油',
-        '外观不良:脏污、破损、脱胶、变形等',
-        '尺寸问题',
-        '泄压',
-        '无法安装',
-        '无法或不便安装',
-        '抖动或跳动',
-        '噪音',
-        '刮雨不干净',
-        '胶条断裂、脱落',
-        '喇叭无声',
-        '声音嘶哑或者变音',
-        '浸水',
-        '伤盘',
-        '摩擦块掉渣,脱落或有残渣',
-        '制动不足,刹车不灵敏',
-        '不耐磨',
-        '冒烟',
-        '缺少感应线',
-        '尺寸不标准',
-        '不点火,间歇式失火',
-        '漏电',
-        '击穿',
-        '烧蚀',
-        '包装型号不符',
-        '整体不亮/部分能亮',
-        '灯珠脱落',
-        '漏电短路',
-        '包装型号不符/包装破损',
-        '召回'
-        ]
+      list: []
     };
   },
   mounted() {
+    this.list = this.$store.state.app.returnReason
   },
   watch: {
     value(newValue, oldValue) {
@@ -92,11 +62,12 @@ const ReturnReason = {
       );
     },
     onChange(value) {
-      console.log('onChange', value);
+      console.log(value,'----')
       this.open = true;
-      this.defaultVal = value;
-      this.$emit('change', value);
-      this.$emit('input', value);
+      const ret = value?value.substr(0,50):''
+      this.defaultVal = ret;
+      this.$emit('change', ret);
+      this.$emit('input', ret);
     },
     onBlur(value){
       this.open = false;

+ 55 - 50
src/views/inventoryManagement/inventoryChecking/selfDisk.vue

@@ -28,58 +28,56 @@
         <!-- 筛选条件 -->
         <div class="table-page-search-wrapper">
           <a-row>
-            <a-col :md="2" :sm="24" style="text-align: left;">
-              <a-button size="small" type="primary" class="button-info" @click.stop="handleBatchAdd('batch')" id="chainTransferOutEdit-del-all-btn">批量添加</a-button>
-            </a-col>
-            <a-col :md="20" :sm="24">
+            <a-col>
               <a-form layout="inline" @keyup.enter.native="searchForm">
                 <a-row :gutter="15">
-                  <a-col :md="6" :sm="24">
+                  <a-col :md="4" :sm="16">
                     <a-form-item label="产品编码" prop="productCode">
                       <a-input id="inventoryCheckSelfDiskList-productCode" v-model.trim="queryParam.productCode" placeholder="请输入" allowClear />
                     </a-form-item>
                   </a-col>
-                  <a-col :md="6" :sm="24">
+                  <a-col :md="4" :sm="16">
                     <a-form-item label="产品名称" prop="productName">
                       <a-input id="inventoryCheckSelfDiskList-productName" v-model.trim="queryParam.productName" placeholder="请输入" allowClear />
                     </a-form-item>
                   </a-col>
-                  <a-col :md="6" :sm="24">
+                  <a-col :md="4" :sm="16">
                     <a-form-item label="产品品牌">
                       <ProductBrand id="inventoryCheckSelfDiskList-productBrand" sysFlag="" v-model="queryParam.brandSn"></ProductBrand>
                     </a-form-item>
                   </a-col>
-                  <template v-if="advanced">
-                    <a-col :md="6" :sm="24">
-                      <a-form-item label="产品分类">
-                        <ProductType id="inventoryCheckSelfDiskList-productType" @change="changeProductType" v-model="productType"></ProductType>
-                      </a-form-item>
-                    </a-col>
-                    <a-col :md="6" :sm="24" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
-                      <a-form-item label="仓库">
-                        <a-select id="inventoryCheckSelfDiskList-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
-                          <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-item>
-                    </a-col>
-                  </template>
-                  <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                  <a-col :md="4" :sm="16">
+                    <a-form-item label="产品分类">
+                      <ProductType id="inventoryCheckSelfDiskList-productType" @change="changeProductType" v-model="productType"></ProductType>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="4" :sm="16" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
+                    <a-form-item label="仓库">
+                      <a-select id="inventoryCheckSelfDiskList-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
+                        <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="3" :sm="12">
+                    <a-form-item label="">
+                      <a-checkbox @change="onlySeeStock" :checked="showChecked">只查看有库存</a-checkbox>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="4" :sm="16" style="margin-bottom: 10px;">
                     <a-button type="primary" @click="searchForm" :disabled="disabled" id="inventoryCheckSelfDiskList-refresh">查询</a-button>
                     <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckSelfDiskList-reset">重置</a-button>
-                    <a @click="advanced=!advanced" style="margin-left: 5px">
-                      {{ advanced ? '收起' : '展开' }}
-                      <a-icon :type="advanced ? 'up' : 'down'"/>
-                    </a>
                   </a-col>
                 </a-row>
               </a-form>
             </a-col>
-            <a-col :md="2" :sm="24" style="text-align: right;">
+            <a-col :md="19"></a-col>
+            <a-col :md="5" :sm="20" style="margin-bottom: 10px;text-align: right;">
+              <a-button size="small" type="primary" class="button-info" @click.stop="handleBatchAdd('batch')" id="chainTransferOutEdit-del-all-btn">批量添加</a-button>
               <a-button
                 size="small"
                 type="primary"
                 class="button-info"
-                style="margin-left: 5px"
+                style="margin: 0px"
                 @click.stop="handleBatchAdd('all')"
                 id="chainTransferOutEdit-del-all-btn">全部添加</a-button>
             </a-col>
@@ -124,42 +122,40 @@
             <a-col :md="24" :sm="24">
               <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
                 <a-row :gutter="15">
-                  <a-col :md="6" :sm="24">
+                  <a-col :md="5" :sm="20">
                     <a-form-item label="产品编码" prop="productCode">
                       <a-input id="inventoryCheckSelfDiskList-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入" allowClear />
                     </a-form-item>
                   </a-col>
-                  <a-col :md="6" :sm="24">
+                  <a-col :md="5" :sm="20">
                     <a-form-item label="产品名称" prop="productName">
                       <a-input id="inventoryCheckSelfDiskList-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入" allowClear />
                     </a-form-item>
                   </a-col>
-                  <a-col :md="6" :sm="24">
+                  <a-col :md="5" :sm="20">
                     <a-form-item label="产品品牌">
                       <ProductBrand id="inventoryCheckSelfDiskList-productBrand" sysFlag="" v-model="chooseQueryParam.brandSn"></ProductBrand>
                     </a-form-item>
                   </a-col>
-                  <template v-if="chooseAdvanced">
-                    <a-col :md="6" :sm="24">
-                      <a-form-item label="产品分类">
-                        <ProductType id="inventoryCheckSelfDiskList-productType" @change="changeChooseProductType" v-model="chooseProductType"></ProductType>
-                      </a-form-item>
-                    </a-col>
-                    <a-col :md="6" :sm="24" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
-                      <a-form-item label="仓库">
-                        <a-select id="inventoryCheckSelfDiskList-warehouseSn" allowClear placeholder="请选择仓库" v-model="chooseQueryParam.warehouseSn" >
-                          <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-item>
-                    </a-col>
-                  </template>
-                  <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                  <a-col :md="5" :sm="20">
+                    <a-form-item label="产品分类">
+                      <ProductType id="inventoryCheckSelfDiskList-productType" @change="changeChooseProductType" v-model="chooseProductType"></ProductType>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="5" :sm="20" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
+                    <a-form-item label="仓库">
+                      <a-select id="inventoryCheckSelfDiskList-warehouseSn" allowClear placeholder="请选择仓库" v-model="chooseQueryParam.warehouseSn" >
+                        <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="4" :sm="16" style="margin-bottom: 10px;text-align: center;">
                     <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="inventoryCheckSelfDiskList-refresh">查询</a-button>
                     <a-button style="margin-left: 5px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="inventoryCheckSelfDiskList-reset">重置</a-button>
-                    <a @click="chooseAdvanced=!chooseAdvanced" style="margin-left: 5px">
+                    <!-- <a @click="chooseAdvanced=!chooseAdvanced" style="margin-left: 5px">
                       {{ chooseAdvanced ? '收起' : '展开' }}
                       <a-icon :type="chooseAdvanced ? 'up' : 'down'"/>
-                    </a>
+                    </a> -->
                   </a-col>
                 </a-row>
               </a-form>
@@ -168,7 +164,6 @@
         </div>
         <a-row>
           <a-col :md="20" :sm="16">
-            <a-button size="small" type="primary" class="button-error" @click.stop="handleDel('', 'batch')" id="chainTransferOutEdit-del-all-btn">批量删除</a-button>
             <!-- 总计 -->
             <a-alert type="info" style="margin-bottom:10px;display: inline-block;">
               <div slot="message">
@@ -181,6 +176,7 @@
             </a-alert>
           </a-col>
           <a-col :md="4" :sm="8" style="text-align: right;">
+            <a-button size="small" type="primary" class="button-error" @click.stop="handleDel('', 'batch')" id="chainTransferOutEdit-del-all-btn">批量删除</a-button>
             <a-button
               size="small"
               type="primary"
@@ -253,10 +249,12 @@ export default {
         brandSn: undefined,
         productTypeSn1: undefined,
         productTypeSn2: undefined,
-        productTypeSn3: undefined
+        productTypeSn3: undefined,
+        existStockFlag: undefined
       },
       basicInfoData: null, // 基础信息
       productTotal: null,
+      showChecked: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -364,6 +362,8 @@ export default {
       this.queryParam.productTypeSn2 = undefined
       this.queryParam.productTypeSn3 = undefined
       this.productType = []
+      this.queryParam.existStockFlag = null
+      this.showChecked = false
       this.$refs.table.refresh(true)
     },
     //  添加
@@ -575,6 +575,11 @@ export default {
           }
         }
       }
+    },
+    // 只查看有库存
+    onlySeeStock (e) {
+      this.showChecked = e.target.checked
+      this.queryParam.existStockFlag = e.target.checked ? 1 : null
     }
   },
   mounted () {

+ 1 - 1
src/views/notice/detailModal.vue

@@ -139,7 +139,7 @@ export default {
       }
       // 补货订单
       if (this.detailsData.extInfo.bizType == 'SHELF_REPLENISH') {
-        this.$router.push({ name: 'replenishmentManagement', query: { bizType: 'WAIT_CONFIRM' } })
+        this.$router.push({ name: 'replenishmentManagement', query: { bizType: 'ALL' } })
       }
       // 货架订单
       if (this.detailsData.extInfo.bizType == 'SHELF_ORDER') {

+ 1 - 1
src/views/notice/list.vue

@@ -192,7 +192,7 @@ export default {
       }
       // 补货订单
       if (data.notice.extInfo.bizType == 'SHELF_REPLENISH') {
-        this.$router.push({ name: 'replenishmentManagement', query: { bizType: 'WAIT_CONFIRM' } })
+        this.$router.push({ name: 'replenishmentManagement', query: { bizType: 'ALL' } })
       }
       // 货架订单
       if (data.notice.extInfo.bizType == 'SHELF_ORDER') {

+ 409 - 0
src/views/numsGoodsShelves/recallManagement/addRecallBillModal.vue

@@ -0,0 +1,409 @@
+<template>
+  <a-modal
+    centered
+    class="shelfSet-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="'新增调回单——'+recallBillInfo.shelfName"
+    v-model="isShow"
+    @cancel="isShow = false"
+    width="60%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model id="shelfSet-basicInfo-form" ref="ruleForm" :model="queryParam" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+        <a-row :gutter="10">
+          <a-col :md="8" :sm="24">
+            <a-form-model-item label="产品编码"><a-input allowClear placeholder="请输入产品编码" v-model.tirm="queryParam.productCode" /></a-form-model-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-item label="产品名称"><a-input allowClear placeholder="请输入产品名称" v-model.tirm="queryParam.productName" /></a-form-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-model-item label="滞销天数">
+              <a-input-group>
+                <a-row>
+                  <a-col :md="11" :sm="24">
+                    <a-input-number
+                      id="shelfMonitoringList-minUnsalableDays"
+                      v-model="queryParam.unsalableDaysBegin"
+                      :precision="0"
+                      :min="0"
+                      :max="999999"
+                      placeholder="起始天数"
+                      style="width: 100%;display: inline-block;"
+                    />
+                  </a-col>
+                  <a-col :md="2" :sm="24"><span style="display: block;text-align: center;line-height: 32px;">至</span></a-col>
+                  <a-col :md="11" :sm="24">
+                    <a-input-number
+                      id="shelfMonitoringList-maxUnsalableDays"
+                      v-model="queryParam.unsalableDaysEnd"
+                      :precision="0"
+                      :min="0"
+                      :max="999999"
+                      placeholder="截止天数"
+                      style="width: 100%;display: inline-block;"
+                    />
+                  </a-col>
+                </a-row>
+              </a-input-group>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24" style="text-align: right;padding-right: 30px;">
+            <a-button type="primary" @click="$refs.recallBillTable.refresh(true)" id="outboundOrderList-refresh">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" id="outboundOrderList-reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+      <div class="tableCon">
+        <div style="margin-bottom: 16px">
+          <a-button type="primary" @click="handleSave">新增调回单</a-button>
+          <span class="tableSpan" v-if="totalCategory ||totalNum">
+            <template>
+              已选
+              <span>{{ totalCategory }}</span>
+              款产品,共
+              <span>{{ totalNum }}</span>
+              件
+            </template>
+          </span>
+          <span v-if="totalNum ||totalCategory"><a-checkbox @change="isShowChooseList" :checked="showChecked" size="small">仅显示已选产品</a-checkbox></span>
+        </div>
+        <s-table
+          class="sTable"
+          ref="recallBillTable"
+          size="small"
+          :rowKey="(record) => record.id"
+          :row-selection="{columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.confirmQty <= 0 } })}"
+          @rowSelection="onSelectChange"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: 450 }"
+          :showPagination="false"
+          bordered>
+          <template slot="confirmQty" slot-scope="text, record">
+            <div v-if="record.confirmQty === 0">--</div>
+            <a-input-number
+              v-else
+              size="small"
+              v-model="record.confirmQty"
+              :readonly="hasChecked(record.id)"
+              @change="changeNums(record)"
+              :precision="0"
+              :min="1"
+              :max="record.recallBillQty?record.qty - record.recallBillQty :record.qty"
+              placeholder="请输入"
+              :style="{ width: '100%' }"
+            ></a-input-number>
+          </template>
+        </s-table>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { commonMixin } from '@/utils/mixin'
+import { shelfControlList } from '@/api/shelf'
+import { shelfRecallSave } from '@/api/shelfRecall'
+export default {
+  name: 'AddRecallBillModal',
+  mixins: [commonMixin],
+  components: { STable },
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    recallBillInfo: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 5 },
+        wrapperCol: { span: 17 }
+      },
+      queryParam: {
+        //  查询条件
+        shelfSn: '',
+        productCode: undefined,
+        productName: undefined,
+        unsalableDaysBegin: undefined,
+        unsalableDaysEnd: undefined
+      },
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '15%', align: 'center' },
+        {
+          title: '产品编码',
+          dataIndex: 'productCode',
+          width: '20%',
+          align: 'center',
+          customRender: function (text) {
+            return text || '--'
+          }
+        },
+        {
+          title: '产品名称',
+          dataIndex: 'productName',
+          width: '30%',
+          align: 'center',
+          customRender: function (text) {
+            return text || '--'
+          },
+          ellipsis: true
+        },
+        {
+          title: '最大库容',
+          dataIndex: 'maxQty',
+          width: '15%',
+          align: 'center',
+          customRender: function (text) {
+            return text || text == 0 ? text : '--'
+          }
+        },
+        {
+          title: '补货在途',
+          dataIndex: 'replenishBillQty',
+          width: '15%',
+          align: 'center',
+          customRender: function (text) {
+            return text || text == 0 ? text : '--'
+          }
+        },
+        {
+          title: '调回在途',
+          dataIndex: 'recallBillQty',
+          width: '15%',
+          align: 'center',
+          customRender: function (text) {
+            return text || text == 0 ? text : '--'
+          }
+        },
+        {
+          title: '货架库存',
+          dataIndex: 'qty',
+          width: '15%',
+          align: 'center',
+          customRender: function (text) {
+            return text || text == 0 ? text : '--'
+          }
+        },
+        {
+          title: '单位',
+          dataIndex: 'productUnit',
+          width: '15%',
+          align: 'center',
+          customRender: function (text) {
+            return text || '--'
+          }
+        },
+        {
+          title: '滞销天数',
+          dataIndex: 'unsalableDays',
+          width: '15%',
+          align: 'center',
+          customRender: function (text) {
+            return text || text == 0 ? text : '--'
+          }
+        },
+        { title: '调回数量', width: '20%', align: 'center', scopedSlots: { customRender: 'confirmQty' } }
+      ],
+      showChecked: false,
+      rowSelectionInfo: null,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        // 获取列表
+        this.spinning = true
+        if (!this.checkValueRange()) {
+          this.spinning = false
+          return
+        }
+        this.queryParam.shelfSn = this.recallBillInfo.shelfSn
+        return shelfControlList(this.queryParam).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            if (this.showChecked) {
+              data = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+            }
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = i + 1
+              const row = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+              const cur = row.find(item => item.id == data[i].id)
+              data[i].confirmQty = cur ? cur.confirmQty : (data[i].confirmQty || data[i].recallBillQty ? data[i].qty - data[i].recallBillQty : data[i].qty)
+              data[i].checked = !cur
+            }
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    onSelectChange (obj) {
+      // 获取选中列表
+      this.rowSelectionInfo = obj || null
+    },
+    hasChecked: function (value) {
+      const row = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+      const cur = row.find(item => item.id == value)
+      return !cur
+    },
+    changeNums (data) {
+      const row = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+      const cur = row.find(item => item.id == data.id)
+      if (cur) {
+        cur.confirmQty = data.confirmQty
+      }
+      row.splice()
+    },
+    //  确定新增回调单
+    handleSave () {
+      const _this = this
+      if (this.rowSelectionInfo.selectedRows && this.rowSelectionInfo.selectedRows.length == 0) {
+        this.$message.warning('请先选择产品')
+        return
+      }
+      const flag = this.rowSelectionInfo.selectedRows.some(con => !con.confirmQty && con.confirmQty != 0)
+      if (flag) {
+        this.$message.warning('调回数量不能为空!')
+        return
+      }
+      const arr = []
+      this.rowSelectionInfo.selectedRows.forEach((item, index) => {
+        arr.push({
+          shelfSn: item.shelfSn,
+          shelfPlaceSn: item.shelfPlaceSn,
+          shelfPlaceCode: item.shelfPlaceCode,
+          productSn: item.productSn,
+          productCode: item.productCode,
+          productName: item.productName,
+          qty: item.confirmQty
+        })
+      })
+      _this.spinning = true
+      const params = {
+        shelfSn: this.recallBillInfo.shelfSn,
+        detailList: arr
+      }
+      shelfRecallSave(params).then(res => {
+        _this.spinning = false
+        if (res.status == 200) {
+          _this.$emit('ok')
+          _this.isShow = false
+          this.$refs.recallBillTable.clearSelected()
+          _this.$message.success('保存并确认成功')
+        }
+      })
+    },
+    isShowChooseList (e) {
+      this.showChecked = e.target.checked
+      this.$refs.recallBillTable.refresh(true)
+    },
+    // 重置
+    resetSearchForm () {
+      const obj = {
+        //  查询条件
+        shelfSn: this.recallBillInfo.shelfSn,
+        productCode: undefined,
+        productName: undefined,
+        unsalableDaysBegin: undefined,
+        unsalableDaysEnd: undefined
+      }
+      this.queryParam = obj
+      this.$refs.recallBillTable.refresh(true)
+    },
+    // 校验滞销天数数值范围
+    checkValueRange () {
+      const isONull = this.queryParam.unsalableDaysBegin === null || this.queryParam.unsalableDaysBegin === undefined
+      const isOEmpty = this.queryParam.unsalableDaysBegin === ''
+      const isOZero = this.queryParam.unsalableDaysBegin === 0
+      const isTNull = this.queryParam.unsalableDaysEnd === null || this.queryParam.unsalableDaysEnd === undefined
+      const isTEmpty = this.queryParam.unsalableDaysEnd === ''
+      const isTZero = this.queryParam.unsalableDaysEnd === 0
+      //  第一个为空(可为null可为空字符)第二个不为空
+      //  第一个不为空第二个为空(可为null可为空字符)
+      //  第一个大于第二个
+      if ((isONull || isOEmpty) && (this.queryParam.unsalableDaysEnd || isTZero)) {
+        this.$message.info('请输入正确的滞销天数查询范围!')
+        return false
+      }
+      if ((this.queryParam.unsalableDaysBegin || isOZero) && (isTNull || isTEmpty)) {
+        this.$message.info('请输入正确的滞销天数查询范围!')
+        return false
+      }
+      if (this.queryParam.unsalableDaysBegin > this.queryParam.unsalableDaysEnd) {
+        this.$message.info('请输入正确的滞销天数查询范围!')
+        return false
+      }
+      this.queryParam.unsalableDaysBegin = this.queryParam.unsalableDaysBegin > 999999999 ? 999999999 : this.queryParam.unsalableDaysBegin
+      this.queryParam.unsalableDaysEnd = this.queryParam.unsalableDaysEnd > 999999999 ? 999999999 : this.queryParam.unsalableDaysEnd
+      return true
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+      } else {
+        this.$nextTick(() => {
+          this.$refs.recallBillTable.clearSelected()
+          this.showChecked = false
+          this.resetSearchForm()
+        })
+      }
+    }
+  },
+  computed: {
+    totalNum () {
+      let ret = 0
+      this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.map(item => {
+        ret = ret + item.confirmQty
+      })
+      return ret
+    },
+    totalCategory () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.shelfSet-basicInfo-modal {
+  .ant-modal-body {
+    padding: 40px 40px 24px;
+  }
+  .ant-form-item {
+    margin-bottom: 15px;
+  }
+  .btn-cont {
+    text-align: center;
+    margin: 35px 0 10px;
+  }
+  .tableSpan {
+    margin: 0 16px;
+    span {
+      margin: 0 10px;
+      color: red;
+      font-weight: bold;
+    }
+  }
+}
+</style>

+ 131 - 0
src/views/numsGoodsShelves/recallManagement/basicInfoModal.vue

@@ -0,0 +1,131 @@
+<template>
+  <a-modal
+    centered
+    class="shelfSet-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="新增调回单"
+    v-model="isShow"
+    @cancel="isShow = false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="shelfSet-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol">
+        <a-form-model-item label="货架名称" prop="shelfSn">
+          <shelfSList v-model="form.shelfSn" @change="shelfChange"></shelfSList>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="importGuide-nextStep" @click="handlerNextStep">下一步</a-button>
+        <a-button id="shelfSet-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
+    <!-- 新增回调单(实现新增) -->
+    <add-recall-bill-modal :recallBillInfo="detailObj" :openModal="showRecallBill" @ok="handleInfoOk" @close="showRecallBill=false"></add-recall-bill-modal>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import custList from '@/views/common/custList.vue'
+import shelfSList from '@/views/common/shelfList'
+import addRecallBillModal from './addRecallBillModal.vue'
+export default {
+  name: 'ShelfSetBasicInfoModal',
+  components: { VSelect, custList, shelfSList, addRecallBillModal },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    nowData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    },
+    type: {
+      type: [String, Number],
+      default: '1'
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 5 },
+        wrapperCol: { span: 17 }
+      },
+      form: {
+        shelfSn: undefined
+      },
+      rules: {
+        shelfSn: [{ required: true, message: '请选择需要调回产品货架', trigger: 'change' }]
+      },
+      showRecallBill: false, // 显示选择货架弹窗
+      detailObj: {
+        shelfName: '',
+        shelfSn: ''
+      }
+    }
+  },
+  methods: {
+    shelfChange (v, row) {
+      this.detailObj.shelfName = row ? row.shelfName : ''
+    },
+    // 下一步 保存货架信息
+    handlerNextStep () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.detailObj.shelfSn = this.form.shelfSn
+          this.showRecallBill = true
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 新增调货单成功
+    handleInfoOk () {
+      this.$emit('ok')
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.shelfSet-basicInfo-modal {
+	.ant-modal-body {
+		padding: 40px 40px 24px;
+	}
+  .ant-form-item{
+    margin-bottom: 15px;
+  }
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 308 - 0
src/views/numsGoodsShelves/recallManagement/detailModal.vue

@@ -0,0 +1,308 @@
+<template>
+  <a-modal
+    centered
+    class="vinRecord-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="shelfName"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="60%">
+    <!-- 详情 -->
+    <div v-if="itemData">
+      <a-descriptions :column="3" size="default">
+        <a-descriptions-item label="调回单号">{{ itemData.recallBillNo }}</a-descriptions-item>
+        <a-descriptions-item label="创建时间">{{ itemData.createDate }}</a-descriptions-item>
+        <a-descriptions-item label="状态" :span="1">{{ itemData.billStateDictValue }}</a-descriptions-item>
+        <a-descriptions-item label="退库时间">{{ itemData.confirmTime }}</a-descriptions-item>
+        <a-descriptions-item style="width:calc(100% - 18px);background:red">
+          <span style="color:rgba(0, 0, 0, 0.85)">关联销售退货单:</span>
+          <span v-if="salesReturnBillList && salesReturnBillList.length>0">
+            <span v-for="con in salesReturnBillList" :key="con.id" class="recallBillNo" @click="jumpDetail(con)">{{ con.salesReturnNo }}</span>
+          </span>
+          <span v-else>
+            --
+          </span>
+          <a-button type="primary" ghost class="recallBillBtn" @click="seeRecallBill" v-if="itemData.billState != 'CANCEL' && !isZero">生成销售退货单</a-button>
+        </a-descriptions-item>
+      </a-descriptions>
+    </div>
+    <!-- 表格 -->
+    <div class="table-body" v-if="detailList && detailList.length>0">
+      <a-table
+        :columns="columns"
+        :data-source="detailList"
+        :scroll="{ y: 300 }"
+        :rowKey="(record) => record.id"
+        :pagination="false"
+        :bordered="true"
+      ></a-table>
+    </div>
+    <div class="btn-cont"><a-button id="vinRecord-modal-back" @click="isShow = false">关闭</a-button></div>
+    <!-- 回调单号提示窗 -->
+    <a-modal
+      class="tipPopup"
+      :maskClosable="false"
+      v-model="tipVisible"
+      :centered="true"
+      :closable="false"
+      :footer="null"
+      width="23%">
+      <div class="tipTop" v-if="itemData">
+        <div>产品总款数:<span>{{ itemData.totalCategory }}</span></div>
+        <div>产品总件数:<span>{{ itemData.viewQty }}</span></div>
+      </div>
+      <div class="tipCon" v-if="salesReturnBillList && salesReturnBillList.length==0">确认生成销售退货订单吗?</div>
+      <div v-else>
+        <div class="tipCon">此调回单已经存在相应的销售退货单,确定再次生成销售退货单吗?</div>
+        <div class="tipRecallBillNo">
+          <p v-for="con in salesReturnBillList" :key="con.id" @click="jumpDetail(con)">{{ con.salesReturnNo }}</p>
+        </div>
+      </div>
+      <div class="tipFooter">
+        <a-button class="btnLeft" type="link" @click="tipVisible = false">
+          取消
+        </a-button>
+        <a-button class="btnLeft" type="link" @click="setReturnBill" :loading="btnLoading">
+          确定
+        </a-button>
+      </div>
+    </a-modal>
+  </a-modal>
+</template>
+
+<script>
+import { generateSaleReturnBill } from '@/api/shelfRecall.js'
+export default {
+  name: 'DetailModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemData: {
+      type: Object,
+      default: function () {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      tipVisible: false,
+      salesReturnBillList: [],
+      detailList: [],
+      btnLoading: false,
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: '10%',
+        align: 'center'
+      },
+      {
+        title: '产品编码',
+        dataIndex: 'productCode',
+        width: '15%',
+        align: 'center',
+        customRender: function (text) {
+          return text || '--'
+        }
+      },
+      {
+        title: '产品名称',
+        dataIndex: 'productName',
+        width: '30%',
+        align: 'left',
+        customRender: function (text) {
+          return text || '--'
+        },
+        ellipsis: true
+      },
+      {
+        title: '调回数量',
+        dataIndex: 'qty',
+        width: '15%',
+        align: 'center',
+        customRender: function (text) {
+          return text || text == 0 ? text : '--'
+        }
+      },
+      {
+        title: '实退数量',
+        dataIndex: 'confirmQty',
+        width: '15%',
+        align: 'center',
+        customRender: function (text) {
+          return text || text == 0 ? text : '--'
+        }
+      },
+      {
+        title: '单位',
+        dataIndex: 'product.unit',
+        width: '15%',
+        align: 'center',
+        customRender: function (text) {
+          return text || text == 0 ? text : '--'
+        }
+      }
+      ],
+      shelfName: '',
+      isZero: false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        if (this.itemData) {
+          this.salesReturnBillList = this.itemData.salesReturnBillList ? this.itemData.salesReturnBillList : []
+          this.itemData.detailList.map((con, i) => {
+            con.no = i + 1
+          })
+          this.detailList = this.itemData.detailList
+          this.isZero = this.itemData.detailList.every((item) => {
+            return item.confirmQty == 0
+          })
+          this.shelfName = '调回单详情——' + this.itemData.shelfInfo.shelfName
+        }
+      }
+    }
+  },
+  methods: {
+    seeRecallBill () {
+      this.tipVisible = true
+    },
+    // 生成销售退货单
+    setReturnBill () {
+      this.spinning = true
+      this.btnLoading = true
+
+      generateSaleReturnBill({ recallBillSn: this.itemData.recallBillSn }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.tipVisible = false
+          this.$emit('close')
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+        this.btnLoading = false
+      })
+    },
+    jumpDetail (row) {
+      const _this = this
+      if (row.delFlag == 0) {
+        _this.isShow = false
+        _this.tipVisible = false
+        _this.$router.push({ name: 'salesReturnDetail', params: { id: row.id, sn: row.salesReturnSn } })
+      } else {
+        _this.$error({
+          title: '提示',
+          content: '此销售退货单已删除,无法查看详情',
+          centered: true
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .vinRecord-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .ant-modal-title{
+      font-weight: 600;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+    .table-body{
+      margin-top:10px;
+      .ant-table-thead > tr > th,.ant-table-header-column{
+        text-align: center!important;
+      }
+    }
+
+    .recallBillNo{
+      color:#39f;
+      font-weight: 600;
+      cursor: pointer;
+    }
+    .recallBillNo:not(:last-child)::after{
+      content:',';
+    }
+    .recallBillBtn{
+      border-color:#39f;
+      color:#39f;
+      margin-left: 20px;
+      &:hover, &:focus {
+        border-color: #52a6fb;
+        color: #52a6fb;
+      }
+    }
+    .ant-descriptions-item{
+          vertical-align: top;
+    }
+  }
+  // 弹窗
+  .tipPopup{
+    .ant-modal-body{
+      padding:0 !important;
+    }
+    text-align: center;
+    .tipTop{
+      width:62%;
+      display: flex;
+      algin-item:center;
+      padding:20px 0;
+      box-sizing: border-box;
+      justify-content: space-between;
+      color:#333;
+      margin:0 auto;
+      span{
+        color:#f30f30;
+        font-weight: bold;
+      }
+    }
+    .tipCon{
+        width:62%;
+        margin: 0 auto 30px;
+        text-align: center;
+    }
+    .tipRecallBillNo{
+        padding:0 20px;
+        p{
+          padding-bottom: 15px;
+          border-bottom: 1px solid #e0e0e0;
+        }
+    }
+    .tipFooter{
+      display: flex;
+      algin-item:center;
+      border-top:1px solid #e0e0e0;
+      :hover{
+
+      }
+      .btnLeft{
+        width:50%;
+        text-align: center;
+        height:46px;
+        line-height: 46px;
+        color:#39f;
+        &:first-child{
+          border-right:1px solid #e0e0e0;
+        }
+      }
+    }
+  }
+</style>

+ 37 - 3
src/views/numsGoodsShelves/recallManagement/list.vue

@@ -48,6 +48,7 @@
           </a-row>
         </a-form>
       </div>
+      <div class="btnStyle"><a-button type="primary" @click="openInfoModal = true">新增调回单</a-button></div>
       <s-table
         class="sTable fixPagination"
         ref="table"
@@ -62,6 +63,11 @@
         :expandRowByClick="true"
         :defaultLoadData="false"
         bordered>
+        <template slot="recallBillNo" slot-scope="text, record">
+          <div class="table-td-link" @click.stop="handleDetail(record)">
+            {{ record.recallBillNo || '--' }}
+          </div>
+        </template>
         <template slot="action" slot-scope="text, record">
           <a-button
             size="small"
@@ -102,6 +108,10 @@
       <!-- 退库 -->
       <recallModal :isOpenModal="showModal" :currentData="currentData" @close="showModal=false" @refresh="$refs.table.refresh(true)"></recallModal>
     </a-spin>
+    <!-- 新增回调单(选择货架) -->
+    <basic-info-modal :openModal="openInfoModal" @ok="handleInfoOk" @close="openInfoModal=false" />
+    <!-- 调回单详情 -->
+    <detailModal :openModal="showDetail" :itemData="detailContent" @close="showDetail=false"></detailModal>
   </a-card>
 </template>
 
@@ -114,9 +124,11 @@ import recallModal from './recallModal.vue'
 import getDate from '@/libs/getDate.js'
 import { toThousands } from '@/libs/tools.js'
 import shelfList from '@/views/common/shelfList'
-import { shelfRecallList, shelfRecallDetailList, shelfRecallCancel, shelfRecallStateCount, shelfRecallDelete } from '@/api/shelfRecall.js'
+import basicInfoModal from './basicInfoModal.vue'
+import detailModal from './detailModal'
+import { shelfRecallList, shelfRecallDetailList, shelfRecallCancel, shelfRecallStateCount, shelfRecallDelete, shelfRecallDetail } from '@/api/shelfRecall.js'
 export default {
-  components: { STable, recallModal, rangeDate, shelfList },
+  components: { STable, recallModal, rangeDate, shelfList, basicInfoModal, detailModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -140,10 +152,11 @@ export default {
         shelfSn: undefined, // 数字货架sn
         bizType: 'ALL'
       },
+      openInfoModal: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调回单号', dataIndex: 'recallBillNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调回单号', scopedSlots: { customRender: 'recallBillNo' }, width: '20%', align: 'center' },
         { title: '货架名称', dataIndex: 'shelfInfo.shelfName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '状态', dataIndex: 'billStateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调回总量', dataIndex: 'totalQty', width: '9%', align: 'center', customRender: function (text) { return (text || text == 0) ? toThousands(text) : '--' } },
@@ -159,6 +172,8 @@ export default {
         { title: '单位', dataIndex: 'product.unit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       innerData: [],
+      showDetail: false,
+      detailContent: null,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -323,6 +338,22 @@ export default {
         _this.setTableH()
       })
       this.getSumByType()
+    },
+    // 查看详情
+    handleDetail (row) {
+      this.spinning = true
+      shelfRecallDetail({ recallSn: row.recallBillSn }).then(res => {
+        if (res.status == 200) {
+          this.detailContent = res.data
+          this.showDetail = true
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
+    },
+    handleInfoOk (e) {
+      this.$refs.table.refresh()
     }
   },
   mounted () {
@@ -385,4 +416,7 @@ export default {
       height: 30px!important;
     }
   }
+  .btnStyle{
+    margin:10px 0 20px;
+  }
 </style>

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

@@ -102,7 +102,12 @@ export default {
     // 保存
     handleSave () {
       const _this = this
-      this.$confirm({
+      const flag = _this.list.some(con => !con.confirmQty && con.confirmQty != 0)
+      if (flag) {
+        _this.$message.warning('实退数量不能为空!')
+        return
+      }
+      _this.$confirm({
         title: '提示',
         content: '此操作将会扣减数字货架的库存,确认退库吗?',
         centered: true,

+ 32 - 8
src/views/numsGoodsShelves/recallStockManagement/editStock.vue

@@ -38,6 +38,14 @@
               placeholder="请选择仓库仓位"
               style="width: 100%;" />
           </template>
+          <template slot="putCost" slot-scope="text, record">
+            <a-input-number
+              v-model="record.putCost"
+              :precision="2"
+              :min="0"
+              placeholder="请输入入库单价"
+              @blur="handleEdit(record.putCost,record)"></a-input-number>
+          </template>
         </s-table>
         <div style="text-align: center;margin-top: 20px;">
           <a-button size="small" class="button-primary" type="primary" @click="handleBack(1)">确认入库</a-button>
@@ -75,6 +83,7 @@ export default {
         payWay: undefined
       },
       settleData: null,
+      loadDataList: [],
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
@@ -82,7 +91,7 @@ export default {
         { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '入库数量', dataIndex: 'putQty', width: '7.5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productUnit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库单价', dataIndex: 'putCost', width: '7.5%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '入库单价', scopedSlots: { customRender: 'putCost' }, width: '7.5%', align: 'center' },
         { title: '入库成本', dataIndex: 'putTotalCost', width: '25%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
         { title: '操作', width: '15%', align: 'left', scopedSlots: { customRender: 'action' } }
       ],
@@ -93,20 +102,20 @@ export default {
         return recallrStockDetailList({ stockPutSn: this.$route.params.stockPutSn }).then(res => {
           let data
           if (res.status == 200) {
-            console.log(res, 'liebiao')
             data = res.data
             for (let i = 0; i < data.length; i++) {
               data[i].no = i + 1
-              if (this.defaultWarehouseCascade.length > 0) {
+              if (this.defaultWarehouseCascade.length > 0 && (!data[i].warehouseSn || !data[i].warehouseLocationSn)) {
                 data[i].warehouseCascade = this.defaultWarehouseCascade
                 data[i].warehouseSn = this.defaultWarehouseCascade[0]
                 data[i].warehouseLocationSn = this.defaultWarehouseCascade[1]
               } else {
-                data[i].warehouseCascade = undefined
+                data[i].warehouseCascade = [data[i].warehouseSn, data[i].warehouseLocationSn]
               }
             }
           }
           this.spinning = false
+          this.loadDataList = data || []
           return data
         })
       }
@@ -114,6 +123,11 @@ export default {
   },
   methods: {
     handleBack (val) {
+      const flag = this.loadDataList.some(con => !con.putCost && con.putCost != 0)
+      if (flag && val == 1) {
+        this.$message.warning('入库单价不能为空!')
+        return
+      }
       if (val == 1) {
         const _this = this
         this.$confirm({
@@ -143,14 +157,24 @@ export default {
         }
       })
     },
-    changeWarehouseCascade (val, opt) {
-      console.log(val, opt)
-      updateSelective({ id: opt.id, warehouseSn: val[0], warehouseLocationSn: val[1] }).then(res => {
+    // 更新列表数据
+    updateSelectData (ajaxData) {
+      updateSelective(ajaxData).then(res => {
         if (res.status == 200) {
           this.$refs.table.refresh()
           this.getStockInfo()
         }
       })
+    },
+    // 修改入库单价
+    handleEdit (costPrice, opt) {
+      if (!costPrice && costPrice != 0) {
+        return
+      }
+      this.updateSelectData({ id: opt.id, putCost: costPrice })
+    },
+    changeWarehouseCascade (val, opt) {
+      this.updateSelectData({ id: opt.id, warehouseSn: val[0], warehouseLocationSn: val[1] })
       // let loadData
       // if (type == 'dealerProduct') { //  全部产品
       //   loadData = this.loadDataSource[ind]
@@ -249,6 +273,6 @@ export default {
         padding: 10px !important;
       }
     }
-
   }
+
 </style>

+ 216 - 64
src/views/numsGoodsShelves/replenishmentManagement/creatReplenishmentOrder.vue

@@ -4,31 +4,82 @@
     class="creatReplenish-confirm-modal"
     :footer="null"
     :maskClosable="false"
-    title="生成补货单"
+    :title="modalTit"
     v-model="isShow"
     @cancel="isShow = false"
-    :width="800">
+    width="80%">
     <a-spin :spinning="spinning" tip="Loading...">
-      <div style="padding:0 0 20px;text-align: center;">
-        <h3>请选择需要生成补货单的数字货架</h3>
-        <div style="color:#999;font-size:12px;">(请从左侧选择货架并移动到右侧区域)</div>
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          @keyup.enter.native="$refs.table.refresh(true)" >
+          <a-row :gutter="5">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品编码">
+                <a-input id="chooseShelf-code" ref="searchProductCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品名称">
+                <a-input id="chooseShelf-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="10" :sm="24">
+              <a-form-model-item label="库存情况">
+                <a-checkbox-group :options="options" v-model="queryParam.stockStateList" @change="onStockChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="24" :sm="24" style="margin-bottom: 10px;text-align:right;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" id="chooseShelf-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" id="chooseShelf-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
       </div>
-      <!-- 列表 -->
-      <div v-if="isShow">
-        <a-transfer
-          :titles="['货架列表', '已选货架']"
-          :listStyle="{width:'45%',height:'400px'}"
-          :data-source="shelfList"
-          show-search
-          :filter-option="filterOption"
-          :target-keys="targetKeys"
-          :render="item => item.title"
-          @change="handleChange"
-        />
-      </div>
-      <div class="btn-cont">
-        <a-button type="primary" id="creatReplenish-confirm-modal-save" @click="handleSave">确定</a-button>
-        <a-button id="creatReplenish-confirm-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      <div>
+        <div class="table-operator">
+          <div>
+            <a-button type="primary" @click="handleSave">创建补货单</a-button>
+            <span style="margin-left:10px;" v-if="totalCategory||totalQty">
+              已选 {{ totalCategory }} 款产品,共 {{ totalQty }} 件
+            </span>
+          </div>
+          <div style="margin-left:20px;" v-if="totalCategory||totalQty">
+            <a-checkbox @change="changeShowChecked">
+              仅显示已选产品
+            </a-checkbox>
+          </div>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :row-selection="{columnWidth: 40}"
+          @rowSelection="rowSelectionFun"
+          :columns="columns"
+          :data="loadData"
+          :style="{ height: '480px' }"
+          :scroll="{ y: 450 }"
+          :showPagination="false"
+          bordered>
+          <template slot="action" slot-scope="text, record">
+            <a-input-number
+              size="small"
+              :readonly="hasChecked(record.id)"
+              v-model="record.replenishQty"
+              @change="changeNums(record)"
+              :precision="0"
+              :min="1"
+              placeholder="请输入"
+              style="width: 100%" />
+          </template>
+        </s-table>
       </div>
     </a-spin>
   </a-modal>
@@ -36,9 +87,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { queryListForSettle, shelfTaskInsertBill } from '@/api/shelfReplenish'
+import { STable, VSelect } from '@/components'
+import { queryProductListForReplenish } from '@/api/shelf'
+import { saveMainAndDetail } from '@/api/shelfReplenish'
 export default {
-  name: 'ConfirmModal',
+  name: 'CreatReplenishmentOrder',
+  components: { STable, VSelect },
   mixins: [commonMixin],
   props: {
     openModal: { //  弹框显示状态
@@ -52,52 +106,150 @@ export default {
       }
     }
   },
+  computed: {
+    modalTit () {
+      const hjName = this.nowData ? this.nowData.shelfName : ''
+      return '待补货产品 —— ' + hjName
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '货架库存', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补货在途', dataIndex: 'replenishBillQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调回在途', dataIndex: 'recallBillQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '待补货数量', dataIndex: 'replenishBillWaitQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '门店库存数量', dataIndex: 'qplsStockQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '本次补货数量', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      return arr
+    },
+    totalCategory () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length
+    },
+    totalQty () {
+      let ret = 0
+      this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.map(item => {
+        ret = ret + item.replenishQty
+      })
+      return ret
+    }
+  },
   data () {
     return {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
-      shelfList: [],
-      targetKeys: []
+      options: [
+        { label: '库存充足', value: 'stockEnough' },
+        { label: '部分缺货', value: 'portionStockout' },
+        { label: '全部缺货', value: 'allStockout' }
+      ],
+      queryParam: {
+        productCode: '', //  产品编码
+        productName: '', //  产品名称
+        stockStateList: []
+      },
+      allData: [],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        this.disabled = true
+        this.queryParam.shelfSn = this.nowData.shelfSn
+        return queryProductListForReplenish(this.queryParam).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            if (this.showChecked) {
+              data = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+            }
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = i + 1
+              const row = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+              const cur = row.find(item => item.id == data[i].id)
+              data[i].replenishQty = cur ? cur.replenishQty : (data[i].replenishBillWaitQty || 1)
+              data[i].checked = !cur
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          this.allData = data
+          return data
+        })
+      },
+      rowSelectionInfo: null,
+      showChecked: false
     }
   },
   methods: {
-    getShelf () {
-      this.spinning = true
-      queryListForSettle().then(res => {
-        if (res.status == 200) {
-          this.shelfList = res.data || []
-          this.shelfList.map(item => {
-            item.title = item.shelfName
-            item.key = item.shelfSn
-          })
-        } else {
-          this.shelfList = []
-        }
-        this.spinning = false
-      })
+    onStockChange (val) {
+      this.queryParam.stockStateList = val
+    },
+    // 显示已选产品
+    changeShowChecked (e) {
+      this.showChecked = e.target.checked
+      this.$refs.table.refresh(true)
     },
-    filterOption (inputValue, option) {
-      return option.title.indexOf(inputValue) > -1
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
     },
-    handleChange (targetKeys, direction, moveKeys) {
-      console.log(targetKeys, direction, moveKeys)
-      this.targetKeys = targetKeys
+    hasChecked: function (value) {
+      const row = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+      const cur = row.find(item => item.id == value)
+      return !cur
+    },
+    changeNums (data) {
+      const row = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+      const cur = row.find(item => item.id == data.id)
+      if (cur) {
+        cur.replenishQty = data.replenishQty
+      }
+      row.splice()
+    },
+    // 重置
+    resetSearchForm () {
+      this.queryParam = {
+        productCode: '', //  产品编码
+        productName: '', //  产品名称
+        stockStateList: []
+      }
+      this.$refs.table.refresh(true)
     },
     //  确认补货
     handleSave () {
-      if (this.targetKeys.length == 0) {
-        this.$message.info('请选择货架!')
-        return false
+      if (this.totalCategory) {
+        const data = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+        const dataList = []
+        data.map(item => {
+          dataList.push({
+            shelfPlaceSn: item.shelfPlaceSn,
+            shelfPlaceCode: item.shelfPlaceCode,
+            productSn: item.productSn,
+            productCode: item.productCode,
+            qty: item.replenishQty
+          })
+        })
+        // 开始提交
+        this.spinning = true
+        saveMainAndDetail({
+          shelfSn: this.nowData.shelfSn,
+          dealerSn: this.nowData.dealerSn,
+          detailList: dataList
+        }).then(res => {
+          if (res.status == 200) {
+            this.$message.success(res.message)
+            this.$emit('ok')
+            this.$emit('close')
+          }
+          this.spinning = false
+        })
+      } else {
+        this.$message.info('请选择产品')
       }
-
-      this.spinning = true
-      shelfTaskInsertBill(this.targetKeys).then(res => {
-        if (res.status == 200) {
-          this.$message.success(res.message)
-          this.$emit('ok')
-        }
-        this.spinning = false
-      })
     }
   },
   watch: {
@@ -109,12 +261,11 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.targetKeys = []
-        this.shelfList = []
       } else {
-        const _this = this
-        this.$nextTick(() => { // 页面渲染完成后的回调
-          _this.getShelf()
+        this.$nextTick(() => {
+          this.resetSearchForm()
+          this.$refs.table.clearSelected()
+          this.showChecked = false
         })
       }
     }
@@ -124,9 +275,10 @@ export default {
 
 <style lang="less">
 .creatReplenish-confirm-modal {
-	.btn-cont {
-		text-align: center;
-		margin: 35px 0 10px;
+	.table-operator {
+		padding:0 10px 10px 0;
+		display:flex;
+		align-items: center;
 	}
 }
 </style>

+ 260 - 0
src/views/numsGoodsShelves/replenishmentManagement/detailModal.vue

@@ -0,0 +1,260 @@
+<template>
+  <a-modal
+    centered
+    class="replenishmentManagement-confirm-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="modalTit"
+    v-model="isShow"
+    @cancel="isShow = false"
+    :width="800">
+    <div v-if="nowData">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 基础信息 -->
+        <div v-if="detailData">
+          <a-descriptions size="small" :column="3">
+            <a-descriptions-item label="补货单号">{{ detailData && detailData.replenishBillNo || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="创建时间">{{ detailData && detailData.createDate || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="状态">{{ detailData&&detailData.billStateDictValue || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="出库时间">{{ detailData&&detailData.outStockTime || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="签收时间">{{ detailData&&detailData.putStockTime || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="出库备注">
+              <div style="word-break: break-all;">
+                {{ detailData&&detailData.remarks || '--' }}
+              </div>
+            </a-descriptions-item>
+            <a-descriptions-item label="关联销售单" :span="3" v-if="detailData.billState=='WAIT_CHECK' || detailData.billState=='WAIT_OUT_STOCK' || detailData.billState=='FINISH' || detailData.billState=='CANCEL'">
+              <div style="word-break: break-all;">
+                <a
+                  style="margin-right:10px;color:#00aaff;"
+                  v-for="item in salesOrderList"
+                  :key="item.id"
+                  @click="viewSales(item)">
+                  {{ item.salesBillNo }};
+                </a>
+                <span v-if="salesOrderList.length==0">--</span>
+                <a-button v-if="totalNums&&detailData.billState!='CANCEL'" type="primary" class="button-info" @click="showPlModal=true">生成销售单</a-button>
+              </div>
+            </a-descriptions-item>
+          </a-descriptions>
+        </div>
+        <div class="pages-wrap" style="margin-top:10px;">
+          <!-- 列表 -->
+          <s-table
+            class="sTable"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.id"
+            :columns="columns"
+            :data="loadData"
+            :scroll="{ y: 400 }"
+            :showPagination="false"
+            bordered>
+          </s-table>
+        </div>
+      </a-spin>
+    </div>
+    <div class="btn-cont">
+      <a-button @click="isShow = false">关闭</a-button>
+    </div>
+    <!-- 生成销售单 -->
+    <commonModal modalTit="" :openModal="showPlModal" @close="showPlModal=false" @ok="createSales">
+      <div style="display: flex;justify-content: center;margin-bottom: 15px;">
+        <div style="padding:5px 20px;">产品款数:<span style="color:red;">{{ listData&&listData.length }}</span></div>
+        <div style="padding:5px 20px;">产品总件数:<span style="color:red;">{{ totalNums }}</span></div>
+      </div>
+      <div style="text-align: center;" v-if="salesOrderList.length">
+        <div style="margin-bottom: 5px;font-size: 14px;">此补货单已经存在对应的销售单</div>
+        <div style="margin-bottom: 15px;font-size: 14px;"><strong>确认再次生成销售单吗?</strong></div>
+        <div style="line-height: 24px;">
+          <div
+            style="padding:5px;border-bottom: 1px solid #eee;color:#00aaff;cursor: pointer;display: flex;justify-content: space-between;align-items: center;"
+            v-for="item in salesOrderList"
+            :key="item.id"
+            @click="viewSales(item)"
+          >
+            <div class="flex-grow:1;padding:0 5px;">{{ item.salesBillNo }};</div>
+            <div class="padding:0 5px;"><a-icon type="right" style="color:#00aaff;" /></div>
+          </div>
+        </div>
+      </div>
+      <div style="text-align: center;" v-else>
+        <div style="margin-bottom: 15px;font-size: 14px;"><strong>确认生成销售单吗?</strong></div>
+      </div>
+    </commonModal>
+    <!-- 销售单详情 -->
+    <a-modal
+      centered
+      class="outboundOrderDetail-modal"
+      :footer="null"
+      :maskClosable="false"
+      :bodyStyle="{padding:'12px'}"
+      :zIndex="1001"
+      title="销售单详情"
+      v-model="openDetailModal"
+      @cancel="openDetailModal=false"
+      width="80%">
+      <div style="max-height: 700px;overflow-y: auto;">
+        <salesDetailModal v-if="openDetailModal" :outBizSn="orderSn" />
+      </div>
+    </a-modal>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import commonModal from '@/views/common/commonModal.vue'
+import salesDetailModal from '@/views/salesManagement/salesQuery/detail.vue'
+import { salesDetailBySn } from '@/api/sales'
+import { shelfReplenishDetailList, shelfReplenishDetail, queryRelationSalesBill, createSalesBill } from '@/api/shelfReplenish'
+export default {
+  name: 'DetailModal',
+  components: { STable, VSelect, commonModal, salesDetailModal },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    nowData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      disabled: false,
+      showPlModal: false,
+      openDetailModal: false,
+      orderSn: null,
+      listData: [],
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'product.code', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '28%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '补货数量', dataIndex: 'qty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '签收数量', dataIndex: 'putQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'product.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return shelfReplenishDetailList({ replenishBillSn: this.nowData.replenishBillSn }).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = i + 1
+            }
+            this.disabled = false
+            this.listData = data || []
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      localDataSource: [],
+      detailData: null, //  详情数据
+      salesOrderList: []
+    }
+  },
+  computed: {
+    modalTit () {
+      const hjName = this.nowData && this.nowData.shelfInfo.shelfName ? this.nowData.shelfInfo.shelfName : ''
+      return '补货单详情 —— ' + hjName
+    },
+    totalNums () {
+      let ret = 0
+      const isFin = this.detailData && this.detailData.billState == 'FINISH'
+      this.listData.map(item => {
+        ret = ret + (isFin ? item.putQty : item.qty)
+      })
+      return ret
+    }
+  },
+  methods: {
+    // 基本信息
+    getDetail () {
+      shelfReplenishDetail({ sn: this.nowData.replenishBillSn }).then(res => {
+        if (res.status == 200) {
+          this.detailData = res.data
+        } else {
+          this.detailData = null
+        }
+      })
+    },
+    // 查询关联销售单
+    getSalesOrder () {
+      queryRelationSalesBill({ replenishBillSn: this.nowData.replenishBillSn }).then(res => {
+        if (res.status == 200) {
+          this.salesOrderList = res.data
+        } else {
+          this.salesOrderList = []
+        }
+      })
+    },
+    // 生成销售单
+    createSales () {
+      this.spinning = true
+      this.showPlModal = false
+      createSalesBill({ replenishBillSn: this.nowData.replenishBillSn }).then(res => {
+        if (res.status == 200) {
+          this.$message.info(res.message)
+          this.getSalesOrder()
+        }
+        this.spinning = false
+      })
+    },
+    // 查看销售单详情
+    viewSales (item) {
+      salesDetailBySn({ salesBillSn: item.salesBillSn }).then(res => {
+        if (res.data) {
+          this.orderSn = item.salesBillSn
+          this.openDetailModal = true
+        } else {
+          this.$message.info('此销售单已被删除!')
+        }
+      })
+    },
+    pageInit () {
+      const vm = this
+      vm.$nextTick(() => {
+        vm.spinning = false
+        vm.disabled = false
+        vm.getSalesOrder()
+        vm.getDetail()
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        this.pageInit()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.replenishmentManagement-confirm-modal {
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 104 - 47
src/views/numsGoodsShelves/replenishmentManagement/list.vue

@@ -11,7 +11,17 @@
         </a-tabs>
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
-            <a-col :md="6" :sm="24">
+            <a-col :md="6" :sm="24" v-if="queryParam.bizType=='WAIT_CHECK'">
+              <a-form-item label="出库时间">
+                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" v-else-if="queryParam.bizType=='FINISH'">
+              <a-form-item label="签收时间">
+                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" v-else>
               <a-form-item label="创建时间">
                 <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
@@ -36,7 +46,6 @@
             </template>
             <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
-                <a-button type="info" style="margin-left: 5px" @click="openCreatRoModal=true" >生成补货单</a-button>
                 <a-button type="primary" style="margin-left: 5px" @click="queryByTypeSum" :disabled="disabled" id="replenishmentManagementList-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="replenishmentManagementList-reset">重置</a-button>
                 <a @click="advanced = !advanced" style="margin-left: 5px">
@@ -47,6 +56,11 @@
             </a-col>
           </a-row>
         </a-form>
+        <!-- 操作按钮 -->
+        <div class="table-operator">
+          <a-button type="primary" class="button-error" @click="openSlodOut=true">待补货产品</a-button>
+          <span style="margin-left:10px;color:#999;">请点击此按钮,选择需要补货的产品创建补货单</span>
+        </div>
       </div>
       <s-table
         class="sTable fixPagination"
@@ -76,13 +90,17 @@
         </a-table>
         <!-- 操作 -->
         <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_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="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-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>
+        <!-- 补货单号 -->
+        <template slot="replenishBillNo" slot-scope="text, record">
+          <span class="table-td-link" @click.stop="handleDetail(record)">{{ record.replenishBillNo }}</span>
+        </template>
       </s-table>
       <!-- 确认 -->
       <confirm-modal :openModal="openConfirmModal" :nowData="nowData" @ok="handleValidate" @close="handleCancel" />
@@ -100,8 +118,10 @@
       <out-warehousing-modal :openModal="openOutWarehousingModal" :nowData="nowData" @ok="handleOutWarehousingOk" @close="handleCancel" />
       <!-- 签收 -->
       <put-warehousing-modal :openModal="openPutWarehousingModal" :nowData="nowData" @ok="handlePutWarehousingOk" @close="handleCancel" />
-      <!-- 生成补货单 -->
-      <creatReplenishmentOrder :openModal="openCreatRoModal" :nowData="nowData" @ok="resetSearchForm" @close="openCreatRoModal=false" />
+      <!-- 详情 -->
+      <detailModal :openModal="openDetailModal" :nowData="nowData" @close="handleCancel" />
+      <!-- 待补货产品 -->
+      <slodOutModal :openModal="openSlodOut" @close="openSlodOut=false" />
     </a-spin>
   </a-card>
 </template>
@@ -113,14 +133,15 @@ import getDate from '@/libs/getDate.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import shelfSList from '@/views/common/shelfList'
 import confirmModal from './confirmModal.vue'
-import creatReplenishmentOrder from './creatReplenishmentOrder.vue'
 import stockModal from './stockModal.vue'
 import printStickerModal from './printStickerModal.vue'
 import outWarehousingModal from './outWarehousingModal.vue'
 import putWarehousingModal from './putWarehousingModal.vue'
+import detailModal from './detailModal.vue'
+import slodOutModal from './slodOutModal.vue'
 import { shelfReplenishList, shelfReplenishDetailList, shelfReplenishCancel, shelfReplenishStateCount, shelfReplenishDetailStock, shelfReplenishConfirm, shelfReplenishDelete } from '@/api/shelfReplenish'
 export default {
-  components: { STable, VSelect, rangeDate, shelfSList, confirmModal, creatReplenishmentOrder, stockModal, printStickerModal, outWarehousingModal, putWarehousingModal },
+  components: { STable, VSelect, rangeDate, shelfSList, confirmModal, stockModal, printStickerModal, outWarehousingModal, putWarehousingModal, detailModal, slodOutModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -136,8 +157,8 @@ export default {
       ],
       // 查询参数
       queryParam: {
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+        bDate: getDate.getCurrMonthDays().starttime,
+        eDate: getDate.getCurrMonthDays().endtime,
         bizType: 'ALL',
         replenishBillNo: '',
         shelfSn: undefined,
@@ -145,17 +166,6 @@ export default {
         productName: ''
       },
       expandedRowKeys: [],
-      columns: [
-        { 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: '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: '17%', align: 'left' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -163,6 +173,16 @@ export default {
         this.expandedRowKeys = []
         parameter.billState = this.queryParam.bizType == 'ALL' ? '' : this.queryParam.bizType
         const params = Object.assign(parameter, this.queryParam)
+        if (params.billState == 'WAIT_CHECK') {
+          params.outStockTimeBegin = this.queryParam.bDate
+          params.outStockTimeEnd = this.queryParam.eDate
+        } else if (params.billState == 'FINISH') {
+          params.putStockTimeBegin = this.queryParam.bDate
+          params.putStockTimeEnd = this.queryParam.eDate
+        } else {
+          params.beginDate = this.queryParam.bDate
+          params.endDate = this.queryParam.eDate
+        }
         delete params.index
         delete params.tableId
         delete params.bizType
@@ -184,17 +204,17 @@ export default {
       },
       subColumns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'product.code', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', width: '32%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '补货应发总量', dataIndex: 'qty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实发总量', dataIndex: 'confirmQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '签收总量', dataIndex: 'putQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补货数量', dataIndex: 'qty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '签收数量', dataIndex: 'putQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'product.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       listData: [],
       tabPaneData: [
         { bizName: '全部', bizType: 'ALL', countNum: 0 },
-        { bizName: '待确认', bizType: 'WAIT_CONFIRM', countNum: 0 },
+        // { bizName: '待确认', bizType: 'WAIT_CONFIRM', countNum: 0 },
         { bizName: '待出库', bizType: 'WAIT_OUT_STOCK', countNum: 0 },
         { bizName: '待签收', bizType: 'WAIT_CHECK', countNum: 0 },
         { bizName: '已完成', bizType: 'FINISH', countNum: 0 },
@@ -206,26 +226,43 @@ export default {
       openPrintStickerModal: false,
       openOutWarehousingModal: false,
       openPutWarehousingModal: false,
-      openCreatRoModal: false,
+      openDetailModal: false,
+      openSlodOut: false,
       validateType: 'confirm',
       stockList: [],
       paramsData: null
     }
   },
+  computed: {
+    columns () {
+      const ret = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '补货单号', dataIndex: 'replenishBillNo', scopedSlots: { customRender: 'replenishBillNo' }, width: '15%', align: 'center' },
+        { title: '货架名称', dataIndex: 'shelfInfo.shelfName', width: '25%', 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: 'totalPutQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '16%', align: 'left' }
+      ]
+      if (this.queryParam.bizType == 'WAIT_CHECK') {
+        ret.splice(1, 1, { title: '出库时间', dataIndex: 'outStockTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } })
+      } else if (this.queryParam.bizType == 'FINISH') {
+        ret.splice(1, 1, { title: '签收时间', dataIndex: 'putStockTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } })
+      }
+      return ret
+    }
+  },
   methods: {
     // 确认
     handleConfirm (row) {
       this.nowData = row
       this.openConfirmModal = true
     },
-    // cancel
-    handleCancel () {
-      this.nowData = null
-      this.openConfirmModal = false
-      this.openStockModal = false
-      this.openPrintStickerModal = false
-      this.openOutWarehousingModal = false
-      this.openPutWarehousingModal = false
+    // 补货详情
+    handleDetail (row) {
+      this.nowData = row
+      this.openDetailModal = true
     },
     // 库存不足 确认 ok
     handleStockOk (type, params) {
@@ -248,9 +285,7 @@ export default {
       this.openPrintStickerModal = true
     },
     // 打印贴签 ok
-    handlePrintStickerOk () {
-
-    },
+    handlePrintStickerOk () {},
     // 出库
     handleOutWarehousing (row) {
       this.nowData = row
@@ -262,6 +297,16 @@ export default {
       this.openOutWarehousingModal = false
       this.queryByTypeSum(true)
     },
+    // cancel
+    handleCancel () {
+      this.nowData = null
+      this.openConfirmModal = false
+      this.openStockModal = false
+      this.openPrintStickerModal = false
+      this.openOutWarehousingModal = false
+      this.openPutWarehousingModal = false
+      this.openDetailModal = false
+    },
     handleValidate (type, params) {
       if (type == 'confirm') { // 确认
         this.confirmFun(params)
@@ -381,10 +426,9 @@ export default {
     },
     // 重置数据
     resetData () {
-      this.openCreatRoModal = false
       this.$refs.rangeDate.resetDate(this.time)
-      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
-      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.bDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.eDate = getDate.getCurrMonthDays().endtime
       this.queryParam.bizType = this.curBizType
       this.queryParam.replenishBillNo = ''
       this.queryParam.shelfSn = undefined
@@ -393,15 +437,15 @@ export default {
     },
     //  时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0] || null
-      this.queryParam.endDate = date[1] || null
+      this.queryParam.bDate = date[0] || null
+      this.queryParam.eDate = date[1] || null
     },
     // 选择类型
     handleTabChange (key) {
       this.expandedRowKeys = []
       this.queryParam.bizType = key
       this.curBizType = key
-      this.$refs.table.refresh(true)
+      this.resetSearchForm()
     },
     // 客户 change
     custChange (obj) {
@@ -410,15 +454,25 @@ export default {
     // 获取类型
     queryByTypeSum (flag) {
       const params = JSON.parse(JSON.stringify(this.queryParam))
+      if (params.bizType == 'WAIT_CHECK') {
+        params.outStockTimeBegin = this.queryParam.bDate
+        params.outStockTimeEnd = this.queryParam.eDate
+      } else if (params.bizType == 'FINISH') {
+        params.putStockTimeBegin = this.queryParam.bDate
+        params.putStockTimeEnd = this.queryParam.eDate
+      } else {
+        params.beginDate = this.queryParam.bDate
+        params.endDate = this.queryParam.eDate
+      }
       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
-          this.tabPaneData[2].countNum = res.data.WAIT_OUT_STOCK || 0
-          this.tabPaneData[3].countNum = res.data.WAIT_CHECK || 0
-          this.tabPaneData[4].countNum = res.data.FINISH || 0
-          this.tabPaneData[5].countNum = res.data.CANCEL || 0
+          // this.tabPaneData[1].countNum = res.data.WAIT_CONFIRM || 0
+          this.tabPaneData[1].countNum = res.data.WAIT_OUT_STOCK || 0
+          this.tabPaneData[2].countNum = res.data.WAIT_CHECK || 0
+          this.tabPaneData[3].countNum = res.data.FINISH || 0
+          this.tabPaneData[4].countNum = res.data.CANCEL || 0
           this.queryParam.bizType = this.curBizType
           this.$refs.table.refresh(!flag)
         }
@@ -437,6 +491,9 @@ export default {
       })
       this.curBizType = this.$route.query && this.$route.query.bizType || this.curBizType
       this.queryByTypeSum()
+      if (this.$route.query && this.$route.query.bizType == 'ALL') {
+        this.openSlodOut = true
+      }
     }
   },
   watch: {

+ 20 - 14
src/views/numsGoodsShelves/replenishmentManagement/outWarehousingModal.vue

@@ -12,27 +12,34 @@
       <a-form-model
         id="replenishmentManagement-outWarehousing-form"
         ref="ruleForm"
-        layout="inline"
         :model="form"
         :rules="rules"
         style="margin-bottom: 10px;" >
         <a-row :gutter="15">
-          <a-col :md="12" :sm="24">
-            <a-form-model-item label="补货单号">{{ basicInfoData && basicInfoData.replenishBillNo || '--' }}</a-form-model-item>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom: 0;" label="补货单号" :labelCol="{ span: 6}" :wrapperCol="{ span: 16 }">{{ basicInfoData && basicInfoData.replenishBillNo || '--' }}</a-form-model-item>
           </a-col>
-          <a-col :md="12" :sm="24">
-            <a-form-model-item label="创建时间">{{ basicInfoData && basicInfoData.createDate || '--' }}</a-form-model-item>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom: 0;" label="创建时间" :labelCol="{ span: 6}" :wrapperCol="{ span: 16 }">{{ basicInfoData && basicInfoData.createDate || '--' }}</a-form-model-item>
           </a-col>
-          <!-- <a-col :md="12" :sm="24">
+          <!-- <a-col :span="12">
             <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="24" :sm="24">
-            <a-form-model-item label="出库备注">
-              <a-input id="replenishmentManagement-outWarehousing-remarks" v-model.trim="form.remarks" allowClear placeholder="请输入出库备注"/>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="24">
+            <a-form-model-item style="margin-bottom: 0;" label="出库备注" :labelCol="{ span: 3 }" :wrapperCol="{ span: 20 }">
+              <a-input
+                type="textarea"
+                id="replenishmentManagement-outWarehousing-remarks"
+                :maxLength="100"
+                v-model.trim="form.remarks"
+                allowClear
+                placeholder="请输入出库备注(最多100字符)"/>
             </a-form-model-item>
           </a-col>
         </a-row>
@@ -85,10 +92,9 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       columns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
-        { title: '产品编码', dataIndex: 'product.code', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'product.name', width: '32%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '补货应发数量', dataIndex: 'qty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实发数量', dataIndex: 'confirmQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品编码', dataIndex: 'product.code', width: '29%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '40%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '补货数量', dataIndex: 'qty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'product.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -145,7 +151,7 @@ export default {
               _this.listData.map((item, index) => {
                 arr.push({
                   productSn: item.productSn,
-                  confirmQty: item.confirmQty,
+                  confirmQty: item.qty,
                   replenishBillDetailSn: item.replenishBillDetailSn,
                   id: item.id
                 })

+ 7 - 10
src/views/numsGoodsShelves/replenishmentManagement/printStickerModal.vue

@@ -20,7 +20,7 @@
         size="small"
         :rowKey="(record) => record.id"
         rowKeyName="id"
-        :row-selection="{ columnWidth: 40 }"
+        :row-selection="!(basicInfoData&&basicInfoData.billState == 'FINISH' && !basicInfoData.totalPutQty)?{columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.printQty} })}:null"
         @rowSelection="rowSelectionFun"
         :columns="columns"
         :data="loadData"
@@ -44,7 +44,7 @@
         </template>
       </s-table>
       <div class="btn-cont">
-        <a-button type="primary" id="replenishmentManagement-printSticker-modal-save" @click="handleSave">开始打印</a-button>
+        <a-button v-if="!(basicInfoData && basicInfoData.billState == 'FINISH' && !basicInfoData.totalPutQty)" type="primary" id="replenishmentManagement-printSticker-modal-save" @click="handleSave">开始打印</a-button>
         <a-button id="replenishmentManagement-printSticker-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-spin>
@@ -58,7 +58,7 @@
 import { commonMixin } from '@/utils/mixin'
 import printView from './printView.vue'
 import { STable, VSelect } from '@/components'
-import { shelfReplenishDetailList, shelfReplenishDetail, shelfReplenishPrintSign } from '@/api/shelfReplenish'
+import { shelfReplenishDetailList, shelfReplenishDetail } from '@/api/shelfReplenish'
 export default {
   name: 'PrintStickerModal',
   components: { STable, VSelect, printView },
@@ -90,8 +90,8 @@ export default {
             data = res.data
             for (var i = 0; i < data.length; i++) {
               data[i].no = i + 1
-              data[i].maxQty = data[i].billState == 'FINISH' ? data[i].putQty : data[i].confirmQty
-              data[i].printQty = data[i].billState == 'FINISH' ? data[i].putQty : data[i].confirmQty
+              data[i].maxQty = data[i].billState == 'FINISH' ? data[i].putQty : data[i].qty
+              data[i].printQty = data[i].billState == 'FINISH' ? data[i].putQty : data[i].qty
             }
             this.disabled = false
             this.listData = data || []
@@ -114,14 +114,11 @@ export default {
       const ret = [
         { title: '产品编码', dataIndex: 'product.code', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', width: '30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '补货应发数量', dataIndex: 'qty', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实发数量', dataIndex: 'confirmQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补货数量', dataIndex: 'qty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '签收数量', dataIndex: 'putQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '打印数量', scopedSlots: { customRender: 'printQty' }, width: '15%', align: 'center' },
         { title: '单位', dataIndex: 'product.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
-      if (this.basicInfoData && this.basicInfoData.billState == 'FINISH') {
-        ret.splice(4, 0, { title: '签收数量', dataIndex: 'putQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
       return ret
     }
   },

+ 3 - 4
src/views/numsGoodsShelves/replenishmentManagement/putWarehousingModal.vue

@@ -40,7 +40,7 @@
         <!-- 签收数量 -->
         <template slot="putQty" slot-scope="text, record">
           <a-input-number
-            v-if="record.confirmQty&&record.confirmQty!=0"
+            v-if="record.qty&&record.qty!=0"
             size="small"
             id="replenishmentManagement-outWarehousing-putQty"
             v-model="record.putQty"
@@ -88,8 +88,7 @@ export default {
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '产品编码', dataIndex: 'product.code', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', width: '28%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '补货应发数量', dataIndex: 'qty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实发数量', dataIndex: 'confirmQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补货数量', dataIndex: 'qty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '签收数量', scopedSlots: { customRender: 'putQty' }, width: '15%', align: 'center' },
         { title: '单位', dataIndex: 'product.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
@@ -103,7 +102,7 @@ export default {
             data = res.data
             for (var i = 0; i < data.length; i++) {
               data[i].no = i + 1
-              data[i].putQty = data[i].confirmQty
+              data[i].putQty = data[i].qty
             }
             this.disabled = false
             this.listData = data || []

+ 168 - 0
src/views/numsGoodsShelves/replenishmentManagement/slodOutModal.vue

@@ -0,0 +1,168 @@
+<template>
+  <a-modal
+    centered
+    class="replenishmentManagement-confirm-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="待补货产品"
+    v-model="isShow"
+    @cancel="isShow = false"
+    width="80%">
+    <div>
+      <a-spin :spinning="spinning" tip="Loading...">
+        <div class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-row :gutter="15">
+              <a-col :md="8" :sm="24">
+                <a-form-item label="货架名称">
+                  <shelfSList v-model="queryParam.shelfSn"></shelfSList>
+                </a-form-item>
+              </a-col>
+              <a-col :md="8" :sm="24">
+                <span class="table-page-search-submitButtons">
+                  <a-button type="primary" style="margin-left: 5px" @click="$refs.table.refresh(true)" :disabled="disabled">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled">重置</a-button>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <div class="pages-wrap" style="margin-top:10px;">
+          <!-- 列表 -->
+          <s-table
+            class="sTable"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.id"
+            :columns="columns"
+            :data="loadData"
+            :style="{ height: '450px' }"
+            :scroll="{ y: 400 }"
+            :showPagination="false"
+            bordered>
+            <template slot="shelfName" slot-scope="text, record">
+              {{ text }}<span style="color:#ff5500;margin-left:5px;" v-if="record.state!=='ENABLE'">(状态为“已暂停”)</span>
+            </template>
+            <template slot="action" slot-scope="text, record">
+              <span class="table-td-link" @click.stop="handleDetail(record)">产品明细</span>
+            </template>
+          </s-table>
+        </div>
+      </a-spin>
+      <!-- 生成补货单 -->
+      <creatReplenishmentOrder :openModal="openCreatRoModal" :nowData="nowData" @ok="resetSearchForm" @close="openCreatRoModal=false" />
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import shelfSList from '@/views/common/shelfList'
+import { queryListForReplenish } from '@/api/shelf'
+import creatReplenishmentOrder from './creatReplenishmentOrder.vue'
+export default {
+  name: 'SlodOutModal',
+  components: { STable, VSelect, shelfSList, creatReplenishmentOrder },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      openCreatRoModal: false,
+      disabled: false,
+      queryParam: {
+        shelfSn: undefined
+      },
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center', customRender: function (text) { return text } },
+        { title: '货架名称', dataIndex: 'shelfName', scopedSlots: { customRender: 'shelfName' }, width: '35%', align: 'left' },
+        { title: '待补产品款数', dataIndex: 'productCategory', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, sorter: true },
+        { title: '待补产品数量', dataIndex: 'productQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, sorter: true },
+        { title: '最近一次补货时间', dataIndex: 'lastDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        if (parameter.sortOrder) {
+          this.queryParam.queryWord = parameter.sortField
+          this.queryParam.orderBy = parameter.sortOrder == 'ascend' ? 'ASC' : 'DESC'
+        } else {
+          this.queryParam.queryWord = undefined
+          this.queryParam.orderBy = undefined
+        }
+        return queryListForReplenish(this.queryParam).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      localDataSource: [],
+      detailData: null, //  详情数据
+      nowData: null
+    }
+  },
+  methods: {
+    // 重置
+    resetSearchForm () {
+      this.queryParam.shelfSn = undefined
+      this.$refs.table.refresh(true)
+    },
+    handleDetail (row) {
+      if (row.productCategory && row.productQty) {
+        this.nowData = row
+        this.openCreatRoModal = true
+      } else {
+        this.$message.info('此货架没有待补货产品')
+      }
+    },
+    pageInit () {
+      const vm = this
+      vm.$nextTick(() => {
+        vm.resetSearchForm()
+        vm.spinning = false
+        vm.disabled = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        this.pageInit()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.replenishmentManagement-confirm-modal {
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 9 - 7
src/views/numsGoodsShelves/shelfMonitoring/addModal.vue

@@ -35,9 +35,9 @@
             v-model="record.confirmQty"
             :precision="0"
             :min="0"
-            :max="record.qty"
+            :max="record.recallBillQty? record.qty - record.recallBillQty :record.qty"
             placeholder="请输入"
-            :style="{width: '100%', color: record.confirmQty==0 ? 'red': ''}" />
+            :style="{width: '100%', color: record.confirmQty<=0 ? 'red': ''}" />
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record, index">
@@ -87,8 +87,9 @@ export default {
         { title: '货位号', dataIndex: 'shelfPlaceCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '当前库存', dataIndex: 'qty', 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: 'recallBillQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '当前库存', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '最大库容', dataIndex: 'maxQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '滞销天数', dataIndex: 'unsalableDays', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调货数量', scopedSlots: { customRender: 'confirmQty' }, width: '10%', align: 'center' },
         { title: '单位', dataIndex: 'productUnit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -103,7 +104,7 @@ export default {
       const _this = this
       const arr = []
       const arrInd = []
-      this.spinning = true
+
       this.listData.map((item, index) => {
         if (item.confirmQty) {
           arr.push({
@@ -123,6 +124,7 @@ export default {
         this.$message.warning('调回数量不能为空或0,请移除后提交')
         return
       }
+      this.spinning = true
       const params = {
         shelfSn: this.nowData && this.nowData.shelfInfo && this.nowData.shelfInfo.shelfSn,
         detailList: arr
@@ -148,11 +150,11 @@ export default {
       this.nowData.list.map((item, index) => {
         params.push(item.shelfProductSn)
       })
-      shelfControlList({ shelfProductSnList: params }).then(res => {
+      shelfControlList({ shelfProductSnList: params, shelfSn: this.nowData.shelfInfo.shelfSn }).then(res => {
         if (res.status == 200 && res.data) {
           res.data.map((item, index) => {
             item.no = index + 1
-            item.confirmQty = item.qty
+            item.confirmQty = item.recallBillQty ? item.qty - item.recallBillQty : item.qty
           })
           this.listData = res.data
         }

+ 31 - 2
src/views/numsGoodsShelves/shelfMonitoring/list.vue

@@ -79,6 +79,13 @@
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="shelfMonitoringList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="shelfMonitoringList-reset">重置</a-button>
+              <a-button
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="salesManagementList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -155,7 +162,8 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import addModal from './addModal.vue'
 import shelfSList from '@/views/common/shelfList'
-import { shelfControlList } from '@/api/shelf'
+import { shelfControlList, exportShelfControlReport } from '@/api/shelf'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   components: { STable, VSelect, addModal, shelfSList },
   mixins: [commonMixin],
@@ -178,7 +186,8 @@ export default {
       rules: {
         'shelfSn': [{ required: true, message: '请选择货架', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
+      disabled: false, //  查询、重置、导出按钮是否可操作
+      exportLoading: false, // 导出loading
       columns: [
         { title: '货位号', dataIndex: 'shelfPlaceCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '绑定产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -271,6 +280,7 @@ export default {
     handleSearch () {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
+          this.$refs.table.clearSelected()
           this.$refs.table.refresh(true)
           this.isSearch = true
         } else {
@@ -289,8 +299,27 @@ export default {
       this.queryParam.state = undefined
       this.queryParam.unsalableDaysBegin = undefined
       this.queryParam.unsalableDaysEnd = undefined
+      this.$refs.table.clearSelected()
       this.handleSearch()
     },
+    // 导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          exportShelfControlReport(params).then(res => {
+            downloadExcel(res, this.shelfName)
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
     // 新增调回单
     handleAddBack () {
       if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length < 1)) {

+ 7 - 1
src/views/numsGoodsShelves/shelfSet/addHwModal.vue

@@ -140,6 +140,9 @@ 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.form.oldPrice = obj && obj.row && obj.row.price || ''
+      this.form.oldCost = obj && obj.row && obj.row.cost || ''
+      this.form.oldMaxQty = ''
     },
     placeCodeBlur (v) {
     	this.$nextTick(() => {
@@ -165,7 +168,10 @@ export default {
               productCode: form.productCode,
               price: form.price,
               cost: form.cost,
-              maxQty: form.maxQty
+              maxQty: form.maxQty,
+              oldPrice: form.oldPrice,
+              oldCost: form.oldCost,
+              oldMaxQty: form.oldMaxQty
             }
           }
           // 开始提交数据

+ 6 - 0
src/views/numsGoodsShelves/shelfSet/bindProductModal.vue

@@ -136,6 +136,8 @@ export default {
       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.form.oldPrice = obj && obj.row && obj.row.price || ''
+      this.form.oldCost = obj && obj.row && obj.row.cost || ''
       this.productName = obj && obj.row && obj.row.name || ''
       this.$refs.ruleForm.validate()
     },
@@ -145,6 +147,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
+          form.shelfSn = _this.nowData && _this.nowData.shelfSn
           form.shelfPlaceSn = _this.nowData && _this.nowData.shelfPlaceSn
           if (this.type != 'bind') { // 修改信息、更换产品
             form.shelfProductSn = _this.nowData && _this.nowData.shelfProductApiEntity && _this.nowData.shelfProductApiEntity.shelfProductSn
@@ -181,6 +184,9 @@ export default {
           this.form.price = res.data.price
           this.form.cost = res.data.cost
           this.form.maxQty = res.data.maxQty
+          this.form.oldPrice = res.data.price
+          this.form.oldCost = res.data.cost
+          this.form.oldMaxQty = res.data.maxQty
         } else {
           this.productInfo = null
           this.$refs.ruleForm.resetFields()

+ 11 - 3
src/views/salesManagement/salesQuery/chooseCustomModal.vue

@@ -151,7 +151,7 @@
             </a-col>
             <a-col :span="8">
               <a-form-model-item label="铺货出库" prop="distributionFlag">
-                <v-select code="FLAG" id="chooseCustom-distributionFlag" v-model="form.distributionFlag" allowClear placeholder="请选择"></v-select>
+                <v-select code="FLAG" id="chooseCustom-distributionFlag" v-model="form.distributionFlag" allowClear placeholder="请选择是否铺货出库"></v-select>
               </a-form-model-item>
             </a-col>
           </a-row>
@@ -206,7 +206,11 @@ export default {
   name: 'ChooseCustomModal',
   components: { VSelect, CustomerManagementEdit, selectCust, settleStyle },
   props: {
-    show: [Boolean]
+    show: [Boolean],
+    distributionFlag: {
+      type: [String, Number],
+      default: '0'
+    }
   },
   data () {
     return {
@@ -240,7 +244,7 @@ export default {
         settleStyleSn: undefined, //  收款方式
         salesManSn: undefined, //  业务员
         salesManName: '',
-        distributionFlag: '0', // 铺货出库
+        distributionFlag: undefined, // 铺货出库
         salesTragetType: 'CUSTOMER',
         remarks: '' //  备注
       },
@@ -564,6 +568,10 @@ export default {
         this.getArea('province')
         this.getUserAllList()
       }
+    },
+    distributionFlag (newValue, oldValue) {
+      console.log(newValue, oldValue)
+      this.form.distributionFlag = newValue.toString()
     }
   }
 }

+ 433 - 0
src/views/salesManagement/salesQuery/chooseShelfProduct.vue

@@ -0,0 +1,433 @@
+<template>
+  <a-modal
+    centered
+    class="chooseShelf-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="mtitle"
+    v-model="isShow"
+    @cancel="isShow = false"
+    width="80%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-tabs type="card">
+        <a-tab-pane :defaultActiveKey="curTab" v-model="curTab" :key="1" tab="待补货产品">
+          <!-- 搜索条件 -->
+          <div class="table-page-search-wrapper">
+            <a-form-model
+              ref="ruleForm"
+              class="form-model-con"
+              layout="inline"
+              :model="queryParam"
+              @keyup.enter.native="$refs.table.refresh(true)" >
+              <a-row :gutter="15">
+                <a-col :md="4" :sm="24">
+                  <a-form-model-item label="产品编码">
+                    <a-input id="chooseShelf-code" ref="searchProductCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :md="4" :sm="24">
+                  <a-form-model-item label="产品名称">
+                    <a-input id="chooseShelf-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-model-item label="产品分类">
+                    <ProductType id="chooseShelf-productType" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-model-item label="库存情况">
+                    <a-checkbox-group v-model.trim="queryParam.stockStateList" :options="options" />
+                  </a-form-model-item>
+                </a-col>
+                <a-col :md="4" :sm="12" style="margin-bottom: 10px;">
+                  <a-button type="primary" @click="$refs.table.refresh(true)" id="chooseShelf-refresh">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm" id="chooseShelf-reset">重置</a-button>
+                </a-col>
+              </a-row>
+            </a-form-model>
+          </div>
+          <div class="chooseShelf-modal-table">
+            <div class="table-operator">
+              <div>
+                <a-button type="primary" @click="handlePlAdd">批量添加</a-button>
+                <span style="margin-left: 10px;" v-if="selectTotal">已选{{ selectTotal }}项</span>
+              </div>
+              <div>
+                <a-icon type="info-circle" />
+                此界面仅显示货架上需要补货的产品
+              </div>
+            </div>
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.id"
+              :row-selection="{columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.includeFlag == 1 } })}"
+              @rowSelection="rowSelectionFun"
+              :columns="columns"
+              :data="loadData"
+              :style="{ height: '500px' }"
+              :scroll="{ y: 450 }"
+              :showPagination="false"
+              bordered>
+              <!-- 售价 -->
+              <template slot="salePrice" slot-scope="text, record">
+                <div style="display: flex;align-items: center;" @dblclick.stop>
+                  <a-input-number
+                    size="small"
+                    v-model="record.price"
+                    :precision="2"
+                    :min="0"
+                    :max="999999"
+                    style="width: 100%;"
+                    placeholder="请输入" />
+                  <span style="color: red;margin: 0 2px;font-size: 14px;" v-if="record.origSalePriceFlag == 1">原</span>
+                  <span v-else>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+                </div>
+              </template>
+              <!-- 销售数量 -->
+              <template slot="nums" slot-scope="text, record">
+                <div @dblclick.stop>
+                  <a-input-number
+                    size="small"
+                    v-model="record.salesNums"
+                    :precision="0"
+                    :min="0"
+                    :max="999999"
+                    style="width: 100%;"
+                    placeholder="请输入" />
+                </div>
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button
+                  size="small"
+                  type="link"
+                  class="button-primary"
+                  @click.stop="handleAdd(record)"
+                  v-if="record.includeFlag != 1"
+                  id="productInfoList-edit-btn">添加</a-button>
+                <span style="color:#999;" v-else>已添加</span>
+                <a-button
+                  size="small"
+                  type="link"
+                  class="button-primary"
+                  @click.stop="handleDetail(record)"
+                  id="productInfoList-detail-btn"
+                  style="margin-left: 5px;">销售记录</a-button>
+              </template>
+            </s-table>
+          </div>
+        </a-tab-pane>
+        <a-tab-pane :key="2" tab="全部货架产品">
+          <!-- 搜索条件 -->
+          <div class="table-page-search-wrapper">
+            <a-form-model
+              ref="ruleForm1"
+              class="form-model-con"
+              layout="inline"
+              :model="queryParam1"
+              @keyup.enter.native="$refs.table1.refresh(true)" >
+              <a-row :gutter="15">
+                <a-col :md="6" :sm="24">
+                  <a-form-model-item label="产品编码">
+                    <a-input id="chooseShelf-code1" v-model.trim="queryParam1.productCode" allowClear placeholder="请输入产品编码"/>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-model-item label="产品名称">
+                    <a-input id="chooseShelf-name1" v-model.trim="queryParam1.productName" allowClear placeholder="请输入产品名称"/>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-model-item label="产品分类">
+                    <ProductType id="chooseShelf-productType1" :isDealer="true" @change="changeProductType1" v-model="productType1"></ProductType>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :md="6" :sm="12" style="margin-bottom: 10px;">
+                  <a-button type="primary" @click="$refs.table1.refresh(true)" id="chooseShelf-refresh">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm1" id="chooseShelf-reset">重置</a-button>
+                </a-col>
+              </a-row>
+            </a-form-model>
+          </div>
+          <div class="chooseShelf-modal-table">
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table1"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="columns1"
+              :data="loadData1"
+              :style="{ height: '500px' }"
+              :scroll="{ y: 450 }"
+              :showPagination="false"
+              bordered>
+            </s-table>
+          </div>
+        </a-tab-pane>
+      </a-tabs>
+    </a-spin>
+    <!-- 销售记录 -->
+    <product-salesRecord-modal ref="salseRecord" :openModal="showRecord" @close="showRecord=false" />
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import ProductType from '../../common/productType.js'
+import productSalesRecordModal from './productSalesRecordModal.vue'
+import { queryWaitReplenish, queryShelfProduct } from '@/api/shelfReplenish'
+export default {
+  name: 'OutinDetailModal',
+  components: { STable, ProductType, productSalesRecordModal },
+  mixins: [commonMixin],
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    baseData: {
+      type: Object,
+      default: function () {
+        return null
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      advanced: false,
+      showRecord: false,
+      isShow: this.openModal, //  是否打开弹框
+      options: [
+        { label: '库存充足', value: 'stockEnough' },
+        { label: '部分缺货', value: 'portionStockout' },
+        { label: '全部缺货', value: 'allStockout' }
+      ],
+      curTab: 1,
+      productType: [],
+      queryParam: {
+        productCode: '', //  产品编码
+        productName: '', //  产品名称
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        stockStateList: []
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        this.queryParam.shelfSn = this.baseData.shelfSn
+        this.queryParam.customerSn = this.baseData.customerSn
+        this.queryParam.salePriceType = this.baseData.salePriceType
+        this.queryParam.salesBillSn = this.baseData.salesBillSn
+
+        return queryWaitReplenish(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i] = data[i].shelfProductApi
+              data[i].no = no + i + 1
+              data[i].salesNums = data[i].replenishBillWaitQty
+              data[i].putCost = data[i].cost
+            }
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      rowSelectionInfo: null,
+      // -------- 全部产品 --------
+      productType1: [],
+      queryParam1: {
+        productCode: '', //  产品编码
+        productName: '', //  产品名称
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '' //  产品三级分类
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData1: parameter => {
+        this.spinning = true
+        this.queryParam1.shelfSn = this.baseData.shelfSn
+        this.queryParam1.customerSn = this.baseData.customerSn
+        this.queryParam1.salePriceType = this.baseData.salePriceType
+        this.queryParam1.salesBillSn = this.baseData.salesBillSn
+        return queryShelfProduct(Object.assign(parameter, this.queryParam1)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+            }
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    mtitle () {
+      return '货架产品' + (this.baseData && this.baseData.shelfName ? this.baseData.shelfName : '')
+    },
+    selectTotal () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '最大库容', dataIndex: 'maxQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '货架库存', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补货在途', dataIndex: 'replenishBillQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调回在途', dataIndex: 'recallBillQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '待补货数量', dataIndex: 'replenishBillWaitQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '门店库存数量', dataIndex: 'qplsStockQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'price', scopedSlots: { customRender: 'salePrice' }, width: '8%', align: 'center' },
+        { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '8%', align: 'center' },
+        { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      return arr
+    },
+    columns1 () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '最大库容', dataIndex: 'maxQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '货架库存', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补货在途', dataIndex: 'replenishBillQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调回在途', dataIndex: 'recallBillQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    cansel () {
+      this.isShow = false
+    },
+    // 销售记录
+    handleDetail (row) {
+      this.showRecord = true
+      this.$refs.salseRecord.getDetail(this.baseData.customerSn, row.productSn, row)
+    },
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    // 添加
+    handleAdd (row) {
+      const clist = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+      const blist = this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys || []
+      const i = clist.findIndex(item => item.id == row.id)
+      const k = blist.findIndex(item => item == row.id)
+      console.log(i, k)
+      if (i >= 0) {
+        clist.splice(i, 1)
+      }
+      if (k >= 0) {
+        blist.splice(k, 1)
+      }
+      this.$emit('add', row)
+    },
+    // 批量添加
+    handlePlAdd () {
+      if (this.selectTotal) {
+        this.$emit('plAdd', this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || [])
+      } else {
+        this.$message.info('请选择产品')
+      }
+    },
+    resetSearchForm () {
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.productType = []
+      this.queryParam.stockStateList = []
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearSelected()
+      this.$refs.table.refresh(true)
+    },
+    reload () {
+      // this.$refs.table.clearSelected()
+      this.$refs.table.refresh()
+    },
+    // ---------- 全部产品----------
+    //  产品分类  change
+    changeProductType1 (val, opt) {
+      this.queryParam1.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam1.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam1.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    resetSearchForm1 () {
+      this.queryParam1.productCode = ''
+      this.queryParam1.productName = ''
+      this.queryParam1.productTypeSn1 = ''
+      this.queryParam1.productTypeSn2 = ''
+      this.queryParam1.productTypeSn3 = ''
+      this.productType1 = []
+      this.$refs.ruleForm1.resetFields()
+      this.$refs.table1.refresh(true)
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        this.$nextTick(() => {
+          this.curTab = 1
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.chooseShelf-modal {
+	.ant-modal-body {
+		padding: 0;
+    .chooseShelf-modal-table{
+      padding: 0 20px 10px;
+      .table-operator{
+        padding:0 10px 10px 0;
+        display:flex;
+        justify-content: space-between;
+        align-items: center;
+      }
+    }
+    .table-page-search-wrapper{
+      padding: 5px 20px 0;
+    }
+	}
+}
+</style>

+ 3 - 3
src/views/salesManagement/salesQuery/detail.vue

@@ -39,8 +39,8 @@
               <a-descriptions-item label="销售单号">{{ detailData&&detailData.salesBillNo || '--' }}</a-descriptions-item>
               <a-descriptions-item label="制单人">{{ detailData&&detailData.operatorName || '--' }}</a-descriptions-item>
               <a-descriptions-item label="业务员">{{ detailData&&detailData.salesManName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="来源">{{ detailData&&detailData.salesBillSourceDictValue || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="下级采购单号" v-if="detailData&&detailData.salesBillSource=='PURCHASE'">{{ detailData&&detailData.purchaseBillNo || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="来源">{{ detailData&&detailData.sourceTypeDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="下级采购单号" v-if="detailData&&detailData.sourceType=='PURCHASE'">{{ detailData&&detailData.purchaseBillNo || '--' }}</a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
               <a-descriptions-item label="财务状态">{{ detailData&&detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
             </a-descriptions>
@@ -186,7 +186,7 @@ export default {
   computed: {
     // 是否自建单据
     isOwerEdit () {
-      return this.detailData && this.detailData.salesBillSource == 'SALES'
+      return this.detailData && this.detailData.sourceType == 'SALES'
     },
     // 是否审核通过
     isAudit () {

+ 80 - 18
src/views/salesManagement/salesQuery/edit.vue

@@ -66,7 +66,7 @@
         <!-- 搜索条件 -->
         <div class="table-page-search-wrapper">
           <a-row :gutter="15">
-            <a-col :span="16">
+            <a-col :md="24" :lg="14">
               <a-form-model :model="productForm" ref="ruleForm" layout="inline" @keyup.enter.native="$refs.table.refresh(true)" >
                 <a-row :gutter="15">
                   <a-col :md="8" :sm="24">
@@ -88,8 +88,8 @@
                 </a-row>
               </a-form-model>
             </a-col>
-            <a-col :span="8">
-              <div style="float:right;overflow: hidden;">
+            <a-col :md="24" :lg="10">
+              <div style="float:right;overflow: hidden;margin-bottom:10px;">
                 <a-checkbox :value="0" :checked="tbForm.indexOf('AUDIT')>=0" @change="(e)=>{tbFormChange(e,0)}" id="salesQuery-tbsh">同步审核</a-checkbox>
                 <a-checkbox :value="1" :checked="tbForm.indexOf('STOCK_OUT')>=0" @change="(e)=>{tbFormChange(e,1)}" id="salesQuery-tbck">同步出库</a-checkbox>
                 <a-checkbox :value="2" :checked="tbForm.indexOf('SETTLE')>=0" @change="(e)=>{tbFormChange(e,2)}" id="salesQuery-tbsk">同步收款</a-checkbox>
@@ -103,8 +103,13 @@
                 <a-button
                   type="default"
                   @click="openGuideModal=true"
-                  :loading="delLoading"
-                  id="salesEdit-del-all">导入产品</a-button>
+                  style="margin-right:5px;"
+                  id="salesEdit-import">导入产品</a-button>
+                <a-button
+                  type="default"
+                  v-if="shelfInfo&&shelfInfo.state=='ENABLE'"
+                  @click="showShelfModal=true"
+                  id="salesEdit-shelf">货架产品</a-button>
                 <a-button
                   type="link"
                   @click="delSalerOrder"
@@ -134,6 +139,11 @@
               <span style="margin-right: 5px;">实际总成本</span> <a-icon type="question-circle" />
             </a-tooltip>
           </div>
+          <!-- 产品名称 -->
+          <template slot="productName" slot-scope="text, record">
+            <a-tag color="blue" v-if="record.shelfPlaceCode">{{ record.shelfPlaceCode }}</a-tag>
+            <span>{{ text }}</span>
+          </template>
           <!-- 产品编码 -->
           <template slot="productCode" slot-scope="text, record">
             <div v-if="detailData">
@@ -197,12 +207,21 @@
     <!-- <div class="affix-cont"></div> -->
     <!-- 选择客户弹框 -->
     <choose-custom-modal ref="custModal" :show="openModal" @updateData="updateData" @cancel="openModal=false" />
-    <!-- 导入明细 -->
+    <!-- 导入产品 -->
     <importGuideModal :openModal="openGuideModal" :params="{salesBillSn: $route.params.sn, salesBillNo:detailData?detailData.salesBillNo:''}" @close="openGuideModal=false" @ok="hanldeImprotOk" />
     <!-- 收付款弹框 -->
     <settleModal ref="settleModal" @ok="settleAcountPay" :openModal="openSettleModal" @close="openSettleModal=false"></settleModal>
-    <!-- 出库明细 -->
+    <!-- 出库明细 -->
     <outInDetialModal ref="outInDetialModal" outBizType="SALES" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
+    <!-- 选择货架产品 -->
+    <chooseShelfProduct
+      v-if="showShelfModal"
+      ref="chooseShelfProduct"
+      @add="insterProduct"
+      @plAdd="plInsterProduct"
+      :baseData="shelfInfo"
+      :openModal="showShelfModal"
+      @close="showShelfModal=false"></chooseShelfProduct>
   </div>
 </template>
 <script>
@@ -214,14 +233,16 @@ import chooseCustomModal from './chooseCustomModal.vue'
 import importGuideModal from './importGuideModal.vue'
 import settleModal from '@/views/financialManagement/settleModal/settleModal.vue'
 import { stockByProductSn } from '@/api/stock'
+import { queryByCustomerSn } from '@/api/shelf'
 import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint, salesDetailExport, salesDel } from '@/api/sales'
-import { salesDetailList, salesDetailInsert, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport } from '@/api/salesDetail'
+import { salesDetailList, salesDetailInsert, salesDetailInsertBatch, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport } from '@/api/salesDetail'
 import outInDetialModal from '@/views/common/outInDetialModal.vue'
+import chooseShelfProduct from './chooseShelfProduct.vue'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'SalesEdit',
-  components: { STable, VSelect, queryPart, chooseCustomModal, Print, importGuideModal, settleModal, outInDetialModal },
+  components: { STable, VSelect, queryPart, chooseCustomModal, Print, importGuideModal, settleModal, outInDetialModal, chooseShelfProduct },
   mixins: [commonMixin],
   data () {
     return {
@@ -236,6 +257,7 @@ export default {
       openGuideModal: false, // 导入产品弹框
       openSettleModal: false, // 打开收款弹框
       enableFundAccount: false, // 是否开启资金账户管理
+      showShelfModal: false, // 货架产品弹框
       delLoading: false,
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
       dataSource: [],
@@ -268,13 +290,14 @@ export default {
         })
       },
       printerType: 'NEEDLE', //  打印机类型
-      isCosts: false // 是否显示成本价
+      isCosts: false, // 是否显示成本价
+      shelfInfo: null // 是否有货架
     }
   },
   computed: {
     // 是否自建单据
     isOwerEdit () {
-      return this.detailData && this.detailData.salesBillSource == 'SALES'
+      return this.detailData && this.detailData.sourceType == 'SALES'
     },
     // 是否审核通过
     isAudit () {
@@ -284,7 +307,7 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '13%', align: 'center', scopedSlots: { customRender: 'productName' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         // { title: '仓库', dataIndex: 'warehouseEntity.name', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
@@ -346,6 +369,7 @@ export default {
     updateData (priceType) {
       // 价格类型变更
       if (priceType != this.$route.params.priceType) {
+        this.getOrderDetail(true)
         this.$router.push({ name: 'salesEdit', params: { id: this.orderId, sn: this.salesBillSn, priceType: priceType } })
       } else {
         this.getOrderDetail(true)
@@ -559,7 +583,7 @@ export default {
       if (this.dataSource && this.dataSource.length > 0) {
         const hasRow = this.dataSource.find(item => item.productSn == row.productSn)
         if (hasRow) {
-          // this.$message.info('该产品已在当前销售单中存在!')
+          this.$message.info('该产品已在当前销售单中存在!')
           this.productForm = {
             productName: '',
             productCode: hasRow.dealerProductEntity && hasRow.dealerProductEntity.code || '',
@@ -631,11 +655,40 @@ export default {
           // this.resetSearchForm(true)  //  不刷新库存
           this.$refs.table.refresh(true)
           this.getOrderDetail(false)
+          if (this.showShelfModal) {
+            this.$refs.chooseShelfProduct.reload()
+          }
         }
         this.isInster = false
         // this.spinning = false
       })
     },
+    // 批量添加接口
+    plInsterProduct (list) {
+      const params = []
+      list.map(item => {
+        params.push({
+          buyerSn: this.detailData.buyerSn,
+          productSn: item.productSn,
+          cost: item.putCost,
+          price: item.price,
+          qty: item.salesNums,
+          salesBillSn: this.detailData.salesBillSn,
+          salesBillNo: this.detailData.salesBillNo,
+          stockSn: item.stockSn
+        })
+      })
+      this.$message.loading('正在批量添加产品...', 1)
+      salesDetailInsertBatch(params).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh(true)
+          this.getOrderDetail(false)
+          if (this.showShelfModal) {
+            this.$refs.chooseShelfProduct.reload()
+          }
+        }
+      })
+    },
     //  销售单详情
     getOrderDetail (flag) {
       salesDetail({ id: this.$route.params.id }).then(res => {
@@ -643,13 +696,26 @@ export default {
           this.detailData = res.data
           if (flag) {
             const vm = this
-            const buyerSn = (vm.detailData && vm.detailData.buyerSn && vm.detailData.salesBillSource && vm.detailData.salesBillSource == 'PURCHASE') ? '' : vm.detailData.buyerSn
+            const buyerSn = (vm.detailData && vm.detailData.buyerSn && vm.detailData.sourceType && vm.detailData.sourceType == 'PURCHASE') ? '' : vm.detailData.buyerSn
             const priceType = vm.$route.params.priceType
             vm.$refs.partQuery.pageInit(buyerSn, priceType, vm.salesBillSn)
+            // 查询关联的客户
+            if (vm.detailData && vm.detailData.buyerSn) {
+              this.getShelfQueryByCustomer()
+            }
           }
         }
       })
     },
+    getShelfQueryByCustomer () {
+      queryByCustomerSn({ sn: this.detailData.buyerSn }).then(res => {
+        if (res.data) {
+          this.shelfInfo = Object.assign(res.data, { salePriceType: this.$route.params.priceType, salesBillSn: this.salesBillSn })
+        } else {
+          this.shelfInfo = null
+        }
+      })
+    },
     // 提交销售单
     handleSubmit (params) {
       this.spinning = true
@@ -743,10 +809,6 @@ export default {
     	})
     }
   },
-  deactivated () {
-    // this.dataSource = []
-    // this.showPage = false
-  },
   beforeRouteEnter (to, from, next) {
     next(vm => {})
   }

+ 26 - 15
src/views/salesManagement/salesQuery/list.vue

@@ -34,9 +34,9 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="单据来源">
                   <v-select
-                    v-model="queryParam.salesBillSource"
-                    ref="salesBillSource"
-                    id="salesManagementList-salesBillSource"
+                    v-model="queryParam.sourceType"
+                    ref="sourceType"
+                    id="salesManagementList-sourceType"
                     code="SALES_SOURCE"
                     placeholder="请选择单据来源"
                     allowClear></v-select>
@@ -80,6 +80,11 @@
                   <a-input id="salesManagementList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
                 </a-form-item>
               </a-col>
+              <a-col :span="6">
+                <a-form-model-item label="铺货出库">
+                  <v-select code="FLAG" id="salesManagementList-distributionFlag" v-model="queryParam.distributionFlag" allowClear placeholder="请选择是否铺货出库"></v-select>
+                </a-form-model-item>
+              </a-col>
             </template>
             <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
@@ -104,7 +109,8 @@
       </div>
       <!-- 操作按钮 -->
       <div class="table-operator">
-        <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd">新增(零售)</a-button>
+        <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(0)">新增(零售)</a-button>
+        <a-button type="primary" class="button-warning" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(1)">新增(铺货)</a-button>
       </div>
       <!-- alert -->
       <a-alert type="info" style="margin-bottom:10px">
@@ -170,7 +176,7 @@
             size="small"
             type="link"
             class="button-primary"
-            v-if="((record.salesBillSource == 'SATELLITE' || record.salesBillSource == 'SALES' || record.salesBillSource == 'TEMPORARY_DISPATCHING') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')"
+            v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')"
             @click="handleEdit(record)"
           >
             编辑
@@ -179,7 +185,7 @@
             size="small"
             type="link"
             class="button-error"
-            v-if="((record.salesBillSource == 'SATELLITE' || record.salesBillSource == 'SALES' || record.salesBillSource == 'TEMPORARY_DISPATCHING') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel')"
+            v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel')"
             @click="handleDel(record)"
           >
             删除
@@ -188,7 +194,7 @@
             size="small"
             type="link"
             class="button-primary"
-            v-if="(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesEdit')"
+            v-if="(record.sourceType == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesEdit')"
             @click="handleEdit(record)"
           >
             改单
@@ -197,17 +203,17 @@
             size="small"
             type="link"
             class="button-error"
-            v-if="(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel')"
+            v-if="(record.sourceType == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel')"
             @click="handleDel(record, 'cancel')"
           >
             取消
           </a-button>
-          <span v-if="!(record.billStatus == 'WAIT_AUDIT' && $hasPermissions('B_salesAudit')) && !(record.billStatus == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_salesStockOut')) && !(((record.salesBillSource == 'SATELLITE' || record.salesBillSource == 'SALES' || record.salesBillSource == 'TEMPORARY_DISPATCHING') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')) && !(((record.salesBillSource == 'SATELLITE' || record.salesBillSource == 'SALES' || record.salesBillSource == 'TEMPORARY_DISPATCHING') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel')) && !((record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesEdit')) && !((record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel'))">--</span>
+          <span v-if="!(record.billStatus == 'WAIT_AUDIT' && $hasPermissions('B_salesAudit')) && !(record.billStatus == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_salesStockOut')) && !(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')) && !(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel')) && !((record.sourceType == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesEdit')) && !((record.sourceType == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel'))">--</span>
         </template>
       </s-table>
     </a-spin>
     <!-- 选择客户弹框 -->
-    <choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
+    <choose-custom-modal :show="openModal" :distributionFlag="distributionFlag" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
     <!-- 审核 -->
     <auditModal :openModal="visibleAudit" :spinning="spinningAudit" @close="visibleAudit=false" @ok="auditOrder('WAIT_OUT_WAREHOUSE')" @fail="auditOrder('AUDIT_REJECT')" />
   </a-card>
@@ -258,7 +264,8 @@ export default {
         settleStyleSn: undefined, //  收款方式
         billStatus: undefined, //  业务状态
         financialStatus: undefined, //  财务状态
-        salesBillSource: undefined
+        sourceType: undefined,
+        distributionFlag: undefined
       },
       totalData: {
         totalAmount: 0,
@@ -266,10 +273,11 @@ export default {
         totalQty: 0,
         totalRecord: 0
       },
+      selType: '0', // 0零售 1铺货
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
-        { title: '来源', dataIndex: 'salesBillSourceDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '来源', dataIndex: 'sourceTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '9%', align: 'center' },
         { title: '客户名称', dataIndex: 'buyerName', align: 'center', width: '15%', customRender: function (text) { return text || '--' } },
         { title: '总款数', dataIndex: 'totalCategory', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -312,7 +320,8 @@ export default {
       },
       visibleAudit: false,
       auditInfo: null,
-      spinningAudit: false
+      spinningAudit: false,
+      distributionFlag: '0'
     }
   },
   methods: {
@@ -340,8 +349,9 @@ export default {
       }
     },
     // 新增
-    handleAdd () {
+    handleAdd (flag) {
       this.openModal = true
+      this.distributionFlag = flag
     },
     //  审核
     handleEexamine (row) {
@@ -453,7 +463,8 @@ export default {
       this.queryParam.settleStyleSn = undefined
       this.queryParam.billStatus = undefined
       this.queryParam.financialStatus = undefined
-      this.queryParam.salesBillSource = undefined
+      this.queryParam.sourceType = undefined
+      this.queryParam.distributionFlag = undefined
       this.$refs.custList.resetForm()
       if (!flag) {
         this.setIsHomeNav(this.$route.name, null)

+ 23 - 22
src/views/salesManagement/salesReturn/list.vue

@@ -91,28 +91,29 @@
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
-          <a-button
-            size="small"
-            type="link"
-            class="button-primary"
-            v-if="record.state == 'WAIT_AUDIT'&&$hasPermissions('B_salesReturnAudit')"
-            @click="handleEexamine(record)"
-            id="salesReturn-eexamine-btn">审核</a-button>
-          <a-button
-            size="small"
-            v-if="(record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT') &&$hasPermissions('B_salesReturnEdit')"
-            type="link"
-            class="button-primary"
-            @click="handleEdit(record,1)"
-            id="salesReturn-edit-btn">编辑</a-button>
-          <a-button
-            size="small"
-            v-if="(record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT') &&$hasPermissions('B_salesReturnDel')"
-            type="link"
-            class="button-error"
-            @click="handleDel(record)"
-            id="salesReturn-del-btn">删除</a-button>
-          <span v-if="record.state == 'FINISH' || (!(record.state == 'WAIT_AUDIT'&&$hasPermissions('B_salesReturnAudit')) && !((record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT') &&$hasPermissions('B_salesReturnEdit')) && !((record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT') &&$hasPermissions('B_salesReturnDel')))">--</span>
+          <div>
+            <a-button
+              size="small"
+              type="link"
+              class="button-primary"
+              v-if="record.state == 'WAIT_AUDIT'&&$hasPermissions('B_salesReturnAudit')"
+              @click="handleEexamine(record)"
+              id="salesReturn-eexamine-btn">审核</a-button>
+            <a-button
+              size="small"
+              v-if="(record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT') &&$hasPermissions('B_salesReturnEdit')"
+              type="link"
+              class="button-primary"
+              @click="handleEdit(record,1)"
+              id="salesReturn-edit-btn">编辑</a-button>
+            <a-button
+              size="small"
+              v-if="(record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT') &&$hasPermissions('B_salesReturnDel')"
+              type="link"
+              class="button-error"
+              @click="handleDel(record)"
+              id="salesReturn-del-btn">删除</a-button>
+          </div>
         </template>
       </s-table>
     </a-spin>

+ 1 - 1
vue.config.js

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