feat: 工单支持修改上门时间

This commit is contained in:
gcd 2025-05-08 20:52:23 +08:00
parent 371808abf1
commit f78bfbc4c9
3 changed files with 22 additions and 8 deletions

View File

@ -121,6 +121,12 @@ class Api {
let url = `${config.host}/worker/common/config`; let url = `${config.host}/worker/common/config`;
return fetch.request('GET', url, {}, false) return fetch.request('GET', url, {}, false)
} }
// 修改上门时间
static updatePlanTime(data) {
let url = `${config.host}/worker/order_dispatch/updatePlanTime`;
return fetch.request('postFrom', url, data, true)
}
} }
export default Api export default Api

View File

@ -50,7 +50,7 @@
<view class="item-row flex-sb line-after"> <view class="item-row flex-sb line-after">
<view class="title flex-l">预约上门时间</view> <view class="title flex-l">预约上门时间</view>
<view class="value flex-r value-theme" v-if="data.status === enums.ORDER_DISPATCH_STATUS.STATUS_PLANIT"> <view class="value flex-r value-theme" v-if="data.status === enums.ORDER_DISPATCH_STATUS.STATUS_PLANIT">
<uni-datetime-picker type="datetime" :hide-second="true" @change="changePlanTime"> <uni-datetime-picker type="datetime" :start="Date.now()" :hide-second="true" @change="changePlanTime">
<view class="flex-r"> <view class="flex-r">
<text>{{data.plan_time}}</text> <text>{{data.plan_time}}</text>
<me-icon class="icon" type="icon-edit-line" color="var(--themeColor)" size="40rpx"></me-icon> <me-icon class="icon" type="icon-edit-line" color="var(--themeColor)" size="40rpx"></me-icon>
@ -203,14 +203,22 @@ const canReportOrderException = computed(() => {
return data.value.status !== enums.ORDER_DISPATCH_STATUS.STATUS_TOGET && data.value.status !== enums.ORDER_DISPATCH_STATUS.STATUS_REFUSED return data.value.status !== enums.ORDER_DISPATCH_STATUS.STATUS_TOGET && data.value.status !== enums.ORDER_DISPATCH_STATUS.STATUS_REFUSED
}) })
const changePlanTime = (e) => { const changePlanTime = (time) => {
//TODO
console.log(e)
uni.showModal({ uni.showModal({
title: '提示信息', title: '提示信息',
showCancel: false, content: '修改前需和客户约定,确定修改上门时间?',
content: '修改前需和客户约定,确定修改上门时间?' success: function (res) {
if (res.confirm) {
api.updatePlanTime({order_dispatch_id: id.value, plan_time: time}).then(() => {
helpers.delayHideLoading()
uni.showToast({
title: '修改成功',
icon: "success"
})
data.value.plan_time = time + ':00'
}).catch(() => {})
}
}
}); });
} }

View File

@ -8,7 +8,7 @@
<view class="item time"> <view class="item time">
<view class="item-row flex-sb"> <view class="item-row flex-sb">
<view class="title flex-l">上门时间</view> <view class="title flex-l">上门时间</view>
<uni-datetime-picker v-model="data.plan_time" type="datetime" :hide-second="true"> <uni-datetime-picker v-model="data.plan_time" :start="Date.now()" type="datetime" :hide-second="true">
<view class="value flex-r value-empty" v-if="data.plan_time === null">点击选择上门时间</view> <view class="value flex-r value-empty" v-if="data.plan_time === null">点击选择上门时间</view>
<view class="value flex-r" v-else>{{ helpers.removeSeconds(data.plan_time) }}</view> <view class="value flex-r" v-else>{{ helpers.removeSeconds(data.plan_time) }}</view>
</uni-datetime-picker> </uni-datetime-picker>