From 85832c85a73adfbef540b57777791cfaa2776727 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期四, 20 十一月 2025 10:27:23 +0800
Subject: [PATCH] fix: 优化绞线报工

---
 src/pages/production/twist/attachment/index.vue  |   81 +---------------------------------------
 src/pages/production/twist/selfInspect/index.vue |    8 +++
 src/pages/production/twist/report/draw.vue       |   16 +++++++-
 3 files changed, 24 insertions(+), 81 deletions(-)

diff --git a/src/pages/production/twist/attachment/index.vue b/src/pages/production/twist/attachment/index.vue
index 0d17e10..f601172 100644
--- a/src/pages/production/twist/attachment/index.vue
+++ b/src/pages/production/twist/attachment/index.vue
@@ -36,23 +36,6 @@
             </view>
           </template>
 
-          <!-- 瑙嗛棰勮 -->
-          <template v-else-if="isVideoType(item.url)">
-            <video
-              v-if="!item.loadError"
-              :src="getFullUrl(item.url)"
-              class="media-preview"
-              :controls="false"
-              :show-center-play-btn="false"
-              @error="onVideoError(item)"
-            />
-            <!-- 瑙嗛鍔犺浇澶辫触鏄剧ず榛樿鍥炬爣 -->
-            <view v-else class="file-icon-wrapper">
-              <wd-icon name="video" size="48px" color="#ccc" />
-              <text class="file-name error-text">鍔犺浇澶辫触</text>
-            </view>
-          </template>
-
           <!-- 鍏朵粬鏂囦欢绫诲瀷鏄剧ず鍥炬爣 -->
           <view v-else class="file-icon-wrapper">
             <wd-icon name="file-outline" size="48px" color="#999" />
@@ -91,7 +74,7 @@
 
 const detailData = ref<any>({});
 
-// 鑾峰彇瀹屾暣鐨勫浘鐗�/瑙嗛 URL
+// 鑾峰彇瀹屾暣鐨勫浘鐗� URL
 const getFullUrl = (url: string) => {
   if (!url) return "";
   // 濡傛灉宸茬粡鏄畬鏁寸殑 URL锛坔ttp 鎴� https 寮�澶达級锛岀洿鎺ヨ繑鍥�
@@ -118,12 +101,6 @@
   return ["jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(extension);
 };
 
-// 鍒ゆ柇鏄惁涓鸿棰戠被鍨�
-const isVideoType = (urlOrFileName: string) => {
-  const extension = getExtension(urlOrFileName);
-  return ["mp4", "mov", "avi", "wmv", "flv", "mkv", "webm"].includes(extension);
-};
-
 // 鍥剧墖鍔犺浇鎴愬姛
 const onImageLoad = (item: any) => {
   item.loadError = false;
@@ -132,12 +109,6 @@
 // 鍥剧墖鍔犺浇澶辫触
 const onImageError = (item: any) => {
   console.error("鍥剧墖鍔犺浇澶辫触:", item.url);
-  item.loadError = true;
-};
-
-// 瑙嗛鍔犺浇澶辫触
-const onVideoError = (item: any) => {
-  console.error("瑙嗛鍔犺浇澶辫触:", item.url);
   item.loadError = true;
 };
 
@@ -178,20 +149,14 @@
 const addAttachment = () => {
   // 鏄剧ず閫夋嫨鏂囦欢绫诲瀷鐨勫脊绐�
   uni.showActionSheet({
-    itemList: ["閫夋嫨鍥剧墖", "閫夋嫨瑙嗛", "鎷嶇収", "褰曞儚"],
+    itemList: ["閫夋嫨鍥剧墖", "鎷嶇収"],
     success: (res) => {
       switch (res.tapIndex) {
         case 0: // 閫夋嫨鍥剧墖
           chooseImages();
           break;
-        case 1: // 閫夋嫨瑙嗛
-          chooseVideos();
-          break;
-        case 2: // 鎷嶇収
+        case 1: // 鎷嶇収
           takePhoto();
-          break;
-        case 3: // 褰曞儚
-          recordVideo();
           break;
       }
     },
@@ -219,22 +184,6 @@
   });
 };
 
-// 閫夋嫨瑙嗛
-const chooseVideos = () => {
-  uni.chooseVideo({
-    sourceType: ["album"],
-    maxDuration: 60,
-    camera: "back",
-    success: async (res) => {
-      await handleFileUpload([res.tempFilePath]);
-    },
-    fail: (error) => {
-      console.error("閫夋嫨瑙嗛澶辫触:", error);
-      toast.show("閫夋嫨瑙嗛澶辫触");
-    },
-  });
-};
-
 // 鎷嶇収
 const takePhoto = () => {
   uni.chooseImage({
@@ -248,22 +197,6 @@
     fail: (error) => {
       console.error("鎷嶇収澶辫触:", error);
       toast.show("鎷嶇収澶辫触");
-    },
-  });
-};
-
-// 褰曞儚
-const recordVideo = () => {
-  uni.chooseVideo({
-    sourceType: ["camera"],
-    maxDuration: 60,
-    camera: "back",
-    success: async (res) => {
-      await handleFileUpload([res.tempFilePath]);
-    },
-    fail: (error) => {
-      console.error("褰曞儚澶辫触:", error);
-      toast.show("褰曞儚澶辫触");
     },
   });
 };
@@ -382,14 +315,6 @@
     case "bmp":
     case "webp":
       return "image";
-    case "mp4":
-    case "mov":
-    case "avi":
-    case "wmv":
-    case "flv":
-    case "mkv":
-    case "webm":
-      return "video";
     case "pdf":
       return "pdf";
     case "doc":
diff --git a/src/pages/production/twist/report/draw.vue b/src/pages/production/twist/report/draw.vue
index b148266..4d11d8f 100644
--- a/src/pages/production/twist/report/draw.vue
+++ b/src/pages/production/twist/report/draw.vue
@@ -34,10 +34,20 @@
                   </view>
                 </wd-form-item>
                 <wd-form-item label="鐩村緞(mm)" prop="diameter" required>
-                  <wd-input v-model="item.dia" :disabled="false" placeholder="璇疯緭鍏�"></wd-input>
+                  <wd-input
+                    v-model="item.dia"
+                    :disabled="false"
+                    placeholder="璇疯緭鍏�"
+                    type="number"
+                  ></wd-input>
                 </wd-form-item>
                 <wd-form-item label="闀垮害(m)" prop="length" required>
-                  <wd-input v-model="item.length" :disabled="false" placeholder="璇疯緭鍏�"></wd-input>
+                  <wd-input
+                    v-model="item.length"
+                    :disabled="false"
+                    placeholder="璇疯緭鍏�"
+                    type="number"
+                  ></wd-input>
                 </wd-form-item>
                 <wd-form-item label="鍗风粫绱у瘑" prop="windingTightness" required>
                   <wd-radio-group v-model="item.windingTightness" cell shape="dot">
@@ -56,6 +66,7 @@
                     v-model="item.edgeDistance"
                     :disabled="false"
                     placeholder="璇疯緭鍏�"
+                    type="number"
                   ></wd-input>
                 </wd-form-item>
               </wd-form>
@@ -161,6 +172,7 @@
                   v-model="localSteelData.outerDiameter"
                   :disabled="false"
                   placeholder="璇疯緭鍏�"
+                  type="number"
                 ></wd-input>
               </wd-form-item>
               <wd-form-item label="鍒掍激" prop="scratch" required>
diff --git a/src/pages/production/twist/selfInspect/index.vue b/src/pages/production/twist/selfInspect/index.vue
index 7e35f3f..def89d9 100644
--- a/src/pages/production/twist/selfInspect/index.vue
+++ b/src/pages/production/twist/selfInspect/index.vue
@@ -127,7 +127,12 @@
           </view>
           <template #footer>
             <view class="flex justify-end gap-2">
-              <wd-button size="small" plain @click="handleViewInspection(item, index)">
+              <wd-button
+                size="small"
+                plain
+                @click="handleViewInspection(item, index)"
+                style="margin-right: 10px"
+              >
                 鏌ョ湅
               </wd-button>
               <wd-button
@@ -136,6 +141,7 @@
                 plain
                 type="primary"
                 @click="handleEditInspection(item, index)"
+                style="margin-right: 10px"
               >
                 淇敼
               </wd-button>

--
Gitblit v1.9.3