Browse Source

修改报名管理

zs 10 months ago
parent
commit
26163d34ea

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

@@ -342,6 +342,7 @@ export default {
     phone: '手机号',
     cardType: '证件类型',
     card: '证件号码',
+    time: '报名时间',
     communication: '微信/QQ',
     email: '电子邮箱',
     remark: '备注',

+ 1 - 1
src/utils/axios-wrapper.js

@@ -11,7 +11,7 @@ import * as crypto from './crypto'
 import { ElMessage, ElMessageBox } from 'element-plus'
 let currentRequests = 0
 const { VITE_APP_BASE_API, VITE_USE_CRYPTO } = import.meta.env
-const userErrorCodeList = ['NOT_LOGIN', 'ACCOUNT_HAS_EXPIRED', 'ACCOUNT_LOGGED_IN_ELESWHERE', 'USER_NOT_FOUND', 'USER_IS_DISABLED', 'ROLE_IS_DISABLED']
+const userErrorCodeList = ['NOT_LOGIN', 'ACCOUNT_HAS_EXPIRED', 'ACCOUNT_LOGGED_IN_ELESWHERE', 'USER_NOT_FOUND', 'USER_IS_DISABLED', 'ROLE_IS_DISABLED', 'SERVICE_REPEAT']
 export class AxiosWrapper {
   constructor({ baseUrl = VITE_APP_BASE_API, unwrap = true } = {}) {
     this.baseUrl = baseUrl

+ 5 - 1
src/views/match/info/index.vue

@@ -28,6 +28,9 @@
             <template #industry>
               <el-option v-for="i in sectorList" :key="i.id" :label="i.title" :value="i.title"></el-option>
             </template>
+            <template #match_status>
+              <el-option v-for="i in matchList" :key="i.id" :label="i.label" :value="i.value"></el-option>
+            </template>
             <template #type>
               <el-option v-for="i in typeList" :key="i.id" :label="i.label" :value="i.value"></el-option>
             </template>
@@ -167,7 +170,8 @@ const formFields = ref([
   { label: t('pages.match.time'), model: 'time', type: 'daterange' },
   { label: t('pages.match.is_use'), model: 'is_use', type: 'radio' },
   { label: t('pages.match.rules'), model: 'rules', custom: true },
-  { label: t('pages.match.brief'), model: 'brief', custom: true }
+  { label: t('pages.match.brief'), model: 'brief', custom: true },
+  { label: t('pages.match.match_status'), model: 'match_status', type: 'select' }
 ])
 const rules = reactive({
   name: [{ required: true, message: t('pages.match.titleMessage'), trigger: 'blur' }]

+ 52 - 3
src/views/match/sign/index.vue

@@ -7,7 +7,7 @@
         </el-col>
         <el-col :span="24" class="two">
           <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">
+          <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>
@@ -25,12 +25,20 @@
             </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>
+import { cloneDeep, get } from 'lodash-es'
 const $checkRes = inject('$checkRes')
 const { t } = useI18n()
 // 接口
@@ -47,9 +55,14 @@ const fields = [
   { label: t('pages.sign.phone'), model: 'phone', isSearch: true },
   { label: t('pages.sign.card'), model: 'card', isSearch: true },
   { label: t('pages.sign.communication'), model: 'communication' },
-  { label: t('pages.sign.email'), model: 'email' }
+  { label: t('pages.sign.email'), model: 'email' },
+  { label: t('pages.sign.time'), model: 'time' },
+  { label: t('pages.match.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 === '0' }
 ]
-const opera = [{ label: t('common.view'), method: 'view' }]
 let skip = 0
 let limit = inject('limit')
 const total = ref(0)
@@ -64,8 +77,15 @@ const formFields = ref([
 ])
 const dialog = ref({ type: '1', show: false, title: t('pages.sign.DialogTitle') })
 const form = ref({})
+// 审核
+const examFormFields = [{ label: t('pages.match.status'), model: 'status', type: 'select' }]
+const examRules = reactive({
+  status: [{ required: true, message: t('common.statusMessage'), trigger: 'blur' }]
+})
+const examForm = ref({})
 // 字典表
 const cardTypeList = ref([])
+const statusList = ref([])
 // 加载中
 const loading = ref(false)
 // 请求
@@ -80,6 +100,9 @@ const searchOther = async () => {
   // 证件类型
   result = await dictDataStore.query({ code: 'cardType', is_use: '0' })
   if ($checkRes(result)) cardTypeList.value = result.data
+  // 状态
+  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
@@ -91,11 +114,37 @@ const search = async (query = { skip, limit }) => {
     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 = async (data) => {
   form.value = data
   dialog.value = { type: '1', show: true, title: t('pages.user.dialogTitle') }
 }
+// 审核
+const toExam = (data) => {
+  examForm.value = data
+  dialog.value = { type: '2', show: true, title: t('pages.match.examDialogTitle') }
+}
+// 审核保存
+const toExamSave = async () => {
+  const data = cloneDeep(examForm.value)
+  let res = await store.update(data)
+  if ($checkRes(res, true)) {
+    search({ skip, limit })
+    toClose()
+  }
+}
+const toClose = () => {
+  examForm.value = {}
+  dialog.value = { show: false }
+}
 // 返回上一页
 const toBack = () => {
   window.history.go(-1)