Sfoglia il codice sorgente

新增路演方式的报名和创建赛事

zs 8 mesi fa
parent
commit
f6f9803361

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

@@ -226,6 +226,7 @@ export default {
     industry: '行业',
     form: '类别',
     file: '封面',
+    remark: '备注',
     time: '有效期',
     money: '奖金(万元)',
     rules: '赛事规则',
@@ -235,7 +236,7 @@ export default {
     address: '地址',
     process: '赛事流程',
     is_use: '是否启用',
-    is_show: '是否在首页显示',
+    is_show: '是否公开路演人信息',
     order_num: '显示顺序',
     titleMessage: '请输入赛事名称',
     formMessage: '请选择类别',
@@ -408,6 +409,11 @@ export default {
     communication: '微信/QQ',
     email: '电子邮箱',
     remark: '备注',
+    type: '报名类型',
+    company: '公司',
+    project_name: '路演名称',
+    project_brief: '路演介绍',
+    project_file: '路演附件',
     DialogTitle: '查看报名情况'
   },
   process: {

src/views/information/parts/match/sign/index.vue → src/views/information/parts/match/sign/table-1.vue


+ 171 - 0
src/views/information/parts/match/sign/table-2.vue

@@ -0,0 +1,171 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main" v-loading="loading">
+        <el-col :span="24" class="one">
+          <custom-search-bar :fields="fields.filter((f) => f.isSearch)" v-model="searchForm" @search="search" @reset="toReset">
+            <template #type>
+              <el-option v-for="i in signTypeList" :key="i.id" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </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-col>
+      </el-col>
+    </el-row>
+    <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" :useSave="false">
+            <template #type>
+              <el-option v-for="i in signTypeList" :key="i.id" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #project_file>
+              <custom-upload model="project_file" :list="form.project_file" :limit="4" url="/files/web/cxyy_sign/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>
+import { cloneDeep, get } from 'lodash-es'
+const $checkRes = inject('$checkRes')
+const { t } = useI18n()
+// 接口
+import { SignStore } from '@/store/api/platform/sign'
+import { DictDataStore } from '@/store/api/system/dictData'
+const store = SignStore()
+const dictDataStore = DictDataStore()
+
+const data = ref([])
+const searchForm = ref({})
+const fields = [
+  { label: t('pages.sign.name'), model: 'name', isSearch: true },
+  { label: t('pages.sign.phone'), model: 'phone', isSearch: true },
+  { label: t('pages.sign.company'), model: 'company', isSearch: true },
+  { label: t('pages.match.type'), model: 'type', isSearch: true, type: 'select', format: (i) => getDict(i, 'type') },
+  { 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' }
+]
+let skip = 0
+let limit = inject('limit')
+const total = ref(0)
+const formFields = ref([
+  { label: t('pages.sign.name'), model: 'name' },
+  { label: t('pages.sign.phone'), model: 'phone' },
+  { label: t('pages.sign.type'), model: 'type', type: 'select' },
+  { label: t('pages.sign.company'), model: 'company' },
+  { label: t('pages.sign.project_name'), model: 'project_name', display: () => form.value.type == '1' },
+  { label: t('pages.sign.project_brief'), model: 'project_brief', type: 'textarea', display: () => form.value.type == '1' },
+  { label: t('pages.sign.project_file'), model: 'project_file', custom: true, display: () => form.value.type == '1' }
+])
+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 signTypeList = ref([])
+// 加载中
+const loading = ref(false)
+const searchOther = async () => {
+  let result
+  // 证件类型
+  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
+  // 报名类型
+  result = await dictDataStore.query({ code: 'signType', is_use: '0' })
+  if ($checkRes(result)) signTypeList.value = result.data
+}
+const props = defineProps({
+  matchInfo: { type: Object }
+})
+const match = computed({
+  get() {
+    return props.matchInfo
+  }
+})
+const id = ref('')
+const search = async (query = { skip, limit }) => {
+  skip = query.skip
+  limit = query.limit
+  const info = { skip: query.skip, limit: query.limit, ...searchForm.value, match: id.value }
+  const res = await store.query(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)
+    if (model == 'type') res = signTypeList.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({ id: data.id, status: data.status })
+  if ($checkRes(res, true)) {
+    search({ skip, limit })
+    toClose()
+  }
+}
+const toClose = () => {
+  examForm.value = {}
+  dialog.value = { show: false }
+}
+watch(
+  match,
+  async (item) => {
+    id.value = item.id
+    loading.value = true
+    await searchOther()
+    await search({ skip, limit })
+    loading.value = false
+  },
+  {
+    immediate: true //初始化立即执行
+  }
+)
+</script>
+<style scoped lang="scss"></style>

+ 6 - 3
src/views/information/parts/platform/match.vue

@@ -156,7 +156,8 @@
         </custom-form>
       </el-col>
       <el-col :span="24" v-if="dialog.type === '3'">
-        <sign :matchInfo="matchInfo"></sign>
+        <table2 v-if="matchInfo.form == '3'" :matchInfo="matchInfo"></table2>
+        <table1 v-else :matchInfo="matchInfo"></table1>
       </el-col>
       <el-col :span="24" v-if="dialog.type === '4'">
         <score :matchInfo="matchInfo"></score>
@@ -172,7 +173,8 @@ import { cloneDeep, get } from 'lodash-es'
 const $checkRes = inject('$checkRes')
 const { t } = useI18n()
 // 组件
-import sign from '../match/sign/index.vue'
+import table1 from '../match/sign/table-1.vue'
+import table2 from '../match/sign/table-2.vue'
 import score from '../match/score/index.vue'
 // 接口
 import { MatchStore } from '@/store/api/platform/match'
@@ -197,7 +199,7 @@ const fields = [
   { label: t('pages.match.status'), model: 'status', format: (i) => getDict(i, 'status') }
 ]
 const opera = [
-  { label: t('common.score'), method: 'score', display: (i) => i.match_status == '2' },
+  { label: t('common.score'), method: 'score', display: (i) => i.match_status == '2' && i.form != '3' },
   { label: t('common.sign'), method: 'sign', type: 'warning' },
   {
     label: t('common.update'),
@@ -255,6 +257,7 @@ const oneformFields = ref([
   { label: t('pages.match.order_num'), model: 'order_num', type: 'number' },
   { label: t('pages.match.video'), model: 'video', custom: true },
   { label: t('pages.match.address'), model: 'address', type: 'textarea' },
+  { label: t('pages.match.remark'), model: 'remark', type: 'textarea', display: () => form.value.form == '3' },
   { label: t('pages.match.match_status'), model: 'match_status', type: 'select' }
 ])
 const twoformFields = ref([