结算全部导出,结算权限页面

This commit is contained in:
hongchao 2025-11-04 17:06:13 +08:00
parent 9ba223fe1f
commit 998aeac196
7 changed files with 370 additions and 375 deletions

View File

@ -114,3 +114,45 @@ export function delConfig(id) {
method: 'post'
})
}
/**
*
*****************************************************************************************************************************************************
*
*/
// 结算人员配置列表接口
export function getCostConfigListApi(query) {
return request({
url: '/material/sysWorkflowType/costConfigList',
method: 'get',
params: query
})
}
// 人员信息列表接口
export function getCostConfigUserListApi(query) {
return request({
url: '/material/sysWorkflowType/costConfigUserList',
method: 'get',
params: query
})
}
// 结算人员配置--修改
export function editCostConfigApi(data) {
return request({
url: '/material/sysWorkflowType/updateCostConfig',
method: 'post',
data: data
})
}
// 结算人员配置--删除
export function deleteCostConfigApi(data) {
return request({
url: '/material/sysWorkflowType/deleteCostConfig',
method: 'post',
data: data
})
}

View File

@ -864,6 +864,7 @@ export default {
findLeaf(this.lessUniteList)
if (leafNodes.length === 1) {
this.maForm.leaseUnitId = leafNodes[0].id || leafNodes[0].value
console.log("kkkkkkkkkkkkkkkk",this.maForm.leaseUnitId)
await this.getLeaseAgreementId()
}
} catch (e) {
@ -1043,10 +1044,12 @@ export default {
},
async getLeaseAgreementId() {
try {
console.log("xxxxxxxxxxxxxxxx222yyyyyyyyyyyyyy",this.maForm)
const params = {
unitId: this.maForm.leaseUnitId,
projectId: this.maForm.leaseProId
}
console.log("zzzzzzzzzyyyyyyyyyy",params)
const res = await getAgreement(params)
console.log('🚀 ~ getAgreementId ~ res:', res)
this.maForm.leaseAgreementId = res.data.agreementId
@ -1093,7 +1096,9 @@ export default {
// this.maForm.backProId = null
// })
// }, 500)
this.getAgreementId()
setTimeout(() => {
this.getAgreementId()
}, 500);
},
projectChange(val) {
setTimeout(() => {
@ -1116,7 +1121,9 @@ export default {
// getListUnite({}).then(res => {
// this.leaseUniteList = res.data
// })
this.getLeaseAgreementId()
setTimeout(() => {
this.getLeaseAgreementId();
}, 500);
// }, 500)
},
//---

View File

@ -64,7 +64,7 @@
</el-table-column>
<el-table-column label="丢失费用(元)" align="center" prop="cost" width="120">
<template slot-scope="scope">
{{ (scope.row.buyPrice * scope.row.num).toFixed(3) }}
{{ (scope.row.buyPrice * scope.row.num).toFixed(2) }}
</template>
</el-table-column>
</el-table>
@ -276,98 +276,24 @@ export default {
return;
}
try {
// Excel
const columns = [
{ key: 'index', title: '序号' },
{ key: 'agreementCode', title: '协议号' },
{ key: 'unitName', title: '结算单位' },
{ key: 'projectName', title: '结算工程' },
{ key: 'typeName', title: '机具名称' },
{ key: 'modelName', title: '规格型号' },
{ key: 'mtUnitName', title: '单位' },
{ key: 'num', title: '丢失数量' },
{ key: 'buyPrice', title: '单价(元)' },
{ key: 'cost', title: '丢失费用(元)' }
];
const formatTime = (date) => {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
};
// Excel
const excelData = [];
//
const headerRow = columns.map(col => col.title);
excelData.push(headerRow);
//
this.tableList.forEach((row, index) => {
const dataRow = columns.map(col => {
if (col.key === 'index') {
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + index + 1;
} else if (col.key === 'buyPrice') {
//
return row.buyPrice ? parseFloat(row.buyPrice.toFixed(2)) : 0.00;
} else if (col.key === 'cost') {
// buyPrice * num
const cost = (row.buyPrice || 0) * (row.num || 0);
return parseFloat(cost.toFixed(3));
} else {
return row[col.key] || '';
}
});
excelData.push(dataRow);
});
// 簿
const workbook = XLSX.utils.book_new();
const worksheet = XLSX.utils.aoa_to_sheet(excelData);
//
const columnWidths = [
{ wch: 8 }, //
{ wch: 20 }, //
{ wch: 15 }, //
{ wch: 20 }, //
{ wch: 20 }, //
{ wch: 15 }, //
{ wch: 8 }, //
{ wch: 10 }, //
{ wch: 12 }, //
{ wch: 15 } //
];
worksheet['!cols'] = columnWidths;
// 簿
XLSX.utils.book_append_sheet(workbook, worksheet, '丢失费用报表');
//
let fileName = '丢失费用报表';
if (this.queryParams.startTime && this.queryParams.endTime) {
fileName += `_${this.queryParams.startTime}_至_${this.queryParams.endTime}`;
}
fileName += `_${new Date().toISOString().slice(0, 10)}.xlsx`;
// Excel
const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
const blob = new Blob([excelBuffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
//
const link = document.createElement('a');
const url = URL.createObjectURL(blob);
link.setAttribute('href', url);
link.setAttribute('download', fileName);
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
// URL
URL.revokeObjectURL(url);
this.$modal.msgSuccess('Excel导出成功');
} catch (error) {
console.error('导出Excel失败:', error);
this.$modal.msgError('导出Excel失败请稍后重试');
}
const currentTime = formatTime(new Date());
this.download(
'/material/slt_agreement_info/exportLostList',
{
...this.queryParams,
},
`丢失费用报表_${currentTime}.xlsx`
)
},
},
}

View File

@ -57,14 +57,13 @@
<el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" />
<el-table-column label="单位" align="center" prop="mtUnitName" width="80" />
<el-table-column label="维修数量" align="center" prop="num" width="100" />
<el-table-column label="维修费用(元)" align="center" prop="cost" width="120">
<el-table-column label="维修费用(元)" align="center" prop="costs" width="120">
<template slot-scope="scope">
{{ scope.row.costs ? scope.row.costs.toFixed(2) : '0.00' }}
</template>
</el-table-column>
<el-table-column label="维修方式" align="center" prop="repairType" width="120" />
<el-table-column label="费用类型" align="center" prop="partType" width="120" />
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" min-width="50" />
</el-table>
<pagination
@ -273,99 +272,25 @@ export default {
this.$modal.msgWarning('没有可导出的数据');
return;
}
const formatTime = (date) => {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
};
try {
// Excel
const columns = [
{ key: 'index', title: '序号' },
{ key: 'agreementCode', title: '协议号' },
{ key: 'unitName', title: '结算单位' },
{ key: 'projectName', title: '结算工程' },
{ key: 'typeName', title: '机具名称' },
{ key: 'modelName', title: '规格型号' },
{ key: 'mtUnitName', title: '单位' },
{ key: 'num', title: '维修数量' },
{ key: 'costs', title: '维修费用(元)' },
{ key: 'repairType', title: '维修方式' },
{ key: 'partType', title: '费用类型' },
{ key: 'remark', title: '备注' }
];
const currentTime = formatTime(new Date());
this.download(
'/material/slt_agreement_info/exportRepairList',
{
...this.queryParams,
},
`维修费用报表_${currentTime}.xlsx`
)
// Excel
const excelData = [];
//
const headerRow = columns.map(col => col.title);
excelData.push(headerRow);
//
this.tableList.forEach((row, index) => {
const dataRow = columns.map(col => {
if (col.key === 'index') {
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + index + 1;
} else if (col.key === 'costs') {
//
return row.costs ? parseFloat(row.costs.toFixed(2)) : 0.00;
} else {
return row[col.key] || '';
}
});
excelData.push(dataRow);
});
// 簿
const workbook = XLSX.utils.book_new();
const worksheet = XLSX.utils.aoa_to_sheet(excelData);
//
const columnWidths = [
{ wch: 8 }, //
{ wch: 20 }, //
{ wch: 15 }, //
{ wch: 20 }, //
{ wch: 20 }, //
{ wch: 15 }, //
{ wch: 8 }, //
{ wch: 10 }, //
{ wch: 15 }, //
{ wch: 12 }, //
{ wch: 12 }, //
{ wch: 20 } //
];
worksheet['!cols'] = columnWidths;
// 簿
XLSX.utils.book_append_sheet(workbook, worksheet, '维修费用报表');
//
let fileName = '维修费用报表';
if (this.queryParams.startTime && this.queryParams.endTime) {
fileName += `_${this.queryParams.startTime}_至_${this.queryParams.endTime}`;
}
fileName += `_${new Date().toISOString().slice(0, 10)}.xlsx`;
// Excel
const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
const blob = new Blob([excelBuffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
//
const link = document.createElement('a');
const url = URL.createObjectURL(blob);
link.setAttribute('href', url);
link.setAttribute('download', fileName);
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
// URL
URL.revokeObjectURL(url);
this.$modal.msgSuccess('Excel导出成功');
} catch (error) {
console.error('导出Excel失败:', error);
this.$modal.msgError('导出Excel失败请稍后重试');
}
},
},
}

View File

@ -57,12 +57,11 @@
<el-table-column label="机具规格" align="center" prop="modelName" :show-overflow-tooltip="true" />
<el-table-column label="单位" align="center" prop="mtUnitName" width="80" />
<el-table-column label="报废数量" align="center" prop="num" width="100" />
<el-table-column label="报废费用(元)" align="center" prop="cost" width="120">
<el-table-column label="报废费用(元)" align="center" prop="costs" width="120">
<template slot-scope="scope">
{{ scope.row.cost ? scope.row.cost.toFixed(2) : '0.00' }}
{{ scope.row.costs ? scope.row.costs.toFixed(2) : '0.00' }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" min-width="50" />
</el-table>
<pagination
@ -271,95 +270,24 @@ export default {
this.$modal.msgWarning('没有可导出的数据');
return;
}
const formatTime = (date) => {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
};
try {
// Excel
const columns = [
{ key: 'index', title: '序号' },
{ key: 'agreementCode', title: '协议号' },
{ key: 'unitName', title: '结算单位' },
{ key: 'projectName', title: '结算工程' },
{ key: 'typeName', title: '机具名称' },
{ key: 'modelName', title: '机具规格' },
{ key: 'mtUnitName', title: '单位' },
{ key: 'num', title: '报废数量' },
{ key: 'cost', title: '报废费用(元)' },
{ key: 'remark', title: '备注' }
];
// Excel
const excelData = [];
//
const headerRow = columns.map(col => col.title);
excelData.push(headerRow);
//
this.tableList.forEach((row, index) => {
const dataRow = columns.map(col => {
if (col.key === 'index') {
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + index + 1;
} else if (col.key === 'cost') {
//
return row.cost ? parseFloat(row.cost.toFixed(2)) : 0.00;
} else {
return row[col.key] || '';
}
});
excelData.push(dataRow);
});
// 簿
const workbook = XLSX.utils.book_new();
const worksheet = XLSX.utils.aoa_to_sheet(excelData);
//
const columnWidths = [
{ wch: 8 }, //
{ wch: 20 }, //
{ wch: 15 }, //
{ wch: 20 }, //
{ wch: 20 }, //
{ wch: 15 }, //
{ wch: 8 }, //
{ wch: 10 }, //
{ wch: 15 }, //
{ wch: 20 } //
];
worksheet['!cols'] = columnWidths;
// 簿
XLSX.utils.book_append_sheet(workbook, worksheet, '报废费用报表');
//
let fileName = '报废费用报表';
if (this.queryParams.startTime && this.queryParams.endTime) {
fileName += `_${this.queryParams.startTime}_至_${this.queryParams.endTime}`;
}
fileName += `_${new Date().toISOString().slice(0, 10)}.xlsx`;
// Excel
const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
const blob = new Blob([excelBuffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
//
const link = document.createElement('a');
const url = URL.createObjectURL(blob);
link.setAttribute('href', url);
link.setAttribute('download', fileName);
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
// URL
URL.revokeObjectURL(url);
this.$modal.msgSuccess('Excel导出成功');
} catch (error) {
console.error('导出Excel失败:', error);
this.$modal.msgError('导出Excel失败请稍后重试');
}
const currentTime = formatTime(new Date());
this.download(
'/material/slt_agreement_info/exportScrapList',
{
...this.queryParams,
},
`报废费用报表_${currentTime}.xlsx`
)
},
},
}

View File

@ -110,9 +110,9 @@
</el-button>
</template>
</el-table-column>
<el-table-column label="合计费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
<el-table-column label="合计费用(元)" align="center" prop="totalCostAll" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.costs != null && scope.row.costs != ''">
<span v-if="scope.row.totalCostAll != null && scope.row.totalCostAll != ''">
<el-button
type="text"
@click="showCostDetail(scope.row, 'total')"
@ -940,106 +940,30 @@ export default {
},
// Excel
exportExcel() {
exportExcel(){
if (!this.tableList || this.tableList.length === 0) {
this.$modal.msgWarning('没有可导出的数据');
return;
}
const formatTime = (date) => {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
};
try {
// Excel
const columns = [
{ key: 'index', title: '序号' },
{ key: 'agreementCode', title: '协议号' },
{ key: 'unitName', title: '结算单位' },
{ key: 'projectName', title: '结算工程' },
{ key: 'settlementType', title: '结算类型' },
{ key: 'leaseCost', title: '租赁费用' },
{ key: 'repairCost', title: '维修费用' },
{ key: 'loseCost', title: '丢失费用' },
{ key: 'scrapCost', title: '报废费用' },
{ key: 'reductionCost', title: '减免费用' },
{ key: 'costs', title: '合计费用(元)' }
];
// Excel
const excelData = [];
//
const headerRow = columns.map(col => col.title);
excelData.push(headerRow);
//
this.tableList.forEach((row, index) => {
const dataRow = columns.map(col => {
if (col.key === 'index') {
return (this.queryParams.pageNum - 1) * 10 + index + 1;
} else if (col.key === 'settlementType') {
//
if (row.settlementType === 1) return '工器具';
if (row.settlementType === 2) return '安全工器具';
return '总费用';
} else if (col.key === 'costs') {
// -
return parseFloat(this.calculateTotalCost(row).toFixed(2));
} else if (col.key === 'leaseCost' || col.key === 'repairCost' || col.key === 'loseCost' || col.key === 'scrapCost' || col.key === 'reductionCost') {
//
return row[col.key] || 0;
} else {
return row[col.key] || '';
}
});
excelData.push(dataRow);
});
// 簿
const workbook = XLSX.utils.book_new();
const worksheet = XLSX.utils.aoa_to_sheet(excelData);
//
const columnWidths = [
{ wch: 8 }, //
{ wch: 20 }, //
{ wch: 15 }, //
{ wch: 20 }, //
{ wch: 12 }, //
{ wch: 12 }, //
{ wch: 12 }, //
{ wch: 12 }, //
{ wch: 12 }, //
{ wch: 12 }, //
{ wch: 15 } //
];
worksheet['!cols'] = columnWidths;
// 簿
XLSX.utils.book_append_sheet(workbook, worksheet, '未结算记录');
//
const fileName = `未结算记录_${new Date().toISOString().slice(0, 10)}.xlsx`;
// Excel
const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
const blob = new Blob([excelBuffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
//
const link = document.createElement('a');
const url = URL.createObjectURL(blob);
link.setAttribute('href', url);
link.setAttribute('download', fileName);
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
// URL
URL.revokeObjectURL(url);
this.$modal.msgSuccess('Excel导出成功');
} catch (error) {
console.error('导出Excel失败:', error);
this.$modal.msgError('导出Excel失败请稍后重试');
}
const currentTime = formatTime(new Date());
this.download(
'/material/slt_agreement_info/exportUnreported',
{
...this.queryParams,
disabled: false,
},
`未结算报表_${currentTime}.xlsx`
)
},
// Excel

View File

@ -0,0 +1,243 @@
<template>
<!-- 会签配置管理 列表页面 -->
<div class="app-container">
<el-table v-loading="loading" :data="configList" ref="multipleTable">
<el-table-column
width="80"
label="序号"
type="index"
align="center"
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
/>
<!-- 点击跳转到二级页面配置审核流程 -->
<el-table-column label="结算类型" align="center" prop="processName" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag
:type="scope.row.processName == '安全工器具' ? 'warning' : ''"
effect="plain">
{{ scope.row.processName }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="配置人员" align="center" prop="userNameStr" width="500" >
<template slot-scope="scope">
<span>{{ sortUserNames(scope.row.userNameStr) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>
人员配置
</el-button>
<!-- <el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>
删除
</el-button> -->
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
v-show="total > 0"
@pagination="getList"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
/>
<!-- 新增或修改弹窗 -->
<el-dialog :title="title" :visible.sync="showConfig" width="40%" append-to-body @close="onDialogClose">
<el-form ref="form" :model="form" label-width="120px">
<el-row :gutter="24">
<el-col :span="20">
<el-form-item label="配置人员" prop="typeName">
<el-select
v-model="form.userIds"
filterable multiple
placeholder="请选择人员"
style="width: 100%"
>
<el-option
v-for="keeper in userOptions"
:key="keeper.userId+''"
:label="keeper.nickName"
:value="keeper.userId+''"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submitForm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getCostConfigListApi,getCostConfigUserListApi, editCostConfigApi,deleteCostConfigApi, deleteConfigApi } from '@/api/countersign/countersign'
import { getKeeperIds } from '@/api/ma/typeConfigKeeper'
export default {
name: 'CostConfig',
data() {
return {
//
loading: false,
//
showSearch: true,
showConfig: false,
//
total: 0,
//
configList: [],
userOptions:[],
//
title: '',
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: undefined
},
//
form: {
id: '',
userIds: [],
itemName: '',
},
}
},
created() {
this.getList()
},
methods: {
sortUserNames(userNameStr) {
if (!userNameStr) return '';
//
return userNameStr.split(',')
.map(name => name.trim())
.filter(name => name)
.sort((a, b) => a.localeCompare(b)) //
.join(', ');
},
//
cancel() {
this.showConfig = false
},
//
handleQuery() {
this.getList()
},
//
onDialogClose() {
this.$refs.form.resetFields()
},
//
reset() {
this.form = {
typeName: '',
taskType: ''
}
this.resetForm('form')
},
//
resetQuery() {
this.resetForm('queryForm')
this.queryParams.keyWord = null
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.handleQuery()
},
//
async handleUpdate(row) {
this.form.id = row.id
this.userOptions = []
let roleIds = ''
await getKeeperIds(row.itemName).then((response) => {
roleIds = response.rows[response.rows.length - 1].itemValue
})
await getCostConfigUserListApi({userNameStr:roleIds}).then((response) => {
this.userOptions = response.rows.sort((a, b) =>
a.nickName.localeCompare(b.nickName, 'zh-CN')
)
})
if (row.itemValue) {
const userIds = row.itemValue.split(',')
// keeperIds KeeperOptions keeper
const users = userIds.map((id) =>
this.userOptions.find((user) => user.userId + '' == id)
).filter(Boolean) // keeper
// keeperName
users.sort((a, b) =>
a.nickName.localeCompare(b.nickName, 'zh-CN')
)
// keeperId
this.form.userIds = users.map((user) => user.userId + '')
} else {
this.form.userIds = [] //
}
this.title = '人员配置'
this.showConfig = true
},
//
async getList() {
this.loading = true
const res = await getCostConfigListApi()
this.configList = res.rows
this.total = res.total
this.loading = false
},
//
handleDelete(row) {
const id = row.id
this.$modal
.confirm('是否确认删除数据项?')
.then(function () {
return deleteCostConfigApi({ id })
})
.then(() => {
this.$modal.msgSuccess('删除成功')
this.getList()
})
.catch(() => {})
},
//
submitForm() {
console.log("xxxxxxxxxxxxxx",this.form)
editCostConfigApi(this.form).then(res => {
this.$modal.msgSuccess('修改成功')
this.showConfig = false
this.getList()
})
}
}
}
</script>