|
|
@@ -4,19 +4,21 @@
|
|
|
:loading="loading">
|
|
|
<el-form ref="formRef" class="el-form--horizontal" label-width="140px" :model="formData" :rules="formRules"
|
|
|
:show-message="false">
|
|
|
- <!-- <el-form-item :label="t('investor.user.open.edit.memberareaid')" prop="memberareaid">
|
|
|
- <el-input v-model="formData.memberareaid" maxlength="50" :placeholder="t('common.pleaseenter')" />
|
|
|
- </el-form-item> -->
|
|
|
+ <el-form-item :label="t('investor.user.open.edit.memberareaid')" prop="memberareaid"
|
|
|
+ v-if="userStore.userInfo.releType === 1">
|
|
|
+ <app-select-member ref="memberareaidRef" v-model="formData.memberareaid" :params="{ usertype: '2', roles: '7' }"
|
|
|
+ :placeholder="t('investor.user.open.edit.tips1')" @change="selectMemberareaid" />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item :label="t('investor.user.open.edit.areaid')" prop="areaid">
|
|
|
- <app-select-member v-model="formData.areaid" :params="{ usertype: '3' }"
|
|
|
- :placeholder="t('investor.user.open.edit.tips1')" />
|
|
|
+ <app-select-member ref="areaidRef" v-model="formData.areaid" :params="{ usertype: '3', parentuserid }"
|
|
|
+ :placeholder="t('investor.user.open.edit.tips1')" @change="selectAreaid" />
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('investor.user.open.edit.brokerid')" prop="brokerid">
|
|
|
- <app-select-member v-model="formData.brokerid" :params="{ usertype: '4' }"
|
|
|
- :placeholder="t('investor.user.open.edit.tips1')" />
|
|
|
+ <app-select-member ref="brokeridRef" v-model="formData.brokerid"
|
|
|
+ :params="{ usertype: '4', parentuseridfirst }" :placeholder="t('investor.user.open.edit.tips1')" />
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('investor.user.open.edit.referral')" prop="referral">
|
|
|
- <app-select-investor v-model="formData.referral" :placeholder="t('investor.user.open.edit.tips1')" />
|
|
|
+ <app-select-investor ref="referralRef" v-model="formData.referral" :placeholder="t('investor.user.open.edit.tips1')" />
|
|
|
</el-form-item>
|
|
|
<el-form-item class="el-form-item--row" :label="t('investor.user.open.edit.userinfotype')"
|
|
|
prop="userinfotype">
|
|
|
@@ -142,9 +144,11 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, reactive, PropType, onMounted, computed } from 'vue'
|
|
|
import { ElMessage, FormInstance, FormRules, UploadUserFile } from 'element-plus'
|
|
|
+import { decryptAES } from '@/services/crypto'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { dealSunOrgan, queryInvestorDetail } from '@/services/api/investor'
|
|
|
import { getUserInfoTypeList, getGenderList, UserInfoType, Gender } from '@/constants/member'
|
|
|
+import { i18n, useUserStore } from '@/stores'
|
|
|
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'
|
|
|
@@ -152,8 +156,6 @@ import AppRegion from '@pc/components/modules/region/index.vue'
|
|
|
import AppSelectMember from '@pc/components/modules/select-member/index.vue'
|
|
|
import AppSelectInvestor from '@pc/components/modules/select-investor/index.vue'
|
|
|
import service from '@/services'
|
|
|
-import { decryptAES } from '@/services/crypto'
|
|
|
-import { i18n } from '@/stores'
|
|
|
|
|
|
const props = defineProps({
|
|
|
record: {
|
|
|
@@ -162,10 +164,21 @@ const props = defineProps({
|
|
|
})
|
|
|
|
|
|
const { global: { t } } = i18n
|
|
|
+const userStore = useUserStore()
|
|
|
const formRef = ref<FormInstance>()
|
|
|
const show = ref(true)
|
|
|
const refresh = ref(false)
|
|
|
|
|
|
+const memberareaidRef = ref() // 所属会员组件实例
|
|
|
+const areaidRef = ref() // 所属机构组件实例
|
|
|
+const brokeridRef = ref() // 经纪人组件实例
|
|
|
+const referralRef = ref() // 推荐人组件实例
|
|
|
+
|
|
|
+const formData = ref<Partial<Model.MemberDetail>>({
|
|
|
+ userinfotype: UserInfoType.Personal,
|
|
|
+ sex: Gender.Male
|
|
|
+})
|
|
|
+
|
|
|
const uploadFiles = reactive<{
|
|
|
cardfrontphotourl: UploadUserFile[];
|
|
|
cardbackphotourl: UploadUserFile[];
|
|
|
@@ -180,15 +193,13 @@ const uploadFiles = reactive<{
|
|
|
otherurl: []
|
|
|
})
|
|
|
|
|
|
+const parentuserid = computed(() => formData.value.memberareaid || userStore.userInfo.areauserid)
|
|
|
+
|
|
|
+const parentuseridfirst = computed(() => formData.value.areaid || userStore.userInfo.areauserid)
|
|
|
|
|
|
// 是否个人
|
|
|
const isPerson = computed(() => formData.value.userinfotype === UserInfoType.Personal)
|
|
|
|
|
|
-const formData = ref<Partial<Model.MemberDetail>>({
|
|
|
- userinfotype: UserInfoType.Personal,
|
|
|
- sex: Gender.Male
|
|
|
-})
|
|
|
-
|
|
|
const getUploadFiles = (value?: string) => {
|
|
|
const paths = value ? value.split(',') : []
|
|
|
return paths.map((url) => {
|
|
|
@@ -219,6 +230,11 @@ const { loading, run } = useRequest(queryInvestorDetail, {
|
|
|
uploadFiles.legalcardfrontphotourl = getUploadFiles(res.data.legalcardfrontphotourl)
|
|
|
uploadFiles.legalcardbackphotourl = getUploadFiles(res.data.legalcardbackphotourl)
|
|
|
uploadFiles.otherurl = getUploadFiles(res.data.otherurl)
|
|
|
+
|
|
|
+ memberareaidRef.value.onReset(res.data.memberareaid)
|
|
|
+ areaidRef.value.onReset(res.data.areaid)
|
|
|
+ brokeridRef.value.onReset(res.data.brokerid)
|
|
|
+ referralRef.value.onReset(res.data.referral)
|
|
|
}),
|
|
|
onError: (err) => {
|
|
|
ElMessage.error(err)
|
|
|
@@ -287,6 +303,17 @@ const formRules: FormRules = {
|
|
|
}],
|
|
|
}
|
|
|
|
|
|
+// 选择所属会员
|
|
|
+const selectMemberareaid = () => {
|
|
|
+ areaidRef.value.onReset()
|
|
|
+ brokeridRef.value.onReset()
|
|
|
+}
|
|
|
+
|
|
|
+// 选择所属机构
|
|
|
+const selectAreaid = () => {
|
|
|
+ brokeridRef.value.onReset()
|
|
|
+}
|
|
|
+
|
|
|
const onCancel = (isRefresh = false) => {
|
|
|
show.value = false
|
|
|
refresh.value = isRefresh
|