lilei 4 tahun lalu
induk
melakukan
908c551bca
2 mengubah file dengan 11 tambahan dan 3 penghapusan
  1. 1 1
      src/utils/request.js
  2. 10 2
      src/views/equipmentManage/boxSetting/AddBoxModal.vue

+ 1 - 1
src/utils/request.js

@@ -49,7 +49,7 @@ service.interceptors.request.use(config => {
 service.interceptors.response.use((response) => {
 service.interceptors.response.use((response) => {
   console.log(response, 'response.data.status')
   console.log(response, 'response.data.status')
   if (window.location.pathname != '/user/login') {
   if (window.location.pathname != '/user/login') {
-    if (response.data.status == '500') {
+    if (response.data.status == '500' || response.data.status == '900') {
       notification.destroy()
       notification.destroy()
       notification.error({
       notification.error({
         message: '提示',
         message: '提示',

+ 10 - 2
src/views/equipmentManage/boxSetting/AddBoxModal.vue

@@ -37,7 +37,13 @@
           </v-select>
           </v-select>
         </a-form-model-item>
         </a-form-model-item>
         <!-- 箱体限投 -->
         <!-- 箱体限投 -->
-        <a-row type="flex" align="middle" v-for="(item, index) in formData.deviceTypeBoxList" :key="index">
+        <a-row
+          type="flex"
+          align="middle"
+          v-for="(item, index) in formData.deviceTypeBoxList"
+          :key="index"
+          v-if="formData.deviceTypeBoxList.length"
+        >
           <a-col span="12">
           <a-col span="12">
             <!-- 投放开始时间 -->
             <!-- 投放开始时间 -->
             <a-form-model-item
             <a-form-model-item
@@ -146,12 +152,14 @@ export default {
     // 内置箱体选择修改
     // 内置箱体选择修改
     handleNumChange (v) {
     handleNumChange (v) {
       console.log(v, 'vvvvvvvvvv')
       console.log(v, 'vvvvvvvvvv')
+      this.formData.deviceTypeBoxList = []
       for (let i = 0; i < v; i++) {
       for (let i = 0; i < v; i++) {
         this.formData.deviceTypeBoxList.push({
         this.formData.deviceTypeBoxList.push({
           maxWeight: '',
           maxWeight: '',
           rubbishType: ''
           rubbishType: ''
         })
         })
       }
       }
+      this.$refs.ruleForm.clearValidate()
     },
     },
     // 查详情
     // 查详情
     getDetailData (id) {
     getDetailData (id) {
@@ -201,7 +209,7 @@ export default {
       this.$emit('close')
       this.$emit('close')
     },
     },
     clear () {
     clear () {
-      this.$refs.ruleForm.resetFields()
+      this.$refs.ruleForm.clearValidate()
       this.formData.name = ''
       this.formData.name = ''
       this.formData.boxNum = ''
       this.formData.boxNum = ''
       this.formData.deviceTypeBoxList = []
       this.formData.deviceTypeBoxList = []