lilei před 2 roky
rodič
revize
0d15c5aea5

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1676273643992
+  "version": 1676274572534
 }

+ 19 - 16
src/views/reportData/salesDetailReport/list.vue

@@ -351,6 +351,7 @@ export default {
       this.queryParam.productEntity.name = ''
       this.queryParam.warehouseSn = undefined
       this.queryParam.warehouseLocationSn = undefined
+      this.queryParam.showCost = undefined
       this.queryParam.warehouseCascade = []
       this.queryParam.salesBillNo = ''
       this.queryParam.salesManName = ''
@@ -362,22 +363,24 @@ export default {
     // 导出
     handleExport () {
       const _this = this
-      this.$refs.ruleForm.validate(valid => {
-        if (valid) {
-          const params = _this.queryParam
-          params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
-          _this.exportLoading = true
-          _this.spinning = true
-          reportSalesBillDetailExport(params).then(res => {
-            downloadExcel(res, '销售明细报表')
-            _this.exportLoading = false
-            _this.spinning = false
-          })
-        } else {
-          console.log('error submit!!')
-          return false
-        }
-      })
+      const str = JSON.stringify(this.queryParam)
+      const ret = str.replace(/\[|\]/g, '"').replace(/"},"/g, '","').replace(/"}/g, '","').match(/"\:".*?","/g)
+      const ret1 = ret.filter(item => item != '":"","')
+      console.log(ret1)
+      if (ret1.length) {
+        const params = _this.queryParam
+        params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
+        _this.exportLoading = true
+        _this.spinning = true
+        reportSalesBillDetailExport(params).then(res => {
+          downloadExcel(res, '销售明细报表')
+          _this.exportLoading = false
+          _this.spinning = false
+          _this.queryParam.showCost = undefined
+        })
+      } else {
+        this.$message.info('请至少输入一个查询条件')
+      }
     },
     filterOption (input, option) {
       return (

+ 21 - 15
src/views/reportData/salesReport/list.vue

@@ -298,6 +298,7 @@ export default {
       this.queryParam.citySn = undefined
       this.queryParam.countySn = undefined
       this.queryParam.settleStyleSn = undefined
+      this.queryParam.showCost = undefined
       this.queryParam.salesBillNo = ''
       this.queryParam.salesManName = ''
       this.$refs.ruleForm.resetFields()
@@ -307,22 +308,27 @@ export default {
     // 导出
     handleExport () {
       const _this = this
-      this.$refs.ruleForm.validate(valid => {
-        if (valid) {
-          const params = _this.queryParam
-          params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
-          _this.exportLoading = true
-          _this.spinning = true
-          reportSalesBillExport(params).then(res => {
-            downloadExcel(res, '销售报表')
-            _this.exportLoading = false
-            _this.spinning = false
-          })
-        } else {
-          console.log('error submit!!')
-          return false
+      let hasVal = false
+      for (const key in this.queryParam) {
+        if (this.queryParam[key]) {
+          hasVal = true
+          break
         }
-      })
+      }
+      if (hasVal) {
+        const params = _this.queryParam
+        params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
+        _this.exportLoading = true
+        _this.spinning = true
+        reportSalesBillExport(params).then(res => {
+          downloadExcel(res, '销售报表')
+          _this.exportLoading = false
+          _this.spinning = false
+          _this.queryParam.showCost = undefined
+        })
+      }else {
+        this.$message.info('请至少输入一个查询条件')
+      }
     },
     filterOption (input, option) {
       return (