chenrui 3 年之前
父節點
當前提交
0a65e18a69

+ 34 - 0
src/api/shelfReplenish.js

@@ -27,3 +27,37 @@ export const shelfReplenishCancel = (params) => {
     method: 'post'
   })
 }
+//  补货单 查询每个状态的数据条数
+export const shelfReplenishStateCount = (params) => {
+  return axios({
+    url: '/shelfReplenish/queryStateCount',
+    data: params,
+    method: 'post'
+  })
+}
+//  补货单 确认补货
+export const shelfReplenishConfirm = (params) => {
+  return axios({
+    url: '/shelfReplenish/confirm',
+    data: params,
+    method: 'post'
+  })
+}
+//  补货单 检查补货单库存数量
+export const shelfReplenishDetailStock = (params) => {
+  return axios({
+    url: '/shelfReplenish/detail/checkDetailStockQty',
+    data: params,
+    method: 'post'
+  })
+}
+//  补货单  详情
+export const shelfReplenishDetail = (params) => {
+  const url = `/shelfReplenish/findBySn/${params.sn}`
+  delete params.sn
+  return axios({
+    url: url,
+    data: params,
+    method: 'get'
+  })
+}

+ 48 - 31
src/views/numsGoodsShelves/replenishmentManagement/confirmModal.vue

@@ -10,8 +10,8 @@
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-descriptions>
-        <a-descriptions-item label="补货单号">BH202101010001</a-descriptions-item>
-        <a-descriptions-item label="单据来源">系统创建</a-descriptions-item>
+        <a-descriptions-item label="补货单号">{{ this.nowData && this.nowData.replenishBillNo || '--' }}</a-descriptions-item>
+        <!-- <a-descriptions-item label="单据来源">{{this.nowData && this.nowData.billType || '--'}}</a-descriptions-item> -->
       </a-descriptions>
       <!-- 列表 -->
       <s-table
@@ -21,21 +21,21 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ y: 400 }"
-        :showPagination="false"
         :defaultLoadData="false"
+        :showPagination="false"
+        :scroll="{ y: 450 }"
         bordered>
         <!-- 实发数量 -->
-        <template slot="outQty" slot-scope="text, record">
+        <template slot="confirmQty" slot-scope="text, record">
           <a-input-number
             size="small"
-            id="replenishmentManagement-confirm-outQty"
-            v-model="record.outQty"
+            id="replenishmentManagement-confirm-confirmQty"
+            v-model="record.confirmQty"
             :precision="0"
             :min="0"
-            :max="record.currentQty"
+            :max="record.qty"
             placeholder="请输入"
-            :style="{width: '100%', color: record.outQty==0 ? 'red': ''}" />
+            style="width: 100%" />
         </template>
       </s-table>
       <div class="btn-cont">
@@ -49,7 +49,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
-import { storeCallOutList } from '@/api/storeCallOut'
+import { shelfReplenishDetailList } from '@/api/shelfReplenish'
 export default {
   name: 'ConfirmModal',
   components: { STable, VSelect },
@@ -72,35 +72,37 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       columns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
-        { title: '产品编码', dataIndex: 'allocationLinkagePutNo', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'outTenantName', width: '32%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '补货应发数量', dataIndex: 'productTotalCategory', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实发数量', scopedSlots: { customRender: 'outQty' }, width: '15%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', 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: '实发数量', scopedSlots: { customRender: 'confirmQty' }, width: '15%', align: 'center' },
         { title: '单位', dataIndex: 'productUnit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return storeCallOutList(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
-            const no = (data.pageNo - 1) * data.pageSize
-            for (var i = 0; i < data.list.length; i++) {
-              data.list[i].no = no + i + 1
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = i + 1
+              data[i].confirmQty = data[i].qty
             }
             this.disabled = false
           }
+          this.listData = data || []
           this.spinning = false
           return data
         })
-      }
+      },
+      listData: []
     }
   },
   computed: {
     modalTit () {
-      const hjName = this.nowData && this.nowData.settleClientName ? this.nowData.settleClientName : ''
+      const hjName = this.nowData && this.nowData.shelfName ? this.nowData.shelfName : ''
       return '补货单确认——' + hjName
     }
   },
@@ -113,17 +115,32 @@ export default {
         content: '确认对该数字货架进行补货吗?',
         centered: true,
         onOk () {
-          _this.$emit('ok', 'confirm')
-          // _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
-          //   }
-          // })
+          const arr = []
+          const arrInd = []
+          _this.listData.map((item, index) => {
+            if (item.confirmQty || item.confirmQty == 0) {
+              arr.push({
+                productSn: item.productSn,
+                confirmQty: item.confirmQty
+              })
+            } else {
+              arrInd.push(index + 1)
+            }
+          })
+          if (arrInd.length > 0) {
+            let str = ''
+            arrInd.map(item => {
+              str += item + '、'
+            })
+            str = str.substr(0, str.length - 1)
+            _this.$message.warning('请完善第' + str + '行数据后再提交')
+            return
+          }
+          const params = {
+            replenishBillSn: _this.nowData && _this.nowData.replenishBillSn,
+            detailList: arr
+          }
+          _this.$emit('ok', 'confirm', params)
         }
       })
     }

+ 70 - 23
src/views/numsGoodsShelves/replenishmentManagement/list.vue

@@ -11,20 +11,20 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="补货单号"><a-input id="replenishmentManagementList-settleNo" v-model.trim="queryParam.settleNo" allowClear placeholder="请输入补货单号" /></a-form-item>
+              <a-form-item label="补货单号"><a-input id="replenishmentManagementList-replenishBillNo" v-model.trim="queryParam.replenishBillNo" allowClear placeholder="请输入补货单号" /></a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="货架名称">
-                <custList ref="custList" @change="custChange" :itemSn="queryParam.customerSn"></custList>
+                <shelfSList ref="shelfList" @change="shelfChange" :itemSn="queryParam.shelfSn"></shelfSList>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-item label="产品编码"><a-input id="replenishmentManagementList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入关联单号" /></a-form-item>
+                <a-form-item label="产品编码"><a-input id="replenishmentManagementList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码" /></a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品名称">
-                  <a-input id="replenishmentManagementList-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入商户名称" />
+                  <a-input id="replenishmentManagementList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称" />
                 </a-form-item>
               </a-col>
             </template>
@@ -83,7 +83,13 @@
       <!-- 确认 -->
       <confirm-modal :openModal="openConfirmModal" :nowData="nowData" @ok="handleValidate" @close="handleCancel" />
       <!-- 库存不足,确认弹框 -->
-      <stock-modal :openModal="openStockModal" :type="validateType" :nowData="nowData" @ok="handleStockOk" @close="handleStockCancel" />
+      <stock-modal
+        :openModal="openStockModal"
+        :type="validateType"
+        :params="paramsData"
+        :listData="stockList"
+        @ok="handleStockOk"
+        @close="handleStockCancel" />
       <!-- 打印贴签 -->
       <print-sticker-modal :openModal="openPrintStickerModal" :nowData="nowData" @ok="handlePrintStickerOk" @close="handleCancel" />
       <!-- 出库 -->
@@ -98,17 +104,15 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import custList from '@/views/common/custList.vue'
+import shelfSList from '@/views/common/shelfList.vue'
 import confirmModal from './confirmModal.vue'
 import stockModal from './stockModal.vue'
 import printStickerModal from './printStickerModal.vue'
 import outWarehousingModal from './outWarehousingModal.vue'
 import putWarehousingModal from './putWarehousingModal.vue'
-import { queryByTypeSum } from '@/api/settleReceipt'
-import { shelfReplenishList, shelfReplenishDetailList, shelfReplenishCancel } from '@/api/shelfReplenish'
-
+import { shelfReplenishList, shelfReplenishDetailList, shelfReplenishCancel, shelfReplenishStateCount, shelfReplenishDetailStock, shelfReplenishConfirm } from '@/api/shelfReplenish'
 export default {
-  components: { STable, VSelect, rangeDate, custList, confirmModal, stockModal, printStickerModal, outWarehousingModal, putWarehousingModal },
+  components: { STable, VSelect, rangeDate, shelfSList, confirmModal, stockModal, printStickerModal, outWarehousingModal, putWarehousingModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -121,8 +125,10 @@ export default {
         bizType: 'ALL',
         beginDate: null,
         endDate: null,
-        customerSn: undefined,
-        billStatus: undefined
+        replenishBillNo: '',
+        shelfSn: undefined,
+        productCode: '',
+        productName: ''
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -131,7 +137,7 @@ export default {
         { 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: '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: 'center' }
       ],
@@ -159,9 +165,9 @@ export default {
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { 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: '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: 'productUnit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       listData: [],
@@ -172,7 +178,9 @@ export default {
       openPrintStickerModal: false,
       openOutWarehousingModal: false,
       openPutWarehousingModal: false,
-      validateType: 'confirm'
+      validateType: 'confirm',
+      stockList: [],
+      paramsData: null
     }
   },
   methods: {
@@ -196,13 +204,18 @@ export default {
       this.openPutWarehousingModal = false
     },
     // 库存不足 确认 ok
-    handleStockOk () {
+    handleStockOk (type, params) {
       this.openStockModal = false
       this.openConfirmModal = false
       this.openOutWarehousingModal = false
+      if (type == 'confirm') { // 确认
+        this.confirmFun(params)
+      }
     },
     // 库存不足 确认 cancel
     handleStockCancel () {
+      this.stockList = []
+      this.validateType = 'confirm'
       this.openStockModal = false
     },
     // 打印贴签
@@ -221,9 +234,32 @@ export default {
     handleOutWarehousingOk () {
 
     },
-    handleValidate (type) {
+    handleValidate (type, params) {
       // 校验产品库存是否足够
-      this.openStockModal = true
+      shelfReplenishDetailStock(params).then(res => {
+        if (res.status == 200) {
+          if (res.data && res.data.length > 0) {
+            this.stockList = res.data
+            this.validateType = 'confirm'
+            this.paramsData = params
+            this.openStockModal = true
+          } else {
+            if (type == 'confirm') { // 确认
+              this.confirmFun(params)
+            }
+          }
+        }
+      })
+    },
+    // 提交确认
+    confirmFun (params) {
+      shelfReplenishConfirm(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success('确认补货成功')
+          this.$refs.table.refresh(true)
+          this.handleCancel()
+        }
+      })
     },
     // 入库
     handlePutWarehousing (row) {
@@ -243,7 +279,7 @@ export default {
         centered: true,
         onOk () {
           _this.spinning = true
-          shelfReplenishCancel({ replenishBillSn: record.replenishBillSn }).then(res => {
+          shelfReplenishCancel({ replenishBillSn: row.replenishBillSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
@@ -255,6 +291,10 @@ export default {
         }
       })
     },
+    // 货架  change
+    shelfChange (obj) {
+      this.queryParam.shelfSn = obj.key || undefined
+    },
     // 自定义展开图标
     customExpandIcon (props) {
       if (props.expanded) {
@@ -275,6 +315,9 @@ export default {
         const ind = this.listData.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.listData[ind].subList = res.data
           } else {
             this.listData[ind].subList = []
@@ -292,9 +335,13 @@ export default {
     resetData () {
       this.$refs.rangeDate.resetDate()
       this.queryParam.bizType = this.curBizType
-      this.queryParam.customerSn = undefined
       this.queryParam.beginDate = null
       this.queryParam.endDate = null
+      this.queryParam.replenishBillNo = ''
+      this.queryParam.shelfSn = undefined
+      this.$refs.shelfList.resetForm()
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
     },
     //  时间  change
     dateChange (date) {
@@ -313,7 +360,7 @@ export default {
     },
     // 获取类型
     queryByTypeSum () {
-      queryByTypeSum({}).then(res => {
+      shelfReplenishStateCount({}).then(res => {
         if (res.data && res.status == 200) {
           this.tabPaneData = [
             { bizName: '全部', bizType: 'ALL', countNum: null },

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

@@ -39,7 +39,7 @@
             v-model="record.outQty"
             :precision="0"
             :min="0"
-            :max="record.currentQty"
+            :max="record.qty"
             placeholder="请输入"
             :style="{width: '100%', color: record.outQty==0 ? 'red': ''}" />
         </template>

+ 33 - 22
src/views/numsGoodsShelves/replenishmentManagement/putWarehousingModal.vue

@@ -10,15 +10,15 @@
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-descriptions>
-        <a-descriptions-item label="补货单号">BH202101010001</a-descriptions-item>
-        <a-descriptions-item label="单据来源">系统创建</a-descriptions-item>
-        <a-descriptions-item label="调往对象">送货到店</a-descriptions-item>
+        <a-descriptions-item label="补货单号">{{ basicInfoData && basicInfoData.replenishBillNo || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="创建时间">{{ basicInfoData && basicInfoData.createDate || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="配送方式">{{ basicInfoData && basicInfoData.dispatchTypeDictValue || '--' }}</a-descriptions-item>
         <a-descriptions-item label="出库备注" :span="3">
           <a-tooltip placement="bottom">
             <template slot="title">
-              <span>这里显示出库备注,没有显示--,超长显示...,鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部</span>
+              <span>{{ basicInfoData && basicInfoData.remarks || '--' }}</span>
             </template>
-            <p class="text-ellipsis">这里显示出库备注,没有显示--,超长显示...,鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部鼠标移到此处显示全部</p>
+            <p class="text-ellipsis">{{ basicInfoData && basicInfoData.remarks || '--' }}</p>
           </a-tooltip>
         </a-descriptions-item>
       </a-descriptions>
@@ -35,16 +35,16 @@
         :defaultLoadData="false"
         bordered>
         <!-- 入库数量 -->
-        <template slot="outQty" slot-scope="text, record">
+        <template slot="putQty" slot-scope="text, record">
           <a-input-number
             size="small"
-            id="replenishmentManagement-outWarehousing-outQty"
-            v-model="record.outQty"
+            id="replenishmentManagement-outWarehousing-putQty"
+            v-model="record.putQty"
             :precision="0"
             :min="0"
-            :max="record.currentQty"
+            :max="record.qty"
             placeholder="请输入"
-            :style="{width: '100%', color: record.outQty==0 ? 'red': ''}" />
+            style="width: 100%" />
         </template>
       </s-table>
       <div class="btn-cont">
@@ -58,7 +58,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
-import { storeCallOutList } from '@/api/storeCallOut'
+import { shelfReplenishDetailList, shelfReplenishDetail } from '@/api/shelfReplenish'
 export default {
   name: 'PutWarehousingModal',
   components: { STable, VSelect },
@@ -81,31 +81,31 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'allocationLinkagePutNo', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'outTenantName', width: '28%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '补货应发数量', dataIndex: 'productTotalCategory', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实发数量', dataIndex: 'productTotalCsategory', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库数量', scopedSlots: { customRender: 'outQty' }, width: '15%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', 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: '入库数量', scopedSlots: { customRender: 'putQty' }, width: '15%', align: 'center' },
         { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return storeCallOutList(Object.assign(parameter, this.queryParam)).then(res => {
+        return shelfReplenishDetailList({ sn: this.nowData && this.nowData.replenishBillSn }).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
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = i + 1
             }
             this.disabled = false
           }
           this.spinning = false
           return data
         })
-      }
+      },
+      basicInfoData: null
     }
   },
   computed: {
@@ -115,7 +115,7 @@ export default {
     }
   },
   methods: {
-    //  确认
+    //  确认
     handleSave () {
       const _this = this
       this.$confirm({
@@ -136,6 +136,16 @@ export default {
           // })
         }
       })
+    },
+    // 基本信息
+    getDetail () {
+      shelfReplenishDetail({ sn: this.nowData && this.nowData.replenishBillSn }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data
+        } else {
+          this.basicInfoData = null
+        }
+      })
     }
   },
   watch: {
@@ -150,6 +160,7 @@ export default {
         this.$refs.table.clearTable()
       } else {
         const _this = this
+        this.getDetail()
         this.$nextTick(() => { // 页面渲染完成后的回调
           _this.$refs.table.refresh(true)
         })

+ 25 - 22
src/views/numsGoodsShelves/replenishmentManagement/stockModal.vue

@@ -9,7 +9,8 @@
     @cancle="isShow = false"
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
-      <div style="text-align: center;margin: 0 0 20px;font-size: 14px;font-weight: bold;">
+      <p v-if="type=='confirm'" style="text-align: center;margin: 0 0 20px;font-size: 14px;font-weight: bold;">以下产品库存不足,确认继续补货吗?</p>
+      <div v-if="type=='outWarehousing'" style="text-align: center;margin: 0 0 20px;font-size: 14px;font-weight: bold;">
         <p style="margin: 0;">以下产品库存不足</p>
         <p style="margin: 0;">如果仍然补货,系统将自动生成【<span style="color: red;">急件</span>】</p>
       </div>
@@ -37,7 +38,6 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
-import { storeCallOutList } from '@/api/storeCallOut'
 export default {
   name: 'StockModal',
   components: { STable, VSelect },
@@ -47,12 +47,18 @@ export default {
       type: Boolean,
       default: false
     },
-    nowData: {
+    params: {
       type: Object,
       default: () => {
         return {}
       }
     },
+    listData: { // 列表数据
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
     type: { // 校验类型。confirm:确认;outWarehousing:出库
       type: String,
       default: 'confirm'
@@ -64,28 +70,25 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       columns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
-        { title: '产品编码', dataIndex: 'allocationLinkagePutNo', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'outTenantName', width: '32%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '可用库存数量', dataIndex: 'outQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '补货实发数量', dataIndex: 'productTotalCategory', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品编码', dataIndex: 'productCode', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '32%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '可用库存数量', dataIndex: 'stockQty', 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: 'productUnit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 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
+        const _this = this
+        _this.disabled = true
+        _this.spinning = true
+        return new Promise(function (resolve, reject) {
+          const data = JSON.parse(JSON.stringify(_this.listData))
+          data.map((item, index) => {
+            item.no = index + 1
+          })
+          _this.disabled = false
+          _this.spinning = false
+          resolve(data)
         })
       }
     }
@@ -93,7 +96,7 @@ export default {
   methods: {
     //  仍然补货
     handleSave () {
-      this.$emit('ok')
+      this.$emit('ok', this.type, this.params)
     }
   },
   watch: {

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

@@ -110,7 +110,7 @@ export default {
             qty: item.outQty
           })
         } else {
-          arrInd.push(index)
+          arrInd.push(index + 1)
         }
       })
       if (arrInd.length > 0) {
@@ -130,7 +130,7 @@ export default {
         if (res.status == 200) {
           _this.$emit('ok')
           _this.isShow = false
-          _this.$message.success('保存并确认成功,返回并刷新列表')
+          _this.$message.success('保存并确认成功')
         }
       })
     },