Browse Source

fix-一键开门

LAPTOP-U5GOA5HA\zz 1 year ago
parent
commit
3763c79773

+ 1 - 0
.gitignore

@@ -22,3 +22,4 @@ yarn-error.log*
 package-lock.json
 yarn.lock
 dist.zip
+ljclw.zip

+ 44 - 15
src/views/clw/KeyCase/modules/Configuration.vue

@@ -3,10 +3,15 @@
     <a-divider orientation="left">
       <b>{{ formTitle }}</b>
     </a-divider>
-    <span style="margin-right: 8px; margin-left: 22px">用车时间结束前</span>
-    <a-input-number id="inputNumber" v-model="valueNum" :min="1" :max="1000" @change="onChange" />
-    <!-- {{ valueNum }} -->
-    <span style="margin-left: 10px">分钟</span>
+    <div>
+      <span style="margin-right: 8px; margin-left: 22px">用车时间结束前</span>
+      <a-input-number id="inputNumber" v-model="valueNum" :min="1" :max="1000" @change="onChange" />
+      <!-- {{ valueNum }} -->
+      <span style="margin-left: 10px">分钟</span>
+    </div>
+    <div>
+      <span>是否确认打开全部箱门</span>
+    </div>
     <div slot="footer">
       <a-button type="primary" @click="handleEdit">确定</a-button>
       <a-button @click="onClose">取消</a-button>
@@ -15,9 +20,12 @@
 </template>
 
 <script>
-import { getWarn } from '@/api/keys'
+import { getWarn, getOpenAll } from '@/api/keys'
 export default {
   components: {},
+  props: {
+    showNum: Number,
+  },
   data() {
     return {
       submitLoading: false,
@@ -30,7 +38,19 @@ export default {
   filters: {},
   created() {},
   computed: {},
-  watch: {},
+  watch: {
+    showNum: {
+      handler(val) {
+        if (val == 1) {
+          this.formTitle = '自动归还提示配置'
+        } else if (val == 2) {
+          this.formTitle = '一键开箱'
+        }
+      },
+      deep: true,
+    //   immediate: true,
+    },
+  },
   mounted() {},
   methods: {
     onClose() {
@@ -38,16 +58,25 @@ export default {
     },
     /** 提交按钮 */
     handleEdit() {
-      const params = {
-        remindId: 4,
-        threshold: this.valueNum,
-      }
-      getWarn(params).then((res) => {
-        if (res.code == 200) {
-          this.$message.success('配置成功')
-          this.onClose()
+      if (this.showNum == 1) {
+        const params = {
+          remindId: 4,
+          threshold: this.valueNum,
         }
-      })
+        getWarn(params).then((res) => {
+          if (res.code == 200) {
+            this.$message.success('配置成功')
+            this.onClose()
+          }
+        })
+      } else if (this.showNum == 2) {
+        getOpenAll().then((res) => {
+          if (res.code == 200) {
+            this.$message.success('开箱成功')
+          }
+          this.funKeyList()
+        })
+      }
     },
     onChange(val) {
       this.valueNum = val

+ 6 - 15
src/views/clw/KeyCase/modules/KeyBox.vue

@@ -85,8 +85,8 @@
         </div>
       </div>
       <div class="imgs">
-        <img style="cursor: pointer;" @click="OpenBox" src="../../../../assets/vehicle/yjkm.png" alt="" />
-        <img style="cursor: pointer;" @click="openConfig" src="../../../../assets/vehicle/zdpz.png" alt="" />
+        <img style="cursor: pointer;" @click="openConfig(1)" src="../../../../assets/vehicle/yjkm.png" alt="" />
+        <img style="cursor: pointer;" @click="openConfig(2)" src="../../../../assets/vehicle/zdpz.png" alt="" />
       </div>
     </div>
     <OpenCabinet ref="openCa" :formType="formType" @add="addCabinText" />
@@ -95,7 +95,7 @@
 </template>
 
 <script>
-import { KeyCaseList, getOpenOne, getRepairSuccess, getRepair, getCarBind, getUnbind,Reminder,getOpenAll } from '@/api/keys.js'
+import { KeyCaseList, getOpenOne, getRepairSuccess, getRepair, getCarBind, getUnbind,Reminder } from '@/api/keys.js'
 import OpenCabinet from './OpenCabinet.vue'
 import Configuration from './Configuration.vue'
 export default {
@@ -105,6 +105,7 @@ export default {
       keyList: [],
       visible: Array.from({ length: 30 }).map((item) => false),
       formType: 1,
+      showNum:1
     }
   },
   dicts:['key_status'],
@@ -185,22 +186,12 @@ export default {
       this.visible = true
     },
     confirm() {},
-    openConfig(){
+    openConfig(num){
+      this.showNum=num
       this.$refs.opemModul.visible = true
     },
-    OpenBox(){
-      getOpenAll().then(res=>{
-        if(res.code==200){
-          this.$message.success('开箱成功')
-        }
-        this.funKeyList()
-      })
-    }
   },
   created() {
-    // for(let i = 1; i <= 30; i++) {
-    //   this.$set(`visible${i}`, false)
-    // }
     this.funKeyList()
   },
 }