bug修复

This commit is contained in:
hongchao 2025-02-21 17:31:52 +08:00
parent 0de1cfbe91
commit 69655e9455
3 changed files with 206 additions and 17 deletions

View File

@ -9,13 +9,13 @@
</view>
</view>
<view class="demand-header">
<view>
<!-- <view>
<SearchIpt
v-model:activeTypeName="activeTypeName"
v-model:searchModelValue="searchModelValue"
@onSearchByType="onSearchByType"
/>
</view>
</view> -->
<navigator class="demand-release" url="/pages/demand-release/index">
<view>

View File

@ -59,6 +59,14 @@
</van-row>
</view>
</view>
<van-steps :active="currentActive" active-color="#07c160">
<van-step v-for="(item, index) in stepList" :key="index" :title="item.title" :desc="item.description" />
<!-- <van-step :title="getStepTitle(1)" :desc="getDescription(1)" />
<van-step :title="getStepTitle(2)" :desc="getDescription(2)" />
<van-step :title="getStepTitle(3)" :desc="getDescription(3)" />
<van-step :title="getStepTitle(4)" />
<van-step :title="getStepTitle(5)" /> -->
</van-steps>
<van-cell-group inset>
<TitleTip :title="`订单信息`" />
<van-cell title="订单编号:" :value="orderDetails.code" />
@ -81,7 +89,7 @@ import companyBg from '@/static/goods/company-bg.png'
import TitleTip from '@/components/TitleTip/index'
import { ref } from 'vue'
import { editOrderDetailsAPI, getOverhaulAPI } from '@/services/order/index.js'
import { showImagePreview } from 'vant'
import { showImagePreview, } from 'vant'
import { onLoad } from '@dcloudio/uni-app'
const orderDetailsList = ref([])
const orderDetails = ref({})
@ -90,6 +98,31 @@ const repairRecordList = ref([])
const scrapRecordList = ref([])
const lossRecordList = ref([])
const fileListAll = ref([])
const stepList = ref([
{
title: '待接单',
description: '',
},
{
title: '待出库',
description: '',
},
{
title: '待收货',
description: '',
},
{
title: '租赁中',
description: '',
},
{
title: '订单完成',
description: '',
},
])
// active
const currentActive = ref(0)
const onClickLeft = () => {
// uni.reLaunch({
// url: '/pages/order-list/index',
@ -154,14 +187,146 @@ const getOverhaulData = async (orderId) => {
const onPreviewFile = (fileList) => {
showImagePreview([fileList[0].fileUrl])
}
const orderStatusTemp = ref(0)
const titleStaus = ref('')
//
const operationDetails = ref({
1: { title: '已出库', preOutboundUser: '', preOutboundTime: '' },
2: { title: '已收货', takeOverUser: '', takeOverTime: '' },
3: { title: '租赁结束', rentOverUser: '', rentOverTime: '' },
})
// Id
const getStepTitle = (stepId) => {
if (orderStatusTemp.value === 2) {
titleStaus.value = '待出库'
return stepId === 1 ? '待出库' : ''
} else if (orderStatusTemp.value === 3) {
titleStaus.value = '待收货'
return stepId === 1 ? '已出库' : stepId === 2 ? '待收货' : ''
} else if (orderStatusTemp.value === 4) {
titleStaus.value = '租赁中'
return stepId === 1 ? '已出库' : stepId === 2 ? '已收货' : stepId === 3 ? '租赁中' : ''
} else if (orderStatusTemp.value === 5) {
titleStaus.value = '已退租'
return stepId === 1
? '已出库'
: stepId === 2
? '已收货'
: stepId === 3
? '租赁结束'
: stepId === 4
? '已退租'
: ''
} else if (orderStatusTemp.value === 6) {
titleStaus.value = '已完成'
return stepId === 1
? '已出库'
: stepId === 2
? '已收货'
: stepId === 3
? '租赁结束'
: stepId === 4
? '已退租'
: stepId === 5
? '已完成'
: ''
} else if (orderStatusTemp.value === 7) {
titleStaus.value = '已驳回'
return stepId === 1 ? '已驳回' : ''
}
titleStaus.value = ''
return '' //
}
const orderStatus = ref(0)
// Id
const getDescription = (desId) => {
const operation = operationDetails.value[desId]
if (operation.title == '已出库' && titleStaus.value != '待出库') {
return `
操作人${operation.preOutboundUser == null ? ' ' : operation.preOutboundUser}
操作时间${operation.preOutboundTime == null ? ' ' : operation.preOutboundTime}
`
} else if (
operation.title == '已收货' &&
titleStaus.value != '待收货' &&
titleStaus.value != '待出库'
) {
return `
操作人${operation.takeOverUser == null ? ' ' : operation.takeOverUser}
操作时间${operation.takeOverTime == null ? ' ' : operation.takeOverTime}
`
} else if (
operation.title == '租赁结束' &&
titleStaus.value != '待收货' &&
titleStaus.value != '待出库' &&
titleStaus.value != '租赁中'
) {
return `
操作人${operation.rentOverUser == null ? ' ' : operation.rentOverUser}
操作时间${operation.rentOverTime == null ? ' ' : operation.rentOverTime}
`
}
return '' //
}
// const route = useRoute()
// const getId = () => {
// orderStatusTemp.value = Number(route.query.orderStatusTemp)
// idTemp.value = String(route.query.idTemp)
// }
onLoad(async (options) => {
const { data: res } = await editOrderDetailsAPI({ orderId: options?.orderId })
orderStatus.value = options?.orderStatus
if (orderStatus.value == 1) {
currentActive.value = 0
}
if (orderStatus.value == 2) {
currentActive.value = 1
stepList.value[0].title = '已接单'
}
if (orderStatus.value == 3) {
stepList.value[0].title = '已接单'
stepList.value[1].title = '已出库'
currentActive.value = 2
}
if (orderStatus.value == 4) {
stepList.value[0].title = '已接单'
stepList.value[1].title = '已出库'
stepList.value[2].title = '已收货'
currentActive.value = 3
}
if (orderStatus.value == 5) {
stepList.value[0].title = '已接单'
stepList.value[1].title = '已出库'
stepList.value[2].title = '已收货'
currentActive.value = 4
}
if (orderStatus.value == 20) {
stepList.value[0].title = '已接单'
stepList.value[1].title = '已出库'
stepList.value[2].title = '已收货'
stepList.value[3].title = '租赁结束'
currentActive.value = 5
}
if (orderStatus.value == 99) {
currentActive.value = 6
stepList.value[6].title = '订单取消'
}
console.log('xxxxxxxxxxx',stepList.value)
orderDetails.value = res
orderDetailsList.value = res.detailsList
if (res.orderStatus == 20) {
getOverhaulData(options?.orderId)
}
})
// onBeforeMount(() => {
// getId()
// })
</script>
<style lang="scss" scoped>

View File

@ -1,9 +1,9 @@
<template>
<!-- 订单详情-->
<view class="h5-container order-details">
<view class="nav-title" style="padding: 15px">
<view style="padding: 15px">
<van-icon name="arrow-left" @click="onClickLeft" />
<text class="nav-title-text">{{ orderQueryParams.flag ? '出租订单' : '承租订单' }}</text>
<text class="nav-title-text">{{ orderQueryParams.flag ? '出租订单' : '承租订单' }}</text>
</view>
<van-tabs
@ -16,7 +16,14 @@
<van-tab v-for="(t, i) in tabList" :title="t.tab_name"> </van-tab>
</van-tabs>
<scroll-view scroll-y style="padding: 10px; box-sizing: border-box">
<van-search
v-model="orderQueryParams.keyWord"
placeholder="请输入搜索内容"
@search="onSearch"
style="margin-bottom: 10px"
/>
<view
class="order-set"
v-for="item in orderList"
@ -24,14 +31,20 @@
@click="onJumpOrderDetails(item)"
>
<van-row>
<van-col span="12">
<van-col span="14">
<view class="company-box">
<van-image width="1.5rem" height="1.2rem" :src="companyImg" />
<view class="company-name">
<view> 安徽送变电公司 </view>
<view style="display: flex; align-items: center;">
<view style="display: inline;white-space: nowrap">订单编号{{ item.code }}</view>
</view>
<van-image fit="cover" height="0.5rem" :src="companyBg" />
</view>
</view>
<view style="display: inline;white-space: nowrap">出租方{{ item.czcompanyName }}</view>
<view style="display: inline;white-space: nowrap">承租方{{ item.companyName }}</view>
</van-col>
<van-col span="10" class="contacts">
<van-tag :type="orderType(item.orderStatus)">
@ -154,7 +167,7 @@
{{ initLesseeBtnText(item.orderStatus) }}
</van-button>
<!-- <van-button
<van-button
style="margin-right: 6px"
size="small"
type="primary"
@ -213,7 +226,7 @@
@click.stop="onViewCosts(item)"
>
费用清单
</van-button> -->
</van-button>
<van-button
style="margin-right: 6px"
size="small"
@ -245,8 +258,6 @@
</view>
</van-row>
</view>
<van-empty description="暂无数据" v-if="orderList.length === 0" />
</scroll-view>
<van-popup v-model:show="showBottom" position="bottom" :style="{ height: '60%' }">
@ -564,6 +575,7 @@ const orderQueryParams = ref({
flag: true,
orderStatus: '',
code: '',
keyWord: '',
})
const submitParams = ref({
@ -597,11 +609,23 @@ const orderType = (status) => {
const tabList = ref([
{ tab_name: '全部', order_status: 0 },
{ tab_name: '租赁中', order_status: 4 },
{ tab_name: '已退租', order_status: 5 },
{ tab_name: '已完成', order_status: 20 },
{ tab_name: '已取消', order_status: 99 },
{ tab_name: '待出库', order_status: 2 },
{ tab_name: '待收货', order_status: 3 },
{ tab_name: '租赁中', order_status: 4 },
])
const searchValue = ref('')
const onSearch = () => {
//
getOrderListData()
console.log('搜索内容:', searchValue.value)
// searchValue orderList
}
//
const onClickLeft = () => {
@ -753,7 +777,7 @@ const onEditOrderStatus = (item, status) => {
tipText = '确认收货'
break
case 4:
editParams.orderStatus = 20
editParams.orderStatus = 5
tipText = '申请全部退租'
break
}
@ -780,7 +804,7 @@ const onReturnGoods = (items, goods) => {
})
.then(async () => {
const res = await editOrderStatusAPI({
orderStatus: 20,
orderStatus: 5,
orderId: items.orderId,
maIds: [goods.maId],
})
@ -939,7 +963,7 @@ const onSubmitRepairResult = () => {
}
const onJumpOrderDetails = (item) => {
uni.navigateTo({ url: `/pages/order-details/index?orderId=${item.orderId}` })
uni.navigateTo({ url: `/pages/order-details/index?orderId=${item.orderId}&orderStatus=${item.orderStatus}` })
}
const onTapsChange = (val) => {
@ -993,7 +1017,7 @@ onShow(() => {
align-items: center;
width: 100%;
.company-name {
width: 100%;
width: 80%;
display: flex;
flex-direction: column;
@ -1001,7 +1025,7 @@ onShow(() => {
padding-left: 6px;
font-size: 16px;
font-weight: bold;
margin-bottom: -6px;
width:100%
}
.van-image {