Compare commits

...

3 Commits

Author SHA1 Message Date
BianLzhaoMin ea13b5f59e Merge branch 'dev-cq' of http://192.168.0.56:3000/bonus/devicesmgt into dev-cq 2024-07-30 16:21:10 +08:00
BianLzhaoMin b1b184b23f 结算页面导出接口调试完成 2024-07-30 16:21:06 +08:00
BianLzhaoMin a591d01bb3 优化结算页面 2024-07-30 11:07:51 +08:00
4 changed files with 228 additions and 56 deletions

View File

@ -67,6 +67,12 @@ export const getComSellQueryApi = (params) => {
export const editSaveApi = (params) => {
return request.post('/material/sltAgreementInfo/updateTrimDay', params)
}
/** 确认结算接口 01和03费用承担方单独结算接口*/
export const submitFeeBearApi = (params) => {
return request.post('/material/sltAgreementInfo/submitFeeBear', params)
}

View File

@ -104,7 +104,9 @@
align="center"
width="80"
type="index"
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
:index="
indexContinuation(queryParams.pageNum, queryParams.pageSize)
"
>
<!-- <template slot-scope="scope">
<span>{{
@ -400,7 +402,9 @@
align="center"
width="80"
type="index"
:index="indexContinuation(outQuery.pageNum, outQuery.pageSize)"
:index="
indexContinuation(outQuery.pageNum, outQuery.pageSize)
"
>
<!-- <template slot-scope="scope">
<span>{{
@ -842,7 +846,7 @@ export default {
/** 导出按钮操作 */
handleExport() {
this.downloadJson(
'base/tm_task/export',
'/material/tm_task/export',
JSON.stringify(this.queryParams),
`领料出库_${new Date().getTime()}.xlsx`,
)

View File

@ -18,7 +18,12 @@
:constBear="1"
:totalPrice="settleTotalPrice_01"
:tableData="settleTableData_01"
:isSettle="isSettle_01"
:listType="1"
@submitSell="submitSell"
@handleExport="handleExport"
@handelSaveSuccess="handelSaveSuccess"
v-if="settleTableData_01.length > 0"
/>
<!-- 03承担方 -->
<FinishTable
@ -28,7 +33,12 @@
:constBear="3"
:totalPrice="settleTotalPrice_03"
:tableData="settleTableData_03"
:isSettle="isSettle_03"
:listType="2"
@submitSell="submitSell"
@handleExport="handleExport"
@handelSaveSuccess="handelSaveSuccess"
v-if="settleTableData_03.length > 0"
/>
<FinishTable
:tableColumns="repairTableColumns"
@ -36,23 +46,31 @@
:isRepair="true"
:totalPrice="repairTotalPrice"
:tableData="repairTableData"
:listType="3"
@handleExport="handleExport"
/>
<FinishTable
:tableColumns="noReturnTableColumns"
:tableTitle="`工机具未还赔偿清单`"
:tableData="noReturnTableData"
:totalPrice="noReturnTotalPrice"
:listType="4"
@handleExport="handleExport"
/>
<FinishTable
:tableColumns="scrapTableColumns"
:tableTitle="`工机具报废赔偿清单`"
:tableData="scrapTableData"
:totalPrice="scrapTotalPrice"
:listType="5"
@handleExport="handleExport"
/>
<FinishTable
:tableColumns="stayScrapTableColumns"
:tableTitle="`工机具待报废清单`"
:tableData="stayScrapTableData"
:listType="6"
@handleExport="handleExport"
/>
<el-row class="submit-btn">
@ -66,7 +84,7 @@
<script>
import PageHeader from '@/components/pageHeader'
import FinishTable from './finishTable.vue'
import { getComSellQueryApi } from '@/api/cost/cost.js'
import { getComSellQueryApi, submitFeeBearApi } from '@/api/cost/cost.js'
export default {
components: {
PageHeader,
@ -164,6 +182,9 @@ export default {
repairTotalPrice: 0,
noReturnTotalPrice: 0,
scrapTotalPrice: 0,
//
isSettle_01: 0,
isSettle_03: 0,
}
},
created() {
@ -187,8 +208,23 @@ export default {
// this.settleTotalPrice_01 = res.relations[0].leaseCostOne
// this.settleTotalPrice_01 = res.relations[0].leaseCostOne
this.noReturnTotalPrice = res.relations[0].loseCost
this.isSettle_01 = res.relations[0].isSltOne
this.isSettle_03 = res.relations[0].isSltThree
console.log(res, '结算信息')
},
/** 确认结算 01或03 */
async submitSell(type) {
const sellParams = {
agreementId: this.currRowInfo.agreementId,
costBearingParty: type,
}
const res = await submitFeeBearApi(sellParams)
if (res.code == 200) {
this.$message.success('结算成功!')
this.getComSellList()
}
},
/** 确认完工结算 */
submitComSett() {
this.$confirm(
@ -203,9 +239,45 @@ export default {
console.log('确定,后续走确定逻辑')
})
},
//
handelSaveSuccess() {
this.getComSellList()
},
/** 单个导出 */
handleExport(type) {
let exportUrl = 'material/sltAgreementInfo/'
let exportTitle = ''
switch (type) {
case 1:
exportUrl += 'exportLeaseOne'
exportTitle = '设备结算清单(费用承担方01)'
break
case 2:
exportUrl += 'exportLeaseThree'
exportTitle = '设备结算清单(费用承担方03)'
break
case 3:
exportTitle = '设备维修清单'
break
case 4:
exportUrl += 'exportLose'
exportTitle = '工机具未还赔偿清单'
break
case 5:
exportTitle = '工机具报废赔偿清单'
break
case 6:
exportTitle = '工机具待报废清单'
break
}
this.downloadJson(
exportUrl,
JSON.stringify([{ agreementId: this.currRowInfo.agreementId }]),
`${exportTitle}-${new Date().getTime()}.xlsx`,
)
},
/** 返回按钮 关闭当前页面 */
goBack() {
this.$emit('closeCurrPage')
@ -228,7 +300,7 @@ export default {
& div:nth-child(3) {
margin-right: 15px;
color: red;
color: rgb(255, 0, 0);
}
}

View File

@ -6,6 +6,7 @@
调整天数批量设置
<el-input
v-model="batchNum"
ref="batchNumRef"
type="number"
clearable
style="width: 120px"
@ -24,26 +25,31 @@
</el-col>
<el-col :span="14" class="title">{{ tableTitle }}</el-col>
<el-col :span="5" class="btn-item">
<el-button size="mini" type="warning" v-if="!isEdit"
<el-button
size="mini"
type="warning"
v-if="!isEdit"
@click="handleExport"
>导出</el-button
>
<el-button
size="mini"
type="primary"
v-if="isCostBear || isRepair"
v-if="isSettle == 0 && (isCostBear || isRepair)"
@click="handleEdit"
>{{ isEdit ? '取消编辑' : '编辑' }}</el-button
>
<el-button
size="mini"
type="success"
v-if="!isEdit && isCostBear"
v-if="!isEdit && isCostBear && isSettle == 0"
@click="submitSell"
>确认结算</el-button
>
<el-button
size="mini"
type="success"
v-if="isEdit && isCostBear"
v-if="isEdit && isCostBear && isSettle == 0"
@click="handleSave"
>保存</el-button
>
@ -60,30 +66,49 @@
:width="t.t_slot === 't_date' ? '180' : ''"
show-overflow-tooltip
>
<template slot-scope="{ row }">
<template slot-scope="scope">
<template v-if="t.t_slot && isEdit">
<!-- 调整天数时的输入框 -->
<el-input
v-if="t.t_slot === 't_ipt'"
v-model.number="row[t.t_prop]"
v-model.number="scope.row[t.t_prop]"
style="width: 80px"
type="number"
:ref="`editIpt_${scope.$index}`"
:class="{
active: activeIndex === scope.$index,
}"
/>
<template v-if="t.t_slot === 't_date'">
<el-date-picker
v-model="row[t.t_prop]"
type="date"
placeholder="选择日期"
v-if="!row[t.t_prop]"
style="width: 150px"
/>
<template v-else>
{{ row[t.t_prop] }}
</template>
</template>
<!-- 调整终结日期的日期选择组件 -->
<el-date-picker
v-model="scope.row[t.t_prop]"
type="date"
placeholder="选择日期"
v-if="t.t_slot === 't_date'"
value-format="yyyy-MM-dd"
:ref="`editTime_${scope.$index}`"
:class="{
active: activeIndexTime === scope.$index,
}"
:picker-options="{
disabledDate: (time) => {
const currentDate = new Date(
scope.row.startTime || new Date(),
)
currentDate.setDate(
currentDate.getDate() - 1,
)
return (
time.getTime() < currentDate.getTime()
)
},
}"
style="width: 150px"
/>
</template>
<template v-else>
{{ row[t.t_prop] }}
{{ scope.row[t.t_prop] }}
</template>
</template>
</el-table-column>
@ -105,7 +130,7 @@ export default {
type: String,
default: () => '',
},
//
//
isCostBear: {
type: Boolean,
default: () => false,
@ -130,19 +155,33 @@ export default {
type: [Number, String],
default: () => -1,
},
// 0 1
isSettle: {
type: [Number, String],
default: () => 0,
},
// 1.01 2.03 3. 4. 5. 6.
listType: {
type: Number,
default: () => 0,
},
},
data() {
return {
isEdit: false,
batchNum: 0,
// tableDataList: [],
isEdit: false, //
batchNum: '', //
activeIndex: '', // index class
activeIndexTime: '', // index class
}
},
methods: {
//
/** 编辑按钮 */
handleEdit() {
this.isEdit = !this.isEdit
if (!this.isEdit) {
this.batchNum = ''
this.$emit('handelSaveSuccess')
}
},
/** 调整天数 */
iptChange(val) {
@ -150,6 +189,7 @@ export default {
const isNum = regex.test(val)
if (!isNum) {
this.$message.error('请输入正整数和负整数或0')
return
}
this.tableData.map((e) => {
@ -161,40 +201,85 @@ export default {
const regex = /^-?\d+$/
let isNum = false
try {
this.tableData.map((e) => {
// 1.
this.tableData.map((e, v) => {
this.$message.closeAll()
if (!e.endTime) {
this.$message.error('请选择终结日期!')
this.activeIndexTime = v
this.$refs[`editTime_${v}`][0].focus()
isNum = true
throw new Error()
}
if (!regex.test(e.trimDay)) {
this.$message.error('请输入正整数和负整数或0')
this.activeIndex = v
this.$refs[`editIpt_${v}`][0].focus()
isNum = true
throw new Error()
}
})
} catch {}
if (isNum) {
this.$message.error('请输入正整数和负整数或0')
return
}
if (isNum) return
let saveParams = []
this.tableData.map((e) => {
const item = {
agreementId: e.agreementId,
typeId: e.typeId,
trimDay: e.trimDay,
maId: e.maId || '',
// 2.
let saveParams = []
this.tableData.map((e) => {
const item = {
agreementId: e.agreementId, // id
typeId: e.typeId, // id
trimDay: e.trimDay, //
maId: e.maId || '',
endTime: e.endTime, //
}
saveParams.push(item)
})
// 3.
const res = await editSaveApi(saveParams)
if (res.code == 200) {
this.$message.success('保存成功!')
this.activeIndex = ''
this.activeIndexTime = ''
this.batchNum = ''
this.isEdit = false
this.$emit('handelSaveSuccess')
}
saveParams.push(item)
})
console.log(saveParams, '保存时的参数---')
const res = await editSaveApi(saveParams)
if (res.code == 200) {
this.$message.success('保存成功!')
this.isEdit = false
this.$emit('handelSaveSuccess')
}
} catch {}
},
/** 单个列表确认结算 */
submitSell() {
let isFlag = false
this.$message.closeAll()
try {
// 1.
this.tableData.map((e, v) => {
if (!e.endTime) {
this.$message.error('终结日期不能为空!')
isFlag = true
throw new Error()
}
})
if (isFlag) return
// 2.
this.$confirm(
'确定后则会生成财务报表,数据将不可修改,请确认检查无误',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
},
).then(() => {
this.$emit('submitSell', `0${this.constBear}`)
})
} catch {}
},
/** 导出按钮 */
handleExport() {
this.$emit('handleExport', this.listType)
},
},
}
@ -254,4 +339,9 @@ export default {
line-height: 36px;
}
}
::v-deep .active {
.el-input__inner:focus {
border-color: #f56c6c;
}
}
</style>