订单流程

This commit is contained in:
hongchao 2025-02-25 16:46:21 +08:00
parent 61e7805e4c
commit b8b405afe6
5 changed files with 114 additions and 46 deletions

View File

@ -18,6 +18,7 @@
@click="selectScreen(v.type, val, i)"
v-for="(val, index) in v.list"
:key="index"
style="color: #333"
>
{{ val.name }}
</div>

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref } from 'vue'
import { ref,watch } from 'vue'
import { getOrderListInfoApi } from 'http/api/usercenter/seekorder'
import { getOverhaulApi } from 'http/api/rent-termination/index'
@ -11,7 +11,9 @@ const lossRecordList = ref<any>([])
const repairRecordList = ref<any>([])
const fileListAll = ref<any>([])
const viewFileInfoList = ref<any>([])
const overhaulDetails = ref<any>({})
const overhaulDetails = ref<any>({
'totalCost': 0,
})
const innerVisible = ref(false)
import moment from 'moment'
@ -27,11 +29,19 @@ const getId = () => {
const orderDetails = ref<any>({})
/** 查询列表 */
const getList = async () => {
flag.value = false
console.log(props, '详情')
const res: any = await getOrderListInfoApi({ orderId: props.orderId })
console.log(res, '详情')
orderDetails.value = res.data
if (props.orderStatus == 20){
isOrderComplete.value= 'text-decoration: line-through'
} else if(props.orderStatus == 4 && orderDetails.value.detailsList.length>0 && orderDetails.value.detailsList.some((item:any) => item.orderStatus == 20)){
isOrderComplete.value= 'text-decoration: line-through'
}
if (props.orderStatus == 20) {
isOrderComplete.value= 'text-decoration: line-through'
const { data: result }: any = await getOverhaulApi(props.orderId)
orderDetailDtoList.value = result.orderDetailDtoList
repairRecordList.value = result.repairRecordList
@ -40,6 +50,29 @@ const getList = async () => {
fileListAll.value = result.fileInfoList
overhaulDetails.value = result
}
if(props.orderStatus == 4){
orderDetails.value.detailsList.forEach((item:any) => {
if (item.orderStatus!= 20) {
// cost totalCost
overhaulDetails.value.totalCost += item.costs;
console.log("yyyyyyyyy",overhaulDetails.value.totalCost)
}
});
if(orderDetails.value.detailsList.length>0){
orderDetails.value.detailsList.forEach((itemTwo: any) => {
if (itemTwo.orderStatus == 20) {
console.log('zzzzzzzzzzzzzzzzzzz',itemTwo)
flag.value = true
let time = momentInit(itemTwo.takeOverTime).diff(itemTwo.rentOverTime, 'day')
if(time==0){
time = 1
}
// cost total
overhaulDetails.value.totalCost += itemTwo.dayLeasePrice*time;
}
});
}
}
}
onBeforeMount(() => {
@ -125,23 +158,6 @@ if (props.orderStatus == 5) {
stepList.value[2].title = '已收货'
currentActive.value = 4
}
// if (props.orderStatus == 10) {
// stepList.value[0].title = ''
// stepList.value[1].title = ''
// stepList.value[2].title = ''
// stepList.value[3].title = ''
// stepList.value[4].title = '退'
// currentActive.value = 5
// }
// if (props.orderStatus == 15) {
// stepList.value[0].title = ''
// stepList.value[1].title = ''
// stepList.value[2].title = ''
// stepList.value[3].title = ''
// stepList.value[4].title = '退'
// stepList.value[5].title = ''
// currentActive.value = 5
// }
if (props.orderStatus == 20) {
stepList.value[0].title = '已接单'
stepList.value[1].title = '已出库'
@ -164,9 +180,23 @@ const onViewFileImg = (row: any, index: number) => {
innerVisible.value = true
}
const isOrderComplete = computed(() => {
if (props.orderStatus == 20) return 'text-decoration: line-through'
})
// const isOrderComplete = (() => {
// if (props.orderStatus == 20){
// console.log('asdsadad')
// return 'text-decoration: line-through'
// } else if(props.orderStatus == 4 && orderDetails.value.detailsList.length>0 && orderDetails.value.detailsList.some((item:any) => item.orderStatus === 20)){
// console.log("222222222222222222222222222222222222")
// return 'text-decoration: line-through'
// }
// console.log("3333333333333333333",orderDetails.value.detailsList)
// })
const isOrderComplete = ref('')
const flag = ref(false)
const isOrderCompleteTwo = (goods: any) => {
if (goods.orderStatus == 20) return 'text-decoration: line-through'
}
</script>
<template>
@ -300,10 +330,10 @@ const isOrderComplete = computed(() => {
<el-row>
<el-col :span="3"> 租期 :</el-col>
<el-col :span="8">
<span style="margin-right: 10px" :style="isOrderComplete">
<span style="margin-right: 10px" :style="isOrderCompleteTwo(goods)">
{{ goods.days }}{{ ' ' + '天' }}
</span>
<span v-if="props.orderStatus == 20">
<span v-if="goods.orderStatus == 20">
{{
isNaN(momentInit(goods.takeOverTime).diff(goods.rentOverTime, 'day'))
? '-'
@ -352,16 +382,16 @@ const isOrderComplete = computed(() => {
<div>租期</div>
<div
style="font-weight: bold; margin-top: 10px"
:style="isOrderComplete"
:style="isOrderCompleteTwo(goods)"
>
{{ goods.rentBeginTime }}{{ goods.rentEndTime }}
</div>
<div
style="font-weight: bold; margin-top: 10px"
v-if="props.orderStatus == 20"
v-if="goods.orderStatus == 20"
>
{{ goods.takeOverTime?.slice(0, 10) }}{{
goods.rentOverTime?.slice(0, 10)
{{ goods.takeOverTime }}{{
goods.rentOverTime
}}
</div>
</div>
@ -371,7 +401,7 @@ const isOrderComplete = computed(() => {
<el-col :span="5" class="order-items-info" style="border: none; font-size: 13px">
<div>总费用</div>
<div class="red-font" :style="isOrderComplete">{{ orderDetails.cost }} </div>
<div class="red-font" v-if="props.orderStatus == 20">
<div class="red-font" v-if="props.orderStatus == 20 ||(props.orderStatus==4 && flag)">
{{ overhaulDetails.totalCost }}
</div>
</el-col>

View File

@ -496,14 +496,15 @@ const pickUpViewOut = (index: number) => {
};
const pickUpCodeFormRef = ref()
//
const pickUpCodeRules = ref([
const pickUpCodeRules = ref({
pickUpCode:[
{
required: true,
message: '请输入取件码',
trigger: 'blur',
},
}
],
)
})
const pickUpCodeForm = reactive<any>({
pickUpCode: '',
})
@ -671,8 +672,8 @@ const pickUpCodeForm = reactive<any>({
class="order-title-info"
>
<el-col :span="8">
<span> 出租方姓名 </span>
<span> {{ item.sellerName }} </span>
<span> 出租方联系人 </span>
<span> {{ item.person }} </span>
</el-col>
<el-col :span="8">
<span> 承租方姓名 </span>

View File

@ -11,7 +11,9 @@ const lossRecordList = ref<any>([])
const repairRecordList = ref<any>([])
const fileListAll = ref<any>([])
const viewFileInfoList = ref<any>([])
const overhaulDetails = ref<any>({})
const overhaulDetails = ref<any>({
'totalCost': 0,
})
const innerVisible = ref(false)
import moment from 'moment'
@ -27,11 +29,18 @@ const getId = () => {
const orderDetails = ref<any>({})
/** 查询列表 */
const getList = async () => {
flag.value = false
const res: any = await getOrderListInfoApi({ orderId: props.orderId })
console.log(res, '详情')
orderDetails.value = res.data
if (props.orderStatus == 20){
isOrderComplete.value= 'text-decoration: line-through'
} else if(props.orderStatus == 4 && orderDetails.value.detailsList.length>0 && orderDetails.value.detailsList.some((item:any) => item.orderStatus == 20)){
isOrderComplete.value= 'text-decoration: line-through'
}
if (props.orderStatus == 20) {
isOrderComplete.value= 'text-decoration: line-through'
const { data: result }: any = await getOverhaulApi(props.orderId)
orderDetailDtoList.value = result.orderDetailDtoList
repairRecordList.value = result.repairRecordList
@ -40,6 +49,27 @@ const getList = async () => {
fileListAll.value = result.fileInfoList
overhaulDetails.value = result
}
if(props.orderStatus == 4){
orderDetails.value.detailsList.forEach((item:any) => {
if (item.orderStatus!= 20) {
// cost totalCost
overhaulDetails.value.totalCost += item.costs;
}
});
if(orderDetails.value.detailsList.length>0){
orderDetails.value.detailsList.forEach((itemTwo: any) => {
if (itemTwo.orderStatus == 20) {
flag.value = true
let time = momentInit(itemTwo.takeOverTime).diff(itemTwo.rentOverTime, 'day')
if(time==0){
time = 1
}
// cost total
overhaulDetails.value.totalCost += itemTwo.dayLeasePrice*time;
}
});
}
}
}
onBeforeMount(() => {
@ -164,9 +194,15 @@ const onViewFileImg = (row: any, index: number) => {
innerVisible.value = true
}
const isOrderComplete = computed(() => {
if (props.orderStatus == 20) return 'text-decoration: line-through'
})
// const isOrderComplete = computed(() => {
// if (props.orderStatus == 20) return 'text-decoration: line-through'
// })
const isOrderComplete = ref('')
const flag = ref(false)
const isOrderCompleteTwo = (goods: any) => {
if (goods.orderStatus == 20) return 'text-decoration: line-through'
}
</script>
<template>
@ -300,7 +336,7 @@ const isOrderComplete = computed(() => {
<el-row>
<el-col :span="3"> 租期 :</el-col>
<el-col :span="8">
<span style="margin-right: 10px" :style="isOrderComplete">
<span style="margin-right: 10px" :style="isOrderCompleteTwo(goods)">
{{ goods.days }}{{ ' ' + '天' }}
</span>
<span v-if="props.orderStatus == 20">
@ -352,16 +388,16 @@ const isOrderComplete = computed(() => {
<div>租期</div>
<div
style="font-weight: bold; margin-top: 10px"
:style="isOrderComplete"
:style="isOrderCompleteTwo(goods)"
>
{{ goods.rentBeginTime }}{{ goods.rentEndTime }}
</div>
<div
style="font-weight: bold; margin-top: 10px"
v-if="props.orderStatus == 20"
v-if="goods.orderStatus == 20"
>
{{ goods.takeOverTime?.slice(0, 10) }}{{
goods.rentOverTime?.slice(0, 10)
{{ goods.takeOverTime }}{{
goods.rentOverTime
}}
</div>
</div>
@ -371,7 +407,7 @@ const isOrderComplete = computed(() => {
<el-col :span="5" class="order-items-info" style="border: none; font-size: 13px">
<div>总费用</div>
<div class="red-font" :style="isOrderComplete">{{ orderDetails.cost }} </div>
<div class="red-font" v-if="props.orderStatus == 20">
<div class="red-font" v-if="props.orderStatus == 20 ||(props.orderStatus==4 && flag)">
{{ overhaulDetails.totalCost }}
</div>
</el-col>

View File

@ -911,8 +911,8 @@ const pickUpView = async(item: any) => {
class="order-title-info"
>
<el-col :span="8">
<span> 出租方姓名 </span>
<span> {{ item.sellerName }} </span>
<span> 出租方联系人 </span>
<span> {{ item.person }} </span>
</el-col>
<el-col :span="8">
<span> 承租方姓名 </span>