|
@@ -1,23 +1,26 @@
|
|
|
<template>
|
|
|
<div id="detail">
|
|
|
- <detail-frame :title="mainTitle" returns="/teacher/list">
|
|
|
+ <detail-frame :title="mainTitle" returns="/teacher/index">
|
|
|
<data-form :data="info" :fields="fields" :needSave="false" :isNew="false">
|
|
|
<template #custom="{ item, form }">
|
|
|
- <template v-if="item.model === 'gender'">{{ form[item.model] }}</template>
|
|
|
<template v-if="item.model === 'is_etiquette_teacher'">{{ form[item.model] === '0' ? '否' : '是' }}</template>
|
|
|
- <template v-if="item.model === 'reason'">
|
|
|
+ <template v-if="item.model === 'remark'">
|
|
|
<el-form-item>
|
|
|
- <el-input v-model="reason" placeholder="审核原因(非必填)"></el-input>
|
|
|
+ <el-input v-model="remark" placeholder="审核原因(非必填)"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
+ <template v-if="item.model === 'zynumberfile'">
|
|
|
+ <pic v-if="form[item.model]" :src="form[item.model]" />
|
|
|
+ <!-- <el-image :src="form[item.model]" style="width:150px;height:150px;" fit="scale-down"></el-image> -->
|
|
|
+ </template>
|
|
|
</template>
|
|
|
- <template #submit>
|
|
|
+ <template #submit v-if="info.status === '0'">
|
|
|
<el-row type="flex" justify="middle" align="center">
|
|
|
<el-col :span="7">
|
|
|
- <el-button type="primary" size="mini" @click="setCheck('0')">确认教师</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="setCheck('1')">确认教师</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="7">
|
|
|
- <el-button type="danger" size="mini" @click="setCheck('1')">退回教师</el-button>
|
|
|
+ <!-- <el-button type="danger" size="mini" @click="setCheck('1')">退回教师</el-button> -->
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</template>
|
|
@@ -29,32 +32,35 @@
|
|
|
<script>
|
|
|
import detailFrame from '@frame/layout/admin/detail-frame';
|
|
|
import dataForm from '@frame/components/form';
|
|
|
-import { createNamespacedHelpers } from 'vuex';
|
|
|
-const { mapActions } = createNamespacedHelpers('teacher');
|
|
|
+import pic from '@frame/components/pic';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: teacher } = createNamespacedHelpers('teacher');
|
|
|
+const { mapActions: subject } = createNamespacedHelpers('subject');
|
|
|
export default {
|
|
|
metaInfo: { title: '教师信息' },
|
|
|
name: 'detail',
|
|
|
props: {},
|
|
|
- components: { detailFrame, dataForm },
|
|
|
+ components: { detailFrame, dataForm, pic },
|
|
|
data: () => ({
|
|
|
info: {},
|
|
|
- reason: '', //审核原因
|
|
|
+ remark: '', //审核原因
|
|
|
fields: [
|
|
|
{ label: '教师姓名', model: 'name', type: 'text' },
|
|
|
- { label: '性别', model: 'gender', custom: true },
|
|
|
+ { label: '性别', model: 'gender', type: 'text' },
|
|
|
{ label: '手机号', model: 'phone', type: 'text' },
|
|
|
- { label: '身份证号', model: 'id_number', type: 'text' },
|
|
|
- { label: '教师资格证号', model: 'profession_number', type: 'text' },
|
|
|
- { label: '学校名称', model: 'school_name', type: 'text' },
|
|
|
+ { label: '身份证号', model: 'idnumber', type: 'text' },
|
|
|
+ { label: '教师资格证号', model: 'zynumber', type: 'text' },
|
|
|
+ { label: '教师资格证', model: 'zynumberfile', custom: true },
|
|
|
+ { label: '学校', model: 'schname', type: 'text' },
|
|
|
+ { label: '科目', model: 'subname', type: 'text' },
|
|
|
{ label: '邮箱', model: 'email', type: 'text' },
|
|
|
{ label: '年龄', model: 'age', type: 'text' },
|
|
|
{ label: '出生日期', model: 'birthday', type: 'text' },
|
|
|
{ label: '职务', model: 'job', type: 'text' },
|
|
|
{ label: '专业', model: 'major', type: 'text' },
|
|
|
{ label: '是/否是礼仪老师', model: 'is_etiquette_teacher', custom: true },
|
|
|
- { label: '审核原因', model: 'reason', custom: true },
|
|
|
],
|
|
|
- loading: true,
|
|
|
+ subjectList: [],
|
|
|
}),
|
|
|
created() {},
|
|
|
computed: {
|
|
@@ -77,16 +83,31 @@ export default {
|
|
|
id: {
|
|
|
immediate: true,
|
|
|
handler(val) {
|
|
|
- if (val) this.loading = false;
|
|
|
- else this.search();
|
|
|
+ if (val) this.search();
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapActions(['fetch']),
|
|
|
- async search() {},
|
|
|
- setCheck(status) {
|
|
|
- //this.reason 是审核原因,需要带上
|
|
|
+ ...teacher(['fetch', 'status']),
|
|
|
+ ...subject({ getSubjectList: 'query' }),
|
|
|
+ async search() {
|
|
|
+ let subject = await this.getSubjectList();
|
|
|
+ if (this.$checkRes(subject)) this.$set(this, `subjectList`, subject.data);
|
|
|
+ let res = await this.fetch(this.id);
|
|
|
+ if (res.data.status === '0') {
|
|
|
+ this.fields.push({ label: '审核原因', model: 'remark', custom: true });
|
|
|
+ }
|
|
|
+ let sub = this.subjectList.find(f => res.data.subid === f._id);
|
|
|
+ if (sub) res.data.subname = sub.name;
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `info`, res.data);
|
|
|
+ },
|
|
|
+ async setCheck(status) {
|
|
|
+ //this.remark 是审核原因,需要带上
|
|
|
+ let teachersid = [];
|
|
|
+ teachersid.push(this.id);
|
|
|
+ let object = { teachersid, status: '1', remark: this.remark };
|
|
|
+ let res = await this.status(object);
|
|
|
+ if (this.$checkRes(res, `确认成功`, res.errmsg)) this.$router.push('/teacher/index');
|
|
|
},
|
|
|
},
|
|
|
};
|