190 lines
4.2 KiB
Vue
Raw Normal View History

2025-04-22 10:22:33 +08:00
<template>
<BasicLayout>
<view class="p-15">
<view v-if="education.xl.length > 0">
<template v-for="(item, index) in education.xl" :key="index">
<view class="po-re mb-15">
<BasicForm
v-model="item.value"
:schema="schema"
:formsProps="{ labelWidth: 100 }"
/>
<view
@click="deleteMemberFamily(index as number, item.value)"
class="delete-icon"
>
<BasicIcon type="clear" size="30" />
</view>
</view>
</template>
</view>
<view
class="flex-row items-center justify-center pb-10 pt-5"
2025-05-13 15:39:44 +08:00
style="border: 1px solid #e8e8e8"
2025-04-22 10:22:33 +08:00
@click="addEducation"
>
<uni-icons type="plus" size="16" color="#447ADE"></uni-icons>
<view class="ml-5 cor-447ADE">新增</view>
</view>
</view>
<template #bottom>
<view class="flex-row items-center pb-10 pt-5">
2025-05-13 15:39:44 +08:00
<u-button
2025-06-10 16:27:34 +08:00
text="上一步"
2025-05-13 15:39:44 +08:00
class="ml-15 mr-7"
:plain="true"
@click="navigateBack"
/>
<u-button
text="下一步"
class="mr-15 mr-7"
type="primary"
@click="submit"
/>
</view>
2025-04-22 10:22:33 +08:00
</template>
</BasicLayout>
</template>
<script lang="ts" setup>
2025-05-13 15:39:44 +08:00
import { dicApi } from "@/api/system/dic";
2025-04-22 10:22:33 +08:00
import { useForm } from "@/components/BasicForm/hooks/useForm";
2025-05-13 15:39:44 +08:00
import { useDataStore } from "@/store/modules/data";
2025-04-22 10:22:33 +08:00
import { navigateBack, navigateTo } from "@/utils/uniapp";
2025-05-13 15:39:44 +08:00
import { cloneDeep, map } from "lodash";
2025-04-22 10:22:33 +08:00
const schema = reactive<FormsSchema[]>([
{
2025-05-13 15:39:44 +08:00
field: "zcdjId",
2025-04-22 10:22:33 +08:00
label: "职称等级",
2025-05-13 15:39:44 +08:00
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 836722710 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
2025-04-22 10:22:33 +08:00
},
2025-06-04 20:52:34 +08:00
{
field: "zclbId",
label: "职称类别",
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 912140841 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
2025-04-22 10:22:33 +08:00
{
2025-05-13 15:39:44 +08:00
field: "zczyId",
2025-04-22 10:22:33 +08:00
label: "职称专业",
2025-06-10 16:27:34 +08:00
component: "BasicInput",
componentProps: {},
2025-04-22 10:22:33 +08:00
},
{
2025-05-13 15:39:44 +08:00
field: "zcspjg",
2025-04-22 10:22:33 +08:00
label: "职称审批机关",
component: "BasicInput",
componentProps: {},
},
{
2025-05-13 15:39:44 +08:00
field: "zcbzwh",
2025-04-22 10:22:33 +08:00
label: "职称批准文号",
component: "BasicInput",
componentProps: {},
},
{
2025-05-13 15:39:44 +08:00
field: "zcpztime",
2025-04-22 10:22:33 +08:00
label: "职称批准年月",
2025-05-13 15:39:44 +08:00
component: "BasicDateTimes",
2025-04-22 10:22:33 +08:00
componentProps: {},
},
{
2025-05-13 15:39:44 +08:00
field: "zczsbh",
2025-04-22 10:22:33 +08:00
label: "职称证书编号",
component: "BasicInput",
componentProps: {},
},
2025-06-04 20:52:34 +08:00
{
field: "pydj",
label: "聘用等级",
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 1982857463 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "qqtime",
label: "起聘时间",
component: "BasicDateTimes",
componentProps: {},
},
{
field: "pywjh",
label: "聘用文件号",
component: "BasicInput",
componentProps: {},
},
2025-06-10 16:27:34 +08:00
{
field: "pywjh",
label: "上传任职文件",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
componentProps: {},
},
{
field: "pywjh",
label: "上传聘用文件",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
componentProps: {},
},
2025-04-22 10:22:33 +08:00
]);
2025-05-13 15:39:44 +08:00
const { getFile, setFile } = useDataStore();
2025-04-22 10:22:33 +08:00
const education = reactive<any>({
xl: [{ value: {} }],
});
2025-05-13 15:39:44 +08:00
if (getFile.zcxxList && getFile.zcxxList.length > 0) {
education.xl = map(getFile.zcxxList, (item) => {
return { value: item };
});
}
2025-04-22 10:22:33 +08:00
function addEducation() {
education.xl.push({ value: {} });
}
function deleteMemberFamily(index: number, item: any) {
const list = cloneDeep(education.xl);
list.splice(index, 1);
education.xl = list;
}
function submit() {
2025-05-13 15:39:44 +08:00
setFile({
...getFile,
zcxxList: map(education.xl, (item) => {
return item.value;
}),
});
2025-04-22 10:22:33 +08:00
navigateTo("/pages/view/hr/teacherProfile/PositionInfo");
}
</script>
<style>
.delete-icon {
position: absolute;
2025-05-13 15:39:44 +08:00
right: -13px;
top: -14px;
2025-04-22 10:22:33 +08:00
z-index: 1;
}
</style>