|
|
@@ -0,0 +1,186 @@
|
|
|
+<!-- 交易商管理-交易商管理-交易商批量转移-新增 -->
|
|
|
+<template>
|
|
|
+ <app-drawer :title="t('account.tradeacct.sign.edit.title')" width="960" v-model:show="show" :refresh="refresh"
|
|
|
+ :loading="loading">
|
|
|
+ <el-form ref="formRef" class="el-form--horizontal" label-width="140px" :model="formData" :rules="formRules"
|
|
|
+ :show-message="false">
|
|
|
+ <fieldset class="g-fieldset el-form--horizontal">
|
|
|
+ <legend class="g-fieldset__legend">转出</legend>
|
|
|
+ <el-form-item label="转移类型" prop="diversiontype">
|
|
|
+ <el-radio-group v-model="formData.diversiontype" @change="switchOutType">
|
|
|
+ <template v-for="item in investortransfertypeEnum.getEnumOptions()" :key="item.value">
|
|
|
+ <el-radio :label="item.label" :value="item.value" />
|
|
|
+ </template>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <template v-if="formData.diversiontype === 1">
|
|
|
+ <el-form-item label="转出交易商" prop="outinvestor">
|
|
|
+ <app-select-member v-model="formData.outinvestor" :params="{ usertype: '5' }"
|
|
|
+ @change="selectOutUser" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="所属会员">
|
|
|
+ {{ handleNoneValue(accountInfo?.memberUserName) }}
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="所属机构">
|
|
|
+ {{ handleNoneValue(accountInfo?.parentUserName) }}
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="证件类型">
|
|
|
+ {{ outUserInfo ? certificatetypeEnum.getEnumTypeName(outUserInfo.cardtypeid) :
|
|
|
+ handleNoneValue() }}
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="证件号码">
|
|
|
+ {{ outUserInfo ? decryptAES(outUserInfo.cardnum) : handleNoneValue() }}
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-form-item label="转出所属会员" prop="outmemberuserid">
|
|
|
+ <app-select-member v-model="formData.outmemberuserid" :params="{ usertype: '2', roles: '7' }" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="转出所属机构" prop="outparentuserid">
|
|
|
+ <app-select-member v-model="formData.outparentuserid"
|
|
|
+ :params="{ usertype: '3', parentuserid: formData.outmemberuserid }"
|
|
|
+ :disabled="!formData.outmemberuserid" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </fieldset>
|
|
|
+ <fieldset class="g-fieldset el-form--horizontal">
|
|
|
+ <legend class="g-fieldset__legend">转入</legend>
|
|
|
+ <el-form-item label="转入所属会员" prop="inmemberuserid">
|
|
|
+ <app-select-member v-model="formData.inmemberuserid" :params="{ usertype: '2', roles: '7' }"
|
|
|
+ @change="selectInUser" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="转入所属机构" prop="inuserid">
|
|
|
+ <app-select-member v-model="formData.inuserid"
|
|
|
+ :params="{ usertype: '3', parentuserid: formData.inmemberuserid }"
|
|
|
+ :disabled="!formData.inmemberuserid" @change="selectInUser" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="机构证件类型">
|
|
|
+ {{ inUserInfo ? certificatetypeEnum.getEnumTypeName(inUserInfo.cardtypeid) : handleNoneValue() }}
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="机构证件号码">
|
|
|
+ {{ inUserInfo ? decryptAES(inUserInfo.cardnum) : handleNoneValue() }}
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="el-form-item--row">
|
|
|
+ <span class="red">*交易商转移将会在系统结算时处理</span>
|
|
|
+ </el-form-item>
|
|
|
+ </fieldset>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="onCancel(false)">{{ t('operation.close') }}</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit">保存</el-button>
|
|
|
+ </template>
|
|
|
+ </app-drawer>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+import { shallowRef, reactive, toRaw } from 'vue'
|
|
|
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
+import { decryptAES } from '@/services/crypto'
|
|
|
+import { handleNoneValue } from '@/filters'
|
|
|
+import { useEnum } from '@/hooks/enum'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import { queryUserinfoByUserId } from '@/services/api/common'
|
|
|
+import { investorTransferAdd, getUserAccountDetail } from '@/services/api/investor'
|
|
|
+import { i18n } from '@/stores'
|
|
|
+import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
+import AppSelectMember from '@pc/components/modules/select-member/index.vue'
|
|
|
+
|
|
|
+// 证件类型
|
|
|
+const certificatetypeEnum = useEnum('certificatetype')
|
|
|
+// 转移类型
|
|
|
+const investortransfertypeEnum = useEnum('investortransfertype')
|
|
|
+
|
|
|
+const { global: { t } } = i18n
|
|
|
+const formRef = shallowRef<FormInstance>()
|
|
|
+const show = shallowRef(true)
|
|
|
+const refresh = shallowRef(false)
|
|
|
+const loading = shallowRef(false)
|
|
|
+
|
|
|
+const accountInfo = shallowRef<Model.UserAccountDetailRsp>()
|
|
|
+const outUserInfo = shallowRef<Model.UserinfoByUserIdRsp>()
|
|
|
+const inUserInfo = shallowRef<Model.UserinfoByUserIdRsp>()
|
|
|
+
|
|
|
+const formData = reactive<Partial<Model.InvestorTransferAddReq>>({
|
|
|
+ diversiontype: 1,
|
|
|
+})
|
|
|
+
|
|
|
+const { runAsync: getUserInfoByUserId } = useRequest(queryUserinfoByUserId, {
|
|
|
+ manual: true
|
|
|
+})
|
|
|
+
|
|
|
+const { runAsync: getAccountInfoByUserId } = useRequest(getUserAccountDetail, {
|
|
|
+ manual: true
|
|
|
+})
|
|
|
+
|
|
|
+// 表单验证规则
|
|
|
+const formRules: FormRules = {
|
|
|
+ outinvestor: [{ required: true }],
|
|
|
+ inmemberuserid: [{ required: true }],
|
|
|
+ diversiontype: [{ required: true }],
|
|
|
+ outmemberuserid: [{ required: true }]
|
|
|
+}
|
|
|
+
|
|
|
+// 切换转移类型
|
|
|
+const switchOutType = () => {
|
|
|
+ formData.outinvestor = undefined
|
|
|
+ formData.outmemberuserid = undefined
|
|
|
+ formData.outparentuserid = undefined
|
|
|
+ accountInfo.value = undefined
|
|
|
+ outUserInfo.value = undefined
|
|
|
+}
|
|
|
+
|
|
|
+// 选择转出交易商
|
|
|
+const selectOutUser = (item?: Model.OrganSelectRsp) => {
|
|
|
+ if (item) {
|
|
|
+ const userid = item.userid
|
|
|
+ getAccountInfoByUserId({ userid }).then((res) => {
|
|
|
+ accountInfo.value = res.data
|
|
|
+ })
|
|
|
+ getUserInfoByUserId({ userid }).then((res) => {
|
|
|
+ outUserInfo.value = res.data
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ accountInfo.value = undefined
|
|
|
+ outUserInfo.value = undefined
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 选择转入机构
|
|
|
+const selectInUser = (item?: Model.OrganSelectRsp) => {
|
|
|
+ if (item || formData.inmemberuserid) {
|
|
|
+ const userid = item?.userid || formData.inmemberuserid
|
|
|
+ if (item?.usertype === '2') {
|
|
|
+ formData.inuserid = undefined
|
|
|
+ }
|
|
|
+ getUserInfoByUserId({ userid }).then((res) => {
|
|
|
+ inUserInfo.value = res.data
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ inUserInfo.value = undefined
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const onCancel = (isRefresh = false) => {
|
|
|
+ show.value = false
|
|
|
+ refresh.value = isRefresh
|
|
|
+}
|
|
|
+
|
|
|
+const onSubmit = () => {
|
|
|
+ formRef.value?.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ const rawData = toRaw(formData)
|
|
|
+ loading.value = true
|
|
|
+ investorTransferAdd({
|
|
|
+ data: rawData
|
|
|
+ }).then(() => {
|
|
|
+ ElMessage.success(t('common.tips3'))
|
|
|
+ onCancel(true)
|
|
|
+ }).catch((err) => {
|
|
|
+ ElMessage.error(t('common.tips4') + err)
|
|
|
+ }).finally(() => {
|
|
|
+ loading.value = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+</script>
|