From 26b2a4b21b3c2cd34e6781cf7876eae580a7e1ec Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期六, 23 五月 2026 15:02:35 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_NEW_pro_鹤壁' into dev_NEW_pro_鹤壁

---
 src/pages/qualityManagement/processInspection/add.vue |  138 ++++++++++++++++++++++------------------------
 1 files changed, 66 insertions(+), 72 deletions(-)

diff --git a/src/pages/qualityManagement/processInspection/add.vue b/src/pages/qualityManagement/processInspection/add.vue
index 87a3feb..f546fcb 100644
--- a/src/pages/qualityManagement/processInspection/add.vue
+++ b/src/pages/qualityManagement/processInspection/add.vue
@@ -51,6 +51,7 @@
       </up-form-item>
       <up-form-item label="鎸囨爣閫夋嫨"
                     prop="testStandardId"
+                    required
                     border-bottom>
         <up-input v-model="testStandardDisplay"
                   placeholder="璇烽�夋嫨鎸囨爣"
@@ -67,14 +68,32 @@
                   placeholder="璇疯緭鍏ュ崟浣�"
                   disabled />
       </up-form-item>
-      <up-form-item label="鏁伴噺"
+      <up-form-item label="鎬绘暟閲�"
                     prop="quantity"
                     required
                     border-bottom>
         <up-input v-model="form.quantity"
                   type="number"
-                  placeholder="璇疯緭鍏ユ暟閲�"
+                  placeholder="璇疯緭鍏ユ�绘暟閲�"
                   :disabled="processQuantityDisabled" />
+      </up-form-item>
+      <up-form-item label="鍚堟牸鏁伴噺"
+                    prop="qualifiedQuantity"
+                    required
+                    border-bottom>
+        <up-input v-model="form.qualifiedQuantity"
+                  type="number"
+                  placeholder="璇疯緭鍏ュ悎鏍兼暟閲�"
+                  clearable />
+      </up-form-item>
+      <up-form-item label="涓嶅悎鏍兼暟閲�"
+                    prop="unqualifiedQuantity"
+                    required
+                    border-bottom>
+        <up-input v-model="form.unqualifiedQuantity"
+                  type="number"
+                  placeholder="璇疯緭鍏ヤ笉鍚堟牸鏁伴噺"
+                  clearable />
       </up-form-item>
       <up-form-item label="妫�娴嬪崟浣�"
                     prop="checkCompany"
@@ -82,19 +101,6 @@
         <up-input v-model="form.checkCompany"
                   placeholder="璇疯緭鍏ユ娴嬪崟浣�"
                   clearable />
-      </up-form-item>
-      <up-form-item label="妫�娴嬬粨鏋�"
-                    prop="checkResult"
-                    required
-                    border-bottom>
-        <up-input v-model="form.checkResult"
-                  placeholder="璇烽�夋嫨妫�娴嬬粨鏋�"
-                  readonly
-                  @click="showResultSheet" />
-        <template #right>
-          <up-icon @click="showResultSheet = true"
-                   name="arrow-right" />
-        </template>
       </up-form-item>
       <up-form-item label="妫�楠屽憳"
                     prop="checkName"
@@ -184,11 +190,15 @@
       </up-button>
     </view>
     <!-- 鏃ユ湡閫夋嫨鍣� -->
-    <up-popup v-model:show="showDate"
-              mode="date"
-              :start-year="2020"
-              :end-year="2030"
-              @confirm="confirmDate" />
+    <up-popup :show="showDate"
+              mode="bottom"
+              @close="showDate = false">
+      <up-datetime-picker :show="true"
+                          v-model="pickerValue"
+                          @confirm="confirmDate"
+                          @cancel="showDate = false"
+                          mode="date" />
+    </up-popup>
     <!-- 宸ュ簭閫夋嫨 -->
     <up-action-sheet :show="showprocessSheet"
                      :actions="processOptions"
@@ -207,12 +217,6 @@
                      @select="selectModel"
                      @close="showModelSheet = false"
                      title="閫夋嫨瑙勬牸鍨嬪彿" />
-    <!-- 妫�娴嬬粨鏋滈�夋嫨 -->
-    <up-action-sheet :show="showResultSheet"
-                     :actions="resultSheetOptions"
-                     @select="selectResult"
-                     @close="showResultSheet = false"
-                     title="閫夋嫨妫�娴嬬粨鏋�" />
     <!-- 妫�楠屽憳閫夋嫨 -->
     <up-action-sheet :show="showInspectorSheet"
                      :actions="userSheetOptions"
@@ -302,7 +306,7 @@
 
 <script setup>
   import { ref, computed, onMounted, nextTick } from "vue";
-  import { onShow } from "@dcloudio/uni-app";
+  import { onShow, onLoad } from "@dcloudio/uni-app";
   import PageHeader from "@/components/PageHeader.vue";
   import dayjs from "dayjs";
   import { getOptions } from "@/api/procurementManagement/procurementLedger.js";
@@ -313,8 +317,8 @@
     qualityInspectParamInfo,
     qualityInspectDetailByProductId,
     getQualityTestStandardParamByTestStandardId,
-    list,
   } from "@/api/qualityManagement/materialInspection.js";
+  import { getProcessList } from "@/api/productionManagement/processManagement.js";
   import { userListNoPage } from "@/api/system/user.js";
 
   // 鏄剧ず鎻愮ず淇℃伅
@@ -339,8 +343,6 @@
   const showProductTree = ref(false);
   // 瑙勬牸鍨嬪彿閫夋嫨
   const showModelSheet = ref(false);
-  // 妫�娴嬬粨鏋滈�夋嫨
-  const showResultSheet = ref(false);
   // 妫�楠屽憳閫夋嫨
   const showInspectorSheet = ref(false);
   // 鎸囨爣閫夋嫨
@@ -358,8 +360,9 @@
     testStandardId: "",
     unit: "",
     quantity: "",
+    qualifiedQuantity: "",
+    unqualifiedQuantity: "",
     checkCompany: "",
-    checkResult: "",
     productMainId: null,
     purchaseLedgerId: null,
   });
@@ -379,11 +382,6 @@
   const modelOptions = ref([]);
   // 妫�楠屽憳鍒楄〃
   const userList = ref([]);
-  // 妫�娴嬬粨鏋滈�夐」
-  const resultOptions = ref([
-    { label: "鍚堟牸", value: "鍚堟牸" },
-    { label: "涓嶅悎鏍�", value: "涓嶅悎鏍�" },
-  ]);
   // 鎸囨爣閫夐」
   const testStandardOptions = ref([]);
   // 褰撳墠浜у搧ID
@@ -411,13 +409,6 @@
     }));
   });
 
-  const resultSheetOptions = computed(() => {
-    return resultOptions.value.map(item => ({
-      name: item.label,
-      value: item.value,
-    }));
-  });
-
   const userSheetOptions = computed(() => {
     return userList.value.map(item => ({
       name: item.nickName,
@@ -442,19 +433,18 @@
       { required: true, message: "璇烽�夋嫨浜у搧鍨嬪彿", trigger: "change" },
     ],
     testStandardId: [
-      { required: false, message: "璇烽�夋嫨鎸囨爣", trigger: "change" },
+      { required: true, message: "璇烽�夋嫨鎸囨爣", trigger: "change" },
     ],
     unit: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
     quantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+    qualifiedQuantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+    unqualifiedQuantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
     checkCompany: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
-    checkResult: [
-      { required: true, message: "璇烽�夋嫨妫�娴嬬粨鏋�", trigger: "change" },
-    ],
   };
 
   // 鏄惁涓虹紪杈戞ā寮�
   const isEdit = computed(() => {
-    const id = getPageId();
+    const id = optionsId.value;
     return !!id;
   });
 
@@ -463,13 +453,6 @@
     const v = form.value || {};
     return !!(v.productMainId != null || v.purchaseLedgerId != null);
   });
-
-  // 鑾峰彇椤甸潰ID
-  const getPageId = () => {
-    const pages = getCurrentPages();
-    const currentPage = pages[pages.length - 1];
-    return currentPage.options.id;
-  };
 
   // 杩斿洖涓婁竴椤�
   const goBack = () => {
@@ -563,12 +546,6 @@
       modelOptions.value.find(item => item.id == value)?.unit || "";
   };
 
-  // 閫夋嫨妫�娴嬬粨鏋�
-  const selectResult = e => {
-    form.value.checkResult = e.value;
-    showResultSheet.value = false;
-  };
-
   // 閫夋嫨妫�楠屽憳
   const selectInspector = e => {
     form.value.checkName = e.value;
@@ -609,8 +586,8 @@
 
   // 鑾峰彇宸ュ簭鍒楄〃
   const getprocessList = () => {
-    list().then(res => {
-      processList.value = res.data;
+    getProcessList({ size: -1, current: -1 }).then(res => {
+      processList.value = res.data?.records || res.data || [];
     });
   };
 
@@ -691,22 +668,29 @@
         return;
       }
       if (!form.value.quantity) {
-        showToast("璇疯緭鍏ユ暟閲�");
+        showToast("璇疯緭鍏ユ�绘暟閲�");
+        return;
+      }
+      if (!form.value.qualifiedQuantity && form.value.qualifiedQuantity !== 0) {
+        showToast("璇疯緭鍏ュ悎鏍兼暟閲�");
+        return;
+      }
+      if (!form.value.unqualifiedQuantity && form.value.unqualifiedQuantity !== 0) {
+        showToast("璇疯緭鍏ヤ笉鍚堟牸鏁伴噺");
         return;
       }
       if (!form.value.productId) {
         showToast("璇烽�夋嫨浜у搧");
         return;
       }
-      if (!form.value.checkResult) {
-        showToast("璇烽�夋嫨妫�娴嬬粨鏋�");
+      if (!form.value.testStandardId) {
+        showToast("璇烽�夋嫨鎸囨爣");
         return;
       }
-
       loading.value = true;
 
       form.value.inspectType = 1;
-      if (isEdit.value) {
+      if (!isEdit.value) {
         tableData.value.forEach(item => {
           delete item.id;
         });
@@ -714,6 +698,8 @@
 
       const data = { ...form.value, qualityInspectParams: tableData.value };
       data.quantity = Number(data.quantity);
+      data.qualifiedQuantity = Number(data.qualifiedQuantity);
+      data.unqualifiedQuantity = Number(data.unqualifiedQuantity);
       if (isEdit.value) {
         const res = await qualityInspectUpdate(data);
         showToast("淇濆瓨鎴愬姛");
@@ -737,7 +723,7 @@
 
   // 鍒濆鍖栬〃鍗�
   const initForm = async () => {
-    const id = getPageId();
+    const id = optionsId.value;
     if (id) {
       // 缂栬緫妯″紡锛屽姞杞芥暟鎹�
       // 鍏堥噸缃〃鍗曟暟鎹�
@@ -753,7 +739,8 @@
         unit: "",
         quantity: "",
         checkCompany: "",
-        checkResult: "",
+        qualifiedQuantity: "",
+        unqualifiedQuantity: "",
         productMainId: null,
         purchaseLedgerId: null,
       };
@@ -775,7 +762,8 @@
         unit: "kg",
         quantity: 1000,
         checkCompany: "绗笁鏂规娴嬫満鏋�",
-        checkResult: "鍚堟牸",
+        qualifiedQuantity: 0,
+        unqualifiedQuantity: 0,
         productMainId: null,
         purchaseLedgerId: null,
       };
@@ -854,8 +842,9 @@
         testStandardId: "",
         unit: "",
         quantity: "",
+        qualifiedQuantity: "",
+        unqualifiedQuantity: "",
         checkCompany: "",
-        checkResult: "",
         productMainId: null,
         purchaseLedgerId: null,
       };
@@ -890,6 +879,11 @@
   onShow(() => {
     initForm();
   });
+  const optionsId = ref("");
+  onLoad(options => {
+    optionsId.value = options.id || "";
+    initForm();
+  });
 </script>
 
 <style scoped lang="scss">

--
Gitblit v1.9.3