feat(工单列表): add 修改价格和远程锁车
This commit is contained in:
parent
b8f814dd84
commit
951528dada
@ -8,3 +8,21 @@ import { http } from '@/http/http'
|
|||||||
export function getOrderManageListApi(query: { pageNum: number, pageSize: number }) {
|
export function getOrderManageListApi(query: { pageNum: number, pageSize: number }) {
|
||||||
return http.get<any>('/operations/statistics/getDiffOperatorOrderList', query)
|
return http.get<any>('/operations/statistics/getDiffOperatorOrderList', query)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 根据车辆编号修改当前订单金额
|
||||||
|
* @param data
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function changePriceApi(data: { bikeCode: string, price: number }) {
|
||||||
|
return http.post<any>('/operations/statistics/updateOrderAmount', data)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 结束用户骑行订单
|
||||||
|
* @param data
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function lockBikeApi(data: { bikeCode: string }) {
|
||||||
|
return http.post<any>('/operations/statistics/closeOrder', data)
|
||||||
|
}
|
||||||
|
|||||||
168
src/pages-sub/order-manage/change-price.vue
Normal file
168
src/pages-sub/order-manage/change-price.vue
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
<template>
|
||||||
|
<z-paging>
|
||||||
|
<template #top>
|
||||||
|
<view class="custom_navbar" :style="{ height: `${systemInfo.statusBarHeight + 44}px` }">
|
||||||
|
<view class="back_bar">
|
||||||
|
<uv-icon name="arrow-left" color="white" size="24" @click="handleBack" />
|
||||||
|
<text class="text">工单管理-修改价格</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<view class="container">
|
||||||
|
<view class="map_container">
|
||||||
|
<map-exhibition
|
||||||
|
:map-location="{
|
||||||
|
latitude: routeQuery.startLocation?.latitude,
|
||||||
|
longitude: routeQuery.startLocation?.longitude,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<uni-card>
|
||||||
|
<uv-form ref="form" label-position="left" :model="formData" :rules="rules" :label-width="90" :label-style="labelStyle">
|
||||||
|
<uv-form-item label="车辆编号:" border-bottom>
|
||||||
|
{{ routeQuery.bikeCode }}
|
||||||
|
</uv-form-item>
|
||||||
|
<uv-form-item label="订单编号:" border-bottom>
|
||||||
|
{{ routeQuery.orderId }}
|
||||||
|
</uv-form-item>
|
||||||
|
<uv-form-item label="实付金额:" border-bottom>
|
||||||
|
{{ routeQuery.actualAmount }}元
|
||||||
|
</uv-form-item>
|
||||||
|
<uv-form-item label="修改金额:" prop="price" border-bottom>
|
||||||
|
<uv-input
|
||||||
|
v-model="formData.price"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入修改金额"
|
||||||
|
/>
|
||||||
|
</uv-form-item>
|
||||||
|
</uv-form>
|
||||||
|
</uni-card>
|
||||||
|
</view>
|
||||||
|
<template #bottom>
|
||||||
|
<view class="bottom-button-zaping">
|
||||||
|
<uv-button
|
||||||
|
type="primary"
|
||||||
|
:text="btnConfig.btnText"
|
||||||
|
:loading="btnConfig.btnLoading"
|
||||||
|
:loading-text="btnConfig.btnLoadingText"
|
||||||
|
:custom-style="{
|
||||||
|
backgroundImage: `linear-gradient(135deg, #1089FF 0%, #0F5BFF 100%)`,
|
||||||
|
borderRadius: '28rpx',
|
||||||
|
height: '100rpx',
|
||||||
|
}"
|
||||||
|
:custom-text-style="{
|
||||||
|
fontSize: '32rpx',
|
||||||
|
marginLeft: '8rpx',
|
||||||
|
}"
|
||||||
|
@click="submitForm"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</z-paging>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
|
import { changePriceApi } from '@/api/order-manage'
|
||||||
|
import MapExhibition from '@/components/mapExhibition/mapExhibition.vue'
|
||||||
|
import { systemInfo } from '@/utils/systemInfo'
|
||||||
|
|
||||||
|
definePage({
|
||||||
|
style: {
|
||||||
|
navigationStyle: 'custom',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// 返回
|
||||||
|
function handleBack() {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
const formData = reactive({
|
||||||
|
bikeCode: '',
|
||||||
|
price: null,
|
||||||
|
})
|
||||||
|
const rules = {
|
||||||
|
price: {
|
||||||
|
type: 'number',
|
||||||
|
required: true,
|
||||||
|
message: '请输入修改金额',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const labelStyle = {
|
||||||
|
padding: '0 5px 0 0',
|
||||||
|
color: '#7c7c7c',
|
||||||
|
fontSize: '14px',
|
||||||
|
fontWeight: 'normal',
|
||||||
|
lineHeight: '32px',
|
||||||
|
}
|
||||||
|
|
||||||
|
const btnConfig = reactive({
|
||||||
|
btnText: '提交',
|
||||||
|
btnLoading: false,
|
||||||
|
btnLoadingText: '正在提交',
|
||||||
|
})
|
||||||
|
|
||||||
|
const routeQuery = ref<any>({})
|
||||||
|
onLoad((options) => {
|
||||||
|
const data = JSON.parse(decodeURIComponent(options.data))
|
||||||
|
routeQuery.value = data
|
||||||
|
formData.bikeCode = data.bikeCode
|
||||||
|
})
|
||||||
|
|
||||||
|
const form = ref<any>(null)
|
||||||
|
async function submitForm() {
|
||||||
|
await form.value.validate()
|
||||||
|
try {
|
||||||
|
await changePriceApi(formData)
|
||||||
|
uni.showToast({
|
||||||
|
title: '提交成功',
|
||||||
|
icon: 'success',
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1500)
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
uni.showToast({
|
||||||
|
title: e.message || '提交失败',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
btnConfig.btnLoading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.custom_navbar {
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
background-color: #0f74ff;
|
||||||
|
|
||||||
|
.back_bar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 25rpx;
|
||||||
|
left: 30rpx;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
font-family: SourceHanSansCN-Medium;
|
||||||
|
font-size: 34rpx;
|
||||||
|
color: white;
|
||||||
|
letter-spacing: 0;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
.map_container {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 40vh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -15,12 +15,16 @@ function handleBack() {
|
|||||||
const paging = ref<any>(null)
|
const paging = ref<any>(null)
|
||||||
|
|
||||||
const orderList = ref([])
|
const orderList = ref([])
|
||||||
|
const query = ref({
|
||||||
|
bikeCode: '',
|
||||||
|
})
|
||||||
async function queryOrderList(pageNum: number, pageSize: number) {
|
async function queryOrderList(pageNum: number, pageSize: number) {
|
||||||
try {
|
try {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中',
|
title: '加载中',
|
||||||
})
|
})
|
||||||
const { records } = await getOrderManageListApi({
|
const { records } = await getOrderManageListApi({
|
||||||
|
...query.value,
|
||||||
pageNum,
|
pageNum,
|
||||||
pageSize,
|
pageSize,
|
||||||
})
|
})
|
||||||
@ -33,11 +37,29 @@ async function queryOrderList(pageNum: number, pageSize: number) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleSearch() {
|
||||||
|
paging.value.reload()
|
||||||
|
}
|
||||||
|
|
||||||
const operatorStore = useOperatorStore()
|
const operatorStore = useOperatorStore()
|
||||||
const operatorAllList = ref<any>([])
|
const operatorAllList = ref<any>([])
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
operatorAllList.value = await operatorStore.getOperatorList()
|
operatorAllList.value = await operatorStore.getOperatorList()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function changePrice(row) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages-sub/order-manage/change-price?data=${encodeURIComponent(JSON.stringify(row))}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function lockBike(row) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages-sub/order-manage/remove-locking?data=${encodeURIComponent(JSON.stringify(row))}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onShow(() => {
|
||||||
|
handleSearch()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -57,6 +79,15 @@ onMounted(async () => {
|
|||||||
<text class="text">工单管理</text>
|
<text class="text">工单管理</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="search_bar">
|
||||||
|
<uv-search
|
||||||
|
v-model="query.bikeCode"
|
||||||
|
:show-action="false"
|
||||||
|
bg-color="white"
|
||||||
|
placeholder="请输入车辆编号"
|
||||||
|
@search="handleSearch"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="list-panel">
|
<view class="list-panel">
|
||||||
@ -65,12 +96,12 @@ onMounted(async () => {
|
|||||||
:key="item.orderId"
|
:key="item.orderId"
|
||||||
>
|
>
|
||||||
<view class="card">
|
<view class="card">
|
||||||
<view class="body">
|
<view class="header">
|
||||||
<view class="row">
|
<view class="title">
|
||||||
<view class="text">
|
<view>{{ item.bikeCode }}</view>
|
||||||
<view>车辆编号:{{ item.bikeCode }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="body">
|
||||||
<view class="row">
|
<view class="row">
|
||||||
<view class="text">
|
<view class="text">
|
||||||
<view>订单编号:{{ item.orderId }}</view>
|
<view>订单编号:{{ item.orderId }}</view>
|
||||||
@ -101,6 +132,7 @@ onMounted(async () => {
|
|||||||
marginLeft: '8rpx',
|
marginLeft: '8rpx',
|
||||||
}"
|
}"
|
||||||
text="修改价格"
|
text="修改价格"
|
||||||
|
@click="changePrice(item)"
|
||||||
/>
|
/>
|
||||||
<uv-button
|
<uv-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -115,6 +147,7 @@ onMounted(async () => {
|
|||||||
marginLeft: '8rpx',
|
marginLeft: '8rpx',
|
||||||
}"
|
}"
|
||||||
text="远程锁车"
|
text="远程锁车"
|
||||||
|
@click="lockBike(item)"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -156,6 +189,17 @@ onMounted(async () => {
|
|||||||
border-radius: 26rpx;
|
border-radius: 26rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.04);
|
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.04);
|
||||||
|
& .header {
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
.title {
|
||||||
|
font-family: PingFangSC-Semibold;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #333333;
|
||||||
|
letter-spacing: 0;
|
||||||
|
font-weight: 600;
|
||||||
|
margin: 0 25rpx 0 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
& .body {
|
& .body {
|
||||||
& .row {
|
& .row {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -192,4 +236,12 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.search_bar {
|
||||||
|
width: calc(100% - 40rpx);
|
||||||
|
padding: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
background-color: #0f73ff;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
147
src/pages-sub/order-manage/remove-locking.vue
Normal file
147
src/pages-sub/order-manage/remove-locking.vue
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
<template>
|
||||||
|
<z-paging>
|
||||||
|
<template #top>
|
||||||
|
<view class="custom_navbar" :style="{ height: `${systemInfo.statusBarHeight + 44}px` }">
|
||||||
|
<view class="back_bar">
|
||||||
|
<uv-icon name="arrow-left" color="white" size="24" @click="handleBack" />
|
||||||
|
<text class="text">工单管理-远程锁车</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<view class="container">
|
||||||
|
<view class="map_container">
|
||||||
|
<map-exhibition
|
||||||
|
:map-location="{
|
||||||
|
latitude: routeQuery.startLocation?.latitude,
|
||||||
|
longitude: routeQuery.startLocation?.longitude,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<uni-card>
|
||||||
|
<uv-form ref="form" label-position="left" :label-width="90" :label-style="labelStyle">
|
||||||
|
<uv-form-item label="车辆编号:" border-bottom>
|
||||||
|
{{ routeQuery.bikeCode }}
|
||||||
|
</uv-form-item>
|
||||||
|
<uv-form-item label="订单编号:" border-bottom>
|
||||||
|
{{ routeQuery.orderId }}
|
||||||
|
</uv-form-item>
|
||||||
|
</uv-form>
|
||||||
|
</uni-card>
|
||||||
|
</view>
|
||||||
|
<template #bottom>
|
||||||
|
<view class="bottom-button-zaping">
|
||||||
|
<uv-button
|
||||||
|
type="primary"
|
||||||
|
:text="btnConfig.btnText"
|
||||||
|
:loading="btnConfig.btnLoading"
|
||||||
|
:loading-text="btnConfig.btnLoadingText"
|
||||||
|
:custom-style="{
|
||||||
|
backgroundImage: `linear-gradient(135deg, #1089FF 0%, #0F5BFF 100%)`,
|
||||||
|
borderRadius: '28rpx',
|
||||||
|
height: '100rpx',
|
||||||
|
}"
|
||||||
|
:custom-text-style="{
|
||||||
|
fontSize: '32rpx',
|
||||||
|
marginLeft: '8rpx',
|
||||||
|
}"
|
||||||
|
@click="submitForm"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</z-paging>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
|
import { lockBikeApi } from '@/api/order-manage'
|
||||||
|
import MapExhibition from '@/components/mapExhibition/mapExhibition.vue'
|
||||||
|
import { systemInfo } from '@/utils/systemInfo'
|
||||||
|
|
||||||
|
definePage({
|
||||||
|
style: {
|
||||||
|
navigationStyle: 'custom',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
// 返回
|
||||||
|
function handleBack() {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
|
||||||
|
const labelStyle = {
|
||||||
|
padding: '0 5px 0 0',
|
||||||
|
color: '#7c7c7c',
|
||||||
|
fontSize: '14px',
|
||||||
|
fontWeight: 'normal',
|
||||||
|
lineHeight: '32px',
|
||||||
|
}
|
||||||
|
|
||||||
|
const btnConfig = reactive({
|
||||||
|
btnText: '确认锁车',
|
||||||
|
btnLoading: false,
|
||||||
|
btnLoadingText: '正在锁车中...',
|
||||||
|
})
|
||||||
|
|
||||||
|
const routeQuery = ref<any>({})
|
||||||
|
onLoad((options) => {
|
||||||
|
const data = JSON.parse(decodeURIComponent(options.data))
|
||||||
|
routeQuery.value = data
|
||||||
|
})
|
||||||
|
|
||||||
|
const form = ref<any>(null)
|
||||||
|
async function submitForm() {
|
||||||
|
await form.value.validate()
|
||||||
|
try {
|
||||||
|
await lockBikeApi({
|
||||||
|
bikeCode: routeQuery.value.bikeCode,
|
||||||
|
})
|
||||||
|
uni.showToast({
|
||||||
|
title: '提交成功',
|
||||||
|
icon: 'success',
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1500)
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
uni.showToast({
|
||||||
|
title: e.message || '提交失败',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
btnConfig.btnLoading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.custom_navbar {
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
background-color: #0f74ff;
|
||||||
|
|
||||||
|
.back_bar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 25rpx;
|
||||||
|
left: 30rpx;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
font-family: SourceHanSansCN-Medium;
|
||||||
|
font-size: 34rpx;
|
||||||
|
color: white;
|
||||||
|
letter-spacing: 0;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
.map_container {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 60vh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
x
Reference in New Issue
Block a user