Browse Source

新增报表

lichao 3 years ago
parent
commit
93842a7ecc

+ 7 - 0
src/components/report-dialog/main.vue

@@ -120,6 +120,7 @@ export default {
       });
     },
     goReport(name) {
+      console.log(name)
       let tenantId = this.$store.getters.userInfo.tenant_id
       if(this.reportName == "同海-统计列表"){
         this.$router.push({
@@ -138,6 +139,12 @@ export default {
         this.$router.push({
           path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}&tenantId=${tenantId}`
         });
+      }else if(name == "国内贸易-库存账.ureport.xml"){
+        this.$router.push({
+          path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}
+          &code=${this.searchValue.code}
+          &cname=${this.searchValue.cname}`
+        });
       }else{
         this.$router.push({
           path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}`

+ 25 - 1
src/views/businessManagement/inventoryAccount/index.vue

@@ -48,6 +48,8 @@
             type="info"
             icon="el-icon-printer"
             size="small"
+            :loading="exportLoading"
+            @click.stop="statement"
           >报 表
           </el-button>
         </template>
@@ -59,6 +61,12 @@
         <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"/>
       </el-dialog>
     </basic-container>
+    <report-dialog
+      :switchDialog="switchDialog"
+      :searchValue="statementData"
+      :reportName="'国内贸易-库存账'"
+      @onClose="onClose()"
+    ></report-dialog>
   </div>
 </template>
 <script>
@@ -66,13 +74,20 @@ import option from "./configuration/mainList.json"
 import {deleteTemplate,customerList,typeSave} from "@/api/basicData/inventoryAccount"
 import {getToken} from "@/util/auth";
 import { defaultDate } from "@/util/date";
+import reportDialog from "@/components/report-dialog/main";
 
 export default {
+  components:{
+    reportDialog
+  },
   data() {
     return {
       data: [],
       search:{},
       loading: false,
+      exportLoading:false,
+      switchDialog:false,
+      statementData: {},
       excelForm: {},
       excelOption: {
         submitBtn: false,
@@ -110,7 +125,6 @@ export default {
   },
   created() {
     this.search.createTime = defaultDate(1)
-    console.log(this.search)
     let i = 0;
     this.option.column.forEach(item => {
       if (item.search) i++
@@ -232,6 +246,16 @@ export default {
       }
       // this.show = false;
     },
+    statement() {
+      this.statementData = {...this.search}
+      this.statementData.createStartTime = this.statementData.createTime[0]+ " " + "00:00:00"
+      this.statementData.createEndTime = this.statementData.createTime[1]+ " " + "23:59:59"
+      delete this.statementData.createTime
+      this.switchDialog = !this.switchDialog;
+    },
+    onClose(val) {
+      this.switchDialog = val;
+    },
   }
 }
 </script>