|
@@ -11,16 +11,16 @@
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-dialog title="专家信息管理" width="40%" :visible.sync="dialog" @closed="handleClose" :destroy-on-close="true">
|
|
|
- <data-form :data="form" :fields="formfields" :rules="rules" @save="toSave" @filterReturn="expertSelect">
|
|
|
+ <el-dialog title="专家信息管理" width="40%" :visible.sync="dialog" @close="handleClose" :destroy-on-close="true">
|
|
|
+ <data-form :data="form" :fields="formfields" :rules="rules" @save="toSave">
|
|
|
<template #options="{item}">
|
|
|
- <template v-if="item.model === 'expert_user_id'">
|
|
|
- <el-option v-for="(i, index) in expertList" :key="`expert${index}`" :label="i.name" :value="i.user_id"></el-option>
|
|
|
+ <template v-if="item.model === 'expert_id'">
|
|
|
+ <el-option v-for="(i, index) in expertList" :key="`expert${index}`" :label="i.expert_name" :value="i._id"></el-option>
|
|
|
</template>
|
|
|
</template>
|
|
|
</data-form>
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="评分详情" width="40%" :visible.sync="scoreDialog" @closed="handleClose" :destroy-on-close="true">
|
|
|
+ <el-dialog title="评分详情" width="40%" :visible.sync="scoreDialog" @close="handleClose" :destroy-on-close="true">
|
|
|
<scoreInfo :form="info"></scoreInfo>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -32,8 +32,8 @@ import scoreInfo from './parts/scoreInfo.vue';
|
|
|
import dataTable from '@common/src/components/frame/filter-page-table.vue';
|
|
|
import dataForm from '@common/src/components/frame/form.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
-const { mapActions: expert } = createNamespacedHelpers('expert');
|
|
|
const { mapActions: achieveExpert } = createNamespacedHelpers('achieveExpert');
|
|
|
+const { mapActions: achieveApplyExpert } = createNamespacedHelpers('achieveApplyExpert');
|
|
|
export default {
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
@@ -47,6 +47,8 @@ export default {
|
|
|
},
|
|
|
data: function() {
|
|
|
return {
|
|
|
+ // 工作类型:1=>评分;2=>会审
|
|
|
+ type: '1',
|
|
|
opera: [
|
|
|
{
|
|
|
label: '编辑',
|
|
@@ -65,8 +67,8 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
fields: [
|
|
|
- { label: '专家姓名', prop: 'expert_name', filter: 'input', showTip: true },
|
|
|
- { label: '联系电话', prop: 'phone', showTip: true },
|
|
|
+ { label: '专家姓名', prop: 'expert_id.expert_name', showTip: true },
|
|
|
+ { label: '联系电话', prop: 'expert_id.phone', showTip: true },
|
|
|
{ label: '评分', prop: 'verify.score', showTip: true },
|
|
|
{ label: '状态', prop: 'verify', format: i => (_.isObject(i) ? '已评分' : '未评分') },
|
|
|
],
|
|
@@ -76,11 +78,7 @@ export default {
|
|
|
dialog: false,
|
|
|
form: {},
|
|
|
rules: {},
|
|
|
- formfields: [
|
|
|
- { label: '专家', model: 'expert_user_id', type: 'select', filterReturn: true },
|
|
|
- { label: '联系电话', model: 'phone' },
|
|
|
- { label: '登录密码', model: 'password', type: 'password' },
|
|
|
- ],
|
|
|
+ formfields: [{ label: '专家', model: 'expert_id', type: 'select' }],
|
|
|
// 评分详情
|
|
|
scoreDialog: false,
|
|
|
info: {},
|
|
@@ -92,11 +90,11 @@ export default {
|
|
|
this.toGetExpert();
|
|
|
},
|
|
|
methods: {
|
|
|
- ...achieveExpert(['query', 'create', 'update', 'delete']),
|
|
|
- ...expert({ getExpert: 'query' }),
|
|
|
+ ...achieveApplyExpert(['query', 'create', 'update', 'delete']),
|
|
|
+ ...achieveExpert({ getExpert: 'query' }),
|
|
|
// 查询列表
|
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
- const res = await this.query({ skip, limit, ...info, apply_id: this.id });
|
|
|
+ const res = await this.query({ skip, limit, ...info, apply_id: this.id, expert: true, type: this.type });
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$set(this, `list`, res.data);
|
|
|
this.$set(this, `total`, res.total);
|
|
@@ -104,7 +102,9 @@ export default {
|
|
|
},
|
|
|
// 专家评分查看
|
|
|
toView({ data }) {
|
|
|
- this.$set(this, `info`, data);
|
|
|
+ const { expert_id, verify } = data;
|
|
|
+ const d = { name: expert_id.expert_name, phone: expert_id.phone, score: verify.score, content: verify.content };
|
|
|
+ this.$set(this, `info`, d);
|
|
|
this.scoreDialog = true;
|
|
|
},
|
|
|
// 添加专家
|
|
@@ -115,9 +115,13 @@ export default {
|
|
|
async toSave({ data }) {
|
|
|
const duplicate = _.cloneDeep(data);
|
|
|
duplicate.apply_id = this.id;
|
|
|
+ duplicate.type = this.type;
|
|
|
let method = _.get(duplicate, '_id') ? 'update' : 'create';
|
|
|
let res = await this[method](duplicate);
|
|
|
- if (this.$checkRes(res, '专家保存成功', res.errmsg || '专家保存失败')) this.handleClose();
|
|
|
+ if (this.$checkRes(res, '专家保存成功', res.errmsg || '专家保存失败')) {
|
|
|
+ this.handleClose();
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
},
|
|
|
// 修改
|
|
|
toEdit({ data }) {
|
|
@@ -133,28 +137,16 @@ export default {
|
|
|
},
|
|
|
// 取消
|
|
|
handleClose() {
|
|
|
- this.form = {};
|
|
|
this.dialog = false;
|
|
|
- this.search();
|
|
|
+ this.form = {};
|
|
|
},
|
|
|
// 返回列表
|
|
|
back() {
|
|
|
this.$router.push({ path: '/adminScore' });
|
|
|
},
|
|
|
- // 选择专家,返回电话
|
|
|
- expertSelect({ data, model }) {
|
|
|
- if (model === 'expert_user_id') {
|
|
|
- const res = this.expertList.find(f => f.user_id === data);
|
|
|
- if (res) {
|
|
|
- const { phone, name } = res;
|
|
|
- this.$set(this.form, 'phone', phone);
|
|
|
- this.$set(this.form, 'expert_name', name);
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
// 获取专家列表
|
|
|
async toGetExpert() {
|
|
|
- const res = await this.getExpert();
|
|
|
+ const res = await this.getExpert({ status: '0' });
|
|
|
if (this.$checkRes(res)) this.$set(this, 'expertList', res.data);
|
|
|
},
|
|
|
},
|