结算页面导出接口调试完成

This commit is contained in:
BianLzhaoMin 2024-07-30 16:21:06 +08:00
parent a591d01bb3
commit b1b184b23f
4 changed files with 150 additions and 25 deletions

View File

@ -67,6 +67,12 @@ export const getComSellQueryApi = (params) => {
export const editSaveApi = (params) => { export const editSaveApi = (params) => {
return request.post('/material/sltAgreementInfo/updateTrimDay', 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" align="center"
width="80" width="80"
type="index" type="index"
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)" :index="
indexContinuation(queryParams.pageNum, queryParams.pageSize)
"
> >
<!-- <template slot-scope="scope"> <!-- <template slot-scope="scope">
<span>{{ <span>{{
@ -400,7 +402,9 @@
align="center" align="center"
width="80" width="80"
type="index" type="index"
:index="indexContinuation(outQuery.pageNum, outQuery.pageSize)" :index="
indexContinuation(outQuery.pageNum, outQuery.pageSize)
"
> >
<!-- <template slot-scope="scope"> <!-- <template slot-scope="scope">
<span>{{ <span>{{
@ -842,7 +846,7 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.downloadJson( this.downloadJson(
'base/tm_task/export', '/material/tm_task/export',
JSON.stringify(this.queryParams), JSON.stringify(this.queryParams),
`领料出库_${new Date().getTime()}.xlsx`, `领料出库_${new Date().getTime()}.xlsx`,
) )

View File

@ -18,6 +18,10 @@
:constBear="1" :constBear="1"
:totalPrice="settleTotalPrice_01" :totalPrice="settleTotalPrice_01"
:tableData="settleTableData_01" :tableData="settleTableData_01"
:isSettle="isSettle_01"
:listType="1"
@submitSell="submitSell"
@handleExport="handleExport"
@handelSaveSuccess="handelSaveSuccess" @handelSaveSuccess="handelSaveSuccess"
v-if="settleTableData_01.length > 0" v-if="settleTableData_01.length > 0"
/> />
@ -29,6 +33,10 @@
:constBear="3" :constBear="3"
:totalPrice="settleTotalPrice_03" :totalPrice="settleTotalPrice_03"
:tableData="settleTableData_03" :tableData="settleTableData_03"
:isSettle="isSettle_03"
:listType="2"
@submitSell="submitSell"
@handleExport="handleExport"
@handelSaveSuccess="handelSaveSuccess" @handelSaveSuccess="handelSaveSuccess"
v-if="settleTableData_03.length > 0" v-if="settleTableData_03.length > 0"
/> />
@ -38,23 +46,31 @@
:isRepair="true" :isRepair="true"
:totalPrice="repairTotalPrice" :totalPrice="repairTotalPrice"
:tableData="repairTableData" :tableData="repairTableData"
:listType="3"
@handleExport="handleExport"
/> />
<FinishTable <FinishTable
:tableColumns="noReturnTableColumns" :tableColumns="noReturnTableColumns"
:tableTitle="`工机具未还赔偿清单`" :tableTitle="`工机具未还赔偿清单`"
:tableData="noReturnTableData" :tableData="noReturnTableData"
:totalPrice="noReturnTotalPrice" :totalPrice="noReturnTotalPrice"
:listType="4"
@handleExport="handleExport"
/> />
<FinishTable <FinishTable
:tableColumns="scrapTableColumns" :tableColumns="scrapTableColumns"
:tableTitle="`工机具报废赔偿清单`" :tableTitle="`工机具报废赔偿清单`"
:tableData="scrapTableData" :tableData="scrapTableData"
:totalPrice="scrapTotalPrice" :totalPrice="scrapTotalPrice"
:listType="5"
@handleExport="handleExport"
/> />
<FinishTable <FinishTable
:tableColumns="stayScrapTableColumns" :tableColumns="stayScrapTableColumns"
:tableTitle="`工机具待报废清单`" :tableTitle="`工机具待报废清单`"
:tableData="stayScrapTableData" :tableData="stayScrapTableData"
:listType="6"
@handleExport="handleExport"
/> />
<el-row class="submit-btn"> <el-row class="submit-btn">
@ -68,7 +84,7 @@
<script> <script>
import PageHeader from '@/components/pageHeader' import PageHeader from '@/components/pageHeader'
import FinishTable from './finishTable.vue' import FinishTable from './finishTable.vue'
import { getComSellQueryApi } from '@/api/cost/cost.js' import { getComSellQueryApi, submitFeeBearApi } from '@/api/cost/cost.js'
export default { export default {
components: { components: {
PageHeader, PageHeader,
@ -166,6 +182,9 @@ export default {
repairTotalPrice: 0, repairTotalPrice: 0,
noReturnTotalPrice: 0, noReturnTotalPrice: 0,
scrapTotalPrice: 0, scrapTotalPrice: 0,
//
isSettle_01: 0,
isSettle_03: 0,
} }
}, },
created() { created() {
@ -189,8 +208,23 @@ export default {
// this.settleTotalPrice_01 = res.relations[0].leaseCostOne // this.settleTotalPrice_01 = res.relations[0].leaseCostOne
// this.settleTotalPrice_01 = res.relations[0].leaseCostOne // this.settleTotalPrice_01 = res.relations[0].leaseCostOne
this.noReturnTotalPrice = res.relations[0].loseCost this.noReturnTotalPrice = res.relations[0].loseCost
this.isSettle_01 = res.relations[0].isSltOne
this.isSettle_03 = res.relations[0].isSltThree
console.log(res, '结算信息') 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() { submitComSett() {
this.$confirm( this.$confirm(
@ -205,9 +239,45 @@ export default {
console.log('确定,后续走确定逻辑') console.log('确定,后续走确定逻辑')
}) })
}, },
//
handelSaveSuccess() { handelSaveSuccess() {
this.getComSellList() 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() { goBack() {
this.$emit('closeCurrPage') this.$emit('closeCurrPage')
@ -230,7 +300,7 @@ export default {
& div:nth-child(3) { & div:nth-child(3) {
margin-right: 15px; margin-right: 15px;
color: red; color: rgb(255, 0, 0);
} }
} }

View File

@ -25,27 +25,31 @@
</el-col> </el-col>
<el-col :span="14" class="title">{{ tableTitle }}</el-col> <el-col :span="14" class="title">{{ tableTitle }}</el-col>
<el-col :span="5" class="btn-item"> <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
> >
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
v-if="isCostBear || isRepair" v-if="isSettle == 0 && (isCostBear || isRepair)"
@click="handleEdit" @click="handleEdit"
>{{ isEdit ? '取消编辑' : '编辑' }}</el-button >{{ isEdit ? '取消编辑' : '编辑' }}</el-button
> >
<el-button <el-button
size="mini" size="mini"
type="success" type="success"
v-if="!isEdit && isCostBear" v-if="!isEdit && isCostBear && isSettle == 0"
@click="submitSell" @click="submitSell"
>确认结算</el-button >确认结算</el-button
> >
<el-button <el-button
size="mini" size="mini"
type="success" type="success"
v-if="isEdit && isCostBear" v-if="isEdit && isCostBear && isSettle == 0"
@click="handleSave" @click="handleSave"
>保存</el-button >保存</el-button
> >
@ -82,11 +86,24 @@
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
v-if="t.t_slot === 't_date'" v-if="t.t_slot === 't_date'"
value-format="yyyy-M-d" value-format="yyyy-MM-dd"
:ref="`editTime_${scope.$index}`" :ref="`editTime_${scope.$index}`"
:class="{ :class="{
active: activeIndexTime === scope.$index, 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" style="width: 150px"
/> />
</template> </template>
@ -113,7 +130,7 @@ export default {
type: String, type: String,
default: () => '', default: () => '',
}, },
// //
isCostBear: { isCostBear: {
type: Boolean, type: Boolean,
default: () => false, default: () => false,
@ -138,8 +155,17 @@ export default {
type: [Number, String], type: [Number, String],
default: () => -1, default: () => -1,
}, },
// 0 1
isSettle: {
type: [Number, String],
default: () => 0,
},
// 1.01 2.03 3. 4. 5. 6.
listType: {
type: Number,
default: () => 0,
},
}, },
data() { data() {
return { return {
isEdit: false, // isEdit: false, //
@ -163,6 +189,7 @@ export default {
const isNum = regex.test(val) const isNum = regex.test(val)
if (!isNum) { if (!isNum) {
this.$message.error('请输入正整数和负整数或0') this.$message.error('请输入正整数和负整数或0')
return
} }
this.tableData.map((e) => { this.tableData.map((e) => {
@ -176,8 +203,7 @@ export default {
try { try {
// 1. // 1.
this.tableData.map((e, v) => { this.tableData.map((e, v) => {
console.log(e.endTime, '选择的时间') this.$message.closeAll()
if (!e.endTime) { if (!e.endTime) {
this.$message.error('请选择终结日期!') this.$message.error('请选择终结日期!')
this.activeIndexTime = v this.activeIndexTime = v
@ -204,6 +230,7 @@ export default {
typeId: e.typeId, // id typeId: e.typeId, // id
trimDay: e.trimDay, // trimDay: e.trimDay, //
maId: e.maId || '', maId: e.maId || '',
endTime: e.endTime, //
} }
saveParams.push(item) saveParams.push(item)
@ -224,17 +251,35 @@ export default {
}, },
/** 单个列表确认结算 */ /** 单个列表确认结算 */
submitSell() { submitSell() {
this.$confirm( let isFlag = false
'确定后则会生成财务报表,数据将不可修改,请确认检查无误', this.$message.closeAll()
'提示', try {
{ // 1.
confirmButtonText: '确定', this.tableData.map((e, v) => {
cancelButtonText: '取消', if (!e.endTime) {
type: 'warning', this.$message.error('终结日期不能为空!')
}, isFlag = true
).then(() => { throw new Error()
console.log('确定,后续走确定逻辑') }
}) })
if (isFlag) return
// 2.
this.$confirm(
'确定后则会生成财务报表,数据将不可修改,请确认检查无误',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
},
).then(() => {
this.$emit('submitSell', `0${this.constBear}`)
})
} catch {}
},
/** 导出按钮 */
handleExport() {
this.$emit('handleExport', this.listType)
}, },
}, },
} }