zs 1 year ago
parent
commit
74bce618e8
1 changed files with 17 additions and 4 deletions
  1. 17 4
      src/views/users/detail/index.vue

+ 17 - 4
src/views/users/detail/index.vue

@@ -14,7 +14,8 @@
               <el-option v-for="i in roleList" :key="i.code" :label="i.name" :value="i.code"></el-option>
             </template>
             <template #street>
-              <el-option @click="toChange(i)" v-for="i in streetList" :key="i._id" :label="i.name" :value="i._id"></el-option>
+              <el-option @click="toChange(i)" v-for="i in streetList" :key="i._id" :label="i.name"
+                :value="i._id"></el-option>
             </template>
             <template #community>
               <el-option v-for="i in communityList" :key="i._id" :label="i.name" :value="i._id"></el-option>
@@ -54,9 +55,7 @@ let fields: Ref<any[]> = ref([
   { label: '联系电话', model: 'tel' },
   { label: '姓名', model: 'name' },
   { label: '性别', model: 'gender', type: 'select' },
-  { label: '角色', model: 'role', type: 'select' },
-  { label: '所属街道', model: 'street', type: 'select' },
-  { label: '所属社区', model: 'community', type: 'select' }
+  { label: '角色', model: 'role', type: 'select' }
 ]);
 const rules = reactive<FormRules>({});
 // 字典表
@@ -82,6 +81,11 @@ const search = async () => {
       // 所属社区
       res = await officeAxios.query({ belong: info.street, type: '1', is_use: '0' });
       if (res.errcode == '0') communityList.value = res.data;
+      if (info.role == 'sqry') {
+        fields.value.push({ label: '所属社区', model: 'community', type: 'select' });
+      } else if (info.role != 'cs') {
+        fields.value.push({ label: '所属街道', model: 'street', type: 'select' });
+      }
     }
   }
 };
@@ -126,19 +130,24 @@ const toBack = () => {
 <style scoped lang="scss">
 .study {
   width: 100%;
+
   .study_1 {
     margin: 0 0 10px 0;
+
     span {
       font-size: 16px;
     }
+
     span:first-child {
       color: #ff0000;
     }
   }
+
   .study_2 {
     .study_2_info {
       width: 100%;
       display: flex;
+
       .info_1 {
         position: relative;
         max-width: 24%;
@@ -146,10 +155,12 @@ const toBack = () => {
         padding: 0 10px;
         border-radius: 5px;
         margin: 0 10px 0 0;
+
         .txt {
           position: absolute;
           top: -15px;
           left: 10px;
+
           span {
             display: inline-block;
             padding: 6px 15px;
@@ -161,8 +172,10 @@ const toBack = () => {
             line-height: 1;
           }
         }
+
         .info {
           margin: 15px 0 0 0;
+
           .label {
             margin: 0 0 10px 0;
           }