Explorar el Código

Merge branch 'develop_szhj' of jianguan-web/qpls-md-html into develop

陈瑞 hace 3 años
padre
commit
6a7755cf43

+ 2 - 1
package-lock.json

@@ -14329,7 +14329,8 @@
       "version": "4.0.8",
       "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz",
       "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=",
-      "dev": true
+      "dev": true,
+      "optional": true
     },
     "rx-lite-aggregates": {
       "version": "4.0.8",

+ 3 - 4
src/api/shelfRecall.js

@@ -53,11 +53,10 @@ export const shelfRecallStateCount = (params) => {
     method: 'post'
   })
 }
-// 删除仓位
-export const warehouseLocDel = params => {
+// 获取调回单详情
+export const shelfRecallDetail = params => {
   return axios({
-    url: `/warehouseLoc/delete/${params.id}`,
-    data: {},
+    url: `/shelfRecall/findBySn/${params.recallSn}`,
     method: 'get'
   })
 }

+ 59 - 45
src/views/numsGoodsShelves/recallManagement/list.vue

@@ -43,18 +43,9 @@
           </a-row>
         </a-form>
       </div>
-      <a-tabs v-model="activeKey" type="card" size="small" @change="tabChange">
-        <a-tab-pane :key="0" tab="全部">
-        </a-tab-pane>
-        <a-tab-pane :key="1">
-          <span slot="tab">
-            待退库
-            <a-badge count="5" :offset="[0,-20]"/>
-          </span>
-        </a-tab-pane>
-        <a-tab-pane :key="2" tab="已完成">
-        </a-tab-pane>
-        <a-tab-pane :key="3" tab="已取消">
+      <a-tabs type="card" v-model="queryParam.billState" @change="tabChange" class="replenishmentManagementList-tabs ">
+        <a-tab-pane v-for="item in tabsList" :key="item.code">
+          <p slot="tab">{{ item.name }}<span v-if="item.countNum&&item.code=='WAIT_CONFIRM'" style="color:red">({{ item.countNum }})</span></p>
         </a-tab-pane>
       </a-tabs>
       <s-table
@@ -86,13 +77,14 @@
             id="shelfMonitoringList-warehousing-btn">取消调回单</a-button>
         </template>
         <a-table
+          v-if="innerData&&innerData[index]"
           size="small"
           class="inner-table"
-          slot-scope="record"
+          slot-scope="record,index"
           slot="expandedRowRender"
           :rowKey="(rec) => rec.id"
           :columns="innerColumns"
-          :data-source="record.innerData"
+          :data-source="innerData[index].innerData"
           :pagination="false"
         >
         </a-table>
@@ -111,7 +103,7 @@ import { STable } from '@/components'
 import recallModal from './recallModal.vue'
 import getDate from '@/libs/getDate.js'
 import shelfList from '@/views/common/shelfList.vue'
-import { shelfRecallList, shelfRecallDetailList, shelfRecallCancel } from '@/api/shelfRecall.js'
+import { shelfRecallList, shelfRecallDetailList, shelfRecallCancel, shelfRecallStateCount } from '@/api/shelfRecall.js'
 export default {
   components: { STable, recallModal, rangeDate, shelfList },
   mixins: [commonMixin],
@@ -124,7 +116,7 @@ export default {
       advanced: false,
       currentData: null,
       activeKey: 0, // 默认的tab
-      tabsList: [{ code: 0, name: '全部' }, { code: 1, name: '待退库' }, { code: 2, name: '已完成' }, { code: 3, name: '已取消' }],
+      tabsList: [],
       time: [
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
@@ -133,31 +125,37 @@ export default {
         beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
         endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         recallBillNo: '',
-        shelfSn: '' // 数字货架sn
+        shelfSn: '', // 数字货架sn
+        billState: 'ALL'
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center' },
-        { title: '调回单号', dataIndex: 'recallBillNo', width: '20%', align: 'center' },
-        { title: '货架名称', dataIndex: 'remarks', width: '25%', align: 'left', scopedSlots: { customRender: 'remarks' } },
-        { title: '状态', dataIndex: 'state', width: '7%', align: 'center' },
-        { title: '调回总量', dataIndex: 'totalQty', width: '9%', align: 'center' },
-        { title: '实退总量', dataIndex: 'totalConfirmQty', width: '9%', 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: '货架名称', dataIndex: 'shelfInfo.shelfName', width: '25%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'state', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调回总量', dataIndex: 'totalQty', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '实退总量', dataIndex: 'totalConfirmQty', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', width: '10%', align: 'left', scopedSlots: { customRender: 'action' } }
       ],
       innerColumns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'left' },
-        { title: '调回数量', dataIndex: 'qty', width: '15%', align: 'center' },
-        { title: '实退数量', dataIndex: 'confirmQty', width: '15%', align: 'center' },
-        { title: '单位', dataIndex: 'unit', width: '15%', align: 'center' }
+        { title: '产品编码', dataIndex: 'product.code', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '30%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '调回数量', dataIndex: 'qty', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '实退数量', dataIndex: 'confirmQty', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'product.unit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
+      innerData: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return shelfRecallList(Object.assign(parameter, this.queryParam)).then(res => {
+        const params = this.queryParam
+        if (params.billState == 'ALL') {
+          params.billState = ''
+        }
+        return shelfRecallList(Object.assign(parameter, params)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -166,6 +164,7 @@ export default {
               data.list[i].no = no + i + 1
               data.list[i].innerData = []
             }
+            this.innerData = data.list || []
             this.disabled = false
           }
           this.spinning = false
@@ -176,8 +175,8 @@ export default {
   },
   methods: {
     // 选择货架
-    shelfChange (data) {
-
+    shelfChange (obj) {
+      this.queryParam.shelfSn = obj.key || undefined
     },
     // 时间改变
     dateChange (date) {
@@ -195,6 +194,21 @@ export default {
       this.queryParam.billState = key
       this.$refs.table.refresh(true)
     },
+    // 获取各类型下的数量
+    getSumByType () {
+      shelfRecallStateCount({}).then(res => {
+        if (res.status == 200) {
+          this.tabsList = [
+            { code: 'ALL', name: '全部', countNum: 0 }, { code: 'WAIT_CONFIRM', name: '待退库', countNum: 0 }, { code: 'FINISH', name: '已完成', countNum: 0 }, { code: 'CANCEL', name: '已取消', countNum: 0 }
+          ]
+          this.queryParam.billState = 'ALL'
+          this.tabsList[1].countNum = res.data.WAIT_CONFIRM || 0
+          this.tabsList[2].countNum = res.data.FINISH || 0
+          this.tabsList[3].countNum = res.data.CANCEL || 0
+          this.$refs.table.refresh()
+        }
+      })
+    },
     // 点击行或图标触发接口
     expand (expanded, record) {
       if (expanded) {
@@ -204,34 +218,33 @@ export default {
     // 获取子表格数据
     getinnerData (record) {
       this.spinning = true
-      shelfRecallDetailList({ shelfSn: record.shelfSn }).then(res => {
-        if (res.status == 200) {
-          record.innerData = res.data.data
-          const no = 0
-          for (var i = 0; i < this.innerData.length; i++) {
-            record.innerData[i].no = no + i + 1
+      shelfRecallDetailList({ recallBillSn: record.recallBillSn }).then(res => {
+        const ind = this.innerData.findIndex(item => item.id == record.id)
+        if (ind >= 0) {
+          if (res.status == 200 && res.data && res.data.length) {
+            res.data.map((item, index) => {
+              item.no = index + 1
+            })
+            this.innerData[ind].innerData = res.data
+          } else {
+            this.innerData[ind].innerData = []
           }
-        } else {
-          record.innerData = []
         }
         this.spinning = false
       })
     },
     // 重置
     resetSearchForm () {
-      this.time = [getDate.getCurrMonthDays().starttime, getDate.getCurrMonthDays().endtime]
+      this.$refs.rangeDate.resetDate(this.time)
       this.queryParam = {
         beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
         endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         recallBillNo: '', // 调回单号
-        shelfSn: '' // 数字货架sn
+        shelfSn: '', // 数字货架sn
+        billState: 'ALL'
       }
       this.$refs.table.refresh(true)
     },
-    // 申请提现
-    handleTX () {
-      this.showModal = true
-    },
     // 退库
     handleRecall (row) {
       this.showModal = true
@@ -267,6 +280,7 @@ export default {
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
+      this.getSumByType()
     }
   },
   mounted () {

+ 27 - 12
src/views/numsGoodsShelves/recallManagement/recallModal.vue

@@ -24,13 +24,13 @@
         :scroll="{ y:500 }"
         :pagination="false"
         bordered>
-        <template slot="thNum" slot-scope="text, record">
+        <template slot="confirmQty" slot-scope="text, record">
           <a-input-number
             id="inputNumber"
             v-model="record.confirmQty"
             :precision="0"
             :min="0"
-            :max="record.dhNum"
+            :max="record.qty"
             placeholder="请输入"
           />
         </template>
@@ -73,19 +73,18 @@ export default {
       spinning: false,
       rules: [],
       columns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'left' },
-        { title: '调回数量', dataIndex: 'qty', width: '10%', align: 'center' },
-        { title: '实际退库数量', width: '10%', align: 'center', scopedSlots: { customRender: 'thNum' } },
-        { title: '单位', dataIndex: 'danwei', width: '10%', align: 'center' }
+        { title: '产品编码', dataIndex: 'product.code', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '30%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '调回数量', dataIndex: 'qty', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '实退数量', width: '15%', align: 'center', scopedSlots: { customRender: 'confirmQty' } },
+        { title: '单位', dataIndex: 'product.unit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       list: []
     }
   },
   computed: {
     title () {
-      return '调回单退库' + ' —— ' + (this.currentData && this.currentData.createDate ? this.currentData.createDate : '')
+      return '调回单退库' + ' —— ' + (this.currentData && this.currentData.shelfInfo ? this.currentData.shelfInfo.shelfName : '')
     }
   },
 
@@ -98,9 +97,25 @@ export default {
         content: '调回产品将退回至经销商仓库,确认退库吗?',
         centered: true,
         onOk () {
-          _this.$emit('close')
+          // _this.$emit('close')
           _this.spinning = true
-          warehouseCascadeList({ recallBillSn: _this.currentData.recallBillSn }).then(res => {
+          const arr = []
+          _this.list.map((item, index) => {
+            if (item.confirmQty || item.confirmQty == 0) {
+              arr.push({
+                productSn: item.productSn,
+                confirmQty: item.confirmQty,
+                recallBillDetailSn: item.recallBillDetailSn
+              })
+            }
+          })
+          const params = {
+            shelfSn: _this.list[0].shelfSn,
+            recallBillSn: _this.list.recallBillSn,
+            recallBillNo: _this.list[0].recallBillNo,
+            detailList: arr
+          }
+          warehouseCascadeList(params).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.spinning = false
@@ -117,7 +132,7 @@ export default {
       this.spinning = true
       shelfRecallDetailList({ recallBillSn: this.currentData.recallBillSn }).then(res => {
         if (res.status == 200) {
-          this.list = res.data.data
+          this.list = res.data
           const no = 0
           for (var i = 0; i < this.list.length; i++) {
             this.list[i].no = no + i + 1

+ 5 - 3
src/views/numsGoodsShelves/replenishmentManagement/list.vue

@@ -45,7 +45,7 @@
       <!-- 标签页 -->
       <a-tabs type="card" v-model="queryParam.bizType" @change="handleTabChange" class="replenishmentManagementList-tabs ">
         <a-tab-pane v-for="item in tabPaneData" :key="item.bizType">
-          <p slot="tab">{{ item.bizName }}<span v-if="item.countNum || item.countNum==0">({{ item.countNum }})</span></p>
+          <p slot="tab">{{ item.bizName }}<span v-if="(item.countNum || item.countNum==0)&&item.bizName!='全部'">({{ item.countNum }})</span></p>
         </a-tab-pane>
       </a-tabs>
       <s-table
@@ -204,7 +204,7 @@ export default {
     // 定时任务
     taskIn () {
       shelfReplenishTaskInsertBill().then(res => {
-        this.$message.info(res.message)
+        this.$message.success(res.message)
         this.resetSearchForm()
       })
     },
@@ -384,7 +384,9 @@ export default {
     },
     // 获取类型
     queryByTypeSum () {
-      shelfReplenishStateCount({}).then(res => {
+      const params = JSON.parse(JSON.stringify(this.queryParam))
+      delete params.bizType
+      shelfReplenishStateCount(params).then(res => {
         if (res.data && res.status == 200) {
           this.tabPaneData = [
             { bizName: '全部', bizType: 'ALL', countNum: 0 },

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

@@ -125,7 +125,7 @@ export default {
     },
     //  开始打印
     handleSave () {
-      if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length < 1)) {
+      if (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows && this.rowSelectionInfo.selectedRows.length < 1) {
         this.$message.warning('请至少选择一个产品')
       } else {
         const nowData = this.nowData
@@ -154,7 +154,9 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        this.rowSelectionInfo = null
         this.$refs.table.clearTable()
+        this.$refs.table.clearSelected()
       } else {
         const _this = this
         this.getDetail()

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

@@ -142,7 +142,7 @@ export default {
                 shelfPlaceSn: item.shelfPlaceSn,
                 shelfPlaceCode: item.shelfPlaceCode
               })
-            } else {
+            } else if ((item.confirmQty || item.confirmQty == 0) && !(item.putQty || item.putQty == 0)) {
               arrInd.push(index + 1)
             }
           })

+ 12 - 8
src/views/numsGoodsShelves/shelfMonitoring/addModal.vue

@@ -28,16 +28,16 @@
         :pagination="false"
         bordered>
         <!-- 调回数量 -->
-        <template slot="outQty" slot-scope="text, record">
+        <template slot="confirmQty" slot-scope="text, record">
           <a-input-number
             size="small"
-            id="shelfMonitoring-add-outQty"
-            v-model="record.outQty"
+            id="shelfMonitoring-add-confirmQty"
+            v-model="record.confirmQty"
             :precision="0"
             :min="0"
             :max="record.qty"
             placeholder="请输入"
-            :style="{width: '100%', color: record.outQty==0 ? 'red': ''}" />
+            :style="{width: '100%', color: record.confirmQty==0 ? 'red': ''}" />
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record, index">
@@ -89,7 +89,7 @@ export default {
         { 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: 'unsalableDays', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调货数量', scopedSlots: { customRender: 'outQty' }, width: '10%', align: 'center' },
+        { title: '调货数量', scopedSlots: { customRender: 'confirmQty' }, width: '10%', align: 'center' },
         { title: '单位', dataIndex: 'productUnit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
@@ -103,11 +103,15 @@ export default {
       const arr = []
       const arrInd = []
       this.listData.map((item, index) => {
-        if (item.outQty) {
+        if (item.confirmQty) {
           arr.push({
+            shelfSn: this.nowData && this.nowData.shelfInfo && this.nowData.shelfInfo.shelfSn,
             shelfPlaceSn: item.shelfPlaceSn,
+            shelfPlaceCode: item.shelfPlaceCode,
             productSn: item.productSn,
-            qty: item.outQty
+            productCode: item.productCode,
+            productName: item.productName,
+            qty: item.confirmQty
           })
         } else {
           arrInd.push(index + 1)
@@ -151,7 +155,7 @@ export default {
         if (this.nowData && this.nowData.list) {
           this.nowData.list.map((item, index) => {
             item.no = index + 1
-            item.outQty = item.qty
+            item.confirmQty = item.qty
           })
         }
         this.listData = JSON.parse(JSON.stringify(this.nowData && this.nowData.list || []))

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

@@ -98,7 +98,7 @@
             <a-divider type="vertical" style="background: #FF7D0C;width: 3px;height: 16px;" />
             <span>{{ shelfName || '--' }}</span>
           </div>
-          <!-- <a-button type="primary" class="button-error" id="shelfMonitoringList-export" @click="handleAddBack">新增调回单</a-button> -->
+          <a-button type="primary" class="button-error" id="shelfMonitoringList-export" @click="handleAddBack">新增调回单</a-button>
           <span style="margin-left: 5px">
             <template v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length > 0">
               {{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}