| | |
| | | <!-- <p class="text-center xieyi">注册协议</p> --> |
| | | </div> |
| | | </div> |
| | | <div v-else-if="active == 1" class="flex justify-center mt-5"> |
| | | <div |
| | | v-else-if="active == 1" |
| | | v-loading="isLoading" |
| | | class="flex justify-center mt-5" |
| | | > |
| | | <el-form |
| | | ref="ruleFormRef" |
| | | style="width: 95%" |
| | |
| | | <div v-if="active !== 3" class="mx-auto pt-2 pb-5 flex justify-center"> |
| | | <el-button :disabled="active == 1" @click="backStep">上一步</el-button> |
| | | <el-button type="primary" @click="nextStep(ruleFormRef)" |
| | | ><span v-if="active == 1">同意</span>下一步</el-button |
| | | ><span v-if="active == 0">同意</span>下一步</el-button |
| | | > |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | <script setup lang="tsx"> |
| | | import { h, ref, reactive, onMounted } from "vue"; |
| | | import { useNav } from "@/layout/hooks/useNav"; |
| | | import { useUserStoreHook } from "@/store/modules/user"; |
| | | import type { FormInstance, FormRules, UploadProps } from "element-plus"; |
| | | import { message } from "@/utils/message"; |
| | | import { baseUrlApi } from "@/api/util"; |
| | |
| | | import { |
| | | enterpriseTypes, |
| | | createrExRolsInformation |
| | | } from "@/api/register/index.ts"; |
| | | } from "@/api/register/index"; |
| | | import { cloneDeep } from "@pureadmin/utils"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import { useRoute, useRouter } from "vue-router"; |
| | | const router = useRouter(); |
| | | const route = useRoute(); |
| | | const { route } = useNav(); |
| | | |
| | | defineOptions({ |
| | | name: "RegisterNav" |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | const isLoading = ref(false); |
| | | const state = reactive({ |
| | | headers: { |
| | | // Accept: "application/json, text/plain, */*", |
| | |
| | | enterpriseType: [ |
| | | { required: true, message: "请选择企业类型", trigger: "change" } |
| | | ], |
| | | // transactionCode: [ |
| | | // { required: true, message: "请输入交易主体代码", trigger: "blur" }, |
| | | // { min: 1, message: "交易主体代码最小长度为1", trigger: "blur" } |
| | | // ], |
| | | // transactionName: [ |
| | | // { required: true, message: "请输入交易主体名称", trigger: "blur" } |
| | | // ], |
| | | businessLicense: [ |
| | | { required: true, message: "请上传营业执照", trigger: "change" } |
| | | ], |
| | |
| | | }; |
| | | // 页面初始化 |
| | | onMounted(async () => { |
| | | state.ruleForm.transactionCode = route.query.code; |
| | | // 企业类型 |
| | | let nowRole = useUserStoreHook()?.exRoles; |
| | | if (nowRole.length >= 1 && !route.query.code) { |
| | | state.ruleForm.transactionCode = nowRole[0].code; |
| | | } else { |
| | | state.ruleForm.transactionCode = route.query.code; |
| | | } |
| | | |
| | | let res = await enterpriseTypes(); |
| | | state.enterpriseList = res?.result; |
| | | }); |
| | | let active = ref(0); |
| | | const nextStep = async (formEl: FormInstance | undefined) => { |
| | | console.log(state.ruleForm); |
| | | |
| | | if (active.value >= 1) { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | |
| | | type: "error" |
| | | }); |
| | | } |
| | | isLoading.value = false; |
| | | }; |
| | | |
| | | const handleAvatarSuccessLegalRepresentative: UploadProps["onSuccess"] = ( |
| | |
| | | type: "error" |
| | | }); |
| | | } |
| | | isLoading.value = false; |
| | | }; |
| | | |
| | | const handleAvatarSuccessOperator: UploadProps["onSuccess"] = ( |
| | |
| | | type: "error" |
| | | }); |
| | | } |
| | | isLoading.value = false; |
| | | }; |
| | | |
| | | const beforeAvatarUpload: UploadProps["beforeUpload"] = rawFile => { |
| | | isLoading.value = true; |
| | | // if (rawFile.type !== "image/jpeg") { |
| | | // message(`请上传jpeg类型的图片`, { |
| | | // type: "error" |