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

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) => {
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,6 +18,10 @@
: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"
/>
@ -29,6 +33,10 @@
: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"
/>
@ -38,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">
@ -68,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,
@ -166,6 +182,9 @@ export default {
repairTotalPrice: 0,
noReturnTotalPrice: 0,
scrapTotalPrice: 0,
//
isSettle_01: 0,
isSettle_03: 0,
}
},
created() {
@ -189,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(
@ -205,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')
@ -230,7 +300,7 @@ export default {
& div:nth-child(3) {
margin-right: 15px;
color: red;
color: rgb(255, 0, 0);
}
}

View File

@ -25,27 +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
>
@ -82,11 +86,24 @@
type="date"
placeholder="选择日期"
v-if="t.t_slot === 't_date'"
value-format="yyyy-M-d"
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>
@ -113,7 +130,7 @@ export default {
type: String,
default: () => '',
},
//
//
isCostBear: {
type: Boolean,
default: () => false,
@ -138,8 +155,17 @@ 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, //
@ -163,6 +189,7 @@ export default {
const isNum = regex.test(val)
if (!isNum) {
this.$message.error('请输入正整数和负整数或0')
return
}
this.tableData.map((e) => {
@ -176,8 +203,7 @@ export default {
try {
// 1.
this.tableData.map((e, v) => {
console.log(e.endTime, '选择的时间')
this.$message.closeAll()
if (!e.endTime) {
this.$message.error('请选择终结日期!')
this.activeIndexTime = v
@ -204,6 +230,7 @@ export default {
typeId: e.typeId, // id
trimDay: e.trimDay, //
maId: e.maId || '',
endTime: e.endTime, //
}
saveParams.push(item)
@ -224,17 +251,35 @@ export default {
},
/** 单个列表确认结算 */
submitSell() {
this.$confirm(
'确定后则会生成财务报表,数据将不可修改,请确认检查无误',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
},
).then(() => {
console.log('确定,后续走确定逻辑')
})
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)
},
},
}