Просмотр исходного кода

Merge branch 'testOptionSystem' into allTestUrgent

qymljy 4 месяцев назад
Родитель
Сommit
6a971d059d

+ 60 - 16
src/optionSystem/optionOrder/detail/modules/components/DieFa.vue

@@ -523,20 +523,31 @@
             ></MySelect>
           </div>
         </div>
-        <div
-          class="tips"
-          v-if="guangtouParam.content.where.drivetype == '电动' && resultArr[0]"
-          style="color: #3874f6; margin-top: 10px"
-        >
-          <i class="el-icon-warning" style="margin-right: 5px"></i
-          >{{ $t("建议开关阀时间")
-          }}{{
-            caliber.filter((v) => v.value == resultArr[0].caliber).length
-              ? caliber
-                  .filter((v) => v.value == resultArr[0].caliber)[0]
-                  .remarks.split(";")[0]
-              : "-"
-          }}{{ $t("秒") }}
+
+        <div style="display: flex;justify-content: left;margin-top: 10px">
+          <div
+              class="tips"
+              v-if="
+            guangtouParam.content.where.drivetype == '电动' && resultArr.length
+          "
+              style="color: #3874f6;margin-top: 2px"
+          >
+            <i class="el-icon-warning" style="margin-right: 5px"></i
+            >{{ $t("建议开关阀时间")
+            }}{{
+              caliber.filter((v) => v.value == resultArr[0].caliber).length
+                  ? caliber
+                      .filter((v) => v.value == resultArr[0].caliber)[0]
+                      .remarks.split(";")[0]
+                  : "-"
+            }}{{ $t("秒") }}
+          </div>
+          <div style="margin-left: 20px;display: flex;justify-content: left">
+            <div class="label" style="margin-top:2px;">{{$t(`开关阀安全时间:`)}}</div>
+            <el-input style="width: 160px;margin-right: 10px" size="small" v-model="mintime" :placeholder="$t(`开关阀安全时间`)"></el-input> -
+            <el-input style="width: 160px;margin-left: 10px" size="small" v-model="maxtime" :placeholder="$t(`开关阀安全时间`)"></el-input>
+          </div>
+          <el-button type="primary" style="margin-left: 10px" size="small" @click="Search('excelParam')">{{$t(`查询`)}}</el-button>
         </div>
 
         <!--执行器-->
@@ -775,6 +786,8 @@ export default {
             actuatorsignal: "",
             maxsquarewidth: "", //方阀杆最大宽度
             maxrounddiameter: "", //圆阀杆最大直径
+            mintime:"",
+            maxtime:""
           },
         },
       },
@@ -794,6 +807,21 @@ export default {
       },
       timer: null,
       product: {},
+      /*开关阀时间*/
+      dateDefault:{
+        id: 20220901092501,
+        content: {
+          optiontypeid: 115, //光头id
+          pageNumber: 1,
+          pageSize: 9999999,
+          where: {
+            condition: "",
+          },
+        },
+      },
+      diameter:'',
+      mintime:"",
+      maxtime:""
     };
   },
   watch: {
@@ -814,7 +842,6 @@ export default {
     },
   },
   methods: {
-    stepsChange() {},
     init() {
       this.guangtouChange(this.data.filter.mainvalve.drivetype);
 
@@ -877,6 +904,7 @@ export default {
     },
     //搜索
     Search(type, position, init) {
+
       if (!init) this.isEdit = true;
       let index = 0;
       let whereKeys = Object.keys(this[type].content.where);
@@ -899,7 +927,9 @@ export default {
             whereKeys[i].indexOf("drivetype") != -1
           )
             continue;
-          this[type].content.where[whereKeys[i]] = "";
+          this[type].content.where[whereKeys[i]] = ""
+          this.excelParam.content.where.mintime = this.mintime
+          this.excelParam.content.where.maxtime = this.maxtime
         }
       }
       switch (type) {
@@ -1105,6 +1135,7 @@ export default {
       this.isEdit = true;
       data.parttype = type;
       if (type == "主阀") {
+        this.queryDefaultDate(data)
         this.resultArr[0] = data;
 
         if (
@@ -1250,6 +1281,19 @@ export default {
         { remarks: "气动", value: "气动" },
       ];
     },
+    async queryDefaultDate(val){
+      const res = await this.$api.requested(this.dateDefault)
+      res.data.forEach(e=>{
+        if (e.value == val.caliber){
+          this.diameter = e
+        }
+      })
+      let newDiameter = this.diameter.remarks.split(';')
+      let diameter = newDiameter[1].split('-')
+      this.mintime = diameter[0]
+      this.maxtime = diameter[1]
+
+    }
   },
   created() {
     this.optionsList();

+ 55 - 14
src/optionSystem/selectOption/components/DieFa.vue

@@ -335,22 +335,30 @@
             ></MySelect>
           </div>
         </div>
-        <div
-          class="tips"
-          v-if="
+        <div style="display: flex;justify-content: left;margin-top: 10px">
+          <div
+              class="tips"
+              v-if="
             guangtouParam.content.where.drivetype == '电动' && resultArr.length
           "
-          style="color: #3874f6; margin-top: 10px"
-        >
-          <i class="el-icon-warning" style="margin-right: 5px"></i
-          >{{ $t("建议开关阀时间")
-          }}{{
-            caliber.filter((v) => v.value == resultArr[0].caliber).length
-              ? caliber
-                  .filter((v) => v.value == resultArr[0].caliber)[0]
-                  .remarks.split(";")[0]
-              : "-"
-          }}{{ $t("秒") }}
+              style="color: #3874f6;margin-top: 2px"
+          >
+            <i class="el-icon-warning" style="margin-right: 5px"></i
+            >{{ $t("建议开关阀时间")
+            }}{{
+              caliber.filter((v) => v.value == resultArr[0].caliber).length
+                  ? caliber
+                      .filter((v) => v.value == resultArr[0].caliber)[0]
+                      .remarks.split(";")[0]
+                  : "-"
+            }}{{ $t("秒") }}
+          </div>
+          <div style="margin-left: 20px;display: flex;justify-content: left">
+            <div class="label" style="margin-top:2px;">{{$t(`开关阀安全时间:`)}}</div>
+            <el-input style="width: 160px;margin-right: 10px" size="small" v-model="mintime" :placeholder="$t(`开关阀安全时间`)"></el-input> -
+            <el-input style="width: 160px;margin-left: 10px" size="small" v-model="maxtime" :placeholder="$t(`开关阀安全时间`)"></el-input>
+          </div>
+          <el-button type="primary" style="margin-left: 10px" size="small" @click="Search('excelParam')">{{$t(`查询`)}}</el-button>
         </div>
         <!--执行器-->
         <div v-if="guangtouParam.content.where.drivetype == '电动'">
@@ -866,6 +874,8 @@ export default {
             actuatorsignal: "",
             maxsquarewidth: "", //方阀杆最大宽度
             maxrounddiameter: "", //圆阀杆最大直径
+            mintime:"",
+            maxtime:""
           },
         },
       },
@@ -885,6 +895,21 @@ export default {
       },
       timer: null,
       product: {},
+      /*开关阀时间*/
+      dateDefault:{
+        id: 20220901092501,
+        content: {
+          optiontypeid: 115, //光头id
+          pageNumber: 1,
+          pageSize: 9999999,
+          where: {
+            condition: "",
+          },
+        },
+      },
+      diameter:'',
+      mintime:"",
+      maxtime:""
     };
   },
   watch: {
@@ -998,6 +1023,8 @@ export default {
           )
             continue;
           this[type].content.where[whereKeys[i]] = "";
+          this.excelParam.content.where.mintime = this.mintime
+          this.excelParam.content.where.maxtime = this.maxtime
         }
       }
       switch (type) {
@@ -1212,6 +1239,7 @@ export default {
       data.parttype = type;
       this.resultArr.push(data);
       if (type == "主阀") {
+        this.queryDefaultDate(data)
         this.guangtouChange(this.guangtouParam.content.where.drivetype);
         this.excelParam.content.itemid = data.itemid;
         this.excelParam.content.where.torque = data.torque;
@@ -1399,6 +1427,19 @@ export default {
         console.log(this.func, "功能");
       });
     },
+    async queryDefaultDate(val){
+      const res = await this.$api.requested(this.dateDefault)
+      res.data.forEach(e=>{
+        if (e.value == val.caliber){
+          this.diameter = e
+        }
+      })
+      let newDiameter = this.diameter.remarks.split(';')
+      let diameter = newDiameter[1].split('-')
+      this.mintime = diameter[0]
+      this.maxtime = diameter[1]
+
+    }
   },
   created() {
     this.optionsList();

+ 4 - 4
src/optionSystem/selectOption/components/DieFaModel.vue

@@ -988,8 +988,7 @@ export default {
     },
     //搜索
     Search(type, position) {
-      this.excelParam.content.where.mintime = this.mintime
-      this.excelParam.content.where.maxtime = this.maxtime
+
       let index = 0;
       let whereKeys = Object.keys(this[type].content.where);
       if (position) {
@@ -1008,11 +1007,12 @@ export default {
             whereKeys[i].indexOf("maxrounddiameter") != -1 ||
             whereKeys[i].indexOf("maxsquarewidth") != -1 ||
             whereKeys[i].indexOf("torque") != -1 ||
-            whereKeys[i].indexOf("drivetype") != -1 || whereKeys[i].indexOf('caliber') != -1 ||
-            whereKeys[i].indexOf("mintime") != -1 || whereKeys[i].indexOf('maxtime') != -1
+            whereKeys[i].indexOf("drivetype") != -1 || whereKeys[i].indexOf('caliber') != -1
           )
             continue;
           this[type].content.where[whereKeys[i]] = "";
+          this.excelParam.content.where.mintime = this.mintime
+          this.excelParam.content.where.maxtime = this.maxtime
         }
       }
       switch (type) {

+ 4 - 6
src/optionSystem/valveOption/DieFa.vue

@@ -1296,8 +1296,6 @@ export default {
     },
     //搜索
     Search(type, position) {
-      this.excelParam.content.where.mintime = this.mintime
-      this.excelParam.content.where.maxtime = this.maxtime
       let index = 0;
       let whereKeys = Object.keys(this[type].content.where);
       if (position) {
@@ -1316,12 +1314,12 @@ export default {
             whereKeys[i].includes("maxrounddiameter") ||
             whereKeys[i].includes("maxsquarewidth") ||
             whereKeys[i].includes("torque") ||
-            whereKeys[i].includes("drivetype") ||
-            whereKeys[i].includes("mintime") ||
-            whereKeys[i].includes("maxtime")
+            whereKeys[i].includes("drivetype")
           )
             continue;
-          this[type].content.where[whereKeys[i]] = "";
+          this[type].content.where[whereKeys[i]] = ""
+          this.excelParam.content.where.mintime = this.mintime
+          this.excelParam.content.where.maxtime = this.maxtime
         }
       }
       if (this.loading) return;