update:CA相关代码整理
This commit is contained in:
@@ -2,10 +2,10 @@
|
|||||||
<div class="ca_index">
|
<div class="ca_index">
|
||||||
<Space>
|
<Space>
|
||||||
<Button type="primary">
|
<Button type="primary">
|
||||||
<router-link to="/ca/user"> 个人数字证书申领入口 </router-link>
|
<router-link to="/ca/userapply"> 个人数字证书申领入口 </router-link>
|
||||||
</Button>
|
</Button>
|
||||||
<Button>
|
<Button>
|
||||||
<router-link to="/ca/composition"> 企业数字证书申领入口 </router-link>
|
<router-link to="/ca/unitapply"> 企业数字证书申领入口 </router-link>
|
||||||
</Button>
|
</Button>
|
||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
<template>
|
|
||||||
<Result
|
|
||||||
status="success"
|
|
||||||
title="您的企业已经完成数字证书申领"
|
|
||||||
sub-title="已经申领过数字证书的企业无法再次申领,如需补办请联系管理人员"
|
|
||||||
>
|
|
||||||
<template #extra>
|
|
||||||
<!-- <Button type="primary">
|
|
||||||
申请补办
|
|
||||||
</Button> -->
|
|
||||||
<Button @click="router.back()"> 返回 </Button>
|
|
||||||
</template>
|
|
||||||
</Result>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { Result, Button } from "ant-design-vue";
|
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
Result,
|
|
||||||
Button
|
|
||||||
},
|
|
||||||
setup() {
|
|
||||||
const router = useRouter();
|
|
||||||
return {
|
|
||||||
router
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,712 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="ca-apply">
|
|
||||||
<Result
|
|
||||||
v-if="isSuccess"
|
|
||||||
status="success"
|
|
||||||
title="您的企业已经完成数字证书申领"
|
|
||||||
sub-title="已经申领过数字证书的企业无法再次申领,如需补办请联系管理人员"
|
|
||||||
>
|
|
||||||
<template #extra>
|
|
||||||
<!-- <Button type="primary">
|
|
||||||
申请补办
|
|
||||||
</Button> -->
|
|
||||||
<Button @click="router.back()" type="primary"> 返回 </Button>
|
|
||||||
<Button style="margin-left: 10px" @click="toggleDrawer"
|
|
||||||
>历史提交记录</Button
|
|
||||||
>
|
|
||||||
</template>
|
|
||||||
</Result>
|
|
||||||
<Spin v-else :spinning="spining">
|
|
||||||
<Form :label-col="{ span: 9 }" :wrapper-col="{ span: 15 }">
|
|
||||||
<Row>
|
|
||||||
<Col :span="11">
|
|
||||||
<FormItem label="企业名称" v-bind="validateInfos.unitName">
|
|
||||||
<Select
|
|
||||||
v-model:value="modelRef.unitName"
|
|
||||||
@change="getTydm"
|
|
||||||
:disabled="disabledFeild"
|
|
||||||
placeholder="请选择企业名称"
|
|
||||||
>
|
|
||||||
<Option
|
|
||||||
v-for="organize in organizeList"
|
|
||||||
:key="organize.id"
|
|
||||||
:value="organize.name"
|
|
||||||
>{{ organize.name }}</Option
|
|
||||||
>
|
|
||||||
</Select>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="统一社会信用代码" v-bind="validateInfos.tydm">
|
|
||||||
<Input
|
|
||||||
v-model:value="modelRef.tydm"
|
|
||||||
readonly
|
|
||||||
:disabled="disabledFeild"
|
|
||||||
placeholder="根据企业名称自动获取"
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="经办人姓名" v-bind="validateInfos.operatorName">
|
|
||||||
<Input
|
|
||||||
v-model:value="modelRef.operatorName"
|
|
||||||
:disabled="disabledFeild"
|
|
||||||
placeholder="请输入经办人姓名"
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="经办人身份证" v-bind="validateInfos.operatorId">
|
|
||||||
<Input
|
|
||||||
v-model:value="modelRef.operatorId"
|
|
||||||
:disabled="disabledFeild"
|
|
||||||
placeholder="请输入经办人身份证号码"
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="经办人手机号" v-bind="validateInfos.operatorPhone">
|
|
||||||
<Input
|
|
||||||
v-model:value="modelRef.operatorPhone"
|
|
||||||
:disabled="disabledFeild"
|
|
||||||
placeholder="请输入经办人手机号码"
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="手机验证码" v-bind="validateInfos.phoneCode">
|
|
||||||
<Row :gutter="8">
|
|
||||||
<Col :span="12">
|
|
||||||
<Input
|
|
||||||
v-model:value="modelRef.phoneCode"
|
|
||||||
:disabled="disabledFeild"
|
|
||||||
/>
|
|
||||||
</Col>
|
|
||||||
<Col :span="12">
|
|
||||||
<Button
|
|
||||||
:disabled="disabledFeild || countdown > 0"
|
|
||||||
@click="getCode"
|
|
||||||
>
|
|
||||||
获取验证码{{ countdown > 0 ? `(${countdown})` : "" }}
|
|
||||||
</Button>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="省市区信息" v-bind="validateInfos.code">
|
|
||||||
<Cascader
|
|
||||||
v-model:value="modelRef.code"
|
|
||||||
placeholder="请选择省市区信息"
|
|
||||||
:options="areaOptions"
|
|
||||||
:load-data="loadAreaOptions"
|
|
||||||
:disabled="disabledFeild"
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="邮寄地址" v-bind="validateInfos.address">
|
|
||||||
<Input
|
|
||||||
v-model:value="modelRef.address"
|
|
||||||
:disabled="disabledFeild"
|
|
||||||
placeholder="请输入证书邮寄地址"
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
</Col>
|
|
||||||
<Col :span="11">
|
|
||||||
<FormItem label="授权委托书" v-bind="validateInfos.loaPicId">
|
|
||||||
<input v-model="modelRef.loaPicId" hidden />
|
|
||||||
<Upload
|
|
||||||
accept="image/*"
|
|
||||||
action="/api2/upload/uploadfile"
|
|
||||||
v-model:fileList="loaPicFileList"
|
|
||||||
:beforeUpload="beforeUpload"
|
|
||||||
list-type="picture"
|
|
||||||
@change="info => handleChange(info, 'loaPicId')"
|
|
||||||
:disabled="disabledUpload"
|
|
||||||
>
|
|
||||||
<Button block :disabled="disabledUpload">
|
|
||||||
<UploadOutlined />
|
|
||||||
点击{{ modelRef.loaPicId ? "替换" : "上传" }}
|
|
||||||
</Button>
|
|
||||||
</Upload>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label="身份证正面照"
|
|
||||||
v-bind="validateInfos.idCardFrontPicId"
|
|
||||||
>
|
|
||||||
<input v-model="modelRef.idCardFrontPicId" hidden />
|
|
||||||
<Upload
|
|
||||||
accept="image/*"
|
|
||||||
action="/api2/upload/uploadfile"
|
|
||||||
v-model:fileList="idCardFrontPicFileList"
|
|
||||||
:beforeUpload="beforeUpload"
|
|
||||||
list-type="picture"
|
|
||||||
@change="info => handleChange(info, 'idCardFrontPicId')"
|
|
||||||
:disabled="disabledUpload"
|
|
||||||
>
|
|
||||||
<Button block :disabled="disabledUpload">
|
|
||||||
<UploadOutlined />
|
|
||||||
点击{{ modelRef.idCardFrontPicId ? "替换" : "上传" }}
|
|
||||||
</Button>
|
|
||||||
</Upload>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label="身份证背面照"
|
|
||||||
v-bind="validateInfos.idCardBackPicId"
|
|
||||||
>
|
|
||||||
<input v-model="modelRef.idCardBackPicId" hidden />
|
|
||||||
<Upload
|
|
||||||
accept="image/*"
|
|
||||||
action="/api2/upload/uploadfile"
|
|
||||||
v-model:fileList="idCardBackPicFileList"
|
|
||||||
:beforeUpload="beforeUpload"
|
|
||||||
list-type="picture"
|
|
||||||
@change="info => handleChange(info, 'idCardBackPicId')"
|
|
||||||
:disabled="disabledUpload"
|
|
||||||
>
|
|
||||||
<Button block :disabled="disabledUpload">
|
|
||||||
<UploadOutlined />
|
|
||||||
点击{{ modelRef.idCardBackPicId ? "替换" : "上传" }}
|
|
||||||
</Button>
|
|
||||||
</Upload>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label="营业许可证照片"
|
|
||||||
v-bind="validateInfos.businessLicensePicId"
|
|
||||||
>
|
|
||||||
<input v-model="modelRef.businessLicensePicId" hidden />
|
|
||||||
<Upload
|
|
||||||
accept="image/*"
|
|
||||||
action="/api2/upload/uploadfile"
|
|
||||||
v-model:fileList="businessLicenseFileList"
|
|
||||||
:beforeUpload="beforeUpload"
|
|
||||||
list-type="picture"
|
|
||||||
@change="info => handleChange(info, 'businessLicensePicId')"
|
|
||||||
:disabled="disabledUpload"
|
|
||||||
>
|
|
||||||
<Button block :disabled="disabledUpload">
|
|
||||||
<UploadOutlined />
|
|
||||||
点击{{ modelRef.businessLicensePicId ? "替换" : "上传" }}
|
|
||||||
</Button>
|
|
||||||
</Upload>
|
|
||||||
</FormItem>
|
|
||||||
</Col>
|
|
||||||
<Col :span="2">
|
|
||||||
<FormItem>
|
|
||||||
<Popover title="说明">
|
|
||||||
<template #content>
|
|
||||||
<p>请将两页纸一起拍照或扫描上传</p>
|
|
||||||
</template>
|
|
||||||
<Button type="link"
|
|
||||||
><a
|
|
||||||
href="http://183.136.157.18:7308/stgl/sources/202102/授权书模板.doc"
|
|
||||||
download="授权书模板.doc"
|
|
||||||
target="_blank"
|
|
||||||
><DownloadOutlined />模板</a
|
|
||||||
></Button
|
|
||||||
>
|
|
||||||
</Popover>
|
|
||||||
</FormItem>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
<FormItem :wrapper-col="{ span: 12, offset: 10 }">
|
|
||||||
<Button v-if="progressingId" type="primary" @click="onSubmit"
|
|
||||||
>查询</Button
|
|
||||||
>
|
|
||||||
<Button v-else type="primary" @click="onSubmit">提交</Button>
|
|
||||||
<Button style="margin-left: 10px" @click="toggleDrawer"
|
|
||||||
>历史提交记录</Button
|
|
||||||
>
|
|
||||||
</FormItem>
|
|
||||||
</Form>
|
|
||||||
</Spin>
|
|
||||||
</div>
|
|
||||||
<Drawer
|
|
||||||
title="历史申领记录"
|
|
||||||
placement="right"
|
|
||||||
:closable="false"
|
|
||||||
v-model:visible="showDrawer"
|
|
||||||
width="450px"
|
|
||||||
>
|
|
||||||
<Empty v-if="!(unitApplyList && unitApplyList.length > 0)" />
|
|
||||||
<div
|
|
||||||
v-for="unitApply in unitApplyList"
|
|
||||||
:key="unitApply.id"
|
|
||||||
style="padding: 10px"
|
|
||||||
>
|
|
||||||
<Card size="small">
|
|
||||||
<template #title>
|
|
||||||
{{ unitApply.unitName
|
|
||||||
}}<Tag
|
|
||||||
style="margin-left:4px;"
|
|
||||||
:color="['orange', 'green', 'red'][unitApply.status]"
|
|
||||||
>{{
|
|
||||||
["进行中", "已成功", "已失败"][unitApply.status] || "未申领"
|
|
||||||
}}</Tag
|
|
||||||
>
|
|
||||||
</template>
|
|
||||||
<template #extra>
|
|
||||||
<Button
|
|
||||||
v-if="unitApply.status == 2"
|
|
||||||
type="link"
|
|
||||||
@click="modifyOrder(unitApply)"
|
|
||||||
:disabled="disabledModify"
|
|
||||||
>重新申请</Button
|
|
||||||
>
|
|
||||||
</template>
|
|
||||||
<p>
|
|
||||||
经办人: {{ unitApply.operatorName }} {{ unitApply.operatorPhone }}
|
|
||||||
</p>
|
|
||||||
<p>发起时间: {{ unitApply.time }}</p>
|
|
||||||
<p v-if="unitApply.dealReason">
|
|
||||||
不通过原因:{{ unitApply.dealReason }}
|
|
||||||
</p></Card
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</Drawer>
|
|
||||||
</template>
|
|
||||||
<style lang="less">
|
|
||||||
.ca-apply {
|
|
||||||
width: 800px;
|
|
||||||
.ant-upload {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
Form,
|
|
||||||
Row,
|
|
||||||
Col,
|
|
||||||
Button,
|
|
||||||
Input,
|
|
||||||
Cascader,
|
|
||||||
Upload,
|
|
||||||
message,
|
|
||||||
Spin,
|
|
||||||
Select,
|
|
||||||
Drawer,
|
|
||||||
Empty,
|
|
||||||
Tag,
|
|
||||||
Card,
|
|
||||||
Modal,
|
|
||||||
Result,
|
|
||||||
Popover
|
|
||||||
} from "ant-design-vue";
|
|
||||||
import { UploadOutlined, DownloadOutlined } from "@ant-design/icons-vue";
|
|
||||||
import { useForm } from "@ant-design-vue/use";
|
|
||||||
import { computed, onMounted, reactive, ref, toRaw, inject } from "vue";
|
|
||||||
import { get, post } from "@/services/http";
|
|
||||||
import regex from "@/services/regex";
|
|
||||||
import { toBit } from "@/services/util";
|
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
async function getAreaOptions(code) {
|
|
||||||
const res = await get("/api2/CA/AreaOptions", { code });
|
|
||||||
if (res.errorCode == 0) {
|
|
||||||
return res.data.map(p => ({
|
|
||||||
label: p.name,
|
|
||||||
value: p.code,
|
|
||||||
isLeaf: p.divisionLevel == 3
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const editfeildFlag = toBit("0001");
|
|
||||||
const editPicFlag = toBit("0010");
|
|
||||||
const editModifyFlag = toBit("0100");
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
Form,
|
|
||||||
FormItem: Form.Item,
|
|
||||||
Row,
|
|
||||||
Col,
|
|
||||||
Button,
|
|
||||||
Input,
|
|
||||||
Cascader,
|
|
||||||
Upload,
|
|
||||||
UploadOutlined,
|
|
||||||
Spin,
|
|
||||||
Select,
|
|
||||||
Option: Select.Option,
|
|
||||||
Drawer,
|
|
||||||
Empty,
|
|
||||||
Tag,
|
|
||||||
Card,
|
|
||||||
Result,
|
|
||||||
DownloadOutlined,
|
|
||||||
Popover
|
|
||||||
},
|
|
||||||
setup() {
|
|
||||||
const modelRef = reactive({
|
|
||||||
id: null,
|
|
||||||
orderNo: null,
|
|
||||||
unitName: null,
|
|
||||||
tydm: "",
|
|
||||||
operatorName: "",
|
|
||||||
operatorId: "",
|
|
||||||
operatorPhone: "",
|
|
||||||
phoneCode: "",
|
|
||||||
code: [],
|
|
||||||
address: "",
|
|
||||||
loaPicId: null,
|
|
||||||
idCardFrontPicId: null,
|
|
||||||
idCardBackPicId: null,
|
|
||||||
businessLicensePicId: null
|
|
||||||
});
|
|
||||||
const loaPicFileList = ref([]);
|
|
||||||
const idCardFrontPicFileList = ref([]);
|
|
||||||
const idCardBackPicFileList = ref([]);
|
|
||||||
const businessLicenseFileList = ref([]);
|
|
||||||
const rulesRef = reactive({
|
|
||||||
operatorId: [
|
|
||||||
{ required: true, message: "请输入18位身份证号码", trigger: "blur" },
|
|
||||||
{
|
|
||||||
pattern: regex.IdCardNo,
|
|
||||||
message: "输入正确的18位身份证号码",
|
|
||||||
trigger: "blur"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
operatorName: [
|
|
||||||
{ required: true, message: "请输入经办人姓名", trigger: "blur" }
|
|
||||||
],
|
|
||||||
unitName: [
|
|
||||||
{ required: true, message: "请选择企业名称", trigger: "change" }
|
|
||||||
],
|
|
||||||
operatorPhone: [
|
|
||||||
{ required: true, message: "请输入你的手机号码", trigger: "blur" },
|
|
||||||
{
|
|
||||||
pattern: regex.Phone,
|
|
||||||
message: "请输入正确的11位手机号码",
|
|
||||||
trigger: "blur"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
tydm: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请输入企业统一社会信用代码",
|
|
||||||
trigger: "blur"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: regex.Tydm,
|
|
||||||
message: "请输入正确的18位统一社会信用代码",
|
|
||||||
trigger: "blur"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
address: [{ required: true, message: "请输入邮寄信息", trigger: "blur" }],
|
|
||||||
code: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请选择省市区信息",
|
|
||||||
trigger: "blur",
|
|
||||||
transform: v => v && v.join("-")
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: /\d+-\d+-\d+/,
|
|
||||||
message: "信息不完整",
|
|
||||||
trigger: "blur",
|
|
||||||
transform: v => v && v.join("-")
|
|
||||||
}
|
|
||||||
],
|
|
||||||
loaPicId: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请上传授权承诺书照片",
|
|
||||||
trigger: "change",
|
|
||||||
type: "number"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
idCardFrontPicId: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请上传身份证正面照片",
|
|
||||||
trigger: "change",
|
|
||||||
type: "number"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
idCardBackPicId: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请上传身份证背面照片",
|
|
||||||
trigger: "change",
|
|
||||||
type: "number"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
businessLicensePicId: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请上营业执照照片",
|
|
||||||
trigger: "change",
|
|
||||||
type: "number"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
phoneCode: [
|
|
||||||
{ required: true, message: "请输入短信验证码", trigger: "change" }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
const { resetFields, validate, validateInfos } = useForm(
|
|
||||||
modelRef,
|
|
||||||
rulesRef
|
|
||||||
);
|
|
||||||
const useReload = inject("reload");
|
|
||||||
const queryUnitApply = async id => {
|
|
||||||
const res = await get("/api2/CA/QueryUnitApplyResult", {
|
|
||||||
id
|
|
||||||
});
|
|
||||||
if (res.errorCode == 0) {
|
|
||||||
Modal.success({
|
|
||||||
title: "完成",
|
|
||||||
content: "数字证书申领流程已完成",
|
|
||||||
onOk: useReload
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Modal.info({ title: "当前状态", content: res.errorMsg });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const sendUnitApply = async id => {
|
|
||||||
const resp = await get("/api2/CA/SendCreateOrder", {
|
|
||||||
orderId: id
|
|
||||||
});
|
|
||||||
if (resp.errorCode != 0) {
|
|
||||||
message.error(resp.errorMsg);
|
|
||||||
} else {
|
|
||||||
message.success("发起申请成功", 2, useReload);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const createUnitApply = async () => {
|
|
||||||
try {
|
|
||||||
await validate();
|
|
||||||
const resp = await post("/api2/CA/createUnitApply", toRaw(modelRef));
|
|
||||||
if (resp.errorCode != 0) {
|
|
||||||
message.error(resp.errorMsg);
|
|
||||||
} else {
|
|
||||||
message.success("提交成功", (onclose = useReload));
|
|
||||||
await sendUnitApply(resp.data);
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
0;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const modifyUnitApply = async () => {
|
|
||||||
try {
|
|
||||||
await validate([
|
|
||||||
"loaPicId",
|
|
||||||
"idCardFrontPicId",
|
|
||||||
"idCardBackPicId",
|
|
||||||
"businessLicensePicId"
|
|
||||||
]);
|
|
||||||
const resp = await post("/api2/CA/modifyUnitApply", toRaw(modelRef));
|
|
||||||
if (resp.errorCode != 0) {
|
|
||||||
message.error(resp.errorMsg);
|
|
||||||
} else {
|
|
||||||
message.success("提交成功", (onclose = useReload));
|
|
||||||
await sendUnitApply(resp.data);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const onSubmit = async e => {
|
|
||||||
e.preventDefault();
|
|
||||||
if (progressingId == 0) {
|
|
||||||
if (modelRef.orderNo) {
|
|
||||||
await modifyUnitApply();
|
|
||||||
} else {
|
|
||||||
await createUnitApply();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var current = toRaw(unitApplyList.value).find(
|
|
||||||
p => p.id == progressingId
|
|
||||||
);
|
|
||||||
if (current.status == null) {
|
|
||||||
await sendUnitApply(progressingId);
|
|
||||||
} else if (current.status == 0) {
|
|
||||||
await queryUnitApply(progressingId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const beforeUpload = file => {
|
|
||||||
const isJpgOrPng =
|
|
||||||
file.type === "image/jpeg" || file.type === "image/png";
|
|
||||||
if (!isJpgOrPng) {
|
|
||||||
message.error("只能上传jpeg/png格式的图片文件");
|
|
||||||
}
|
|
||||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
|
||||||
if (!isLt2M) {
|
|
||||||
message.error("文件大小超过2MB!");
|
|
||||||
}
|
|
||||||
return isJpgOrPng && isLt2M;
|
|
||||||
};
|
|
||||||
const handleChange = (info, name) => {
|
|
||||||
console.log(info.file.status, info.file, info.fileList);
|
|
||||||
// if (info.file.status !== "uploading") {
|
|
||||||
// }
|
|
||||||
if (info.file.status === "done") {
|
|
||||||
message.success(`${info.file.name} 文件上传成功`);
|
|
||||||
modelRef[name] = info.file.response.id;
|
|
||||||
if (info.fileList.length > 1) {
|
|
||||||
info.fileList.shift();
|
|
||||||
}
|
|
||||||
} else if (info.file.status === "error") {
|
|
||||||
message.error(`${info.file.name} 文件上传失败`);
|
|
||||||
info.fileList.pop();
|
|
||||||
}
|
|
||||||
if (info.file.status === "removed") {
|
|
||||||
modelRef[name] = null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const areaOptions = ref([]);
|
|
||||||
const spining = ref(false);
|
|
||||||
const organizeList = ref([]);
|
|
||||||
const loadAreaOptions = async selectedOptions => {
|
|
||||||
const targetOption = selectedOptions[selectedOptions.length - 1];
|
|
||||||
targetOption.loading = true;
|
|
||||||
const options = await getAreaOptions(targetOption.value);
|
|
||||||
if (options) {
|
|
||||||
targetOption.children = options;
|
|
||||||
}
|
|
||||||
targetOption.loading = false;
|
|
||||||
};
|
|
||||||
const getTydm = async () => {
|
|
||||||
const unitName = modelRef.unitName;
|
|
||||||
const res = await get("/api2/CA/GetTydm", { unitName });
|
|
||||||
if (res.errorCode !== 0) {
|
|
||||||
message.error(res.errorMsg);
|
|
||||||
} else {
|
|
||||||
modelRef.tydm = res.data;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const countdown = ref(0);
|
|
||||||
const getCode = async () => {
|
|
||||||
try {
|
|
||||||
await validate("operatorPhone");
|
|
||||||
} catch (error) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var res = await get("/api2/CA/GetPhoneCode", {
|
|
||||||
type: 1,
|
|
||||||
phone: modelRef.operatorPhone
|
|
||||||
});
|
|
||||||
if (res.errorCode !== 0) {
|
|
||||||
message.error(res.errorMsg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
countdown.value = 60;
|
|
||||||
var handle = setInterval(() => {
|
|
||||||
countdown.value--;
|
|
||||||
countdown.value < 0 && clearInterval(handle);
|
|
||||||
}, 1000);
|
|
||||||
};
|
|
||||||
const editStatus = ref(toBit("0000"));
|
|
||||||
const disabledFeild = computed(
|
|
||||||
() => (editStatus.value & editfeildFlag) == 0
|
|
||||||
);
|
|
||||||
const disabledUpload = computed(
|
|
||||||
() => (editStatus.value & editPicFlag) == 0
|
|
||||||
);
|
|
||||||
const disabledModify = computed(
|
|
||||||
() => (editStatus.value & editModifyFlag) == 0
|
|
||||||
);
|
|
||||||
const initPage = unitApply => {
|
|
||||||
for (const key in toRaw(modelRef)) {
|
|
||||||
if (Object.hasOwnProperty.call(unitApply, key)) {
|
|
||||||
const element = unitApply[key];
|
|
||||||
modelRef[key] = element;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
loaPicFileList.value = [
|
|
||||||
{
|
|
||||||
uid: "-1",
|
|
||||||
status: "done",
|
|
||||||
url: unitApply.loaPicPath
|
|
||||||
}
|
|
||||||
];
|
|
||||||
idCardFrontPicFileList.value = [
|
|
||||||
{
|
|
||||||
uid: "-1",
|
|
||||||
status: "done",
|
|
||||||
url: unitApply.idCardFrontPicPath
|
|
||||||
}
|
|
||||||
];
|
|
||||||
idCardBackPicFileList.value = [
|
|
||||||
{
|
|
||||||
uid: "-1",
|
|
||||||
status: "done",
|
|
||||||
url: unitApply.idCardBackPicPath
|
|
||||||
}
|
|
||||||
];
|
|
||||||
businessLicenseFileList.value = [
|
|
||||||
{
|
|
||||||
uid: "-1",
|
|
||||||
status: "done",
|
|
||||||
url: unitApply.businessLicensePicPath
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
const modifyOrder = unitApply => {
|
|
||||||
initPage(unitApply);
|
|
||||||
editStatus.value = toBit("0000") | editPicFlag | editModifyFlag;
|
|
||||||
};
|
|
||||||
let progressingId = 0;
|
|
||||||
const unitApplyList = ref([]);
|
|
||||||
const isSuccess = ref(false);
|
|
||||||
onMounted(async () => {
|
|
||||||
spining.value = true;
|
|
||||||
const options = await getAreaOptions("");
|
|
||||||
const organizeInfoRes = await get("/api2/UserInfo/Organize");
|
|
||||||
if (organizeInfoRes.errorCode != 0) {
|
|
||||||
message.error(organizeInfoRes.errorMsg);
|
|
||||||
spining.value = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
organizeList.value = organizeInfoRes.data;
|
|
||||||
const unitApplyListRes = await get("/api2/CA/UnitApplyList");
|
|
||||||
if (unitApplyListRes.errorCode != 0) {
|
|
||||||
message.error(unitApplyListRes.errorMsg);
|
|
||||||
spining.value = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
unitApplyList.value = unitApplyListRes.data;
|
|
||||||
const current = unitApplyListRes.data.find(
|
|
||||||
d => d.status == null || d.status == 0
|
|
||||||
);
|
|
||||||
if (current) {
|
|
||||||
progressingId = current.id;
|
|
||||||
initPage(current);
|
|
||||||
} else {
|
|
||||||
const successApply = unitApplyListRes.data.find(d => d.status == 1);
|
|
||||||
if (successApply) {
|
|
||||||
isSuccess.value = true;
|
|
||||||
} else {
|
|
||||||
editStatus.value =
|
|
||||||
editStatus.value | editfeildFlag | editPicFlag | editModifyFlag;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
areaOptions.value = options;
|
|
||||||
spining.value = false;
|
|
||||||
console.log(toRaw(modelRef));
|
|
||||||
});
|
|
||||||
const showDrawer = ref(false);
|
|
||||||
const toggleDrawer = () => {
|
|
||||||
showDrawer.value = !showDrawer.value;
|
|
||||||
};
|
|
||||||
return {
|
|
||||||
modelRef,
|
|
||||||
loaPicFileList,
|
|
||||||
idCardFrontPicFileList,
|
|
||||||
idCardBackPicFileList,
|
|
||||||
businessLicenseFileList,
|
|
||||||
rulesRef,
|
|
||||||
validate,
|
|
||||||
validateInfos,
|
|
||||||
editStatus,
|
|
||||||
onSubmit,
|
|
||||||
resetFields,
|
|
||||||
beforeUpload,
|
|
||||||
handleChange,
|
|
||||||
areaOptions,
|
|
||||||
loadAreaOptions,
|
|
||||||
spining,
|
|
||||||
organizeList,
|
|
||||||
unitApplyList,
|
|
||||||
getTydm,
|
|
||||||
getCode,
|
|
||||||
countdown,
|
|
||||||
disabledFeild,
|
|
||||||
disabledUpload,
|
|
||||||
disabledModify,
|
|
||||||
showDrawer,
|
|
||||||
toggleDrawer,
|
|
||||||
isSuccess,
|
|
||||||
modifyOrder,
|
|
||||||
router: useRouter(),
|
|
||||||
progressingId
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="ca_apply">
|
<div class="ca-apply">
|
||||||
<Result
|
<Result
|
||||||
v-if="isSuccess"
|
v-if="isSuccess"
|
||||||
status="success"
|
status="success"
|
||||||
@@ -10,24 +10,22 @@
|
|||||||
<!-- <Button type="primary">
|
<!-- <Button type="primary">
|
||||||
申请补办
|
申请补办
|
||||||
</Button> -->
|
</Button> -->
|
||||||
<Button @click="router.back()"> 返回 </Button>
|
<Button @click="router.back()" type="primary"> 返回 </Button>
|
||||||
|
<Button style="margin-left: 10px" @click="toggleDrawer"
|
||||||
|
>历史提交记录</Button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</Result>
|
</Result>
|
||||||
<Form
|
<Spin v-else :spinning="spining">
|
||||||
v-if="!isSuccess"
|
<Form :label-col="{ span: 9 }" :wrapper-col="{ span: 15 }">
|
||||||
ref="ruleForm"
|
|
||||||
:model="form"
|
|
||||||
:label-col="labelCol"
|
|
||||||
:wrapper-col="wrapperCol"
|
|
||||||
:rules="rules"
|
|
||||||
>
|
|
||||||
<Row>
|
<Row>
|
||||||
<Col :span="12">
|
<Col :span="11">
|
||||||
<FormItem label="企业名称" name="unitName">
|
<FormItem label="企业名称" v-bind="validateInfos.unitName">
|
||||||
<Select
|
<Select
|
||||||
v-model:value="form.unitName"
|
v-model:value="modelRef.unitName"
|
||||||
:disabled="disabled"
|
|
||||||
@change="getTydm"
|
@change="getTydm"
|
||||||
|
:disabled="disabledFeild"
|
||||||
|
placeholder="请选择企业名称"
|
||||||
>
|
>
|
||||||
<Option
|
<Option
|
||||||
v-for="organize in organizeList"
|
v-for="organize in organizeList"
|
||||||
@@ -37,130 +35,225 @@
|
|||||||
>
|
>
|
||||||
</Select>
|
</Select>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="统一社会信用代码" name="tydm">
|
<FormItem label="统一社会信用代码" v-bind="validateInfos.tydm">
|
||||||
<Input v-model:value="form.tydm" disabled />
|
<Input
|
||||||
|
v-model:value="modelRef.tydm"
|
||||||
|
readonly
|
||||||
|
:disabled="disabledFeild"
|
||||||
|
placeholder="根据企业名称自动获取"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="经办人姓名" name="operatorName">
|
<FormItem label="经办人姓名" v-bind="validateInfos.operatorName">
|
||||||
<Input v-model:value="form.operatorName" :disabled="disabled" />
|
<Input
|
||||||
|
v-model:value="modelRef.operatorName"
|
||||||
|
:disabled="disabledFeild"
|
||||||
|
placeholder="请输入经办人姓名"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="经办人身份证号" name="operatorId">
|
<FormItem label="经办人身份证" v-bind="validateInfos.operatorId">
|
||||||
<Input v-model:value="form.operatorId" :disabled="disabled" />
|
<Input
|
||||||
|
v-model:value="modelRef.operatorId"
|
||||||
|
:disabled="disabledFeild"
|
||||||
|
placeholder="请输入经办人身份证号码"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="经办人手机号" name="operatorPhone">
|
<FormItem label="经办人手机号" v-bind="validateInfos.operatorPhone">
|
||||||
<Input v-model:value="form.operatorPhone" :disabled="disabled" />
|
<Input
|
||||||
|
v-model:value="modelRef.operatorPhone"
|
||||||
|
:disabled="disabledFeild"
|
||||||
|
placeholder="请输入经办人手机号码"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="手机验证码" name="phoneCode">
|
<FormItem label="手机验证码" v-bind="validateInfos.phoneCode">
|
||||||
<Row :gutter="8">
|
<Row :gutter="8">
|
||||||
<Col :span="12">
|
<Col :span="12">
|
||||||
<Input v-model:value="form.phoneCode" :disabled="disabled" />
|
<Input
|
||||||
|
v-model:value="modelRef.phoneCode"
|
||||||
|
:disabled="disabledFeild"
|
||||||
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col :span="12">
|
<Col :span="12">
|
||||||
<Button @click="getCode" :disabled="disabled || countdown > 0"
|
<Button
|
||||||
>获取验证码{{ countdown > 0 ? `(${countdown})` : "" }}</Button
|
:disabled="disabledFeild || countdown > 0"
|
||||||
|
@click="getCode"
|
||||||
>
|
>
|
||||||
|
获取验证码{{ countdown > 0 ? `(${countdown})` : "" }}
|
||||||
|
</Button>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="省市区信息" name="code">
|
<FormItem label="省市区信息" v-bind="validateInfos.code">
|
||||||
<Cascader
|
<Cascader
|
||||||
v-model:value="form.code"
|
v-model:value="modelRef.code"
|
||||||
:load-data="loadAreaOptions"
|
|
||||||
:options="areaOptions"
|
|
||||||
placeholder="请选择省市区信息"
|
placeholder="请选择省市区信息"
|
||||||
change-on-select
|
:options="areaOptions"
|
||||||
:disabled="disabled"
|
:load-data="loadAreaOptions"
|
||||||
|
:disabled="disabledFeild"
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="邮寄地址" name="address">
|
<FormItem label="邮寄地址" v-bind="validateInfos.address">
|
||||||
<Input v-model:value="form.address" :disabled="disabled" />
|
<Input
|
||||||
|
v-model:value="modelRef.address"
|
||||||
|
:disabled="disabledFeild"
|
||||||
|
placeholder="请输入证书邮寄地址"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Col>
|
</Col>
|
||||||
<Col :span="12">
|
<Col :span="11">
|
||||||
<FormItem
|
<FormItem label="授权委托书" v-bind="validateInfos.loaPicId">
|
||||||
v-for="config in uploadConfig"
|
<input v-model="modelRef.loaPicId" hidden />
|
||||||
:label="config.label"
|
|
||||||
:name="config.name"
|
|
||||||
:key="config"
|
|
||||||
>
|
|
||||||
<input hidden v-model="form[config.name]" />
|
|
||||||
<Upload
|
<Upload
|
||||||
:disabled="disableUpload"
|
|
||||||
v-model:fileList="config.defaultFileList"
|
|
||||||
accept="image/*"
|
accept="image/*"
|
||||||
action="/api2/upload/uploadfile"
|
action="/api2/upload/uploadfile"
|
||||||
@change="info => handleChange(config, info)"
|
v-model:fileList="loaPicFileList"
|
||||||
:beforeUpload="beforeUpload"
|
:beforeUpload="beforeUpload"
|
||||||
list-type="picture"
|
list-type="picture"
|
||||||
|
@change="info => handleChange(info, 'loaPicId')"
|
||||||
|
:disabled="disabledUpload"
|
||||||
>
|
>
|
||||||
<Button block :disabled="disableUpload || config.disabled">
|
<Button block :disabled="disabledUpload">
|
||||||
<UploadOutlined />
|
<UploadOutlined />
|
||||||
点击上传
|
点击{{ modelRef.loaPicId ? "替换" : "上传" }}
|
||||||
|
</Button>
|
||||||
|
</Upload>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label="身份证正面照"
|
||||||
|
v-bind="validateInfos.idCardFrontPicId"
|
||||||
|
>
|
||||||
|
<input v-model="modelRef.idCardFrontPicId" hidden />
|
||||||
|
<Upload
|
||||||
|
accept="image/*"
|
||||||
|
action="/api2/upload/uploadfile"
|
||||||
|
v-model:fileList="idCardFrontPicFileList"
|
||||||
|
:beforeUpload="beforeUpload"
|
||||||
|
list-type="picture"
|
||||||
|
@change="info => handleChange(info, 'idCardFrontPicId')"
|
||||||
|
:disabled="disabledUpload"
|
||||||
|
>
|
||||||
|
<Button block :disabled="disabledUpload">
|
||||||
|
<UploadOutlined />
|
||||||
|
点击{{ modelRef.idCardFrontPicId ? "替换" : "上传" }}
|
||||||
|
</Button>
|
||||||
|
</Upload>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label="身份证背面照"
|
||||||
|
v-bind="validateInfos.idCardBackPicId"
|
||||||
|
>
|
||||||
|
<input v-model="modelRef.idCardBackPicId" hidden />
|
||||||
|
<Upload
|
||||||
|
accept="image/*"
|
||||||
|
action="/api2/upload/uploadfile"
|
||||||
|
v-model:fileList="idCardBackPicFileList"
|
||||||
|
:beforeUpload="beforeUpload"
|
||||||
|
list-type="picture"
|
||||||
|
@change="info => handleChange(info, 'idCardBackPicId')"
|
||||||
|
:disabled="disabledUpload"
|
||||||
|
>
|
||||||
|
<Button block :disabled="disabledUpload">
|
||||||
|
<UploadOutlined />
|
||||||
|
点击{{ modelRef.idCardBackPicId ? "替换" : "上传" }}
|
||||||
|
</Button>
|
||||||
|
</Upload>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label="营业许可证照片"
|
||||||
|
v-bind="validateInfos.businessLicensePicId"
|
||||||
|
>
|
||||||
|
<input v-model="modelRef.businessLicensePicId" hidden />
|
||||||
|
<Upload
|
||||||
|
accept="image/*"
|
||||||
|
action="/api2/upload/uploadfile"
|
||||||
|
v-model:fileList="businessLicenseFileList"
|
||||||
|
:beforeUpload="beforeUpload"
|
||||||
|
list-type="picture"
|
||||||
|
@change="info => handleChange(info, 'businessLicensePicId')"
|
||||||
|
:disabled="disabledUpload"
|
||||||
|
>
|
||||||
|
<Button block :disabled="disabledUpload">
|
||||||
|
<UploadOutlined />
|
||||||
|
点击{{ modelRef.businessLicensePicId ? "替换" : "上传" }}
|
||||||
</Button>
|
</Button>
|
||||||
</Upload>
|
</Upload>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col :span="2">
|
||||||
|
<FormItem>
|
||||||
|
<Popover title="说明">
|
||||||
|
<template #content>
|
||||||
|
<p>请将两页纸一起拍照或扫描上传</p>
|
||||||
|
</template>
|
||||||
|
<Button type="link"
|
||||||
|
><a
|
||||||
|
href="http://183.136.157.18:7308/stgl/sources/202102/授权书模板.doc"
|
||||||
|
download="授权书模板.doc"
|
||||||
|
target="_blank"
|
||||||
|
><DownloadOutlined />模板</a
|
||||||
|
></Button
|
||||||
|
>
|
||||||
|
</Popover>
|
||||||
|
</FormItem>
|
||||||
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
<FormItem :wrapper-col="{ span: 12, offset: 10 }">
|
||||||
<FormItem :wrapperCol="{ span: 10, offset: 8 }">
|
<Button v-if="progressingId" type="primary" @click="onSubmit"
|
||||||
<Button
|
>查询</Button
|
||||||
v-if="currentId == 0"
|
|
||||||
style="margin-left: 10px"
|
|
||||||
type="primary"
|
|
||||||
@click="createUnitApply"
|
|
||||||
>申领登记</Button
|
|
||||||
>
|
>
|
||||||
<Button
|
<Button v-else type="primary" @click="onSubmit">提交</Button>
|
||||||
v-if="currentId !== 0 && currentStatus == null"
|
<Button style="margin-left: 10px" @click="toggleDrawer"
|
||||||
style="margin-left: 10px"
|
>历史提交记录</Button
|
||||||
type="primary"
|
|
||||||
@click="sendUnitApply"
|
|
||||||
>发起申领</Button
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
v-if="currentId !== 0 && currentStatus == 0"
|
|
||||||
style="margin-left: 10px"
|
|
||||||
type="primary"
|
|
||||||
@click="queryOrder"
|
|
||||||
>查询结果</Button
|
|
||||||
>
|
|
||||||
<Button style="margin-left: 10px" @click="showDrawer"
|
|
||||||
>历史申领记录</Button
|
|
||||||
>
|
>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
|
</Spin>
|
||||||
</div>
|
</div>
|
||||||
<Drawer
|
<Drawer
|
||||||
title="历史申领记录"
|
title="历史申领记录"
|
||||||
placement="right"
|
placement="right"
|
||||||
:closable="false"
|
:closable="false"
|
||||||
v-model:visible="drawVisible"
|
v-model:visible="showDrawer"
|
||||||
width="350px"
|
width="450px"
|
||||||
>
|
>
|
||||||
|
<Empty v-if="!(unitApplyList && unitApplyList.length > 0)" />
|
||||||
<div
|
<div
|
||||||
v-for="unitApply in unitApplyList"
|
v-for="unitApply in unitApplyList"
|
||||||
:key="unitApply.id"
|
:key="unitApply.id"
|
||||||
style="padding: 10px"
|
style="padding: 10px"
|
||||||
>
|
>
|
||||||
<p>
|
<Card size="small">
|
||||||
|
<template #title>
|
||||||
{{ unitApply.unitName
|
{{ unitApply.unitName
|
||||||
}}<Tag :color="['orange', 'green', 'red'][unitApply.status]">{{
|
}}<Tag
|
||||||
|
style="margin-left:4px;"
|
||||||
|
:color="['orange', 'green', 'red'][unitApply.status]"
|
||||||
|
>{{
|
||||||
["进行中", "已成功", "已失败"][unitApply.status] || "未申领"
|
["进行中", "已成功", "已失败"][unitApply.status] || "未申领"
|
||||||
}}</Tag>
|
}}</Tag
|
||||||
</p>
|
>
|
||||||
<p>经办人: {{ unitApply.operatorName }} {{ unitApply.operatorPhone }}</p>
|
</template>
|
||||||
<p>发起时间: {{ unitApply.time }}</p>
|
<template #extra>
|
||||||
<Button
|
<Button
|
||||||
v-if="unitApply.status == 2"
|
v-if="unitApply.status == 2"
|
||||||
type="link"
|
type="link"
|
||||||
@click="modifyOrder(unitApply)"
|
@click="modifyOrder(unitApply)"
|
||||||
:disabled="disabled"
|
:disabled="disabledModify"
|
||||||
>重新申请</Button
|
>重新申请</Button
|
||||||
>
|
>
|
||||||
|
</template>
|
||||||
|
<p>
|
||||||
|
经办人: {{ unitApply.operatorName }} {{ unitApply.operatorPhone }}
|
||||||
|
</p>
|
||||||
|
<p>发起时间: {{ unitApply.time }}</p>
|
||||||
|
<p v-if="unitApply.dealReason">
|
||||||
|
不通过原因:{{ unitApply.dealReason }}
|
||||||
|
</p></Card
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
</template>
|
</template>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.ca_apply {
|
.ca-apply {
|
||||||
width: 800px;
|
width: 800px;
|
||||||
.ant-upload {
|
.ant-upload {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -170,50 +263,30 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
Input,
|
|
||||||
Upload,
|
|
||||||
message,
|
|
||||||
Cascader,
|
|
||||||
Button,
|
|
||||||
Select,
|
|
||||||
Row,
|
Row,
|
||||||
Col,
|
Col,
|
||||||
|
Button,
|
||||||
|
Input,
|
||||||
|
Cascader,
|
||||||
|
Upload,
|
||||||
|
message,
|
||||||
|
Spin,
|
||||||
|
Select,
|
||||||
Drawer,
|
Drawer,
|
||||||
|
Empty,
|
||||||
Tag,
|
Tag,
|
||||||
|
Card,
|
||||||
Modal,
|
Modal,
|
||||||
Result
|
Result,
|
||||||
|
Popover
|
||||||
} from "ant-design-vue";
|
} from "ant-design-vue";
|
||||||
import { UploadOutlined } from "@ant-design/icons-vue";
|
import { UploadOutlined, DownloadOutlined } from "@ant-design/icons-vue";
|
||||||
|
import { useForm } from "@ant-design-vue/use";
|
||||||
|
import { computed, onMounted, reactive, ref, toRaw, inject } from "vue";
|
||||||
import { get, post } from "@/services/http";
|
import { get, post } from "@/services/http";
|
||||||
import { delay } from "@/services/util";
|
|
||||||
import regex from "@/services/regex";
|
import regex from "@/services/regex";
|
||||||
|
import { toBit } from "@/services/util";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
const picUploadConfig = [
|
|
||||||
{
|
|
||||||
label: "授权委托书照片",
|
|
||||||
name: "loaPicId",
|
|
||||||
disabled: false,
|
|
||||||
defaultFileList: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "身份证正面照片",
|
|
||||||
name: "idCardFrontPicId",
|
|
||||||
disabled: false,
|
|
||||||
defaultFileList: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "身份证背面照片",
|
|
||||||
name: "idCardBackPicId",
|
|
||||||
disabled: false,
|
|
||||||
defaultFileList: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "营业执照照片",
|
|
||||||
name: "businessLicensePicId",
|
|
||||||
disabled: false,
|
|
||||||
defaultFileList: []
|
|
||||||
}
|
|
||||||
];
|
|
||||||
async function getAreaOptions(code) {
|
async function getAreaOptions(code) {
|
||||||
const res = await get("/api2/CA/AreaOptions", { code });
|
const res = await get("/api2/CA/AreaOptions", { code });
|
||||||
if (res.errorCode == 0) {
|
if (res.errorCode == 0) {
|
||||||
@@ -224,40 +297,53 @@ async function getAreaOptions(code) {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const editfeildFlag = toBit("0001");
|
||||||
|
const editPicFlag = toBit("0010");
|
||||||
|
const editModifyFlag = toBit("0100");
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Form,
|
Form,
|
||||||
FormItem: Form.Item,
|
FormItem: Form.Item,
|
||||||
Input,
|
|
||||||
Upload,
|
|
||||||
Cascader,
|
|
||||||
UploadOutlined,
|
|
||||||
Button,
|
|
||||||
Select,
|
|
||||||
Option: Select.Option,
|
|
||||||
Row,
|
Row,
|
||||||
Col,
|
Col,
|
||||||
|
Button,
|
||||||
|
Input,
|
||||||
|
Cascader,
|
||||||
|
Upload,
|
||||||
|
UploadOutlined,
|
||||||
|
Spin,
|
||||||
|
Select,
|
||||||
|
Option: Select.Option,
|
||||||
Drawer,
|
Drawer,
|
||||||
|
Empty,
|
||||||
Tag,
|
Tag,
|
||||||
Result
|
Card,
|
||||||
|
Result,
|
||||||
|
DownloadOutlined,
|
||||||
|
Popover
|
||||||
},
|
},
|
||||||
data() {
|
setup() {
|
||||||
return {
|
const modelRef = reactive({
|
||||||
uploadConfig: picUploadConfig,
|
id: null,
|
||||||
labelCol: { span: 8 },
|
orderNo: null,
|
||||||
wrapperCol: { span: 14 },
|
unitName: null,
|
||||||
form: {},
|
tydm: "",
|
||||||
currentId: 0,
|
operatorName: "",
|
||||||
currentStatus: null,
|
operatorId: "",
|
||||||
unitApplyList: [],
|
operatorPhone: "",
|
||||||
areaOptions: [],
|
phoneCode: "",
|
||||||
organizeList: [],
|
code: [],
|
||||||
drawVisible: false,
|
address: "",
|
||||||
disabled: true,
|
loaPicId: null,
|
||||||
disableUpload: true,
|
idCardFrontPicId: null,
|
||||||
countdown: 0,
|
idCardBackPicId: null,
|
||||||
isSuccess: false,
|
businessLicensePicId: null
|
||||||
rules: {
|
});
|
||||||
|
const loaPicFileList = ref([]);
|
||||||
|
const idCardFrontPicFileList = ref([]);
|
||||||
|
const idCardBackPicFileList = ref([]);
|
||||||
|
const businessLicenseFileList = ref([]);
|
||||||
|
const rulesRef = reactive({
|
||||||
operatorId: [
|
operatorId: [
|
||||||
{ required: true, message: "请输入18位身份证号码", trigger: "blur" },
|
{ required: true, message: "请输入18位身份证号码", trigger: "blur" },
|
||||||
{
|
{
|
||||||
@@ -292,9 +378,7 @@ export default {
|
|||||||
trigger: "blur"
|
trigger: "blur"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
address: [
|
address: [{ required: true, message: "请输入邮寄信息", trigger: "blur" }],
|
||||||
{ required: true, message: "请输入邮寄信息", trigger: "blur" }
|
|
||||||
],
|
|
||||||
code: [
|
code: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -314,7 +398,7 @@ export default {
|
|||||||
required: true,
|
required: true,
|
||||||
message: "请上传授权承诺书照片",
|
message: "请上传授权承诺书照片",
|
||||||
trigger: "change",
|
trigger: "change",
|
||||||
transform: v => v && v.toString()
|
type: "number"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
idCardFrontPicId: [
|
idCardFrontPicId: [
|
||||||
@@ -322,7 +406,7 @@ export default {
|
|||||||
required: true,
|
required: true,
|
||||||
message: "请上传身份证正面照片",
|
message: "请上传身份证正面照片",
|
||||||
trigger: "change",
|
trigger: "change",
|
||||||
transform: v => v && v.toString()
|
type: "number"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
idCardBackPicId: [
|
idCardBackPicId: [
|
||||||
@@ -330,7 +414,7 @@ export default {
|
|||||||
required: true,
|
required: true,
|
||||||
message: "请上传身份证背面照片",
|
message: "请上传身份证背面照片",
|
||||||
trigger: "change",
|
trigger: "change",
|
||||||
transform: v => v && v.toString()
|
type: "number"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
businessLicensePicId: [
|
businessLicensePicId: [
|
||||||
@@ -338,52 +422,95 @@ export default {
|
|||||||
required: true,
|
required: true,
|
||||||
message: "请上营业执照照片",
|
message: "请上营业执照照片",
|
||||||
trigger: "change",
|
trigger: "change",
|
||||||
transform: v => v && v.toString()
|
type: "number"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
phoneCode: [
|
phoneCode: [
|
||||||
{ required: true, message: "请输入短信验证码", trigger: "change" }
|
{ required: true, message: "请输入短信验证码", trigger: "change" }
|
||||||
]
|
]
|
||||||
},
|
});
|
||||||
router: useRouter()
|
const { resetFields, validate, validateInfos } = useForm(
|
||||||
};
|
modelRef,
|
||||||
},
|
rulesRef
|
||||||
async created() {
|
|
||||||
const organizeInfo = await get("/api2/UserInfo/Organize");
|
|
||||||
const unitApplyList = await get("/api2/CA/UnitApplyList");
|
|
||||||
this.areaOptions = await getAreaOptions("");
|
|
||||||
this.organizeList = organizeInfo.data;
|
|
||||||
const current = unitApplyList.data.find(
|
|
||||||
d => d.status == null || d.status == 0
|
|
||||||
);
|
);
|
||||||
this.isSuccess = !!unitApplyList.data.find(d => d.status == 1);
|
const useReload = inject("reload");
|
||||||
this.unitApplyList = unitApplyList.data;
|
const queryUnitApply = async id => {
|
||||||
if (current) {
|
const res = await get("/api2/CA/QueryUnitApplyResult", {
|
||||||
this.initForm(current);
|
id
|
||||||
|
});
|
||||||
|
if (res.errorCode == 0) {
|
||||||
|
Modal.success({
|
||||||
|
title: "完成",
|
||||||
|
content: "数字证书申领流程已完成",
|
||||||
|
onOk: useReload
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.disabled = false;
|
Modal.info({ title: "当前状态", content: res.errorMsg });
|
||||||
this.disableUpload = false;
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
methods: {
|
const sendUnitApply = async id => {
|
||||||
handleChange(config, info) {
|
const resp = await get("/api2/CA/SendCreateOrder", {
|
||||||
const name = config.name;
|
orderId: id
|
||||||
if (info.file.status !== "uploading") {
|
});
|
||||||
// console.log(info.file.status,info.file, info.fileList);
|
if (resp.errorCode != 0) {
|
||||||
|
message.error(resp.errorMsg);
|
||||||
|
} else {
|
||||||
|
message.success("发起申请成功", 2, useReload);
|
||||||
}
|
}
|
||||||
if (info.file.status === "done") {
|
};
|
||||||
message.success(`${info.file.name} 文件上传成功`);
|
const createUnitApply = async () => {
|
||||||
this.form[name] = info.file.response.id;
|
try {
|
||||||
config.disabled = true;
|
await validate();
|
||||||
} else if (info.file.status === "error") {
|
const resp = await post("/api2/CA/createUnitApply", toRaw(modelRef));
|
||||||
message.error(`${info.file.name} 文件上传失败`);
|
if (resp.errorCode != 0) {
|
||||||
|
message.error(resp.errorMsg);
|
||||||
|
} else {
|
||||||
|
message.success("提交成功", (onclose = useReload));
|
||||||
|
await sendUnitApply(resp.data);
|
||||||
}
|
}
|
||||||
if (info.file.status === "removed") {
|
} catch {
|
||||||
config.disabled = false;
|
0;
|
||||||
this.form[name] = null;
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
beforeUpload(file) {
|
const modifyUnitApply = async () => {
|
||||||
|
try {
|
||||||
|
await validate([
|
||||||
|
"loaPicId",
|
||||||
|
"idCardFrontPicId",
|
||||||
|
"idCardBackPicId",
|
||||||
|
"businessLicensePicId"
|
||||||
|
]);
|
||||||
|
const resp = await post("/api2/CA/modifyUnitApply", toRaw(modelRef));
|
||||||
|
if (resp.errorCode != 0) {
|
||||||
|
message.error(resp.errorMsg);
|
||||||
|
} else {
|
||||||
|
message.success("提交成功", (onclose = useReload));
|
||||||
|
await sendUnitApply(resp.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const onSubmit = async e => {
|
||||||
|
e.preventDefault();
|
||||||
|
if (progressingId == 0) {
|
||||||
|
if (modelRef.orderNo) {
|
||||||
|
await modifyUnitApply();
|
||||||
|
} else {
|
||||||
|
await createUnitApply();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var current = toRaw(unitApplyList.value).find(
|
||||||
|
p => p.id == progressingId
|
||||||
|
);
|
||||||
|
if (current.status == null) {
|
||||||
|
await sendUnitApply(progressingId);
|
||||||
|
} else if (current.status == 0) {
|
||||||
|
await queryUnitApply(progressingId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const beforeUpload = file => {
|
||||||
const isJpgOrPng =
|
const isJpgOrPng =
|
||||||
file.type === "image/jpeg" || file.type === "image/png";
|
file.type === "image/jpeg" || file.type === "image/png";
|
||||||
if (!isJpgOrPng) {
|
if (!isJpgOrPng) {
|
||||||
@@ -394,9 +521,29 @@ export default {
|
|||||||
message.error("文件大小超过2MB!");
|
message.error("文件大小超过2MB!");
|
||||||
}
|
}
|
||||||
return isJpgOrPng && isLt2M;
|
return isJpgOrPng && isLt2M;
|
||||||
},
|
};
|
||||||
async loadAreaOptions(selectedOptions) {
|
const handleChange = (info, name) => {
|
||||||
console.log(selectedOptions);
|
console.log(info.file.status, info.file, info.fileList);
|
||||||
|
// if (info.file.status !== "uploading") {
|
||||||
|
// }
|
||||||
|
if (info.file.status === "done") {
|
||||||
|
message.success(`${info.file.name} 文件上传成功`);
|
||||||
|
modelRef[name] = info.file.response.id;
|
||||||
|
if (info.fileList.length > 1) {
|
||||||
|
info.fileList.shift();
|
||||||
|
}
|
||||||
|
} else if (info.file.status === "error") {
|
||||||
|
message.error(`${info.file.name} 文件上传失败`);
|
||||||
|
info.fileList.pop();
|
||||||
|
}
|
||||||
|
if (info.file.status === "removed") {
|
||||||
|
modelRef[name] = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const areaOptions = ref([]);
|
||||||
|
const spining = ref(false);
|
||||||
|
const organizeList = ref([]);
|
||||||
|
const loadAreaOptions = async selectedOptions => {
|
||||||
const targetOption = selectedOptions[selectedOptions.length - 1];
|
const targetOption = selectedOptions[selectedOptions.length - 1];
|
||||||
targetOption.loading = true;
|
targetOption.loading = true;
|
||||||
const options = await getAreaOptions(targetOption.value);
|
const options = await getAreaOptions(targetOption.value);
|
||||||
@@ -404,151 +551,162 @@ export default {
|
|||||||
targetOption.children = options;
|
targetOption.children = options;
|
||||||
}
|
}
|
||||||
targetOption.loading = false;
|
targetOption.loading = false;
|
||||||
this.areaOptions = [...this.areaOptions];
|
};
|
||||||
},
|
const getTydm = async () => {
|
||||||
async createUnitApply() {
|
const unitName = modelRef.unitName;
|
||||||
if (this.form.orderNo) {
|
|
||||||
//有orderNo 修改
|
|
||||||
const resp = await post("/api2/CA/ModifyUnitApply", {
|
|
||||||
id: this.form.id,
|
|
||||||
orderNo: this.form.orderNo,
|
|
||||||
loaPicId: this.form.loaPicId,
|
|
||||||
idCardFrontPicId: this.form.idCardFrontPicId,
|
|
||||||
idCardBackPicId: this.form.idCardBackPicId,
|
|
||||||
businessLicensePicId: this.form.businessLicensePicId
|
|
||||||
});
|
|
||||||
if (resp.errorCode != 0) {
|
|
||||||
message.error(resp.errorMsg);
|
|
||||||
} else {
|
|
||||||
message.success("修改成功");
|
|
||||||
this.disabled = true;
|
|
||||||
this.disableUpload = true;
|
|
||||||
this.currentId = resp.data;
|
|
||||||
this.currentStatus = null;
|
|
||||||
await delay(500);
|
|
||||||
await this.sendUnitApply();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
await this.$refs.ruleForm.validate();
|
|
||||||
} catch (error) {
|
|
||||||
console.log("error", error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const resp = await post("/api2/CA/createUnitApply", this.form);
|
|
||||||
if (resp.errorCode != 0) {
|
|
||||||
message.error(resp.errorMsg);
|
|
||||||
} else {
|
|
||||||
message.success("登记成功");
|
|
||||||
this.disabled = true;
|
|
||||||
this.currentId = resp.data;
|
|
||||||
this.currentStatus = null;
|
|
||||||
await delay(500);
|
|
||||||
await this.sendUnitApply();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async sendUnitApply() {
|
|
||||||
if (this.currentId && this.currentStatus === null) {
|
|
||||||
const resp = await get("/api2/CA/SendCreateOrder", {
|
|
||||||
orderId: this.currentId
|
|
||||||
});
|
|
||||||
if (resp.errorCode != 0) {
|
|
||||||
message.error(resp.errorMsg);
|
|
||||||
} else {
|
|
||||||
message.success("发起申请成功");
|
|
||||||
this.currentStatus = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//查询结果
|
|
||||||
async queryOrder() {
|
|
||||||
const res = await get("/api2/CA/QueryUnitApplyResult", {
|
|
||||||
id: this.currentId
|
|
||||||
});
|
|
||||||
if (res.errorCode == 0) {
|
|
||||||
Modal.success({ title: "完成", content: "数字证书申领流程已完成" });
|
|
||||||
this.isSuccess = true;
|
|
||||||
} else {
|
|
||||||
Modal.info({ title: "当前状态", content: res.errorMsg });
|
|
||||||
}
|
|
||||||
},
|
|
||||||
showDrawer() {
|
|
||||||
this.drawVisible = true;
|
|
||||||
},
|
|
||||||
async getCode() {
|
|
||||||
if (!regex.Phone.test(this.form.operatorPhone)) {
|
|
||||||
message.error("请输入正确的手机号码");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var res = await get("/api2/CA/GetPhoneCode", {
|
|
||||||
type: 1,
|
|
||||||
phone: this.form.operatorPhone
|
|
||||||
});
|
|
||||||
if (res.errorCode !== 0) {
|
|
||||||
message.error(res.errorMsg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.countdown = 60;
|
|
||||||
var handle = setInterval(() => {
|
|
||||||
this.countdown--;
|
|
||||||
this.countdown < 0 && clearInterval(handle);
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
async getTydm() {
|
|
||||||
const unitName = this.form.unitName;
|
|
||||||
const res = await get("/api2/CA/GetTydm", { unitName });
|
const res = await get("/api2/CA/GetTydm", { unitName });
|
||||||
if (res.errorCode !== 0) {
|
if (res.errorCode !== 0) {
|
||||||
message.error(res.errorMsg);
|
message.error(res.errorMsg);
|
||||||
} else {
|
} else {
|
||||||
this.form.tydm = res.data;
|
modelRef.tydm = res.data;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
async initForm(unitApply) {
|
const countdown = ref(0);
|
||||||
//省市信息初始化
|
const getCode = async () => {
|
||||||
const [code0, code1] = unitApply.code;
|
try {
|
||||||
var option0 = this.areaOptions.find(o => o.value == code0);
|
await validate("operatorPhone");
|
||||||
option0.children = await getAreaOptions(code0);
|
} catch (error) {
|
||||||
var option1 = option0.children.find(o => o.value == code1);
|
return;
|
||||||
option1.children = await getAreaOptions(code1);
|
}
|
||||||
this.form = unitApply;
|
var res = await get("/api2/CA/GetPhoneCode", {
|
||||||
this.currentId = unitApply.id;
|
type: 1,
|
||||||
this.currentStatus = unitApply.status;
|
phone: modelRef.operatorPhone
|
||||||
picUploadConfig[0].defaultFileList.push({
|
});
|
||||||
uid: -1,
|
if (res.errorCode !== 0) {
|
||||||
|
message.error(res.errorMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
countdown.value = 60;
|
||||||
|
var handle = setInterval(() => {
|
||||||
|
countdown.value--;
|
||||||
|
countdown.value < 0 && clearInterval(handle);
|
||||||
|
}, 1000);
|
||||||
|
};
|
||||||
|
const editStatus = ref(toBit("0000"));
|
||||||
|
const disabledFeild = computed(
|
||||||
|
() => (editStatus.value & editfeildFlag) == 0
|
||||||
|
);
|
||||||
|
const disabledUpload = computed(
|
||||||
|
() => (editStatus.value & editPicFlag) == 0
|
||||||
|
);
|
||||||
|
const disabledModify = computed(
|
||||||
|
() => (editStatus.value & editModifyFlag) == 0
|
||||||
|
);
|
||||||
|
const initPage = unitApply => {
|
||||||
|
for (const key in toRaw(modelRef)) {
|
||||||
|
if (Object.hasOwnProperty.call(unitApply, key)) {
|
||||||
|
const element = unitApply[key];
|
||||||
|
modelRef[key] = element;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
loaPicFileList.value = [
|
||||||
|
{
|
||||||
|
uid: "-1",
|
||||||
status: "done",
|
status: "done",
|
||||||
url: unitApply.loaPicPath
|
url: unitApply.loaPicPath
|
||||||
});
|
}
|
||||||
picUploadConfig[0].disabled = true;
|
];
|
||||||
picUploadConfig[1].defaultFileList.push({
|
idCardFrontPicFileList.value = [
|
||||||
uid: -1,
|
{
|
||||||
|
uid: "-1",
|
||||||
status: "done",
|
status: "done",
|
||||||
url: unitApply.idCardFrontPicPath
|
url: unitApply.idCardFrontPicPath
|
||||||
});
|
}
|
||||||
picUploadConfig[1].disabled = true;
|
];
|
||||||
|
idCardBackPicFileList.value = [
|
||||||
picUploadConfig[2].defaultFileList.push({
|
{
|
||||||
uid: -1,
|
uid: "-1",
|
||||||
status: "done",
|
status: "done",
|
||||||
url: unitApply.idCardBackPicPath
|
url: unitApply.idCardBackPicPath
|
||||||
});
|
}
|
||||||
picUploadConfig[2].disabled = true;
|
];
|
||||||
|
businessLicenseFileList.value = [
|
||||||
picUploadConfig[3].defaultFileList.push({
|
{
|
||||||
uid: -1,
|
uid: "-1",
|
||||||
status: "done",
|
status: "done",
|
||||||
url: unitApply.businessLicensePicPath
|
url: unitApply.businessLicensePicPath
|
||||||
});
|
|
||||||
picUploadConfig[3].disabled = true;
|
|
||||||
},
|
|
||||||
async modifyOrder(unitApply) {
|
|
||||||
await this.initForm(unitApply);
|
|
||||||
this.currentId = 0;
|
|
||||||
this.disabled = true;
|
|
||||||
this.disableUpload = false;
|
|
||||||
this.currentStatus = null;
|
|
||||||
}
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
const modifyOrder = unitApply => {
|
||||||
|
initPage(unitApply);
|
||||||
|
editStatus.value = toBit("0000") | editPicFlag | editModifyFlag;
|
||||||
|
};
|
||||||
|
let progressingId = 0;
|
||||||
|
const unitApplyList = ref([]);
|
||||||
|
const isSuccess = ref(false);
|
||||||
|
onMounted(async () => {
|
||||||
|
spining.value = true;
|
||||||
|
const options = await getAreaOptions("");
|
||||||
|
const organizeInfoRes = await get("/api2/UserInfo/Organize");
|
||||||
|
if (organizeInfoRes.errorCode != 0) {
|
||||||
|
message.error(organizeInfoRes.errorMsg);
|
||||||
|
spining.value = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
organizeList.value = organizeInfoRes.data;
|
||||||
|
const unitApplyListRes = await get("/api2/CA/UnitApplyList");
|
||||||
|
if (unitApplyListRes.errorCode != 0) {
|
||||||
|
message.error(unitApplyListRes.errorMsg);
|
||||||
|
spining.value = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
unitApplyList.value = unitApplyListRes.data;
|
||||||
|
const current = unitApplyListRes.data.find(
|
||||||
|
d => d.status == null || d.status == 0
|
||||||
|
);
|
||||||
|
if (current) {
|
||||||
|
progressingId = current.id;
|
||||||
|
initPage(current);
|
||||||
|
} else {
|
||||||
|
const successApply = unitApplyListRes.data.find(d => d.status == 1);
|
||||||
|
if (successApply) {
|
||||||
|
isSuccess.value = true;
|
||||||
|
} else {
|
||||||
|
editStatus.value =
|
||||||
|
editStatus.value | editfeildFlag | editPicFlag | editModifyFlag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
areaOptions.value = options;
|
||||||
|
spining.value = false;
|
||||||
|
console.log(toRaw(modelRef));
|
||||||
|
});
|
||||||
|
const showDrawer = ref(false);
|
||||||
|
const toggleDrawer = () => {
|
||||||
|
showDrawer.value = !showDrawer.value;
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
modelRef,
|
||||||
|
loaPicFileList,
|
||||||
|
idCardFrontPicFileList,
|
||||||
|
idCardBackPicFileList,
|
||||||
|
businessLicenseFileList,
|
||||||
|
rulesRef,
|
||||||
|
validate,
|
||||||
|
validateInfos,
|
||||||
|
editStatus,
|
||||||
|
onSubmit,
|
||||||
|
resetFields,
|
||||||
|
beforeUpload,
|
||||||
|
handleChange,
|
||||||
|
areaOptions,
|
||||||
|
loadAreaOptions,
|
||||||
|
spining,
|
||||||
|
organizeList,
|
||||||
|
unitApplyList,
|
||||||
|
getTydm,
|
||||||
|
getCode,
|
||||||
|
countdown,
|
||||||
|
disabledFeild,
|
||||||
|
disabledUpload,
|
||||||
|
disabledModify,
|
||||||
|
showDrawer,
|
||||||
|
toggleDrawer,
|
||||||
|
isSuccess,
|
||||||
|
modifyOrder,
|
||||||
|
router: useRouter(),
|
||||||
|
progressingId
|
||||||
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,126 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="ca-apply">
|
|
||||||
<Form :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
|
|
||||||
<FormItem label="真实姓名" v-bind="validateInfos.idCardName">
|
|
||||||
<Input v-model:value="form.idCardName" :disabled="disableEdit" />
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="身份证号码" v-bind="validateInfos.idCardNo">
|
|
||||||
<Input v-model:value="form.idCardNo" :disabled="disableEdit" />
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="所在单位名称" v-bind="validateInfos.unitName">
|
|
||||||
<Select v-model:value="form.unitName" :disabled="disableEdit">
|
|
||||||
<Option
|
|
||||||
v-for="organize in organizeList"
|
|
||||||
:key="organize.id"
|
|
||||||
:value="organize.name"
|
|
||||||
>{{ organize.name }}</Option
|
|
||||||
>
|
|
||||||
</Select>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="手机号码" v-bind="validateInfos.phone">
|
|
||||||
<Input v-model:value="form.phone" :disabled="disableEdit" />
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="收件人" v-bind="validateInfos.idCardNo">
|
|
||||||
<Input v-model:value="form.receiverName" :disadbled="disableEdit" />
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="联系电话" v-bind="validateInfos.idCardNo">
|
|
||||||
<Input v-model:value="form.receiverPhone" :disadbled="disableEdit" />
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="邮寄地址" v-bind="validateInfos.address">
|
|
||||||
<Input v-model:value="form.address" :disabled="disableEdit" />
|
|
||||||
</FormItem>
|
|
||||||
<FormItem :wrapperCol="{ span: 10, offset: 8 }">
|
|
||||||
<Button type="primary" @click="onSubmit">前往申领</Button>
|
|
||||||
<Button style="margin-left: 10px" @click="changeDisabled"
|
|
||||||
>历史申领记录</Button
|
|
||||||
>
|
|
||||||
</FormItem>
|
|
||||||
</Form>
|
|
||||||
</div>
|
|
||||||
<Drawer title="历史申领记录" placement="right" :closable="false"> </Drawer>
|
|
||||||
</template>
|
|
||||||
<style lang="less" scoped>
|
|
||||||
.ca-apply {
|
|
||||||
width: 600px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script>
|
|
||||||
import { Form, Input, Button, Select, Drawer, message } from "ant-design-vue";
|
|
||||||
import { onMounted, reactive, ref, toRaw } from "vue";
|
|
||||||
import { useForm } from "@ant-design-vue/use";
|
|
||||||
import { get } from "@/services/http";
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
Form,
|
|
||||||
Input,
|
|
||||||
FormItem: Form.Item,
|
|
||||||
Button,
|
|
||||||
Select,
|
|
||||||
Option: Select.Option,
|
|
||||||
Drawer
|
|
||||||
},
|
|
||||||
setup() {
|
|
||||||
//界面初始化
|
|
||||||
var organizeList = ref([]);
|
|
||||||
var userApplyList = ref([]);
|
|
||||||
onMounted(async () => {
|
|
||||||
const res = await get("/api2/UserInfo/Organize");
|
|
||||||
if (res.errorCode != 0) {
|
|
||||||
message.error(res.errorMsg);
|
|
||||||
}
|
|
||||||
organizeList.value = res.data;
|
|
||||||
const listRes = await get("/api2/CA/UserApplyList");
|
|
||||||
if (res.errorCode != 0) {
|
|
||||||
message.error(res.errorMsg);
|
|
||||||
}
|
|
||||||
userApplyList.value = listRes;
|
|
||||||
});
|
|
||||||
const formRef = reactive({
|
|
||||||
idCardName: "",
|
|
||||||
idCardNo: "",
|
|
||||||
phone: "",
|
|
||||||
unitName: ""
|
|
||||||
});
|
|
||||||
const rulesRef = reactive({
|
|
||||||
idCardName: [
|
|
||||||
{ required: true, message: "请输入18位身份证号码", trigger: "blur" }
|
|
||||||
],
|
|
||||||
idCardId: [
|
|
||||||
{ required: true, message: "请输入18位身份证号码", trigger: "blur" }
|
|
||||||
],
|
|
||||||
phone: [
|
|
||||||
{ required: true, message: "请输入18位身份证号码", trigger: "blur" }
|
|
||||||
],
|
|
||||||
unitName: [
|
|
||||||
{ required: true, message: "请输入18位身份证号码", trigger: "change" }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
const { validate, validateInfos } = useForm(formRef, rulesRef);
|
|
||||||
|
|
||||||
var disableEdit = ref(false);
|
|
||||||
const changeDisabled = function() {
|
|
||||||
disableEdit.value = !disableEdit.value;
|
|
||||||
console.log(disableEdit);
|
|
||||||
};
|
|
||||||
const onSubmit = function() {
|
|
||||||
validate()
|
|
||||||
.then(() => {
|
|
||||||
console.log(toRaw(formRef));
|
|
||||||
})
|
|
||||||
.catch(e => {
|
|
||||||
console.log(e);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return {
|
|
||||||
labelCol: { span: 8 },
|
|
||||||
wrapperCol: { span: 10 },
|
|
||||||
form: formRef,
|
|
||||||
disableEdit,
|
|
||||||
changeDisabled,
|
|
||||||
validateInfos,
|
|
||||||
onSubmit,
|
|
||||||
organizeList
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
Reference in New Issue
Block a user