|
@@ -0,0 +1,84 @@
|
|
|
+<template>
|
|
|
+ <div id="detail">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-col :span="24" class="back">
|
|
|
+ <el-button type="primary" size="mini" @click="back">返回</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="detail">
|
|
|
+ <data-form :data="form" :fields="formFields" :rules="rules" @save="toSave" labelWidth="135px">
|
|
|
+ <template #options="{item}">
|
|
|
+ <template v-if="item.model === 'pid'">
|
|
|
+ <el-option v-for="(i, index) in pidList" :key="index" :label="i.name" :value="i.id"></el-option>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </data-form>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import dataForm from '@common/src/components/frame/form.vue';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+export default {
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ name: 'detail',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ dataForm,
|
|
|
+ },
|
|
|
+ data: function() {
|
|
|
+ return {
|
|
|
+ formFields: [
|
|
|
+ { label: '所属机构', model: 'pid', type: 'select' },
|
|
|
+ { label: '机构代码或邀请码', model: 'code' },
|
|
|
+ { label: '机构名称', model: 'deptname' },
|
|
|
+ { label: '姓名', model: 'name' },
|
|
|
+ { label: '手机号', model: 'phone', options: { maxLength: 11, minLength: 11, type: 'number' } },
|
|
|
+ { label: '密码', model: 'passwd', type: 'password' },
|
|
|
+ ],
|
|
|
+ form: {},
|
|
|
+ rules: {
|
|
|
+ pid: [{ required: true, message: '请选择所属机构' }],
|
|
|
+ code: [{ required: true, message: '请输入机构代码或邀请码' }],
|
|
|
+ name: [{ required: true, message: '请输入姓名' }],
|
|
|
+ phone: [{ required: true, message: '请输入手机号' }],
|
|
|
+ passwd: [{ required: true, message: '请输入密码' }],
|
|
|
+ },
|
|
|
+ // 机构管理员列表
|
|
|
+ pidList: [
|
|
|
+ { id: '1', name: '机构管理员1' },
|
|
|
+ { id: '2', name: '机构管理员2' },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ // 提交
|
|
|
+ toSave({ data }) {
|
|
|
+ console.log(data);
|
|
|
+ },
|
|
|
+ // 返回
|
|
|
+ back() {
|
|
|
+ this.$router.push({ path: '/yw' });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ },
|
|
|
+ watch: {},
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.main {
|
|
|
+ .back {
|
|
|
+ text-align: right;
|
|
|
+ margin: 0 0 10px 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|