From e83afaf476ea4a6eadde2bf0bf7f76fac71014bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=B1=7E=E6=B5=B7=7E=E7=88=B1=E6=B5=B7=E7=88=B1?= =?UTF-8?q?=E6=B5=B7=7E=E5=8F=B3?= <1828712314@qq.com> Date: Tue, 1 Apr 2025 09:07:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A1=A8=E5=8D=95=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E9=80=BB=E8=BE=91=EF=BC=8C=E8=B0=83=E6=95=B4=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=A3=B0=E6=98=8E=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/enterprises/update.vue | 37 ++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/src/views/enterprises/update.vue b/src/views/enterprises/update.vue index fcf0101..dcccec2 100644 --- a/src/views/enterprises/update.vue +++ b/src/views/enterprises/update.vue @@ -88,7 +88,7 @@ v-for="(p, index) in formData.photo" :src="p.url" :key="index" - :preview-src-list="formData.photo.map((i) => i.url)" + :preview-src-list="formData.photo.map((i: any) => i.url)" :initial-index="index" fit="contain" class="w-148px h-148px border-solid border-1 border-color-#ccc border-rounded-8px" @@ -211,8 +211,8 @@ @@ -287,7 +287,22 @@ const formRules = reactive({ enterprisesName: [{ required: true, message: '企业名称不能为空', trigger: 'blur' }], contactName: [{ required: true, message: '负责人不能为空', trigger: 'blur' }], environmentalContactPhone: [ - { required: true, message: '企业环保负责人联系电话不能为空', trigger: 'blur' } + { required: true, message: '企业环保负责人联系电话不能为空', trigger: 'blur' }, + { + validator: (rule: any, value: any, callback) => { + if ( + value && + !/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test( + value + ) + ) { + callback(new Error('请输入正确的手机号')) + } else { + callback() + } + }, + trigger: 'blur' + } ], userId: [ { @@ -448,7 +463,7 @@ const getDetail = () => { formData.value.region = getDictLabel(DICT_TYPE.ENTERPRISES_AREA, formData.value.region) formData.value.tagIds = res.tagObjList.map((i) => i.tagName).join(',') } - console.log(formData.value.tagIds) + console.log(formData.value.tagIds) }) } @@ -457,7 +472,7 @@ const getProveList = () => { pageSize: -1, enterpriseId: formData.value.id }).then((res) => { - proveList.value = res.list.map((i) => { + proveList.value = res.list.map((i:any) => { return { ...i, files: i.qualificationFiles @@ -466,7 +481,7 @@ const getProveList = () => { }) } -const deleteProve = (params) => { +const deleteProve = (params:any) => { if (params.id) { EnterpriseQualificationApi.deleteEnterpriseQualification(params.id).then(() => { message.success('删除成功') @@ -474,7 +489,7 @@ const deleteProve = (params) => { }) } else { proveList.value.splice(params.index, 1) - message.success('删除成功') + message.success('删除成功') } } @@ -504,15 +519,15 @@ const logSpanMethod = ({ row, column, rowIndex, columnIndex }) => { } } -const showInspection = (id) => { +const showInspection = (id:any) => { unref(inspectionRef).open({ id }) } -const getSpanArr = (data) => { +const getSpanArr = (data:any) => { logSpanArr.value = [] let pos = 0 - for (var i = 0; i < data.length; i++) { + for (let i = 0; i < data.length; i++) { if (i === 0) { logSpanArr.value.push(1) pos = 0