From f78bfbc4c90b48ef812a06c41acb53cd644ae767 Mon Sep 17 00:00:00 2001 From: gcd Date: Thu, 8 May 2025 20:52:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B7=A5=E5=8D=95=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E9=97=A8=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api.js | 6 ++++++ pages/order/order-info.vue | 22 +++++++++++++++------- pages/order/select-time.vue | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/api/api.js b/api/api.js index 99f1105..1c5f354 100644 --- a/api/api.js +++ b/api/api.js @@ -121,6 +121,12 @@ class Api { let url = `${config.host}/worker/common/config`; 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 diff --git a/pages/order/order-info.vue b/pages/order/order-info.vue index b05d639..1c9f2ac 100644 --- a/pages/order/order-info.vue +++ b/pages/order/order-info.vue @@ -50,7 +50,7 @@ 预约上门时间 - + {{data.plan_time}} @@ -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 }) -const changePlanTime = (e) => { - //TODO 修改上门时间 - console.log(e) - +const changePlanTime = (time) => { uni.showModal({ 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(() => {}) + } + } }); } diff --git a/pages/order/select-time.vue b/pages/order/select-time.vue index 551db2a..cae3586 100644 --- a/pages/order/select-time.vue +++ b/pages/order/select-time.vue @@ -8,7 +8,7 @@ 上门时间 - + 点击选择上门时间 {{ helpers.removeSeconds(data.plan_time) }}