Files
laws_weilai/jero-web/src/views/projectManagement/components/responsibilityList.vue
T
2022-07-02 17:29:43 +08:00

112 lines
2.9 KiB
Java

<template>
<a-modal
:title="title"
:width="800"
:visible="visible"
:confirm-loading="confirmLoading"
:maskClosable="false"
@cancel="visible = false"
>
<template slot="footer">
<a-button key="back" @click="visible = false">
{{$t('cancel')}}
</a-button>
</template>
<div style="text-align: right;margin-bottom: 10px">
<div @click="handleExport" class="operator-text">
<a-icon type="export" :rotate="-90"/>
{{$t('export')}}
</div>
</div>
<a-table
ref="table"
:loading="loading"
:pagination="false"
:scroll="{x: true,y:400}"
:data-source="dataSource"
:columns="columns"
>
<a slot="areaOfResponsibility" slot-scope="text,result" @click="areaOfResponsibilityClick(result)">
{{text}}
</a>
</a-table>
</a-modal>
</template>
<script>
import { getAction, postAction, downloadFile } from '@/api/manage'
import moment from 'moment'
export default {
name: 'responsibilityList',
data() {
return {
visible: false,
title: '',
confirmLoading: false,
loading: false,
dataSource: [],
queryParam: {},
url: {
groupByTerritoryXls: '/project/projectLibraryBase/exportProjectDetailsStatisticsGroupByTerritoryXls',
GroupByTerritory: '/project/projectLibraryBase/getProjectDetailsStatisticsGroupByTerritory'
},
columns: [
{
title: this.$t('areaOfResponsibility'),
dataIndex: 'dutyTerritoryName',
align: 'center',
width: 400,
ellipsis: true,
scopedSlots: { customRender: 'areaOfResponsibility' }
},
{
title: this.$t('Quantity'),
dataIndex: 'amount',
align: 'center',
ellipsis: true,
width: 300
}
]
}
},
mounted() {
},
methods: {
getData(data) {
this.visible = true
this.title = data.title
this.queryParam = data
this.getList(data)
},
getList(data) {
this.loading = true
getAction(this.url.GroupByTerritory, data).then((res) => {
if (res.success) {
this.loading = false
this.dataSource = res.result.dataList || []
} else {
this.loading = false
this.dataSource = []
}
})
},
handleExport() {
downloadFile(this.url.groupByTerritoryXls, this.title + '.xls', this.queryParam)
},
handleCancel() {
this.visible = false
},
areaOfResponsibilityClick(item) {
if (this.queryParam.operatorType == 'queryListingToConfirmStatistics' || this.queryParam.operatorType == 'queryTaskToConfirmStatistics'){
item.isListing = '1'
}
this.$emit('responsibility', item)
}
}
}
</script>
<style scoped>
</style>