zs 1 rok pred
rodič
commit
f1abdbe2a1

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

@@ -194,5 +194,15 @@ export default {
     status: '审核状态',
     is_use: '是否启用',
     titleMessage: '请输入项目名称'
+  },
+  sign: {
+    name: '姓名',
+    phone: '手机号',
+    cardType: '证件类型',
+    card: '证件号码',
+    communication: '微信/QQ',
+    email: '电子邮箱',
+    remark: '备注',
+    DialogTitle: '查看报名情况'
   }
 }

+ 40 - 0
src/store/api/platform/sign.js

@@ -0,0 +1,40 @@
+import { defineStore } from 'pinia'
+import { AxiosWrapper } from '@/utils/axios-wrapper'
+import { get } from 'lodash-es'
+const url = '/sign'
+const axios = new AxiosWrapper()
+
+export const SignStore = defineStore('sign', () => {
+  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 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
+  }
+  return {
+    query,
+    fetch,
+    create,
+    update,
+    del
+  }
+})

+ 105 - 2
src/views/match/sign/index.vue

@@ -5,23 +5,126 @@
         <el-col :span="24" class="one">
           <el-button type="primary" @click="toBack()">返回</el-button>
         </el-col>
-        <el-col :span="24" class="two"> 报名管理 </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"
+          >
+            <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 #cardType>
+              <el-option
+                v-for="i in cardTypeList"
+                :key="i._id"
+                :label="i.label"
+                :value="i.value"
+              ></el-option>
+            </template>
+          </custom-form>
+        </el-col>
+      </el-row>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
+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 route = useRoute()
+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.card'), model: 'card', isSearch: true },
+  { label: t('pages.sign.communication'), model: 'communication' },
+  { label: t('pages.sign.email'), model: 'email' }
+]
+const opera = [{ label: t('common.view'), method: 'view' }]
+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.cardType'), model: 'cardType', type: 'select' },
+  { label: t('pages.sign.card'), model: 'card' },
+  { label: t('pages.sign.communication'), model: 'communication' },
+  { label: t('pages.sign.email'), model: 'email' },
+  { label: t('pages.sign.remark'), model: 'remark', type: 'textarea' }
+])
+const dialog = ref({ type: '1', show: false, title: t('pages.sign.DialogTitle') })
+const form = ref({})
+// 字典表
+const cardTypeList = ref([])
 // 加载中
 const loading = ref(false)
 // 请求
 onMounted(async () => {
   loading.value = true
+  await searchOther()
+  await search({ skip, limit })
   loading.value = false
 })
+const searchOther = async () => {
+  let result
+  // 证件类型
+  result = await dictDataStore.query({ code: 'cardType', is_use: '0' })
+  if ($checkRes(result)) cardTypeList.value = result.data
+}
+const search = async (query = { skip: 0, limit }) => {
+  const info = { skip: query.skip, limit: query.limit, ...searchForm.value, match: route.query.id }
+  const res = await store.query(info)
+  if (res.errcode == '0') {
+    data.value = res.data
+    total.value = res.total
+  }
+}
+// 查看
+const toView = async (data) => {
+  form.value = data
+  dialog.value = { type: '1', show: true, title: t('pages.user.dialogTitle') }
+}
 // 返回上一页
 const toBack = () => {
   window.history.go(-1)
 }
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.main {
+  .one {
+    text-align: right;
+  }
+}
+</style>