li.shaoyi před 11 měsíci
rodič
revize
c88b28b9b5

+ 264 - 0
src/packages/pc/views/investor/custom/tradecfg/components/add/index.vue

@@ -0,0 +1,264 @@
+<!-- 交易商管理-个性化管理-交易商个性化-新增 -->
+<template>
+    <app-drawer :title="t('investor.custom.tradecfg.edit.title')" width="1100" 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('investor.custom.tradecfg.edit.subtitle1') }}</legend>
+                <el-form-item :label="t('investor.custom.tradecfg.edit.usergroupid')" prop="usergroupid">
+                    <el-select v-model="formData.usergroupid" @change="onGroupChange">
+                        <template v-for="(item, index) in groupTrees" :key="index">
+                            <el-option :label="item.name" :value="item.usergroupid" />
+                        </template>
+                    </el-select>
+                </el-form-item>
+                <el-form-item :label="t('investor.custom.tradecfg.edit.marketid')" prop="marketid">
+                    <el-select v-model="formData.marketid" :empty-values="[null, undefined, 0]"
+                        @change="onMarketChange">
+                        <template v-for="(item, index) in marketData?.markets" :key="index">
+                            <el-option :label="item.marketname" :value="item.marketid" />
+                        </template>
+                    </el-select>
+                </el-form-item>
+                <el-form-item :label="t('investor.custom.tradecfg.edit.goodsid')" prop="goodsid">
+                    <el-select v-model="formData.goodsid" :empty-values="[null, undefined, 0]" @change="onGoodsChange">
+                        <template v-for="(item, index) in goodsData?.goods" :key="index">
+                            <el-option :label="item.goodsname" :value="item.goodsid" />
+                        </template>
+                    </el-select>
+                </el-form-item>
+                <el-form-item :label="t('investor.custom.tradecfg.edit.paramid')" prop="paramid">
+                    <el-select v-model="formData.paramid" :empty-values="[null, undefined, 0]" @change="onResultChange"
+                        clearable>
+                        <template v-for="(item, index) in resultData?.results" :key="index">
+                            <el-option :label="item.enumdicname" :value="item.enumitemname" />
+                        </template>
+                    </el-select>
+                </el-form-item>
+            </fieldset>
+            <app-table :data="resultData?.rulesConfigVos" :columns="ruleColumns">
+                <!-- 商品设置值 -->
+                <template #paramvalue="{ row }">
+                    <span v-if="row.ruleid === 105">{{ feetypeEnum.getEnumTypeName(row.paramvalue) }}</span>
+                    <span v-else>{{ row.paramvalue || 0 }}</span>
+                </template>
+                <!-- 会员 -->
+                <template #dvalue="{ row }">
+                    <span v-if="row.ruleid === 105">
+                        {{ handleNoneValue(feetypeEnum.getEnumTypeName(row.dvalue)) }}
+                    </span>
+                    <span v-else>{{ handleNoneValue(row.dvalue) }}</span>
+                </template>
+                <!-- 个性化 -->
+                <template #cvalue="{ row, index }">
+                    <template v-if="formData.ruleList[index]">
+                        <el-select v-model="formData.ruleList[index].paramvalue" :empty-values="[null, undefined, 0]" v-if="row.ruleid === 105">
+                            <template v-for="item in feetypeEnum.getEnumOptions()" :key="item.id">
+                                <el-option :label="item.label" :value="item.value" />
+                            </template>
+                        </el-select>
+                        <el-input-number v-model="formData.ruleList[index].paramvalue"
+                            :placeholder="t('common.pleaseenter')" v-else />
+                    </template>
+                </template>
+            </app-table>
+            <app-table :data="resultData?.feesConfigVos" :columns="feeColumns">
+                <!-- 商品设置值 -->
+                <template #exchangevalue="{ row }">
+                    <template v-if="row.feealgorithm">
+                        {{ row.exchangevalue + (row.feealgorithm === 1 && '‱') }}
+                    </template>
+                    <template v-else>
+                        {{ handleNoneValue() }}
+                    </template>
+                </template>
+                <!-- 会员设置值 -->
+                <template #dvalue="{ row }">
+                    <template v-if="row.drithm">
+                        {{ row.dvalue + (row.drithm === 1 && '‱') }}
+                    </template>
+                    <template v-else>
+                        {{ handleNoneValue() }}
+                    </template>
+                </template>
+                <!-- 最小值 -->
+                <template #memberminvalue="{ row }">
+                    {{ row.memberminvalue + (row.feealgorithm === 1 && '‱') }}
+                </template>
+                <!-- 最大值 -->
+                <template #membermaxvalue="{ row }">
+                    {{ row.membermaxvalue + (row.feealgorithm === 1 && '‱') }}
+                </template>
+                <!-- 服务费 -->
+                <template #fee="{ row, index }">
+                    <template v-if="formData.feeList[index]">
+                        <el-input-number v-model="formData.feeList[index].paramvalue" :min="row.memberminvalue"
+                            :max="row.membermaxvalue" :placeholder="t('common.pleaseenter')" />
+                    </template>
+                </template>
+            </app-table>
+        </el-form>
+        <template #footer>
+            <el-button @click="onCancel(false)">{{ t('operation.close') }}</el-button>
+            <el-button type="primary" @click="onSubmit">{{ t('operation.save') }}</el-button>
+        </template>
+    </app-drawer>
+</template>
+
+<script lang="ts" setup>
+import { ref, computed } from 'vue'
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
+import { handleNoneValue } from '@/filters'
+import { getFeeAlgorithmName } from '@/constants/order'
+import { useEnum } from '@/hooks/enum'
+import { useRequest } from '@/hooks/request'
+import { traderPersonAdd, getInvestorTree, initInvestorPerson } from '@/services/api/investor'
+import AppDrawer from '@pc/components/base/drawer/index.vue'
+import AppTable from '@pc/components/base/table/index.vue'
+import { i18n } from '@/stores'
+
+const feetypeEnum = useEnum('feetype')
+
+const { global: { t } } = i18n
+const formRef = ref<FormInstance>()
+const show = ref(true)
+const refresh = ref(false)
+const loading = ref(false)
+
+const formData = ref<Model.TraderPersonAddReq>({
+    feeList: [],
+    flag: 0,
+    goodsid: 0,
+    marketid: 0,
+    ruleList: [],
+    usergroupid: 0
+})
+
+// 分组树列表
+const groupTrees = computed(() => {
+    return nodeList.value.filter((e) => e.pid === '-1')
+})
+
+// 获取分组列表
+const { dataList: nodeList } = useRequest(getInvestorTree)
+
+// 获取市场列表
+const { data: marketData, run: getMarketList } = useRequest(initInvestorPerson)
+
+// 获取商品列表
+const { data: goodsData, run: getGoodsList } = useRequest(initInvestorPerson, {
+    manual: true,
+})
+
+// 获取保证金类别列表
+const { data: resultData, run: getResultList } = useRequest(initInvestorPerson, {
+    manual: true,
+    onSuccess: (res) => {
+        formData.value.ruleList = []
+        formData.value.feeList = []
+
+        res.data.rulesConfigVos.forEach((e) => {
+            formData.value.ruleList.push({
+                paramid: e.ruleid,
+                paramvalue: 0
+            })
+        })
+
+        res.data.feesConfigVos.forEach((e) => {
+            formData.value.feeList.push({
+                feealgorithm: e.feealgorithm,
+                paramid: e.tradefeeid,
+                paramvalue: 0
+            })
+        })
+    }
+})
+
+const ruleColumns = computed<Model.TableColumn[]>(() => [
+    { field: 'rulename', label: 'investor.custom.tradecfg.edit.rulename' },
+    { field: 'paramvalue', label: 'investor.custom.tradecfg.edit.paramvalue' },
+    { field: 'dvalue', label: 'investor.custom.tradecfg.edit.dvalue', show: formData.value.usergroupid !== 0 },
+    { field: 'cvalue', label: 'investor.custom.tradecfg.edit.cvalue' },
+])
+
+const feeColumns = computed<Model.TableColumn[]>(() => [
+    { field: 'tradefeename', label: 'investor.custom.tradecfg.edit.tradefeename' },
+    { field: 'feealgorithm', label: 'investor.custom.tradecfg.edit.feealgorithm', formatValue: (val) => getFeeAlgorithmName(val) },
+    { field: 'exchangevalue', label: 'investor.custom.tradecfg.edit.exchangevalue' },
+    { field: 'dvalue', label: 'investor.custom.tradecfg.edit.dvalue', show: formData.value.usergroupid !== 0 },
+    { field: 'memberminvalue', label: 'investor.custom.tradecfg.edit.memberminvalue' },
+    { field: 'fee', label: 'investor.custom.tradecfg.edit.fee', width: 200 },
+    { field: 'membermaxvalue', label: 'investor.custom.tradecfg.edit.membermaxvalue' },
+])
+
+// 表单验证规则
+const formRules: FormRules = {
+    usergroupid: [{ required: true }],
+    marketid: [{ required: true }],
+    goodsid: [{ required: true }],
+}
+
+// 选择分组
+const onGroupChange = (value: number) => {
+    formData.value.marketid = 0
+    formData.value.goodsid = 0
+    formData.value.paramid = 0
+    formData.value.feealgorithm = 0
+    resultData.value = undefined
+    getMarketList({
+        usergroupid: value,
+    })
+}
+
+// 选择市场
+const onMarketChange = (value: number) => {
+    formData.value.goodsid = 0
+    formData.value.paramid = 0
+    formData.value.feealgorithm = 0
+    resultData.value = undefined
+    getGoodsList({
+        usergroupid: formData.value.usergroupid,
+        marketid: value,
+    })
+}
+
+// 选择商品
+const onGoodsChange = (value: number) => {
+    formData.value.paramid = 0
+    formData.value.feealgorithm = 0
+    getResultList({
+        marketid: formData.value.marketid,
+        usergroupid: formData.value.usergroupid,
+        goodsid: value
+    })
+}
+
+// 选择保证金类别
+const onResultChange = (value?: number) => {
+    const res = resultData.value?.results.find((e) => e.enumitemname === value?.toString())
+    formData.value.feealgorithm = res?.marginalgorithm
+}
+
+const onSubmit = () => {
+    formRef.value?.validate((valid) => {
+        if (valid) {
+            loading.value = true
+            traderPersonAdd({
+                data: formData.value
+            }).then(() => {
+                ElMessage.success(t('common.tips3'))
+                onCancel(true)
+            }).catch((err) => {
+                ElMessage.error(t('common.tips4') + err)
+            }).finally(() => {
+                loading.value = false
+            })
+        }
+    })
+}
+
+const onCancel = (isRefresh = false) => {
+    show.value = false
+    refresh.value = isRefresh
+}
+</script>

+ 53 - 115
src/packages/pc/views/investor/custom/tradecfg/components/edit/index.vue

@@ -1,30 +1,18 @@
 <!-- 交易商管理-个性化管理-交易商个性化-编辑 -->
 <template>
-    <app-drawer :title="t('investor.custom.tradecfg.edit.title')" width="1100" v-model:show="show" :refresh="refresh" :loading="loading">
-        <el-form ref="formRef" label-width="140px" :model="formData" :rules="formRules" :show-message="false">
+    <app-drawer :title="t('investor.custom.tradecfg.edit.title')" width="1100" v-model:show="show" :refresh="refresh"
+        :loading="loading">
+        <el-form ref="formRef" label-width="140px" :model="formData" :show-message="false">
             <fieldset class="g-fieldset el-form--horizontal">
                 <legend class="g-fieldset__legend">{{ t('investor.custom.tradecfg.edit.subtitle1') }}</legend>
-                <el-form-item :label="t('investor.custom.tradecfg.edit.usergroupid')" prop="usergroupid">
-                    <el-select v-model="formData.usergroupid" @change="onGroupChange">
-                        <template v-for="(item, index) in groupTrees" :key="index">
-                            <el-option :label="item.name" :value="item.usergroupid" />
-                        </template>
-                    </el-select>
+                <el-form-item :label="t('investor.custom.tradecfg.edit.usergroupid')">
+                    {{ handleNoneValue(groupItem?.name) }}
                 </el-form-item>
-                <el-form-item :label="t('investor.custom.tradecfg.edit.marketid')" prop="marketid">
-                    <el-select v-model="formData.marketid" :empty-values="[null, undefined, 0]"
-                        @change="onMarketChange">
-                        <template v-for="(item, index) in marketData?.markets" :key="index">
-                            <el-option :label="item.marketname" :value="item.marketid" />
-                        </template>
-                    </el-select>
+                <el-form-item :label="t('investor.custom.tradecfg.edit.marketid')">
+                    {{ handleNoneValue(marketItem?.name) }}
                 </el-form-item>
-                <el-form-item :label="t('investor.custom.tradecfg.edit.goodsid')" prop="goodsid">
-                    <el-select v-model="formData.goodsid" :empty-values="[null, undefined, 0]" @change="onGoodsChange">
-                        <template v-for="(item, index) in goodsData?.goods" :key="index">
-                            <el-option :label="item.goodsname" :value="item.goodsid" />
-                        </template>
-                    </el-select>
+                <el-form-item :label="t('investor.custom.tradecfg.edit.goodsid')">
+                    {{ handleNoneValue(goodsItem?.name) }}
                 </el-form-item>
                 <el-form-item :label="t('investor.custom.tradecfg.edit.paramid')" prop="paramid">
                     <el-select v-model="formData.paramid" :empty-values="[null, undefined, 0]" @change="onResultChange"
@@ -51,12 +39,13 @@
                 <!-- 个性化 -->
                 <template #cvalue="{ row, index }">
                     <template v-if="formData.ruleList[index]">
-                        <el-select v-model="formData.ruleList[index].paramvalue" v-if="row.ruleid === 105">
+                        <el-select v-model="formData.ruleList[index].paramvalue" :empty-values="[null, undefined, 0]" v-if="row.ruleid === 105">
                             <template v-for="item in feetypeEnum.getEnumOptions()" :key="item.id">
                                 <el-option :label="item.label" :value="item.value" />
                             </template>
                         </el-select>
-                        <el-input-number v-model="formData.ruleList[index].paramvalue" :placeholder="t('common.pleaseenter')" v-else />
+                        <el-input-number v-model="formData.ruleList[index].paramvalue"
+                            :placeholder="t('common.pleaseenter')" v-else />
                     </template>
                 </template>
             </app-table>
@@ -89,8 +78,10 @@
                 </template>
                 <!-- 服务费 -->
                 <template #fee="{ row, index }">
-                    <el-input-number v-model="formData.feeList[index].paramvalue" :min="row.memberminvalue"
-                        :max="row.membermaxvalue" :placeholder="t('common.pleaseenter')" />
+                    <template v-if="formData.feeList[index]">
+                        <el-input-number v-model="formData.feeList[index].paramvalue" :min="row.memberminvalue"
+                            :max="row.membermaxvalue" :placeholder="t('common.pleaseenter')" />
+                    </template>
                 </template>
             </app-table>
         </el-form>
@@ -102,8 +93,8 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, PropType, computed, onMounted } from 'vue'
-import { ElMessage, FormInstance, FormRules } from 'element-plus'
+import { reactive, shallowRef, PropType, computed } from 'vue'
+import { ElMessage, FormInstance } from 'element-plus'
 import { handleNoneValue } from '@/filters'
 import { getFeeAlgorithmName } from '@/constants/order'
 import { useEnum } from '@/hooks/enum'
@@ -115,62 +106,63 @@ import { i18n } from '@/stores'
 
 const props = defineProps({
     record: {
-        type: Object as PropType<Model.TradeConfigViewRsp>
+        type: Object as PropType<Model.TradeConfigViewRsp>,
+        required: true
     }
 })
 
 const feetypeEnum = useEnum('feetype')
 
 const { global: { t } } = i18n
-const formRef = ref<FormInstance>()
-const show = ref(true)
-const refresh = ref(false)
-const loading = ref(false)
+const formRef = shallowRef<FormInstance>()
+const show = shallowRef(true)
+const refresh = shallowRef(false)
+const loading = shallowRef(false)
 
-const formData = ref<Model.TraderPersonAddReq>({
+const formData = reactive<Model.TraderPersonAddReq>({
     feeList: [],
-    flag: 0,
-    goodsid: 0,
-    marketid: 0,
+    flag: 1,
+    goodsid: props.record.goodsid,
+    marketid: props.record.marketid,
     ruleList: [],
-    usergroupid: 0
-})
-
-// 分组树列表
-const groupTrees = computed(() => {
-    return nodeList.value.filter((e) => e.pid === '-1')
+    paramid: props.record.paramid,
+    usergroupid: props.record.usergroupid
 })
 
 // 获取分组列表
 const { dataList: nodeList } = useRequest(getInvestorTree)
 
-// 获取市场列表
-const { data: marketData, run: getMarketList } = useRequest(initInvestorPerson)
+// 分组对象
+const groupItem = computed(() => nodeList.value.find((e) => e.pid === '-1' && e.usergroupid === formData.usergroupid))
 
-// 获取商品列表
-const { data: goodsData, run: getGoodsList } = useRequest(initInvestorPerson, {
-    manual: true,
-})
+// 市场对象
+const marketItem = computed(() => nodeList.value.find((e) => e.pid === groupItem.value?.id && e.marketid === formData.marketid))
+
+// 商品对象
+const goodsItem = computed(() => nodeList.value.find((e) => e.pid === marketItem.value?.id && e.goodsid === formData.goodsid))
 
 // 获取保证金类别列表
-const { data: resultData, run: getResultList } = useRequest(initInvestorPerson, {
-    manual: true,
+const { data: resultData } = useRequest(initInvestorPerson, {
+    params: {
+        usergroupid: formData.usergroupid,
+        marketid: formData.marketid,
+        goodsid: formData.goodsid
+    },
     onSuccess: (res) => {
-        formData.value.ruleList = []
-        formData.value.feeList = []
-
         res.data.rulesConfigVos.forEach((e) => {
-            formData.value.ruleList.push({
+            const rule = props.record.druleList.find((d) => d.ruleid === e.ruleid)
+            formData.ruleList.push({
                 paramid: e.ruleid,
-                paramvalue: 0
+                paramvalue: rule ? rule.cvalue : 0
             })
         })
 
         res.data.feesConfigVos.forEach((e) => {
-            formData.value.feeList.push({
+            const fee = props.record.dfeeList.find((d) => d.tradefeeid === e.tradefeeid)
+            formData.feeList.push({
                 feealgorithm: e.feealgorithm,
                 paramid: e.tradefeeid,
-                paramvalue: 0
+                paramvalue: fee ? fee.cvalue : 0
             })
         })
     }
@@ -179,7 +171,7 @@ const { data: resultData, run: getResultList } = useRequest(initInvestorPerson,
 const ruleColumns = computed<Model.TableColumn[]>(() => [
     { field: 'rulename', label: 'investor.custom.tradecfg.edit.rulename' },
     { field: 'paramvalue', label: 'investor.custom.tradecfg.edit.paramvalue' },
-    { field: 'dvalue', label: 'investor.custom.tradecfg.edit.dvalue', show: formData.value.usergroupid !== 0 },
+    { field: 'dvalue', label: 'investor.custom.tradecfg.edit.dvalue', show: formData.usergroupid !== 0 },
     { field: 'cvalue', label: 'investor.custom.tradecfg.edit.cvalue' },
 ])
 
@@ -187,58 +179,16 @@ const feeColumns = computed<Model.TableColumn[]>(() => [
     { field: 'tradefeename', label: 'investor.custom.tradecfg.edit.tradefeename' },
     { field: 'feealgorithm', label: 'investor.custom.tradecfg.edit.feealgorithm', formatValue: (val) => getFeeAlgorithmName(val) },
     { field: 'exchangevalue', label: 'investor.custom.tradecfg.edit.exchangevalue' },
-    { field: 'dvalue', label: 'investor.custom.tradecfg.edit.dvalue', show: formData.value.usergroupid !== 0 },
+    { field: 'dvalue', label: 'investor.custom.tradecfg.edit.dvalue', show: formData.usergroupid !== 0 },
     { field: 'memberminvalue', label: 'investor.custom.tradecfg.edit.memberminvalue' },
     { field: 'fee', label: 'investor.custom.tradecfg.edit.fee', width: 200 },
     { field: 'membermaxvalue', label: 'investor.custom.tradecfg.edit.membermaxvalue' },
 ])
 
-// 表单验证规则
-const formRules: FormRules = {
-    usergroupid: [{ required: true }],
-    marketid: [{ required: true }],
-    goodsid: [{ required: true }],
-}
-
-// 选择分组
-const onGroupChange = (value: number) => {
-    formData.value.marketid = 0
-    formData.value.goodsid = 0
-    formData.value.paramid = 0
-    formData.value.feealgorithm = 0
-    resultData.value = undefined
-    getMarketList({
-        usergroupid: value,
-    })
-}
-
-// 选择市场
-const onMarketChange = (value: number) => {
-    formData.value.goodsid = 0
-    formData.value.paramid = 0
-    formData.value.feealgorithm = 0
-    resultData.value = undefined
-    getGoodsList({
-        usergroupid: formData.value.usergroupid,
-        marketid: value,
-    })
-}
-
-// 选择商品
-const onGoodsChange = (value: number) => {
-    formData.value.paramid = 0
-    formData.value.feealgorithm = 0
-    getResultList({
-        marketid: formData.value.marketid,
-        usergroupid: formData.value.usergroupid,
-        goodsid: value
-    })
-}
-
 // 选择保证金类别
 const onResultChange = (value?: number) => {
     const res = resultData.value?.results.find((e) => e.enumitemname === value?.toString())
-    formData.value.feealgorithm = res?.marginalgorithm
+    formData.feealgorithm = res?.marginalgorithm
 }
 
 const onSubmit = () => {
@@ -246,7 +196,7 @@ const onSubmit = () => {
         if (valid) {
             loading.value = true
             traderPersonAdd({
-                data: formData.value
+                data: formData
             }).then(() => {
                 ElMessage.success(t('common.tips3'))
                 onCancel(true)
@@ -263,16 +213,4 @@ const onCancel = (isRefresh = false) => {
     show.value = false
     refresh.value = isRefresh
 }
-
-onMounted(() => {
-    const record = props.record
-    if (record) {
-        console.log(record)
-        // formData.value = {
-        //     accountid: record.accountid,
-        //     customertype: record.customertype,
-        //     userid: record.userid
-        // }
-    }
-})
 </script>

+ 7 - 1
src/packages/pc/views/investor/custom/tradecfg/index.vue

@@ -36,7 +36,8 @@
                 @click="openComponent" v-if="data" />
         </div>
         <template v-if="data">
-            <app-table-details :title="t('common.baseinfo')" :data="data" :label-width="160" :cell-props="detailProps" :column="3" />
+            <app-table-details :title="t('common.baseinfo')" :data="data" :label-width="160" :cell-props="detailProps"
+                :column="3" />
             <app-table :data="data.druleList" :columns="ruleColumns">
                 <template #headerLeft>
                     <b>{{ t('investor.custom.tradecfg.subtitle') }}</b>
@@ -121,6 +122,9 @@ import { i18n } from '@/stores'
 const { componentMap, componentId, openComponent, closeComponent, getActionButtons } = useOperation<Model.TradeConfigViewRsp>({
     onClose: (componentId) => {
         getNodeList()
+        if (componentId === 'investor_custom_tradecfg_modify') {
+            onSearch()
+        }
         if (componentId === 'investor_custom_tradecfg_delete') {
             qs.value = {}
             data.value = undefined
@@ -220,6 +224,8 @@ const onSearch = () => {
                     goodsName: selectedGoods.value?.name,
                 }
                 run(qs.value)
+            } else {
+                data.value = undefined
             }
         })
     })

+ 108 - 1
src/packages/pc/views/member/institution/user/index.vue

@@ -1,7 +1,114 @@
 <!-- 会员机构管理-机构管理-机构资料管理 -->
 <template>
-    <app-view></app-view>
+    <app-view>
+        <template #header>
+            <app-filter :option="filterOption" />
+        </template>
+        <app-table :data="dataList" :columns="tableColumns" :loading="loading">
+            <template #headerLeft>
+                <app-operation :data-list="getActionButtons(['query_internal_liquidation_export'])"
+                    @click="(code: string) => openComponent(code)" />
+            </template>
+            <!-- 操作 -->
+            <template #operate="{ row }">
+                <app-operation size="small" :data-list="getActionButtons(['query_internal_liquidation_details'])"
+                    @click="(code: string) => openComponent(code, row)" circle />
+            </template>
+            <template #footer>
+                <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
+                    @change="onSearch" />
+            </template>
+        </app-table>
+        <component :is="componentMap.get(componentId)" v-bind="{ record, queryParams }" @closed="closeComponent"
+            v-if="componentId" />
+    </app-view>
 </template>
 
 <script lang="ts" setup>
+import { ref } from 'vue'
+import { ElMessage } from 'element-plus'
+import { getBuyOrSellList } from '@/constants/order'
+import { useDataFilter } from '@/hooks/datatable-v2'
+import { useRequest } from '@/hooks/request'
+import { useMarket } from '@/hooks/market'
+import { useOperation } from '@/hooks/operation'
+import { queryOrganDetailList } from '@/services/api/member'
+import { i18n } from '@/stores'
+import AppTable from '@pc/components/base/table/index.vue'
+import AppPagination from '@pc/components/base/pagination/index.vue'
+import AppOperation from '@pc/components/base/operation/index.vue'
+import AppFilter from '@pc/components/base/table-filter-v2/index.vue'
+
+const { getMarketOptions } = useMarket()
+const { global: { t } } = i18n
+
+const { componentMap, componentId, record, openComponent, closeComponent, getActionButtons } = useOperation<Model.OrganDetailRsp>({
+    onClose: () => onSearch()
+})
+
+const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryOrganDetailList, {
+    params: {
+        pageNum: 1,
+        pageSize: 20
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
+
+const tableColumns = ref<Model.TableColumn[]>([
+    { field: 'orderId', label: '机构代码' },
+    { field: 'accountNameId', label: '机构名称' },
+    { field: 'goodsCodeName', label: '机构状态' },
+    { field: 'buyOrSell', label: '机构角色' },
+    { field: 'orderPrice', label: '操作员' },
+    { field: 'orderQty', label: '创建时间' },
+    { field: 'orderAccount', label: '最后更新时间' },
+    { field: 'operate', label: '操作', fixed: 'right' }
+])
+
+const { queryParams, filterOption, getQueryParams, resetFilters } = useDataFilter<Model.OrganDetailListReq>({
+    filters: [
+        {
+            field: 'marketId',
+            label: '机构',
+            required: true,
+            options: () => getMarketOptions()
+        },
+        {
+            field: 'goodsId',
+            label: '机构状态',
+        },
+        {
+            field: 'buyOrSell',
+            label: '市场权限',
+            options: () => getBuyOrSellList()
+        },
+        {
+            field: 'accountId',
+            label: '创建时间',
+        },
+        {
+            field: 'orderId',
+            label: '角色',
+        },
+    ],
+    buttons: [
+        { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
+        { label: t('operation.reset'), className: 'el-button--primary', validateEvent: false, onClick: () => resetFilters() }
+    ]
+})
+
+// 处理请求参数
+const processRequiredParams = () => {
+    const qs = getQueryParams()
+    const marketId = (qs.marketId ?? 0).toString()
+    qs.tradeMode = +marketId.slice(0, 2)
+    return qs
+}
+
+const onSearch = () => {
+    const qs = processRequiredParams()
+    run(qs)
+}
 </script>

+ 14 - 0
src/services/api/investor/index.ts

@@ -184,6 +184,13 @@ export function initInvestorPerson(options: CommonFetchOptions<{ request: Model.
 }
 
 /**
+ * 交易商管理-->个性化管理-->交易商个性化-->修改-->初始化保证金类别
+ */
+export function initBZList(options: CommonFetchOptions<{ request: Model.BZListReq; response: Model.BZListRsp[]; }>) {
+    return httpClient.commonRequest('/investor/initBZList', 'get', options)
+}
+
+/**
  * 交易商管理-->个性化管理-->交易商个性化-->新增/修改
  */
 export function traderPersonAdd(options: CommonFetchOptions<{ request: Partial<Model.TraderPersonAddReq>; }>) {
@@ -286,4 +293,11 @@ export function restoreAccount(options: CommonFetchOptions<{ request: Model.Rest
  */
 export function modifyAudit(options: CommonFetchOptions<{ request: Model.ModifyAuditReq; }>) {
     return httpClient.commonRequest('/investor/modifyAudit', 'get', options)
+}
+
+/**
+ * 交易商管理-->个性化管理-->资金账户个性化-->获取树结构
+ */
+export function getAccTradeTree(options: CommonFetchOptions<{ response: Model.AccTradeTreeRsp; }>) {
+    return httpClient.commonRequest('/investor/getAccTradeTree', 'get', options)
 }

+ 54 - 3
src/types/model/investor.d.ts

@@ -757,7 +757,7 @@ declare namespace Model {
         usergroupid: number;
     }
 
-    /** 交易商管理-->个性化管理-->交易商个性化-->详情 请求 */
+    /** 交易商管理-->个性化管理-->交易商个性化-->详情 响应 */
     interface TradeConfigViewRsp {
         autoid: number; // 自增ID
         config: {
@@ -777,8 +777,33 @@ declare namespace Model {
         };
         createtime: string; // 创建时间
         creatorid: number; // 创建人
-        dfeeList: [];
-        druleList: [];
+        dfeeList: {
+            crithm: number;
+            cvalue: number;
+            drithm: number;
+            dvalue: number;
+            exchangevalue: number;
+            feealgorithm: number;
+            grithm: number;
+            gvalue: number;
+            membermaxvalue: number;
+            memberminvalue: number;
+            qtydecimalplace: number;
+            tradefeeid: number;
+            tradefeename: string;
+        }[];
+        druleList: {
+            cvalue: number;
+            defaultvalue: number;
+            dvalue: number;
+            gvalue: number;
+            paramvalue: number;
+            qtydecimalplace: number;
+            regexpress: string;
+            remark: string;
+            ruleid: number;
+            rulename: string;
+        }[];
         feeList: [];
         feealgorithm: number; // 费用算法 - 1:比率 2:固定
         goodsid: number; // 商品ID
@@ -904,4 +929,30 @@ declare namespace Model {
         auditid: number;
         msg?: string; // 不通过原因
     }
+
+    /** 交易商管理-->个性化管理-->交易商个性化-->修改-->初始化保证金类别 请求 */
+    interface BZListReq {
+        goodsid: number;
+    }
+
+    /** 交易商管理-->个性化管理-->交易商个性化-->修改-->初始化保证金类别 响应 */
+    interface BZListRsp {
+        enumdicname: string;
+        enumitemname: string;
+        marginalgorithm: number;
+        marketmarginvalue: number;
+    }
+
+    /** 交易商管理-->个性化管理-->资金账户个性化-->获取树结构 */
+    interface AccTradeTreeRsp {
+        accountid: number;
+        goodsid: number;
+        id: string;
+        level: number;
+        marketid: number;
+        name: string;
+        pid: string;
+        tradetype: number;
+        userid: number;
+    }
 }