From 1efdf8fa2f60cc6d9da42b319540d4c2df4b3e0a Mon Sep 17 00:00:00 2001
From: baoshiwei <baoshiwei@shlanbao.cn>
Date: 星期六, 14 六月 2025 15:13:35 +0800
Subject: [PATCH] refactor(repair): 优化报修相关功能和页面展示

---
 eims-ui-mobile/src/pages/repair/repair-add.vue |   54 +++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/eims-ui-mobile/src/pages/repair/repair-add.vue b/eims-ui-mobile/src/pages/repair/repair-add.vue
index 2a2778c..af4caaf 100644
--- a/eims-ui-mobile/src/pages/repair/repair-add.vue
+++ b/eims-ui-mobile/src/pages/repair/repair-add.vue
@@ -24,7 +24,7 @@
           :columns="reqList"
           label-key="dictLabel"
           value-key="dictValue"
-          label="鏁呴殰绫诲瀷"
+          label="鎶ヤ慨绫诲瀷"
           v-model="model.reqType"
           @confirm="handleConfirmReqType"
           :disabled="reqTypeDis"
@@ -115,10 +115,9 @@
         />
         <wd-cell title="鎶ヤ慨鍥剧墖" title-width="200rpx" prop="fileList">
           <wd-upload
-            :auto-upload="false"
-            :file-list="model.fileList"
+            v-model:file-list="model.fileList"
             :action="VITE_UPLOAD_BASEURL"
-            @change="handleFileChange"
+            @success="handleUploadSuccess"
           ></wd-upload>
         </wd-cell>
 
@@ -131,9 +130,26 @@
           @open="openOccTime"
           @confirm="handleOccTimeConfirm"
         />
+        <!-- <wd-picker
+          :columns="urgencyList"
+          label-key="dictLabel"
+          value-key="dictValue"
+          label="绱ф�ョ▼搴�"
+          v-model="model.urgencyLevel"
+          @confirm="handleConfirmUrgencyLevel"
+        /> -->
+        <wd-cell title="绱ф�ョ▼搴�" title-width="200rpx" prop="urgencyLevel">
+          <wd-radio-group v-model="model.urgencyLevel" inline  shape="dot"> @change="handleConfirmUrgencyLevel">
+          <wd-radio v-for="item in urgencyList" :value="item.dictValue">{{item.dictLabel}}</wd-radio>
+        </wd-radio-group>
+        </wd-cell>
+
       </wd-cell-group>
 
-      <wd-cell-group custom-class="mt-2" title="鍏朵粬淇℃伅" border>
+
+      <wd-button style="margin: 20px" block @click="handleSubmit">鎻愪氦</wd-button>
+
+      <!-- <wd-cell-group custom-class="mt-2" title="鍏朵粬淇℃伅" border>
         <wd-picker
           :columns="faultList"
           label-key="dictLabel"
@@ -150,7 +166,7 @@
           v-model="model.urgencyLevel"
           @confirm="handleConfirmUrgencyLevel"
         />
-      </wd-cell-group>
+      </wd-cell-group> -->
     </wd-form>
   </view>
 </template>
@@ -315,27 +331,36 @@
   model.reqTime = formatDate(new Date())
   model.reqDept = userStore?.userInfo?.deptId
   model.reqUser = userStore?.userInfo?.userId
+  console.log('model', model)
+  const map = model.fileList?.map((file) => file.url)
+  console.log('map', map)
+  model.faultPicture = map.join(',')
   addRepairReq(model)
     .then((res: any) => {
       if (res?.code === 200) {
         toast.success(res?.msg)
-        uni.$emit('req-list-refresh')
+        uni.$emit('list-refresh')
         setTimeout(() => {
           uni.navigateBack()
         }, 1500)
       }
     })
     .catch((res) => {
+      console.error('娣诲姞鎶ヤ慨澶辫触:', res)
       toast.error(res?.data?.msg || '璇锋眰澶辫触')
     })
 }
 
-/**
- * 涓婁紶鐐规鍥剧墖
- * @param fileList
- */
-function handleFileChange({ fileList }) {
-  model.fileList = fileList
+
+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
+  }
 }
 
 function checkData() {
@@ -370,11 +395,14 @@
  */
 function openOccTime() {
   occTime.value = Date.now()
+  console.log('openOccTime', occTime)
+  model.occTime = formatDate(new Date(occTime.value))
 }
 /**
  * 纭閫夋嫨鍙戠敓鏃堕棿
  */
 function handleOccTimeConfirm({ value }) {
+  console.log('handleOccTimeConfirm', value)
   model.occTime = formatDate(new Date(value))
 }
 

--
Gitblit v1.9.3