|
|
@@ -1,38 +1,52 @@
|
|
|
<!-- 会员机构管理-子机构管理-子机构管理-编辑 -->
|
|
|
<template>
|
|
|
- <app-drawer :title="t('member.subinstitution.manage.edit.title')" width="900" v-model:show="show" :refresh="refresh" :loading="loading">
|
|
|
+ <app-drawer :title="t('member.subinstitution.manage.edit.title')" width="900" v-model:show="show" :refresh="refresh"
|
|
|
+ :loading="loading">
|
|
|
<el-form ref="formRef" label-width="140px" :model="formData" :rules="formRules" :show-message="false">
|
|
|
<fieldset class="g-fieldset el-form--horizontal">
|
|
|
<legend class="g-fieldset__legend">{{ t('common.baseinfo') }}</legend>
|
|
|
- <el-form-item :label="t('member.subinstitution.manage.edit.referral')" prop="referral">
|
|
|
- {{ selectedParent?.accountname }}
|
|
|
+ <el-form-item :label="t('member.subinstitution.manage.edit.referral')" prop="parentuserid"
|
|
|
+ v-if="!record">
|
|
|
+ <span v-if="selectedParent">{{ selectedParent.accountname }}</span>
|
|
|
+ <app-select-institution v-model="formData.parentuserid"
|
|
|
+ :params="{ usertype: '3', level: 5, roles: '7' }"
|
|
|
+ :placeholder="t('member.subinstitution.manage.edit.tips1')" v-else />
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.subinstitution.manage.edit.userinfotype')" prop="userinfotype">
|
|
|
- <el-radio-group v-model="formData.userinfotype" :disabled="!!record">
|
|
|
+ <span v-if="record">{{ getUserInfoTypeName(formData.userinfotype) }}</span>
|
|
|
+ <el-radio-group v-model="formData.userinfotype" v-else>
|
|
|
<template v-for="item in getUserInfoTypeList()" :key="item.value">
|
|
|
<el-radio :label="item.label" :value="item.value" />
|
|
|
</template>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.subinstitution.manage.edit.userid')" prop="userid">
|
|
|
- <el-input v-model="formData.userid" maxlength="4" :placeholder="t('common.pleaseenter')" :disabled="!!record" />
|
|
|
+ <span v-if="record">{{ formData.userid }}</span>
|
|
|
+ <el-input v-model="formData.userid" maxlength="4" :placeholder="t('common.pleaseenter')" v-else />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="机构类型" v-if="record">
|
|
|
+ {{ usertype2Enum.getEnumTypeName(record.usertype) }}
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.subinstitution.manage.edit.accountname')" prop="accountname">
|
|
|
<el-input v-model="formData.accountname" maxlength="50" :placeholder="t('common.pleaseenter')" />
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.subinstitution.manage.edit.refereeuserid')" prop="refereeuserid">
|
|
|
- <app-select-member v-model="formData.refereeuserid" usertype="2,3" :placeholder="t('member.subinstitution.manage.edit.tips1')" />
|
|
|
+ <app-select-member v-model="formData.refereeuserid" :params="{ usertype: '2,3' }"
|
|
|
+ :placeholder="t('member.subinstitution.manage.edit.tips1')" />
|
|
|
</el-form-item>
|
|
|
</fieldset>
|
|
|
<fieldset class="g-fieldset el-form--horizontal">
|
|
|
- <legend class="g-fieldset__legend">{{ isPerson ? t('member.subinstitution.manage.edit.person') : t('member.subinstitution.manage.edit.companny') }}{{ t('member.subinstitution.manage.edit.profile') }}</legend>
|
|
|
+ <legend class="g-fieldset__legend">{{ isPerson ? t('member.subinstitution.manage.edit.person') :
|
|
|
+ t('member.subinstitution.manage.edit.companny') }}{{ t('member.subinstitution.manage.edit.profile')
|
|
|
+ }}</legend>
|
|
|
<el-form-item :label="t('member.subinstitution.manage.edit.customername')" prop="customername">
|
|
|
<el-input v-model="formData.customername" maxlength="50" :placeholder="t('common.pleaseenter')" />
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.subinstitution.manage.edit.company')" prop="company" v-if="isPerson">
|
|
|
<el-input v-model="formData.company" maxlength="50" :placeholder="t('common.pleaseenter')" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="t('member.subinstitution.manage.edit.biznature')" prop="biznature" v-if="!isPerson">
|
|
|
+ <el-form-item :label="t('member.subinstitution.manage.edit.biznature')" prop="biznature"
|
|
|
+ v-if="!isPerson">
|
|
|
<app-enum code="biznature" v-model="formData.biznature" :empty-values="[0]" />
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.subinstitution.manage.edit.cardtypeid')" prop="cardtypeid">
|
|
|
@@ -42,28 +56,35 @@
|
|
|
<el-form-item :label="t('member.subinstitution.manage.edit.cardnum')" prop="cardnum">
|
|
|
<el-input v-model="formData.cardnum" maxlength="50" :placeholder="t('common.pleaseenter')" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="t('member.subinstitution.manage.edit.cardfrontphotourl')" prop="cardfrontphotourl">
|
|
|
+ <el-form-item :label="t('member.subinstitution.manage.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.subinstitution.manage.edit.cardbackphotourl')" prop="cardbackphotourl" v-if="isPerson">
|
|
|
+ <el-form-item :label="t('member.subinstitution.manage.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.subinstitution.manage.edit.legalpersonname')" prop="legalpersonname">
|
|
|
- <el-input v-model="formData.legalpersonname" maxlength="50" :placeholder="t('common.pleaseenter')" />
|
|
|
+ <el-form-item :label="t('member.subinstitution.manage.edit.legalpersonname')"
|
|
|
+ prop="legalpersonname">
|
|
|
+ <el-input v-model="formData.legalpersonname" maxlength="50"
|
|
|
+ :placeholder="t('common.pleaseenter')" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="t('member.subinstitution.manage.edit.legalcardfrontphotourl')" prop="legalcardfrontphotourl">
|
|
|
+ <el-form-item :label="t('member.subinstitution.manage.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.subinstitution.manage.edit.legalcardbackphotourl')" prop="legalcardbackphotourl">
|
|
|
+ <el-form-item :label="t('member.subinstitution.manage.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.subinstitution.manage.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.subinstitution.manage.edit.sex')" prop="sex">
|
|
|
@@ -74,16 +95,20 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.subinstitution.manage.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.subinstitution.manage.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.subinstitution.manage.edit.provinceid')" prop="provinceid">
|
|
|
+ <el-form-item class="el-form-item--row" :label="t('member.subinstitution.manage.edit.provinceid')"
|
|
|
+ prop="provinceid">
|
|
|
<app-region class="el-form-item--col" 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.subinstitution.manage.edit.address')" prop="address">
|
|
|
+ <el-form-item class="el-form-item--row" :label="t('member.subinstitution.manage.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.subinstitution.manage.edit.postalcode')" prop="postalcode">
|
|
|
@@ -92,38 +117,46 @@
|
|
|
<el-form-item :label="t('member.subinstitution.manage.edit.email')" prop="email">
|
|
|
<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.subinstitution.manage.edit.remark')" prop="remark">
|
|
|
- <el-input type="textarea" v-model="formData.remark" maxlength="200" :rows="2" :placeholder="t('common.pleaseenter')" />
|
|
|
+ <el-form-item class="el-form-item--row" :label="t('member.subinstitution.manage.edit.remark')"
|
|
|
+ prop="remark">
|
|
|
+ <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">
|
|
|
<legend class="g-fieldset__legend">{{ t('member.subinstitution.manage.edit.subtitle') }}</legend>
|
|
|
<el-form-item :label="t('member.subinstitution.manage.edit.logincode')" prop="logincode">
|
|
|
- <el-input v-model="formData.logincode" maxlength="50" :placeholder="t('common.pleaseenter')" :disabled="!!record" />
|
|
|
+ <span v-if="record">{{ formData.logincode }}</span>
|
|
|
+ <el-input v-model="formData.logincode" maxlength="50" :placeholder="t('common.pleaseenter')"
|
|
|
+ v-else />
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.subinstitution.manage.edit.username')" prop="username">
|
|
|
- <el-input v-model="formData.username" maxlength="50" :placeholder="t('common.pleaseenter')" :disabled="!!record" />
|
|
|
+ <span v-if="record">{{ formData.username }}</span>
|
|
|
+ <el-input v-model="formData.username" maxlength="50" :placeholder="t('common.pleaseenter')"
|
|
|
+ v-else />
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="t('member.subinstitution.manage.edit.smpassword')" prop="smpassword" v-if="!record">
|
|
|
- <el-input value="123456" disabled />
|
|
|
+ <el-form-item :label="t('member.subinstitution.manage.edit.smpassword')" prop="smpassword"
|
|
|
+ v-if="!record">
|
|
|
+ <span>123456</span>
|
|
|
</el-form-item>
|
|
|
</fieldset>
|
|
|
<fieldset class="g-fieldset el-form--horizontal">
|
|
|
<legend class="g-fieldset__legend">{{ t('common.annex') }}</legend>
|
|
|
<el-form-item :label="t('common.annex1')" 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('common.annex2')" prop="attachment2">
|
|
|
<app-upload v-model="uploadFiles.attachment2" :file-types="['image', 'pdf']"
|
|
|
- :type-message="t('common.tips21')" />
|
|
|
+ :type-message="t('common.tips21')" />
|
|
|
</el-form-item>
|
|
|
</fieldset>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<el-button @click="onCancel(false)">{{ t('operation.cancel') }}</el-button>
|
|
|
<el-button type="primary" @click="onSubmit(2)">{{ t('operation.save') }}</el-button>
|
|
|
- <el-button type="primary" @click="onSubmit(4)" v-if="record?.accountstatus === 4">{{ t('operation.submitaduit') }}</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit(4)" v-if="record?.accountstatus === 4">{{
|
|
|
+ t('operation.submitaduit') }}</el-button>
|
|
|
</template>
|
|
|
</app-drawer>
|
|
|
</template>
|
|
|
@@ -132,14 +165,16 @@
|
|
|
import { ref, reactive, PropType, onMounted, computed } from 'vue'
|
|
|
import { ElMessage, FormInstance, FormRules, UploadUserFile } from 'element-plus'
|
|
|
import { decryptAES } from '@/services/crypto'
|
|
|
+import { useEnum } from '@/hooks/enum'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { organSonViewson, organSonAdd, organSonSave, organSonEdit } from '@/services/api/member'
|
|
|
-import { getUserInfoTypeList, getGenderList, UserInfoType, Gender } from '@/constants/member'
|
|
|
+import { getUserInfoTypeList, getUserInfoTypeName, getGenderList, UserInfoType, Gender } from '@/constants/member'
|
|
|
import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
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 AppSelectInstitution from '@pc/components/modules/select-institution/index.vue'
|
|
|
import service from '@/services'
|
|
|
import { i18n } from '@/stores'
|
|
|
|
|
|
@@ -152,6 +187,9 @@ const props = defineProps({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+// 机构类型
|
|
|
+const usertype2Enum = useEnum('usertype2')
|
|
|
+
|
|
|
const { global: { t } } = i18n
|
|
|
const formRef = ref<FormInstance>()
|
|
|
const show = ref(true)
|
|
|
@@ -247,6 +285,7 @@ const { loading, run } = useRequest(organSonViewson, {
|
|
|
|
|
|
// 表单验证规则
|
|
|
const formRules: FormRules = {
|
|
|
+ parentuserid: [{ required: true }],
|
|
|
userid: [{ required: true }],
|
|
|
accountname: [{ required: true }],
|
|
|
cardtypeid: [{ required: true }],
|