YY 2 rokov pred
rodič
commit
4343b1275a

+ 90 - 0
src/components/common/demand/info.vue

@@ -0,0 +1,90 @@
+<template>
+  <div id="info">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <component :is="CForm" :fields="field" :rules="{}" :form="form" labelWidth="auto" :isSave="false">
+          <template #fieldsList="{ item }">
+            <span v-for="(i, index) in form[item.model]" :key="index" class="direction">
+              <span>{{ index + 1 }}.</span>{{ i.name }}
+            </span>
+          </template>
+          <template #file="{ item }">
+            <el-link class="link" :href="i.url" :underline="false" v-for="(i, index) in form[item.model]" :key="index" target="_blank">
+              <i class="el-icon-view el-icon--right"></i><span>{{ index + 1 }}.{{ i.name }}</span>
+            </el-link>
+          </template>
+          <template #content="{ item }">
+            <p v-html="form[item.model]"></p>
+          </template>
+        </component>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+<script lang="ts" setup>
+import CForm from '@/components/c-form.vue';
+import { ref, toRefs, watch } from 'vue';
+import type { Ref } from 'vue';
+import _ from 'lodash';
+import { DictDataStore } from '@common/src/stores/users/sysdictdata'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const sysdictdata = DictDataStore();
+const props = defineProps({
+  info: { type: Object, default: () => {} },
+  type: { type: String },
+});
+const { info } = toRefs(props);
+let field: Ref<any[]> = ref([
+  { label: '需求截止时间', model: 'stop_date', options: { readonly: true } },
+  { label: '标题', model: 'title', options: { readonly: true } },
+  { label: '发布时间', model: 'date', options: { readonly: true } },
+  { label: '依托单位名称', model: 'company_name', options: { readonly: true } },
+  // { label: '联系方式', model: 'phone', options: { readonly: true } },
+  { label: '专业领域', model: 'fieldsList', custom: true },
+  { label: '文件信息', model: 'file', custom: true },
+  { label: '信息内容', model: 'content', custom: true },
+]);
+let form: Ref<{}> = ref({});
+let fieldsList: Ref<any[]> = ref([]);
+
+// 查询
+const search = async (info) => {
+  let e = _.cloneDeep(info);
+  e.fieldsList = getFields(e.fields);
+  form.value = e;
+};
+// 获得领域
+const getFields = (e) => {
+  let field = [];
+  for (const val of e) {
+    let data = fieldsList.value.find((i) => i.dict_value == val);
+    if (data) field.push({ name: data.dict_label });
+  }
+  return field;
+};
+const searchOther = async () => {
+  const p1: IQueryResult = await sysdictdata.query({ dict_type: 'studio_field' });
+  fieldsList.value = p1.data as [];
+};
+watch(info, async (newVal) => {
+  if (newVal && newVal._id) {
+    await searchOther();
+    await search(newVal);
+  }
+});
+</script>
+
+<style lang="scss" scoped>
+.direction {
+  display: inline-block;
+  background-color: #409eff;
+  border-radius: 5px;
+  padding: 0 5px;
+  margin: 0 5px 5px 0;
+  color: #ffffff;
+  line-height: 2.5;
+  span {
+    padding: 0 5px 0 0;
+  }
+}
+</style>

+ 1 - 19
src/components/common/scientist/info.vue

@@ -67,32 +67,14 @@ interface opItem {
   dict_value: string;
   dict_label: string;
 }
-interface operaItem {
-  label: string;
-  model: string;
-  method: string;
-  confirm?: boolean;
-  type?: string;
-  display?: any;
-}
 const props = defineProps({
   info: { type: Object, default: () => {} },
   type: { type: String },
-
-  // 行业领域
-  fieldList: { type: Array },
-  // 是否在职人员
-  isjobList: { type: Array },
-  zcList: { type: Array },
-
   educationList: { type: Array<opItem> },
   degreeList: { type: Array<opItem> },
 });
 const { info } = toRefs(props);
 const { type } = toRefs(props);
-const { fieldList } = toRefs(props);
-const { isjobList } = toRefs(props);
-const { zcList } = toRefs(props);
 const { educationList } = toRefs(props);
 const { degreeList } = toRefs(props);
 let field: Ref<any[]> = ref([]);
@@ -139,7 +121,7 @@ const search = async (e) => {
   }
   field.value = fields.value;
 };
-watch(info, (newVal, oldVal) => {
+watch(info, (newVal) => {
   if (newVal && newVal._id) {
     search(newVal);
   }

+ 3 - 5
src/components/common/studio/info.vue

@@ -2,7 +2,6 @@
   <div id="info">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight">
-        <!-- <data-form :fields="fields" :form="form" :rules="{}" :isSave="false" :span="24" labelWidth="130px">   -->
         <component :is="CForm" :fields="field" :rules="{}" :form="form" labelWidth="auto" :isSave="false">
           <template #zy_fields>
             <span v-for="(i, index) in form.zyfieldsList" :key="index" class="direction">
@@ -36,9 +35,8 @@
             <el-link class="link" :href="i.url" :underline="false" v-for="(i, index) in form[item.model]" :key="index" target="_blank">
               <i class="el-icon-view el-icon--right"></i><span>{{ index + 1 }}.{{ i.name }}</span>
             </el-link>
-          </template></component
-        >
-        <!-- </data-form> -->
+          </template>
+        </component>
       </el-col>
     </el-row>
   </div>
@@ -137,7 +135,7 @@ const searchOther = async () => {
   const p1: IQueryResult = await sysdictdata.query({ dict_type: 'studio_field' });
   fieldsList.value = p1.data as [];
 };
-watch(info, async (newVal, oldVal) => {
+watch(info, async (newVal) => {
   if (newVal && newVal._id) {
     await searchOther();
     await search(newVal);

+ 90 - 0
src/components/common/support/info.vue

@@ -0,0 +1,90 @@
+<template>
+  <div id="info">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <component :is="CForm" :fields="field" :rules="{}" :form="form" labelWidth="auto" :isSave="false">
+          <template #fieldsList="{ item }">
+            <span v-for="(i, index) in form[item.model]" :key="index" class="direction">
+              <span>{{ index + 1 }}.</span>{{ i.name }}
+            </span>
+          </template>
+          <template #file="{ item }">
+            <el-link class="link" :href="i.url" :underline="false" v-for="(i, index) in form[item.model]" :key="index" target="_blank">
+              <i class="el-icon-view el-icon--right"></i><span>{{ index + 1 }}.{{ i.name }}</span>
+            </el-link>
+          </template>
+          <template #content="{ item }">
+            <p v-html="form[item.model]"></p>
+          </template>
+        </component>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+<script lang="ts" setup>
+import CForm from '@/components/c-form.vue';
+import { ref, toRefs, watch } from 'vue';
+
+import type { Ref } from 'vue';
+import _ from 'lodash';
+import { DictDataStore } from '@common/src/stores/users/sysdictdata'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const sysdictdata = DictDataStore();
+const props = defineProps({
+  info: { type: Object, default: () => {} },
+  type: { type: String },
+});
+const { info } = toRefs(props);
+let field: Ref<any[]> = ref([
+  { label: '标题', model: 'title', options: { readonly: true } },
+  { label: '发布时间', model: 'date', options: { readonly: true } },
+  { label: '科学家姓名', model: 'scientist_name', options: { readonly: true } },
+  { label: '单位名称', model: 'company_name', options: { readonly: true } },
+  { label: '行业领域', model: 'fieldsList', custom: true },
+  { label: '文件信息', model: 'file', custom: true },
+  { label: '信息内容', model: 'content', custom: true },
+]);
+let form: Ref<{}> = ref({});
+let fieldsList: Ref<any[]> = ref([]);
+
+// 查询
+const search = async (info) => {
+  let e = _.cloneDeep(info);
+  e.fieldsList = getFields(e.fields);
+  form.value = e;
+};
+// 获得领域
+const getFields = (e) => {
+  let field = [];
+  for (const val of e) {
+    let data = fieldsList.value.find((i) => i.dict_value == val);
+    if (data) field.push({ name: data.dict_label });
+  }
+  return field;
+};
+const searchOther = async () => {
+  const p1: IQueryResult = await sysdictdata.query({ dict_type: 'studio_field' });
+  fieldsList.value = p1.data as [];
+};
+watch(info, async (newVal) => {
+  if (newVal && newVal._id) {
+    await searchOther();
+    await search(newVal);
+  }
+});
+</script>
+
+<style lang="scss" scoped>
+.direction {
+  display: inline-block;
+  background-color: #409eff;
+  border-radius: 5px;
+  padding: 0 5px;
+  margin: 0 5px 5px 0;
+  color: #ffffff;
+  line-height: 2.5;
+  span {
+    padding: 0 5px 0 0;
+  }
+}
+</style>

+ 186 - 0
src/views/center/supplydemand/demand/index.vue

@@ -0,0 +1,186 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <component :is="partsSearch" :is_search="true" :fields="fields" @search="partSearch">
+            <template #status>
+              <el-option v-for="i in statusList" :key="i.model" :label="i.dict_label" :value="i.dict_value"></el-option>
+            </template>
+          </component>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <component
+            :is="CTable"
+            :fields="fields"
+            :opera="opera"
+            :select="false"
+            :selected="selected"
+            @handleSelect="handleSelect"
+            @query="search"
+            :data="tableData"
+            :total="total"
+            @view="toView"
+            @exam="toExam"
+          >
+          </component>
+        </el-col>
+      </el-col>
+    </el-row>
+    <component :is="CDialog" :dialog="dialog" @handleClose="handleClose">
+      <template v-slot:info>
+        <component :is="CForm" :fields="infoFields" :rules="rules" :form="form" labelWidth="auto" @save="toSave">
+          <template #status>
+            <el-option v-for="(item, index) in statusList" :key="index" :label="item.dict_label" :value="item.dict_value"></el-option>
+          </template>
+        </component>
+      </template>
+    </component>
+  </div>
+</template>
+<script setup lang="ts">
+import store from '@/stores/counter';
+import moment from 'moment';
+// #region 组件
+import partsSearch from '@/components/c-search.vue';
+import CTable from '@/components/c-table.vue';
+import CForm from '@/components/c-form.vue';
+import CDialog from '@/components/c-dialog.vue';
+// #endregion
+import type { Ref } from 'vue';
+import { ref, onMounted, getCurrentInstance, reactive } from 'vue';
+import type { FormRules } from 'element-plus';
+import { ElMessage } from 'element-plus';
+import { useRouter } from 'vue-router';
+// #region 接口
+import { TecholdemandStore } from '@common/src/stores/studio/supplydemand/techoldemand'; // 列表 // 列表
+import { DictDataStore } from '@common/src/stores/users/sysdictdata'; // 字典表
+import { MessageStore } from '@common/src/stores/studio/other/message'; // 系统消息
+import type { IQueryResult } from '@/util/types.util';
+const techoldemand = TecholdemandStore();
+const sysdictdata = DictDataStore();
+const message = MessageStore();
+const { proxy } = getCurrentInstance() as any;
+const router = useRouter();
+// #endregion
+// 列表数据
+let tableData: Ref<any[]> = ref([]);
+// 列表
+let fields: Ref<any[]> = ref([
+  { label: '序号', options: { type: 'index' } },
+  { label: '标题', model: 'title', isSearch: true },
+  { label: '发布时间', model: 'date' },
+  { label: '依托单位名称', model: 'company_name', isSearch: true },
+  { label: '联系方式', model: 'phone', isSearch: true },
+  {
+    label: '审核状态',
+    model: 'status',
+    type: 'select',
+    format: (i) => {
+      let data = statusList.value.find((r) => r.dict_value == i);
+      if (data) return data.dict_label;
+    },
+    isSearch: true,
+  },
+  { label: '需求截止时间', model: 'stop_date' },
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '详情', method: 'view' },
+  { label: '审核', method: 'exam', type: 'warning', display: (i) => i.status == '0' },
+]);
+// 多选
+let selected: Ref<any[]> = ref([]);
+// 总数
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit: number = proxy.$limit;
+// 查询数据
+let searchForm: Ref<{}> = ref({});
+// 弹框
+const dialog: Ref<{ type: string; show: boolean; title: string }> = ref({ type: '1', show: false, title: '信息管理' });
+// 审核表单
+let form: Ref<{}> = ref({});
+// 必填项
+const rules = reactive<FormRules>({
+  status: [{ required: true, message: '请选择审核状态', trigger: 'change' }],
+  remark: [{ required: true, message: '请输入审核意见', trigger: 'blur' }],
+});
+// 表单
+let infoFields: Ref<any[]> = ref([
+  { label: '审核状态', model: 'status', type: 'select' },
+  { label: '审核意见', model: 'remark', type: 'textarea' },
+]);
+// 状态
+let statusList: Ref<any[]> = ref([]);
+onMounted(async () => {
+  await searchOther();
+  await search({ skip, limit });
+});
+// 查询
+const search = async (e: { skip: number; limit: number }) => {
+  const { skip, limit } = e;
+  let info = { limit: limit, skip: skip, ...searchForm.value, is_use: 'Y' };
+  const res: IQueryResult = await techoldemand.query(info);
+  tableData.value = res.data as any[];
+  total.value = res.total;
+};
+// 查询
+const partSearch = (form: { [x: string]: any }) => {
+  searchForm.value = form;
+  search({ skip, limit });
+};
+
+// 修改
+const toView = async (data: { _id: string }) => {
+  router.push({ path: '/center/supplydemand/demand/info', query: { id: data._id } });
+};
+// 审核
+const toExam = (data: object) => {
+  form.value = data;
+  dialog.value = { title: '信息管理', show: true, type: '1' };
+};
+// 审核保存
+const toSave = async (data: { _id: string; status: string; user_id: string; company_name: string; phone: string; title: string; remark: string }) => {
+  let obj = { id: data._id, status: data.status };
+  let res: IQueryResult = await techoldemand.update(obj);
+  if (res.errcode == 0) {
+    ElMessage({ type: 'success', message: '维护信息成功' });
+    createMess(data);
+  } else ElMessage({ type: 'warning', message: `${res.errmsg}` });
+};
+// // 发送系统消息
+const createMess = async (data: { user_id: string; company_name: string; phone: string; title: string; status: string; remark: string }) => {
+  let user = store.state.user;
+  let obj = {
+    user_id: user._id,
+    title: '审核通知',
+    send_time: moment().format('YYYY-MM-DD HH:mm:ss'),
+    type: '3',
+    user: [{ id: data.user_id, company: data.company_name, phone: data.phone }],
+    content: '您好,您所发布的《' + data.title + '》的申请,' + `${data.status == '1' ? '已通过审核' : '未通过审核'}` + ',原因:' + data.remark,
+  };
+  let arr = await message.create(obj);
+  if (arr.errcode == 0) {
+    ElMessage({ type: 'success', message: '系统信息发送成功' });
+    handleClose();
+  }
+};
+
+// 关闭弹窗
+const handleClose = () => {
+  form.value = {};
+  search({ skip, limit });
+  dialog.value = { title: '信息管理', show: false, type: '' };
+};
+// 选择
+const handleSelect = () => {};
+// 查询其他信息
+const searchOther = async () => {
+  // 字典表---审核状态
+  const p1: IQueryResult = await sysdictdata.query({ dict_type: 'studio_status' });
+  statusList.value = p1.data as [];
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 41 - 0
src/views/center/supplydemand/demand/info.vue

@@ -0,0 +1,41 @@
+<template>
+  <div id="info">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <component :is="partsSearch" :is_back="true" @toBack="toBack()"></component>
+        </el-col>
+        <el-col :span="24" class="two">
+          <component :is="demandInfo" :info="info"></component>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+<script setup lang="ts">
+import partsSearch from '@/components/c-search.vue';
+import demandInfo from '@/components/common/demand/info.vue';
+import { useRoute } from 'vue-router';
+import type { Ref } from 'vue';
+import { ref, onMounted } from 'vue';
+import { TecholdemandStore } from '@common/src/stores/studio/supplydemand/techoldemand';
+import type { IQueryResult } from '@/util/types.util';
+const techoldemand = TecholdemandStore();
+let route = useRoute();
+let info: Ref<{}> = ref({});
+onMounted(async () => {
+  await search();
+});
+const search = async () => {
+  if (route.query.id) {
+    let id = route.query.id;
+    const res: IQueryResult = await techoldemand.fetch(id);
+    info.value = res.data as {};
+  }
+};
+const toBack = () => {
+  window.history.go(-1);
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 334 - 0
src/views/center/supplydemand/support/index.vue

@@ -0,0 +1,334 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <component :is="partsSearch" :is_search="true" :fields="fields" @search="partSearch">
+            <template #status>
+              <el-option v-for="i in statusList" :key="i.model" :label="i.dict_label" :value="i.dict_value"></el-option>
+            </template>
+          </component>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <component
+            :is="CTable"
+            :fields="fields"
+            :opera="opera"
+            :select="false"
+            :selected="selected"
+            @handleSelect="handleSelect"
+            @query="search"
+            :data="tableData"
+            :total="total"
+            @view="toView"
+            @exam="toExam"
+          >
+          </component>
+        </el-col>
+      </el-col>
+    </el-row>
+    <component :is="CDialog" :dialog="dialog" @handleClose="handleClose">
+      <template v-slot:info>
+        <component :is="CForm" :fields="infoFields" :rules="rules" :form="form" labelWidth="auto" @save="toSave">
+          <template #status>
+            <el-option v-for="(item, index) in statusList" :key="index" :label="item.dict_label" :value="item.dict_value"></el-option>
+          </template>
+        </component>
+      </template>
+    </component>
+  </div>
+</template>
+<script setup lang="ts">
+import store from '@/stores/counter';
+import moment from 'moment';
+// #region 组件
+import partsSearch from '@/components/c-search.vue';
+import CTable from '@/components/c-table.vue';
+import CForm from '@/components/c-form.vue';
+import CDialog from '@/components/c-dialog.vue';
+// #endregion
+import type { Ref } from 'vue';
+import { ref, onMounted, getCurrentInstance, reactive } from 'vue';
+import type { FormRules } from 'element-plus';
+import { ElMessage } from 'element-plus';
+import { useRouter } from 'vue-router';
+// #region 接口
+import { TecholsupportStore } from '@common/src/stores/studio/supplydemand/techolsupport'; // 列表 // 列表
+import { DictDataStore } from '@common/src/stores/users/sysdictdata'; // 字典表
+import { MessageStore } from '@common/src/stores/studio/other/message'; // 系统消息
+import type { IQueryResult } from '@/util/types.util';
+const techolsupport = TecholsupportStore();
+const sysdictdata = DictDataStore();
+const message = MessageStore();
+const { proxy } = getCurrentInstance() as any;
+const router = useRouter();
+// #endregion
+// 列表数据
+let tableData: Ref<any[]> = ref([]);
+// 列表
+let fields: Ref<any[]> = ref([
+  { 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 = statusList.value.find((r) => r.dict_value == i);
+      if (data) return data.dict_label;
+    },
+    isSearch: true,
+  },
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '详情', method: 'view' },
+  { label: '审核', method: 'exam', type: 'warning', display: (i) => i.status == '0' },
+]);
+// 多选
+let selected: Ref<any[]> = ref([]);
+// 总数
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit: number = proxy.$limit;
+// 查询数据
+let searchForm: Ref<{}> = ref({});
+// 弹框
+const dialog: Ref<{ type: string; show: boolean; title: string }> = ref({ type: '1', show: false, title: '信息管理' });
+// 审核表单
+let form: Ref<{}> = ref({});
+// 必填项
+const rules = reactive<FormRules>({
+  status: [{ required: true, message: '请选择审核状态', trigger: 'change' }],
+  remark: [{ required: true, message: '请输入审核意见', trigger: 'blur' }],
+});
+// 表单
+let infoFields: Ref<any[]> = ref([
+  { label: '审核状态', model: 'status', type: 'select' },
+  { label: '审核意见', model: 'remark', type: 'textarea' },
+]);
+// 状态
+let statusList: Ref<any[]> = ref([]);
+onMounted(async () => {
+  await searchOther();
+  await search({ skip, limit });
+});
+// 查询
+const search = async (e: { skip: number; limit: number }) => {
+  const { skip, limit } = e;
+  let info = { limit: limit, skip: skip, ...searchForm.value, is_use: 'Y' };
+  const res: IQueryResult = await techolsupport.query(info);
+  tableData.value = res.data as any[];
+  total.value = res.total;
+};
+// 查询
+const partSearch = (form: { [x: string]: any }) => {
+  searchForm.value = form;
+  search({ skip, limit });
+};
+
+// 修改
+const toView = async (data: { _id: string }) => {
+  router.push({ path: '/center/supplydemand/support/info', query: { id: data._id } });
+};
+// 审核
+const toExam = (data: object) => {
+  form.value = data;
+  dialog.value = { title: '信息管理', show: true, type: '1' };
+};
+// 审核保存
+const toSave = async (data: { _id: string; status: string; user_id: string; scientist_name: string; phone: string; title: string; remark: string }) => {
+  let obj = { id: data._id, status: data.status };
+  let res: IQueryResult = await techolsupport.update(obj);
+  if (res.errcode == 0) {
+    ElMessage({ type: 'success', message: '维护信息成功' });
+    createMess(data);
+  } else ElMessage({ type: 'warning', message: `${res.errmsg}` });
+};
+// // 发送系统消息
+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: '审核通知',
+    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 message.create(obj);
+  if (arr.errcode == 0) {
+    ElMessage({ type: 'success', message: '系统信息发送成功' });
+    handleClose();
+  }
+};
+
+// 关闭弹窗
+const handleClose = () => {
+  form.value = {};
+  search({ skip, limit });
+  dialog.value = { title: '信息管理', show: false, type: '' };
+};
+// 选择
+const handleSelect = () => {};
+// 查询其他信息
+const searchOther = async () => {
+  // 字典表---审核状态
+  const p1: IQueryResult = await sysdictdata.query({ dict_type: 'studio_status' });
+  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>

+ 41 - 0
src/views/center/supplydemand/support/info.vue

@@ -0,0 +1,41 @@
+<template>
+  <div id="info">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <component :is="partsSearch" :is_back="true" @toBack="toBack()"></component>
+        </el-col>
+        <el-col :span="24" class="two">
+          <component :is="supportInfo" :info="info"></component>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+<script setup lang="ts">
+import partsSearch from '@/components/c-search.vue';
+import supportInfo from '@/components/common/support/info.vue';
+import { useRoute } from 'vue-router';
+import type { Ref } from 'vue';
+import { ref, onMounted } from 'vue';
+import { TecholsupportStore } from '@common/src/stores/studio/supplydemand/techolsupport';
+import type { IQueryResult } from '@/util/types.util';
+const techolsupport = TecholsupportStore();
+let route = useRoute();
+let info: Ref<{}> = ref({});
+onMounted(async () => {
+  await search();
+});
+const search = async () => {
+  if (route.query.id) {
+    let id = route.query.id;
+    const res: IQueryResult = await techolsupport.fetch(id);
+    info.value = res.data as {};
+  }
+};
+const toBack = () => {
+  window.history.go(-1);
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 5 - 3
src/views/center/users/scientist/index.vue

@@ -94,7 +94,8 @@ let fields: Ref<any[]> = ref([
 // 操作
 let opera: Ref<any[]> = ref([
   { label: '详情', method: 'view' },
-  { label: '审核', method: 'exam', type: 'warning', display: (i) => i.status == '0' },
+  { label: '审核', method: 'exam', type: 'warning' },
+  // { label: '审核', method: 'exam', type: 'warning', display: (i) => i.status == '0' },
   { label: '删除', method: 'del', type: 'danger', confirm: true },
 ]);
 // 多选
@@ -170,6 +171,7 @@ const updateRole = async (e) => {
       role: [...userInfo.data.role, roleInfo.value._id],
     };
     let res = await users.update(object);
+    console.log(res.data);
     if (res.errcode == 0) ElMessage({ type: 'success', message: '分配角色成功' });
   }
 };
@@ -223,8 +225,8 @@ const searchOther = async () => {
   const p1: IQueryResult = await sysdictdata.query({ dict_type: 'studio_status' });
   statusList.value = p1.data as [];
   // 角色
-  const p2 = await role.query({ code: 'studio-users', account_type: '3', status: 'Y' });
-  roleInfo.value = p2.data[0];
+  const p2 = await role.query({ code: 'studio-user', account_type: '2', status: 'Y' });
+  roleInfo.value = p2.data[0] as { _id: string };
 };
 </script>
 <style scoped>