zhangdan 3 gadi atpakaļ
vecāks
revīzija
766a557393

+ 25 - 12
src/views/numsGoodsShelves/recallManagement/list.vue

@@ -43,7 +43,7 @@
           </a-row>
         </a-form>
       </div>
-      <a-tabs type="card" v-model="queryParam.billState" @change="tabChange" class="replenishmentManagementList-tabs">
+      <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>
         </a-tab-pane>
@@ -66,15 +66,18 @@
           <a-button
             size="small"
             type="link"
+            v-if="record.billState=='WAIT_CONFIRM'"
             class="button-primary"
             @click.stop="handleRecall(record)"
             id="shelfMonitoringList-warehousing-btn">退库</a-button>
           <a-button
             size="small"
+            v-if="record.billState=='WAIT_CONFIRM'"
             type="link"
             class="button-primary"
             @click.stop="handleCancel(record)"
             id="shelfMonitoringList-warehousing-btn">取消调回单</a-button>
+          <span v-if="record.billState!='WAIT_CONFIRM'" style="display: inline-block;margin-left: 7px;">--</span>
         </template>
         <a-table
           v-if="innerData&&innerData[index]"
@@ -117,6 +120,7 @@ export default {
       currentData: null,
       activeKey: 0, // 默认的tab
       tabsList: [],
+      currentType: 'ALL',
       expandedRowKeys: [],
       time: [
         getDate.getCurrMonthDays().starttime,
@@ -127,7 +131,7 @@ export default {
         endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         recallBillNo: '',
         shelfSn: undefined, // 数字货架sn
-        billState: 'ALL'
+        bizType: 'ALL'
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
@@ -136,7 +140,7 @@ export default {
         { title: '货架名称', dataIndex: 'shelfInfo.shelfName', width: '25%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '状态', dataIndex: 'billStateDictValue', 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: '实退总量', dataIndex: 'totalConfirmQty', width: '9%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
         { title: '操作', width: '10%', align: 'left', scopedSlots: { customRender: 'action' } }
       ],
       innerColumns: [
@@ -153,8 +157,9 @@ export default {
         this.disabled = true
         this.spinning = true
         this.expandedRowKeys = []
+        parameter.billState = this.queryParam.bizType == 'ALL' ? '' : this.queryParam.bizType
         const params = this.queryParam
-        params.billState = this.queryParam.billState == 'ALL' ? '' : this.queryParam.billState
+        // delete params.bizType
         return shelfRecallList(Object.assign(parameter, params)).then(res => {
           let data
           if (res.status == 200) {
@@ -192,20 +197,21 @@ export default {
       console.log(key)
       this.expandedRowKeys = []
       setTimeout(() => {
-        this.queryParam.billState = key
+        this.queryParam.bizType = key
         this.$refs.table.refresh(true)
+        this.currentType = key
       }, 100)
     },
     // 获取各类型下的数量
     getSumByType () {
       const params = JSON.parse(JSON.stringify(this.queryParam))
-      params.billState = this.queryParam.billState == 'ALL' ? '' : this.queryParam.billState
+      delete params.bizType
       shelfRecallStateCount(params).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.queryParam.bizType = '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
@@ -243,16 +249,23 @@ export default {
     },
     // 重置
     resetSearchForm () {
+      // this.$refs.rangeDate.resetDate(this.time)
+      // this.queryParam.billState = this.currentType
+      // this.queryParam = {
+      this.resetData()
+
+      this.getSumByType()
+    },
+    resetData () {
       this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.bizType = this.currentType
       this.queryParam = {
         beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
         endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         recallBillNo: '', // 调回单号
-        shelfSn: undefined, // 数字货架sn
-        billState: 'ALL'
+        shelfSn: undefined // 数字货架sn
       }
       this.$refs.shelfList.resetForm()
-      this.getSumByType()
     },
     // 退库
     handleRecall (row) {
@@ -295,7 +308,7 @@ export default {
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.pageInit()
-      this.resetSearchForm()
+      this.resetData()
     }
   },
   watch: {
@@ -313,7 +326,7 @@ export default {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
       this.pageInit()
-      this.resetSearchForm()
+      this.resetData()
     }
     // 仅刷新列表,不重置页面
     if (this.$store.state.app.updateList) {

+ 20 - 2
src/views/numsGoodsShelves/recallManagement/recallModal.vue

@@ -24,9 +24,12 @@
         :scroll="{ y:500 }"
         :pagination="false"
         bordered>
-        <template slot="confirmQty" slot-scope="text, record">
+        <template slot="confirmQty" slot-scope="text,record,index">
           <a-input-number
-            id="inputNumber"
+            size="small"
+            id="recallModal-inputNumber"
+            @focus="currentInd=index"
+            @change="changeNum"
             v-model="record.confirmQty"
             :precision="0"
             :min="0"
@@ -64,6 +67,7 @@ export default {
   },
   data () {
     return {
+      currentInd: 0,
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 15 }
@@ -89,6 +93,12 @@ export default {
   },
 
   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
@@ -136,6 +146,7 @@ export default {
           const no = 0
           for (var i = 0; i < this.list.length; i++) {
             this.list[i].no = no + i + 1
+            this.list[i].confirmQty = this.list[i].qty
           }
         } else {
           this.list = []
@@ -153,6 +164,13 @@ export default {
       this.opened = nVal
       if (nVal) {
         this.getData()
+        // if (this.currentData) {
+        //   this.currentData.map((item, index) => {
+        //     item.no = index + 1
+        //     item.confirmQty = item.qty
+        //   })
+        // }
+        // this.list = JSON.parse(JSON.stringify(this.currentData || []))
       }
     }
   }