Handy_Cao hai 7 meses
pai
achega
1bbd127ab0

+ 2 - 2
src/constants/member.ts

@@ -60,8 +60,8 @@ export function getGenderName(value?: number) {
  * 客户类别
  */
 export enum CustomerType {
-    Normal = 0, // 普通做市商
-    Main = 1, // 主做市商
+    Normal = 1, // 普通做市商
+    Main = 2, // 主做市商
 }
 
 /**

+ 47 - 4
src/packages/pc/views/member/institution/marketer/components/edit/index.vue

@@ -13,12 +13,19 @@
                     <span>{{ organSelect?.accountname }}</span>
                 </el-form-item>
                 <el-form-item label="客户类别" prop="customertype">
-                    <el-select v-model="formData.customertype" :placeholder="t('common.pleasechoice')">
+                    <el-select v-model="formData.customertype" :placeholder="t('common.pleasechoice')" @change="run">
                         <el-option v-for="item in getCustomerTypeList()" :key="item.value" :label="item.label"
                         :value="item.value" />
                     </el-select>
                 </el-form-item>
             </fieldset>
+            <fieldset class="g-fieldset el-form--horizontal">
+                <legend class="g-fieldset__legend">默认做市商资金账户</legend>
+            </fieldset>
+            <fieldset class="g-fieldset el-form--horizontal">
+                <legend class="g-fieldset__legend">风险率信息</legend>
+                <app-table-details title="风险率信息" :data="marker" :label-width="160" :cell-props="detailProps3" :column="2" v-if="marker" />
+            </fieldset>
         </el-form>
         <template #footer>
             <el-button @click="onCancel(false)">{{ t('operation.cancel') }}</el-button>
@@ -29,15 +36,22 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, PropType, ref, defineAsyncComponent, onMounted } from 'vue'
+import { shallowRef, PropType, ref, defineAsyncComponent, onMounted, computed } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
 import { useComponent } from '@/hooks/component'
 import { i18n } from '@/stores'
 import { roleadd, initAdd } from '@/services/api/member'
+import { useEnum } from '@/hooks/enum'
 import { getCustomerTypeList } from '@/constants/member'
 import { useRequest } from '@/hooks/request'
+import { getRiskRatioTypeForMarketer } from '@/services/api/investor'
+import { CellProp } from '@pc/components/base/table-details/types'
 import AppSelectMember from '@pc/components/modules/select-member/index.vue'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
+import AppTableDetails from '@pc/components/base/table-details/index.vue'
+
+const flagEnum = useEnum('flag') // 确认状态
+const marketerTypeEnum = useEnum('marketerType') // 风险率类型
 
 const props = defineProps({
     record: {
@@ -56,6 +70,10 @@ const show = shallowRef(true)
 const refresh = shallowRef(false)
 const organSelect = ref<Model.OrganSelectRsp>()
 
+const formData = ref<Partial<Member.RoleAddReq>>({
+    roleid: 8
+})
+
 const { data, loading } = useRequest(initAdd, {
     params: {
         role: 'marketer'
@@ -65,8 +83,14 @@ const { data, loading } = useRequest(initAdd, {
     }
 })
 
-const formData = ref<Partial<Member.RoleAddReq>>({
-    roleid: 8
+const { data: marker, run } = useRequest(getRiskRatioTypeForMarketer, {
+    params: {
+        riskcontrolmode: 2,
+        customertype: formData.value.customertype ?? 1
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
 })
 
 // 表单验证规则
@@ -93,6 +117,25 @@ const onSubmit = () => {
     })
 }
 
+const detailProps3 = computed<CellProp[]>(() => {
+    const { notesaferatio } = marker.value ?? {}
+    return [
+        { prop: 'riskcontrolmode', label: 'member.institution.marketer.details.riskcontrolmode', formatValue: (val) => val === 1 ? t('member.institution.marketer.details.riskcontrolmode1') : t('member.institution.marketer.details.riskcontrolmode2') },
+        { prop: 'customertype', label: 'member.institution.marketer.details.customertype1', formatValue: (val) => marketerTypeEnum.getEnumTypeName(val) },
+        { prop: 'riskratiocalcmode', label: 'member.institution.marketer.details.riskratiocalcmode', formatValue: (val) => val === 1 ? t('member.institution.marketer.details.riskratiocalcmode1') : t('member.institution.marketer.details.riskratiocalcmode2') },
+        { prop: 'notemarginriskratio', label: 'member.institution.marketer.details.notemarginriskratio', formatValue: (val) => val + '%', show: !notesaferatio },
+        { prop: 'addmarginriskratio', label: 'member.institution.marketer.details.addmarginriskratio', formatValue: (val) => val + '%', show: !notesaferatio },
+        { prop: 'cutriskratio', label: 'member.institution.marketer.details.cutriskratio', formatValue: (val) => val + '%', show: !notesaferatio },
+        { prop: 'cutbackriskratio', label: 'member.institution.marketer.details.cutbackriskratio', formatValue: (val) => val + '%', show: !notesaferatio },
+        { prop: 'notesaferatio', label: 'member.institution.marketer.details.notesaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
+        { prop: 'addsaferatio', label: 'member.institution.marketer.details.addsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
+        { prop: 'recoversaferatio', label: 'member.institution.marketer.details.recoversaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
+        { prop: 'cutsaferatio', label: 'member.institution.marketer.details.cutsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
+        { prop: 'isdefault', label: 'member.institution.marketer.details.isdefault', formatValue: (val) => flagEnum.getEnumTypeName(val) },
+        { prop: 'markets', label: 'member.institution.marketer.details.markets' },
+    ]
+})
+
 const onMemberChange = (item?: Model.OrganSelectRsp) => {
     organSelect.value = item
 }