| | |
| | | <ProForm :model="form" :rules="rules" ref="formRef" label-width="120px" :is-read="isDetail"> |
| | | <ProFormCol> |
| | | <ProFormColItem :span="12"> |
| | | <ProFormItemV2 label="企业名称:" prop="name" required> |
| | | <ProFormItemV2 label="企业名称:" prop="enterpriseName"> |
| | | <ProFormText |
| | | v-model.trim="form.name" |
| | | v-model.trim="form.enterpriseName" |
| | | :maxlength="30" |
| | | placeholder="请输入供应商名称" |
| | | /> |
| | |
| | | </ProFormCol> |
| | | <ProFormCol> |
| | | <ProFormColItem :span="12"> |
| | | <ProFormItemV2 label="法人姓名:" prop="name" required> |
| | | <ProFormItemV2 label="法人姓名:" prop="legalPersonName"> |
| | | <ProFormText |
| | | v-model.trim="form.name" |
| | | v-model.trim="form.legalPersonName" |
| | | :maxlength="30" |
| | | placeholder="请输入法人姓名" |
| | | /> |
| | |
| | | </ProFormCol> |
| | | <ProFormCol> |
| | | <ProFormColItem :span="12"> |
| | | <ProFormItemV2 label="法人身份证号:" prop="name" required> |
| | | <ProFormItemV2 label="法人身份证号:" prop="legalPersonIdNumber"> |
| | | <ProFormText |
| | | v-model.trim="form.name" |
| | | v-model.trim="form.legalPersonIdNumber" |
| | | :maxlength="30" |
| | | placeholder="请输入法人身份证号" |
| | | /> |
| | |
| | | </ProFormCol> |
| | | <ProFormCol> |
| | | <ProFormColItem :span="12"> |
| | | <ProFormItemV2 label="所在省份:" prop="name" required> |
| | | <ProFormItemV2 label="所在省份:" prop="proviceName"> |
| | | <ProFormText |
| | | v-model.trim="form.name" |
| | | v-model.trim="form.proviceName" |
| | | :maxlength="30" |
| | | placeholder="请输入所在省份" |
| | | /> |
| | |
| | | </ProFormCol> |
| | | <ProFormCol> |
| | | <ProFormColItem :span="12"> |
| | | <ProFormItemV2 label="所属行业:" prop="name" required> |
| | | <ProFormItemV2 label="所属行业:" prop="belongIndustryType"> |
| | | <ProFormSelect |
| | | placeholder="请选择所属行业" |
| | | :value-enum="typeList" |
| | | enum-value-key="id" |
| | | enum-label-key="name" |
| | | clearable |
| | | v-model="form.name" |
| | | v-model="form.belongIndustryType" |
| | | ></ProFormSelect> |
| | | </ProFormItemV2> |
| | | </ProFormColItem> |
| | | </ProFormCol> |
| | | <ProFormCol> |
| | | <ProFormColItem :span="12"> |
| | | <ProFormItemV2 label="所在城市:" prop="name" required> |
| | | <ProFormItemV2 label="所在城市:" prop="cityName"> |
| | | <ProFormText |
| | | v-model.trim="form.name" |
| | | v-model.trim="form.cityName" |
| | | :maxlength="30" |
| | | placeholder="请输入所在城市" |
| | | /> |
| | |
| | | </ProFormCol> |
| | | <ProFormCol> |
| | | <ProFormColItem :span="24"> |
| | | <ProFormItemV2 label="主营业务:" prop="name"> |
| | | <ProFormItemV2 label="主营业务:" prop="cityName"> |
| | | <ProFormTextArea |
| | | v-model="form.name" |
| | | v-model="form.cityName" |
| | | maxlength="200" |
| | | :rows="6" |
| | | show-word-limit |
| | |
| | | </ProFormCol> |
| | | </ProForm> |
| | | </ChunkCell> |
| | | <ChunkCell title="账号信息"> |
| | | <ProForm |
| | | :model="form" |
| | | :rules="rules" |
| | | ref="accountFormRef" |
| | | label-width="140px" |
| | | :scroll-to-error="false" |
| | | :is-read="isDetail" |
| | | > |
| | | <ProFormCol> |
| | | <ProFormColItem :span="12"> |
| | | <ProFormItemV2 label="账号:" prop="contact"> |
| | | <ProFormText v-model.trim="form.contact" :maxlength="30" placeholder="请输入账号" /> |
| | | </ProFormItemV2> |
| | | </ProFormColItem> |
| | | </ProFormCol> |
| | | <div class="chuck-add-or-edit-actions"> |
| | | <el-button @click="handleBack">返回</el-button> |
| | | <el-button v-if="!isDetail" type="primary" @click="handleSubmit">确认</el-button> |
| | | </div> |
| | | </ProForm> |
| | | </ChunkCell> |
| | | </AppScrollContainer> |
| | | </LoadingLayout> |
| | | </template> |
| | |
| | | } from '@bole-core/components'; |
| | | import { FormRules, FormInstance } from 'element-plus'; |
| | | import { SearchType } from '@/constants'; |
| | | import * as searchSettingServices from '@/services/api/SearchSetting'; |
| | | import * as flexEnterpriseServices from '@/services/api/FlexEnterprise'; |
| | | import { useRouteView, useGlobalEventContext, GlobalEvent, useSearchSettingType } from '@/hooks'; |
| | | import _ from 'lodash'; |
| | | import { validateFormList, filterCN } from '@/utils'; |
| | |
| | | id: '', |
| | | emitAddEvent: 'enterprise:add', |
| | | emitEditEvent: 'enterprise:edit', |
| | | backRouteName: '', |
| | | backRouteName: 'EnterpriseManageList', |
| | | }); |
| | | |
| | | const route = useRoute(); |
| | |
| | | |
| | | const form = reactive({ |
| | | id: '', |
| | | name: '', |
| | | enterpriseName: '', |
| | | legalPersonName: '', |
| | | legalPersonIdNumber: '', |
| | | societyCreditCode: '', |
| | | proviceName: '', |
| | | cityName: '', |
| | | belongIndustryType: '', |
| | | contact: '', |
| | | contactPhone: '', |
| | | email: '', |
| | |
| | | |
| | | const formRef = ref<FormInstance>(); |
| | | const settingFormRef = ref<FormInstance>(); |
| | | const accountFormRef = ref<FormInstance>(); |
| | | |
| | | const rules = reactive<FormRules>({ |
| | | name: [{ required: true, message: '请输入供应商名称', trigger: 'blur' }], |
| | | societyCreditCode: [{ required: true, message: '请输入统一信用代码', trigger: 'blur' }], |
| | | categoryType: [{ required: true, message: '请选择行业配套', trigger: 'change' }], |
| | | areaList: [{ required: true, message: '请选择所在地区', trigger: 'change', type: 'array' }], |
| | | companyAddress: [{ required: true, message: '请输入公司地址', trigger: 'blur' }], |
| | | enterpriseName: [{ required: true, message: '请输入企业名称', trigger: 'blur' }], |
| | | contact: [{ required: true, message: '请输入联系人', trigger: 'blur' }], |
| | | suppierLevel: [{ required: true, message: '请选择供应商等级', trigger: 'change' }], |
| | | // suppierType: [{ required: true, message: '请选择供应商类型', trigger: 'change' }], |
| | | contactPhone: [ |
| | | { required: true, message: '请输入联系电话', trigger: 'blur' }, |
| | | { message: '请输入正确的联系电话', trigger: 'blur', pattern: BoleRegExp.RegPhoneNumber }, |
| | |
| | | |
| | | async function handleSubmit() { |
| | | try { |
| | | const valid = await validateFormList([formRef.value, settingFormRef.value]); |
| | | const valid = await validateFormList([ |
| | | formRef.value, |
| | | settingFormRef.value, |
| | | accountFormRef.value, |
| | | ]); |
| | | if (valid) { |
| | | handleCreateOrEditInsureSupplier(); |
| | | handleCreateOrEditFlexEnterprise(); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function handleCreateOrEditInsureSupplier() { |
| | | async function handleCreateOrEditFlexEnterprise() { |
| | | try { |
| | | // let params: API.CreateOrEditSearchInput = { |
| | | // name: form.name, |
| | | // }; |
| | | // if (isEdit.value) { |
| | | // params.id = props.id; |
| | | // } |
| | | // let res = await searchSettingServices.createOrEditSearchSetting(params); |
| | | // if (res) { |
| | | // Message.successMessage(isEdit ? '编辑成功' : '发布成功'); |
| | | // eventContext.emit(isEdit ? 'enterprise:edit' : 'enterprise:add'); |
| | | // handleBack(); |
| | | // } |
| | | let params: API.CreateOrEditFlexEnterpriseInput = { |
| | | enterpriseName: form.enterpriseName, |
| | | legalPersonName: form.legalPersonName, |
| | | legalPersonIdNumber: form.legalPersonIdNumber, |
| | | societyCreditCode: form.societyCreditCode, |
| | | proviceName: form.proviceName, |
| | | cityName: form.cityName, |
| | | belongIndustryType: form.belongIndustryType, |
| | | contact: form.contact, |
| | | contactPhone: form.contactPhone, |
| | | // email: form.email, |
| | | }; |
| | | if (isEdit.value) { |
| | | params.id = props.id; |
| | | } |
| | | let res = await flexEnterpriseServices.createOrEditFlexEnterprise(params); |
| | | if (res) { |
| | | Message.successMessage(isEdit ? '编辑成功' : '发布成功'); |
| | | eventContext.emit(isEdit ? 'enterprise:edit' : 'enterprise:add'); |
| | | handleBack(); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |