|
|
@@ -22,7 +22,9 @@
|
|
|
</el-form-item>
|
|
|
</fieldset>
|
|
|
<fieldset class="g-fieldset el-form--horizontal">
|
|
|
- <legend class="g-fieldset__legend">{{ isPerson ? t('member.institution.user.edit.person') : t('member.institution.user.edit.enterprise') }}{{ t('member.institution.user.edit.legend') }}</legend>
|
|
|
+ <legend class="g-fieldset__legend">{{ isPerson ? t('member.institution.user.edit.person') :
|
|
|
+ t('member.institution.user.edit.enterprise') }}{{ t('member.institution.user.edit.legend') }}
|
|
|
+ </legend>
|
|
|
<el-form-item label="名称" prop="customername">
|
|
|
<el-input v-model="formData.customername" maxlength="50" :placeholder="t('common.pleaseenter')" />
|
|
|
</el-form-item>
|
|
|
@@ -41,26 +43,31 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.institution.user.edit.cardfrontphotourl')" prop="cardfrontphotourl">
|
|
|
<app-upload v-model="uploadFiles.cardfrontphotourl" :file-types="['image']"
|
|
|
- :type-message="t('common.tips21')" />
|
|
|
+ :type-message="t('common.tips21')" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="t('member.institution.user.edit.cardbackphotourl')" prop="cardbackphotourl" v-if="isPerson">
|
|
|
+ <el-form-item :label="t('member.institution.user.edit.cardbackphotourl')" prop="cardbackphotourl"
|
|
|
+ v-if="isPerson">
|
|
|
<app-upload v-model="uploadFiles.cardbackphotourl" :file-types="['image']"
|
|
|
- :type-message="t('common.tips21')" />
|
|
|
+ :type-message="t('common.tips21')" />
|
|
|
</el-form-item>
|
|
|
<template v-if="!isPerson">
|
|
|
<el-form-item :label="t('member.institution.user.edit.legalpersonname')" prop="legalpersonname">
|
|
|
- <el-input v-model="formData.legalpersonname" maxlength="50" :placeholder="t('common.pleaseenter')" />
|
|
|
+ <el-input v-model="formData.legalpersonname" maxlength="50"
|
|
|
+ :placeholder="t('common.pleaseenter')" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="t('member.institution.user.edit.legalcardfrontphotourl')" prop="legalcardfrontphotourl">
|
|
|
+ <el-form-item :label="t('member.institution.user.edit.legalcardfrontphotourl')"
|
|
|
+ prop="legalcardfrontphotourl">
|
|
|
<app-upload v-model="uploadFiles.legalcardfrontphotourl" :file-types="['image']"
|
|
|
- :type-message="t('common.tips21')" />
|
|
|
+ :type-message="t('common.tips21')" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="t('member.institution.user.edit.legalcardbackphotourl')" prop="legalcardbackphotourl">
|
|
|
+ <el-form-item :label="t('member.institution.user.edit.legalcardbackphotourl')"
|
|
|
+ prop="legalcardbackphotourl">
|
|
|
<app-upload v-model="uploadFiles.legalcardbackphotourl" :file-types="['image']"
|
|
|
- :type-message="t('common.tips21')" />
|
|
|
+ :type-message="t('common.tips21')" />
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.institution.user.edit.contactname')" prop="contactname">
|
|
|
- <el-input v-model="formData.contactname" maxlength="50" :placeholder="t('common.pleaseenter')" />
|
|
|
+ <el-input v-model="formData.contactname" maxlength="50"
|
|
|
+ :placeholder="t('common.pleaseenter')" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<el-form-item :label="t('member.institution.user.edit.sex')" prop="sex">
|
|
|
@@ -71,16 +78,21 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.institution.user.edit.mobile')" prop="mobile">
|
|
|
- <el-input type="number" v-model="formData.mobile" maxlength="50" :placeholder="t('common.pleaseenter')" />
|
|
|
+ <el-input type="number" v-model="formData.mobile" maxlength="50"
|
|
|
+ :placeholder="t('common.pleaseenter')" />
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.institution.user.edit.telphone')" prop="telphone">
|
|
|
- <el-input type="number" v-model="formData.telphone" maxlength="50" :placeholder="t('common.pleaseenter')" />
|
|
|
+ <el-input type="number" v-model="formData.telphone" maxlength="50"
|
|
|
+ :placeholder="t('common.pleaseenter')" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item class="el-form-item--row" :label="t('member.institution.user.edit.provinceid')" prop="provinceid">
|
|
|
- <app-region class="el-form-item--col" v-model:country="formData.countryid" v-model:province="formData.provinceid"
|
|
|
- v-model:city="formData.cityid" v-model:district="formData.districtid" />
|
|
|
+ <el-form-item class="el-form-item--row" :label="t('member.institution.user.edit.provinceid')"
|
|
|
+ prop="provinceid">
|
|
|
+ <app-region class="el-form-item--col" v-model:country="formData.countryid"
|
|
|
+ v-model:province="formData.provinceid" v-model:city="formData.cityid"
|
|
|
+ v-model:district="formData.districtid" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item class="el-form-item--row" :label="t('member.institution.user.edit.address')" prop="address">
|
|
|
+ <el-form-item class="el-form-item--row" :label="t('member.institution.user.edit.address')"
|
|
|
+ prop="address">
|
|
|
<el-input v-model="formData.address" maxlength="50" :placeholder="t('common.pleaseenter')" />
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.institution.user.edit.postalcode')" prop="postalcode">
|
|
|
@@ -90,7 +102,8 @@
|
|
|
<el-input v-model="formData.email" maxlength="50" :placeholder="t('common.pleaseenter')" />
|
|
|
</el-form-item>
|
|
|
<el-form-item class="el-form-item--row" :label="t('member.institution.user.edit.remark')" prop="remark">
|
|
|
- <el-input type="textarea" v-model="formData.remark" maxlength="200" :rows="3" :placeholder="t('common.pleaseenter')" />
|
|
|
+ <el-input type="textarea" v-model="formData.remark" maxlength="200" :rows="3"
|
|
|
+ :placeholder="t('common.pleaseenter')" />
|
|
|
</el-form-item>
|
|
|
</fieldset>
|
|
|
<fieldset class="g-fieldset el-form--horizontal" v-if="data && data.rspResult.usertype !== 4">
|
|
|
@@ -98,7 +111,8 @@
|
|
|
<el-form-item :label="t('member.institution.user.edit.username1')">
|
|
|
{{ data.users.username }}
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="t('member.institution.user.edit.userinfotype1')" prop="userinfotype" v-if="data.rspResult.usertype === 2">
|
|
|
+ <el-form-item :label="t('member.institution.user.edit.userinfotype1')" prop="userinfotype"
|
|
|
+ v-if="data.rspResult.usertype === 2">
|
|
|
{{ data.rspResult.reckonaccountid }}
|
|
|
</el-form-item>
|
|
|
</fieldset>
|
|
|
@@ -106,7 +120,7 @@
|
|
|
<legend class="g-fieldset__legend">{{ t('member.institution.user.edit.attachment') }}</legend>
|
|
|
<el-form-item :label="t('member.institution.user.edit.attachment1')" prop="attachment1">
|
|
|
<app-upload v-model="uploadFiles.attachment1" :file-types="['image', 'pdf']"
|
|
|
- :type-message="t('common.tips21')" />
|
|
|
+ :type-message="t('common.tips21')" />
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.institution.user.edit.attachment2')" prop="attachment2">
|
|
|
<app-upload v-model="uploadFiles.attachment2" :file-types="['image', 'pdf']"
|
|
|
@@ -124,7 +138,7 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, reactive, PropType, computed } from 'vue'
|
|
|
import { ElMessage, FormInstance, FormRules, UploadUserFile } from 'element-plus'
|
|
|
-import { handleNoneValue } from '@/filters'
|
|
|
+import { handleNoneValue, parseFilePaths, extractFilePaths } from '@/filters'
|
|
|
import { useEnum } from '@/hooks/enum'
|
|
|
import { decryptAES } from '@/services/crypto'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
@@ -135,7 +149,6 @@ import AppUpload from '@pc/components/base/upload/index.vue'
|
|
|
import AppEnum from '@pc/components/modules/enum/index.vue'
|
|
|
import AppRegion from '@pc/components/modules/region/index.vue'
|
|
|
import AppSelectMember from '@pc/components/modules/select-member/index.vue'
|
|
|
-import service from '@/services'
|
|
|
import { i18n } from '@/stores'
|
|
|
|
|
|
const props = defineProps({
|
|
|
@@ -176,21 +189,6 @@ const uploadFiles = reactive<{
|
|
|
// 是否个人
|
|
|
const isPerson = computed(() => formData.value.userinfotype === UserInfoType.Personal)
|
|
|
|
|
|
-const getUploadFiles = (value?: string) => {
|
|
|
- const paths = value ? value.split(',') : []
|
|
|
- return paths.map((url) => {
|
|
|
- const urlObj = new URL(url, service.getConfig('apiUrl'))
|
|
|
- const name = urlObj.pathname.split('/').pop()
|
|
|
- return {
|
|
|
- name: name ?? urlObj.href,
|
|
|
- url: urlObj.href,
|
|
|
- response: {
|
|
|
- data: [{ filePath: value }]
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
const { data, loading } = useRequest(queryOrganDetail, {
|
|
|
params: {
|
|
|
areaId: props.record.userid
|
|
|
@@ -199,12 +197,12 @@ const { data, loading } = useRequest(queryOrganDetail, {
|
|
|
const { rspResult, userinfo, users } = res.data
|
|
|
|
|
|
if (userinfo) {
|
|
|
- uploadFiles.cardfrontphotourl = getUploadFiles(userinfo.cardfrontphotourl)
|
|
|
- uploadFiles.cardbackphotourl = getUploadFiles(userinfo.cardbackphotourl)
|
|
|
- uploadFiles.legalcardfrontphotourl = getUploadFiles(userinfo.legalcardfrontphotourl)
|
|
|
- uploadFiles.legalcardbackphotourl = getUploadFiles(userinfo.legalcardbackphotourl)
|
|
|
- uploadFiles.attachment1 = getUploadFiles(userinfo.attachment1)
|
|
|
- uploadFiles.attachment2 = getUploadFiles(userinfo.attachment2)
|
|
|
+ uploadFiles.cardfrontphotourl = parseFilePaths(userinfo.cardfrontphotourl)
|
|
|
+ uploadFiles.cardbackphotourl = parseFilePaths(userinfo.cardbackphotourl)
|
|
|
+ uploadFiles.legalcardfrontphotourl = parseFilePaths(userinfo.legalcardfrontphotourl)
|
|
|
+ uploadFiles.legalcardbackphotourl = parseFilePaths(userinfo.legalcardbackphotourl)
|
|
|
+ uploadFiles.attachment1 = parseFilePaths(userinfo.attachment1)
|
|
|
+ uploadFiles.attachment2 = parseFilePaths(userinfo.attachment2)
|
|
|
}
|
|
|
|
|
|
formData.value = {
|
|
|
@@ -266,22 +264,14 @@ const onCancel = (isRefresh = false) => {
|
|
|
refresh.value = isRefresh
|
|
|
}
|
|
|
|
|
|
-// 更新上传文件到表单中
|
|
|
-const updateUploadFiles = (uploadFiles: UploadUserFile[]) => {
|
|
|
- return uploadFiles.map((e) => {
|
|
|
- const res = e.response as { data: { filePath: string }[] }
|
|
|
- return res.data.map((e) => e.filePath)
|
|
|
- }).join(',')
|
|
|
-}
|
|
|
-
|
|
|
const onSubmit = () => {
|
|
|
const rawData = { ...formData.value }
|
|
|
- rawData.cardfrontphotourl = updateUploadFiles(uploadFiles.cardfrontphotourl)
|
|
|
- rawData.cardbackphotourl = updateUploadFiles(uploadFiles.cardbackphotourl)
|
|
|
- rawData.legalcardfrontphotourl = updateUploadFiles(uploadFiles.legalcardfrontphotourl)
|
|
|
- rawData.legalcardbackphotourl = updateUploadFiles(uploadFiles.legalcardbackphotourl)
|
|
|
- rawData.attachment1 = updateUploadFiles(uploadFiles.attachment1)
|
|
|
- rawData.attachment2 = updateUploadFiles(uploadFiles.attachment2)
|
|
|
+ rawData.cardfrontphotourl = extractFilePaths(uploadFiles.cardfrontphotourl)
|
|
|
+ rawData.cardbackphotourl = extractFilePaths(uploadFiles.cardbackphotourl)
|
|
|
+ rawData.legalcardfrontphotourl = extractFilePaths(uploadFiles.legalcardfrontphotourl)
|
|
|
+ rawData.legalcardbackphotourl = extractFilePaths(uploadFiles.legalcardbackphotourl)
|
|
|
+ rawData.attachment1 = extractFilePaths(uploadFiles.attachment1)
|
|
|
+ rawData.attachment2 = extractFilePaths(uploadFiles.attachment2)
|
|
|
|
|
|
formRef.value?.validate((valid) => {
|
|
|
if (valid) {
|