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

183 lines
4.1 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
2025-06-10 23:40:49 +08:00
text="上一步"
2025-04-22 10:22:33 +08:00
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";
2025-06-04 20:52:34 +08:00
import {
hideLoading,
navigateBack,
showLoading,
} from "@/utils/uniapp";
2025-04-22 10:22:33 +08:00
const signCompRef = ref<any>(null);
2025-07-18 14:20:12 +08:00
import { imagUrl } from "@/utils";
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";
import { jsConfirmJsDataApi } from "@/api/base/server";
2025-07-18 14:20:12 +08:00
import { useUserStore } from "@/store/modules/user";
const { getJs, setJs } = useUserStore();
const { getGlobal } = useDataStore();
2025-04-22 10:22:33 +08:00
2025-05-13 15:39:44 +08:00
const signTitle = ref<string>("签名");
2025-07-18 14:20:12 +08:00
const componentProps = {
multiple: false, // 禁止多选
maxCount: 1 // 限制最多显示一个文件
}
2025-05-13 15:39:44 +08:00
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",
},
2025-07-18 14:20:12 +08:00
componentProps: componentProps,
2025-04-22 10:22:33 +08:00
},
{
2025-05-13 15:39:44 +08:00
field: "sfzghy",
label: "身份证国徽页",
2025-04-22 10:22:33 +08:00
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
2025-07-18 14:20:12 +08:00
componentProps: componentProps,
2025-04-22 10:22:33 +08:00
},
{
2025-05-13 15:39:44 +08:00
field: "dyxlbyz",
2025-04-22 10:22:33 +08:00
label: "第一学历毕业证",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
2025-07-18 14:20:12 +08:00
componentProps: componentProps,
2025-04-22 10:22:33 +08:00
},
{
2025-05-13 15:39:44 +08:00
field: "dyxlxwz",
2025-04-22 10:22:33 +08:00
label: "第一学历学位证",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
2025-07-18 14:20:12 +08:00
componentProps: componentProps,
2025-04-22 10:22:33 +08:00
},
{
2025-05-13 15:39:44 +08:00
field: "zgxlbyz",
2025-04-22 10:22:33 +08:00
label: "最高学历毕业证",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
2025-07-18 14:20:12 +08:00
componentProps: componentProps,
2025-04-22 10:22:33 +08:00
},
{
2025-05-13 15:39:44 +08:00
field: "zgxlxwz",
2025-04-22 10:22:33 +08:00
label: "最高学历学位证",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
2025-07-18 14:20:12 +08:00
componentProps: componentProps,
2025-04-22 10:22:33 +08:00
},
{
2025-05-13 15:39:44 +08:00
field: "pthzm",
2025-04-22 10:22:33 +08:00
label: "普通话证明",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
2025-07-18 14:20:12 +08:00
componentProps: componentProps,
2025-04-22 10:22:33 +08:00
},
{
2025-05-13 15:39:44 +08:00
field: "jszgz",
2025-04-22 10:22:33 +08:00
label: "教师资格证",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
},
2025-07-18 14:20:12 +08:00
componentProps: componentProps,
2025-04-22 10:22:33 +08:00
},
],
});
2025-07-18 14:20:12 +08:00
const srcData = {
sfzrxy: imagUrl(getJs.sfzrxy),
sfzghy: imagUrl(getJs.sfzghy),
dyxlbyz: imagUrl(getJs.dyxlbyz),
dyxlxwz: imagUrl(getJs.dyxlxwz),
zgxlbyz: imagUrl(getJs.zgxlbyz),
zgxlxwz: imagUrl(getJs.zgxlxwz),
pthzm: imagUrl(getJs.pthzm),
jszgz: imagUrl(getJs.jszgz),
}
setValue(srcData);
2025-05-13 15:39:44 +08:00
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 = {
2025-07-18 14:20:12 +08:00
...getJs,
2025-05-13 15:39:44 +08:00
...value,
2025-08-02 11:15:22 +08:00
signFile: sign_file.value,
2025-05-13 15:39:44 +08:00
};
2025-07-18 14:20:12 +08:00
setJs(params);
2025-05-13 15:39:44 +08:00
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({
2025-06-04 21:31:44 +08:00
url:
"/pages/system/launchPage/launchPage?openId=" +
getGlobal.openId +
(getGlobal.type ? "&type=" + getGlobal.type : ""),
2025-06-04 20:52:34 +08:00
});
}, 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>