'处理字典选择、展示处理'
This commit is contained in:
@ -23,6 +23,8 @@ import { qcckPost } from "@/api/qcckApi.js";
|
||||
import FormMessage from '@/components/aboutTable/FormMessage.vue'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { D_BAXX_GWLX } = proxy.$dict("D_BAXX_GWLX")
|
||||
|
||||
const title = ref('新增培训人员')
|
||||
const loading = ref(false)
|
||||
const disabled = ref(false)
|
||||
@ -59,7 +61,7 @@ const formList = reactive([
|
||||
[
|
||||
{ label: "居住地址", prop: "jzdz", type: "input" },
|
||||
{ label: "申请时间", prop: "xtCjsj", type: "date" },
|
||||
{ label: "岗位", prop: "gw", type: "input" },
|
||||
{ label: "岗位", prop: "gw", type: "select", options: D_BAXX_GWLX },
|
||||
],
|
||||
[
|
||||
{ label: "身份证正面", prop: "ryzpzm", type: "upload", limit: 1 },
|
||||
|
||||
@ -1,82 +0,0 @@
|
||||
<template>
|
||||
<el-dialog class="dialogWerapper" width="30%" v-model="modelValue" :title="title" @close="handleClose">
|
||||
<form-message ref="FormRef" :disabled="disabled" v-model="formData" :rules="rules" :formList="formList" />
|
||||
|
||||
<template #footer>
|
||||
<el-button type="primary" v-if="!disabled" :loading="loading" @click="handleSubmit">确定</el-button>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref, reactive, getCurrentInstance } from 'vue';
|
||||
import FormMessage from '@/components/aboutTable/FormMessage.vue'
|
||||
import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { D_BAXX_DWLX } = proxy.$dict("D_BAXX_DWLX")
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
})
|
||||
|
||||
const emits = defineEmits(['update:modelValue', 'refresh'])
|
||||
|
||||
const visible = computed({
|
||||
get() {
|
||||
return props.modelValue
|
||||
},
|
||||
set(val) {
|
||||
emits('update:modelValue', val)
|
||||
}
|
||||
})
|
||||
|
||||
const title = ref('上传资料')
|
||||
const loading = ref(false)
|
||||
const disabled = ref(false)
|
||||
const FormRef = ref(null)
|
||||
const formData = ref({})
|
||||
|
||||
const formList = reactive([
|
||||
[
|
||||
{ label: "上传资料", prop: "zl", type: "upload", limit: 3 },
|
||||
],
|
||||
])
|
||||
|
||||
const rules = {
|
||||
zl: [{ required: true, message: "请上传资料", trigger: "change" }],
|
||||
}
|
||||
|
||||
const open = (row = {}, type = 'updata') => {
|
||||
visible.value = true
|
||||
disabled.value = false
|
||||
formData.value = { ...row }
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
FormRef.value?.reset()
|
||||
visible.value = false
|
||||
}
|
||||
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
loading.value = true
|
||||
await FormRef.value.submit(async () => {
|
||||
await qcckPost({ ...formData.value }, `/mosty-base/baxx/basq/edit`)
|
||||
proxy.$message.success('上传资料成功')
|
||||
emits('refresh')
|
||||
visible.value = false
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
proxy.$message.error('上传资料失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
@ -13,14 +13,17 @@
|
||||
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
||||
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth">
|
||||
<template #pxgs="{ row }">
|
||||
{{ row?.pxgs === '01' ? `是` : `否` }}
|
||||
{{ row?.ryzpzm && row?.ryzpfm && row?.tjbg && row?.wfzzmjl ? `是` : `否` }}
|
||||
</template>
|
||||
<template #sfpx="{ row }">
|
||||
{{ row?.sfpx === '01' ? `否` : `是` }}
|
||||
</template>
|
||||
<template #gw="{ row }">
|
||||
<DictTag :value="row.gw" :options="D_BAXX_GWLX" />
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<template #controls="{ row }">
|
||||
<el-link type="success" v-if="row?.pxgs !== '01'" @click="addEdit('upload', row)">上传资料</el-link>
|
||||
<el-link type="success" @click="addEdit('upload', row)">上传资料</el-link>
|
||||
<el-link type="danger" @click="handleDelete([row.id])">删除</el-link>
|
||||
<el-link type="warning" @click="addEdit('view', row)">详情</el-link>
|
||||
<el-link type="primary" @click="addEdit('select', row)">提交培训公司</el-link>
|
||||
@ -35,7 +38,6 @@
|
||||
|
||||
<add-trainer-dialog v-model="isVisible" ref="trainerRef" @refresh="getList" />
|
||||
<select-ttaning-dialog ref="selectTtaningRef" v-model="dialogVisible" @refresh="getList" />
|
||||
<upload-data-dialog ref="uploadDataRef" v-model="uploadVisible" @refresh="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -47,16 +49,14 @@ import Search from '@/components/aboutTable/Search.vue';
|
||||
import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js";
|
||||
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
||||
import AddTrainerDialog from "./components/addTrainerDialog.vue";
|
||||
import UploadDataDialog from "./components/uploadDataDialog.vue";
|
||||
import selectTtaningDialog from "./components/selectTtaningDialog.vue";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { D_BAXX_GWLX } = proxy.$dict("D_BAXX_GWLX")
|
||||
const trainerRef = ref(null);
|
||||
const selectTtaningRef = ref(null);
|
||||
const uploadDataRef = ref(null);
|
||||
const queryFrom = ref({});
|
||||
const isVisible = ref(false);
|
||||
const uploadVisible = ref(false);
|
||||
const dialogVisible = ref(false);
|
||||
const searchBox = ref(null);
|
||||
const searchConfiger = ref([
|
||||
@ -98,7 +98,7 @@ const pageData = reactive({
|
||||
{ label: "姓名", prop: "xm" },
|
||||
{ label: "证件号码", prop: "zjhm" },
|
||||
{ label: "联系方式", prop: "lxdh" },
|
||||
{ label: "岗位", prop: "gw" },
|
||||
{ label: "岗位", prop: "gw", showSolt: true },
|
||||
{ label: "申请时间", prop: "xtCjsj" },
|
||||
{ label: "是否上传资料", prop: "pxgs", showSolt: true },
|
||||
{ label: "是否线上培训", prop: "sfpx", showSolt: true },
|
||||
@ -117,8 +117,6 @@ const tabHeightFn = () => {
|
||||
const addEdit = (type, row) => {
|
||||
if (type === 'select') {
|
||||
selectTtaningRef.value.open(row, type);
|
||||
} else if (type === 'upload') {
|
||||
uploadDataRef.value.open(row, type);
|
||||
} else {
|
||||
trainerRef.value.open(row, type);
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ import { qcckPost } from "@/api/qcckApi.js";
|
||||
import FormMessage from '@/components/aboutTable/FormMessage.vue'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { D_BZ_WHCD } = proxy.$dict("D_BZ_WHCD");
|
||||
const { D_BZ_WHCD, D_BAXX_GWLX } = proxy.$dict("D_BZ_WHCD", "D_BAXX_GWLX");
|
||||
const title = ref('新增从业人员')
|
||||
const loading = ref(false)
|
||||
const disabled = ref(false)
|
||||
@ -64,7 +64,7 @@ const formList = reactive([
|
||||
{ label: "资格证类型", prop: "zgzlx", type: "input" },
|
||||
{ label: "资格证起始日期", prop: "zgzKssj", type: "date" },
|
||||
{ label: "资格证截至日期", prop: "zgzJssj", type: "date" },
|
||||
{ label: "岗位", prop: "gw", type: "input" },
|
||||
{ label: "岗位", prop: "gw", type: "select", options: D_BAXX_GWLX },
|
||||
],
|
||||
[
|
||||
{ label: "外派单位", prop: "wpdw", type: "input" },
|
||||
|
||||
@ -13,7 +13,10 @@
|
||||
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
||||
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth">
|
||||
<template #sflz="{ row }">
|
||||
<DictTag :value="row.sflz" :tag="false" :options="D_BZ_SF" />
|
||||
<DictTag :value="row.newSflz" :options="D_BZ_SF" />
|
||||
</template>
|
||||
<template #gw="{ row }">
|
||||
<DictTag :value="row.gw" :options="D_BAXX_GWLX" />
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<template #controls="{ row }">
|
||||
@ -43,7 +46,7 @@ import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js";
|
||||
import AddPractitionerDialog from "./components/addPractitionerDialog.vue";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { D_BZ_SF } = proxy.$dict("D_BZ_SF");
|
||||
const { D_BZ_SF, D_BAXX_GWLX } = proxy.$dict("D_BZ_SF", "D_BAXX_GWLX");
|
||||
const addPractitionerRef = ref(null);
|
||||
const queryFrom = ref({});
|
||||
const isVisible = ref(false);
|
||||
@ -94,7 +97,7 @@ const pageData = reactive({
|
||||
{ label: "姓名", prop: "xm" },
|
||||
{ label: "证件号码", prop: "sfzh" },
|
||||
{ label: "联系方式", prop: "lxdh" },
|
||||
{ label: "岗位", prop: "gw" },
|
||||
{ label: "岗位", prop: "gw", showSolt: true },
|
||||
{ label: "入职时间", prop: "rzsj" },
|
||||
{ label: "外派单位", prop: "wpdw", },
|
||||
{ label: "是否在职", prop: "sflz", showSolt: true },
|
||||
@ -155,7 +158,8 @@ const getList = async () => {
|
||||
}, `/mosty-base/baxx/cyry/page`)
|
||||
|
||||
if(res) {
|
||||
pageData.tableData = res.records || [];
|
||||
// 处理sflz为null默认为0
|
||||
pageData.tableData = res.records?.map(i => ({ ...i, newSflz: i?.sflz === null ? 0 : i.sflz })) || [];
|
||||
pageData.total = res.total;
|
||||
}
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user