zhengyiming
6 天以前 20459fe59f680031bfc7c1012be860e0727cb016
src/views/EnterpriseManage/components/AddOrEditEnterpriseView.vue
@@ -2,14 +2,18 @@
  <LoadingLayout :loading="isEdit && isLoading">
    <AppScrollContainer>
      <ChunkCell title="企业基本信息">
        <ProForm :model="form" :rules="rules" ref="formRef" label-width="120px" :is-read="isDetail">
        <ProForm :model="form" ref="formRef" label-width="140px" :is-read="isDetail">
          <ProFormCol>
            <ProFormColItem :span="12">
              <ProFormItemV2 label="企业名称:" prop="enterpriseName">
              <ProFormItemV2
                label="企业名称:"
                prop="enterpriseName"
                :check-rules="[{ message: '请输入企业名称' }]"
              >
                <ProFormText
                  v-model.trim="form.enterpriseName"
                  :maxlength="30"
                  placeholder="请输入供应商名称"
                  placeholder="请输入企业名称"
                />
              </ProFormItemV2>
            </ProFormColItem>
@@ -38,7 +42,11 @@
          </ProFormCol>
          <ProFormCol>
            <ProFormColItem :span="12">
              <ProFormItemV2 label="统一社会信用代码:" prop="societyCreditCode">
              <ProFormItemV2
                label="统一社会信用代码:"
                prop="societyCreditCode"
                :check-rules="[{ message: '请输入统一社会信用代码', type: 'societyCreditCode' }]"
              >
                <ProFormText
                  v-model.trim="form.societyCreditCode"
                  placeholder="请输入统一社会信用代码"
@@ -100,7 +108,6 @@
      <ChunkCell title="联系信息">
        <ProForm
          :model="form"
          :rules="rules"
          ref="settingFormRef"
          label-width="140px"
          :scroll-to-error="false"
@@ -108,7 +115,11 @@
        >
          <ProFormCol>
            <ProFormColItem :span="12">
              <ProFormItemV2 label="联系人:" prop="contact">
              <ProFormItemV2
                label="联系人:"
                prop="contact"
                :check-rules="[{ message: '请输入联系人' }]"
              >
                <ProFormText
                  v-model.trim="form.contact"
                  :maxlength="30"
@@ -119,7 +130,11 @@
          </ProFormCol>
          <ProFormCol>
            <ProFormColItem :span="12">
              <ProFormItemV2 label="联系电话:" prop="contactPhone">
              <ProFormItemV2
                label="联系电话:"
                prop="contactPhone"
                :check-rules="[{ message: '请输入联系电话', type: 'phone' }]"
              >
                <ProFormText v-model.trim="form.contactPhone" placeholder="请输入联系电话" />
              </ProFormItemV2>
            </ProFormColItem>
@@ -141,7 +156,6 @@
      <ChunkCell title="账号信息">
        <ProForm
          :model="form"
          :rules="rules"
          ref="accountFormRef"
          label-width="140px"
          :scroll-to-error="false"
@@ -149,7 +163,11 @@
        >
          <ProFormCol>
            <ProFormColItem :span="12">
              <ProFormItemV2 label="账号:" prop="contact">
              <ProFormItemV2
                label="账号:"
                prop="contact"
                :check-rules="[{ message: '请输入账号' }]"
              >
                <ProFormText v-model.trim="form.contact" :maxlength="30" placeholder="请输入账号" />
              </ProFormItemV2>
            </ProFormColItem>
@@ -178,8 +196,7 @@
} from '@bole-core/components';
import { FormRules, FormInstance } from 'element-plus';
import { SearchType } from '@/constants';
import * as flexEnterpriseServices from '@/services/api/FlexEnterprise';
import { useRouteView, useGlobalEventContext, GlobalEvent, useSearchSettingType } from '@/hooks';
import { useRouteView, useGlobalEventContext, GlobalEvent } from '@/hooks';
import _ from 'lodash';
import { validateFormList, filterCN } from '@/utils';
import { Message, BoleRegExp } from '@bole-core/core';
@@ -207,9 +224,7 @@
const { closeViewPush } = useRouteView();
const eventContext = useGlobalEventContext();
const { searchSettingTypeList: typeList } = useSearchSettingType({
  searchType: SearchType.IndustryCategory,
});
const typeList = ref([]);
const form = reactive({
  id: '',
@@ -244,15 +259,6 @@
const formRef = ref<FormInstance>();
const settingFormRef = ref<FormInstance>();
const accountFormRef = ref<FormInstance>();
const rules = reactive<FormRules>({
  enterpriseName: [{ required: true, message: '请输入企业名称', trigger: 'blur' }],
  contact: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
  contactPhone: [
    { required: true, message: '请输入联系电话', trigger: 'blur' },
    { message: '请输入正确的联系电话', trigger: 'blur', pattern: BoleRegExp.RegPhoneNumber },
  ],
});
async function handleSubmit() {
  try {