chenrui 1 سال پیش
والد
کامیت
f2315856d4

+ 25 - 6
src/views/reportData/tireSalesReport/detailList.vue

@@ -75,7 +75,7 @@
                 style="margin-left: 10px"
                 type="primary"
                 class="button-warning"
-                @click="handleExport"
+                @click="handleExport(0)"
                 :disabled="disabled"
                 :loading="exportLoading"
                 v-if="$hasPermissions('B_tireSalesReportExport')"
@@ -84,7 +84,7 @@
                 style="margin-left: 10px"
                 type="primary"
                 class="button-warning"
-                @click="handleExport"
+                @click="handleExport(1)"
                 :disabled="disabled"
                 :loading="exportLoading"
                 v-if="$hasPermissions('B_tireSalesReportExport')"
@@ -167,7 +167,7 @@ import BizUser from '@/views/common/bizUser.js'
 import reportModal from '@/views/common/reportModal.vue'
 import outDetailModal from './outDetailModal'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { queryTireCount, tireListExport, tireReportDetailList } from '@/api/reportData'
+import { queryTireCount, tireListExport, tireReportDetailList, tireOutDetailListExport } from '@/api/reportData'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 export default {
   name: 'TireSalesDealerList',
@@ -374,11 +374,15 @@ export default {
       this.$refs.ruleForm.resetFields()
     },
     //  导出
-    handleExport () {
+    handleExport (pos) {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          _this.exportList()
+          if (pos == 0) {
+            _this.exportList()
+          } else {
+            _this.exportOutDetailList()
+          }
         } else {
           _this.$message.error('请选择日期')
           return false
@@ -387,18 +391,33 @@ export default {
     },
     exportList () {
       const _this = this
-      const params = _this.queryParam
+      const params = JSON.parse(JSON.stringify(_this.queryParam))
       _this.exportLoading = true
       _this.spinning = true
       _this.showExport = true
       _this.$store.state.app.curActionPermission = 'B_tireSalesReportExport'
       params.exportFlag = 1
+      delete params.time
       hdExportExcel(tireListExport, params, '轮胎明细报表', function () {
         _this.exportLoading = false
         _this.spinning = false
         _this.$store.state.app.curActionPermission = ''
       })
     },
+    exportOutDetailList () {
+      const _this = this
+      const params = JSON.parse(JSON.stringify(_this.queryParam))
+      _this.exportLoading = true
+      _this.spinning = true
+      _this.showExport = true
+      _this.$store.state.app.curActionPermission = 'B_tireSalesReportExport'
+      delete params.time
+      hdExportExcel(tireOutDetailListExport, params, '轮胎出库明细报表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+        _this.$store.state.app.curActionPermission = ''
+      })
+    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 11 - 4
src/views/reportData/tireSalesReport/index.vue

@@ -4,10 +4,10 @@
       <a-tabs default-active-key="1" @change="handleChange">
         <a-tab-pane key="1" tab="轮胎统计报表">
           <!-- 列表 -->
-          <tireList ref="tireStatisticsList" :tableHeight="tableHeight" :totalData="totalData" :queryParam="queryParam"></tireList>
+          <tireList ref="tireStatisticsList"></tireList>
         </a-tab-pane>
         <a-tab-pane key="2" tab="轮胎明细报表" force-render>
-          <detailList ref="tireDetailList" :tableHeight="tableHeight" :totalData="totalData" :queryParam="queryParam"></detailList>
+          <detailList ref="tireDetailList"></detailList>
         </a-tab-pane>
       </a-tabs>
     </a-card>
@@ -29,17 +29,24 @@ export default {
   methods: {
     handleChange (val) {
       this.tabVal = val
+    },
+    pageInit () {
+      if (this.tabVal == 1) {
+        this.$refs.tireStatisticsList.pageInit()
+      } else {
+        this.$refs.tireDetailList.pageInit()
+      }
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.$refs.tireStatisticsList.pageInit()
+      this.pageInit()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.$refs.tireStatisticsList.pageInit()
+      this.pageInit()
     }
   }
 }

+ 15 - 2
src/views/reportData/tireSalesReport/list.vue

@@ -53,7 +53,7 @@
               <a-button
                 style="margin-left: 5px"
                 type="primary"
-                @click="$refs.table.refresh(true)"
+                @click="handleSearch"
                 :disabled="disabled"
                 id="tireSalesDealerList-refresh">查询</a-button>
               <a-button
@@ -252,6 +252,18 @@ export default {
     }
   },
   methods: {
+    // 查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          _this.$message.error('请选择日期')
+          return false
+        }
+      })
+    },
     custChange (val) {
       this.queryParam.dealerName = val.name
       this.queryParam.dealerSn = val.key
@@ -325,12 +337,13 @@ export default {
     //  导出
     exportList () {
       const _this = this
-      const params = _this.queryParam
+      const params = JSON.parse(JSON.stringify(_this.queryParam))
       _this.exportLoading = true
       _this.spinning = true
       _this.showExport = true
       _this.$store.state.app.curActionPermission = 'B_tireSalesReportExport'
       params.exportFlag = 0
+      delete params.time
       hdExportExcel(tireListExport, params, '轮胎统计报表', function () {
         _this.exportLoading = false
         _this.spinning = false