From 87fce896046ec8e804810f75a90a62a5986e67ed Mon Sep 17 00:00:00 2001
From: ZN <zhang_12370@163.com>
Date: 星期二, 31 三月 2026 15:18:26 +0800
Subject: [PATCH] fix: 修正端口号、消息页签索引及生产报告表单字段

---
 src/pages/login.vue                                       |    4 +-
 src/pages/productionManagement/productionReport/index.vue |   70 ++++++++++++++++++----------------
 src/pages/message.vue                                     |    4 +-
 src/config.js                                             |    4 +-
 4 files changed, 43 insertions(+), 39 deletions(-)

diff --git a/src/config.js b/src/config.js
index b87a0a7..f79e4db 100644
--- a/src/config.js
+++ b/src/config.js
@@ -1,7 +1,7 @@
 // 搴旂敤鍏ㄥ眬閰嶇疆
 const config = {
-  baseUrl: 'http://1.15.17.182:9003',
-  fileUrl: 'http://1.15.17.182:9003',
+  baseUrl: 'http://1.15.17.182:9023',
+  fileUrl: 'http://1.15.17.182:9023',
    // 搴旂敤淇℃伅
    appInfo: {
      // 搴旂敤鍚嶇О
diff --git a/src/pages/login.vue b/src/pages/login.vue
index 806e964..8746749 100644
--- a/src/pages/login.vue
+++ b/src/pages/login.vue
@@ -201,12 +201,12 @@
         // 鏇存柊tabbar鐨勮鏍�
         if (count > 0) {
           uni.setTabBarBadge({
-            index: 2, // 娑堟伅鏍囩椤电殑绱㈠紩
+            index: 1, // 娑堟伅鏍囩椤电殑绱㈠紩
             text: count.toString(),
           });
         } else {
           uni.removeTabBarBadge({
-            index: 2,
+            index: 1,
           });
         }
       })
diff --git a/src/pages/message.vue b/src/pages/message.vue
index 22947bc..6b8b400 100644
--- a/src/pages/message.vue
+++ b/src/pages/message.vue
@@ -239,12 +239,12 @@
           // 鏇存柊tabbar鐨勮鏍�
           if (count > 0) {
             uni.setTabBarBadge({
-              index: 2, // 娑堟伅鏍囩椤电殑绱㈠紩
+              index: 1, // 娑堟伅鏍囩椤电殑绱㈠紩
               text: count.toString(),
             });
           } else {
             uni.removeTabBarBadge({
-              index: 2,
+              index: 1,
             });
           }
         })
diff --git a/src/pages/productionManagement/productionReport/index.vue b/src/pages/productionManagement/productionReport/index.vue
index dcd0fd7..ab3baf4 100644
--- a/src/pages/productionManagement/productionReport/index.vue
+++ b/src/pages/productionManagement/productionReport/index.vue
@@ -31,13 +31,16 @@
                    placeholder="璇疯緭鍏�"
                    type="number" />
         </u-form-item>
-        <u-form-item label="鐝粍淇℃伅"
-                     prop="schedulingUserId"
+        <!-- 鐝粍淇℃伅鍜屽鏍镐汉 -->
+        <u-form-item v-for="(item, key) in pickerFields"
+                     :key="key"
+                     :label="item.label"
+                     :prop="key + '.name'"
                      required>
-          <u-input v-model="form.userName"
-                   placeholder="璇烽�夋嫨鐢熶骇浜�"
+          <u-input v-model="form[key].name"
+                   :placeholder="form[key].name ? '宸查�夋嫨: ' + form[key].name : '璇烽�夋嫨' + item.label"
                    readonly
-                   @click="openProducerPicker"
+                   @click="openProducerPicker(key)"
                    suffix-icon="arrow-down" />
         </u-form-item>
       </view>
@@ -76,23 +79,29 @@
   const formRef = ref();
 
   // 琛ㄥ崟鏁版嵁
-  let form = ref({
+  const form = ref({
     planQuantity: "",
     quantity: "",
     scrapQty: "",
-    userName: "",
     workOrderId: "",
     productProcessRouteItemId: "",
-    userId: "",
-    schedulingUserId: "",
+    userId: { value: "", name: "" }, // 鐝粍淇℃伅
+    auditUserId: { value: "", name: "" }, // 瀹℃牳浜�
   });
+
+  // 杩欓噷鐨勫瓧娈甸厤缃敤浜庢ā鐗堝惊鐜�
+  const pickerFields = {
+    userId: { label: "鐝粍淇℃伅" },
+    auditUserId: { label: "瀹℃牳浜�" },
+  };
 
   // 鐢熶骇浜洪�夋嫨鍣ㄧ姸鎬�
   const showProducerPicker = ref(false);
   const producerList = ref([]);
+  const currentField = ref(""); // 褰撳墠閫夋嫨鐨勫瓧娈�
 
   // 鎵撳紑鐢熶骇浜洪�夋嫨鍣�
-  const openProducerPicker = async () => {
+  const openProducerPicker = async (field) => {
     if (producerList.value.length === 0) {
       // 濡傛灉鍒楄〃涓虹┖锛屽厛鍔犺浇鐢ㄦ埛鍒楄〃
       try {
@@ -100,7 +109,7 @@
         const users = res.data || [];
         // 杞崲涓� action-sheet 闇�瑕佺殑鏍煎紡
         producerList.value = users.map(user => ({
-          name: user.nickName || user.userName,
+          name: user.nickName || "",
           value: user.userId,
         }));
       } catch (error) {
@@ -110,13 +119,15 @@
       }
     }
     showProducerPicker.value = true;
+    currentField.value = field; // 淇濆瓨褰撳墠瀛楁
   };
 
   // 鐢熶骇浜洪�夋嫨纭
   const onProducerConfirm = e => {
-    form.value.schedulingUserId = e.value;
-    form.value.userName = e.name;
-    form.value.userId = e.value; // 鍚屾椂鏇存柊 userId
+    if (currentField.value && form.value[currentField.value]) {
+      form.value[currentField.value].value = e.value;
+      form.value[currentField.value].name = e.name ;
+    }
     showProducerPicker.value = false;
   };
 
@@ -136,9 +147,14 @@
       showToast("璇疯緭鍏ユ湰娆$敓浜ф暟閲�");
       return;
     }
-    if (!form.value.schedulingUserId) {
+    if (!form.value.userId.value) {
       submitting.value = false;
-      showToast("璇烽�夋嫨鐢熶骇浜�");
+      showToast("璇烽�夋嫨鐝粍淇℃伅");
+      return;
+    }
+    if (!form.value.auditUserId.value) {
+      submitting.value = false;
+      showToast("璇烽�夋嫨瀹℃牳浜�");
       return;
     }
     // 杞崲涓烘暟瀛楄繘琛屾瘮杈�
@@ -162,6 +178,9 @@
       quantity: Number(form.value.quantity),
       scrapQty: Number(form.value.scrapQty) || 0,
       planQuantity: Number(form.value.planQuantity) || 0,
+      userId: form.value.userId.value,
+      auditUserId: form.value.auditUserId.value,
+      schedulingUserId: form.value.userId.value, // 鍏煎鏃у瓧娈�
     };
     console.log(submitData, "submitData");
 
@@ -181,31 +200,16 @@
 
   // 椤甸潰鍔犺浇鏃跺垵濮嬪寲鏁版嵁
   onLoad(options => {
-    console.log(options, "options");
-    // 濡傛灉娌℃湁 orderRow 鍙傛暟锛岃鏄庢槸浠庨椤电洿鎺ヨ烦杞紝闇�瑕佺敤鎴锋墜鍔ㄩ�夋嫨璁㈠崟
-    if (!options.orderRow) {
-      console.log("浠庨椤佃烦杞紝鏃犺鍗曟暟鎹�");
-      getInfo().then(res => {
-        // 榛樿浣跨敤褰撳墠鐧诲綍鐢ㄦ埛
-        form.value.userId = res.user.userId;
-        form.value.userName = res.user.userName;
-        form.value.schedulingUserId = res.user.userId;
-      });
-      return;
-    }
     try {
       const orderRow = JSON.parse(options.orderRow);
-      console.log("鏋勯�犵殑orderRow:", orderRow);
-      console.log(orderRow, "orderRow======########");
       // 纭繚 planQuantity 杞崲涓哄瓧绗︿覆锛屼互渚垮湪 u-input 涓纭樉绀�
       form.value.planQuantity = orderRow.planQuantity != null ? String(orderRow.planQuantity) : "";
       form.value.productProcessRouteItemId = orderRow.productProcessRouteItemId || "";
       form.value.workOrderId = orderRow.id || "";
       getInfo().then(res => {
         // 榛樿浣跨敤褰撳墠鐧诲綍鐢ㄦ埛锛屼絾鍏佽鐢ㄦ埛淇敼
-        form.value.userId = res.user.userId;
-        form.value.userName = res.user.userName;
-        form.value.schedulingUserId = res.user.userId;
+        form.value.userId.value = res.user.userId;
+        form.value.userId.name = res.user.nickName;
       });
       // 浣跨敤 nextTick 纭繚 DOM 鏇存柊
       nextTick(() => {

--
Gitblit v1.9.3