Browse Source

feat: 商务管家

zhengxy 7 months ago
parent
commit
469cc0745d

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

15
         <el-icon class="rMar7 tMar2" color="#ff9b48">
15
         <el-icon class="rMar7 tMar2" color="#ff9b48">
16
           <WarningFilled />
16
           <WarningFilled />
17
         </el-icon>
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
       </div>
24
       </div>
22
 
25
 
23
       <!-- S 导入媒体账户 附加条件 -->
26
       <!-- S 导入媒体账户 附加条件 -->
30
       <!-- E 导入媒体账户 附加条件 -->
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
     </div>
42
     </div>
38
     <template #footer>
43
     <template #footer>
39
       <div class="dialog-footer" style="text-align: right;padding:10px;padding-top: 0;">
44
       <div class="dialog-footer" style="text-align: right;padding:10px;padding-top: 0;">
86
 const handleClose = () => {
91
 const handleClose = () => {
87
   visible.value = false
92
   visible.value = false
88
 }
93
 }
89
-const getCountAcc = (val) =>{
94
+const getCountAcc = (val) => {
90
   acc_count.value = val
95
   acc_count.value = val
91
 }
96
 }
92
-const getMInput = (val)=>{
97
+const getMInput = (val) => {
93
   inputValue.value = val
98
   inputValue.value = val
94
 }
99
 }
95
 
100
 
100
     return
105
     return
101
   }
106
   }
102
   let data_str = '';
107
   let data_str = '';
103
-  if(importType.type == 'part' && handType.type == 1){
108
+  if (importType.type == 'part' && handType.type == 1) {
104
     data_str = inputValue.value
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
         data_str = JSON.stringify(res)
113
         data_str = JSON.stringify(res)
109
       })
114
       })
110
     }
115
     }
111
   }
116
   }
112
-  if(data_str == ''){
117
+  if (data_str == '') {
113
     ElMessage.warning('请输入账户ID或手动选择媒体账户!');
118
     ElMessage.warning('请输入账户ID或手动选择媒体账户!');
114
     return
119
     return
115
   }
120
   }
123
     project_id: projectIdRef.value?.value,
128
     project_id: projectIdRef.value?.value,
124
   }).then((res) => {
129
   }).then((res) => {
125
     loading.value = false
130
     loading.value = false
126
-    if(res){
131
+    if (res) {
127
       ElMessage.warning('导入成功')
132
       ElMessage.warning('导入成功')
128
       visible.value = false
133
       visible.value = false
129
       emit('close')
134
       emit('close')
163
 
168
 
164
 .block {
169
 .block {
165
   display: block;
170
   display: block;
166
-}
167
-</style>
171
+}</style>

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

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

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

2
   <!--  类型切换 -->
2
   <!--  类型切换 -->
3
   <div class="typeBorlineBox flex_between">
3
   <div class="typeBorlineBox flex_between">
4
     <div class="flex" style="margin-left: 15px">
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
     </div>
10
     </div>
10
     <el-button type="primary" size="default" class="rMar15" @click="authEvent()">账号授权</el-button>
11
     <el-button type="primary" size="default" class="rMar15" @click="authEvent()">账号授权</el-button>
11
   </div>
12
   </div>
12
 
13
 
13
   <div class="screenBox flex" style="padding: 15px;s" v-loading="authLoading">
14
   <div class="screenBox flex" style="padding: 15px;s" v-loading="authLoading">
14
     <Input ref="InputRef_text" title="关键词" placeholderTxt="关键词" @changeEvent="init()" @clearEvent="init()" />
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
     <Select ref="ctypeRef" :clearFlag="true" title="类型" selectWidth="160px" @changeEvent="init()" @clearEvent="init()"
19
     <Select ref="ctypeRef" :clearFlag="true" title="类型" selectWidth="160px" @changeEvent="init()" @clearEvent="init()"
18
       :options="pageInfo.getTypeList" />
20
       :options="pageInfo.getTypeList" />
19
   </div>
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
     <template v-slot:operate="slotProps">
26
     <template v-slot:operate="slotProps">
25
       <div class="text-center">
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
         <span class="c-theme pointer f13" @click="agencyEditEvent(slotProps.row)">编辑</span>
31
         <span class="c-theme pointer f13" @click="agencyEditEvent(slotProps.row)">编辑</span>
28
         <Popconfirm @confirm="deleEvent(slotProps.row)" />
32
         <Popconfirm @confirm="deleEvent(slotProps.row)" />
29
       </div>
33
       </div>
55
 
59
 
56
 const typeList = reactive({
60
 const typeList = reactive({
57
   list: [
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
   typeList.typeAc = info.id
69
   typeList.typeAc = info.id
65
   init(1)
70
   init(1)
66
 }
71
 }
74
 
79
 
75
 // 表格数据公共ts
80
 // 表格数据公共ts
76
 const descolParams = reactive([
81
 const descolParams = reactive([
77
-  { name: '账号名称', column: 'account_name', minWidth: '120px'},
82
+  { name: '账号名称', column: 'account_name', minWidth: '120px' },
78
   { name: '账号ID', column: 'account_id', cancleForMat: true },
83
   { name: '账号ID', column: 'account_id', cancleForMat: true },
79
   { name: '账号类型', column: 'type_name', },
84
   { name: '账号类型', column: 'type_name', },
80
   { name: '所属人员', column: 'owner_name', },
85
   { name: '所属人员', column: 'owner_name', },
81
   { name: '所属项目', column: 'project_name', },
86
   { name: '所属项目', column: 'project_name', },
82
-  { name: '创建时间', column: 'created_at', minWidth: '100px'},
87
+  { name: '创建时间', column: 'created_at', minWidth: '100px' },
83
   { name: '操作', column: 'operate', slotFlag: true },
88
   { name: '操作', column: 'operate', slotFlag: true },
84
 ])
89
 ])
85
 const { tableInfo, tableListRef, total } = publicTableTs(descolParams)
90
 const { tableInfo, tableListRef, total } = publicTableTs(descolParams)
154
 }
159
 }
155
 
160
 
156
 const editClose = () => {
161
 const editClose = () => {
157
-  if(route.query?.account_id){
162
+  if (route.query?.account_id) {
158
     router.replace('/adqManage')
163
     router.replace('/adqManage')
159
   }
164
   }
160
   init(1)
165
   init(1)
161
 }
166
 }
162
 
167
 
163
 onMounted(async () => {
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
   await init()
172
   await init()
168
   await init_createrList()
173
   await init_createrList()
181
 
186
 
182
 .screenArea {
187
 .screenArea {
183
   margin-bottom: 8px;
188
   margin-bottom: 8px;
184
-}
185
-</style>
189
+}</style>