Browse Source

选型优化

codeMan 6 months ago
parent
commit
22a6f4954c
1 changed files with 64 additions and 15 deletions
  1. 64 15
      src/optionSystem/selectOption/components/DieFa.vue

+ 64 - 15
src/optionSystem/selectOption/components/DieFa.vue

@@ -127,7 +127,7 @@
                     <MySelect :disabled="!excelParam.content.where.func"  @click="Search('excelParam','bodystructure')" :options="bodystructure" v-model="excelParam.content.where.bodystructure"></MySelect>
                 </div>
             </div>
-            <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>建议开关阀时间{{ caliber.filter(v=>v.value==resultArr[0].caliber).length ? caliber.filter(v=>v.value==resultArr[0].caliber)[0].remarks:'-' }}秒</div>
+            <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>建议开关阀时间{{ caliber.filter(v=>v.value==resultArr[0].caliber).length ? caliber.filter(v=>v.value==resultArr[0].caliber)[0].remarks.split(';')[0]:'-' }}秒</div>
             <!--执行器-->
             <div v-if="guangtouParam.content.where.drivetype=='电动'">
                 <MyTable fixedName="operation" :height="tableHeight" :noQuery="true" ref="excelRef" :layout="tool.tabelCol($route.name)['excelTable1'].tablecols" :param="excelParam" :custom="true" style="margin-top: 14px">
@@ -656,6 +656,9 @@ export default {
                 this.excelParam.content.where.flh = data.flh
                 this.excelParam.content.where.maxsquarewidth = data.maxsquarewidth
                 this.excelParam.content.where.maxrounddiameter = data.maxrounddiameter
+                if (this.guangtouParam.content.where.drivetype == '电动') {
+                    this.excelParam.content.where.caliber = this.resultArr[0].caliber
+                }
                 this.$nextTick(() => {
                     this.$refs.excelRef.listData(() => {
                         if (!this.$refs.excelRef.list.length) return
@@ -666,21 +669,67 @@ export default {
                 })
             this.active = 2
             } else if (type == '执行器') {
-                this.resultArr[1].itenname = this.resultArr[1].actuatorname
-                this.resultArr[1].itemno = this.resultArr[1].actuatorno
-
-                if (this.excelParam.content.where.drivetype == '气动调节') {
-                    this.fujianParam.content.othertypes = ['定位器','过滤减压阀']
-                } else {
-                    this.fujianParam.content.othertypes = ['电磁阀','限位开关','过滤减压阀']
-                }
-                data.itemid = data.actuatorid
-                data.itemname = data.actuatorname
-                if (this.guangtouParam.content.where.drivetype == '气动') {
-                    this.active = 3
-                    this.$refs.fujianRef.listData()
+                if (this.guangtouParam.content.where.drivetype == '电动') {
+                    let times = this.caliber.filter(v=>v.value==this.resultArr[0].caliber)[0].remarks.split(';')[0].split('-')
+                    if (parseInt(data.maxruntime) > parseInt(times[1]) || parseInt(data.maxruntime) < parseInt(times[0])) {
+                        this.$confirm(`当前选择执行器开关时间为${data.maxruntime}秒,超出建议值${times.join('-')},是否确认?`, "提示", {
+                            confirmButtonText: "确定",
+                            cancelButtonText: "取消",
+                            type: "warning",
+                        })
+                            .then(() => {
+                                this.resultArr[1].itenname = this.resultArr[1].actuatorname
+                                this.resultArr[1].itemno = this.resultArr[1].actuatorno
+                                if (this.excelParam.content.where.drivetype == '气动调节') {
+                                    this.fujianParam.content.othertypes = ['定位器','过滤减压阀']
+                                } else {
+                                    this.fujianParam.content.othertypes = ['电磁阀','限位开关','过滤减压阀']
+                                }
+                                data.itemid = data.actuatorid
+                                data.itemname = data.actuatorname
+                                if (this.guangtouParam.content.where.drivetype == '气动') {
+                                    this.active = 3
+                                    this.$refs.fujianRef.listData()
+                                } else {
+                                    this.active = 4
+                                }
+                            })
+                            .catch(() => {
+                                this.resultArr.pop()
+                            });
+                    } else {
+                        this.resultArr[1].itenname = this.resultArr[1].actuatorname
+                        this.resultArr[1].itemno = this.resultArr[1].actuatorno
+                        if (this.excelParam.content.where.drivetype == '气动调节') {
+                            this.fujianParam.content.othertypes = ['定位器','过滤减压阀']
+                        } else {
+                            this.fujianParam.content.othertypes = ['电磁阀','限位开关','过滤减压阀']
+                        }
+                        data.itemid = data.actuatorid
+                        data.itemname = data.actuatorname
+                        if (this.guangtouParam.content.where.drivetype == '气动') {
+                            this.active = 3
+                            this.$refs.fujianRef.listData()
+                        } else {
+                            this.active = 4
+                        }
+                    }
                 } else {
-                    this.active = 4
+                    this.resultArr[1].itenname = this.resultArr[1].actuatorname
+                    this.resultArr[1].itemno = this.resultArr[1].actuatorno
+                    if (this.excelParam.content.where.drivetype == '气动调节') {
+                        this.fujianParam.content.othertypes = ['定位器','过滤减压阀']
+                    } else {
+                        this.fujianParam.content.othertypes = ['电磁阀','限位开关','过滤减压阀']
+                    }
+                    data.itemid = data.actuatorid
+                    data.itemname = data.actuatorname
+                    if (this.guangtouParam.content.where.drivetype == '气动') {
+                        this.active = 3
+                        this.$refs.fujianRef.listData()
+                    } else {
+                        this.active = 4
+                    }
                 }
             } else {
                 if (this.fujianArr.filter(item=>item.itemid==data.itemid).length) return