From 45792b3776cda2e1ada31755ffc226a663f90b48 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 19 三月 2025 15:32:23 +0800
Subject: [PATCH] 锁屏功能

---
 src/views/business/inspectionOrder/add.vue |  275 ++++++++++++++++++++++++++----------------------------
 1 files changed, 133 insertions(+), 142 deletions(-)

diff --git a/src/views/business/inspectionOrder/add.vue b/src/views/business/inspectionOrder/add.vue
index ade64a8..1691fcb 100644
--- a/src/views/business/inspectionOrder/add.vue
+++ b/src/views/business/inspectionOrder/add.vue
@@ -1,9 +1,6 @@
 <template>
   <div class="bg-1">
-    <div
-      v-show="!configShow && !equipConfigShow && !cableConfigShow"
-      style="margin: 5px 15px"
-    >
+    <div style="margin: 5px 15px" v-show="!configShow && !equipConfigShow">
       <el-row class="title">
         <el-col :span="6"
           >濮旀墭鍗曚俊鎭�&nbsp;&nbsp;&nbsp;鎬讳环锛�<span style="color: #3a7bfa"
@@ -80,17 +77,14 @@
             v-show="active == 3 && addObj.companyId"
             >閫氳繃</el-button
           >
-          <el-button size="medium" @click="$router.go(-1)">
+          <el-button size="medium" @click="goBack">
             <span style="color: #3a7bfa">杩斿洖</span>
           </el-button>
         </el-col>
       </el-row>
     </div>
-    <basic-container>
-      <div
-        class="search"
-        v-show="!configShow && !equipConfigShow && !cableConfigShow"
-      >
+    <basic-container v-show="!configShow && !equipConfigShow">
+      <div class="search">
         <el-form
           :model="addObj"
           :rules="formRule"
@@ -395,7 +389,7 @@
     </basic-container>
     <div
       class="search"
-      v-if="active == 1"
+      v-if="active == 1 && !configShow && !equipConfigShow"
       style="display: flex; background: transparent"
     >
       <div style="display: flex; align-items: center">
@@ -443,7 +437,7 @@
         </div>
       </div>
     </div>
-    <basic-container>
+    <basic-container v-show="!configShow && !equipConfigShow">
       <div style="height: auto">
         <el-table
           class="el-table sampleTable"
@@ -909,104 +903,103 @@
     <el-dialog
       title="妫�楠屼笅鍙�"
       :visible.sync="issuedDialogVisible"
-      width="400px"
+      width="450px"
       :close-on-click-modal="false"
       :close-on-press-escape="false"
       :show-close="false"
     >
       <div class="body" style="max-height: 60vh">
-        <el-row>
-          <el-col class="search_thing" :span="22">
-            <div class="search_label">
-              <span class="required-span">* </span>绾﹀畾鏃堕棿锛�
-            </div>
-            <div class="search_input">
-              <el-date-picker
-                size="small"
-                v-model="distributeData.appointed"
-                :picker-options="pickerOptions"
-                type="date"
-                placeholder="閫夋嫨鏃ユ湡"
-                value-format="yyyy-MM-dd"
-                style="width: 100%"
-                format="yyyy-MM-dd"
-              >
-              </el-date-picker>
-            </div>
+        <el-row style="margin-bottom: 20px">
+          <el-col :span="8" style="text-align: right">
+            <div><span class="required-span">* </span>绾﹀畾鏃堕棿锛�</div>
           </el-col>
-          <el-col class="search_thing" :span="22">
-            <div class="search_label">
+          <el-col :span="16">
+            <el-date-picker
+              size="small"
+              v-model="distributeData.appointed"
+              :picker-options="{ disabledDate: this.disabledDate }"
+              type="date"
+              placeholder="閫夋嫨鏃ユ湡"
+              value-format="yyyy-MM-dd"
+              style="width: 100%"
+              format="yyyy-MM-dd"
+            >
+            </el-date-picker>
+          </el-col>
+        </el-row>
+        <el-row style="margin-bottom: 20px">
+          <el-col :span="8" style="text-align: right">
+            <div>
               <span class="required-span" v-if="addObj.type == 2">* </span
               >鎸囨淳浜哄憳锛�
             </div>
-            <div class="search_input">
-              <el-select
-                multiple
-                v-model="distributeData.userId"
-                placeholder="璇烽�夋嫨"
-                size="small"
-                filterable
-                style="width: 100%"
-                @change="changeUser"
-              >
-                <el-option-group
-                  v-for="(item, index) in Object.keys(personList)"
-                  :key="index"
-                  :label="item"
-                >
-                  <el-option
-                    v-for="op in personList[item]"
-                    :key="op.id"
-                    :label="op.name"
-                    :value="op.id"
-                  >
-                  </el-option>
-                </el-option-group>
-              </el-select>
-            </div>
           </el-col>
-          <el-col
-            class="search_thing"
-            :span="22"
-            v-if="distributeData.userId.length > 0"
-          >
-            <div class="search_label">
-              <span class="required-span">* </span>璇曢獙瀹わ細
-            </div>
-            <div class="search_input">
-              <el-select
-                v-model="distributeData.sonLaboratory"
-                placeholder="璇烽�夋嫨"
-                size="small"
-                filterable
-                style="width: 100%"
+          <el-col :span="16">
+            <el-select
+              multiple
+              v-model="distributeData.userId"
+              placeholder="璇烽�夋嫨"
+              size="small"
+              filterable
+              style="width: 100%"
+              @change="changeUser"
+            >
+              <el-option-group
+                v-for="(item, index) in Object.keys(personList)"
+                :key="index"
+                :label="item"
               >
                 <el-option
-                  v-for="item in sonLaboratoryList"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
+                  v-for="op in personList[item]"
+                  :key="op.id"
+                  :label="op.name"
+                  :value="op.id"
                 >
                 </el-option>
-              </el-select>
-            </div>
+              </el-option-group>
+            </el-select>
           </el-col>
-          <el-col class="search_thing" :span="22">
-            <div class="search_label">
-              <span class="required-span">* </span>鍒涘缓濮旀墭鍗曪細
-            </div>
-            <div class="search_input">
-              <el-select
-                v-model="distributeData.isCreate"
-                placeholder="璇烽�夋嫨"
-                size="small"
-                filterable
-                style="width: 100%"
+        </el-row>
+        <el-row
+          v-if="distributeData.userId.length > 0"
+          style="margin-bottom: 20px"
+        >
+          <el-col :span="8" style="text-align: right">
+            <div><span class="required-span">* </span>璇曢獙瀹わ細</div>
+          </el-col>
+          <el-col :span="16">
+            <el-select
+              v-model="distributeData.sonLaboratory"
+              placeholder="璇烽�夋嫨"
+              size="small"
+              filterable
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in sonLaboratoryList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
               >
-                <el-option label="鏄�" :value="true"></el-option>
-                <el-option label="鍚�" :value="false"></el-option>
-              </el-select>
-            </div>
+              </el-option>
+            </el-select>
+          </el-col>
+        </el-row>
+        <el-row style="margin-bottom: 20px">
+          <el-col :span="8" style="text-align: right">
+            <div><span class="required-span">* </span>鍒涘缓濮旀墭鍗曪細</div>
+          </el-col>
+          <el-col :span="16">
+            <el-select
+              v-model="distributeData.isCreate"
+              placeholder="璇烽�夋嫨"
+              size="small"
+              filterable
+              style="width: 100%"
+            >
+              <el-option label="鏄�" :value="true"></el-option>
+              <el-option label="鍚�" :value="false"></el-option>
+            </el-select>
           </el-col>
         </el-row>
       </div>
@@ -1022,17 +1015,15 @@
     <el-dialog title="涓嶉�氳繃鍘熷洜" :visible.sync="noDialogVisible" width="400px">
       <div class="body" style="max-height: 60vh">
         <el-row>
-          <el-col class="search_thing" :span="22">
-            <div class="search_label">
-              <span class="required-span">* </span>涓嶉�氳繃鍘熷洜锛�
-            </div>
-            <div class="search_input">
-              <el-input
-                v-model="tell"
-                size="small"
-                placeholder="璇疯緭鍏ヤ笉閫氳繃鍘熷洜"
-              ></el-input>
-            </div>
+          <el-col :span="8" style="text-align: right">
+            <div><span class="required-span">* </span>涓嶉�氳繃鍘熷洜锛�</div>
+          </el-col>
+          <el-col :span="16">
+            <el-input
+              v-model="tell"
+              size="small"
+              placeholder="璇疯緭鍏ヤ笉閫氳繃鍘熷洜"
+            ></el-input>
           </el-col>
         </el-row>
       </div>
@@ -1055,7 +1046,7 @@
       :active="active"
       :inspectionItemST="inspectionItemST"
     />
-    <fiberOpticConfigTwo
+    <fiberOpticConfigReadOnly
       :currentId="currentId"
       v-if="configShow && examine == 1"
       :active="active"
@@ -1065,7 +1056,6 @@
       v-if="equipConfigShow"
       :active="active"
     />
-    <cableConfig v-if="cableConfigShow" :active="active" />
     <!--    鍗曢�夌壒娈婂�煎鐞嗘-->
     <el-dialog
       title="妫�娴嬪埌鐗规畩椤癸紝璇蜂綔鍑轰互涓嬮�夋嫨"
@@ -1572,16 +1562,15 @@
 import fiberOpticConfig from "./fiberoptic-config.vue";
 import fiberOpticConfigReadOnly from "./fiberoptic-config-readonly.vue";
 import equipConfig from "./equip-config.vue";
-import cableConfig from "./cable-config.vue";
 import getLodop from "@/utils/lodop";
 import { bigEval } from "@/utils/bigEval";
 import { getDicts } from "@/api/system/dict/data";
+import Big from "big.js";
 export default {
   components: {
     fiberOpticConfig,
     fiberOpticConfigReadOnly,
     equipConfig,
-    cableConfig,
   },
   computed: {
     ...mapGetters(["nickName", "loginUserInfo"]),
@@ -1593,14 +1582,6 @@
       examine: 0,
       active: 0,
       currentId: 0,
-      pickerOptions: {
-        disabledDate(time) {
-          // 褰撳墠鏃堕棿鍔犱笂涓夊ぉ鐨勬椂闂存埑
-          const threeDaysLater = Date.now() + 24 * 60 * 60 * 1000;
-          // 绂佺敤涓夊ぉ鍚庝箣鍓嶇殑鎵�鏈夋棩鏈�
-          return time.getTime() < threeDaysLater;
-        },
-      },
       fiberLoss: [],
       qrDataList: [],
       isFocus: false,
@@ -1769,7 +1750,6 @@
       bsm1Dia: false,
       bsm1DiaAll: false,
       equipConfigShow: false,
-      cableConfigShow: false,
       bsm2: false,
       bsm2Val: null,
       bsm2Dia: false,
@@ -1887,7 +1867,7 @@
     },
   },
   created() {
-    this.active = this.$route.query.active;
+    this.active = Number(this.$route.query.active);
     this.currentId = this.$route.query.currentId;
     this.examine = this.$route.query.examine;
     this.isReview = this.$route.query.isReview;
@@ -1934,6 +1914,21 @@
     }
   },
   methods: {
+    goBack() {
+      let path = this.$route.query.isPlan
+        ? "/business/inspectionTask"
+        : "/business/inspectionOrder";
+      this.$router.push(path);
+    },
+    //涓嬫鏍告煡鏃ユ湡:绂佺敤鍦ㄦ牳鏌ユ棩鏈熷墠鐨勬棩鏈�
+    disabledDate(time) {
+      if (time) {
+        let now = new Date();
+        now.setHours(0, 0, 0, 0);
+        return time < now.getTime();
+      }
+      return false;
+    },
     changeType(type) {
       this.hasSendUrgentOrder(type)
         .then((res) => {
@@ -2458,10 +2453,9 @@
           let arr1 = [];
           arr0.forEach((m) => {
             let index = code.findIndex((b) => m.includes(b));
-            // console.log("index--銆�", index);
             if (index > -1) {
               let arr = m.split(code[index]).filter((b) => !!b);
-              let calcNum = this.$Big(
+              let calcNum = new Big(
                 bigEval(this.replaceAll(arr[0], symbolItem, value))
               );
               let num = calcNum.toFixed(
@@ -2480,7 +2474,7 @@
           if (index > -1) {
             let arr = ask.split(code[index]).filter((b) => !!b);
             console.log("鐗规畩鍊兼浛鎹�--銆�", arr);
-            let calcNum = this.$Big(
+            let calcNum = new Big(
               bigEval(this.replaceAll(arr[0], symbolItem, value))
             );
             let num = calcNum.toFixed(
@@ -3324,6 +3318,20 @@
           b.id = null;
           delete b.bsmRow;
         });
+        if (a.bushing && a.bushing.length > 0) {
+          a.bushing.forEach((b) => {
+            b.fiber.forEach((c) => {
+              c.productList.forEach((d) => {
+                d.id = null;
+              });
+            });
+            b.fibers.forEach((c) => {
+              c.productList.forEach((d) => {
+                d.id = null;
+              });
+            });
+          });
+        }
       });
       this.editTable.forEach((item) => {
         sampleList.forEach((a) => {
@@ -3358,7 +3366,7 @@
           if (res.code === 200) {
             this.$message.success("宸叉彁浜�");
             this.bsm3Dia = false;
-            this.$router.go(-1);
+            this.goBack();
           }
           this.saveLoad = false;
         })
@@ -3369,7 +3377,6 @@
     },
     upInsOrderOfState(state) {
       if (state == 1) {
-        //this.saveLoad = true
         this.issuedDialogVisible = true;
         selectOrderManDay({
           id: this.currentId,
@@ -3378,7 +3385,6 @@
             if (res.code === 200) {
               this.distributeData.orderId = this.currentId;
               this.distributeData.appointed = res.data;
-              console.log("绾﹀畾鏃堕棿", this.distributeData.appointed);
             }
           })
           .catch((error) => {
@@ -3530,7 +3536,7 @@
                 this.$message.success("鎻愪氦鎴愬姛");
                 this.issuedDialogVisible = false;
                 this.upLoad = false;
-                this.$router.go(-1);
+                this.goBack();
                 //瀹℃牳閫氳繃鍚庯紝鑷姩鎵撳嵃浜岀淮鐮�
                 //TODO: 鐢靛姏璇曢獙瀹ゆ殏鏃朵笉鐢ㄦ爣绛炬墦鍗�
                 if (
@@ -3808,7 +3814,6 @@
       val.forEach((a) => {
         this.productIds.push(a.id);
       });
-      console.log("selectChange", this.sampleList);
     },
     rowClick(row, column, event) {
       this.currentMethod = row;
@@ -4622,7 +4627,7 @@
             this.tell = "";
             this.$message.success("鎻愪氦鎴愬姛");
             this.issuedDialogVisible = false;
-            this.$router.go(-1);
+            this.goBack();
           }
         })
         .catch((error) => {
@@ -4695,20 +4700,6 @@
           return;
         }
         this.equipConfigShow = true;
-      } else {
-        if (this.sampleId === null) {
-          this.$message.error("鏈�変腑鏍峰搧");
-          return;
-        }
-      }
-    },
-    openCableConfig() {
-      if (this.active === 1) {
-        if (this.sampleIds.length === 0) {
-          this.$message.error("鏈�夋嫨鏍峰搧");
-          return;
-        }
-        this.cableConfigShow = true;
       } else {
         if (this.sampleId === null) {
           this.$message.error("鏈�変腑鏍峰搧");

--
Gitblit v1.9.3