chenrui 3 years ago
parent
commit
fffc2aad15

+ 8 - 1
src/api/shelfRecall.js

@@ -37,7 +37,14 @@ export const shelfRecallCancel = params => {
     method: 'post'
   })
 }
-
+// 保存 调回单
+export const shelfRecallSave = params => {
+  return axios({
+    url: '/shelfRecall/insert',
+    data: params,
+    method: 'post'
+  })
+}
 // 删除仓位
 export const warehouseLocDel = params => {
   return axios({

+ 16 - 0
src/api/shelfReplenish.js

@@ -11,3 +11,19 @@ export const shelfReplenishList = (params) => {
     method: 'post'
   })
 }
+//  补货单 明细列表 不分页
+export const shelfReplenishDetailList = (params) => {
+  return axios({
+    url: '/shelfReplenish/detail/queryList',
+    data: params,
+    method: 'post'
+  })
+}
+//  补货单 取消补货单
+export const shelfReplenishCancel = (params) => {
+  return axios({
+    url: '/shelfReplenish/cancel',
+    data: params,
+    method: 'post'
+  })
+}

+ 0 - 1
src/utils/request.js

@@ -119,7 +119,6 @@ service.interceptors.response.use((response) => {
     })
   }
   store.commit('SET_loadingStatus', false)
-  console.log(response)
   return response
 }, err)
 

+ 38 - 45
src/views/numsGoodsShelves/replenishmentManagement/list.vue

@@ -44,25 +44,9 @@
       <!-- 标签页 -->
       <a-tabs type="card" v-model="queryParam.bizType" @change="handleTabChange" class="replenishmentManagementList-tabs ">
         <a-tab-pane v-for="item in tabPaneData" :key="item.bizType">
-          <span slot="tab">{{ item.bizName }}({{ item.countNum }})</span>
+          <p slot="tab">{{ item.bizName }}<span v-if="item.countNum || item.countNum==0">({{ item.countNum }})</span></p>
         </a-tab-pane>
       </a-tabs>
-      <!-- 列表 -->
-      <!-- <s-table
-        class="sTable fixPagination"
-        ref="table"
-        :style="{ height: tableHeight+84.5+'px' }"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        @expand="expandFun"
-        :expandRowByClick="true"
-        :scroll="{ y: tableHeight }"
-        :expandIcon="(props) => this.customExpandIcon(props)"
-        :showPagination="false"
-        :defaultLoadData="false"
-        bordered> -->
       <s-table
         class="sTable fixPagination"
         ref="table"
@@ -120,8 +104,9 @@ import stockModal from './stockModal.vue'
 import printStickerModal from './printStickerModal.vue'
 import outWarehousingModal from './outWarehousingModal.vue'
 import putWarehousingModal from './putWarehousingModal.vue'
-import { settleReceiptQuery, queryByTypeSum } from '@/api/settleReceipt'
-import { storeCallOutTypeList } from '@/api/storeCallOutType'
+import { queryByTypeSum } from '@/api/settleReceipt'
+import { shelfReplenishList, shelfReplenishDetailList, shelfReplenishCancel } from '@/api/shelfReplenish'
+
 export default {
   components: { STable, VSelect, rangeDate, custList, confirmModal, stockModal, printStickerModal, outWarehousingModal, putWarehousingModal },
   mixins: [commonMixin],
@@ -142,19 +127,19 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '补货单号', dataIndex: 'salesBfillNo', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '货架名称', dataIndex: 'dealerProductEntity.name', width: '21%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '状态', dataIndex: 'salesBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '补货应发总量', dataIndex: 'qsty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补货单号', dataIndex: 'replenishBillNo', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货架名称', dataIndex: 'shelfName', width: '21%', 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: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库总量', dataIndex: 'qtssy', 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: '18%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return settleReceiptQuery(Object.assign(parameter, this.queryParam)).then(res => {
+        return shelfReplenishList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -172,12 +157,12 @@ export default {
       },
       subColumns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
-        { title: '产品编码', dataIndex: 'salesBilslNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', width: '28%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '28%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '补货应发总量', dataIndex: 'qsty', 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: 'qtssy', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'salesBisslslNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '单位', dataIndex: 'productUnit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       listData: [],
       tabPaneData: [],
@@ -256,16 +241,16 @@ export default {
         content: '确认取消补货单吗?',
         centered: true,
         onOk () {
-          // _this.spinning = true
-          // storeCallOutOut({ storeCallOutSn: row.storeCallOutSn }).then(res => {
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //     _this.spinning = false
-          //   } else {
-          //     _this.spinning = false
-          //   }
-          // })
+          _this.spinning = true
+          shelfReplenishCancel({ replenishBillSn: record.replenishBillSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
         }
       })
     },
@@ -285,13 +270,11 @@ export default {
     // 获取子节点数据
     getSubItem (record) {
       this.spinning = true
-      storeCallOutTypeList({ pageNo: 1, pageSize: 20 }).then(res => {
+      shelfReplenishDetailList({ replenishBillSn: record.replenishBillSn }).then(res => {
         const ind = this.listData.findIndex(item => item.id == record.id)
         if (ind >= 0) {
-          // if (res.status == 200 && res.data && res.data.length) {
-          if (res.status == 200 && res.data && res.data.list.length) {
-            // this.listData[ind].subList = res.data
-            this.listData[ind].subList = res.data.list
+          if (res.status == 200 && res.data && res.data.length) {
+            this.listData[ind].subList = res.data
           } else {
             this.listData[ind].subList = []
           }
@@ -331,8 +314,18 @@ export default {
     queryByTypeSum () {
       queryByTypeSum({}).then(res => {
         if (res.data && res.status == 200) {
-          this.tabPaneData = res.data
-          this.queryParam.bizType = res.data[0].bizType
+          this.tabPaneData = [
+            { bizName: '全部', bizType: 'ALL', countNum: null },
+            { bizName: '待确认', bizType: 'SAF', countNum: 0 },
+            { bizName: '待出库', bizType: 'DFG', countNum: 0 },
+            { bizName: '待入库', bizType: 'CDE', countNum: 0 },
+            { bizName: '已完成', bizType: 'VBN', countNum: null },
+            { bizName: '已取消', bizType: 'XCV', countNum: null }
+          ]
+          this.queryParam.bizType = 'ALL'
+          this.tabPaneData[1].countNum = res.data.dqr || 0
+          this.tabPaneData[2].countNum = res.data.dck || 0
+          this.tabPaneData[3].countNum = res.data.drk || 0
           this.$refs.table.refresh(true)
         }
       })

+ 20 - 26
src/views/numsGoodsShelves/shelfMonitoring/addModal.vue

@@ -17,15 +17,15 @@
         <div slot="message">调回数量不能大于当前库存。如果调回数量为0,请移除此产品。</div>
       </a-alert>
       <!-- 列表 -->
-      <s-table
+      <a-table
         class="sTable"
         ref="table"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
-        :data="loadData"
+        :dataSource="listData"
         :scroll="{ y: 400 }"
-        :showPagination="false"
+        :pagination="false"
         bordered>
         <!-- 调回数量 -->
         <template slot="outQty" slot-scope="text, record">
@@ -48,7 +48,7 @@
             @click="handleDel(record)"
             id="shelfMonitoring-add-btn">移除</a-button>
         </template>
-      </s-table>
+      </a-table>
       <div class="btn-cont">
         <a-button type="primary" id="shelfMonitoring-add-modal-save" @click="handleSave">确认调回</a-button>
         <a-button id="shelfMonitoring-add-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
@@ -60,7 +60,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
-import { storeCallOutList } from '@/api/storeCallOut'
+import { shelfRecallSave } from '@/api/shelfRecall'
 export default {
   name: 'ShelfMonitoringAddModal',
   components: { STable, VSelect },
@@ -93,31 +93,22 @@ export default {
         { title: '单位', dataIndex: 'productUnit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        return storeCallOutList(Object.assign(parameter, this.queryParam)).then(res => {
-          let data
-          if (res.status == 200) {
-            data = res.data
-            const no = (data.pageNo - 1) * data.pageSize
-            for (var i = 0; i < data.list.length; i++) {
-              data.list[i].no = no + i + 1
-            }
-            this.disabled = false
-          }
-          this.spinning = false
-          return data
-        })
-      }
+      listData: []
     }
   },
   methods: {
     //  确认调回
     handleSave () {
-      this.$emit('ok')
-      this.$message.info('保存并确认成功,返回并刷新列表')
+      const _this = this
+      let params = {
+        shelfSn: ''
+      }
+      shelfRecallSave(params).then(res => {
+        if(res.status == 200){
+          _this.$emit('ok')
+          _this.$message.info('保存并确认成功,返回并刷新列表')
+        }
+      })
     },
     // 移除
     handleDel (row) {
@@ -133,8 +124,11 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.$refs.table.clearTable()
+        this.listData = []
+      }else{
+        this.listData = JSON.parse(JSON.stringify(this.nowData))
       }
+      console.log(this.nowData, this.listData)
     }
   }
 }