2025-07-09 15:50:10 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<a-spin :spinning="confirmLoading">
|
|
|
|
|
|
<JFormContainer :disabled="disabled">
|
|
|
|
|
|
<template #detail>
|
|
|
|
|
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
|
|
|
|
|
name="OrgApplyInfoForm">
|
2025-10-29 10:50:15 +08:00
|
|
|
|
<a-row class="card-class">
|
|
|
|
|
|
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
|
2025-07-09 15:50:10 +08:00
|
|
|
|
<SectionDivider :title="'机构信息'" />
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :span="12">
|
2025-07-29 10:38:19 +08:00
|
|
|
|
<a-form-item label="机构所在地">
|
2025-10-29 10:50:15 +08:00
|
|
|
|
<a-textarea :autosize="{ minRows: 1 }" maxlength="50" disabled v-model:value="cityViewValue"
|
|
|
|
|
|
allow-clear></a-textarea>
|
|
|
|
|
|
<!-- {{ cityViewValue }} -->
|
2025-07-09 15:50:10 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :span="12">
|
2025-07-29 10:38:19 +08:00
|
|
|
|
<a-form-item label="机构名称" v-bind="validateInfos.comName" id="OrgApplyInfoForm-comName" name="comName">
|
2025-10-29 10:50:15 +08:00
|
|
|
|
<a-textarea :autosize="{ minRows: 1 }" maxlength="50" disabled v-model:value="formData.comName"
|
|
|
|
|
|
allow-clear></a-textarea>
|
|
|
|
|
|
<!-- {{ formData.comName }} -->
|
2025-07-09 15:50:10 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
|
<a-form-item label="机构负责人" v-bind="validateInfos.orgLeader" id="OrgApplyInfoForm-orgLeader"
|
|
|
|
|
|
name="orgLeader">
|
2025-10-29 10:50:15 +08:00
|
|
|
|
<a-input v-model:value="formData.orgLeader" disabled allow-clear></a-input>
|
|
|
|
|
|
<!-- {{ formData.orgLeader }} -->
|
2025-07-09 15:50:10 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :span="12">
|
2025-07-29 17:33:49 +08:00
|
|
|
|
<a-form-item label="负责人电话" v-bind="validateInfos.orgLeaderPhone" id="OrgApplyInfoForm-orgLeaderPhone"
|
2025-07-09 15:50:10 +08:00
|
|
|
|
name="orgLeaderPhone">
|
2025-10-29 10:50:15 +08:00
|
|
|
|
<a-input v-model:value="formData.orgLeaderPhone" disabled allow-clear></a-input>
|
|
|
|
|
|
<!-- {{ formData.orgLeaderPhone }} -->
|
2025-07-09 15:50:10 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :span="12">
|
2025-07-29 17:33:49 +08:00
|
|
|
|
<a-form-item label="房屋性质" v-bind="validateInfos.orgPropertyType" id="OrgApplyInfoForm-orgPropertyType"
|
2025-07-09 15:50:10 +08:00
|
|
|
|
name="orgPropertyType">
|
2025-10-29 10:50:15 +08:00
|
|
|
|
<a-input v-model:value="formData.orgPropertyType" disabled allow-clear></a-input>
|
|
|
|
|
|
<!-- {{ formData.orgPropertyType }} -->
|
2025-07-09 15:50:10 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :span="12">
|
2025-10-29 10:50:15 +08:00
|
|
|
|
<a-form-item label="建筑面积(㎡)" v-bind="validateInfos.orgBuildingArea" id="OrgApplyInfoForm-orgBuildingArea"
|
2025-07-09 15:50:10 +08:00
|
|
|
|
name="orgBuildingArea">
|
2025-10-29 10:50:15 +08:00
|
|
|
|
<a-input v-model:value="formData.orgBuildingArea" disabled allow-clear></a-input>
|
|
|
|
|
|
<!-- {{ formData.orgBuildingArea }}㎡ -->
|
2025-07-11 08:37:28 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
|
<a-form-item label="机构地址" v-bind="validateInfos.orgAddress" id="OrgApplyInfoForm-orgAddress"
|
|
|
|
|
|
name="orgAddress">
|
2025-10-29 10:50:15 +08:00
|
|
|
|
<a-textarea :autosize="{ minRows: 1 }" maxlength="50" disabled v-model:value="formData.orgAddress"
|
|
|
|
|
|
allow-clear></a-textarea>
|
|
|
|
|
|
<!-- {{ formData.orgAddress }} -->
|
2025-07-09 15:50:10 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
</a-row>
|
2025-10-29 10:50:15 +08:00
|
|
|
|
<a-row v-if="formData.buildStatus == '3'" class="card-class">
|
|
|
|
|
|
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
|
2025-07-09 15:50:10 +08:00
|
|
|
|
<SectionDivider :title="'加盟合同'" />
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
|
<a-form-item label="加盟合同" v-bind="validateInfos.contract" id="OrgApplyInfoForm-contract">
|
2025-10-29 10:50:15 +08:00
|
|
|
|
<JUpload v-model:value="formData.contract" :maxCount="1" accept=".pdf" :beforeUpload="checkFileType">
|
|
|
|
|
|
</JUpload>
|
2025-07-09 15:50:10 +08:00
|
|
|
|
</a-form-item>
|
2025-07-11 09:42:59 +08:00
|
|
|
|
<div style="margin-top: 15px;margin-left:20%;color:#8e8e8e;font-size:12px;">说明:请上传pdf文件,并且只能上传一份文件</div>
|
2025-07-09 15:50:10 +08:00
|
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
|
<a-form-item label="备注信息" v-bind="validateInfos.contractNote" id="OrgApplyInfoForm-contractNote"
|
|
|
|
|
|
name="contractNote">
|
|
|
|
|
|
<a-textarea :autosize="{ minRows: 3 }" maxlength="100" show-count v-model:value="formData.contractNote"
|
|
|
|
|
|
allow-clear placeholder="请填写备注信息"></a-textarea>
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
</a-row>
|
|
|
|
|
|
</a-form>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</JFormContainer>
|
|
|
|
|
|
</a-spin>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
|
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
|
|
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
|
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
|
|
|
|
|
import { getValueType } from '/@/utils';
|
2025-10-29 10:50:15 +08:00
|
|
|
|
import { saveOrUpdate, submitContract, editCg } from '../OrgApplyInfo.api';
|
2025-07-09 15:50:10 +08:00
|
|
|
|
import { Form } from 'ant-design-vue';
|
|
|
|
|
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
|
|
|
|
|
import TencentMap from '/@/components/TencentMap/TencentMap.vue';
|
|
|
|
|
|
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
|
|
|
|
|
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
|
|
|
|
|
|
|
|
|
|
|
const cityViewValue = ref('')
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
|
formDisabled: { type: Boolean, default: false },
|
|
|
|
|
|
formData: { type: Object, default: () => ({}) },
|
|
|
|
|
|
formBpm: { type: Boolean, default: true }
|
|
|
|
|
|
});
|
|
|
|
|
|
const formRef = ref();
|
|
|
|
|
|
const useForm = Form.useForm;
|
|
|
|
|
|
const emit = defineEmits(['register', 'ok']);
|
|
|
|
|
|
const formData = reactive<Record<string, any>>({
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
openId: '',
|
|
|
|
|
|
wechatName: '',
|
|
|
|
|
|
tel: '',
|
|
|
|
|
|
status: '',
|
|
|
|
|
|
buildStatus: '',
|
|
|
|
|
|
content: '',
|
|
|
|
|
|
createTime: '',
|
|
|
|
|
|
updateTime: '',
|
|
|
|
|
|
izEntry: '',
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
sex: '',
|
|
|
|
|
|
national: '',
|
|
|
|
|
|
birthDate: '',
|
|
|
|
|
|
idCardAddress: '',
|
|
|
|
|
|
idCard: '',
|
|
|
|
|
|
issuingAuthority: '',
|
|
|
|
|
|
startTime: '',
|
|
|
|
|
|
endTime: '',
|
|
|
|
|
|
cardZmPath: '',
|
|
|
|
|
|
cardFmPath: '',
|
|
|
|
|
|
comBusinessLicense: '',
|
|
|
|
|
|
comName: '',
|
|
|
|
|
|
comRegisterAddress: '',
|
|
|
|
|
|
comCreditCode: '',
|
|
|
|
|
|
comLegalPerson: '',
|
|
|
|
|
|
orgAddress: '',
|
|
|
|
|
|
orgCoordinateLo: '',
|
|
|
|
|
|
orgCoordinateLa: '',
|
|
|
|
|
|
orgLeader: '',
|
|
|
|
|
|
orgLeaderPhone: '',
|
|
|
|
|
|
orgBuildingNumber: '',
|
|
|
|
|
|
orgPropertyType: '',
|
|
|
|
|
|
orgBuildingArea: undefined,
|
|
|
|
|
|
orgProvince: '',
|
|
|
|
|
|
orgCity: '',
|
|
|
|
|
|
orgDistrict: '',
|
|
|
|
|
|
orgProvince_dictText: '',
|
|
|
|
|
|
orgCity_dictText: '',
|
|
|
|
|
|
orgDistrict_dictText: '',
|
|
|
|
|
|
franchiseTime: null,
|
|
|
|
|
|
contract: null,
|
|
|
|
|
|
contractNote: null,
|
2025-07-28 15:21:46 +08:00
|
|
|
|
auditBy: '',
|
|
|
|
|
|
auditTime: null,
|
2025-07-09 15:50:10 +08:00
|
|
|
|
});
|
|
|
|
|
|
const tempNullVal = ref('')
|
|
|
|
|
|
const { createMessage } = useMessage();
|
2025-07-30 14:50:23 +08:00
|
|
|
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 8 } });
|
|
|
|
|
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 14 } });
|
2025-07-09 15:50:10 +08:00
|
|
|
|
const confirmLoading = ref<boolean>(false);
|
|
|
|
|
|
//表单验证
|
|
|
|
|
|
const validatorRules = reactive({
|
2025-07-29 10:38:19 +08:00
|
|
|
|
status: [{ required: true, message: '请选择审核结果!' },],
|
2025-07-09 15:50:10 +08:00
|
|
|
|
contract: [{ required: true, message: '请上传加盟合同!' },],
|
|
|
|
|
|
contractNote: [{ required: true, message: '请填写备注信息!' },],
|
|
|
|
|
|
});
|
|
|
|
|
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
|
|
|
|
|
|
|
|
|
|
|
// 表单禁用
|
|
|
|
|
|
const disabled = computed(() => {
|
|
|
|
|
|
if (props.formBpm === true) {
|
|
|
|
|
|
if (props.formData.disabled === false) {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return props.formDisabled;
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2025-07-28 15:21:46 +08:00
|
|
|
|
const checkFileType = (file) => {
|
|
|
|
|
|
const isPDF = file.type === 'application/pdf' || file.name.endsWith('.pdf');
|
|
|
|
|
|
if (!isPDF) {
|
|
|
|
|
|
createMessage.error('只能上传 PDF 文件!');
|
|
|
|
|
|
return false; // 阻止上传
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
};
|
2025-07-09 15:50:10 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 新增
|
|
|
|
|
|
*/
|
|
|
|
|
|
function add() {
|
|
|
|
|
|
edit({});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 编辑
|
|
|
|
|
|
*/
|
|
|
|
|
|
function edit(record) {
|
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
|
resetFields();
|
|
|
|
|
|
let tmpData = {};
|
|
|
|
|
|
Object.keys(formData).forEach((key) => {
|
|
|
|
|
|
if (record.hasOwnProperty(key)) {
|
|
|
|
|
|
tmpData[key] = record[key]
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
if (tmpData.status != '2' && tmpData.status != '3') {
|
|
|
|
|
|
tmpData.status = null
|
|
|
|
|
|
}
|
|
|
|
|
|
cityViewValue.value = record.orgProvince_dictText
|
|
|
|
|
|
+ (!!record.orgCity_dictText ? record.orgCity_dictText : '')
|
|
|
|
|
|
+ (!!record.orgDistrict_dictText ? record.orgDistrict_dictText : '')
|
|
|
|
|
|
//赋值
|
|
|
|
|
|
Object.assign(formData, tmpData);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 保存为草稿
|
|
|
|
|
|
*/
|
|
|
|
|
|
async function saveForm() {
|
|
|
|
|
|
console.log('保存为草稿')
|
|
|
|
|
|
try {
|
|
|
|
|
|
// 触发表单验证
|
|
|
|
|
|
await validate();
|
|
|
|
|
|
} catch ({ errorFields }) {
|
|
|
|
|
|
if (errorFields) {
|
|
|
|
|
|
const firstField = errorFields[0];
|
|
|
|
|
|
if (firstField) {
|
|
|
|
|
|
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return Promise.reject(errorFields);
|
|
|
|
|
|
}
|
|
|
|
|
|
confirmLoading.value = true;
|
|
|
|
|
|
//时间格式化
|
|
|
|
|
|
let model = formData;
|
|
|
|
|
|
//循环数据
|
|
|
|
|
|
for (let data in model) {
|
|
|
|
|
|
//如果该数据是数组并且是字符串类型
|
|
|
|
|
|
if (model[data] instanceof Array) {
|
|
|
|
|
|
let valueType = getValueType(formRef.value.getProps, data);
|
|
|
|
|
|
//如果是字符串类型的需要变成以逗号分割的字符串
|
|
|
|
|
|
if (valueType === 'string') {
|
|
|
|
|
|
model[data] = model[data].join(',');
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-29 10:38:19 +08:00
|
|
|
|
await editCg(model, true)
|
2025-07-09 15:50:10 +08:00
|
|
|
|
.then((res) => {
|
|
|
|
|
|
if (res.success) {
|
|
|
|
|
|
createMessage.success(res.message);
|
|
|
|
|
|
emit('ok');
|
|
|
|
|
|
} else {
|
|
|
|
|
|
createMessage.warning(res.message);
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
.finally(() => {
|
|
|
|
|
|
confirmLoading.value = false;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 保存并提交
|
|
|
|
|
|
*/
|
|
|
|
|
|
async function submitForm() {
|
|
|
|
|
|
try {
|
|
|
|
|
|
// 触发表单验证
|
|
|
|
|
|
await validate();
|
|
|
|
|
|
} catch ({ errorFields }) {
|
|
|
|
|
|
if (errorFields) {
|
|
|
|
|
|
const firstField = errorFields[0];
|
|
|
|
|
|
if (firstField) {
|
|
|
|
|
|
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return Promise.reject(errorFields);
|
|
|
|
|
|
}
|
|
|
|
|
|
confirmLoading.value = true;
|
|
|
|
|
|
//时间格式化
|
|
|
|
|
|
let model = formData;
|
|
|
|
|
|
//循环数据
|
|
|
|
|
|
for (let data in model) {
|
|
|
|
|
|
//如果该数据是数组并且是字符串类型
|
|
|
|
|
|
if (model[data] instanceof Array) {
|
|
|
|
|
|
let valueType = getValueType(formRef.value.getProps, data);
|
|
|
|
|
|
//如果是字符串类型的需要变成以逗号分割的字符串
|
|
|
|
|
|
if (valueType === 'string') {
|
|
|
|
|
|
model[data] = model[data].join(',');
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-11 08:37:28 +08:00
|
|
|
|
model.workOrderStatus = '1'
|
2025-07-11 09:42:59 +08:00
|
|
|
|
model.buildStatus = 'contractSubmit'//给后端判断是否为合同上传并提交状态
|
2025-07-09 15:50:10 +08:00
|
|
|
|
await submitContract(model)
|
|
|
|
|
|
.then((res) => {
|
|
|
|
|
|
emit('ok');
|
|
|
|
|
|
})
|
|
|
|
|
|
.finally(() => {
|
|
|
|
|
|
confirmLoading.value = false;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
|
|
add,
|
|
|
|
|
|
edit,
|
|
|
|
|
|
saveForm,
|
|
|
|
|
|
submitForm,
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
|
.antd-modal-form {
|
|
|
|
|
|
padding: 14px;
|
|
|
|
|
|
}
|
2025-10-29 10:50:15 +08:00
|
|
|
|
|
|
|
|
|
|
.card-class {
|
|
|
|
|
|
padding-top: 24px;
|
|
|
|
|
|
padding-bottom: 24px;
|
|
|
|
|
|
padding-left: 14px;
|
|
|
|
|
|
padding-right: 14px;
|
|
|
|
|
|
// background-color: rgba(255, 255, 255, 0.9);
|
|
|
|
|
|
background-color: #fcfdff;
|
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
|
// box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 12px;
|
|
|
|
|
|
margin-bottom: 14px;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2025-07-09 15:50:10 +08:00
|
|
|
|
</style>
|