Ver código fonte

Merge branch 'main' of http://git.cc-lotus.info/Information/cxyy-admin

lrf 8 meses atrás
pai
commit
abe84d7c4b

+ 18 - 0
src/lang/package/zh-cn/pages.js

@@ -338,6 +338,18 @@ export default {
     is_use: '是否启用',
     titleMessage: '请输入服务名称'
   },
+  applyCompany: {
+    viewDialogTitle: '查看',
+    examDialogTitle: '审核企业认领',
+    company_name: '企业名称',
+    user_name: '用户名称',
+    file: '营业执照',
+    person: '负责人',
+    person_phone: '负责人手机号',
+    card: '负责人身份证正反面',
+    email: '电子邮箱',
+    status: '审核状态'
+  },
   journal: {
     addDialogTitle: '新增行研产研',
     upDialogTitle: '修改行研产研',
@@ -626,6 +638,12 @@ export default {
     work: '工作单位',
     work_pla: '请输入工作单位',
     is_show: '是否公开',
+    industry: '所属产业',
+    industry_pla: '请选择所属产业',
+    industry_type: '产业类型',
+    industry_type_pla: '请输入产业类型',
+    work_type: '工作类型',
+    work_type_pla: '请输入工作类型',
     brief: '简介',
     brief_pla: '请输入简介',
     status: '状态',

+ 14 - 0
src/router/modules/apply.js

@@ -0,0 +1,14 @@
+import i18n from '@/lang'
+export const routes = [
+  {
+    path: '/applyCompany/index',
+    name: 'applyCompany',
+    meta: {
+      title: i18n.global.t('menus.applyCompany'),
+      affix: true,
+      keepAlive: true,
+      alwaysShow: false
+    },
+    component: () => import('@/views/applyCompany/index.vue')
+  }
+]

+ 56 - 0
src/store/api/user/applyCompany.js

@@ -0,0 +1,56 @@
+import { defineStore } from 'pinia'
+import { AxiosWrapper } from '@/utils/axios-wrapper'
+import { get } from 'lodash-es'
+const url = '/applyCompany'
+const axios = new AxiosWrapper()
+
+export const ApplyCompanyStore = defineStore('applyCompany', () => {
+  const query = async ({ skip = 0, limit = undefined, ...info } = {}) => {
+    let cond = {}
+    if (skip) cond.skip = skip
+    if (limit) cond.limit = limit
+    cond = { ...cond, ...info }
+    const res = await axios.$get(`${url}`, cond)
+    return res
+  }
+  const list = async ({ skip = 0, limit = undefined, ...info } = {}) => {
+    let cond = {}
+    if (skip) cond.skip = skip
+    if (limit) cond.limit = limit
+    cond = { ...cond, ...info }
+    const res = await axios.$get(`${url}/list`, cond)
+    return res
+  }
+  const fetch = async (payload) => {
+    const res = await axios.$get(`${url}/${payload}`)
+    return res
+  }
+  const create = async (payload) => {
+    const res = await axios.$post(`${url}`, payload)
+    return res
+  }
+  const update = async (payload) => {
+    const id = get(payload, 'id', get(payload, '_id'))
+    const res = await axios.$post(`${url}/${id}`, payload)
+    return res
+  }
+  const del = async (payload) => {
+    const res = await axios.$delete(`${url}/${payload}`)
+    return res
+  }
+  const examine = async (payload) => {
+    const id = get(payload, 'id')
+    const status = get(payload, 'status')
+    const res = await axios.$post(`${url}/examine`, { id, status })
+    return res
+  }
+  return {
+    query,
+    list,
+    fetch,
+    create,
+    update,
+    examine,
+    del
+  }
+})

+ 161 - 4
src/views/exam/parts/company.vue

@@ -1,8 +1,165 @@
 <template>
-  <div id="company">
-    <p>company</p>
+  <div id="company" v-loading="loading">
+    <custom-search-bar :fields="fields.filter((f) => f.isSearch)" v-model="searchForm" @search="search" @reset="toReset"> </custom-search-bar>
+    <custom-table :data="data" :fields="fields" @query="search" :total="total" :opera="opera" @view="toView" @exam="toExam">
+      <template #is_use="{ row }">
+        <el-tag v-if="row.is_use == '0'" type="success" @click="toUse(row, '1')">启用</el-tag>
+        <el-tag v-else type="info" @click="toUse(row, '0')">禁用</el-tag>
+      </template>
+    </custom-table>
+    <el-dialog v-model="dialog.show" :title="dialog.title" :destroy-on-close="false" @close="toClose">
+      <el-row>
+        <el-col :span="24" v-if="dialog.type == '1'">
+          <custom-form v-model="form" :fields="formFields" :rules="rules" @save="toSave">
+            <template #file>
+              <custom-upload model="file" :list="form.file" :limit="1" listType="picture-card" url="/files/web/cxyy_applyCompany/upload" @change="onUpload"></custom-upload>
+            </template>
+            <template #card>
+              <custom-upload model="card" :list="form.card" :limit="2" listType="picture-card" url="/files/web/cxyy_applyCompany/upload" @change="onUpload"></custom-upload>
+            </template>
+          </custom-form>
+        </el-col>
+        <el-col :span="24" v-if="dialog.type == '2'">
+          <custom-form v-model="examForm" :fields="examFormFields" :rules="examRules" @save="toExamSave">
+            <template #status>
+              <el-option v-for="i in statusList" :key="i.id" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </custom-form>
+        </el-col>
+      </el-row>
+    </el-dialog>
   </div>
 </template>
 
-<script setup></script>
-<style scoped></style>
+<script setup>
+import { cloneDeep, get } from 'lodash-es'
+const $checkRes = inject('$checkRes')
+const { t } = useI18n()
+// 接口
+import { ApplyCompanyStore } from '@/store/api/user/applyCompany'
+import { DictDataStore } from '@/store/api/system/dictData'
+const store = ApplyCompanyStore()
+const dictDataStore = DictDataStore()
+const data = ref([])
+const searchForm = ref({})
+const fields = [
+  { label: t('pages.applyCompany.company_name'), model: 'company_name' },
+  { label: t('pages.applyCompany.user_name'), model: 'user_name' },
+  { label: t('pages.applyCompany.person'), model: 'person', isSearch: true },
+  { label: t('pages.applyCompany.person_phone'), model: 'person_phone', isSearch: true },
+  { label: t('pages.applyCompany.status'), model: 'status', format: (i) => getDict(i, 'status') }
+]
+const opera = [
+  { label: t('common.view'), method: 'view' },
+  { label: t('common.exam'), method: 'exam', type: 'warning', display: (i) => i.status != '1' }
+]
+let skip = 0
+let limit = inject('limit')
+const total = ref(0)
+const statusList = ref([])
+// 加载中
+const loading = ref(false)
+const formFields = ref([
+  { label: t('pages.applyCompany.file'), model: 'file', custom: true },
+  { label: t('pages.applyCompany.person'), model: 'person' },
+  { label: t('pages.applyCompany.person_phone'), model: 'person_phone' },
+  { label: t('pages.applyCompany.email'), model: 'email' },
+  { label: t('pages.applyCompany.card'), model: 'card', custom: true }
+])
+const rules = reactive({})
+const dialog = ref({ type: '1', show: false, title: t('pages.applyCompany.addDialogTitle') })
+const form = ref({ file: [] })
+// 审核
+const examFormFields = [{ label: t('pages.applyCompany.status'), model: 'status', type: 'select' }]
+const examRules = reactive({ status: [{ required: true, message: t('common.statusMessage'), trigger: 'blur' }] })
+const examForm = ref({})
+// 请求
+onMounted(async () => {
+  loading.value = true
+  await searchOther()
+  await search({ skip, limit })
+  loading.value = false
+})
+
+const searchOther = async () => {
+  let result
+  // 状态
+  result = await dictDataStore.query({ code: 'examStatus', is_use: '0' })
+  if ($checkRes(result)) statusList.value = result.data
+}
+const search = async (query = { skip, limit }) => {
+  skip = query.skip
+  limit = query.limit
+  const info = { skip: query.skip, limit: query.limit, ...searchForm.value }
+  const res = await store.list(info)
+  if (res.errcode == '0') {
+    data.value = res.data
+    total.value = res.total
+  }
+}
+// 字典数据转换
+const getDict = (data, model) => {
+  if (data) {
+    let res
+    if (model == 'status') res = statusList.value.find((f) => f.value == data)
+    return get(res, 'label')
+  }
+}
+
+// 查看信息
+const toView = (data) => {
+  form.value = data
+  dialog.value = { type: '1', show: true, title: t('pages.applyCompany.viewDialogTitle') }
+}
+// 上传图片
+const onUpload = (e) => {
+  const { model, value } = e
+  form.value[model] = value
+}
+const toSave = async () => {
+  const data = cloneDeep(form.value)
+  const other = { status: '0' }
+  let res
+  if (get(data, 'id')) res = await store.update({ ...data, ...other })
+  else res = await store.create({ ...data, ...other })
+  if ($checkRes(res, true)) {
+    search({ skip, limit })
+    toClose()
+  }
+}
+// 审核
+const toExam = (data) => {
+  examForm.value = data
+  dialog.value = { type: '2', show: true, title: t('pages.applyCompany.examDialogTitle') }
+}
+// 审核保存
+const toExamSave = async () => {
+  const data = cloneDeep(examForm.value)
+  let res = await store.examine({ id: data.id, status: data.status })
+  if ($checkRes(res, true)) {
+    search({ skip, limit })
+    toClose()
+  }
+}
+// 开启或禁用
+const toUse = async (data, is_use) => {
+  ElMessageBox.confirm(`确定修改【${data.name}】数据?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
+    .then(async () => {
+      let res = await store.update({ id: get(data, 'id'), is_use, status: get(data, 'status') })
+      if ($checkRes(res, true)) {
+        search({ skip, limit })
+      }
+    })
+    .catch(() => {})
+}
+const toClose = () => {
+  form.value = { file: [] }
+  dialog.value = { show: false }
+}
+// 重置
+const toReset = async () => {
+  searchForm.value = {}
+  await search({ skip, limit })
+}
+</script>
+<style scoped lang="scss"></style>

+ 8 - 0
src/views/information/parts/role/expert.vue

@@ -47,9 +47,12 @@ import { ExpertStore } from '@/store/api/user/expert'
 import { DictDataStore } from '@/store/api/system/dictData'
 import { get, cloneDeep, isArray } from 'lodash-es'
 import { RegionStore } from '@/store/api/system/region'
+import { SectorStore } from '@/store/api/system/sector'
 import expertForm from './expert/form.vue'
 const regionStore = RegionStore()
 const store = ExpertStore()
+const sectorStore = SectorStore()
+
 const dictDataStore = DictDataStore()
 const $checkRes = inject('$checkRes')
 let skip = 0
@@ -150,6 +153,7 @@ const cityList = ref([])
 const fieldList = ref([])
 const educationList = ref([])
 const cardTypeList = ref([])
+const plateList = ref([])
 const searchOther = async () => {
   let result
   result = await dictDataStore.query({ code: 'examStatus', is_use: '0' })
@@ -168,6 +172,9 @@ const searchOther = async () => {
   // 证件类型
   result = await dictDataStore.query({ code: 'cardType', is_use: '0' })
   if ($checkRes(result)) cardTypeList.value = result.data
+  // 行业
+  result = await sectorStore.query({ is_use: '0' })
+  if (result.errcode == '0') plateList.value = result.data
 }
 provide('form', form)
 provide('isUseList', isUseList)
@@ -175,6 +182,7 @@ provide('statusList', examStatusList)
 provide('cityList', cityList)
 provide('fieldList', fieldList)
 provide('educationList', educationList)
+provide('plateList', plateList)
 provide('cardTypeList', cardTypeList)
 
 const getDict = (data, type) => {

+ 20 - 0
src/views/information/parts/role/expert/form.vue

@@ -74,6 +74,25 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item :label="$t('pages.expert.industry_type')" prop="industry_type">
+            <el-input size="large" clearable v-model="form.industry_type" :placeholder="$t('pages.expert.industry_type_pla')" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item :label="$t('pages.expert.work_type')" prop="work_type">
+            <el-input size="large" clearable v-model="form.work_type" :placeholder="$t('pages.expert.work_type_pla')" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-col :span="24">
+        <el-form-item :label="$t('pages.expert.industry')" prop="industry">
+          <el-checkbox-group v-model="form.industry">
+            <el-checkbox v-for="(item, index) in plateList" :key="index" :value="item.title">{{ item.title }}</el-checkbox>
+          </el-checkbox-group>
+        </el-form-item>
+      </el-col>
       <el-col :span="24">
         <el-form-item :label="$t('pages.expert.brief')" prop="brief">
           <el-input v-model="form.brief" :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" :placeholder="$t('pages.expert.brief_pla')" />
@@ -102,6 +121,7 @@ const form = inject('form')
 // 字典表
 const fieldList = inject('fieldList')
 const educationList = inject('educationList')
+const plateList = inject('plateList')
 const cityList = inject('cityList')
 const isUseList = inject('isUseList')
 const cardTypeList = inject('cardTypeList')

+ 10 - 0
src/views/user/parts/user/company.vue

@@ -231,6 +231,7 @@ import { cloneDeep, get } from 'lodash-es'
 const $checkRes = inject('$checkRes')
 // 接口
 import { CompanyYearStore } from '@/store/api/user/companyYear'
+import { watch } from 'vue'
 const yearStore = CompanyYearStore()
 const activeName = ref('first')
 // 表单
@@ -324,6 +325,15 @@ const toClose = () => {
   yearForm.value = {}
   dialog.value = { show: false }
 }
+watch(
+  form,
+  () => {
+    if (!form.value.logo) form.value.logo = []
+  },
+  {
+    immediate: true //初始化立即执行
+  }
+)
 </script>
 <style scoped lang="scss">
 .index {

+ 29 - 0
src/views/user/parts/user/expert.vue

@@ -74,6 +74,25 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item label="产业类型" prop="industry_type">
+            <el-input size="large" clearable v-model="form.industry_type" placeholder="请输入产业类型" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="工作类型" prop="work_type">
+            <el-input size="large" clearable v-model="form.work_type" placeholder="请输入工作类型" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-col :span="24">
+        <el-form-item label="所属产业" prop="industry">
+          <el-checkbox-group v-model="form.industry">
+            <el-checkbox v-for="(item, index) in sectorList" :key="index" :value="item.title">{{ item.title }}</el-checkbox>
+          </el-checkbox-group>
+        </el-form-item>
+      </el-col>
       <el-col :span="24">
         <el-form-item label="简介" prop="brief">
           <el-input v-model="form.brief" :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" placeholder="请输入简介" />
@@ -100,6 +119,7 @@ const form = inject('form')
 // 字典表
 const fieldList = inject('fieldList')
 const educationList = inject('educationList')
+const sectorList = inject('sectorList')
 const cityList = inject('cityList')
 const isUseList = inject('isUseList')
 const cardTypeList = inject('cardTypeList')
@@ -110,5 +130,14 @@ const onUpload = (e) => {
   const { model, value } = e
   form.value[model] = value
 }
+watch(
+  form,
+  () => {
+    if (!form.value.icon) form.value.icon = []
+  },
+  {
+    immediate: true //初始化立即执行
+  }
+)
 </script>
 <style scoped lang="scss"></style>

+ 9 - 0
src/views/user/parts/user/incubator.vue

@@ -341,6 +341,15 @@ const toClose = () => {
   yearForm.value = {}
   dialog.value = { show: false }
 }
+watch(
+  form,
+  () => {
+    if (!form.value.logo) form.value.logo = []
+  },
+  {
+    immediate: true //初始化立即执行
+  }
+)
 </script>
 <style scoped lang="scss">
 .index {