|
@@ -111,6 +111,7 @@ let infoFields: Ref<any[]> = ref([
|
|
|
{ label: '审核状态', model: 'status', type: 'select' },
|
|
|
{ label: '审核意见', model: 'remark', type: 'textarea' },
|
|
|
]);
|
|
|
+let user = store.state.user as { _id: string; role_type: string };
|
|
|
// 状态
|
|
|
let statusList: Ref<any[]> = ref([]);
|
|
|
onMounted(async () => {
|
|
@@ -151,7 +152,6 @@ const toSave = async (data: { _id: string; status: string; user_id: string; scie
|
|
|
};
|
|
|
// // 发送系统消息
|
|
|
const createMess = async (data: { user_id: string; scientist_name: string; phone: string; title: string; status: string; remark: string }) => {
|
|
|
- let user = store.state.user;
|
|
|
let obj = {
|
|
|
user_id: user._id,
|
|
|
title: '审核通知',
|
|
@@ -182,153 +182,5 @@ const searchOther = async () => {
|
|
|
statusList.value = p1.data as [];
|
|
|
};
|
|
|
</script>
|
|
|
-<!-- <script>
|
|
|
-import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
-const { mapActions } = createNamespacedHelpers('techolsupport');
|
|
|
-const { mapActions: sysdictdata } = createNamespacedHelpers('sysdictdata');
|
|
|
-const { mapActions: message } = createNamespacedHelpers('message');
|
|
|
-const moment = require('moment');
|
|
|
-export default {
|
|
|
- name: 'index',
|
|
|
- props: {},
|
|
|
- components: {},
|
|
|
- data: function () {
|
|
|
- return {
|
|
|
- // 查询
|
|
|
- searchInfo: {},
|
|
|
- list: [],
|
|
|
- total: 0,
|
|
|
- fields: [
|
|
|
- { label: '序号', options: { type: 'index' } },
|
|
|
- { label: '标题', model: 'title', isSearch: true },
|
|
|
- { label: '发布时间', model: 'date' },
|
|
|
- { label: '科学家姓名', model: 'scientist_name', isSearch: true },
|
|
|
- { label: '联系方式', model: 'phone', isSearch: true },
|
|
|
- { label: '单位名称', model: 'company_name', isSearch: true },
|
|
|
- {
|
|
|
- label: '审核状态',
|
|
|
- model: 'status',
|
|
|
- type: 'select',
|
|
|
- format: (i) => {
|
|
|
- let data = this.statusList.find((r) => r.dict_value == i);
|
|
|
- if (data) return data.dict_label;
|
|
|
- },
|
|
|
- isSearch: true,
|
|
|
- },
|
|
|
- ],
|
|
|
- opera: [
|
|
|
- { label: '对接信息', method: 'dock', display: (i) => i.dock_status == '1' || i.dock_status == '2' },
|
|
|
- { label: '详情', method: 'view' },
|
|
|
- { label: '审核', method: 'exam', type: 'warning', display: (i) => i.status == '0' },
|
|
|
- ],
|
|
|
- // 是否啓用
|
|
|
- isuseList: [],
|
|
|
- // 审核状态
|
|
|
- statusList: [],
|
|
|
- dialog: { title: '信息审核', show: false, type: '1' },
|
|
|
- form: {},
|
|
|
- rules: {
|
|
|
- status: [{ required: true, message: '请选择审核状态', trigger: 'change' }],
|
|
|
- remark: [{ required: true, message: '请输入审核意见', trigger: 'blur' }],
|
|
|
- },
|
|
|
- };
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.searchOther();
|
|
|
- this.search();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- ...mapActions(['query', 'update', 'delete']),
|
|
|
- ...sysdictdata({ dQuery: 'query' }),
|
|
|
- ...message({ mCreate: 'create' }),
|
|
|
- async search({ skip = 0, limit = this.$limit, ...info } = {}) {
|
|
|
- info.is_use = 'Y';
|
|
|
- let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `list`, res.data);
|
|
|
- this.$set(this, `total`, res.total);
|
|
|
- }
|
|
|
- },
|
|
|
- btSearch(query) {
|
|
|
- this.$set(this, `searchInfo`, query);
|
|
|
- this.search();
|
|
|
- },
|
|
|
- // 对接信息
|
|
|
- toDock({ data }) {
|
|
|
- this.$router.push({ path: '/center/supplydemand/support/dock', query: { id: data.id } });
|
|
|
- },
|
|
|
- // 详细信息
|
|
|
- toView({ data }) {
|
|
|
- this.$router.push({ path: '/center/supplydemand/support/info', query: { id: data.id } });
|
|
|
- },
|
|
|
- // 信息审核
|
|
|
- toExam({ data }) {
|
|
|
- this.$set(this, `form`, data);
|
|
|
- this.dialog = { title: '信息审核', show: true, type: '1' };
|
|
|
- },
|
|
|
- // 提交审核
|
|
|
- toSubmit(formName) {
|
|
|
- this.$refs[formName].validate(async (valid) => {
|
|
|
- if (valid) {
|
|
|
- let data = this.form;
|
|
|
- let obj = { id: data.id, status: data.status };
|
|
|
- let res = await this.update(obj);
|
|
|
- if (this.$checkRes(res, `信息审核成功`, res.errmsg)) this.createMess(data);
|
|
|
- } else {
|
|
|
- console.log('error submit!!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 发送系统消息
|
|
|
- async createMess(data) {
|
|
|
- let obj = {
|
|
|
- user_id: this.user._id,
|
|
|
- title: '审核通知',
|
|
|
- send_time: moment().format('YYYY-MM-DD HH:mm:ss'),
|
|
|
- type: '3',
|
|
|
- user: [{ id: data.user_id, name: data.scientist_name, phone: data.phone }],
|
|
|
- content: '您好,您所发布的《' + data.title + '》的申请,' + `${data.status == '1' ? '已通过审核' : '未通过审核'}` + ',原因:' + data.remark,
|
|
|
- };
|
|
|
- let arr = await this.mCreate(obj);
|
|
|
- if (this.$checkRes(arr, `系统信息发送成功`, arr.errmsg)) this.toClose();
|
|
|
- },
|
|
|
- // 关闭弹框
|
|
|
- toClose() {
|
|
|
- this.form = {};
|
|
|
- this.dialog = { title: '信息审核', show: false, type: '1' };
|
|
|
- this.searchOther();
|
|
|
- this.search();
|
|
|
- },
|
|
|
- // 查詢其他信息
|
|
|
- async searchOther() {
|
|
|
- let res;
|
|
|
- // 是否启用
|
|
|
- res = await this.dQuery({ dict_type: 'sys_yes_no' });
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `isuseList`, res.data);
|
|
|
- }
|
|
|
- // 审核状态
|
|
|
- res = await this.dQuery({ dict_type: 'studio_status' });
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `statusList`, res.data);
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapState(['user']),
|
|
|
- },
|
|
|
- metaInfo() {
|
|
|
- return { title: this.$route.meta.title };
|
|
|
- },
|
|
|
- watch: {
|
|
|
- test: {
|
|
|
- deep: true,
|
|
|
- immediate: true,
|
|
|
- handler(val) {},
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
-</script> -->
|
|
|
|
|
|
<style lang="scss" scoped></style>
|