Browse Source

合并,优化账号得推送、绑定区域

hjs 1 year ago
parent
commit
a3de515f7d
3 changed files with 32 additions and 11 deletions
  1. BIN
      back.rar
  2. 14 2
      src/views/basic_setup/index.vue
  3. 18 9
      src/views/user_manage/index.vue

BIN
back.rar


+ 14 - 2
src/views/basic_setup/index.vue

@@ -264,6 +264,7 @@
             class="form-item-style"
             style="margin-left:60px;width:450px;flex:none;"
             :prop="`clockWayPushInterfaceAddresses.${index}.zoneId`"
+            :rules="{ required: true, type: 'number', message: '绑定区域不能为空', trigger: ['change', 'blur'], validator: zoneRule }"
           >
             <el-select
               v-model="clockWayItem.zoneId"
@@ -674,6 +675,7 @@ export default {
         // 打卡方式-通用 [{"interfAddr":"三方接口地址","punchReportFields":"打卡上报字段, 多个逗号分割","zoneId":"所在区域ID"}]
         clockWayPushInterfaceAddresses: [{
           interfAddr: null,
+          punchReportFields: null,
           zoneId: null
         }],
         openThirdLinkPlatform: false,
@@ -833,6 +835,7 @@ export default {
             this.user_form.clockWayPushInterfaceAddresses = this.user_form.clockWayPushInterfaceAddresses.map(item => {
               return {
                 interfAddr: item.interfAddr,
+                punchReportFields: item.punchReportFields,
                 zoneId: item.zoneId
               }
             })
@@ -840,6 +843,7 @@ export default {
             this.user_form.clockWayPushInterfaceAddresses = []
             this.user_form.clockWayPushInterfaceAddresses.push({
               interfAddr: null,
+              punchReportFields: null,
               zoneId: null
             })
           }
@@ -912,9 +916,16 @@ export default {
     addCheckWayInterfaceAddress() {
       this.user_form.clockWayPushInterfaceAddresses.push({
         interfAddr: null,
+        punchReportFields: null,
         zoneId: null
       })
     },
+    zoneRule(rule, value, callback) {
+      if (value != null && value != undefined) {
+        return callback()
+      }
+      return callback('绑定区域不能为空!')
+    },
     // 修改
     updateAdmin() {
       if (this.submitLoading) {
@@ -940,7 +951,7 @@ export default {
           }
           if (this.user_form.clockWayPushInterfaceAddresses && this.user_form.clockWayPushInterfaceAddresses.length > 0) {
             this.user_form.clockWayPushInterfaceAddresses = this.user_form.clockWayPushInterfaceAddresses.filter(item => {
-              return item.interfAddr !== null && item.zoneId !== null
+              return item.zoneId !== null
             })
             if (this.user_form.clockWayPushInterfaceAddresses.length <= 0) {
               this.user_form.clockWayPushInterfaceAddresses = null
@@ -948,6 +959,7 @@ export default {
               this.user_form.clockWayPushInterfaceAddresses = this.user_form.clockWayPushInterfaceAddresses.map(item => {
                 return {
                   interfAddr: item.interfAddr,
+                  punchReportFields: item.punchReportFields,
                   zoneId: item.zoneId
                 }
               })
@@ -1189,7 +1201,7 @@ export default {
   border-bottom: none;
 }
 .interfaceAddress-layout {
-  width: 1155px;
+  width: 1160px;
   padding: 0 10px;
   border: 1px solid #D6EAFF;
   border-radius: 6px;

+ 18 - 9
src/views/user_manage/index.vue

@@ -356,7 +356,7 @@
     <el-dialog
       :title="dialogTitle[dialogType]"
       :visible.sync="dialogVisible"
-      width="1100px"
+      width="1200px"
       :close-on-click-modal="false"
     >
       <el-form
@@ -1337,7 +1337,7 @@
                 label-width="78px"
                 :label="`推送地址${index+1}`"
                 class="form-item-style"
-                style="width: 400px;flex:none;"
+                style="width: 390px;flex:none;"
                 :prop="`clockWayPushInterfaceAddresses.${index}.interfAddr`"
               >
                 <el-input
@@ -1373,11 +1373,14 @@
               </el-form-item>
               <el-form-item
                 label-width="78px"
+                label-position="right"
+                label="绑定区域"
                 class="form-item-style"
-                style="margin-left:10px;width:309px;flex:none;"
+                style="margin-left:13px;width:309px;flex:none;"
                 :prop="`clockWayPushInterfaceAddresses.${index}.zoneId`"
+                :rules="{ required: true, type: 'number', message: '绑定区域不能为空', trigger: ['change', 'blur'], validator: zoneRule }"
               >
-                <div slot="label" style="text-align: right;">绑定区域</div>
+                <!-- <div slot="label" style="text-align: right;">绑定区域</div> -->
                 <el-select
                   v-model="clockWayItem.zoneId"
                   filterable
@@ -2512,6 +2515,12 @@ export default {
       }
       return callback("推送字段不能为空!");
     },
+    zoneRule(rule, value, callback) {
+      if (value != null && value != undefined) {
+        return callback();
+      }
+      return callback("绑定区域不能为空!");
+    },
     // 获取区域列表
     getPlatformList(adminId) {
       getAreaList({ adminId }).then((res) => {
@@ -2782,7 +2791,7 @@ export default {
             this.user_form.clockWayPushInterfaceAddresses =
               this.user_form.clockWayPushInterfaceAddresses.filter((item) => {
                 return (
-                  item.interfAddr !== null &&
+                  // item.interfAddr !== null &&
                   item.punchReportFields !== null &&
                   item.punchReportFields.length > 0 &&
                   item.zoneId !== null
@@ -2794,7 +2803,7 @@ export default {
               this.user_form.clockWayPushInterfaceAddresses =
                 this.user_form.clockWayPushInterfaceAddresses.map((item) => {
                   return {
-                    interfAddr: item.interfAddr,
+                    interfAddr: item.interfAddr || null,
                     zoneId: item.zoneId,
                     punchReportFields:
                       item.punchReportFields && item.punchReportFields > 0
@@ -2886,7 +2895,7 @@ export default {
               punchReportFields = item.punchReportFields;
             }
             return {
-              interfAddr: item.interfAddr,
+              interfAddr: item.interfAddr || null,
               zoneId: item.zoneId,
               punchReportFields,
             };
@@ -2959,7 +2968,7 @@ export default {
             this.user_form.clockWayPushInterfaceAddresses =
               this.user_form.clockWayPushInterfaceAddresses.filter((item) => {
                 return (
-                  item.interfAddr !== null &&
+                  // item.interfAddr !== null &&
                   item.punchReportFields !== null &&
                   item.punchReportFields.length > 0 &&
                   item.zoneId !== null
@@ -2971,7 +2980,7 @@ export default {
               this.user_form.clockWayPushInterfaceAddresses =
                 this.user_form.clockWayPushInterfaceAddresses.map((item) => {
                   return {
-                    interfAddr: item.interfAddr,
+                    interfAddr: item.interfAddr || null,
                     zoneId: item.zoneId,
                     punchReportFields:
                       item.punchReportFields &&