浏览代码

补货管理

lilei 3 年之前
父节点
当前提交
47ba4cde69

+ 1 - 0
src/components/Select/index.js

@@ -43,6 +43,7 @@ export default {
       if (res.status == 200) {
         _this.dataList = res.data.list
       }
+      _this.$emit("loadDataFinish",_this.dataList)
     })
   },
   methods: {

+ 1 - 1
src/utils/request.js

@@ -8,7 +8,7 @@ import { VueAxios } from './axios'
 // 创建 axios 实例
 const service = axios.create({
   baseURL: process.env.VUE_APP_API_BASE_URL, // api base_url
-  timeout: 10000 // 请求超时时间
+  timeout: 1000000 // 请求超时时间
 })
 
 const err = (error) => {

+ 6 - 3
src/views/numsGoodsShelves/replenishmentManagement/confirmModal.vue

@@ -102,8 +102,8 @@ export default {
   },
   computed: {
     modalTit () {
-      const hjName = this.nowData && this.nowData.shelfName ? this.nowData.shelfName : ''
-      return '补货单确认——' + hjName
+      const hjName = this.nowData && this.nowData.shelfInfo.shelfName ? this.nowData.shelfInfo.shelfName : ''
+      return '补货单确认 —— ' + hjName
     }
   },
   methods: {
@@ -121,7 +121,8 @@ export default {
             if (item.confirmQty || item.confirmQty == 0) {
               arr.push({
                 productSn: item.productSn,
-                confirmQty: item.confirmQty
+                confirmQty: item.confirmQty,
+                replenishBillDetailSn: item.replenishBillDetailSn
               })
             } else {
               arrInd.push(index + 1)
@@ -133,6 +134,8 @@ export default {
           }
           const params = {
             replenishBillSn: _this.nowData && _this.nowData.replenishBillSn,
+            replenishBillNo: _this.nowData && _this.nowData.replenishBillNo,
+            shelfSn: _this.nowData && _this.nowData.shelfSn,
             detailList: arr
           }
           _this.$emit('ok', 'confirm', params)

+ 32 - 14
src/views/numsGoodsShelves/replenishmentManagement/list.vue

@@ -56,6 +56,7 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
+        :expandedRowKeys="expandedRowKeys"
         @expand="expandFun"
         :expandRowByClick="true"
         :scroll="{ y: tableHeight }"
@@ -63,6 +64,7 @@
         :defaultLoadData="false"
         bordered>
         <a-table
+          v-if="listData&&listData[index]"
           slot="expandedRowRender"
           slot-scope="record, index"
           size="small"
@@ -160,22 +162,29 @@ export default {
         productCode: '',
         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: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '货架名称', dataIndex: 'shelfName', width: '21%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '补货单号', dataIndex: 'replenishBillNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货架名称', dataIndex: 'shelfInfo.shelfName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '状态', dataIndex: '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: '18%', align: 'left' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'left' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return shelfReplenishList(Object.assign(parameter, this.queryParam)).then(res => {
+        this.expandedRowKeys = []
+        parameter.billState = this.queryParam.bizType == 'ALL' ? '' : this.queryParam.bizType
+        const params = Object.assign(parameter, this.queryParam)
+        delete params.index
+        delete params.tableId
+        delete params.bizType
+        return shelfReplenishList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -270,7 +279,7 @@ export default {
     handlePrintStickerOk () {
       this.nowData = null
       this.openPrintStickerModal = false
-      this.$refs.table.refresh(true)
+      this.queryByTypeSum()
     },
     // 出库
     handleOutWarehousing (row) {
@@ -281,7 +290,7 @@ export default {
     handleOutWarehousingOk () {
       this.nowData = null
       this.openOutWarehousingModal = false
-      this.$refs.table.refresh(true)
+      this.queryByTypeSum()
     },
     handleValidate (type, params) {
       // 校验产品库存是否足够
@@ -319,7 +328,7 @@ export default {
     handlePutWarehousingOk () {
       this.nowData = null
       this.openPutWarehousingModal = false
-      this.$refs.table.refresh(true)
+      this.queryByTypeSum()
     },
     // 取消补货单
     handleCancelOrder (row) {
@@ -348,7 +357,11 @@ export default {
     },
     expandFun (expanded, record) {
       if (expanded) {
+        this.expandedRowKeys.push(record.id)
         this.getSubItem(record) // 获取表格内部数据
+      } else {
+        const i = this.expandedRowKeys.findIndex(item => item == record.id)
+        this.expandedRowKeys.splice(i, 1)
       }
     },
     // 获取子节点数据
@@ -393,9 +406,12 @@ export default {
     },
     // 选择类型
     handleTabChange (key) {
-      this.queryParam.bizType = key
-      this.$refs.table.refresh(true)
-      this.curBizType = key
+      this.expandedRowKeys = []
+      setTimeout(() => {
+        this.queryParam.bizType = key
+        this.$refs.table.refresh(true)
+        this.curBizType = key
+      }, 100)
     },
     // 客户 change
     custChange (obj) {
@@ -406,18 +422,20 @@ export default {
       shelfReplenishStateCount({}).then(res => {
         if (res.data && res.status == 200) {
           this.tabPaneData = [
-            { bizName: '全部', bizType: 'ALL', countNum: null },
+            { bizName: '全部', bizType: 'ALL', 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: null },
-            { bizName: '已取消', bizType: 'CANCEL', countNum: null }
+            { bizName: '已完成', bizType: 'FINISH', countNum: 0 },
+            { bizName: '已取消', bizType: 'CANCEL', countNum: 0 }
           ]
           this.queryParam.bizType = 'ALL'
           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.$refs.table.refresh(true)
+          this.tabPaneData[4].countNum = res.data.FINISH || 0
+          this.tabPaneData[5].countNum = res.data.CANCEL || 0
+          this.$refs.table.refresh()
         }
       })
     },

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

@@ -95,7 +95,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return shelfReplenishDetailList(Object.assign(parameter, this.queryParam)).then(res => {
+        return shelfReplenishDetailList({ replenishBillSn: this.nowData && this.nowData.replenishBillSn }).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -126,7 +126,7 @@ export default {
   },
   computed: {
     modalTit () {
-      const hjName = this.nowData && this.nowData.shelfName ? this.nowData.shelfName : ''
+      const hjName = this.nowData && this.nowData.shelfInfo.shelfName ? this.nowData.shelfInfo.shelfName : ''
       return '补货单出库——' + hjName
     }
   },
@@ -145,7 +145,8 @@ export default {
               _this.listData.map((item, index) => {
                 arr.push({
                   productSn: item.productSn,
-                  confirmQty: item.confirmQty
+                  confirmQty: item.confirmQty,
+                  replenishBillDetailSn: item.replenishBillDetailSn
                 })
               })
               const params = {

+ 4 - 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!=0"
+            v-if="record.confirmQty&&record.confirmQty!=0"
             size="small"
             id="replenishmentManagement-outWarehousing-putQty"
             v-model="record.putQty"
@@ -97,7 +97,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return shelfReplenishDetailList({ sn: this.nowData && this.nowData.replenishBillSn }).then(res => {
+        return shelfReplenishDetailList({ replenishBillSn: this.nowData && this.nowData.replenishBillSn }).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -118,7 +118,7 @@ export default {
   },
   computed: {
     modalTit () {
-      const hjName = this.nowData && this.nowData.shelfName ? this.nowData.shelfName : ''
+      const hjName = this.nowData && this.nowData.shelfInfo.shelfName ? this.nowData.shelfInfo.shelfName : ''
       return '补货单签收——' + hjName
     }
   },
@@ -135,7 +135,7 @@ export default {
           const arrInd = []
           _this.listData.map((item, index) => {
             if (item.putQty || item.putQty == 0) {
-              arr.push({ productSn: item.productSn, putQty: item.putQty })
+              arr.push({ productSn: item.productSn, putQty: item.putQty, replenishBillDetailSn: item.replenishBillDetailSn })
             } else {
               arrInd.push(index + 1)
             }

+ 138 - 0
src/views/numsGoodsShelves/replenishmentManagement/replenishmentDetail.vue

@@ -0,0 +1,138 @@
+<template>
+  <div v-if="showPage" class="replenishmentDetail-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 基础信息 -->
+      <a-collapse :activeKey="['1']" v-if="detailData">
+        <a-collapse-panel key="1" header="基础信息">
+          <a-descriptions size="small" :column="3">
+            <a-descriptions-item label="关联客户">
+              {{ detailData&&detailData.shelfInfo.storeName || '--' }}
+            </a-descriptions-item>
+            <a-descriptions-item label="货架名称" :span="2">
+              {{ detailData&&detailData.shelfInfo.shelfName || '--' }}
+            </a-descriptions-item>
+            <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>
+        </a-collapse-panel>
+      </a-collapse>
+      <div class="pages-wrap">
+        <!-- alert -->
+        <a-alert type="info" style="margin: 10px 0;">
+          <div slot="message">
+            总款数:<strong>{{ detailData&&(detailData.totalCategory || detailData.totalCategory==0) ? detailData.totalCategory : '--' }}</strong>;
+            总数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
+            总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? detailData.totalCost : '--' }}</strong>;
+          </div>
+        </a-alert>
+        <!-- 列表 -->
+        <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>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { getOperationalPrecision } from '@/libs/tools.js'
+import { STable, VSelect } from '@/components'
+import { shelfReplenishDetailList, shelfReplenishDetail } from '@/api/shelfReplenish'
+export default {
+  name: 'SalesDetail',
+  components: { STable, VSelect },
+  mixins: [commonMixin],
+  props: {
+    outBizSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      showPage: false,
+      spinning: false,
+      disabled: false,
+      // 表头
+      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: 'confirmQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'product.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
+        // { title: '成本价', dataIndex: 'product.unit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '成本小计', dataIndex: 'product.unit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '是否急件', dataIndex: 'product.unit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return shelfReplenishDetailList({ replenishBillSn: this.nowData && 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
+              data[i].putQty = data[i].confirmQty
+            }
+            this.disabled = false
+            this.listData = data || []
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      localDataSource: [],
+      detailData: null //  详情数据
+    }
+  },
+  methods: {
+    // 基本信息
+    getDetail () {
+      shelfReplenishDetail({ sn: this.outBizSn || this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.detailData = res.data
+        } else {
+          this.detailData = null
+        }
+      })
+    },
+    pageInit () {
+      const vm = this
+      vm.$nextTick(() => {
+        vm.spinning = false
+        vm.disabled = false
+        vm.$refs.table.refresh(true)
+        vm.getDetail()
+      })
+    }
+  },
+  mounted () {
+    this.showPage = true
+    if (!this.$store.state.app.isNewTab || this.outBizSn) { // 页签刷新 或 为弹框时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    this.showPage = true
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 8 - 2
src/views/outboundOrderManagement/outboundOrder/list.vue

@@ -100,13 +100,15 @@
       v-if="openModal"
       @cancle="cancleModal"
       width="80%">
-      <div style="max-height: 700px;overflow-y: scroll;">
+      <div style="max-height: 700px;overflow-y: auto;">
         <pushOrderDetailModal v-if="outBizType=='PURCHASE_RETURN'" :outBizSn="orderSn" />
         <salesDetailModal v-if="outBizType=='SALES'" :outBizSn="orderSn" />
         <urgentDetailModal v-if="outBizType=='DISPATCH_DEDUCT'" :outBizSn="orderSn" />
         <storeTransferOutDetailModal v-if="outBizType=='SHOP_CALL_OUT'" :outBizSn="orderSn" />
         <chainTransferOutDetailModal v-if="outBizType=='LINKAGE_CALL_OUT'" :outBizSn="orderSn" />
         <warehouseAllocationDetailModal v-if="outBizType=='WAREHOUSE_CALL_OUT'" :outBizSn="orderSn" />
+        <warehouseAllocationDetailModal v-if="outBizType=='WAREHOUSE_CALL_OUT'" :outBizSn="orderSn" />
+        <replenishmentDetailModal v-if="outBizType=='SHELF_REPLENISH'" :outBizSn="orderSn"></replenishmentDetailModal>
       </div>
     </a-modal>
   </a-card>
@@ -123,11 +125,12 @@ import urgentDetailModal from '@/views/salesManagement/urgentItemsOffset/detail.
 import storeTransferOutDetailModal from '@/views/allocationManagement/storeTransferOut/detail.vue'
 import chainTransferOutDetailModal from '@/views/allocationManagement/chainTransferOut/detail.vue'
 import warehouseAllocationDetailModal from '@/views/allocationManagement/warehouseAllocation/detail.vue'
+import replenishmentDetailModal from '@/views/numsGoodsShelves/replenishmentManagement/replenishmentDetail.vue'
 import { stockOutList, stockOutOut, stockOutBatchOut } from '@/api/stockOut'
 import getDate from '@/libs/getDate.js'
 export default {
   name: 'OutboundOrderList',
-  components: { STable, VSelect, rangeDate, pushOrderDetailModal, salesDetailModal, urgentDetailModal, storeTransferOutDetailModal, chainTransferOutDetailModal, warehouseAllocationDetailModal },
+  components: { STable, VSelect, rangeDate, pushOrderDetailModal, salesDetailModal, urgentDetailModal, storeTransferOutDetailModal, chainTransferOutDetailModal, warehouseAllocationDetailModal, replenishmentDetailModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -261,6 +264,9 @@ export default {
       } else if (row.outBizType == 'WAREHOUSE_CALL_OUT') { // 仓库调出
         this.orderSn = row.outBizSn
         this.openModal = true
+      } else if (row.outBizType == 'SHELF_REPLENISH') { // 数字货架
+        this.orderSn = row.outBizSn
+        this.openModal = true
       } else {
         this.$message.warning('出库类型未知')
       }