Bläddra i källkod

成本额下载设置加载状态

yuhan 10 månader sedan
förälder
incheckning
fc13122bca

+ 26 - 18
src/views/module_kzks/dashboard/modulesDetail/ChengbenDetailList.vue

@@ -1,16 +1,17 @@
 <template>
-  <a-card :bordered="false" class="u-dialog-card">
-
-    <div class="table-operator">
-      <a-button type="primary" icon="download" @click="handleExportXls('当月成本额明细')">导出</a-button>
-    </div>
-    <a-tabs :default-active-key="0" @change="changeTab">
-      <a-tab-pane :key="index" :tab="item.title" v-for="(item, index) in chengbenTabs">
-        <clf-detail v-if="chooseTabIndex === 0"></clf-detail>
-        <other-detail v-if="chooseTabIndex !== 0 && chooseTab === item.value" :listUrl="listUrl"></other-detail>
-      </a-tab-pane>
-    </a-tabs>
-  </a-card>
+  <a-spin :spinning="spinning">
+    <a-card :bordered="false" class="u-dialog-card">
+      <div class="table-operator">
+        <a-button type="primary" icon="download" @click="handleExportXls('当月成本额明细')">导出</a-button>
+      </div>
+      <a-tabs :default-active-key="0" @change="changeTab">
+        <a-tab-pane :key="index" :tab="item.title" v-for="(item, index) in chengbenTabs">
+          <clf-detail v-if="chooseTabIndex === 0"></clf-detail>
+          <other-detail v-if="chooseTabIndex !== 0 && chooseTab === item.value" :listUrl="listUrl"></other-detail>
+        </a-tab-pane>
+      </a-tabs>
+    </a-card>
+  </a-spin>
 </template>
 
 <script>
@@ -28,6 +29,7 @@
     },
     data () {
       return {
+        spinning: false,
         chengbenTabs: [
           { title: '材料费', value: 'clf', url: '/index/getClfDetailNew'},
           { title: '专用费', value: 'zyf', url: '/index/getZyfDetailNew'},
@@ -50,6 +52,9 @@
     created() {
     },
     computed: {
+      departNameList() {
+        return this.$store.getters.departNameList
+      },
     },
     methods: {
       // 使用jeecgListMinxin中方法,但不需要loadData
@@ -67,16 +72,19 @@
           fileName = "导出文件"
         }
         // let param = this.getQueryParams();
-        let param = {};
-        if(this.selectedRowKeys && this.selectedRowKeys.length>0){
-          param['selections'] = this.selectedRowKeys.join(",")
-        }
-        console.log("导出参数",param)
-        downFile(this.url.exportXlsUrl,param).then((data)=>{
+        // let param = {};
+        // if(this.selectedRowKeys && this.selectedRowKeys.length>0){
+        //   param['selections'] = this.selectedRowKeys.join(",")
+        // }
+        // console.log("导出参数",param)
+        this.spinning = true
+        downFile(this.url.exportXlsUrl, {departNameList: this.departNameList}).then((data)=>{
           if (!data) {
             this.$message.warning("文件下载失败")
+            this.spinning = false
             return
           }
+          this.spinning = false
           if (typeof window.navigator.msSaveBlob !== 'undefined') {
             window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
           }else{

+ 51 - 44
src/views/module_kzks/projectCostList/modulesDetail/ProjectZcbDetailModal.vue

@@ -7,49 +7,51 @@
     :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
     cancelText="关闭"
     @cancel="handleCancel">
-    <a-card :bordered="false" class="u-dialog-card">
-      <div class="table-operator">
-        <a-button type="primary" icon="download" @click="handleExportXls('总成本明细')">导出</a-button>
-      </div>
-      <a-tabs default-active-key="clf" @change="changeTab">
-        <a-tab-pane key="clf" tab="材料费">
-          <!-- 材料费 -->
-          <material-detail-list :taskno="taskno" :cengji="cengji" :showBtn="false"></material-detail-list>
-        </a-tab-pane>
-        <a-tab-pane key="zyf" tab="专用费">
-          <!-- 专用费 -->
-          <project-chb-zyf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-zyf-list>
-        </a-tab-pane>
-        <a-tab-pane key="swf" tab="事务费">
-          <!-- 事务费 -->
-          <project-chb-swf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-swf-list>
-        </a-tab-pane>
-        <a-tab-pane key="wxf" tab="外协费">
-          <!-- 外协费 -->
-          <project-chb-wxf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-wxf-list>
-        </a-tab-pane>
-        <a-tab-pane key="rldlf" tab="燃动费">
-          <!-- 燃动费 -->
-          <project-chb-rdf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-rdf-list>
-        </a-tab-pane>
-        <a-tab-pane key="gdzczj" tab="固资费">
-          <!-- 固资费 -->
-          <project-chb-gzf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-gzf-list>
-        </a-tab-pane>
-        <a-tab-pane key="gzjlwf" tab="人工费">
-          <!-- 人工费 -->
-          <project-chb-rgf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-rgf-list>
-        </a-tab-pane>
-        <a-tab-pane key="glf" tab="管理费">
-          <!-- 管理费 -->
-          <project-chb-glf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-glf-list>
-        </a-tab-pane>
-        <a-tab-pane key="sxf" tab="筛选费">
-          <!-- 筛选费 -->
-          <project-chb-sxf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-sxf-list>
-        </a-tab-pane>
-      </a-tabs>
-    </a-card>
+    <a-spin :spinning="spinning">
+      <a-card :bordered="false" class="u-dialog-card">
+        <div class="table-operator">
+          <a-button type="primary" icon="download" @click="handleExportXls('总成本明细')">导出</a-button>
+        </div>
+        <a-tabs default-active-key="clf" @change="changeTab">
+          <a-tab-pane key="clf" tab="材料费">
+            <!-- 材料费 -->
+            <material-detail-list :taskno="taskno" :cengji="cengji" :showBtn="false"></material-detail-list>
+          </a-tab-pane>
+          <a-tab-pane key="zyf" tab="专用费">
+            <!-- 专用费 -->
+            <project-chb-zyf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-zyf-list>
+          </a-tab-pane>
+          <a-tab-pane key="swf" tab="事务费">
+            <!-- 事务费 -->
+            <project-chb-swf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-swf-list>
+          </a-tab-pane>
+          <a-tab-pane key="wxf" tab="外协费">
+            <!-- 外协费 -->
+            <project-chb-wxf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-wxf-list>
+          </a-tab-pane>
+          <a-tab-pane key="rldlf" tab="燃动费">
+            <!-- 燃动费 -->
+            <project-chb-rdf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-rdf-list>
+          </a-tab-pane>
+          <a-tab-pane key="gdzczj" tab="固资费">
+            <!-- 固资费 -->
+            <project-chb-gzf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-gzf-list>
+          </a-tab-pane>
+          <a-tab-pane key="gzjlwf" tab="人工费">
+            <!-- 人工费 -->
+            <project-chb-rgf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-rgf-list>
+          </a-tab-pane>
+          <a-tab-pane key="glf" tab="管理费">
+            <!-- 管理费 -->
+            <project-chb-glf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-glf-list>
+          </a-tab-pane>
+          <a-tab-pane key="sxf" tab="筛选费">
+            <!-- 筛选费 -->
+            <project-chb-sxf-list :taskno="taskno" :cengji="cengji" :showBtn="false"></project-chb-sxf-list>
+          </a-tab-pane>
+        </a-tabs>
+      </a-card>
+    </a-spin>
 
     <template slot="footer">
       <a-button @click="handleCancel">关闭</a-button>
@@ -84,12 +86,13 @@ import { downFile } from '@/api/manage'
     },
     data () {
       return {
+        spinning: false,
         taskno: '',
         cengji: 1,
         title:'',
         width: 1200,
         visible: false,
-        disableSubmit: false
+        disableSubmit: false,
       }
     },
     methods: {
@@ -114,11 +117,15 @@ import { downFile } from '@/api/manage'
         //   param['selections'] = this.selectedRowKeys.join(",")
         // }
         // console.log("导出参数",param)
+        this.spinning = true
         downFile('/projectCostHuiji/projectCostHuiji/exportZcbXls',{taskno: this.taskno}).then((data)=>{
+          console.log('data', data)
           if (!data) {
             this.$message.warning("文件下载失败")
+            this.spinning = false
             return
           }
+          this.spinning = false
           if (typeof window.navigator.msSaveBlob !== 'undefined') {
             window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
           }else{