完工结算接口调试完成

This commit is contained in:
BianLzhaoMin 2024-07-29 18:25:49 +08:00
parent c30d7aa355
commit a5635d173a
3 changed files with 206 additions and 42 deletions

View File

@ -7,11 +7,11 @@ export function getSltAgreementInfo(query) {
method: 'get',
params: query
})
}
}
// 查询费用结算申请详情
export function getSltInfo(params){
export function getSltInfo(params) {
return request({
url: '/material/sltAgreementInfo/getSltInfo',
method: 'post',
@ -20,7 +20,7 @@ export function getSltInfo(params){
}
// 费用结算申请提交
export function submitFee(params){
export function submitFee(params) {
return request({
url: '/material/sltAgreementInfo/submitFee',
method: 'post',
@ -55,6 +55,18 @@ export function settlementReview(query) {
params: query
})
}
/**
* 7.29
*/
/** 完工结算查询 */
export const getComSellQueryApi = (params) => {
return request.post('/material/sltAgreementInfo/getSltInfo', params)
}
/** 编辑后保存接口 */
export const editSaveApi = (params) => {
return request.post('/material/sltAgreementInfo/updateTrimDay', params)
}

View File

@ -15,29 +15,44 @@
:tableColumns="settleTableColumns"
:tableTitle="`设备结算清单`"
:isCostBear="true"
:constBear="1"
:totalPrice="settleTotalPrice_01"
:tableData="settleTableData_01"
@handelSaveSuccess="handelSaveSuccess"
/>
<!-- 03承担方 -->
<FinishTable
:tableColumns="settleTableColumns"
:tableTitle="`设备结算清单`"
:isCostBear="true"
:constBear="3"
:totalPrice="settleTotalPrice_03"
:tableData="settleTableData_03"
@handelSaveSuccess="handelSaveSuccess"
/>
<FinishTable
:tableColumns="repairTableColumns"
:tableTitle="`设备维修清单`"
:isRepair="true"
:totalPrice="repairTotalPrice"
:tableData="repairTableData"
/>
<FinishTable
:tableColumns="noReturnTableColumns"
:tableTitle="`工机具未还赔偿清单`"
:tableData="noReturnTableData"
:totalPrice="noReturnTotalPrice"
/>
<FinishTable
:tableColumns="scrapTableColumns"
:tableTitle="`工机具报废赔偿清单`"
:tableData="scrapTableData"
:totalPrice="scrapTotalPrice"
/>
<FinishTable
:tableColumns="stayScrapTableColumns"
:tableTitle="`工机具待报废清单`"
:tableData="stayScrapTableData"
/>
<el-row class="submit-btn">
@ -51,6 +66,7 @@
<script>
import PageHeader from '@/components/pageHeader'
import FinishTable from './finishTable.vue'
import { getComSellQueryApi } from '@/api/cost/cost.js'
export default {
components: {
PageHeader,
@ -72,18 +88,18 @@ export default {
return {
//
settleTableColumns: [
{ t_prop: '', t_label: '设备名称' },
{ t_prop: '', t_label: '规格型号' },
{ t_prop: '', t_label: '单位' },
{ t_prop: '', t_label: '数量' },
{ t_prop: '', t_label: '台班费单价(元/天)' },
{ t_prop: '', t_label: '起租日期' },
{ t_prop: 'date', t_label: '终止日期', t_slot: 't_date' },
{ t_prop: '', t_label: '应结算天数' },
{ t_prop: '', t_label: '应结算金额(元)' },
{ t_prop: 'day', t_label: '调整天数', t_slot: 't_ipt' },
{ t_prop: '', t_label: '实际结算天数' },
{ t_prop: '', t_label: '实际结算金额(元)' },
{ t_prop: 'typeName', t_label: '设备名称' },
{ t_prop: 'modelName', t_label: '规格型号' },
{ t_prop: 'nuitName', t_label: '单位' },
{ t_prop: 'num', t_label: '数量' },
{ t_prop: 'leasePrice', t_label: '台班费单价(元/天)' },
{ t_prop: 'startTime', t_label: '起租日期' },
{ t_prop: 'endTime', t_label: '终止日期', t_slot: 't_date' },
{ t_prop: 'leaseDays', t_label: '应结算天数' },
{ t_prop: 'costs', t_label: '应结算金额(元)' },
{ t_prop: 'trimDay', t_label: '调整天数', t_slot: 't_ipt' },
{ t_prop: 'realDays', t_label: '实际结算天数' },
{ t_prop: 'realCosts', t_label: '实际结算金额(元)' },
{ t_prop: '', t_label: '已入账金额(元)' },
{ t_prop: '', t_label: '本次结算金额(元)' },
],
@ -100,15 +116,17 @@ export default {
{ t_prop: '', t_label: '委外维修费用' },
{ t_prop: '', t_label: '费用总价' },
],
//
noReturnTableColumns: [
{ t_prop: '', t_label: '设备名称' },
{ t_prop: '', t_label: '规格型号' },
{ t_prop: 'unit', t_label: '单位' },
{ t_prop: '', t_label: '设备编码' },
{ t_prop: 'date', t_label: '未还数量' },
{ t_prop: '', t_label: '赔偿单价' },
{ t_prop: '', t_label: '赔偿金额' },
{ t_prop: 'typeName', t_label: '设备名称' },
{ t_prop: 'modelName', t_label: '规格型号' },
{ t_prop: 'nuitName', t_label: '单位' },
{ t_prop: 'maCode', t_label: '设备编码' },
{ t_prop: 'num', t_label: '未还数量' },
{ t_prop: 'buyPrice', t_label: '赔偿单价' },
{ t_prop: 'costs', t_label: '赔偿金额' },
],
//
scrapTableColumns: [
{ t_prop: '', t_label: '设备名称' },
{ t_prop: 'type', t_label: '规格型号' },
@ -118,6 +136,7 @@ export default {
{ t_prop: '', t_label: '赔偿单价' },
{ t_prop: '', t_label: '赔偿金额' },
],
//
stayScrapTableColumns: [
{ t_prop: '', t_label: '设备名称' },
{ t_prop: 'type', t_label: '规格型号' },
@ -126,12 +145,49 @@ export default {
{ t_prop: 'date', t_label: '报废数量' },
{ t_prop: '', t_label: '状态' },
],
// 01
settleTableData_01: [],
// 03
settleTableData_03: [],
//
repairTableData: [],
//
noReturnTableData: [],
//
scrapTableData: [],
//
stayScrapTableData: [],
//
settleTotalPrice_01: 0,
settleTotalPrice_03: 0,
repairTotalPrice: 0,
noReturnTotalPrice: 0,
scrapTotalPrice: 0,
}
},
created() {
this.getComSellList()
},
methods: {
//
goBack() {
this.$emit('closeCurrPage')
/** 获取结算信息 */
async getComSellList() {
const { data: res } = await getComSellQueryApi([
{ agreementId: this.currRowInfo.agreementId },
])
this.settleTableData_01 = res.leaseListOne // 01
this.settleTableData_03 = res.leaseListThree // 03
this.repairTableData = res.repairList //
this.noReturnTableData = res.loseList //
this.scrapTableData = res.scrapList //
this.settleTotalPrice_01 = res.relations[0].leaseCostOne
this.settleTotalPrice_03 = res.relations[0].leaseCostThree
// this.settleTotalPrice_01 = res.relations[0].leaseCostOne
// this.settleTotalPrice_01 = res.relations[0].leaseCostOne
this.noReturnTotalPrice = res.relations[0].loseCost
console.log(res, '结算信息')
},
/** 确认完工结算 */
submitComSett() {
@ -147,6 +203,13 @@ export default {
console.log('确定,后续走确定逻辑')
})
},
handelSaveSuccess() {
this.getComSellList()
},
/** 返回按钮 关闭当前页面 */
goBack() {
this.$emit('closeCurrPage')
},
},
}
</script>

View File

@ -3,14 +3,24 @@
<div style="margin-top: 60px">
<el-row class="table-title" type="flex">
<div class="batch-system-day" v-if="isCostBear && isEdit">
调整天数批量设置 <el-input style="width: 120px" />
调整天数批量设置
<el-input
v-model="batchNum"
type="number"
clearable
style="width: 120px"
@change="iptChange"
/>
</div>
<span class="repair-tip" v-if="isRepair"
>勾选需要赔偿的维修项目</span
>
<el-col :span="5" class="cost-bear">
<span>{{ isCostBear ? '费用承担方03' : '' }}</span>
<span>合计xxxxx元</span>
<span v-if="isCostBear">{{
constBear === 1 ? '费用承担方01' : '费用承担方03'
}}</span>
<span v-else />
<span v-if="totalPrice !== -1">合计{{ totalPrice }}</span>
</el-col>
<el-col :span="14" class="title">{{ tableTitle }}</el-col>
<el-col :span="5" class="btn-item">
@ -34,6 +44,7 @@
size="mini"
type="success"
v-if="isEdit && isCostBear"
@click="handleSave"
>保存</el-button
>
</el-col>
@ -47,21 +58,29 @@
:key="index"
:label="t.t_label"
:width="t.t_slot === 't_date' ? '180' : ''"
show-overflow-tooltip
>
<template slot-scope="{ row }">
<template v-if="t.t_slot && isEdit">
<el-input
v-if="t.t_slot === 't_ipt'"
v-model="row[t.t_prop]"
v-model.number="row[t.t_prop]"
style="width: 80px"
type="number"
/>
<template v-if="t.t_slot === 't_date'">
<el-date-picker
v-model="row[t.t_prop]"
type="date"
placeholder="选择日期"
v-if="t.t_slot === 't_date'"
v-if="!row[t.t_prop]"
style="width: 150px"
/>
<template v-else>
{{ row[t.t_prop] }}
</template>
</template>
</template>
<template v-else>
{{ row[t.t_prop] }}
@ -73,6 +92,7 @@
</template>
<script>
import { editSaveApi } from '@/api/cost/cost.js'
export default {
props: {
//
@ -95,11 +115,28 @@ export default {
type: Boolean,
default: () => false,
},
//
tableData: {
type: Array,
default: () => [],
},
// 01 03
constBear: {
type: Number,
default: () => 1,
},
//
totalPrice: {
type: [Number, String],
default: () => -1,
},
},
data() {
return {
isEdit: false,
tableData: [{ date: '2020-12-12', day: 2 }],
batchNum: 0,
// tableDataList: [],
}
},
methods: {
@ -107,6 +144,58 @@ export default {
handleEdit() {
this.isEdit = !this.isEdit
},
/** 调整天数 */
iptChange(val) {
const regex = /^-?\d+$/
const isNum = regex.test(val)
if (!isNum) {
this.$message.error('请输入正整数和负整数或0')
}
this.tableData.map((e) => {
e.trimDay = val
})
},
/** 保存按钮 */
async handleSave() {
const regex = /^-?\d+$/
let isNum = false
try {
this.tableData.map((e) => {
if (!regex.test(e.trimDay)) {
isNum = true
throw new Error()
}
})
} catch {}
if (isNum) {
this.$message.error('请输入正整数和负整数或0')
return
}
let saveParams = []
this.tableData.map((e) => {
const item = {
agreementId: e.agreementId,
typeId: e.typeId,
trimDay: e.trimDay,
maId: e.maId || '',
}
saveParams.push(item)
})
console.log(saveParams, '保存时的参数---')
const res = await editSaveApi(saveParams)
if (res.code == 200) {
this.$message.success('保存成功!')
this.isEdit = false
this.$emit('handelSaveSuccess')
}
},
},
}
</script>