lilei 2 tahun lalu
induk
melakukan
e87b0484e2

+ 2 - 3
src/views/dataExport/exportCheck/list.vue

@@ -84,6 +84,8 @@ export default {
   },
   methods: {
     getList (v) {
+      this.queryParam.checkWarehouseSn = undefined
+      this.checkList = []
       if(v){
         checkWarehouseExcelList({warehouseSn: this.queryParam.warehouseSn}).then(res => {
           if (res.status == 200) {
@@ -92,9 +94,6 @@ export default {
             this.checkList = []
           }
         })
-      }else{
-        this.queryParam.checkWarehouseSn = undefined
-        this.checkList = []
       }
     },
     //  导出

+ 50 - 35
src/views/dataExport/exportSales/list.vue

@@ -2,19 +2,32 @@
   <a-card size="small" :bordered="false" class="exportCheckList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div ref="tableSearch" class="table-page-search-wrapper">
+      <div ref="tableSearch">
         <a-form-model
           id="exportCheckList-form"
           ref="ruleForm"
           class="form-model-con"
-          layout="inline"
           :model="queryParam"
           :rules="rules"
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           @keyup.enter.native="handleSearch" >
+          <a-row :gutter="15" v-show="isShowWarehouse">
+            <a-col :md="12" :sm="24">
+              <a-form-model-item label="选择仓库" prop="warehouseSn">
+                <warehouse
+                  v-model="queryParam.warehouseSn"
+                  isPermission
+                  @load="loadWareHouse"
+                  id="exportCheckList-warehouseSn"
+                  placeholder="请选择仓库"
+                  @change="getList"
+                />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
           <a-row :gutter="15">
-            <a-col :md="10" :sm="24">
+            <a-col :md="12" :sm="24">
               <a-form-model-item label="选择时间范围" prop="dateArr">
                 <a-select id="exportCheckList-print" v-model="queryParam.dateArr" placeholder="请选择时间范围" allowClear>
                   <a-select-option v-for="item in checkList" :value="item" :key="item">
@@ -23,16 +36,17 @@
                 </a-select>
               </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-button
+          </a-row>
+          <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }">
+            <a-button
                 type="primary"
                 class="button-warning"
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
                 id="exportCheckList-export">导出</a-button>
-            </a-col>
-          </a-row>
+            <a-button @click="pageInit" style="margin-left: 15px" id="chooseCustom-btn-back">重置</a-button>
+          </a-form-model-item>
         </a-form-model>
       </div>
     </a-spin>
@@ -44,11 +58,12 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { checkWarehouseExcelList } from '@/api/checkWarehouse'
 import { exportSalesOutProduct } from '@/api/stockOut.js'
+import warehouse from '@/views/common/chooseWarehouse.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 export default {
   name: 'ExportSalesList',
   mixins: [commonMixin],
-  components: { STable, VSelect },
+  components: { STable, VSelect, warehouse },
   data () {
     return {
       spinning: false,
@@ -56,10 +71,12 @@ export default {
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
       queryParam: { //  查询条件
-        dateArr: undefined
+        dateArr: undefined,
+        warehouseSn: undefined
       },
       rules: {
-        'dateArr': [{ required: true, message: '请选择时间范围', trigger: 'change' }]
+        'dateArr': [{ required: true, message: '请选择时间范围', trigger: 'change' }],
+        warehouseSn: [{ required: true, message: '请选择仓库', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
@@ -67,17 +84,21 @@ export default {
     }
   },
   methods: {
-    getList () {
-      checkWarehouseExcelList().then(res => {
-        if (res.status == 200) {
-          const arr = res.data.reverse()
-          for (let i = arr.length - 1; i > 0; i--) {
-            this.checkList.push([arr[i - 1].financeAuditTime, arr[i].financeAuditTime].join(' 至 '))
+    getList (v) {
+      this.queryParam.dateArr = undefined
+      this.checkList = []
+      if(v){
+        checkWarehouseExcelList({warehouseSn: this.queryParam.warehouseSn}).then(res => {
+          if (res.status == 200) {
+            const arr = res.data.reverse()
+            for (let i = arr.length - 1; i > 0; i--) {
+              this.checkList.push([arr[i - 1].financeAuditTime, arr[i].financeAuditTime].join(' 至 '))
+            }
+          } else {
+            this.checkList = []
           }
-        } else {
-          this.checkList = []
-        }
-      })
+        })
+      }
     },
     //  导出
     handleExport () {
@@ -97,23 +118,17 @@ export default {
         }
       })
     },
-    pageInit () {
-      const _this = this
-      this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
-      })
+    loadWareHouse(){
+      const defWareHouse = this.$store.state.app.defWarehouse
       this.queryParam.dateArr = undefined
-      this.$refs.ruleForm.resetFields()
-      this.getList()
+      this.queryParam.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse?defWareHouse.warehouseSn:undefined)
+
+      if(!this.isShowWarehouse){
+        this.getList(true)
+      }
     },
-    setTableH () {
-      const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 238
-    }
-  },
-  watch: {
-    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
-      this.setTableH()
+    pageInit () {
+      this.$refs.ruleForm.resetFields()
     }
   },
   mounted () {