Browse Source

bug修复

chenrui 3 years ago
parent
commit
780235301c

+ 26 - 27
src/views/inventoryManagement/inventoryChecking/makeInventory.vue

@@ -70,7 +70,7 @@
         <!-- 筛选条件 -->
         <div class="table-page-search-wrapper">
           <a-row :gutter="15">
-            <a-col :span="18">
+            <a-col :span="19">
               <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
                 <a-row :gutter="15">
                   <a-col :md="8" :sm="24">
@@ -83,21 +83,21 @@
                       <ProductType id="inventoryCheckMakeInventoryList-productType" @change="changeProductType" v-model="productType"></ProductType>
                     </a-form-item>
                   </a-col>
-                  <a-col :md="6" :sm="24" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
+                  <a-col :md="5" :sm="24" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
                     <a-form-item label="仓库">
                       <a-select id="inventoryCheckMakeInventoryList-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
                         <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
                       </a-select>
                     </a-form-item>
                   </a-col>
-                  <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
+                  <a-col :md="5" :sm="24" style="margin-bottom: 10px;">
                     <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckMakeInventoryList-refresh">查询</a-button>
                     <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckMakeInventoryList-reset">重置</a-button>
                   </a-col>
                 </a-row>
               </a-form>
             </a-col>
-            <a-col :span="6">
+            <a-col :span="5">
               <div style="float:right;overflow: hidden;">
                 <a-button size="small" type="primary" class="button-info" id="inventoryCheckMakeInventoryList-checkZero-btn" @click="handleCheckZero">整单盘零</a-button>
               </div>
@@ -251,7 +251,7 @@ export default {
     },
     // 数量  blur
     checkQtyBlur (val, record) {
-      if (val != record.checkQtyBackups) {
+      if ((val != record.checkQtyBackups) || (!val && record.checkQtyBackups == 0)) {
         this.handleAdd(record, 'edit')
       }
     },
@@ -284,7 +284,7 @@ export default {
       }
       if (isEdit) { // 编辑
         // 清空数量时,值应保持未清空前的值,因数量都不可为空
-        if (!row.checkQty) {
+        if (!(row.checkQty || row.checkQty == 0)) {
           row.checkQty = row.checkQtyBackups
           return
         }
@@ -302,14 +302,22 @@ export default {
     },
     // 整单盘零
     handleCheckZero () {
-      this.spinning = true
-      checkWarehouseCheckZero({ checkWarehouseSn: this.$route.params.sn }).then(res => {
-        if (res.status == 200) {
-          this.$message.success(res.message)
-          this.$refs.table.refresh(true)
-          this.spinning = false
-        } else {
-          this.spinning = false
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定要进行 整单盘零 操作吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          checkWarehouseCheckZero({ checkWarehouseSn: _this.$route.params.sn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh(true)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
         }
       })
     },
@@ -320,10 +328,12 @@ export default {
     // 查询基础信息
     getDetail () {
       checkWarehouseDetail({ sn: this.$route.params.sn }).then(res => {
-        if (res.status == 200) {
-          this.basicInfoData = res.data || null
+        if (res.status == 200 && res.data) {
+          this.basicInfoData = res.data
+          this.warehouseList = res.data.warehouseList || []
         } else {
           this.basicInfoData = null
+          this.warehouseList = []
         }
       })
     },
@@ -343,16 +353,6 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    // 仓库下拉数据
-    getWarehouseList () {
-      checkWarehouseWarehouse({}).then(res => {
-        if (res.status == 200) {
-          this.warehouseList = res.data
-        } else {
-          this.warehouseList = []
-        }
-      })
-    },
     // 打印导出
     handlePrint (type) {
       if (type == 'export') {
@@ -426,7 +426,6 @@ export default {
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.getDetail()
-      vm.getWarehouseList()
     })
   }
 }

+ 4 - 11
src/views/inventoryManagement/inventoryChecking/printModal.vue

@@ -49,7 +49,6 @@
 </template>
 
 <script>
-import { checkWarehouseWarehouse } from '@/api/checkWarehouse'
 export default {
   props: {
     openModal: { //  弹框显示状态
@@ -129,16 +128,10 @@ export default {
     },
     // 仓库下拉数据
     getWarehouseList () {
-      checkWarehouseWarehouse({}).then(res => {
-        if (res.status == 200) {
-          this.warehouseList = [{ warehouseSn: 'all', name: '所有仓库' }]
-          if (res.data && res.data.length > 0) {
-            this.warehouseList = [...this.warehouseList, ...res.data]
-          }
-        } else {
-          this.warehouseList = []
-        }
-      })
+      this.warehouseList = [{ warehouseSn: 'all', name: '所有仓库' }]
+      if (this.itemData && this.itemData.warehouseList && this.itemData.warehouseList.length > 0) {
+        this.warehouseList = [...this.warehouseList, ...this.itemData.warehouseList]
+      }
     }
   },
   watch: {

+ 2 - 11
src/views/inventoryManagement/inventoryChecking/selfDisk.vue

@@ -472,8 +472,10 @@ export default {
       checkWarehouseDetail({ sn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.basicInfoData = res.data || null
+          this.warehouseList = res.data.warehouseList || []
         } else {
           this.basicInfoData = null
+          this.warehouseList = []
         }
       })
     },
@@ -526,16 +528,6 @@ export default {
       this.chooseQueryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.chooseQueryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    // 仓库下拉数据
-    getWarehouseList () {
-      checkWarehouseWarehouse({}).then(res => {
-        if (res.status == 200) {
-          this.warehouseList = res.data
-        } else {
-          this.warehouseList = []
-        }
-      })
-    },
     // 双击快速添加
     handleClickRow (record) {
       return {
@@ -626,7 +618,6 @@ export default {
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.getDetail()
-      vm.getWarehouseList()
     })
   }
 }