Explorar el Código

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

陈瑞 hace 3 años
padre
commit
14e845b5fc

+ 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 || []))
       }
     }
   }

+ 7 - 5
src/views/numsGoodsShelves/shelfMonitoring/list.vue

@@ -180,13 +180,15 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
-        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '绑定产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '绑定产品名称', dataIndex: 'productName', width: '23%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '货位产品状态', scopedSlots: { customRender: 'state' }, width: '15%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '绑定产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '绑定产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '货位产品状态', scopedSlots: { customRender: 'state' }, width: '10%', align: 'center' },
+        { title: '补货在途', dataIndex: 'replenishBillQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调回在途', dataIndex: 'recallBillQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { 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 || text == 0) ? text : '--') } },
+        { title: '滞销天数', dataIndex: 'unsalableDays', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'left' }
       ],
       // 加载数据方法 必须为 Promise 对象

+ 6 - 2
src/views/numsGoodsShelves/shelfMonitoring/warehouseDetail.vue

@@ -58,6 +58,10 @@
           :data="loadData"
           :defaultLoadData="false"
           bordered>
+          <template slot="qty" slot-scope="text, record">
+            {{ (record.bizType == 'PUT_REPLENISH_BILL' || record.bizType == 'MONTH') ? '+' : (record.bizType == 'OUT_RECALL_BILL' || record.bizType == 'OUT_ORDER_BILL') ? '-':'' }}
+            {{ (record.qty || record.qty==0) ? record.qty : '--' }}
+          </template>
         </s-table>
       </a-card>
     </a-spin>
@@ -89,8 +93,8 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '24%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '关联单据类型', dataIndex: 'bizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '关联单据号', dataIndex: 'bizNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '关联单据号', dataIndex: 'bizNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', scopedSlots: { customRender: 'qty' }, width: '8%', align: 'center' }
         // { title: '状态', dataIndex: 'stateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象

+ 5 - 2
src/views/numsGoodsShelves/shelfSet/bindProductModal.vue

@@ -163,6 +163,9 @@ export default {
           if (this.type != 'bind') { // 修改信息、更换产品
             form.shelfProductSn = _this.nowData && _this.nowData.shelfProductApiEntity && _this.nowData.shelfProductApiEntity.shelfProductSn
           }
+          if (this.type == 'replace') { // 更换产品
+            form.updateProductFlag = 1
+          }
           _this.spinning = true
           shelfProductSave(form).then(res => {
             if (res.status == 200) {
@@ -185,7 +188,7 @@ export default {
       shelfProductDetail({ shelfPlaceSn: this.nowData && this.nowData.shelfPlaceSn }).then(res => {
         if (res.status == 200 && res.data) {
           this.productInfo = res.data
-          if(this.type == 'edit'){
+          if (this.type == 'edit') {
             this.form.productSn = res.data.productSn
             this.form.productCode = res.data.productCode
           }
@@ -198,7 +201,7 @@ export default {
         }
       })
     },
-    resetData(){
+    resetData () {
       this.form.productSn = undefined
       this.form.productCode = undefined
       this.form.price = ''