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