Zimo пре 1 месец
родитељ
комит
c0ecb4fe9c
3 измењених фајлова са 40 додато и 4 уклоњено
  1. 1 1
      pages/recordFilling/detail.vue
  2. 15 3
      pages/ruiDu/create.vue
  3. 24 0
      pages/ruiyingx/components/form.vue

+ 1 - 1
pages/recordFilling/detail.vue

@@ -95,7 +95,7 @@
             (nosum) =>
               !keys.includes(nosum.description) &&
               (deptName === 'ry'
-                ? attrItem.description !== 'productionStatus'
+                ? nosum.description !== 'productionStatus'
                 : true)
           )">
           <!-- isCollection为1,提示:以下数值取自PLC,如有不符请修改 -->

+ 15 - 3
pages/ruiDu/create.vue

@@ -392,10 +392,22 @@ async function submitForm() {
       }
     }
 
-    await createIotRdDailyReport(form.value);
+    const res = await createIotRdDailyReport(form.value);
 
-    uni.showToast({ title: t("operation.success"), icon: "none" });
-    uni.navigateBack();
+    console.log("res", res);
+
+    if (res.code !== 0) {
+      uni.showToast({
+        title: res.msg || "提交失败",
+        icon: "none",
+      });
+      return;
+    } else {
+      uni.showToast({ title: t("operation.success"), icon: "none" });
+      setTimeout(() => {
+        uni.navigateBack();
+      }, 500);
+    }
   } catch (error) {
     console.error("提交表单失败", error);
   } finally {

+ 24 - 0
pages/ruiyingx/components/form.vue

@@ -49,6 +49,8 @@ const FORM_KEYS = [
   "totalStaffNum",
   "onDutyStaffNum",
   "leaveStaffNum",
+  "daySupervisors",
+  "nightSupervisors",
   "reportDetails",
   "constructionBrief",
   "remark",
@@ -80,6 +82,8 @@ const initFormData = () => {
     productionTime: 0,
     constructionBrief: "",
     reportDetails: [],
+    daySupervisors: "",
+    nightSupervisors: "",
   };
   // 初始化所有非生产时间字段为 0
   NON_PROD_FIELDS.forEach((field) => {
@@ -289,6 +293,12 @@ const rules = reactive({
       },
     ],
   },
+  daySupervisors: {
+    rules: [{ required: true, errorMessage: "请输入白班跟班干部" }],
+  },
+  nightSupervisors: {
+    rules: [{ required: true, errorMessage: "请输入夜班跟班干部" }],
+  },
 });
 
 const allTimeKeys = [
@@ -511,6 +521,20 @@ const reportDetailsTimeRange = (data) => {
           :disabled="disabled('edit')"
           v-model="form.leaveStaffNum" />
       </uni-forms-item>
+      <uni-forms-item label="白班跟班干部" name="daySupervisors" required>
+        <uni-easyinput
+          type="number"
+          v-bind="defaultProps"
+          :disabled="disabled('edit')"
+          v-model="form.daySupervisors" />
+      </uni-forms-item>
+      <uni-forms-item label="夜班跟班干部" name="nightSupervisors" required>
+        <uni-easyinput
+          type="number"
+          v-bind="defaultProps"
+          :disabled="disabled('edit')"
+          v-model="form.nightSupervisors" />
+      </uni-forms-item>
       <!-- <uni-forms-item label="生产动态" name="productionStatus" required>
         <uni-easyinput
           type="textarea"