From 421445f9242a10ba1e424eb8060a5db2d344b121 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Thu, 5 Dec 2024 18:12:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E9=80=BB=E8=BE=91=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/http/api/rent-termination/index.ts | 7 + src/views/user/lessor/settlement/index.vue | 236 ++++++++++++++++++++- 2 files changed, 233 insertions(+), 10 deletions(-) diff --git a/src/http/api/rent-termination/index.ts b/src/http/api/rent-termination/index.ts index f9e9f75..71cd056 100644 --- a/src/http/api/rent-termination/index.ts +++ b/src/http/api/rent-termination/index.ts @@ -31,4 +31,11 @@ export const setAddLeaseRepairApi = (data: any) => { */ export const getOverhaulApi = (orderId: any) => { return get(`/material-mall/lease-repair/getById`, { orderId }) +} +/** + * @param data 结算关联改价 data 参数 + * @returns + */ +export const setChangePriceApi = (data: any) => { + return post(`/material-mall/lease-repair/changePrice`, data) } \ No newline at end of file diff --git a/src/views/user/lessor/settlement/index.vue b/src/views/user/lessor/settlement/index.vue index 832380d..6c1017a 100644 --- a/src/views/user/lessor/settlement/index.vue +++ b/src/views/user/lessor/settlement/index.vue @@ -106,6 +106,11 @@ div + + + @@ -123,9 +128,9 @@ div size="small" class="primary-lease" type="primary" - @click="onRepublish(row.orderStatus, row.orderId)" + @click="onRepublish(row.orderStatus, row.orderId, row.isChangePrice)" > - {{ row.orderStatus == 6 ? '费用详情' : '费用结算' }} + {{ row.orderStatus == 6 || row.isChangePrice == 1 ? '费用详情' : '费用结算' }} @@ -614,7 +619,42 @@ div {{ `${row.rentBeginTime}至${row.rentEndTime} ` }} - + + + + + + + @@ -630,7 +670,22 @@ div - + + + + + + + - + + + + + + + - + + + + + + + + +
+ 取消 + 确认改价 +
@@ -724,12 +876,12 @@ import PagingComponent from 'components/PagingComponent/index.vue' import TitleTip from 'components/TitleTip/index.vue' import { getRentTerminationListApi, - getOrderDetailsByIdApi, setAddLeaseRepairApi, getOverhaulApi, + setChangePriceApi, } from 'http/api/rent-termination/index' -import { ElMessage } from 'element-plus' +import { ElMessage, ElMessageBox } from 'element-plus' import { Plus } from '@element-plus/icons-vue' const uploadUrl = import.meta.env.VITE_API_URL + '/file/upload' const addOrEditDialogVisible = ref(false) @@ -754,6 +906,7 @@ const viewFileInfoList = ref([]) const fileListAll = ref([]) const overhaulDetails = ref({}) const innerVisible = ref(false) +const currentOrderId = ref('') const props2 = { multiple: true, checkStrictly: true, @@ -1025,9 +1178,12 @@ const onReset = () => { } // 重新发布 -const onRepublish = async (type: any, orderId: any) => { - type == 6 ? (dialogTitle.value = '费用详情') : (dialogTitle.value = '费用结算') +const onRepublish = async (type: any, orderId: any, isChangePrice: any) => { + type == 6 || isChangePrice == 1 + ? (dialogTitle.value = '费用详情') + : (dialogTitle.value = '费用结算') const { data: res }: any = await getOverhaulApi(orderId) + currentOrderId.value = orderId orderDetailDtoList.value = res.orderDetailDtoList repairRecordList.value = res.repairRecordList scrapRecordList.value = res.scrapRecordList @@ -1165,6 +1321,66 @@ const onViewFileImg = (row: any, index: number) => { innerVisible.value = true } +const onSubmitChangePrice = () => { + ElMessageBox.confirm(`改价只能申请一次,是否确认提交本次改价申请?`, '温馨提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'success', + }) + .then(async () => { + // 组装参数 + + const rentPriceList = orderDetailDtoList.value?.map((e: any) => { + return { + orderId: currentOrderId.value, + maId: e.maId, + changeCost: e.costs, + } + }) + const repairPriceList = repairRecordList.value?.map((e: any) => { + return { + orderId: currentOrderId.value, + maId: e.maId, + repairChangePrice: e.repairPrice, + } + }) + const scrapPriceList = scrapRecordList.value?.map((e: any) => { + return { + orderId: currentOrderId.value, + maId: e.maId, + scrapChangePrice: e.scrapPrice, + } + }) + const lossPriceList = lossRecordList.value?.map((e: any) => { + return { + orderId: currentOrderId.value, + maId: e.maId, + lossChangePrice: e.lossPrice, + } + }) + const changePriceParams = { + rentPriceList, + repairPriceList, + scrapPriceList, + lossPriceList, + } + + console.log(changePriceParams, 'changePriceParams参数') + + const res: any = await setChangePriceApi(changePriceParams) + if (res.code === 200) { + ElMessage({ + type: 'success', + message: '改价成功', + }) + + addOrEditDialogVisible.value = false + getLeaseListData() + } + }) + .catch(async () => {}) +} + onMounted(() => { getLeaseListData() })