From bab490d2da009c1a23b352b3b964e0c2dd06a0b3 Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期四, 12 六月 2025 17:32:42 +0800 Subject: [PATCH] 移动端功能优化 --- eims-ui-mobile/src/pages/maint/maint-order.vue | 62 ++++++++++++++++++++++++------- 1 files changed, 48 insertions(+), 14 deletions(-) diff --git a/eims-ui-mobile/src/pages/maint/maint-order.vue b/eims-ui-mobile/src/pages/maint/maint-order.vue index fe14b49..7e60bdc 100644 --- a/eims-ui-mobile/src/pages/maint/maint-order.vue +++ b/eims-ui-mobile/src/pages/maint/maint-order.vue @@ -54,15 +54,17 @@ <view class="text-color-gray text-sm mt-1 flex"> <text class="mr-3">宸ュ崟鎬绘暟: {{ maintSt.orderCount }}</text> | - <text class="mx-3">宸插畬鎴�: {{ maintSt.wcCount }}</text> - </view> - <view class="text-color-gray text-sm mt-2 flex"> - <text class="mr-3">寰呬繚鍏�: {{ maintSt.dbyCount }}</text> + <text class="mx-3">宸插畬鎴�: {{ maintSt.dyzCount }}</text> | - <text class="mx-3">淇濆吇涓�: {{ maintSt.byCount }}</text> -<!-- |--> -<!-- <text class="ml-3">寰呴獙璇�: {{ maintSt.dyzCount }}</text>--> + <text class="mx-3">寰呬繚鍏�: {{ maintSt.dbyCount }}</text> </view> +<!-- <view class="text-color-gray text-sm mt-2 flex">--> +<!-- <text class="mr-3">寰呬繚鍏�: {{ maintSt.dbyCount }}</text>--> +<!-- |--> +<!-- <text class="mx-3">淇濆吇涓�: {{ maintSt.byCount }}</text>--> +<!--<!– |–>--> +<!--<!– <text class="ml-3">寰呴獙璇�: {{ maintSt.dyzCount }}</text>–>--> +<!-- </view>--> <view class="text-color-gray text-sm mt-2 flex"> <text>鐘舵�侊細</text> <template v-if="maintSt.status === '1'"> @@ -140,6 +142,9 @@ <!-- 姝f枃鍖哄煙 --> <view v-else class="mt-2"> + <wd-upload v-model:file-list="item.fileList" :action="VITE_UPLOAD_BASEURL" @success="handleUploadSuccess" > + <wd-button>涓婁紶鍥剧墖</wd-button> + </wd-upload> <!-- 淇濆吇璇存槑鍖哄煙 --> <view v-if="item.maintFun === '1'" class="mt-2"> <wd-input @@ -170,7 +175,7 @@ > <wd-input v-model="part.name" - label="鍚嶇О" + label="鍚嶇О锛�" label-width="100rpx" placeholder="澶囦欢鍚嶇О" @@ -178,7 +183,8 @@ /> <wd-input v-model="part.quantity" - label="鏁伴噺" label-width="100rpx" + label="鏁伴噺锛�" + label-width="100rpx" placeholder="鏁伴噺" type="number" :maxlength="5" /> </view> </view> @@ -255,11 +261,12 @@ import { getMaintSt, getMaintStOrderList, updateMaintOrder, updateMaintSt, updateMaintOrderBatch } from '@/service/maint' import { ref, reactive } from 'vue' import { useToast, useMessage } from 'wot-design-uni' -import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils' +import { isLeader, isLineOrRepair } from '@/utils/RoleUtils' import { formatDate } from '@/utils/DateUtils' import { useUserStore } from "@/store"; import { getSpareList } from '@/service/spare' - +import { getEnvBaseUploadUrl } from "@/utils"; +const VITE_UPLOAD_BASEURL = `${getEnvBaseUploadUrl()}` const message = useMessage() const toast = useToast() const userStore = useUserStore() @@ -300,10 +307,19 @@ } getMaintStOrderList(params) .then((res: any) => { + // 灏嗘瘡涓�椤圭殑picture杞崲涓篺ileList鏁扮粍 + res.rows.forEach((item: any) => { + item.fileList = item.picture?.split(',').map((url: string) => { + return { + url: url, + } + }) + }) // 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡 paging.value.completeByTotal(res.rows, res.total) }) .catch((res) => { + console.error(res) // 濡傛灉璇锋眰澶辫触鍐檖aging.value.complete(false)锛屼細鑷姩灞曠ず閿欒椤甸潰 // 娉ㄦ剰锛屾瘡娆¢兘闇�瑕佸湪catch涓啓杩欏彞璇濆緢楹荤儲锛寊-paging鎻愪緵浜嗘柟妗堝彲浠ュ叏灞�缁熶竴澶勭悊 // 鍦ㄥ簳灞傜殑缃戠粶璇锋眰鎶涘嚭寮傚父鏃讹紝鍐檜ni.$emit('z-paging-error-emit');鍗冲彲 @@ -381,6 +397,7 @@ function confirmSpareSelection() { closeSparePopup() } + function addOtherSparePart() { dataList.value[selectedPartIndex.value].spareParts.push({ @@ -483,6 +500,15 @@ return false } + // 灏唖ubmitList涓瘡涓�椤圭殑fileList杞崲涓轰互閫楀彿鍒嗗壊鐨勫瓧绗︿覆 + submitList.forEach((item) => { + + console.log('item.fileList', item.fileList) + const map = item.fileList?.map((file) => file.url) + console.log('map', map) + item.picture = map?.join(',') + }) + const data: any = Object.assign( {}, @@ -536,9 +562,8 @@ } function handleClickRight() { - if(isOperatorOrRepair()){ + handleUpdateMaintSt() - } } @@ -643,7 +668,16 @@ .catch((res) => { console.error(res) }) - +} +function handleUploadSuccess({ file, fileList }) { + console.log('handleUploadSuccess', file) + // 鍒ゆ柇 file.response鏄笉鏄� 瀵硅薄锛屼笉鏄璞″皢json瀛楃涓茶浆鎹负瀵硅薄 + if (typeof file.response === 'string') { + file.response = JSON.parse(file.response) + console.log('file.response', file.response) + file.ossId = file.response.data.ossId + file.url = file.response.data.url + } } // 鏂板鏂规硶锛氳幏鍙栫姸鎬佹枃鏈� -- Gitblit v1.9.3