|
@@ -1,131 +1,50 @@
|
|
|
<template>
|
|
|
- <a-card :bordered="false">
|
|
|
+ <a-card :bordered="false" class="u-dialog-card">
|
|
|
|
|
|
- <!-- table区域-begin -->
|
|
|
- <div>
|
|
|
- <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
|
|
- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
|
|
|
- <a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
|
|
- </div> -->
|
|
|
-
|
|
|
- <a-table
|
|
|
- ref="table"
|
|
|
- size="middle"
|
|
|
- :scroll="{x:true}"
|
|
|
- bordered
|
|
|
- rowKey="id"
|
|
|
- :columns="columns"
|
|
|
- :dataSource="dataSource"
|
|
|
- :pagination="ipagination"
|
|
|
- :loading="loading"
|
|
|
- class="j-table-force-nowrap"
|
|
|
- @change="handleTableChange">
|
|
|
- </a-table>
|
|
|
+ <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>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import '@/assets/less/TableExpand.less'
|
|
|
- import { mixinDevice } from '@/utils/mixin'
|
|
|
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
+ import { downFile } from '@/api/manage'
|
|
|
+ import ClfDetail from '../chengbeneDetali/clfDetail.vue'
|
|
|
+ import OtherDetail from '../chengbeneDetali/otherDetail.vue'
|
|
|
|
|
|
export default {
|
|
|
- name: 'ListModalList',
|
|
|
- mixins:[JeecgListMixin, mixinDevice],
|
|
|
+ name: 'ChengbenDetailList',
|
|
|
components: {
|
|
|
+ ClfDetail,
|
|
|
+ OtherDetail
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- // 表头
|
|
|
- columns: [
|
|
|
- {
|
|
|
- title: '序号',
|
|
|
- dataIndex: '',
|
|
|
- key:'rowIndex',
|
|
|
- width:60,
|
|
|
- align:"center",
|
|
|
- customRender:function (t,r,index) {
|
|
|
- return parseInt(index)+1;
|
|
|
- }
|
|
|
- },
|
|
|
- // {
|
|
|
- // title:'任务号',
|
|
|
- // align:"center",
|
|
|
- // dataIndex: 'taskno'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // title:'下达部门',
|
|
|
- // align:"center",
|
|
|
- // dataIndex: 'xdbm'
|
|
|
- // },
|
|
|
- {
|
|
|
- title:'责任部门',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'zrbm'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'材料费(元)',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'clf'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'专用费(元)',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'zyf'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'事务费(元)',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'swf'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'外协费(元)',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'wxf'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'燃动费(元)',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'rldlf'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'固资费(元)',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'gdzczj'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'人工费(元)',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'gzjlwf'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'管理费(元)',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'glf'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'筛选费(元)',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'sxf'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'总成本(元)',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'zcb'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'年月',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'yearmonth'
|
|
|
- },
|
|
|
+ chengbenTabs: [
|
|
|
+ { title: '材料费', value: 'clf', url: '/index/getClfDetailNew'},
|
|
|
+ { title: '专用费', value: 'zyf', url: '/index/getZyfDetailNew'},
|
|
|
+ { title: '事务费', value: 'swf', url: '/index/getSwfDetailNew'},
|
|
|
+ { title: '外协费', value: 'wxf', url: '/index/getWxfDetailNew'},
|
|
|
+ { title: '燃动费', value: 'rdf', url: '/index/getRdfDetailNew'},
|
|
|
+ { title: '固资费', value: 'gzf', url: '/index/getZjfDetailNew'},
|
|
|
+ { title: '人工费', value: 'rgf', url: '/index/getRgfDetailNew'},
|
|
|
+ { title: '管理费', value: 'glf', url: '/index/getGlfDetailNew'},
|
|
|
+ { title: '筛选费', value: 'sxf', url: '/index/getSxfDetailNew'},
|
|
|
],
|
|
|
+ chooseTabIndex: 0,
|
|
|
+ chooseTab: '', // 为了解决用v-else会出现多个请求的问题
|
|
|
+ listUrl: '',
|
|
|
url: {
|
|
|
- list: "/index/getZhiChuDetail",
|
|
|
+ exportXlsUrl: "/index/exportCneXls",
|
|
|
},
|
|
|
- dictOptions:{},
|
|
|
- superFieldList:[],
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -133,11 +52,56 @@
|
|
|
computed: {
|
|
|
},
|
|
|
methods: {
|
|
|
- initDictConfig(){
|
|
|
+ // 使用jeecgListMinxin中方法,但不需要loadData
|
|
|
+ // loadData(){},
|
|
|
+ changeTab(e){
|
|
|
+ console.log(e)
|
|
|
+ this.chooseTabIndex = e
|
|
|
+ this.chooseTab = this.chengbenTabs[e].value
|
|
|
+ if(e !== 0){
|
|
|
+ this.listUrl = this.chengbenTabs[e].url
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleExportXls(fileName){
|
|
|
+ if(!fileName || typeof fileName != "string"){
|
|
|
+ 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)=>{
|
|
|
+ if (!data) {
|
|
|
+ this.$message.warning("文件下载失败")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
|
|
+ window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
|
|
|
+ }else{
|
|
|
+ let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
|
|
|
+ let link = document.createElement('a')
|
|
|
+ link.style.display = 'none'
|
|
|
+ link.href = url
|
|
|
+ link.setAttribute('download', fileName+'.xls')
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ document.body.removeChild(link); //下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(url); //释放掉blob对象
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
@import '~@assets/less/common.less';
|
|
|
+</style>
|
|
|
+<style lang="less" scoped>
|
|
|
+ .u-dialog-card{
|
|
|
+ /deep/.ant-card-body{
|
|
|
+ padding: 0 !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|