|
@@ -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>
|