|
|
|
|
@ -65,14 +65,14 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template #menu-right> |
|
|
|
|
<el-button type="primary" v-if="permission.payrollComputation_export">导出</el-button> |
|
|
|
|
<el-button type="primary" v-if="permission.payrollComputation_export" @click="handleExport">导出</el-button> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
</basic-container> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import {getList} from "@/api/performanceManagement/payrollComputation" |
|
|
|
|
import {getList,exportData} from "@/api/performanceManagement/payrollComputation" |
|
|
|
|
import jhSelect from '@/components/jh-select/index.vue'; |
|
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
export default { |
|
|
|
|
@ -705,6 +705,58 @@ export default { |
|
|
|
|
}, |
|
|
|
|
mounted() {}, |
|
|
|
|
methods: { |
|
|
|
|
handleExport() { |
|
|
|
|
let params = { |
|
|
|
|
...this.query, |
|
|
|
|
startDate:this.query.date && this.query.date.length != 0 && this.query.date[0], |
|
|
|
|
endDate:this.query.date && this.query.date.length != 0 && this.query.date[1], |
|
|
|
|
wcIds:this.query.wcId && this.query.wcId.length != 0 && this.query.wcId.join(','), |
|
|
|
|
prodIdents:this.query.prodIdent && this.query.prodIdent.length != 0 && this.query.prodIdent.join(','), |
|
|
|
|
ppsIds:this.search.ppsName && this.search.ppsName.length != 0 ? this.search.ppsName.join(',') : undefined, |
|
|
|
|
minTotalArea:this.search.minTotalArea && this.search.minTotalArea, |
|
|
|
|
maxTotalArea:this.search.maxTotalArea && this.search.maxTotalArea, |
|
|
|
|
minSingleBatchNo:this.search.minSingleBatchNo && this.search.minSingleBatchNo, |
|
|
|
|
maxSingleBatchNo:this.search.maxSingleBatchNo && this.search.maxSingleBatchNo, |
|
|
|
|
} |
|
|
|
|
if(params.date) delete params.date |
|
|
|
|
if(params.wcId) delete params.wcId |
|
|
|
|
if(params.prodIdent) delete params.prodIdent |
|
|
|
|
if(params.ppsName) delete params.ppsName |
|
|
|
|
if(params.minTotalArea && params.maxTotalArea && params.minTotalArea > params.maxTotalArea){ |
|
|
|
|
this.$message.error('最小面积不能大于最大面积') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if(params.minSingleBatchNo && params.maxSingleBatchNo && params.minSingleBatchNo > params.maxSingleBatchNo){ |
|
|
|
|
this.$message.error('最小单批数量不能大于最大单批数量') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
console.log('params===========',params) |
|
|
|
|
if( !params.startDate || !params.endDate){ |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.$confirm('是否导出数据?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
// this.loading = true; |
|
|
|
|
exportData(params).then(res => { |
|
|
|
|
const blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); |
|
|
|
|
const url = window.URL.createObjectURL(blob); |
|
|
|
|
const link = document.createElement('a'); |
|
|
|
|
link.href = url; |
|
|
|
|
link.download = '薪资计算.xlsx'; |
|
|
|
|
document.body.appendChild(link); |
|
|
|
|
link.click(); |
|
|
|
|
document.body.removeChild(link); |
|
|
|
|
window.URL.revokeObjectURL(url); |
|
|
|
|
this.$message.success('导出成功'); |
|
|
|
|
this.loading = false; |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.loading = false; |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 表格排序 |
|
|
|
|
sortChange({ prop, order }) { |
|
|
|
|
console.log('prop-------------',prop) |
|
|
|
|
|