lilei 2 年之前
父节点
当前提交
288789876b

+ 2 - 2
src/api/checkWarehouse.js

@@ -136,13 +136,13 @@ export const checkWarehouseDetailFinanceList = (params) => {
 export const checkWarehouseExcelList = (params) => {
   return axios({
     url: `/checkWarehouse/excelList`,
-    method: 'get'
+    data: params,
+    method: 'post'
   })
 }
 // 数据导出  导出盘点   盘点列表  导出
 export const checkWarehouseExport = params => {
   const url = `/checkWarehouse/excel/${params.checkWarehouseSn}`
-  delete params.checkWarehouseSn
   return axios.request({
     url: url,
     data: params,

+ 31 - 28
src/views/dataExport/exportCheck/list.vue

@@ -11,18 +11,7 @@
           :rules="rules"
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          @keyup.enter.native="handleSearch" >
-          <a-row :gutter="15">
-            <a-col :md="12" :sm="24">
-              <a-form-model-item label="选择盘点单" prop="checkWarehouseSn">
-                <a-select id="exportCheckList-print" v-model="queryParam.checkWarehouseSn" placeholder="请选择盘点单" allowClear>
-                  <a-select-option v-for="item in checkList" :value="item.checkWarehouseSn" :key="item.checkWarehouseSn">
-                    <span>{{ item.financeAuditTime }} - {{ item.checkWarehouseNo }}</span>
-                  </a-select-option>
-                </a-select>
-              </a-form-model-item>
-            </a-col>
-          </a-row>
+          @keyup.enter.native="handleExport" >
           <a-row :gutter="15" v-show="isShowWarehouse">
             <a-col :md="12" :sm="24">
               <a-form-model-item label="选择仓库" prop="warehouseSn">
@@ -31,10 +20,22 @@
                   isPermission
                   id="exportCheckList-warehouseSn"
                   placeholder="请选择仓库"
+                  @change="getList"
                 />
               </a-form-model-item>
             </a-col>
           </a-row>
+          <a-row :gutter="15">
+            <a-col :md="12" :sm="24">
+              <a-form-model-item label="选择盘点单" prop="checkWarehouseSn">
+                <a-select id="exportCheckList-print" v-model="queryParam.checkWarehouseSn" placeholder="请选择盘点单" allowClear>
+                  <a-select-option v-for="item in checkList" :value="item.checkWarehouseSn" :key="item.checkWarehouseSn">
+                    <span>{{ item.financeAuditTime }} - {{ item.checkWarehouseNo }}</span>
+                  </a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
           <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }">
             <a-button
                 type="primary"
@@ -43,7 +44,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 id="exportCheckList-export">导出</a-button>
-            <a-button @click="cancel" style="margin-left: 15px" id="chooseCustom-btn-back">重置</a-button>
+            <a-button @click="pageInit" style="margin-left: 15px" id="chooseCustom-btn-back">重置</a-button>
           </a-form-model-item>
         </a-form-model>
       </div>
@@ -81,14 +82,19 @@ export default {
     }
   },
   methods: {
-    getList () {
-      checkWarehouseExcelList().then(res => {
-        if (res.status == 200) {
-          this.checkList = res.data || []
-        } else {
-          this.checkList = []
-        }
-      })
+    getList (v) {
+      if(v){
+        checkWarehouseExcelList({warehouseSn: this.queryParam.warehouseSn}).then(res => {
+          if (res.status == 200) {
+            this.checkList = res.data || []
+          } else {
+            this.checkList = []
+          }
+        })
+      }else{
+        this.queryParam.checkWarehouseSn = undefined
+        this.checkList = []
+      }
     },
     //  导出
     handleExport () {
@@ -108,14 +114,11 @@ export default {
         }
       })
     },
-    cancel(){
-      this.queryParam.checkWarehouseSn = undefined
-      this.queryParam.warehouseSn = undefined
-      this.$refs.ruleForm.resetFields()
-    },
     pageInit () {
-      this.cancel()
-      this.getList()
+      this.$refs.ruleForm.resetFields()
+      const defWareHouse = this.$store.state.app.defWarehouse
+      this.queryParam.checkWarehouseSn = undefined
+      this.queryParam.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse?defWareHouse.warehouseSn:undefined)
     }
   },
   mounted () {

+ 30 - 23
src/views/purchasingManagement/bulkWarehousingOrder/productModal.vue

@@ -39,10 +39,10 @@
         </a-form-model-item>
         <a-form-model-item label="产品名称" prop="productName">{{ form.productName || '--' }}</a-form-model-item>
         <a-form-model-item label="原厂编码" prop="productOrigCode">{{ form.productOrigCode || '--' }}</a-form-model-item>
-        <a-form-model-item label="仓库仓位" prop="warehouse">
+        <a-form-model-item label="仓库仓位" prop="warehouseLocationSn">
           <a-cascader
             @change="changeWarehouseCascade"
-            v-model="form.warehouse"
+            v-model="defaultWarehouseCascade"
             expand-trigger="hover"
             :allowClear="false"
             :options="warehouseCascadeData"
@@ -128,7 +128,7 @@ export default {
         productSn: [
           { required: true, message: '请选择产品编码', trigger: 'change' }
         ],
-        warehouse: [
+        warehouseLocationSn: [
           { required: true, message: '请选择仓库仓位', trigger: 'change' }
         ],
         productCost: [
@@ -265,24 +265,30 @@ export default {
       const _this = this
       warehouseCascadeList({}).then(res => {
         if (res.status == 200) {
-          this.warehouseCascadeData = res.data.find(item => _this.defWarehouse && item.warehouseSn == _this.defWarehouse.warehouseSn)
-          this.defaultWarehouseCascade[0] = this.defWarehouse.warehouseSn
-          this.warehouseCascadeData.map(item => {
-            item.sn = item.warehouseSn
-            if (item.warehouseLocationList) {
-              item.warehouseLocationList.map(subItem => {
-                subItem.sn = subItem.warehouseLocationSn
-                if(subItem.defaultFlag == 1){
-                  _this.defaultWarehouseCascade[1] = subItem.warehouseLocationSn
-                  _this.form.warehouse = _this.defaultWarehouseCascade
-                  _this.form.warehouseSn = _this.defaultWarehouseCascade[0] || undefined
-                  _this.form.warehouseLocationSn = _this.defaultWarehouseCascade[1] || undefined
-                  _this.warehouseSnBackups = _this.defaultWarehouseCascade[0] || undefined
-                  _this.warehouseLocationSnBackups = _this.defaultWarehouseCascade[1] || undefined
-                }
-              })
-            }
-          })
+          // 默认仓库
+          const defSn = this.isShowWarehouse ? this.nowData.warehouseSn : this.defWarehouse&&this.defWarehouse.warehouseSn
+          this.defaultWarehouseCascade[0] = defSn
+          const data = res.data.find(item => item.warehouseSn == defSn)
+          if(data){
+            data.sn = data.warehouseSn
+            if (data.warehouseLocationList) {
+              data.warehouseLocationList.map(subItem => {
+                  subItem.sn = subItem.warehouseLocationSn
+                  if(subItem.defaultFlag == 1){
+                    _this.defaultWarehouseCascade[1] = subItem.warehouseLocationSn
+                    _this.form.warehouse = _this.defaultWarehouseCascade
+                    _this.form.warehouseSn = _this.defaultWarehouseCascade[0] || undefined
+                    _this.form.warehouseLocationSn = _this.defaultWarehouseCascade[1] || undefined
+                    _this.warehouseSnBackups = _this.defaultWarehouseCascade[0] || undefined
+                    _this.warehouseLocationSnBackups = _this.defaultWarehouseCascade[1] || undefined
+                  }
+                })
+              }
+            this.warehouseCascadeData = [data]
+          }else{
+            this.warehouseCascadeData = []
+          }
+          
         } else {
           this.warehouseCascadeData = []
         }
@@ -297,11 +303,12 @@ export default {
         productCode: '',
         productOrigCode: '',
         warehouse: [],
-        warehouseSn: '',
-        warehouseLocationSn: '',
+        warehouseSn: this.warehouseSnBackups,
+        warehouseLocationSn: this.warehouseLocationSnBackups,
         productCost: '',
         productQty: ''
       }
+      this.defaultWarehouseCascade = [this.warehouseSnBackups,this.warehouseLocationSnBackups]
       this.productCost = ''
       this.isGift = false
     }

+ 2 - 0
src/views/purchasingManagement/purchaseReturn/addModal.vue

@@ -185,6 +185,8 @@ export default {
         this.$nextTick(() => {
           this.$refs.attachList.setFileList('')
           this.$refs.ruleForm.resetFields()
+          // 默认仓库
+          this.form.warehouseSn = this.isShowWarehouse ? undefined : this.defWarehouse&&this.defWarehouse.warehouseSn
         })
       } else {
         if (this.itemSn) {