zhxy-jsd/src/pages/view/hr/teacherProfile/RecordMaterials.vue

165 lines
3.5 KiB
Vue
Raw Normal View History

2025-04-22 10:22:33 +08:00
<template>
<BasicLayout>
<view class="p-15">
<BasicForm @register="register"> </BasicForm>
<BasicSign ref="signCompRef" :title="signTitle"></BasicSign>
</view>
<template #bottom>
<view class="flex-row items-center pb-10 pt-5">
<u-button
text="返回"
class="ml-15 mr-7"
:plain="true"
@click="navigateBack"
/>
<u-button
text="签名"
class="mr-15 mr-7"
type="primary"
@click="submit"
/>
</view>
</template>
</BasicLayout>
</template>
<script setup lang="ts">
import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
2025-06-04 20:52:34 +08:00
import {
hideLoading,
navigateBack,
navigateTo,
showLoading,
} from "@/utils/uniapp";
2025-04-22 10:22:33 +08:00
import { cloneDeep } from "lodash";
const leaveId = ref<string | null>(null);
const signCompRef = ref<any>(null);
import { useForm } from "@/components/BasicForm/hooks/useForm";
2025-05-13 15:39:44 +08:00
import { useDataStore } from "@/store/modules/data";
import { jsConfirmJsDataApi } from "@/api/base/server";
2025-04-22 10:22:33 +08:00
2025-05-13 15:39:44 +08:00
const signTitle = ref<string>("签名");
const [register, { getValue, setValue }] = useForm({
2025-04-22 10:22:33 +08:00
formsProps: {
labelWidth: 120,
},
schema: [
{
2025-05-13 15:39:44 +08:00
field: "sfzrxy",
label: "身份证人像页",
2025-04-22 10:22:33 +08:00
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
componentProps: {},
},
{
2025-05-13 15:39:44 +08:00
field: "sfzghy",
label: "身份证国徽页",
2025-04-22 10:22:33 +08:00
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
componentProps: {},
},
{
2025-05-13 15:39:44 +08:00
field: "dyxlbyz",
2025-04-22 10:22:33 +08:00
label: "第一学历毕业证",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
componentProps: {},
},
{
2025-05-13 15:39:44 +08:00
field: "dyxlxwz",
2025-04-22 10:22:33 +08:00
label: "第一学历学位证",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
componentProps: {},
},
{
2025-05-13 15:39:44 +08:00
field: "zgxlbyz",
2025-04-22 10:22:33 +08:00
label: "最高学历毕业证",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
componentProps: {},
},
{
2025-05-13 15:39:44 +08:00
field: "zgxlxwz",
2025-04-22 10:22:33 +08:00
label: "最高学历学位证",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
componentProps: {},
},
{
2025-05-13 15:39:44 +08:00
field: "pthzm",
2025-04-22 10:22:33 +08:00
label: "普通话证明",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
componentProps: {},
},
{
2025-05-13 15:39:44 +08:00
field: "jszgz",
2025-04-22 10:22:33 +08:00
label: "教师资格证",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
componentProps: {},
},
],
});
2025-05-13 15:39:44 +08:00
const { getFile, setFile } = useDataStore();
setValue(getFile);
const sign_file = ref<string>("");
2025-04-22 10:22:33 +08:00
async function submit() {
2025-05-13 15:39:44 +08:00
const value = await getValue();
if (!sign_file.value) {
const data = await signCompRef.value.getSyncSignature();
sign_file.value = data.base64;
}
showLoading("提交中...");
const params = {
...getFile,
...value,
sign_file: sign_file.value,
};
setFile(params);
const res = await jsConfirmJsDataApi(params);
hideLoading();
if (res.resultCode === 1) {
uni.showToast({
title: "提交成功",
icon: "success",
});
2025-06-04 20:52:34 +08:00
setTimeout(() => {
uni.redirectTo({
url: "/pages/system/launchPage/launchPage",
});
}, 1500);
2025-05-13 15:39:44 +08:00
} else {
uni.showToast({
title: "提交失败",
icon: "none",
});
}
2025-04-22 10:22:33 +08:00
}
</script>
2025-05-13 15:39:44 +08:00
<style lang="scss" scoped></style>