lilei пре 11 месеци
родитељ
комит
0da50f3665

+ 1 - 1
public/version.json

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

+ 29 - 18
src/views/numsGoodsShelves/recallManagement/addRecallBillModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="shelfSet-basicInfo-modal"
+    class="recallBill-basicInfo-modal"
     :footer="null"
     :maskClosable="false"
     :title="'新增调回单——'+recallBillInfo.shelfName"
@@ -9,13 +9,13 @@
     @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-form-model id="recallBill-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-form-model-item label="产品编码"><a-input id="recallBill-productCode" 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-form-item label="产品名称"><a-input id="recallBill-productName" allowClear placeholder="请输入产品名称" v-model.tirm="queryParam.productName" /></a-form-item>
           </a-col>
           <a-col :md="8" :sm="24">
             <a-form-model-item label="滞销天数">
@@ -23,7 +23,7 @@
                 <a-row>
                   <a-col :md="11" :sm="24">
                     <a-input-number
-                      id="shelfMonitoringList-minUnsalableDays"
+                      id="recallBill-unsalableDaysBegin"
                       v-model="queryParam.unsalableDaysBegin"
                       :precision="0"
                       :min="0"
@@ -35,7 +35,7 @@
                   <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"
+                      id="recallBill-unsalableDaysEnd"
                       v-model="queryParam.unsalableDaysEnd"
                       :precision="0"
                       :min="0"
@@ -49,8 +49,8 @@
             </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-button type="primary" @click="$refs.recallBillTable.refresh(true)" id="recallBill-refresh">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" id="recallBill-reset">重置</a-button>
           </a-col>
         </a-row>
       </a-form-model>
@@ -66,7 +66,9 @@
             </template>
           </span>
-          <span v-if="totalNum ||totalCategory"><a-checkbox @change="isShowChooseList" :checked="showChecked" size="small">仅显示已选产品</a-checkbox></span>
+          <span v-if="totalNum ||totalCategory">
+            <a-checkbox id="recallBill-showChecked" @change="isShowChooseList" :checked="showChecked" size="small">仅显示已选产品</a-checkbox>
+          </span>
         </div>
         <s-table
           class="sTable"
@@ -84,6 +86,7 @@
             <div v-if="record.confirmQty === 0">--</div>
             <a-input-number
               v-else
+              :id="'recallBill-confirmQty-'+record.id"
               size="small"
               v-model="record.confirmQty"
               :readonly="hasChecked(record.id)"
@@ -116,7 +119,7 @@ export default {
       type: Boolean,
       default: false
     },
-    recallBillInfo: {
+    recallBillInfo: { // 调回单详情信息
       type: Object,
       default: () => {
         return {}
@@ -133,12 +136,13 @@ export default {
       },
       queryParam: {
         //  查询条件
-        shelfSn: '',
-        productCode: undefined,
-        productName: undefined,
-        unsalableDaysBegin: undefined,
-        unsalableDaysEnd: undefined
+        shelfSn: '', // 货架sn
+        productCode: undefined, // 产品编码
+        productName: undefined, // 产品名称
+        unsalableDaysBegin: undefined, // 不可销售天数开始
+        unsalableDaysEnd: undefined// 不可销售天数结束
       },
+      // 表格列
       columns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
         { title: '货位号', dataIndex: 'shelfPlaceCode', width: '15%', align: 'center' },
@@ -217,8 +221,9 @@ export default {
         },
         { title: '调回数量', width: '20%', align: 'center', scopedSlots: { customRender: 'confirmQty' } }
       ],
+      // 是否仅显示已选产品
       showChecked: false,
-      rowSelectionInfo: null,
+      rowSelectionInfo: null, // 已选产品数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         // 获取列表
@@ -235,6 +240,7 @@ export default {
             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 || []
@@ -250,15 +256,17 @@ export default {
     }
   },
   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)
@@ -306,6 +314,7 @@ export default {
         }
       })
     },
+    // 仅显示已选产品勾选
     isShowChooseList (e) {
       this.showChecked = e.target.checked
       this.$refs.recallBillTable.refresh(true)
@@ -371,6 +380,7 @@ export default {
     }
   },
   computed: {
+    // 总数量
     totalNum () {
       let ret = 0
       this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.map(item => {
@@ -378,6 +388,7 @@ export default {
       })
       return ret
     },
+    // 总款数
     totalCategory () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length
     }
@@ -386,7 +397,7 @@ export default {
 </script>
 
 <style lang="less">
-.shelfSet-basicInfo-modal {
+.recallBill-basicInfo-modal {
   .ant-modal-body {
     padding: 40px 40px 24px;
   }

+ 12 - 15
src/views/numsGoodsShelves/recallManagement/basicInfoModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="shelfSet-basicInfo-modal"
+    class="recallNew-basicInfo-modal"
     :footer="null"
     :maskClosable="false"
     title="新增调回单"
@@ -10,19 +10,19 @@
     :width="600">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
-        id="shelfSet-basicInfo-form"
+        id="recallNew-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>
+          <shelfSList id="recallNew-basicInfo-shelf" v-model="form.shelfSn" @change="shelfChange"></shelfSList>
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
-        <a-button size="large" type="primary" id="importGuide-nextStep" @click="handlerNextStep">下一步</a-button>
-        <a-button size="large" id="shelfSet-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+        <a-button size="large" type="primary" id="recallNew-nextStep" @click="handlerNextStep">下一步</a-button>
+        <a-button size="large" id="recallNew-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-spin>
     <!-- 新增回调单(实现新增) -->
@@ -45,15 +45,11 @@ export default {
       type: Boolean,
       default: false
     },
-    nowData: {
+    nowData: { // 单据详情信息
       type: Object,
       default: () => {
         return {}
       }
-    },
-    type: {
-      type: [String, Number],
-      default: '1'
     }
   },
   data () {
@@ -65,19 +61,20 @@ export default {
         wrapperCol: { span: 17 }
       },
       form: {
-        shelfSn: undefined
+        shelfSn: undefined // 货架sn
       },
       rules: {
         shelfSn: [{ required: true, message: '请选择需要调回产品货架', trigger: 'change' }]
       },
       showRecallBill: false, // 显示选择货架弹窗
       detailObj: {
-        shelfName: '',
-        shelfSn: ''
+        shelfName: '', // 货架名称
+        shelfSn: '' // 货架sn
       }
     }
   },
   methods: {
+    // 选择货架
     shelfChange (v, row) {
       this.detailObj.shelfName = row ? row.shelfName : ''
     },
@@ -93,7 +90,7 @@ export default {
         }
       })
     },
-    // 新增调货单成功
+    // 打开新增调货单成功
     handleInfoOk () {
       this.$emit('ok')
       this.isShow = false
@@ -116,7 +113,7 @@ export default {
 </script>
 
 <style lang="less">
-.shelfSet-basicInfo-modal {
+.recallNew-basicInfo-modal {
 	.ant-modal-body {
 		padding: 40px 40px 24px;
 	}

+ 25 - 18
src/views/numsGoodsShelves/recallManagement/detailModal.vue

@@ -18,12 +18,18 @@
         <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 v-for="con in salesReturnBillList" :key="con.id" :id="'recallDetail-jumpSalesReturn-'+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 &&itemData.shelfInfo.state!='WRITE_OFF'&&itemData.shelfInfo.state!='SUSPEND'">生成销售退货单</a-button>
+          <a-button
+            id="recallDetail-creatSales"
+            type="primary"
+            ghost
+            class="recallBillBtn"
+            @click="seeRecallBill"
+            v-if="itemData.billState != 'CANCEL' && !isZero &&itemData.shelfInfo.state!='WRITE_OFF'&&itemData.shelfInfo.state!='SUSPEND'">生成销售退货单</a-button>
         </a-descriptions-item>
       </a-descriptions>
     </div>
@@ -38,7 +44,7 @@
         :bordered="true"
       ></a-table>
     </div>
-    <div class="btn-cont"><a-button id="vinRecord-modal-back" @click="isShow = false">关闭</a-button></div>
+    <div class="btn-cont"><a-button id="recallDetail-modal-back" @click="isShow = false">关闭</a-button></div>
     <!-- 回调单号提示窗 -->
     <a-modal
       class="tipPopup"
@@ -56,14 +62,14 @@
       <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>
+          <p v-for="con in salesReturnBillList" :key="con.id" :id="'recallDetailModal-jumpSalesReturn-'+con.id" @click="jumpDetail(con)">{{ con.salesReturnNo }}</p>
         </div>
       </div>
       <div class="tipFooter">
-        <a-button class="btnLeft" type="link" @click="tipVisible = false">
+        <a-button class="btnLeft" type="link" @click="tipVisible = false" id="recallDetail-cacel">
           取消
         </a-button>
-        <a-button class="btnLeft" type="link" @click="setReturnBill" :loading="btnLoading">
+        <a-button class="btnLeft" type="link" @click="setReturnBill" :loading="btnLoading" id="recallDetail-submit">
           确定
         </a-button>
       </div>
@@ -80,7 +86,7 @@ export default {
       type: Boolean,
       default: false
     },
-    itemData: {
+    itemData: { // 详情数据
       type: Object,
       default: function () {
         return []
@@ -90,10 +96,11 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      tipVisible: false,
-      salesReturnBillList: [],
-      detailList: [],
-      btnLoading: false,
+      tipVisible: false, // 回调单号提示窗
+      salesReturnBillList: [], // 调回单已经存在相应的销售退货单列表
+      detailList: [], // 调回单明细列表
+      btnLoading: false, // 按钮loading
+      // 明细列
       columns: [{
         title: '序号',
         dataIndex: 'no',
@@ -147,8 +154,8 @@ export default {
         }
       }
       ],
-      shelfName: '',
-      isZero: false
+      shelfName: '', // 货架名称
+      isZero: false // 明细列表是否为空
     }
   },
   watch: {
@@ -161,6 +168,7 @@ export default {
       if (!newValue) {
         this.$emit('close')
       } else {
+        // 赋值,初始化页面
         if (this.itemData) {
           this.salesReturnBillList = this.itemData.salesReturnBillList ? this.itemData.salesReturnBillList : []
           this.itemData.detailList.map((con, i) => {
@@ -176,26 +184,25 @@ export default {
     }
   },
   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.spinning = false
         this.btnLoading = false
       })
     },
+    // 关联销退单详情
     jumpDetail (row) {
       const _this = this
       if (row.delFlag == 0) {

+ 38 - 32
src/views/numsGoodsShelves/recallManagement/list.vue

@@ -5,42 +5,42 @@
       <div ref="tableSearch" style="width:100%;overflow: hidden;" class="table-page-search-wrapper">
         <a-tabs type="card" v-model="queryParam.bizType" @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>
+            <p slot="tab" :id="'tabs-'+item.code">{{ item.name }}<span v-if="item.countNum&&item.code=='WAIT_CONFIRM'" style="color:red">({{ item.countNum }})</span></p>
           </a-tab-pane>
         </a-tabs>
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="10">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="recall-creatDate" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="调回单号">
-                <a-input allowClear placeholder="请输入调回单号" v-model.tirm="queryParam.recallBillNo"/>
+                <a-input id="recall-recallBillNo" allowClear placeholder="请输入调回单号" v-model.tirm="queryParam.recallBillNo"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="货架名称">
-                <shelfList style="width: 100%;" :showAll="true" v-model="queryParam.shelfSn"></shelfList>
+                <shelfList id="recall-shelfSn" style="width: 100%;" :showAll="true" v-model="queryParam.shelfSn"></shelfList>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品编码">
-                  <a-input allowClear placeholder="请输入产品编码" v-model.tirm="queryParam.productCode"/>
+                  <a-input id="recall-productCode" allowClear placeholder="请输入产品编码" v-model.tirm="queryParam.productCode"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品名称">
-                  <a-input allowClear placeholder="请输入产品名称" v-model.tirm="queryParam.productName"/>
+                  <a-input id="recall-productName" allowClear placeholder="请输入产品名称" v-model.tirm="queryParam.productName"/>
                 </a-form-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24">
-              <a-button type="primary" @click="getSumByType" :disabled="disabled" id="outboundOrderList-refresh" >查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="outboundOrderList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px" v-if="activeKey==0">
+              <a-button type="primary" @click="getSumByType" :disabled="disabled" id="recall-refresh" >查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="recall-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px" v-if="activeKey==0" id="recall-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -48,7 +48,7 @@
           </a-row>
         </a-form>
       </div>
-      <div class="btnStyle"><a-button type="primary" @click="openInfoModal = true">新增调回单</a-button></div>
+      <div class="btnStyle"><a-button id="recall-newAdd" type="primary" @click="openInfoModal = true">新增调回单</a-button></div>
       <s-table
         class="sTable fixPagination"
         ref="table"
@@ -70,13 +70,14 @@
         </template>
         <!-- 货架名称 -->
         <template slot="shelfName" slot-scope="text, record">
-          {{text}}
+          {{ text }}
           <a-badge count="已注销" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="record.shelfInfo.state=='WRITE_OFF'"></a-badge>
           <a-badge count="已暂停" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="record.shelfInfo.state=='SUSPEND'"></a-badge>
           <a-badge count="已停用" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="record.shelfInfo.state=='DISABLED'"></a-badge>
         </template>
         <template slot="action" slot-scope="text, record">
           <a-button
+            :id="'recall-tuiku-'+record.id"
             size="small"
             type="link"
             v-if="record.billState=='WAIT_CONFIRM'"
@@ -84,6 +85,7 @@
             @click.stop="handleRecall(record)"
           >退库</a-button>
           <a-button
+            :id="'recall-cancel-'+record.id"
             size="small"
             v-if="record.billState=='WAIT_CONFIRM'"
             type="link"
@@ -91,6 +93,7 @@
             @click.stop="handleCancel(record)"
           >取消调回单</a-button>
           <a-button
+            :id="'recall-del-'+record.id"
             size="small"
             v-if="record.billState=='CANCEL'"
             type="link"
@@ -124,12 +127,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import getDate from '@/libs/getDate.js'
 import moment from 'moment'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { STable } from '@/components'
 import recallModal from './recallModal.vue'
-import getDate from '@/libs/getDate.js'
-import { toThousands } from '@/libs/tools.js'
 import shelfList from '@/views/common/shelfList'
 import basicInfoModal from './basicInfoModal.vue'
 import detailModal from './detailModal'
@@ -141,35 +143,36 @@ export default {
     return {
       spinning: false,
       disabled: false,
-      tableHeight: 0,
-      showModal: false,
-      advanced: false,
-      currentData: null,
+      tableHeight: 0, // 表格高度
+      showModal: false, // 退库弹框
+      advanced: false, // 高级搜索 展开/关闭
+      currentData: null, // 当前操作的数据
       activeKey: 0, // 默认的tab
-      tabsList: [],
-      expandedRowKeys: [],
-      time: [
+      tabsList: [], // tabs列表数据
+      expandedRowKeys: [], // 默认展开的行
+      time: [ // 默认的时间
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
       queryParam: {
         beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
         endDate: getDate.getCurrMonthDays().endtime, // 结束时间
-        recallBillNo: '',
+        recallBillNo: '', // 调回单号
         shelfSn: undefined, // 数字货架sn
-        bizType: 'ALL'
+        bizType: 'ALL' // 状态,默认全部
       },
-      openInfoModal: false,
+      openInfoModal: false, // 新增调回单弹框
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调回单号', scopedSlots: { customRender: 'recallBillNo' }, width: '20%', align: 'center' },
-        { title: '货架名称', dataIndex: 'shelfInfo.shelfName',scopedSlots: { customRender: 'shelfName' }, width: '25%', align: 'left', ellipsis: true },
+        { title: '货架名称', dataIndex: 'shelfInfo.shelfName', scopedSlots: { customRender: 'shelfName' }, width: '25%', align: 'left', 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) ? text : '--' } },
         { title: '实退总量', dataIndex: 'totalConfirmQty', width: '9%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
         { title: '操作', width: '10%', align: 'left', scopedSlots: { customRender: 'action' } }
       ],
+      // 子表格列
       innerColumns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '产品编码', dataIndex: 'product.code', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -178,9 +181,9 @@ export default {
         { 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 || '--' } }
       ],
-      innerData: [],
-      showDetail: false,
-      detailContent: null,
+      innerData: [], // 子表格数据
+      showDetail: false, // 调回单详情弹框
+      detailContent: null, // 调回单详情数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -200,7 +203,7 @@ export default {
               data.list[i].no = no + i + 1
               data.list[i].innerData = []
             }
-            this.innerData = data.list || []
+            this.innerData = data.list || [] // 子表格数据
             this.disabled = false
           }
           this.spinning = false
@@ -221,14 +224,13 @@ export default {
     },
     // 切换tab
     tabChange (key) {
-      console.log(key)
       this.expandedRowKeys = []
       setTimeout(() => {
         this.queryParam.bizType = key
         this.$refs.table.refresh(true)
       }, 100)
     },
-    // 获取各类型下的数量
+    // 获取各状态下的数量
     getSumByType () {
       const params = JSON.parse(JSON.stringify(this.queryParam))
       params.billState = ''
@@ -278,6 +280,7 @@ export default {
       this.resetData()
       this.getSumByType()
     },
+    // 重置列表
     resetData () {
       this.$refs.rangeDate.resetDate(this.time)
       this.queryParam = {
@@ -288,7 +291,7 @@ export default {
         bizType: 'ALL'
       }
     },
-    // 退库
+    // 退库弹框
     handleRecall (row) {
       this.showModal = true
       this.currentData = row
@@ -314,7 +317,7 @@ export default {
         }
       })
     },
-    // 删除
+    // 删除调回单
     handleDelete (row) {
       const _this = this
       this.$confirm({
@@ -335,10 +338,12 @@ export default {
         }
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 250
     },
+    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -359,6 +364,7 @@ export default {
         }
       })
     },
+    // 新增回调单成功,刷新列表
     handleInfoOk (e) {
       this.$refs.table.refresh()
     }

+ 17 - 14
src/views/numsGoodsShelves/recallManagement/recallModal.vue

@@ -27,7 +27,7 @@
         <template slot="confirmQty" slot-scope="text,record,index">
           <a-input-number
             size="small"
-            id="recallModal-inputNumber"
+            :id="'recallModal-inputNumber-'+record.id"
             @focus="currentInd=index"
             @change="changeNum"
             v-model="record.confirmQty"
@@ -39,8 +39,8 @@
         </template>
       </a-table>
       <div class="btn-cont">
-        <a-button type="primary" id="recallManagement-confirm-modal-save" @click="handleSave">确认退库</a-button>
-        <a-button id="recallManagement-confirm-modal-back" @click="cancel" style="margin-left: 15px;">取消</a-button>
+        <a-button type="primary" id="recallModal-confirm-modal-save" @click="handleSave">确认退库</a-button>
+        <a-button id="recallModal-confirm-modal-back" @click="cancel" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -54,11 +54,11 @@ export default {
   components: { STable },
   mixins: [commonMixin],
   props: {
-    isOpenModal: {
+    isOpenModal: { // 是否显示弹框
       type: Boolean,
       default: false
     },
-    currentData: {
+    currentData: { // 当前操作数据
       type: Object,
       default: function () {
         return {}
@@ -72,10 +72,10 @@ export default {
         labelCol: { span: 6 },
         wrapperCol: { span: 15 }
       },
-      opened: this.isOpenModal,
-      confirmLoading: false,
-      spinning: false,
-      rules: [],
+      opened: this.isOpenModal, // 打开弹框
+      confirmLoading: false, // 确定按钮loading
+      spinning: false, // 页面loading
+      rules: [], // 规则校验
       columns: [
         { 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 || '--' } },
@@ -83,25 +83,26 @@ export default {
         { title: '实退数量', width: '15%', align: 'center', scopedSlots: { customRender: 'confirmQty' } },
         { title: '单位', dataIndex: 'product.unit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      list: []
+      list: [] // 表格数据
     }
   },
   computed: {
+    // 弹框标题
     title () {
       return '调回单退库' + ' —— ' + (this.currentData && this.currentData.shelfInfo ? this.currentData.shelfInfo.shelfName : '')
     }
   },
 
   methods: {
+    // 修改调回数量
     changeNum (val) {
-      console.log(val)
       this.list[this.currentInd].confirmQty = val
       this.list.splice()
-      console.log(this.list[this.currentInd].confirmQty, '调回数量')
     },
     // 保存
     handleSave () {
       const _this = this
+      // 判断实退数量是否为空
       const flag = _this.list.some(con => !con.confirmQty && con.confirmQty != 0)
       if (flag) {
         _this.$message.warning('实退数量不能为空!')
@@ -112,7 +113,6 @@ export default {
         content: '此操作将会扣减数字货架的库存,确认退库吗?',
         centered: true,
         onOk () {
-          // _this.$emit('close')
           _this.spinning = true
           const arr = []
           _this.list.map((item, index) => {
@@ -137,6 +137,7 @@ export default {
               _this.$emit('refresh')
               _this.cancel()
             } else {
+              // 检查库存清空
               if (res.errCode == 'VALIDATE_STOCK_LACK') {
                 _this.walidateStock(res.message)
               }
@@ -146,6 +147,7 @@ export default {
         }
       })
     },
+    // 库存不足提示
     walidateStock (msg) {
       const h = this.$createElement
       const p = []
@@ -160,6 +162,7 @@ export default {
         onOk () {}
       })
     },
+    // 获取调回明细列表
     getData () {
       this.spinning = true
       shelfRecallDetailList({ recallBillSn: this.currentData.recallBillSn }).then(res => {
@@ -176,7 +179,7 @@ export default {
         this.spinning = false
       })
     },
-    // 取消
+    // 取消关闭弹框
     cancel () {
       this.$emit('close')
     }