From 2f1e317685883e87c449af0e779743548d5fb3f2 Mon Sep 17 00:00:00 2001 From: liugongyu <290219706@qq.com> Date: Tue, 23 Dec 2025 18:07:18 +0800 Subject: [PATCH] 图片参数处理 --- common/utils/common.js | 10 ---------- pages-sub/daily/maintain-manage/add-record.vue | 53 +++-------------------------------------------------- pages-sub/daily/quick-order/add-order.vue | 4 ++-- pages-sub/daily/quick-order/index.vue | 5 ++--- pages-sub/problem/work-order-manage/add-order.vue | 22 +++++++++++----------- pages-sub/problem/work-order-manage/index.vue | 18 ++++++------------ pages-sub/problem/work-order-manage/order-detail.vue | 453 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------- 7 files changed, 426 insertions(+), 139 deletions(-) diff --git a/common/utils/common.js b/common/utils/common.js index c01980e..8eb1718 100644 --- a/common/utils/common.js +++ b/common/utils/common.js @@ -42,16 +42,6 @@ export const nextStepMap = { }, } -// ylTeamLeader 养护组长退回:210 -// ylTeamLeader 养护组长分配:110 -// ylInspectorStart 巡查员结束工单:200 -// ylInspectorStart 巡查员重新发起:100 -// ylWorker 养护员退回 :220 -// ylWorker 养护员实施 :120 -// ylTeamLeaderConfirm 养护组长验收通过: 130 -// ylTeamLeaderConfirm 养护组长验收不通过:230 -// ylInspector 巡查员验收通过:140 -// ylInspector 巡查员验收不通过:240 export const buzStatusMap = { '000' :'巡查员发起', diff --git a/pages-sub/daily/maintain-manage/add-record.vue b/pages-sub/daily/maintain-manage/add-record.vue index ab44627..dbff351 100644 --- a/pages-sub/daily/maintain-manage/add-record.vue +++ b/pages-sub/daily/maintain-manage/add-record.vue @@ -116,38 +116,14 @@ export default { } } ], - // progress: [ - // { - // - // required: true, - // message: '请设置完成进度', - // trigger: ['change'], - // validator: (rule, value, callback) => { - // // 第一步:校验是否为空/0 - // if (!value && value !== 0) { - // callback(new Error('请设置完成进度')) - // } - // // 第二步:校验是否大于初始进度 - // else if (value <= this.initProgress) { - // callback(new Error(`完成进度必须大于${this.initProgress}%`)) - // } - // // 校验通过 - // else { - // callback() - // } - // } - // } - // ] + } } }, onLoad(option) { console.log('页面参数:', option) this.paramsOptins = option - // // 初始化初始进度 - // this.initProgress = option.finishPercent ? Number(option.finishPercent)+1 : 0 - // // 关键修复:初始进度值设为 初始进度+1,避免刚进入就触发校验失败 - // this.inspectForm.progress = this.initProgress + }, onReady() { @@ -158,30 +134,7 @@ export default { /** * 进度滑块变化处理 - 核心优化:实时触发校验 + 状态更新 */ - handleProgressChange(value) { - // // 1. 强制修正非法值(兜底) - // console.log(value) - // if (value <= this.initProgress) { - // console.log('123') - // this.inspectForm.progress = this.initProgress + 1 - // uni.showToast({ - // title: `进度不能低于${this.initProgress}%`, - // icon: 'none', - // duration: 1500 - // }) - // } - // - // // 2. 关键:手动触发progress字段的校验,实时更新提示状态 - // this.$nextTick(async () => { - // try { - // // 触发单个字段校验 - // await this.$refs.inspectFormRef.validateField('progress') - // } catch (err) { - // // 校验失败时uView会自动显示提示,此处无需额外处理 - // console.log('进度校验失败:', err) - // } - // }) - }, + /** * 删除图片 diff --git a/pages-sub/daily/quick-order/add-order.vue b/pages-sub/daily/quick-order/add-order.vue index 7be7796..73cd81a 100644 --- a/pages-sub/daily/quick-order/add-order.vue +++ b/pages-sub/daily/quick-order/add-order.vue @@ -445,8 +445,8 @@ export default { const submitData = { roadId: this.workOrderForm.roadId, roadName: this.workOrderForm.roadName, - imgs: this.getImgUrlList(this.problemImgsList), - longRangeImgList: this.getImgUrlList(this.completeImgsList), + problemsImgs: this.getImgUrlList(this.problemImgsList), + endImgs : this.getImgUrlList(this.completeImgsList), remark: this.workOrderForm.problemDesc.trim(), handleResult: this.workOrderForm.handleResult.trim(), latLonType: 2, diff --git a/pages-sub/daily/quick-order/index.vue b/pages-sub/daily/quick-order/index.vue index b67e79b..76da1d5 100644 --- a/pages-sub/daily/quick-order/index.vue +++ b/pages-sub/daily/quick-order/index.vue @@ -4,7 +4,7 @@ - + { // 下拉选择框容器 .select-wrap { - width: 80px; - color: #333; + width: 60px; margin-right: 20rpx; // 适配up-select样式 :deep(.u-select) { diff --git a/pages-sub/problem/work-order-manage/add-order.vue b/pages-sub/problem/work-order-manage/add-order.vue index d257d82..6f72b6f 100644 --- a/pages-sub/problem/work-order-manage/add-order.vue +++ b/pages-sub/problem/work-order-manage/add-order.vue @@ -118,11 +118,11 @@ @@ -201,7 +201,7 @@ const currentActionSheetData = reactive({ }) // 完成时间选择器控制 const show = ref(false) -const finishDate = ref(Date.now()) +const expectedFinishDate = ref(Date.now()) // ========== 重新提交相关状态(核心:本地存储读取) ========== const isRenew = ref(false); // 是否为重新提交状态 @@ -223,7 +223,7 @@ const workOrderForm = reactive({ problemDesc: '', // 情况描述 lat: 0, // 纬度 lon: 0, // 经度 - finishDate: '', // 完成时间 + expectedFinishDate: '', // 希望完成时间 }) // ========== 表单校验规则 ========== @@ -318,7 +318,7 @@ const echoOrderData = (orderItem) => { workOrderForm.problemDesc = orderItem.remark || ''; workOrderForm.lat = orderItem.lat || 0; workOrderForm.lon = orderItem.lon || 0; - workOrderForm.finishDate = orderItem.finishDate || timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss'); + workOrderForm.expectedFinishDate = orderItem.expectedFinishDate || timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss'); // 2. 上传图片回显(兼容useUploadImgs格式) if (orderItem.problemsImgs && Array.isArray(orderItem.problemsImgs) && orderItem.problemsImgs.length > 0) { @@ -480,9 +480,9 @@ const chooseWorkLocation = () => { /** * 完成时间确认 */ -const finishDateConfirm = (e) => { +const expectedFinishDateConfirm = (e) => { console.log('选择的完成时间:', e) - workOrderForm.finishDate = timeFormat(e.value, 'yyyy-mm-dd hh:MM:ss') + workOrderForm.expectedFinishDate = timeFormat(e.value, 'yyyy-mm-dd hh:MM:ss') show.value = false } @@ -505,7 +505,7 @@ const submitWorkOrder = async () => { const commonSubmitData = { roadId: workOrderForm.roadId, roadName: workOrderForm.roadName, - imgs: problemImgs.getSuccessImgUrls(), // 复用上传逻辑的URL获取方法 + problemsImgs: problemImgs.getSuccessImgUrls(), // 复用上传逻辑的URL获取方法 remark: workOrderForm.problemDesc.trim(), latLonType: 2, lat: workOrderForm.lat, @@ -513,7 +513,7 @@ const submitWorkOrder = async () => { lonLatAddress: workOrderForm.workLocation, pressingType: workOrderForm.pressingType, orderName: workOrderForm.orderName, - finishDate: workOrderForm.finishDate, + expectedFinishDate: workOrderForm.expectedFinishDate, sourceId: 1, sourceName: '园林', busiLine: 'yl' diff --git a/pages-sub/problem/work-order-manage/index.vue b/pages-sub/problem/work-order-manage/index.vue index faf2ebc..6bc81a8 100644 --- a/pages-sub/problem/work-order-manage/index.vue +++ b/pages-sub/problem/work-order-manage/index.vue @@ -510,12 +510,12 @@ const confirmReject = async () => { // 严格校验回退原因(去除首尾空格) const rejectReasonTrim = rejectReason.value.trim(); if (!rejectReasonTrim) { - uni.showToast({title: '请填写回退原因', icon: 'none', duration: 2000}); + uni.showToast({title: '请填写回退原因', icon: 'none', duration: 1000}); return; } // 校验当前工单有效性 if (!currentRejectItem.value || !currentRejectItem.value.id) { - uni.showToast({title: '工单信息异常,无法提交', icon: 'none', duration: 2000}); + uni.showToast({title: '工单信息异常,无法提交', icon: 'none', duration:1000}); rejectModalShow.value = false; return; } @@ -559,12 +559,12 @@ const handleAddOrder = () => { const handleAcceptModalConfirm = async () => { // 1. 校验验收原因是否为空 if (!acceptReason.value.trim()) { - uni.showToast({title: '请填写验收原因', icon: 'none', duration: 2000}); + uni.showToast({title: '请填写验收原因', icon: 'none', duration: 1000}); return; } // 2. 校验验收原因长度 if (acceptReason.value.length > 200) { - uni.showToast({title: '验收原因最多200字', icon: 'none', duration: 2000}); + uni.showToast({title: '验收原因最多200字', icon: 'none', duration: 1000}); return; } try { @@ -592,14 +592,14 @@ const handleAcceptModalConfirm = async () => { } const acceptRes = await universalApproval(postData); // 4. 操作成功处理 - uni.showToast({title: '提交成功', icon: 'success', duration: 1500}); + uni.showToast({title: '提交成功', icon: 'success', duration: 1000}); acceptModalShow.value = false; acceptReason.value = ''; // 清空验收原因 paging.value?.reload(); // 刷新工单列表 } catch (error) { // 5. 操作失败处理 console.error('养护组长验收失败:', error); - uni.showToast({title: '验收提交失败,请重试', icon: 'none', duration: 2000}); + uni.showToast({title: '验收提交失败,请重试', icon: 'none', duration: 1000}); } }; @@ -679,12 +679,6 @@ onShow(() => { } } -.reject-textarea { - font-size: 28rpx; - padding: 16rpx; - border: 1rpx solid #e4e7ed; - border-radius: 8rpx; -} .upload-wrap { margin-top: 20rpx; diff --git a/pages-sub/problem/work-order-manage/order-detail.vue b/pages-sub/problem/work-order-manage/order-detail.vue index abab96b..9df621f 100644 --- a/pages-sub/problem/work-order-manage/order-detail.vue +++ b/pages-sub/problem/work-order-manage/order-detail.vue @@ -110,7 +110,7 @@ @@ -131,7 +131,9 @@ 共同处理人 @@ -167,10 +169,10 @@ v-if="processData.activityNodes && processData.activityNodes.length" :list="processData.activityNodes" :current="getCurrentStepIndex()" - direction="column" - active-color="#3c9cff" - inactive-color="#999" - class="vertical-steps" + direction="column" + active-color="#3c9cff" + inactive-color="#999" + class="vertical-steps" >