Handy_Cao hai 7 meses
pai
achega
1971a33683

+ 4 - 0
public/locales/en-US.json

@@ -1164,6 +1164,10 @@
                     "title": "Details",
                     "subtitle": "Basic information",
                     "subtitle2": "Commodity query permission",
+                    "subtitle3": "默认做市商资金账户",
+                    "subtitle4": "风险率信息",
+                    "enumdicname": "*币种",
+                    "reckonaccountid1": "*资金账户",
                     "accountname": "Name",
                     "userName": "Administrator",
                     "reckonaccountid": "Capital account",

+ 4 - 0
public/locales/th-TH.json

@@ -1164,6 +1164,10 @@
                     "title": "รายละเอียด",
                     "subtitle": "ข้อมูลพื้นฐาน",
                     "subtitle2": "สิทธิการค้นหาสินค้า",
+                    "subtitle3": "默认做市商资金账户",
+                    "subtitle4": "风险率信息",
+                    "enumdicname": "*币种",
+                    "reckonaccountid1": "*资金账户",
                     "accountname": "ชื่อ",
                     "userName": "ผู้ดูแลระบบ",
                     "reckonaccountid": "บัญชีเงิน",

+ 4 - 0
public/locales/vi-VN.json

@@ -1164,6 +1164,10 @@
                     "title": "Chi tiết",
                     "subtitle": "Thông tin cơ bản",
                     "subtitle2": "Quyền truy vấn sản phẩm",
+                    "subtitle3": "默认做市商资金账户",
+                    "subtitle4": "风险率信息",
+                    "enumdicname": "*币种",
+                    "reckonaccountid1": "*资金账户",
                     "accountname": "Tên",
                     "userName": "Quản trị viên",
                     "reckonaccountid": "Tài khoản tiền",

+ 4 - 0
public/locales/zh-CN.json

@@ -1164,6 +1164,10 @@
                     "title": "详情",
                     "subtitle": "基本信息",
                     "subtitle2": "商品查询权限",
+                    "subtitle3": "默认做市商资金账户",
+                    "subtitle4": "风险率信息",
+                    "enumdicname": "*币种",
+                    "reckonaccountid1": "*资金账户",
                     "accountname": "名称",
                     "userName": "管理员",
                     "reckonaccountid": "资金账户",

+ 4 - 0
public/locales/zh-TW.json

@@ -1164,6 +1164,10 @@
                     "title": "詳情",
                     "subtitle": "基本資訊",
                     "subtitle2": "商品查詢權限",
+                    "subtitle3": "默认做市商资金账户",
+                    "subtitle4": "风险率信息",
+                    "enumdicname": "*币种",
+                    "reckonaccountid1": "*资金账户",
                     "accountname": "名稱",
                     "userName": "管理員",
                     "reckonaccountid": "資金帳戶",

+ 39 - 5
src/packages/pc/views/member/institution/broker/components/edit/index.vue

@@ -10,10 +10,10 @@
                 </el-form-item>
                 <el-form-item :label="t('member.institution.broker.edit.title1')" prop="userid" v-if="!record" >
                     <el-button @click="openComponent('Roles')">{{ t('member.institution.broker.edit.look') }}</el-button>
-                    <span>{{ manger }}</span>
+                    <span style="margin-left: 10px;">{{ manger }}</span>
                 </el-form-item>
                 <el-form-item :label="t('member.institution.broker.edit.parentuserid')" prop="parentuserid">
-                    <app-select-member2 v-model="formData.parentuserid"  :placeholder="t('investor.custom.riskcfg.edit.tips1')" :params="{ roles: '3' }"/>
+                    <app-select-member2 v-model="formData.parentuserid"  :placeholder="t('investor.custom.riskcfg.edit.tips1')" :params="{ exists: '3' }"/>
                 </el-form-item>
             </fieldset>
             <fieldset class="g-fieldset el-form--horizontal">
@@ -65,12 +65,12 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, PropType, ref, defineAsyncComponent, onMounted } from 'vue'
-import { ElMessage, FormInstance, FormRules } from 'element-plus'
+import { shallowRef, PropType, ref, defineAsyncComponent, onMounted, nextTick } from 'vue'
+import { ElMessage, FormInstance, FormRules, TableInstance } from 'element-plus'
 import { useComponent } from '@/hooks/component'
 import { i18n } from '@/stores'
 import { handleNoneValue } from '@/filters'
-import { roleadd, initAdd, getOragnDefaultManager } from '@/services/api/member'
+import { roleadd, initAdd, getOragnDefaultManager, queryRoleDetail } from '@/services/api/member'
 import { useRequest } from '@/hooks/request'
 import AppSelectMember from '@pc/components/modules/select-member/index.vue'
 import AppSelectMember2 from '@pc/components/modules/select-member2/index.vue'
@@ -99,6 +99,7 @@ const refresh = shallowRef(false)
 const organSelect = ref<Model.OrganSelectRsp>()
 const multipleSelection = ref<Model.UpdateTaAccountReq['dtype']>([]) // 已选中的市场数据
 const marketbstype = [{value: 0, label: "无"}, {value:1, label: "可挂可摘"}, {value:2, label: "可挂"}, {value:3, label: "可摘"}]
+const tableRef = ref<TableInstance>()
 
 const { loading } = useRequest(initAdd, {
     params: {
@@ -123,6 +124,38 @@ const { loading } = useRequest(initAdd, {
     }
 })
 
+const { run: runRoleDetail } = useRequest(queryRoleDetail, {
+    manual: true,
+    params: {
+        rolename: 'broker',
+        userid: props.record?.userid
+    },
+    onSuccess: (res) => {
+        formData.value.dtype = formData.value.dtype?.map(e => ({
+            checked: res.data.markets.some(a => a.marketid === e.marketId) ? 1 : 0,
+            dtype: 0,
+            fdType: 0,
+            fspotRightType: 0,
+            marketId: e.marketId,
+            marketName: e.marketName,
+            spotRightType: 0, 
+            tradeMode: e.tradeMode,
+            tradeProperty: e.tradeProperty,
+        })) ?? []
+        // 初始化已选中的市场
+        nextTick(() => {
+            formData.value.dtype?.forEach((e) => {
+                if (e.checked) {
+                    tableRef.value?.toggleRowSelection(e, true)
+                }
+            })
+        })
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
+
 const { data: manger, run: runDefaultManager } = useRequest(getOragnDefaultManager, {
     manual: true,
     params: {
@@ -182,6 +215,7 @@ onMounted(() => {
     const { userid, } = props.record ?? {}
     if (userid) {
         formData.value.userid = userid
+        runRoleDetail()
     }
 })
 </script>

+ 40 - 5
src/packages/pc/views/member/institution/industry/components/edit/index.vue

@@ -10,7 +10,7 @@
                 </el-form-item>
                 <el-form-item :label="t('member.institution.industry.edit.title1')" prop="userid" v-if="!record" >
                     <el-button @click="openComponent('Roles')">{{ t('member.institution.industry.edit.look') }}</el-button>
-                    <span>{{ manger }}</span>
+                    <span style="margin-left: 10px;">{{ manger }}</span>
                 </el-form-item>
             </fieldset>
             <fieldset class="g-fieldset el-form--horizontal">
@@ -62,11 +62,11 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, PropType, onMounted, ref, defineAsyncComponent } from 'vue'
-import { ElMessage, FormInstance, FormRules } from 'element-plus'
+import { shallowRef, PropType, onMounted, ref, defineAsyncComponent, nextTick } from 'vue'
+import { ElMessage, FormInstance, FormRules, TableInstance } from 'element-plus'
 import { i18n } from '@/stores'
 import { useComponent } from '@/hooks/component'
-import { roleadd, initAdd, getOragnDefaultManager } from '@/services/api/member'
+import { roleadd, initAdd, getOragnDefaultManager, queryRoleDetail } from '@/services/api/member'
 import { useRequest } from '@/hooks/request'
 import { handleNoneValue } from '@/filters'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
@@ -79,6 +79,7 @@ const refresh = shallowRef(false)
 const organSelect = ref<Model.OrganSelectRsp>()
 const multipleSelection = ref<Model.UpdateTaAccountReq['dtype']>([]) // 已选中的市场数据
 const marketbstype = [{value: 0, label: "无"}, {value:1, label: "可挂可摘"}, {value:2, label: "可挂"}, {value:3, label: "可摘"}]
+const tableRef = ref<TableInstance>()
 
 const props = defineProps({
     record: {
@@ -103,7 +104,7 @@ const { loading } = useRequest(initAdd, {
     onSuccess: (res) => {
         // 赋值数据
         formData.value.dtype = res.data.markets.map(e => ({
-            checked: 0,
+            checked: 1,
             dtype: 0,
             fdType: 0,
             fspotRightType: 0,
@@ -119,6 +120,38 @@ const { loading } = useRequest(initAdd, {
     }
 })
 
+const { run: runRoleDetail } = useRequest(queryRoleDetail, {
+    manual: true,
+    params: {
+        rolename: 'industry',
+        userid: props.record?.userid
+    },
+    onSuccess: (res) => {
+        formData.value.dtype = formData.value.dtype?.map(e => ({
+            checked: res.data.markets.some(a => a.marketid === e.marketId) ? 1 : 0,
+            dtype: 0,
+            fdType: 0,
+            fspotRightType: 0,
+            marketId: e.marketId,
+            marketName: e.marketName,
+            spotRightType: 0, 
+            tradeMode: e.tradeMode,
+            tradeProperty: e.tradeProperty,
+        })) ?? []
+        // 初始化已选中的市场
+        nextTick(() => {
+            formData.value.dtype?.forEach((e) => {
+                if (e.checked) {
+                    tableRef.value?.toggleRowSelection(e, true)
+                }
+            })
+        })
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
+
 const { data: manger, run: runDefaultManager } = useRequest(getOragnDefaultManager, {
     manual: true,
     params: {
@@ -135,6 +168,7 @@ const formRules: FormRules = {
 }
 
 const handleSelectionChange = (selection: Model.UpdateTaAccountReq['dtype']) => {
+    console.log(selection)
     multipleSelection.value = selection
 }
 
@@ -178,6 +212,7 @@ onMounted(() => {
     const { userid, } = props.record ?? {}
     if (userid) {
         formData.value.userid = userid
+        runRoleDetail()
     }
 })
 

+ 8 - 5
src/packages/pc/views/member/institution/marketer/components/details/index.vue

@@ -2,8 +2,11 @@
 <template>
     <app-drawer title="详情" width="900" v-model:show="show" :loading="loading" :refresh="refresh">
         <app-table-details :title="t('member.institution.marketer.details.subtitle')" :data="data?.organ" :label-width="160" :cell-props="detailProps1" :column="2" />
-        <app-table-details title="默认做市商资金账户" :data="data?.roleNight[0]" :label-width="160" :cell-props="detailProps2" :column="1" />
-        <app-table-details title="风险率信息" :data="marker" :label-width="160" :cell-props="detailProps3" :column="2" />
+        <app-table-details :title="t('member.institution.marketer.details.subtitle3')" :data="data?.roleNight[0]" :label-width="160" :cell-props="detailProps2" :column="1" />
+        <app-table-details v-if="marker" :title="t('member.institution.marketer.details.subtitle4')" :data="marker" :label-width="160" :cell-props="detailProps3" :column="2" />
+        <fieldset class="g-fieldset el-form--horizontal">
+            <legend class="g-fieldset__legend">{{ t('member.institution.marketer.details.subtitle4') }}</legend>
+        </fieldset>
         <template #footer>
             <el-button @click="onCancel(false)">{{ t('operation.close') }}</el-button>
         </template>
@@ -65,12 +68,12 @@ const detailProps1: CellProp[] = [
     { prop: 'userName', label: 'member.institution.marketer.details.userName', formatValue: () => {
         return data.value?.users.username
     } },
-    { prop: 'customertype', label: '客户类别:', formatValue: () => customerTypeEnum.getEnumTypeName(data.value?.customertype.customertype) }
+    { prop: 'customertype', label: 'member.institution.marketer.details.customertype', formatValue: () => customerTypeEnum.getEnumTypeName(data.value?.customertype.customertype) }
 ]
 
 const detailProps2: CellProp[] = [
-    { prop: 'enumdicname', label: '*币种'},
-    { prop: 'reckonaccountid', label: '*资金账户' }
+    { prop: 'enumdicname', label: 'member.institution.marketer.details.enumdicname'},
+    { prop: 'reckonaccountid', label: 'member.institution.marketer.details.reckonaccountid1' }
 ]
 
 const detailProps3 = computed<CellProp[]>(() => {

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

@@ -10,10 +10,10 @@
                 </el-form-item>
                 <el-form-item :label="t('member.institution.marketer.edit.userid1')" prop="userid" v-if="!record" >
                     <el-button @click="openComponent('Roles')">{{ t('member.institution.marketer.edit.look') }}</el-button>
-                    <span>{{ manger }}</span>
+                    <span style="margin-left: 10px;">{{ manger }}</span>
                 </el-form-item>
                 <el-form-item :label="t('member.institution.marketer.edit.customertype')" prop="marketerType">
-                    <app-enum code="marketerType" v-model="formData.customertype" />
+                    <app-enum code="marketerType" v-model="formData.customertype" @change="onCustomerType"/>
                 </el-form-item>
             </fieldset>
             <fieldset class="g-fieldset el-form--horizontal">
@@ -106,6 +106,11 @@ const { run: runRoleDetail } = useRequest(queryRoleDetail, {
     },
     onSuccess: (res) => {
         formData.value.customertype = res.data.customertype.customertype
+        // 查询数据
+        run({
+            riskcontrolmode: 2,
+            customertype: formData.value.customertype ?? 1
+        })
         // 获取资金账号信息
         runAccountIdForMarket({
             userid: props.record?.userid
@@ -113,7 +118,6 @@ const { run: runRoleDetail } = useRequest(queryRoleDetail, {
     }
 })
 
-
 const { data: manger, run: runDefaultManager } = useRequest(getOragnDefaultManager, {
     manual: true,
     params: {
@@ -153,7 +157,8 @@ const { data: marker, run } = useRequest(getRiskRatioTypeForMarketer, {
 // 表单验证规则
 const formRules: FormRules = {
     userid: [{ required: true }],
-    customertype: [{ required: true }]
+    customertype: [{ required: true }],
+    accountid: [{ required: true }]
 }
 
 const onSubmit = () => {
@@ -202,6 +207,14 @@ const onTaAccount = (accountid: number) => {
     currency.value = currencyEnum.getEnumTypeName(talist.value.find(e => e.accountid === accountid)?.currencyid) ?? ''
 }
 
+const onCustomerType = () => {
+    // 查询数据
+    run({
+        riskcontrolmode: 2,
+        customertype: formData.value.customertype ?? 1
+    })
+}
+
 const onMemberChange = (item?: Model.OrganSelectRsp) => {
     organSelect.value = item
     
@@ -227,6 +240,9 @@ onMounted(() => {
     if (userid) {
         formData.value.userid = userid
         runRoleDetail()
+        run({
+
+        })
     }
 })
 </script>

+ 1 - 1
src/packages/pc/views/member/institution/marketing/components/edit/index.vue

@@ -10,7 +10,7 @@
                 </el-form-item>
                 <el-form-item :label="t('member.institution.marketing.edit.userid1')" prop="userid" v-if="!record" >
                     <el-button @click="openComponent('Roles')">{{ t('member.institution.marketing.edit.look') }}</el-button>
-                    <span>{{ manger }}</span>
+                    <span style="margin-left: 10px;">{{ manger }}</span>
                 </el-form-item>
             </fieldset>
         </el-form>

+ 1 - 1
src/packages/pc/views/member/institution/operation/components/edit/index.vue

@@ -10,7 +10,7 @@
                 </el-form-item>
                 <el-form-item :label="t('member.institution.operation.edit.userid1')" prop="userid" v-if="!record" >
                     <el-button @click="openComponent('Roles')">{{ t('member.institution.operation.edit.look') }}</el-button>
-                    <span>{{ manger }}</span>
+                    <span style="margin-left: 10px;">{{ manger }}</span>
                 </el-form-item>
             </fieldset>
             <fieldset class="g-fieldset el-form--vertical">

+ 41 - 5
src/packages/pc/views/member/institution/self/components/edit/index.vue

@@ -10,7 +10,7 @@
                 </el-form-item>
                 <el-form-item :label="t('member.institution.self.edit.title1')" prop="userid" v-if="!record" >
                     <el-button @click="openComponent('Roles')">{{ t('member.institution.self.edit.look') }}</el-button>
-                    <span>{{ manger }}</span>
+                    <span style="margin-left: 10px;">{{ manger }}</span>
                 </el-form-item>
             </fieldset>
             <fieldset class="g-fieldset el-form--horizontal">
@@ -62,11 +62,11 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, PropType, ref, onMounted, defineAsyncComponent } from 'vue'
-import { ElMessage, FormInstance, FormRules } from 'element-plus'
+import { shallowRef, PropType, ref, onMounted, defineAsyncComponent, nextTick } from 'vue'
+import { ElMessage, FormInstance, FormRules, TableInstance } from 'element-plus'
 import { i18n } from '@/stores'
 import { useComponent } from '@/hooks/component'
-import { initAdd, roleadd, getOragnDefaultManager } from '@/services/api/member'
+import { initAdd, roleadd, getOragnDefaultManager, queryRoleDetail } from '@/services/api/member'
 import { useRequest } from '@/hooks/request'
 import { handleNoneValue } from '@/filters'
 import AppSelectMember from '@pc/components/modules/select-member/index.vue'
@@ -95,6 +95,7 @@ const refresh = shallowRef(false)
 const organSelect = ref<Model.OrganSelectRsp>()
 const multipleSelection = ref<Model.UpdateTaAccountReq['dtype']>([]) // 已选中的市场数据
 const marketbstype = [{value: 0, label: "无"}, {value:1, label: "可挂可摘"}, {value:2, label: "可挂"}, {value:3, label: "可摘"}]
+const tableRef = ref<TableInstance>()
 
 const { loading } = useRequest(initAdd, {
     params: {
@@ -103,7 +104,7 @@ const { loading } = useRequest(initAdd, {
     onSuccess: (res) => {
         // 赋值数据
         formData.value.dtype = res.data.markets.map(e => ({
-            checked: 0,
+            checked: 1,
             dtype: 0,
             fdType: 0,
             fspotRightType: 0,
@@ -119,6 +120,39 @@ const { loading } = useRequest(initAdd, {
     }
 })
 
+const { run: runRoleDetail } = useRequest(queryRoleDetail, {
+    manual: true,
+    params: {
+        rolename: 'selfsupport',
+        userid: props.record?.userid
+    },
+    onSuccess: (res) => {
+        formData.value.dtype = formData.value.dtype?.map(e => ({
+            checked: res.data.markets.some(a => a.marketid === e.marketId) ? 1 : 0,
+            dtype: 0,
+            fdType: 0,
+            fspotRightType: 0,
+            marketId: e.marketId,
+            marketName: e.marketName,
+            spotRightType: 0, 
+            tradeMode: e.tradeMode,
+            tradeProperty: e.tradeProperty,
+        })) ?? []
+        console.log(formData.value.dtype)
+        // 初始化已选中的市场
+        nextTick(() => {
+            formData.value.dtype?.forEach((e) => {
+                if (e.checked) {
+                    tableRef.value?.toggleRowSelection(e, true)
+                }
+            })
+        })
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
+
 const { data: manger, run: runDefaultManager } = useRequest(getOragnDefaultManager, {
     manual: true,
     params: {
@@ -141,6 +175,7 @@ const handleSelectionChange = (selection: Model.UpdateTaAccountReq['dtype']) =>
 const onSubmit = () => {
     const rawData = { ...formData.value }
     rawData.dtype = multipleSelection.value
+    console.log(rawData)
     formRef.value?.validate((valid) => {
         if (valid) {
             loading.value = true
@@ -178,6 +213,7 @@ onMounted(() => {
     const { userid, } = props.record ?? {}
     if (userid) {
         formData.value.userid = userid
+        runRoleDetail()
     }
 })
 </script>

+ 1 - 1
src/packages/pc/views/member/institution/warehouse/components/edit/index.vue

@@ -10,7 +10,7 @@
                 </el-form-item>
                 <el-form-item :label="t('member.institution.warehouse.edit.title1')" prop="userid" v-if="!record" >
                     <el-button @click="openComponent('Roles')">{{ t('member.institution.warehouse.edit.look') }}</el-button>
-                    <span>{{ manger }}</span>
+                    <span style="margin-left: 10px;">{{ manger }}</span>
                 </el-form-item>
             </fieldset>
         </el-form>