Bladeren bron

其他用户管理更新

guhongwei 5 jaren geleden
bovenliggende
commit
febfaad98f

+ 39 - 0
src/layout/common/detailTop.vue

@@ -0,0 +1,39 @@
+<template>
+  <div id="detailTop">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="22" class="title">
+          创建信息
+        </el-col>
+        <el-col :span="2" class="btn">
+          <el-button type="text" icon="el-icon-arrow-left" @click="goBack">返回</el-button>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'detailTop',
+  props: {},
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {
+    goBack() {
+      this.$emit('goBack');
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.title {
+  padding: 10px 0;
+}
+.btn {
+  text-align: center;
+}
+</style>

+ 5 - 1
src/layout/common/topInfo.vue

@@ -9,7 +9,10 @@
           </el-breadcrumb>
         </el-col>
         <el-col :span="2">
-          <el-button type="text" @click="clickBtn()" icon="el-icon-plus">添加信息</el-button>
+          <span v-if="display === 'block'">
+            <el-button type="text" @click="clickBtn()" icon="el-icon-plus">添加信息</el-button>
+          </span>
+          <span v-else></span>
         </el-col>
       </el-col>
     </el-row>
@@ -21,6 +24,7 @@ export default {
   name: 'topInfo',
   props: {
     topTitle: null,
+    display: null,
   },
   components: {},
   data: () => ({}),

+ 63 - 0
src/layout/otheruser/otheruserForm.vue

@@ -0,0 +1,63 @@
+<template>
+  <div id="otheruserForm">
+    <el-row>
+      <el-col :span="24" class="form">
+        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
+          <el-form-item label="用户名称" prop="name">
+            <el-input v-model="ruleForm.name" placeholder="请输入用户名称"></el-input>
+          </el-form-item>
+          <el-form-item label="手机号" prop="phone">
+            <el-input v-model="ruleForm.phone" placeholder="请输入手机号"></el-input>
+          </el-form-item>
+          <el-form-item label="注册密码" prop="passwd">
+            <el-input v-model="ruleForm.passwd" placeholder="请输入注册密码" show-password></el-input>
+          </el-form-item>
+          <el-form-item label="用户类型" prop="type">
+            <el-select v-model="ruleForm.type" placeholder="请选择用户类型">
+              <el-option label="金控集团后台管理员" value="0"></el-option>
+              <el-option label="金融机构用户" value="1"></el-option>
+              <el-option label="政府用户" value="2"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-button size="small" @click="resetForm('ruleForm')">取消</el-button>
+            <el-button type="primary" size="small" @click="submitForm('ruleForm')">提交</el-button>
+          </el-form-item>
+        </el-form>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'otheruserForm',
+  props: {
+    ruleForm: null,
+  },
+  components: {},
+  data: () => ({
+    rules: {
+      phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
+      passwd: [{ required: true, message: '请输入注册密码', trigger: 'blur' }],
+      type: [{ required: true, message: '请选择用户类型', trigger: 'change' }],
+    },
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    submitForm() {
+      this.$emit('submitForm', { data: this.ruleForm });
+    },
+    resetForm() {
+      this.$emit('resetForm');
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.form {
+  padding: 0 200px 0 0;
+}
+</style>

+ 47 - 0
src/layout/otheruser/otheruserList.vue

@@ -0,0 +1,47 @@
+<template>
+  <div id="otheruserList">
+    <el-row>
+      <el-col :span="24">
+        <el-table ref="debtTable" :data="debtTable" style="width: 100%" border>
+          <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
+          <el-table-column property="name" label="用户名" align="center"> </el-table-column>
+          <el-table-column property="phone" label="手机号" align="center"> </el-table-column>
+          <el-table-column label="用户类型" align="center">
+            <template slot-scope="scope">
+              <span style="margin-left: 10px">{{ scope.row.type === '0' ? '金控集团后台管理员' : scope.row.type === '1' ? '金融机构用户' : '政府用户' }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column fixed="right" label="操作" align="center">
+            <template slot-scope="scope">
+              <el-button @click="handleClick(scope.row)" type="text"><i class="el-icon-edit"></i></el-button>
+              <el-button @click.native.prevent="deleteRow(scope.$index, debtTable)" type="text"><i class="el-icon-delete"></i></el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'otheruserList',
+  props: {
+    debtTable: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {
+    handleClick(id) {
+      this.$emit('handleClick', id);
+    },
+    deleteRow(id) {
+      this.$emit('deleteRow', id);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 6 - 1
src/router/index.js

@@ -28,11 +28,16 @@ const routes = [
     path: '/financial/detail',
     component: () => import('../views/financial/detail.vue'),
   },
-  // 用户管理
+  // 其他用户管理-列表
   {
     path: '/otheruser/index',
     component: () => import('../views/otheruser/index.vue'),
   },
+  // 其他用户管理-添加
+  {
+    path: '/otheruser/detail',
+    component: () => import('../views/otheruser/detail.vue'),
+  },
   // 企业信息管理
   {
     path: '/company/index',

+ 69 - 0
src/views/otheruser/detail.vue

@@ -0,0 +1,69 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="debt">
+        <el-col :span="24" class="top">
+          <topInfo :topTitle="topTitle" :display="display"></topInfo>
+        </el-col>
+        <el-col :span="24" class="main">
+          <el-col :span="24" class="back">
+            <detailTop @goBack="goBack"></detailTop>
+          </el-col>
+          <el-col :span="24" class="info">
+            <otheruserForm :ruleForm="ruleForm" @submitForm="submitForm" @resetForm="resetForm"></otheruserForm>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/common/topInfo.vue';
+import detailTop from '@/layout/common/detailTop.vue';
+import otheruserForm from '@/layout/otheruser/otheruserForm.vue';
+export default {
+  name: 'detail',
+  props: {},
+  components: {
+    topInfo, //头部导航
+    detailTop, //头部返回
+    otheruserForm, //添加其他用户
+  },
+  data: () => ({
+    display: 'none',
+    topTitle: '用户信息管理',
+    ruleForm: {},
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    submitForm(form) {
+      console.log(form);
+    },
+    resetForm() {
+      console.log('返回');
+    },
+    goBack() {
+      this.$router.go(-1);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.debt {
+  padding: 20px;
+}
+.top {
+  border-bottom: 1px solid #ccc;
+}
+.main {
+  border-radius: 10px;
+  margin: 20px 0 0 0;
+  box-shadow: 0 0 3px #666;
+}
+.main .back {
+  padding: 10px 0 10px 15px;
+}
+</style>

+ 53 - 6
src/views/otheruser/index.vue

@@ -1,21 +1,68 @@
 <template>
   <div id="index">
-    <el-col :span="24">
-      其他用户
+    <el-col :span="24" class="debt">
+      <el-col :span="24" class="top">
+        <topInfo :topTitle="topTitle" :display="display" @clickBtn="clickBtn"></topInfo>
+      </el-col>
+      <el-col :span="24" class="search">
+        <searchInfo></searchInfo>
+      </el-col>
+      <el-col :span="24" class="main">
+        <otheruserList :debtTable="debtTable"></otheruserList>
+      </el-col>
     </el-col>
   </div>
 </template>
 
 <script>
+import topInfo from '@/layout/common/topInfo.vue';
+import searchInfo from '@/layout/common/searchInfo.vue';
+import otheruserList from '@/layout/otheruser/otheruserList.vue';
+
 export default {
   name: 'index',
   props: {},
-  components: {},
-  data: () => ({}),
+  components: {
+    topInfo, //头部导航
+    searchInfo, //搜素
+    otheruserList, //其他用户列表
+  },
+  data: () => ({
+    topTitle: '其他用户',
+    display: 'block',
+    debtTable: [
+      {
+        name: '其他用户',
+        phone: '123456789',
+        type: '0',
+      },
+      {
+        name: '其他用户',
+        phone: '123456789',
+        type: '1',
+      },
+      {
+        name: '其他用户',
+        phone: '123456789',
+        type: '2',
+      },
+    ],
+  }),
   created() {},
   computed: {},
-  methods: {},
+  methods: {
+    clickBtn() {
+      this.$router.push({ path: '/otheruser/detail' });
+    },
+  },
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.debt {
+  padding: 20px;
+}
+.top {
+  border-bottom: 1px solid #ccc;
+}
+</style>