费用推送

This commit is contained in:
hongchao 2025-09-26 16:31:19 +08:00
parent 15d7e404b2
commit 50eec81888
5 changed files with 126 additions and 42 deletions

View File

@ -182,3 +182,21 @@ export function submitPushCosts(params){
})
}
// 安全工机具租赁费用推送审核提交
export function submitPushSafetyCosts(params){
return request({
url: '/material/iws_cost_push/safetyMaterialCostPush',
method: 'post',
data: params
})
}
// 安全工机具消耗性费用推送审核提交
export function submitPushSafetyConsumeCosts(params){
return request({
url: '/material/iws_cost_push/safetyConsumeMaterialCostPush',
method: 'post',
data: params
})
}

View File

@ -60,7 +60,7 @@
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出数据</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" size="mini" :disabled="selectionList.length == 0" @click="submit"> </el-button>
<el-button type="primary" size="mini" @click="submit"> </el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -70,13 +70,15 @@
fit
highlight-current-row
show-summary
:summary-method="getSummaries"
ref="multipleTable"
row-key="id"
:summary-method="ge---tSummaries"
style="width: 100%"
:max-height="650"
@selection-change="selectionChange"
>
<!-- 多选 -->
<el-table-column type="selection" width="65" align="center" :selectable="row => row.pushStatus == 0" />
<el-table-column type="selection" width="65" align="center" :selectable="row => row.pushStatus != 1" />
<el-table-column
type="index"
width="55"
@ -155,7 +157,7 @@
<script>
import { getProjectList, getUnitList, getAgreementInfoById } from '@/api/back/index.js'
import { getConsumPushCheckList, getConsumPushCheckListCount, consumeCheckData } from '@/api/costPush/costPush'
import { getConsumPushCheckList, getConsumPushCheckListCount, submitPushSafetyConsumeCosts } from '@/api/costPush/costPush'
import TreeSelect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -164,6 +166,13 @@ export default {
data() {
return {
showSearch: true,
//
single: true,
//
multiple: true,
//
ids: [],
taskId:[],
queryParams: {
pageNum: 1,
pageSize: 10,
@ -265,9 +274,12 @@ export default {
}
},
//
selectionChange(val) {
console.log('selectionChange', val)
this.selectionList = val
selectionChange(selection) {
console.log("xxxxxxxxxxxxx",selection)
this.taskId = selection.map((item) => item.taskId).filter(id => id != null)
this.ids = selection.map((item) => item.agreementId).filter(id => id != null)
this.single = selection.length != 1
this.multiple = !selection.length
},
//
getSummaries() {
@ -360,6 +372,15 @@ export default {
}
},
submit() {
this.ids = this.ids.filter(id => id != null)
console.log("xxxxxxxxxxxxxxx",this.ids)
if (this.ids.length == 0) {
this.$message({
type: 'warning',
message: '请选择数据',
})
return;
}
//
this.$confirm('是否确认提交?', '提示', {
confirmButtonText: '确定',
@ -368,8 +389,11 @@ export default {
})
.then(() => {
try {
const cheks = JSON.stringify(this.selectionList)
consumeCheckData(cheks).then(res => {
let params = {
agreementIds: this.ids.filter(id => id != null),
taskId: this.taskId.filter(id => id!= null)[0]
}
submitPushSafetyConsumeCosts(params).then(res => {
//
this.$message({
type: 'success',

View File

@ -61,7 +61,7 @@
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出数据</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" size="mini" :disabled="selectionList.length == 0" @click="submit"> </el-button>
<el-button type="primary" size="mini" @click="submit"> </el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -71,13 +71,15 @@
fit
highlight-current-row
show-summary
ref="multipleTable"
row-key="id"
:summary-method="getSummaries"
style="width: 100%"
:max-height="650"
@selection-change="selectionChange"
>
<!-- 多选 -->
<el-table-column type="selection" width="65" align="center" :selectable="row => row.pushStatus == 0" />
<el-table-column type="selection" width="65" align="center" :selectable="row => row.pushStatus != 1" />
<el-table-column
type="index"
width="55"
@ -114,13 +116,13 @@
</el-table>
<!-- 分页 -->
<pagination
<!-- <pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
/> -->
<!-- 弹框 -->
<el-dialog title="查看" :visible.sync="dialogVisible" width="70%">
@ -176,7 +178,7 @@
<script>
import { getProjectList, getUnitList, getAgreementInfoById } from '@/api/back/index.js'
import { getCostPushCheckList, getCostPushCheckListCount, checkData,getCostPushLeaseListApi } from '@/api/costPush/costPush'
import { getCostPushCheckList, getCostPushCheckListCount, submitPushSafetyCosts,getCostPushLeaseListApi } from '@/api/costPush/costPush'
import TreeSelect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -185,6 +187,13 @@ export default {
data() {
return {
showSearch: true,
//
single: true,
//
multiple: true,
//
ids: [],
taskId:[],
queryParams: {
pageNum: 1,
pageSize: 10,
@ -318,9 +327,12 @@ export default {
}
},
//
selectionChange(val) {
console.log('selectionChange', val)
this.selectionList = val
selectionChange(selection) {
console.log("xxxxxxxxxxxxx",selection)
this.taskId = selection.map((item) => item.taskId).filter(id => id != null)
this.ids = selection.map((item) => item.agreementId).filter(id => id != null)
this.single = selection.length != 1
this.multiple = !selection.length
},
selectable(row) {
console.log('🚀 ~ selectable ~ row:', row)
@ -424,6 +436,15 @@ export default {
}
},
submit() {
this.ids = this.ids.filter(id => id != null)
console.log("xxxxxxxxxxxxxxx",this.ids)
if (this.ids.length == 0) {
this.$message({
type: 'warning',
message: '请选择数据',
})
return;
}
//
this.$confirm('是否确认提交?', '提示', {
confirmButtonText: '确定',
@ -432,13 +453,22 @@ export default {
})
.then(() => {
try {
const cheks = JSON.stringify(this.selectionList)
checkData(cheks).then(res => {
let params = {
agreementIds: this.ids.filter(id => id != null),
taskId: this.taskId.filter(id => id!= null)[0]
}
submitPushSafetyCosts(params).then(res => {
//
this.$message({
type: 'success',
message: '操作成功!'
})
//
if (this.$refs.multipleTable) {
this.$refs.multipleTable.clearSelection()
}
// ids
this.ids = []
this.getList()
})
} catch (error) {

View File

@ -508,6 +508,8 @@ export default {
//
ids: [],
taskId:[],
//
showLease: false,
dialogLeaseList: [], //
@ -580,10 +582,10 @@ export default {
}
},
//
handleSelectionChange(val) {
this.ids = val.map(item => item.agreementId);
},
// //
// handleSelectionChange(val) {
// this.ids = val.map(item => item.agreementId);
// },
/** 转换菜单数据结构 */
normalizer(node) {
@ -721,7 +723,8 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.agreementId)
this.taskId = selection.map((item) => item.taskId).filter(id => id != null)
this.ids = selection.map((item) => item.agreementId).filter(id => id != null)
this.single = selection.length != 1
this.multiple = !selection.length
},
@ -895,6 +898,8 @@ export default {
/** 提交 */
handleSubmit() {
this.ids = this.ids.filter(id => id != null)
console.log("xxxxxxxxxxxxxxx",this.ids)
if (this.ids.length == 0) {
this.$message({
type: 'warning',
@ -905,23 +910,24 @@ export default {
this.$modal
.confirm('是否确认提交?')
.then(() => {
// let params = {
// agreementIds:this.ids
// }
// console.log("xxxxxxxxxxxx",params)
// submitPushCosts(params).then((response) => {
// this.$message({
// type: 'success',
// message: '',
// })
// //
// if (this.$refs.multipleTable) {
// this.$refs.multipleTable.clearSelection()
// }
// // ids
// this.ids = []
// this.getList()
// })
let params = {
agreementIds: this.ids.filter(id => id != null),
taskId: this.taskId.filter(id => id!= null)[0]
}
console.log("xxxxxxxxxxxx",params)
submitPushCosts(params).then((response) => {
this.$message({
type: 'success',
message: '提交成功',
})
//
if (this.$refs.multipleTable) {
this.$refs.multipleTable.clearSelection()
}
// ids
this.ids = []
this.getList()
})
})
.catch(() => {})
},

View File

@ -139,7 +139,13 @@
:show-overflow-tooltip="column.showOverflowTooltip"
align="center"
:width="column.width"
></el-table-column>
>
<template slot-scope="scope">
<span :style="{ color: column.prop === 'code' && scope.row.isUpdate == 1 ? 'red' : '' }">
{{ scope.row[column.prop] }}
</span>
</template>
</el-table-column>
<!-- 操作 -->
<el-table-column label="操作" align="center" width="220">
<template slot-scope="{ row }">