feat: 【小程序】新增更新进度页面
This commit is contained in:
parent
e76819c020
commit
1f80845b21
|
|
@ -104,6 +104,12 @@ class Api {
|
|||
return fetch.request('postFrom', url, data, true)
|
||||
}
|
||||
|
||||
// 更新进度
|
||||
static updateProgress(data) {
|
||||
let url = `${config.host}/worker/order_dispatch/updateProgress`;
|
||||
return fetch.request('postFrom', url, data, true)
|
||||
}
|
||||
|
||||
// 保存师傅备注
|
||||
static saveWorkerRemark(data) {
|
||||
let url = `${config.host}/worker/order_dispatch/saveWorkerRemark`;
|
||||
|
|
|
|||
|
|
@ -3,23 +3,23 @@
|
|||
<view class="form-group">
|
||||
<picker @change="bindPickerChange" :range="typeList">
|
||||
<view class="item input flex-sb line-after">
|
||||
<view class="title flex-l">进度</view>
|
||||
<view class="select-ctr flex-r select">{{ submitData.is_finish_today == 1 ? '今日能完工' : '今日不能完工'}}</view>
|
||||
<view class="title flex-l">今日完成</view>
|
||||
<view class="select-ctr flex-r select">{{ submitData.is_finish_today == 0 ? '今日不能完工' : '今日能完工'}}</view>
|
||||
</view>
|
||||
</picker>
|
||||
<view :class="[submitData.is_finish_today == 0 ? 'line-after' : '', 'item', 'time']">
|
||||
<view class="item-row flex-sb">
|
||||
<view class="title flex-l">完工时间</view>
|
||||
<uni-datetime-picker v-model="submitData.finish_date" :start="Date.now()" type="datetime" :hide-second="true">
|
||||
<view class="value flex-r value-empty" v-if="submitData.finish_date === null">点击选择完工时间</view>
|
||||
<view class="value flex-r" v-else>{{ helpers.removeSeconds(submitData.finish_date) }}</view>
|
||||
<uni-datetime-picker v-model="submitData.estimated_finish_time" :start="Date.now()" type="datetime" :hide-second="true">
|
||||
<view class="value flex-r value-empty" v-if="submitData.estimated_finish_time === null">点击选择完工时间</view>
|
||||
<view class="value flex-r" v-else>{{ helpers.removeSeconds(submitData.estimated_finish_time) }}</view>
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="textarea" v-if="submitData.is_finish_today == 0">
|
||||
<view class="title flex-l">当前施工进度</view>
|
||||
<view class="value">
|
||||
<textarea maxlength="200" :disable-default-padding="true" class="input-textarea" v-model="submitData.detail" placeholder-class="placeholder-class" placeholder="请简要描述当前的施工进度,方便平台知晓服(200字以内)"/>
|
||||
<textarea maxlength="200" :disable-default-padding="true" class="input-textarea" v-model="submitData.work_progress" placeholder-class="placeholder-class" placeholder="请简要描述当前的施工进度,方便平台知晓服(200字以内)"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -53,21 +53,21 @@ const submit = throttle(() => {
|
|||
uni.showModal({
|
||||
title: '提示信息',
|
||||
confirmText: '确认',
|
||||
content: '确认上报异常?',
|
||||
content: '确认更新进度?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
uni.showLoading({
|
||||
title: '提交中'
|
||||
});
|
||||
|
||||
submitData.order_id = orderId.value
|
||||
submitData.order_dispatch_id = id.value
|
||||
|
||||
api.createOrderAbnormal(submitData).then(() => {
|
||||
api.updateProgress(submitData).then(() => {
|
||||
helpers.delayHideLoading()
|
||||
uni.showModal({
|
||||
title: '提示信息',
|
||||
showCancel: false,
|
||||
content: '异常已上报',
|
||||
content: '进度已更新',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateBack();
|
||||
|
|
@ -82,25 +82,22 @@ const submit = throttle(() => {
|
|||
});
|
||||
})
|
||||
|
||||
const orderInfo = ref(null)
|
||||
const init = () => {
|
||||
// api.orderAbnormalInfo({order_id: orderId.value}).then(res => {
|
||||
// if (res.id !== undefined) {
|
||||
// orderInfo.value = res
|
||||
// submitData.abnormal_id = orderInfo.value.abnormal_id
|
||||
// submitData.detail = orderInfo.value.detail
|
||||
// }
|
||||
//
|
||||
// helpers.delayHideLoading()
|
||||
// }).catch(() => {})
|
||||
api.orderInfo({order_dispatch_id: id.value}).then(res => {
|
||||
submitData.is_finish_today = res.is_finish_today
|
||||
submitData.estimated_finish_time = res.estimated_finish_time
|
||||
submitData.work_progress = res.work_progress
|
||||
|
||||
helpers.delayHideLoading()
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
const orderId = ref(null)
|
||||
const id = ref(null)
|
||||
onLoad((params) => {
|
||||
orderId.value = params.order_id
|
||||
// uni.showLoading({
|
||||
// title: '加载中'
|
||||
// })
|
||||
id.value = params.id
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
})
|
||||
init()
|
||||
})
|
||||
|
||||
|
|
@ -112,19 +109,19 @@ const typeList = ref([
|
|||
//提交数据
|
||||
const submitData = reactive({
|
||||
is_finish_today: 1,
|
||||
finish_date: null,
|
||||
detail: '',
|
||||
estimated_finish_time: null,
|
||||
work_progress: '',
|
||||
})
|
||||
|
||||
//验证提交数据
|
||||
const validate = () => {
|
||||
if (submitData.abnormal_id === 0) {
|
||||
helpers.showToast('请选择异常原因')
|
||||
if (submitData.estimated_finish_time === null) {
|
||||
helpers.showToast('请选择完成时间')
|
||||
return false
|
||||
}
|
||||
|
||||
if (submitData.detail === '') {
|
||||
helpers.showToast('请输入异常详情')
|
||||
if (submitData.is_finish_today == 0 && submitData.work_progress === '') {
|
||||
helpers.showToast('请输入当前施工进度')
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user