|
@@ -0,0 +1,80 @@
|
|
|
|
+<template>
|
|
|
|
+ <div id="detail-1">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="24" class="main">
|
|
|
|
+ <data-form :fields="fields" :data="form" :rules="rules" @save="toSave">
|
|
|
|
+ <template #options="{ item }">
|
|
|
|
+ <template v-if="item.model === 'type'">
|
|
|
|
+ <el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
|
+ </template>
|
|
|
|
+ </template>
|
|
|
|
+ </data-form>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
|
+export default {
|
|
|
|
+ name: 'detail-1',
|
|
|
|
+ props: {
|
|
|
|
+ form: { type: Object },
|
|
|
|
+ },
|
|
|
|
+ components: {},
|
|
|
|
+ data: function () {
|
|
|
|
+ return {
|
|
|
|
+ fields: [
|
|
|
|
+ { label: '用户类别', model: 'type', type: 'select' },
|
|
|
|
+ { label: '姓名', model: 'name' },
|
|
|
|
+ { label: '电话', model: 'phone' },
|
|
|
|
+ { label: '电子邮箱', model: 'email' },
|
|
|
|
+ { label: '联系地址', model: 'address' },
|
|
|
|
+ { label: '部门', model: 'dept' },
|
|
|
|
+ { label: '职务', model: 'zw' },
|
|
|
|
+ { label: '工作单位', model: 'company' },
|
|
|
|
+ ],
|
|
|
|
+ rules: {
|
|
|
|
+ type: [{ required: true, message: '请选择用户类别' }],
|
|
|
|
+ name: [{ required: true, message: '请输入姓名' }],
|
|
|
|
+ phone: [{ required: true, message: '请输入电话' }],
|
|
|
|
+ email: [{ required: true, message: '请输入电子邮箱' }],
|
|
|
|
+ address: [{ required: true, message: '请输入联系地址' }],
|
|
|
|
+ dept: [{ required: true, message: '请输入部门' }],
|
|
|
|
+ zw: [{ required: true, message: '请输入职务' }],
|
|
|
|
+ company: [{ required: true, message: '请输入工作单位' }],
|
|
|
|
+ },
|
|
|
|
+ typeList: [
|
|
|
|
+ { label: '超级管理员', value: '0' },
|
|
|
|
+ { label: '科室人员', value: '1' },
|
|
|
|
+ { label: '办公室人员', value: '2' },
|
|
|
|
+ { label: '采购部门', value: '3' },
|
|
|
|
+ { label: '入库管理部门', value: '4' },
|
|
|
|
+ { label: '财务部门', value: '5' },
|
|
|
|
+ { label: '供货部门', value: '6' },
|
|
|
|
+ ],
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ created() {},
|
|
|
|
+ methods: {
|
|
|
|
+ toSave({ data }) {
|
|
|
|
+ this.$emit('onSubmit', data);
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState(['user']),
|
|
|
|
+ },
|
|
|
|
+ metaInfo() {
|
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ test: {
|
|
|
|
+ deep: true,
|
|
|
|
+ immediate: true,
|
|
|
|
+ handler(val) {},
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less" scoped></style>
|