zhengxy преди 7 месеца
родител
ревизия
469cc0745d

+ 19 - 15
src/components/businessMoudle/adqManage3/agency/importDialog.vue

@@ -15,9 +15,12 @@
15 15
         <el-icon class="rMar7 tMar2" color="#ff9b48">
16 16
           <WarningFilled />
17 17
         </el-icon>
18
-        <span class="flex_1 " v-if="importType.type == 'part' && handType.type == 1">请确保输入的广告主账户已属于对应的代理商,否则会导致失败;单次授权账户上限{{ agencyCount }}个,如账户数量较多,请分批次输入</span>
19
-        <span class="flex_1 " v-if="importType.type == 'part' && handType.type == 2">该代理商账户下共{{acc_count}}个媒体账户,请选择想要导入的账户名称</span>
20
-        <span class="flex_1 " v-if="importType.type == 'all'">该代理商账户下共{{acc_count}}个媒体账户</span>
18
+        <span class="flex_1 "
19
+          v-if="importType.type == 'part' && handType.type == 1">请确保输入的广告主账户已属于对应的代理商,否则会导致失败;单次授权账户上限{{ agencyCount
20
+          }}个,如账户数量较多,请分批次输入</span>
21
+        <span class="flex_1 "
22
+          v-if="importType.type == 'part' && handType.type == 2">该代理商账户下共{{ acc_count }}个媒体账户,请选择想要导入的账户名称</span>
23
+        <span class="flex_1 " v-if="importType.type == 'all'">该代理商账户下共{{ acc_count }}个媒体账户</span>
21 24
       </div>
22 25
 
23 26
       <!-- S 导入媒体账户 附加条件 -->
@@ -30,10 +33,12 @@
30 33
       <!-- E 导入媒体账户 附加条件 -->
31 34
 
32 35
       <!-- 手动输入 -->
33
-      <ManualInput v-show="importType.type == 'part' && handType.type == 1" :maxRow="agencyCount" @mInput="getMInput"></ManualInput>
36
+      <ManualInput v-show="importType.type == 'part' && handType.type == 1" :maxRow="agencyCount" @mInput="getMInput">
37
+      </ManualInput>
34 38
 
35 39
       <!-- 列表选择或者全部导入 -->
36
-      <ChildList ref="ChildListRef" v-show="importType.type == 'part' && handType.type == 2 || importType.type == 'all'" :agencyItem="agencyItem" :importType="importType.type" :handType="handType.type" @total="getCountAcc"></ChildList>
40
+      <ChildList ref="ChildListRef" v-show="importType.type == 'part' && handType.type == 2 || importType.type == 'all'"
41
+        :agencyItem="agencyItem" :importType="importType.type" :handType="handType.type" @total="getCountAcc"></ChildList>
37 42
     </div>
38 43
     <template #footer>
39 44
       <div class="dialog-footer" style="text-align: right;padding:10px;padding-top: 0;">
@@ -86,10 +91,10 @@ onBeforeMount(() => {
86 91
 const handleClose = () => {
87 92
   visible.value = false
88 93
 }
89
-const getCountAcc = (val) =>{
94
+const getCountAcc = (val) => {
90 95
   acc_count.value = val
91 96
 }
92
-const getMInput = (val)=>{
97
+const getMInput = (val) => {
93 98
   inputValue.value = val
94 99
 }
95 100
 
@@ -100,16 +105,16 @@ const submitEvent = async () => {
100 105
     return
101 106
   }
102 107
   let data_str = '';
103
-  if(importType.type == 'part' && handType.type == 1){
108
+  if (importType.type == 'part' && handType.type == 1) {
104 109
     data_str = inputValue.value
105
-  }else{
106
-    if(ChildListRef.value){
107
-      await ChildListRef.value.getMultipleList().then((res)=>{
110
+  } else {
111
+    if (ChildListRef.value) {
112
+      await ChildListRef.value.getMultipleList().then((res) => {
108 113
         data_str = JSON.stringify(res)
109 114
       })
110 115
     }
111 116
   }
112
-  if(data_str == ''){
117
+  if (data_str == '') {
113 118
     ElMessage.warning('请输入账户ID或手动选择媒体账户!');
114 119
     return
115 120
   }
@@ -123,7 +128,7 @@ const submitEvent = async () => {
123 128
     project_id: projectIdRef.value?.value,
124 129
   }).then((res) => {
125 130
     loading.value = false
126
-    if(res){
131
+    if (res) {
127 132
       ElMessage.warning('导入成功')
128 133
       visible.value = false
129 134
       emit('close')
@@ -163,5 +168,4 @@ defineExpose({
163 168
 
164 169
 .block {
165 170
   display: block;
166
-}
167
-</style>
171
+}</style>

+ 2 - 2
src/components/businessMoudle/adqManage3/hooks/agency.ts

@@ -5,7 +5,7 @@ export const agencyExport = () => {
5 5
   const EditDialogRef = ref()
6 6
   const ImpoartDialogRef = ref()
7 7
   const agencyEvent = (info) => {
8
-    if(!info?.agency_account_id){
8
+    if (!info?.agency_account_id) {
9 9
       ElMessage.error('代理商获取失败,无法导入账户!')
10 10
       return
11 11
     }
@@ -14,7 +14,7 @@ export const agencyExport = () => {
14 14
     }
15 15
   }
16 16
   const agencyEditEvent = (info) => {
17
-    if(!info?.account_id){
17
+    if (!info?.account_id) {
18 18
       ElMessage.error('账户获取失败,无法进行编辑!')
19 19
       return
20 20
     }

+ 25 - 21
src/components/businessMoudle/adqManage3/index.vue

@@ -2,28 +2,32 @@
2 2
   <!--  类型切换 -->
3 3
   <div class="typeBorlineBox flex_between">
4 4
     <div class="flex" style="margin-left: 15px">
5
-      <div class="item" v-for="item in typeList.list" :key="item.id" :class="item.id == typeList.typeAc ? 'itemAc' : ''" @click="switchTypeItem(item)">
6
-      <div>{{item.name}}</div>
7
-      <div class="borLine"></div>
8
-    </div>
5
+      <div class="item" v-for="item in typeList.list" :key="item.id" :class="item.id == typeList.typeAc ? 'itemAc' : ''"
6
+        @click="switchTypeItem(item)">
7
+        <div>{{ item.name }}</div>
8
+        <div class="borLine"></div>
9
+      </div>
9 10
     </div>
10 11
     <el-button type="primary" size="default" class="rMar15" @click="authEvent()">账号授权</el-button>
11 12
   </div>
12 13
 
13 14
   <div class="screenBox flex" style="padding: 15px;s" v-loading="authLoading">
14 15
     <Input ref="InputRef_text" title="关键词" placeholderTxt="关键词" @changeEvent="init()" @clearEvent="init()" />
15
-    <Select ref="ideaManRef" :clearFlag="true" title="所属人员" selectWidth="160px" :optObj="{ k: 'id', la: 'username', val: 'id' }"
16
-      @changeEvent="init()" @clearEvent="init()" :options="pageInfo.createrList" />
16
+    <Select ref="ideaManRef" :clearFlag="true" title="所属人员" selectWidth="160px"
17
+      :optObj="{ k: 'id', la: 'username', val: 'id' }" @changeEvent="init()" @clearEvent="init()"
18
+      :options="pageInfo.createrList" />
17 19
     <Select ref="ctypeRef" :clearFlag="true" title="类型" selectWidth="160px" @changeEvent="init()" @clearEvent="init()"
18 20
       :options="pageInfo.getTypeList" />
19 21
   </div>
20 22
 
21 23
   <!--  列表-->
22
-  <TableList ref="tableListRef" :tableData="tableInfo.tableList" immobilizationHeight="calc(100vh - 260px)" :descol="tableInfo.descolList" :total="total"
23
-    @init="init">
24
+  <TableList ref="tableListRef" :tableData="tableInfo.tableList" immobilizationHeight="calc(100vh - 260px)"
25
+    :descol="tableInfo.descolList" :total="total" @init="init">
24 26
     <template v-slot:operate="slotProps">
25 27
       <div class="text-center">
26
-        <span class="c-theme pointer f13 rMar7" v-if="typeList.typeAc == 'ACCOUNT_ROLE_TYPE_AGENCY'" @click="agencyEvent(slotProps.row)">导入账户</span>
28
+        <span class="c-theme pointer f13 rMar7"
29
+          v-if="['ACCOUNT_ROLE_TYPE_AGENCY', 'ACCOUNT_ROLE_TYPE_BUSINESS_MANAGER'].includes(typeList.typeAc)"
30
+          @click="agencyEvent(slotProps.row)">导入账户</span>
27 31
         <span class="c-theme pointer f13" @click="agencyEditEvent(slotProps.row)">编辑</span>
28 32
         <Popconfirm @confirm="deleEvent(slotProps.row)" />
29 33
       </div>
@@ -55,12 +59,13 @@ const { proxy } = getCurrentInstance() as any;
55 59
 
56 60
 const typeList = reactive({
57 61
   list: [
58
-  {id:'ACCOUNT_ROLE_TYPE_ADVERTISER', name: '广告主' },
59
-  {id:'ACCOUNT_ROLE_TYPE_AGENCY', name: '代理商' },
60
-],
61
-typeAc: 'ACCOUNT_ROLE_TYPE_AGENCY'
62
+    { id: 'ACCOUNT_ROLE_TYPE_ADVERTISER', name: '广告主' },
63
+    { id: 'ACCOUNT_ROLE_TYPE_AGENCY', name: '代理商' },
64
+    { id: 'ACCOUNT_ROLE_TYPE_BUSINESS_MANAGER', name: '商务管家' },
65
+  ],
66
+  typeAc: 'ACCOUNT_ROLE_TYPE_AGENCY'
62 67
 })
63
-const switchTypeItem = (info)=>{
68
+const switchTypeItem = (info) => {
64 69
   typeList.typeAc = info.id
65 70
   init(1)
66 71
 }
@@ -74,12 +79,12 @@ const {
74 79
 
75 80
 // 表格数据公共ts
76 81
 const descolParams = reactive([
77
-  { name: '账号名称', column: 'account_name', minWidth: '120px'},
82
+  { name: '账号名称', column: 'account_name', minWidth: '120px' },
78 83
   { name: '账号ID', column: 'account_id', cancleForMat: true },
79 84
   { name: '账号类型', column: 'type_name', },
80 85
   { name: '所属人员', column: 'owner_name', },
81 86
   { name: '所属项目', column: 'project_name', },
82
-  { name: '创建时间', column: 'created_at', minWidth: '100px'},
87
+  { name: '创建时间', column: 'created_at', minWidth: '100px' },
83 88
   { name: '操作', column: 'operate', slotFlag: true },
84 89
 ])
85 90
 const { tableInfo, tableListRef, total } = publicTableTs(descolParams)
@@ -154,15 +159,15 @@ const init_createrList = async () => {
154 159
 }
155 160
 
156 161
 const editClose = () => {
157
-  if(route.query?.account_id){
162
+  if (route.query?.account_id) {
158 163
     router.replace('/adqManage')
159 164
   }
160 165
   init(1)
161 166
 }
162 167
 
163 168
 onMounted(async () => {
164
-  if(route.query?.account_id){
165
-    agencyEditEvent({'account_id': route.query?.account_id})
169
+  if (route.query?.account_id) {
170
+    agencyEditEvent({ 'account_id': route.query?.account_id })
166 171
   }
167 172
   await init()
168 173
   await init_createrList()
@@ -181,5 +186,4 @@ onMounted(async () => {
181 186
 
182 187
 .screenArea {
183 188
   margin-bottom: 8px;
184
-}
185
-</style>
189
+}</style>