Handy_Cao 7 месяцев назад
Родитель
Сommit
fbf34bc7b9

+ 64 - 12
src/packages/pc/views/member/institution/broker/components/edit/index.vue

@@ -12,18 +12,48 @@
                     <el-button @click="openComponent('Roles')">查看</el-button>
                     <span>{{ manger }}</span>
                 </el-form-item>
-                <el-form-item label="营销中心" prop="userid">
-                    <app-select-member2 v-model="formData.userid" />
+                <el-form-item label="营销中心" prop="parentuserid">
+                    <app-select-member2 v-model="formData.parentuserid"  :placeholder="t('investor.custom.riskcfg.edit.tips1')" :params="{ roles: '3' }"/>
                 </el-form-item>
             </fieldset>
-            <fieldset class="g-fieldset el-form--vertical">
+            <fieldset class="g-fieldset el-form--horizontal">
                 <legend class="g-fieldset__legend">权限信息</legend>
-                <el-form-item label="会员市场:" prop="marketid" >
-                    <el-checkbox-group v-model="formData.marketids">
-                        <el-checkbox v-for="item in data?.markets" v-bind:key="item.marketid" 
-                            :label="item.marketname" :value="item.marketid"/>
-                    </el-checkbox-group>
-                </el-form-item>
+                <el-table ref="tableRef" :data="formData.dtype" style="width: 100%;" @selection-change="handleSelectionChange" border>
+                    <el-table-column type="selection" width="55" />
+                    <el-table-column prop="marketName" label="市场" />
+                    <el-table-column prop="tradeMode" label="买大厅权限" 
+                       v-if="multipleSelection.some((e) => e.tradeProperty === 4 || e.tradeMode === 79)">
+                       <template #default="{ row }">
+                            <span v-if="row.tradeMode === 79">买大厅权限:可挂</span>
+                            <template v-else-if="row.tradeMode === 17 && row.tradeProperty === 4">
+                                <el-select v-model="row.dtype">
+                                    <template v-for="item in marketbstype" :key="item.value">
+                                        <el-option :label="item.label" :value="item.value" />
+                                    </template>
+                                </el-select>
+                            </template>
+                            <template v-else>
+                                {{ handleNoneValue() }}
+                            </template>
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="tradeMode" label="卖大厅权限" 
+                       v-if="multipleSelection.some((e) => e.tradeProperty === 4 || [77, 78].includes(e.tradeMode))" >
+                       <template #default="{ row }">
+                            <span v-if="[77, 78].includes(row.tradeMode)">卖大厅权限:可挂</span>
+                            <template v-else-if="row.tradeProperty === 4">
+                                <el-select v-model="row.spotRightType">
+                                    <template v-for="item in marketbstype" :key="item.value">
+                                        <el-option :label="item.label" :value="item.value" />
+                                    </template>
+                                </el-select>
+                            </template>
+                            <template v-else>
+                                {{ handleNoneValue() }}
+                            </template>
+                        </template>
+                    </el-table-column>
+                </el-table>
             </fieldset> 
         </el-form>
         <template #footer>
@@ -39,7 +69,8 @@ import { shallowRef, PropType, ref, defineAsyncComponent, onMounted } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
 import { useComponent } from '@/hooks/component'
 import { i18n } from '@/stores'
-import { roleadd, initAdd, getOragnDefaultManager } from '@/services/api/member'
+import { handleNoneValue } from '@/filters'
+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'
@@ -66,11 +97,27 @@ const formRef = ref<FormInstance>()
 const show = shallowRef(true)
 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 { data, loading } = useRequest(initAdd, {
+const { loading } = useRequest(initAdd, {
     params: {
         role: 'broker'
     },
+    onSuccess: (res) => {
+        // 赋值数据
+        formData.value.dtype = res.data.markets.map(e => ({
+            checked: 0,
+            dtype: 0,
+            fdType: 0,
+            fspotRightType: 0,
+            marketId: e.marketid,
+            marketName: e.marketname,
+            spotRightType: 0, 
+            tradeMode: e.trademode,
+            tradeProperty: e.tradeproperty,
+        })) ?? []
+    },
     onError: (err) => {
         ElMessage.error(err)
     }
@@ -91,8 +138,13 @@ const formRules: FormRules = {
     userid: [{ required: true }]
 }
 
+const handleSelectionChange = (selection: Model.UpdateTaAccountReq['dtype']) => {
+    multipleSelection.value = selection
+}
+
 const onSubmit = () => {
-    formData.value.type = props.record ? 2 : 1
+    const rawData = { ...formData.value }
+    rawData.dtype = multipleSelection.value
     formRef.value?.validate((valid) => {
         if (valid) {
             loading.value = true

+ 60 - 8
src/packages/pc/views/member/institution/industry/components/edit/index.vue

@@ -13,14 +13,44 @@
                     <span>{{ manger }}</span>
                 </el-form-item>
             </fieldset>
-            <fieldset class="g-fieldset el-form--vertical">
+            <fieldset class="g-fieldset el-form--horizontal">
                 <legend class="g-fieldset__legend">权限信息</legend>
-                <el-form-item label="会员市场:" prop="marketid" >
-                    <el-checkbox-group v-model="formData.marketids">
-                        <el-checkbox v-for="item in data?.markets" v-bind:key="item.marketid" 
-                            :label="item.marketname" :value="item.marketid"/>
-                    </el-checkbox-group>
-                </el-form-item>
+                <el-table ref="tableRef" :data="formData.dtype" style="width: 100%;" @selection-change="handleSelectionChange" border>
+                    <el-table-column type="selection" width="55" />
+                    <el-table-column prop="marketName" label="市场" />
+                    <el-table-column prop="tradeMode" label="买大厅权限" 
+                       v-if="multipleSelection.some((e) => e.tradeProperty === 4 || e.tradeMode === 79)">
+                       <template #default="{ row }">
+                            <span v-if="row.tradeMode === 79">买大厅权限:可挂</span>
+                            <template v-else-if="row.tradeMode === 17 && row.tradeProperty === 4">
+                                <el-select v-model="row.dtype">
+                                    <template v-for="item in marketbstype" :key="item.value">
+                                        <el-option :label="item.label" :value="item.value" />
+                                    </template>
+                                </el-select>
+                            </template>
+                            <template v-else>
+                                {{ handleNoneValue() }}
+                            </template>
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="tradeMode" label="卖大厅权限" 
+                       v-if="multipleSelection.some((e) => e.tradeProperty === 4 || [77, 78].includes(e.tradeMode))" >
+                       <template #default="{ row }">
+                            <span v-if="[77, 78].includes(row.tradeMode)">卖大厅权限:可挂</span>
+                            <template v-else-if="row.tradeProperty === 4">
+                                <el-select v-model="row.spotRightType">
+                                    <template v-for="item in marketbstype" :key="item.value">
+                                        <el-option :label="item.label" :value="item.value" />
+                                    </template>
+                                </el-select>
+                            </template>
+                            <template v-else>
+                                {{ handleNoneValue() }}
+                            </template>
+                        </template>
+                    </el-table-column>
+                </el-table>
             </fieldset> 
         </el-form>
         <template #footer>
@@ -38,6 +68,7 @@ import { i18n } from '@/stores'
 import { useComponent } from '@/hooks/component'
 import { roleadd, initAdd, getOragnDefaultManager } from '@/services/api/member'
 import { useRequest } from '@/hooks/request'
+import { handleNoneValue } from '@/filters'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import AppSelectMember from '@pc/components/modules/select-member/index.vue'
 
@@ -46,6 +77,8 @@ const formRef = ref<FormInstance>()
 const show = shallowRef(true)
 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 props = defineProps({
     record: {
@@ -63,10 +96,24 @@ const componentMap = new Map<string, unknown>([
 ])
 const { componentRef, componentId, openComponent, closeComponent } = useComponent()
 
-const { data, loading } = useRequest(initAdd, {
+const { loading } = useRequest(initAdd, {
     params: {
         role: 'industry'
     },
+    onSuccess: (res) => {
+        // 赋值数据
+        formData.value.dtype = res.data.markets.map(e => ({
+            checked: 0,
+            dtype: 0,
+            fdType: 0,
+            fspotRightType: 0,
+            marketId: e.marketid,
+            marketName: e.marketname,
+            spotRightType: 0, 
+            tradeMode: e.trademode,
+            tradeProperty: e.tradeproperty,
+        })) ?? []
+    },
     onError: (err) => {
         ElMessage.error(err)
     }
@@ -87,8 +134,13 @@ const formRules: FormRules = {
     userid: [{ required: true }]
 }
 
+const handleSelectionChange = (selection: Model.UpdateTaAccountReq['dtype']) => {
+    multipleSelection.value = selection
+}
+
 const onSubmit = () => {
     const rawData = { ...formData.value }
+    rawData.dtype = multipleSelection.value
     formRef.value?.validate((valid) => {
         if (valid) {
             loading.value = true

+ 60 - 8
src/packages/pc/views/member/institution/self/components/edit/index.vue

@@ -13,14 +13,44 @@
                     <span>{{ manger }}</span>
                 </el-form-item>
             </fieldset>
-            <fieldset class="g-fieldset el-form--vertical">
+            <fieldset class="g-fieldset el-form--horizontal">
                 <legend class="g-fieldset__legend">权限信息</legend>
-                <el-form-item label="会员市场:" prop="marketid" >
-                    <el-checkbox-group v-model="formData.marketids">
-                        <el-checkbox v-for="item in data?.markets" v-bind:key="item.marketid" 
-                            :label="item.marketname" :value="item.marketid" />
-                    </el-checkbox-group>
-                </el-form-item>
+                <el-table ref="tableRef" :data="formData.dtype" style="width: 100%;" @selection-change="handleSelectionChange" border>
+                    <el-table-column type="selection" width="55" />
+                    <el-table-column prop="marketName" label="市场" />
+                    <el-table-column prop="tradeMode" label="买大厅权限" 
+                       v-if="multipleSelection.some((e) => e.tradeProperty === 4 || e.tradeMode === 79)">
+                       <template #default="{ row }">
+                            <span v-if="row.tradeMode === 79">买大厅权限:可挂</span>
+                            <template v-else-if="row.tradeMode === 17 && row.tradeProperty === 4">
+                                <el-select v-model="row.dtype">
+                                    <template v-for="item in marketbstype" :key="item.value">
+                                        <el-option :label="item.label" :value="item.value" />
+                                    </template>
+                                </el-select>
+                            </template>
+                            <template v-else>
+                                {{ handleNoneValue() }}
+                            </template>
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="tradeMode" label="卖大厅权限" 
+                       v-if="multipleSelection.some((e) => e.tradeProperty === 4 || [77, 78].includes(e.tradeMode))" >
+                       <template #default="{ row }">
+                            <span v-if="[77, 78].includes(row.tradeMode)">卖大厅权限:可挂</span>
+                            <template v-else-if="row.tradeProperty === 4">
+                                <el-select v-model="row.spotRightType">
+                                    <template v-for="item in marketbstype" :key="item.value">
+                                        <el-option :label="item.label" :value="item.value" />
+                                    </template>
+                                </el-select>
+                            </template>
+                            <template v-else>
+                                {{ handleNoneValue() }}
+                            </template>
+                        </template>
+                    </el-table-column>
+                </el-table>
             </fieldset> 
         </el-form>
         <template #footer>
@@ -38,6 +68,7 @@ import { i18n } from '@/stores'
 import { useComponent } from '@/hooks/component'
 import { initAdd, roleadd, getOragnDefaultManager } from '@/services/api/member'
 import { useRequest } from '@/hooks/request'
+import { handleNoneValue } from '@/filters'
 import AppSelectMember from '@pc/components/modules/select-member/index.vue'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 
@@ -62,11 +93,27 @@ const formRef = ref<FormInstance>()
 const show = shallowRef(true)
 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 { data, loading } = useRequest(initAdd, {
+const { loading } = useRequest(initAdd, {
     params: {
         role: 'selfsupport'
     },
+    onSuccess: (res) => {
+        // 赋值数据
+        formData.value.dtype = res.data.markets.map(e => ({
+            checked: 0,
+            dtype: 0,
+            fdType: 0,
+            fspotRightType: 0,
+            marketId: e.marketid,
+            marketName: e.marketname,
+            spotRightType: 0, 
+            tradeMode: e.trademode,
+            tradeProperty: e.tradeproperty,
+        })) ?? []
+    },
     onError: (err) => {
         ElMessage.error(err)
     }
@@ -87,8 +134,13 @@ const formRules: FormRules = {
     userid: [{ required: true }]
 }
 
+const handleSelectionChange = (selection: Model.UpdateTaAccountReq['dtype']) => {
+    multipleSelection.value = selection
+}
+
 const onSubmit = () => {
     const rawData = { ...formData.value }
+    rawData.dtype = multipleSelection.value
     formRef.value?.validate((valid) => {
         if (valid) {
             loading.value = true

+ 9 - 9
src/types/model/member.d.ts

@@ -2049,15 +2049,15 @@ declare namespace Member {
     }
 
     interface TaAccountMarketVo {
-        checked?: number
-        dtype?: number
-        fdType?: number
-        fspotRightType?: number
-        marketId?: number
-        marketName?: string
-        spotRightType?: number // code:marketbstype
-        tradeMode?: number
-        tradeProperty?: number
+        checked: number
+        dtype: number
+        fdType: number
+        fspotRightType: number
+        marketId: number
+        marketName: string
+        spotRightType: number // code:marketbstype
+        tradeMode: number
+        tradeProperty: number
     }
 
     interface Arearoledivideconfig {