|
|
|
|
@ -20,13 +20,14 @@ |
|
|
|
|
@on-load="onLoad" |
|
|
|
|
@cell-click="cellClick" |
|
|
|
|
:cell-class-name="tableCellClassName" |
|
|
|
|
@sort-change="sortChange" |
|
|
|
|
> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<el-button type="primary" @click="handleCost">成本计算</el-button> |
|
|
|
|
<el-button type="danger" @click="handleDelete">删除</el-button> |
|
|
|
|
<el-button type="primary" @click="handleCost" v-if="permission.costStatistics_calculate">成本计算</el-button> |
|
|
|
|
<el-button type="danger" @click="handleDelete" v-if="permission.calculate_delete">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #menu-right> |
|
|
|
|
<el-button type="primary" @click="handleExport">导出</el-button> |
|
|
|
|
<el-button type="primary" @click="handleExport" v-if="permission.calculate_export">导出</el-button> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
</div> |
|
|
|
|
@ -75,6 +76,7 @@ |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import {getList,deleteTable,verifyTable,calculateTable,exportData,getDetail,exportMaterial,exportWorkCenterMaterial,exportAuxiliaryPersonMaterial} from "@/api/costManagement/costStatistics" |
|
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
export default { |
|
|
|
|
data(){ |
|
|
|
|
return{ |
|
|
|
|
@ -82,7 +84,9 @@ export default { |
|
|
|
|
openShow:false, |
|
|
|
|
data:[], |
|
|
|
|
form:{}, |
|
|
|
|
query:{}, |
|
|
|
|
query:{ |
|
|
|
|
ascs:'work_center_code' |
|
|
|
|
}, |
|
|
|
|
page:{ |
|
|
|
|
pageSize: 10, |
|
|
|
|
currentPage: 1, |
|
|
|
|
@ -154,7 +158,9 @@ export default { |
|
|
|
|
prop: 'workCenterName', |
|
|
|
|
search: false, |
|
|
|
|
sortable: false, |
|
|
|
|
sortable: 'custom', |
|
|
|
|
overHidden: true, |
|
|
|
|
minWidth:150, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '月份', |
|
|
|
|
@ -162,8 +168,8 @@ export default { |
|
|
|
|
type:"month", |
|
|
|
|
format:"YYYY-MM", |
|
|
|
|
valueFormat:"YYYY-MM", |
|
|
|
|
sortable: 'custom', |
|
|
|
|
search: true, |
|
|
|
|
sortable: false, |
|
|
|
|
overHidden: true, |
|
|
|
|
width:80, |
|
|
|
|
}, |
|
|
|
|
@ -172,46 +178,52 @@ export default { |
|
|
|
|
prop: 'productCost', |
|
|
|
|
search: false, |
|
|
|
|
sortable: false, |
|
|
|
|
sortable: 'custom', |
|
|
|
|
overHidden: true, |
|
|
|
|
width: 95, |
|
|
|
|
width: 110, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '材料费用(元)', |
|
|
|
|
prop: 'materialCost', |
|
|
|
|
search: false, |
|
|
|
|
sortable: false, |
|
|
|
|
sortable: 'custom', |
|
|
|
|
overHidden: true, |
|
|
|
|
width: 95, |
|
|
|
|
width: 110, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '作业中心材料费用(元)', |
|
|
|
|
prop: 'workCenterMaterialCost', |
|
|
|
|
search: false, |
|
|
|
|
sortable: false, |
|
|
|
|
sortable: 'custom', |
|
|
|
|
overHidden: true, |
|
|
|
|
width: 140, |
|
|
|
|
width: 160, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '辅助人员材料费用(元)', |
|
|
|
|
prop: 'assistantMaterialCost', |
|
|
|
|
search: false, |
|
|
|
|
width: 140, |
|
|
|
|
width: 160, |
|
|
|
|
sortable: false, |
|
|
|
|
sortable: 'custom', |
|
|
|
|
overHidden: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '单位成本(元)', |
|
|
|
|
prop: 'unitCost', |
|
|
|
|
search: false, |
|
|
|
|
sortable: 'custom', |
|
|
|
|
sortable: false, |
|
|
|
|
overHidden: true, |
|
|
|
|
width: 100, |
|
|
|
|
width: 115, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '月度产出(dm²)', |
|
|
|
|
prop: 'monthOutputArea', |
|
|
|
|
search: false, |
|
|
|
|
sortable: false, |
|
|
|
|
sortable: 'custom', |
|
|
|
|
overHidden: true, |
|
|
|
|
width:120, |
|
|
|
|
}, |
|
|
|
|
@ -219,16 +231,19 @@ export default { |
|
|
|
|
label: '月度产出(v)', |
|
|
|
|
prop: 'monthOutputVolume', |
|
|
|
|
search: false, |
|
|
|
|
sortable: 'custom', |
|
|
|
|
sortable: false, |
|
|
|
|
width:120, |
|
|
|
|
overHidden: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label:"更新人", |
|
|
|
|
sortable: 'custom', |
|
|
|
|
prop:"updateUserName", |
|
|
|
|
width: 80, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
sortable: 'custom', |
|
|
|
|
label:"更新时间", |
|
|
|
|
prop:"updateTime", |
|
|
|
|
width:160, |
|
|
|
|
@ -304,10 +319,38 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
...mapGetters(['permission']), |
|
|
|
|
}, |
|
|
|
|
created(){ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods:{ |
|
|
|
|
// 表格排序 |
|
|
|
|
sortChange({ prop, order }) { |
|
|
|
|
console.log('prop----------',prop) |
|
|
|
|
console.log('order----------',order) |
|
|
|
|
if (!prop) { |
|
|
|
|
// 如果取消排序,清空排序参数 |
|
|
|
|
this.query.orderByField = undefined; |
|
|
|
|
// this.query.isAsc = undefined; |
|
|
|
|
this.query.asc = undefined; |
|
|
|
|
} else { |
|
|
|
|
const orderByField = prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase(); |
|
|
|
|
if(order === 'ascending'){ |
|
|
|
|
this.query.ascs = orderByField == 'WORK_CENTER_NAME' ? 'WORK_CENTER_CODE' : orderByField; |
|
|
|
|
this.query.descs = undefined; |
|
|
|
|
}else{ |
|
|
|
|
this.query.descs = orderByField == 'WORK_CENTER_NAME' ? 'WORK_CENTER_CODE' : orderByField; |
|
|
|
|
this.query.ascs = undefined; |
|
|
|
|
} |
|
|
|
|
// this.query.orderByField = orderByField; |
|
|
|
|
// this.query.isAsc = order === 'ascending' ? true : false; |
|
|
|
|
// this.query.asc = order === 'ascending' ? true : false; |
|
|
|
|
} |
|
|
|
|
// // 重新加载数据 |
|
|
|
|
this.onLoad(this.page, this.query); |
|
|
|
|
}, |
|
|
|
|
cellClick(row, column, cell, event){ |
|
|
|
|
console.log('row----------',row) |
|
|
|
|
console.log('column----------',column) |
|
|
|
|
@ -505,13 +548,18 @@ export default { |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
searchChange(params, done){ |
|
|
|
|
this.query = params; |
|
|
|
|
this.query = { |
|
|
|
|
...params, |
|
|
|
|
ascs:'work_center_code' |
|
|
|
|
}; |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.onLoad() |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
searchReset(){ |
|
|
|
|
this.query = {} |
|
|
|
|
this.query = { |
|
|
|
|
ascs:'work_center_code' |
|
|
|
|
} |
|
|
|
|
this.onLoad() |
|
|
|
|
}, |
|
|
|
|
selectionChange(list){ |
|
|
|
|
|