feat: 师傅备注

This commit is contained in:
gcd 2025-04-20 23:46:43 +08:00
parent 4bb1fcc37c
commit 51c192017b
8 changed files with 134 additions and 4 deletions

View File

@ -103,6 +103,12 @@ class Api {
let url = `${config.host}/worker/order_abnormal/create`;
return fetch.request('postFrom', url, data, true)
}
// 保存师傅备注
static saveWorkerRemark(data) {
let url = `${config.host}/worker/order_dispatch/saveWorkerRemark`;
return fetch.request('postFrom', url, data, true)
}
}
export default Api

View File

@ -66,6 +66,13 @@
{
"navigationBarTitleText" : "上报异常"
}
},
{
"path" : "pages/order/worker-remark",
"style" :
{
"navigationBarTitleText" : "工单备注"
}
}
],
"globalStyle": {

View File

@ -55,6 +55,16 @@
</view>
</view>
<view class="info" v-if="data.status !== enums.ORDER_DISPATCH_STATUS.STATUS_TOGET">
<view class="item-multi-line">
<view class="title flex-l title-class">我的备注 <text v-if="data.worker_remark" class="description flex-l">仅自己可见点击备注可修改</text></view>
<view @click="updateWorkerRemark()">
<view class="value flex-l placeholder-class" v-if="data.worker_remark === ''">您可在此处输入备注信息该备注信息仅自己可见</view>
<view class="value flex-l" v-else>{{ data.worker_remark }}</view>
</view>
</view>
</view>
<!-- 已拒接-->
<view class="info" v-if="data.status === enums.ORDER_DISPATCH_STATUS.STATUS_REFUSED">
<view class="item-multi-line">
@ -170,6 +180,11 @@ const openLocation = () => {
});
}
//
const updateWorkerRemark = () => {
helpers.jumpToPage('worker-remark', `id=${id.value}&worker_remark=${data.value.worker_remark}`)
}
//
const reportOrderException = (orderId) => {
helpers.jumpToPage('report-order-exception', `order_id=${orderId}`)
@ -350,6 +365,13 @@ const previewImage = (url) => {
height: 80rpx;
font-size: 30rpx;
color: var(--summaryColor);
.description {
margin-left: 8rpx;
height: 80rpx;
font-size: 30rpx;
color: var(--descriptionColor);
font-weight: 400;
}
}
.value {
width: 100%;

View File

@ -20,8 +20,8 @@
<view class="textarea">
<view class="title flex-l">异常说明</view>
<view class="value">
<textarea v-if="orderInfo.length === 0" :disable-default-padding="true" class="input-textarea" v-model="submitData.detail" placeholder-class="placeholder-class" placeholder="请输入异常说明200字以内"/>
<textarea v-else disabled="disabled" :disable-default-padding="true" class="input-textarea" v-model="orderInfo.detail" placeholder-class="placeholder-class" placeholder="请输入异常说明200字以内"/>
<textarea maxlength="200" v-if="orderInfo.length === 0" :disable-default-padding="true" class="input-textarea" v-model="submitData.detail" placeholder-class="placeholder-class" placeholder="请输入异常说明200字以内"/>
<textarea maxlength="200" v-else disabled="disabled" :disable-default-padding="true" class="input-textarea" v-model="orderInfo.detail" placeholder-class="placeholder-class" placeholder="请输入异常说明200字以内"/>
</view>
</view>
</view>

View File

@ -0,0 +1,88 @@
<template>
<view class="ctr">
<view class="form-group">
<view class="textarea">
<view class="title flex-l">备注信息</view>
<view class="value">
<textarea maxlength="500" :disable-default-padding="true" class="input-textarea" v-model="submitData.worker_remark" placeholder-class="placeholder-class" placeholder="您可在此处输入备注信息该备注信息仅自己可见500字以内"/>
</view>
</view>
</view>
<me-empty-space height="376"></me-empty-space>
<view class="bottom">
<me-button @click="submit()" text="保 存" width="686rpx" icon-type="icon-checkbox-circle" margin-top="32rpx"></me-button>
</view>
</view>
</template>
<script setup>
import MeEmptySpace from "../../components/me-empty-space/me-empty-space.vue";
import MeButton from "../../components/me-button/me-button.vue";
import helpers from "../../utils/helpers";
import {ref, reactive} from 'vue'
import {onLoad} from '@dcloudio/uni-app'
import api from "../../api/api";
import {throttle} from "../../utils/throttle";
//
const submit = throttle(() => {
uni.showLoading({
title: '保存中'
});
submitData.order_dispatch_id = orderDispatchId.value
api.saveWorkerRemark(submitData).then(() => {
uni.hideLoading();
uni.showToast({
title: '已保存',
icon: "success"
})
}).catch(() => {})
})
const orderDispatchId = ref(null)
onLoad((params) => {
orderDispatchId.value = params.id
submitData.worker_remark = params.worker_remark
})
//
const submitData = reactive({
worker_remark: '',
})
</script>
<style lang="scss" scoped>
.ctr {
padding: 0 32rpx;
box-sizing: border-box;
height: 100vh;
.value {
height: 300rpx !important;
}
.bottom {
width: 100%;
padding-top: 20rpx;
padding-bottom: 68rpx;
background: var(--pageBgColor);
box-sizing: border-box;
position: fixed;
bottom: 0;
}
}
</style>

View File

@ -245,7 +245,12 @@
}
.placeholder-class {
color: var(--descriptionColor);
color: var(--descriptionColor) !important;
}
.title-class {
color: var(--titleColor) !important;
font-weight: 500;
}
swiper .wx-swiper-dots .wx-swiper-dot{

View File

@ -80,7 +80,7 @@
.desc {
margin-left: 8rpx;
height: 80rpx;
font-size: 28rpx;
font-size: 30rpx;
color: var(--descriptionColor);
}
}

View File

@ -27,6 +27,8 @@ class helpers {
'complete-service': '/pages/order/complete-service',
//上报异常
'report-order-exception': '/pages/order/report-order-exception',
//更新师傅备注
'worker-remark': '/pages/order/worker-remark',
}
url = paths[pathName]