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