liuxiaona vor 1 Jahr
Ursprung
Commit
6c424ec516
57 geänderte Dateien mit 675 neuen und 154 gelöschten Zeilen
  1. 1 1
      dist/assets/index.f1d960a4.css
  2. 0 1
      dist/assets/index.30e21b1b.css
  3. 0 1
      dist/assets/index.50118c75.js
  4. 0 1
      dist/assets/index.9195889f.css
  5. 1 0
      dist/assets/index.af24d2a1.css
  6. 1 0
      dist/assets/index.e563defa.js
  7. 1 0
      dist/assets/index.fde7f742.css
  8. 0 1
      dist/assets/materialBlock.2584bccc.css
  9. 1 0
      dist/assets/materialBlock.4d7b717e.css
  10. 0 1
      dist/assets/radioGroup.aa4af5c1.css
  11. 1 0
      dist/assets/radioGroup.e77f65db.css
  12. 0 1
      dist/assets/timeScreen.0ab73184.css
  13. 1 0
      dist/assets/timeScreen.2ccf4b4d.css
  14. 2 2
      dist/index.html
  15. 1 1
      dist/js/_dialog/_dialog.34a9672f.js
  16. 1 1
      dist/js/_input/_input.4ae0951e.js
  17. 1 1
      dist/js/_select/_select.fd940e6a.js
  18. 1 1
      dist/js/api/api.9e312803.js
  19. 1 1
      dist/js/basisMoudle/accountManage.e1786e90.js
  20. 1 1
      dist/js/basisMoudle/error.cae4f2c8.js
  21. 1 1
      dist/js/basisMoudle/home.e3f6d98d.js
  22. 1 1
      dist/js/basisMoudle/login.be6bddf0.js
  23. 1 1
      dist/js/businessMoudle/adqManage.1e207448.js
  24. 1 0
      dist/js/collectClip/index.6ca85cac.js
  25. 0 1
      dist/js/collectClip/index.884e5e3c.js
  26. 0 1
      dist/js/configArea/index.49d6c4f5.js
  27. 1 0
      dist/js/configArea/index.c077cf0c.js
  28. 0 0
      dist/js/edit/edit.d526229f.js
  29. 0 1
      dist/js/gdtList/index.9b6d963e.js
  30. 1 0
      dist/js/gdtList/index.fe282530.js
  31. 1 1
      dist/js/index/index.9a26689a.js
  32. 1 1
      dist/js/index/index.a6e5dc8c.js
  33. 0 1
      dist/js/layout/index.06a6707a.js
  34. 1 0
      dist/js/layout/index.8dfe992c.js
  35. 1 1
      dist/js/layout/index_head.4a558654.js
  36. 1 0
      dist/js/materialBlock/materialBlock.2c0a8115.js
  37. 0 1
      dist/js/materialBlock/materialBlock.97c080df.js
  38. 0 1
      dist/js/materialLibrary/index.861cc55a.js
  39. 1 0
      dist/js/materialLibrary/index.fe53cb83.js
  40. 1 1
      dist/js/materialTs/materialTs.4781f705.js
  41. 1 1
      dist/js/menuPermission/menuList.76470dda.js
  42. 1 1
      dist/js/miniprogram/index.19942ac2.js
  43. 0 1
      dist/js/question-filled/question-filled.23a894b6.js
  44. 1 0
      dist/js/question-filled/question-filled.8537ddf0.js
  45. 1 0
      dist/js/radioGroup/radioGroup.43a780d8.js
  46. 0 1
      dist/js/radioGroup/radioGroup.760e6234.js
  47. 1 0
      dist/js/tableInfo/tableInfo.31a11f41.js
  48. 0 1
      dist/js/tableInfo/tableInfo.566c61d9.js
  49. 1 1
      dist/js/taskList/index.082747c9.js
  50. 0 1
      dist/js/timeScreen/timeScreen.0cfbacc4.js
  51. 1 0
      dist/js/timeScreen/timeScreen.1061a3c2.js
  52. 9 9
      src/common/common.ts
  53. 4 5
      src/components/businessMoudle/batchGdt/previewArea/index.vue
  54. 130 103
      src/components/businessMoudle/gdtList/account.vue
  55. 470 0
      src/components/businessMoudle/gdtList/dialog/modifyDailyBudget.vue
  56. 13 2
      src/components/businessMoudle/gdtList/index.vue
  57. 14 0
      src/components/businessMoudle/gdtList/plan.vue

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/assets/index.f1d960a4.css


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/assets/index.30e21b1b.css


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/assets/index.50118c75.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/assets/index.9195889f.css


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/assets/index.af24d2a1.css


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/assets/index.e563defa.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/assets/index.fde7f742.css


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/assets/materialBlock.2584bccc.css


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/assets/materialBlock.4d7b717e.css


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/assets/radioGroup.aa4af5c1.css


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/assets/radioGroup.e77f65db.css


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/assets/timeScreen.0ab73184.css


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/assets/timeScreen.2ccf4b4d.css


+ 2 - 2
dist/index.html

@@ -6,7 +6,7 @@
6 6
     <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
7 7
     <title>广告系统</title>
8 8
       <script src="//open.thunderurl.com/thunder-link.js"></script>
9
-    <script type="module" crossorigin src="./assets/index.50118c75.js"></script>
9
+    <script type="module" crossorigin src="./assets/index.e563defa.js"></script>
10 10
     <link rel="modulepreload" href="./js/@vue/@vue.e7eafc10.js">
11 11
     <link rel="modulepreload" href="./js/vue-router/vue-router.647267ed.js">
12 12
     <link rel="modulepreload" href="./js/axios/axios.27022086.js">
@@ -28,7 +28,7 @@
28 28
     <link rel="modulepreload" href="./js/echarts/echarts.5b4b2848.js">
29 29
     <link rel="stylesheet" href="./assets/nprogress.18a10d8a.css">
30 30
     <link rel="stylesheet" href="./assets/element-plus.de6aff2c.css">
31
-    <link rel="stylesheet" href="./assets/index.f1d960a4.css">
31
+    <link rel="stylesheet" href="./assets/index.1db48064.css">
32 32
   </head>
33 33
   <body>
34 34
     <div id="app"></div>

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/_dialog/_dialog.34a9672f.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/_input/_input.4ae0951e.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/_select/_select.fd940e6a.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/api/api.9e312803.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/basisMoudle/accountManage.e1786e90.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/basisMoudle/error.cae4f2c8.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/basisMoudle/home.e3f6d98d.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/basisMoudle/login.be6bddf0.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/businessMoudle/adqManage.1e207448.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/js/collectClip/index.6ca85cac.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/js/collectClip/index.884e5e3c.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/js/configArea/index.49d6c4f5.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/js/configArea/index.c077cf0c.js


dist/js/edit/edit.fe309c5f.js → dist/js/edit/edit.d526229f.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/js/gdtList/index.9b6d963e.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/js/gdtList/index.fe282530.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/index/index.9a26689a.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/index/index.a6e5dc8c.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/js/layout/index.06a6707a.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/js/layout/index.8dfe992c.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/layout/index_head.4a558654.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/js/materialBlock/materialBlock.2c0a8115.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/js/materialBlock/materialBlock.97c080df.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/js/materialLibrary/index.861cc55a.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/js/materialLibrary/index.fe53cb83.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/materialTs/materialTs.4781f705.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/menuPermission/menuList.76470dda.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/miniprogram/index.19942ac2.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/js/question-filled/question-filled.23a894b6.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/js/question-filled/question-filled.8537ddf0.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/js/radioGroup/radioGroup.43a780d8.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/js/radioGroup/radioGroup.760e6234.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/js/tableInfo/tableInfo.31a11f41.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/js/tableInfo/tableInfo.566c61d9.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/js/taskList/index.082747c9.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1
dist/js/timeScreen/timeScreen.0cfbacc4.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
dist/js/timeScreen/timeScreen.1061a3c2.js


+ 9 - 9
src/common/common.ts

@@ -147,14 +147,14 @@ export const getDay = (day:number, haveHours?:boolean)=>{
147 147
     tMonth = doHandleMonth(tMonth + 1);
148 148
     tDate = doHandleMonth(tDate);
149 149
     if (haveHours) {
150
-        if (day == 0) {
151
-            return {
152
-                'now': tYear + "-" + tMonth + "-" + tDate + ' ' + (hours < 10 ? '0' + hours : hours) + ':' + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds),
153
-                'zero': tYear + "-" + tMonth + "-" + tDate + ' ' + '00:00:00'
154
-            }
155
-        } else {
156
-            return tYear + "-" + tMonth + "-" + tDate + ' ' + hours + ':' + minutes + ':' + seconds
157
-        }
150
+      if (day == 0) {
151
+        return {
152
+          'now': tYear + "-" + tMonth + "-" + tDate + ' ' + (hours < 10 ? '0' + hours : hours) + ':' + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds),
153
+          'zero': tYear + "-" + tMonth + "-" + tDate + ' ' + '00:00:00'
154
+        }  as any;
155
+      } else {
156
+        return tYear + "-" + tMonth + "-" + tDate + ' ' + hours + ':' + minutes + ':' + seconds
157
+      }
158 158
     } else {
159 159
         return tYear + "-" + tMonth + "-" + tDate
160 160
     }
@@ -168,7 +168,7 @@ export const getDay = (day:number, haveHours?:boolean)=>{
168 168
 }
169 169
 
170 170
 export const fillZero=(s:number|string) =>{
171
-    return s < 10 ? '0' + s : s
171
+    return Number(s) < 10 ? '0' + s : s
172 172
 }
173 173
 export const formatGMT = (data:any,hasTime:boolean,isOnlyYear:boolean)=>{
174 174
     //hasTime,是否需要时间 true,要时间,否则只显示日期,isOnlyYear是否只返回年

+ 4 - 5
src/components/businessMoudle/batchGdt/previewArea/index.vue

@@ -362,9 +362,10 @@ const auditSubmitEvent = () => {
362 362
       }
363 363
     }
364 364
   }
365
-  ElMessageBox.alert('确定全部提交审核?', '提示', {
365
+  ElMessageBox.confirm('确定全部提交审核?', '提示', {
366 366
     confirmButtonText: '确认',
367
-    callback: () => {
367
+    distinguishCancelAndClose: true
368
+  }).then(() => {
368 369
       submitLoading.value = true
369 370
       adsCreate({
370 371
         campaign_list: JSON.stringify(campaign_list),
@@ -380,9 +381,7 @@ const auditSubmitEvent = () => {
380 381
         console.log(err,'提交失败')
381 382
         submitLoading.value = false
382 383
       })
383
-    }
384
-  })
385
-
384
+    }).catch(()=>{})
386 385
 }
387 386
 
388 387
 const accItemEvent = (id: number) => {

+ 130 - 103
src/components/businessMoudle/gdtList/account.vue

@@ -1,10 +1,9 @@
1 1
 <template>
2 2
   <div>
3 3
     <div class="screenBox_mini">
4
-      <Input ref="InputRef_text" title="关键词" placeholderTxt="关键词" @changeEvent="()=>init()" @clearEvent="()=>init()"/>
5
-      <TimeScreen title="时间" selectWidth="260px" :haveQuick="false" :timeIdx="1"
6
-                  ref="timeRef"
7
-                  @init="()=>init()"></TimeScreen>
4
+      <Input ref="InputRef_text" title="关键词" placeholderTxt="关键词" @changeEvent="() => init()" @clearEvent="() => init()" />
5
+      <TimeScreen title="时间" selectWidth="260px" :haveQuick="false" :timeIdx="1" ref="timeRef" @init="() => init()">
6
+      </TimeScreen>
8 7
       <!-- <span class="pointer c-theme lMar10" @click="clearEvent">清空</span> -->
9 8
       <el-button class="lMarauto" type="primary" @click="goNewPlanEvent">新建计划</el-button>
10 9
     </div>
@@ -12,51 +11,61 @@
12 11
       <div class="bMar10 flex">
13 12
         <el-button plain @click="goAdq">+ 添加账户</el-button>
14 13
         <Dropdown title="批量操作" :list="tableInfo.moreList" @close="dropdownEvent" class="rMar10"
15
-                  :disabledFlag="tableInfo.multipleSelection&&tableInfo.multipleSelection.length == 0"></Dropdown>
16
-        <div>已选 : <span>{{tableInfo.multipleSelection&&tableInfo.multipleSelection.length}}</span></div>
14
+          :disabledFlag="tableInfo.multipleSelection && tableInfo.multipleSelection.length == 0"></Dropdown>
15
+        <div v-if="tableInfo.multipleSelection && tableInfo.multipleSelection.length > 0">已选 :
16
+          <span>{{ tableInfo.multipleSelection && tableInfo.multipleSelection.length }}</span>个媒体账户</div>
17 17
 
18
-        <div  class="lMarauto">
18
+        <div class="lMarauto">
19 19
           <Indicators type="media_base" @refresh="init()"></Indicators>
20 20
         </div>
21 21
       </div>
22 22
 
23
-      <el-table v-loading="loading" ref="tableRef" :data="tableInfo.tableList"
24
-                :header-cell-style="tableHeaderStyle"
25
-                :key="tableInfo.updateKey" style="width: 100%;"
26
-                border empty-text="暂无数据"
27
-                row-key="campaign_id"
28
-                max-height="calc(100vh - 294px)">
29
-        <el-table-column type="selection" width="55" align="center" fixed="left"/>
23
+      <el-table v-loading="loading" ref="tableRef" :data="tableInfo.tableList" :header-cell-style="tableHeaderStyle"
24
+        :key="tableInfo.updateKey" style="width: 100%;" border empty-text="暂无数据" :summary-method="getSummaries"
25
+        @selection-change="handleSelectionChange" show-summary row-key="campaign_id" max-height="calc(100vh - 294px)">
26
+        <el-table-column type="selection" width="55" align="center" fixed="left" />
30 27
         <template v-for="item in tableInfo.descol">
31
-          <el-table-column :fixed="item.disabled == 1" :min-width="item.key_value != 'advertiser_status' && item.key_value != 'advertiser_nick' && item.label.length <= 4 ? '100px' : item.label.length <= 8 ? '150px' : '200px'">
28
+          <el-table-column :fixed="item.disabled == 1" :prop="item.key_value"
29
+            :min-width="item.key_value != 'advertiser_status' && item.key_value != 'advertiser_nick' && item.label.length <= 4 ? '120px' : item.label.length <= 8 ? '150px' : '200px'">
32 30
             <template #header>
33 31
               <div class="flex"
34
-                   :class="[tableInfo.sortKey == item.key_value ? 'active_css' : '',item.if_sort == 1 ? 'pointer' : '']"
35
-                   @click="item.if_sort == 1&&sortEvent(item.key_value)">
36
-                {{ item.label }}
37
-                <el-tooltip v-if="item.tooltip && item.tooltip != item.label" placement="top" effect="dark" :content="item.tooltip"><i-ep-QuestionFilled class="lMar5 c-999 f14 pointer" /></el-tooltip>
38
-                <div v-if="item.if_sort == 1">
39
-                  <div class="sortItem"><el-icon :color="tableInfo.sortKey == item.key_value ? '#3173FF' : '#a8abb2'"><i-ep-CaretBottom /></el-icon></div>
32
+                :class="[tableInfo.sortKey == item.key_value ? 'active_css' : '']">
33
+                <span :style="{color:tableInfo.sortKey == item.key_value ? '#3173FF' : ''}">{{ item.label }}</span>
34
+                <el-tooltip v-if="item.tooltip && item.tooltip != item.label" placement="top" effect="dark"
35
+                  :content="item.tooltip"><i-ep-QuestionFilled class="lMar5 c-999 f14 pointer" /></el-tooltip>
36
+                <div v-if="item.if_sort == 1" class="sortBox lMar5 pointer">
37
+                  <div class="sortItem" @click="sortEvent(item.key_value,'desc')">
38
+                    <el-icon :color="(tableInfo.sortType == 'desc' && tableInfo.sortKey == item.key_value) ? '#3173FF' : ''"><i-ep-CaretTop /></el-icon>
39
+                  </div>
40
+                  <div class="sortItem" @click="sortEvent(item.key_value,'asc')">
41
+                    <el-icon :color="(tableInfo.sortType == 'asc' && tableInfo.sortKey == item.key_value) ? '#3173FF' : ''"><i-ep-CaretBottom /></el-icon>
42
+                  </div>
40 43
                 </div>
41 44
               </div>
42 45
             </template>
43 46
             <template #default="scope">
44 47
               <!-- 账户ID -->
45 48
               <div v-if="item.key_value == 'advertiser_id'">
46
-                <span style="color: #3173FF" class="pointer">{{ scope.row[item.key_value] }}</span>
49
+                <span style="color: #3173FF" class="pointer" @click="goPlanEvent(scope.row[item.key_value])">{{ scope.row[item.key_value] }}</span>
47 50
               </div>
48 51
               <!-- 账户状态 -->
49 52
               <div v-else-if="item.key_value == 'advertiser_status'" class="flex">
50 53
                 <div class="dot"></div>
51 54
                 <span>{{ scope.row[item.key_value] }}</span>
52 55
               </div>
56
+              <!-- 日预算 -->
57
+              <div v-else-if="item.key_value == 'daily_budget'" class="flex">
58
+                <span>{{ scope.row[item.key_value] || '不限' }}</span>
59
+              </div>
53 60
               <!-- 其他 -->
54 61
               <div class="cellDiv" v-else :class="tableInfo.sortKey == item.key_value ? 'active_css' : ''">
55
-                <el-tooltip :disabled="!(scope.row[item.key_value] && scope.row[item.key_value].length >30)" effect="dark" :content="scope.row[item.key_value]+''">
62
+                <el-tooltip :disabled="!(scope.row[item.key_value] && scope.row[item.key_value].length > 30)" effect="dark"
63
+                  :content="scope.row[item.key_value] + ''">
56 64
                   <div class="clampTwo line21" style="flex: 1">
57
-                    {{ scope.row[item.key_value] || scope.row[item.key_value]==0 ?
58
-                      (item.cancleForMat ? (scope.row[item.key_value] ? scope.row[item.key_value] : '-') : scope.row[item.key_value]) : '-'}}
59
-                    <span v-if="item.hasPercent&&(scope.row[item.key_value] || scope.row[item.key_value] ==0)">%</span>
65
+                    {{ scope.row[item.key_value] || scope.row[item.key_value] == 0 ?
66
+                      (item.cancleForMat ? (scope.row[item.key_value] ? scope.row[item.key_value] : '-') :
67
+                        scope.row[item.key_value]) : '-' }}
68
+                    <span v-if="item.hasPercent && (scope.row[item.key_value] || scope.row[item.key_value] == 0)">%</span>
60 69
                   </div>
61 70
                 </el-tooltip>
62 71
               </div>
@@ -66,114 +75,94 @@
66 75
       </el-table>
67 76
 
68 77
     </div>
69
-
78
+    <!-- 批量修改日预算 -->
79
+    <ModifyDailyBudget ref="ModifyDailyBudgetRef" @confirm="tableInfo.multipleSelection = []; init()"></ModifyDailyBudget>
70 80
   </div>
71 81
 </template>
72 82
 <script setup lang="ts">
73
-import {getCurrentInstance, nextTick, onMounted, reactive, ref} from "vue";
83
+import { getCurrentInstance, nextTick, onMounted, reactive, ref } from "vue";
74 84
 import TimeScreen from '@/components/capsulationMoudle/timeScreen.vue'
75 85
 import Input from '@/components/capsulationMoudle/_input.vue'
76 86
 import Dropdown from '@/components/capsulationMoudle/_dropdown.vue'
77
-import {listTs} from "@/components/businessMoudle/gdtList/ts/list";
78
-import {Api} from "@/api/api";
79
-import {ElMessage} from "element-plus";
80
-import {batchGdt_edit, batchAccount_list, reactiveTableAndAny} from "@/api/ApiModel";
87
+import ModifyDailyBudget from './dialog/modifyDailyBudget.vue'
88
+import { listTs } from "@/components/businessMoudle/gdtList/ts/list";
89
+import { Api } from "@/api/api";
90
+import { ElMessage } from "element-plus";
91
+import { batchAccount_list, reactiveTableAndAny } from "@/api/ApiModel";
81 92
 import Indicators from './indicators/index.vue'
82 93
 import { useRouter } from "vue-router";
83 94
 const router = useRouter();
84 95
 
85 96
 const { proxy } = getCurrentInstance() as any;
86
-// 全局方法定义
87
-const NumberHandle = proxy.$NumberHandle
88 97
 
89 98
 const emit = defineEmits<{
99
+  (event: "goPlan", advertiser_id: any[]): void;
90 100
   (event: "goNewPlan"): void;
91
-  (event: "goAdvert",campaign_id:any): void;
92 101
 }>();
102
+const goPlanEvent = (advertiser_id) => {
103
+  emit('goPlan', [advertiser_id])
104
+}
93 105
 const goNewPlanEvent = () => {
94 106
   emit('goNewPlan')
95 107
 }
96 108
 
97 109
 const loading = ref<boolean>(false)
98 110
 const tableInfo = reactive<reactiveTableAndAny>({
99
-  tableList:[],
100
-  tableList_all:[],
101
-  descol:[],
102
-  summary:[],
103
-  multipleSelection:[],
104
-  updateKey:1,
105
-  chooseAll:false,
106
-  sortKey:'',
107
-  moreList:[
108
-    {value:'1',label:'启用'},
109
-    {value:'2',label:'暂停'},
110
-    {value:'3',label:'删除'},
111
+  tableList: [],
112
+  tableList_all: [],
113
+  descol: [],
114
+  summary: [],
115
+  multipleSelection: [],
116
+  updateKey: 1,
117
+  chooseAll: false,
118
+  sortKey: '',
119
+  moreList: [
120
+    { value: '1', label: '修改日预算' },
111 121
   ],
112
-  currentPage:1,
113
-  pageSize:20,
114
-  total:0,
115
-  totalPages:0,//共多少页
122
+  currentPage: 1,
123
+  pageSize: 20,
124
+  total: 0,
125
+  totalPages: 0,//共多少页
126
+  sortType: 'desc'
116 127
 })
117 128
 
129
+const ModifyDailyBudgetRef = ref()
118 130
 
119
-
120
-// 启用 暂停 删除
121
-const batchPlanApi = async (arr?:any,val?:any) => {
122
-  const paramsModel = reactive<batchGdt_edit>({
123
-    campaign_infos:JSON.stringify(arr),
124
-    flag:val?val:0
125
-  })
126
-  let res:any = await proxy.$http.post(Api.batchGdt_plan_batch_edit,paramsModel)
127
-  ElMessage.info(res.errMsg)
128
-  if(res&&res.errNo=='0'){
129
-    init()
130
-    tableInfo.multipleSelection = []
131
-  }else{
132
-    loading.value = false
133
-  }
134
-}
131
+/**点击批量操作 */
135 132
 const dropdownEvent = (val: string | number | object) => {
136
-  loading.value = true
137
-  let arr:any = []
138
-  tableInfo.multipleSelection.forEach(item=>{
139
-    arr.push({
140
-      account_id:item.account_id,
141
-      campaign_id:item.campaign_id
142
-    })
143
-  })
144
-  batchPlanApi(arr,val)
133
+  if(val == 1) {//修改日预算
134
+    ModifyDailyBudgetRef.value?.switchShow(true, tableInfo.multipleSelection)
135
+  }
145 136
 }
146 137
 
147 138
 
148 139
 //排序
149
-const sortEvent = (row:any) => {
150
-  if(row != tableInfo.sortKey){
151
-    tableInfo.sortKey = row
152
-    init()
153
-  }
154
-  console.log('tableInfo.sortKey',tableInfo.sortKey)
140
+const sortEvent = (row: any, order: string) => {
141
+  tableInfo.sortType = order;
142
+  tableInfo.sortKey = row
143
+  init()
155 144
 }
156 145
 
157 146
 //列表
158 147
 const init = async () => {
159 148
   loading.value = true
160 149
   let params = {
161
-    keyword:InputRef_text.value!.value,
162
-    st_date:timeRef.value!.dateVal&&timeRef.value!.dateVal[0],
163
-    en_date:timeRef.value!.dateVal&&timeRef.value!.dateVal[1],
150
+    keyword: InputRef_text.value!.value,
151
+    st_date: timeRef.value!.dateVal && timeRef.value!.dateVal[0],
152
+    en_date: timeRef.value!.dateVal && timeRef.value!.dateVal[1],
164 153
   }
165
-  if(tableInfo.sortKey){
154
+  if (tableInfo.sortKey) {
166 155
     params['field'] = tableInfo.sortKey
167
-    params['order'] = 'desc'
156
+    params['order'] = tableInfo.sortType
168 157
   }
169 158
   const paramsModel = reactive<batchAccount_list>(params)
170
-  let res:any = await proxy.$http.get(Api.batchGdt_accountList_list,paramsModel)
159
+  let res: any = await proxy.$http.get(Api.batchGdt_accountList_list, paramsModel)
171 160
   loading.value = false
172
-  if(res&&res.errNo=='0'){
161
+  if (res && res.errNo == '0') {
173 162
     tableInfo.summary = res.rst.summary;
174 163
     tableInfo.descol = res.rst.explain;
175 164
     tableInfo.tableList = res.rst.list;
176
-  }else{
165
+  } else {
177 166
     ElMessage.error(res.errMsg)
178 167
   }
179 168
 }
@@ -181,6 +170,27 @@ const init = async () => {
181 170
 const goAdq = () => {
182 171
   router.push({ path: '/adqManage' })
183 172
 }
173
+/**表格多选 */
174
+const handleSelectionChange = (val) => {
175
+  tableInfo.multipleSelection = val
176
+}
177
+/**合计计算 */
178
+const getSummaries = (param) => {
179
+  const { columns, data } = param
180
+  const sums: string[] = []
181
+  columns.forEach((column, index) => {
182
+    if (index === 0) {
183
+      sums[index] = ''
184
+      return
185
+    }
186
+    if (index === 1) {
187
+      sums[index] = '合计'
188
+      return
189
+    }
190
+    sums[index] = tableInfo.summary[column.property]
191
+  })
192
+  return sums
193
+}
184 194
 
185 195
 const {
186 196
   timeRef,
@@ -188,49 +198,66 @@ const {
188 198
   tableHeaderStyle,
189 199
 } = listTs()
190 200
 
191
-onMounted(()=>{
192
-  nextTick(async ()=>{
201
+onMounted(() => {
202
+  nextTick(async () => {
193 203
     await init()
194 204
   })
195 205
 })
196 206
 </script>
197 207
 <style lang="scss" scoped>
198
-.dot{
208
+@import "./index.scss";
209
+.dot {
199 210
   width: 6px;
200 211
   height: 6px;
201 212
   border-radius: 50%;
202 213
   background-color: rgb(35, 194, 63);
203 214
   margin-right: 4px;
204 215
 }
216
+
217
+:deep(.el-table__body-wrapper) {
218
+  order: 1;
219
+}
220
+:deep(.el-table__footer-wrapper){
221
+  border-bottom: var(--el-table-border);
222
+  border-top: none;
223
+}
224
+:deep(.el-table__footer-wrapper tbody td.el-table__cell){
225
+  background-color: #fafafa;
226
+}
205 227
 .el-table th div.cell {
206 228
   white-space: nowrap;
207 229
   text-overflow: ellipsis;
208 230
   overflow: hidden;
209
-  max-width: 600px; /* 设置最大宽度,根据需要调整 */
231
+  max-width: 600px;
232
+  /* 设置最大宽度,根据需要调整 */
210 233
 }
211
-.campaignName{
212
-  .icon{
234
+
235
+.campaignName {
236
+  .icon {
213 237
     color: #3173FF;
214 238
     opacity: 0;
215 239
   }
216
-  &:hover{
217
-    .icon{
240
+
241
+  &:hover {
242
+    .icon {
218 243
       opacity: 1;
219 244
     }
220 245
   }
221 246
 }
222
-.checkBoxSelf{
247
+
248
+.checkBoxSelf {
223 249
   width: 13px;
224 250
   height: 13px;
225 251
   border: 1px solid #d9d9d9;
226 252
   border-radius: 2px;
227
-  &:hover{
253
+
254
+  &:hover {
228 255
     cursor: pointer;
229 256
     border: 1px solid #3173FF;
230 257
   }
231
-  &.active{
258
+
259
+  &.active {
232 260
     border: 1px solid #3173FF;
233 261
     background-color: #3173FF;
234 262
   }
235
-}
236
-</style>
263
+}</style>

+ 470 - 0
src/components/businessMoudle/gdtList/dialog/modifyDailyBudget.vue

@@ -0,0 +1,470 @@
1
+<template>
2
+  <Dialog :dialogVisible="dialogShow" @confirm="confirmEvent" @close="closeEvent" :cancleText="pageInfo.cancleText"
3
+    :closeOnModal="false" :hasBtn="pageInfo.hasBtn" :destroyOnCloseFlag="true" width="800px" dialog-title="批量修改日预算">
4
+    <template v-slot:content>
5
+      <div class="dialogBox" v-if="pageInfo.schedule == 1">
6
+        <div class="batch-title">已选{{ pageInfo.multipleSelection.length }}个可操作媒体账户</div>
7
+        <div class="flex bMar15">
8
+          <span class="form-block-item-title">修改规则</span>
9
+          <el-radio-group v-model="pageInfo.modifyRuleValue" size="default">
10
+            <template v-for="item in modifyRule">
11
+              <el-radio-button :label="item.value">{{ item.label }}</el-radio-button>
12
+            </template>
13
+          </el-radio-group>
14
+        </div>
15
+        <div class="flex_start bMar15">
16
+          <span class="form-block-item-title">预算</span>
17
+          <div class="flex_start">
18
+            <el-select v-model="pageInfo.selectValue" style="width: 115px" @change="selectChange">
19
+              <el-option :label="item.label" :value="item.value" v-for="item in selectList" />
20
+            </el-select>
21
+            <div>
22
+              <el-input v-model="pageInfo.inputValue" :class="pageInfo.mainInputError ? 'inputError' : ''"
23
+                v-if="pageInfo.selectValue != 6" style="width:260px" @input="onChangeInput('mainInput')">
24
+                <template #suffix>
25
+                  <span>{{ selectList.filter((v) => v.value == pageInfo.selectValue)[0]?.unit }}</span>
26
+                </template>
27
+              </el-input>
28
+              <div class="error" v-if="pageInfo.mainInputError">{{ pageInfo.mainInputErrHint }}</div>
29
+            </div>
30
+            <el-tooltip placement="top" content="选中广告主账户预算包含不限,不可以设置此内容"
31
+              :disabled="!(pageInfo.selectValue == 1 || pageInfo.selectValue == 6 ? false : pageInfo.isNoLimit)"
32
+              effect="light">
33
+              <span>
34
+                <el-button type="primary" class="lMar10"
35
+                  :disabled="pageInfo.selectValue == 1 || pageInfo.selectValue == 6 ? false : pageInfo.isNoLimit"
36
+                  @click="application">应 用</el-button>
37
+              </span>
38
+            </el-tooltip>
39
+          </div>
40
+        </div>
41
+        <!-- 更改预算 table -->
42
+        <el-table :data="pageInfo.multipleSelection" :header-cell-style="tableHeaderStyle" border style="width: 100%">
43
+          <el-table-column prop="advertiser_id" label="广告主账户" width="180" />
44
+          <el-table-column label="日预算" width="180" align="right">
45
+            <template #default="scope">
46
+              {{ scope.row.daily_budget || '不限' }}
47
+            </template>
48
+          </el-table-column>
49
+          <el-table-column label="分别修改日预算">
50
+            <template #default="scope">
51
+              <el-input v-model="scope.row.modifyDailyBudget"
52
+                :class="scope.row.inputError != '' && scope.row.inputError ? 'inputError' : ''" placeholder="请输入日预算"
53
+                style="width:260px" @input="onChangeInput('tableInput', scope.$index)"></el-input>
54
+              <div class="error" v-if="scope.row.inputError">{{ scope.row.inputError }}</div>
55
+            </template>
56
+          </el-table-column>
57
+        </el-table>
58
+      </div>
59
+      <!-- 确定修改操作 -->
60
+      <div class="dialogBox" v-if="pageInfo.schedule == 2 || pageInfo.schedule == 3">
61
+        <div class="flex bMar15" v-if="pageInfo.schedule == 2">
62
+          <el-icon color="#ff9b48">
63
+            <WarningFilled />
64
+          </el-icon>
65
+          <p class="f13 c-555 lMar5">确定要执行以下修改操作吗?此操作不可逆!</p>
66
+        </div>
67
+        <div class="flex bMar15" v-if="pageInfo.schedule == 3">
68
+          <el-icon color="#00b697">
69
+            <CircleCheckFilled />
70
+          </el-icon>
71
+          <p class="f13 c-555 lMar5">修改完成,共{{ pageInfo.successLength }}项修改成功</p>
72
+        </div>
73
+        <el-table :data="pageInfo.multipleSelection" :header-cell-style="tableHeaderStyle" border style="width: 100%">
74
+          <el-table-column prop="advertiser_id" label="广告主账户" />
75
+          <el-table-column label="日预算">
76
+            <template #default="scope">
77
+              <div class="preview-modified">
78
+                <div class="budget">{{ scope.row.daily_budget || '不限' }}</div>
79
+                <div class="modified-info">
80
+                  <div class="status">
81
+                    <div class="text">{{ scope.row.modifyDailyBudget && scope.row.modifyDailyBudget != '' ? '修改为' :
82
+                      '(未修改)' }}</div>
83
+                  </div>
84
+                  <div class="modified-budget">{{ scope.row.modifyDailyBudget }}</div>
85
+                </div>
86
+              </div>
87
+            </template>
88
+          </el-table-column>
89
+          <el-table-column label="修改结果" v-if="pageInfo.schedule == 3" width="180px">
90
+            <template #default="scope">
91
+              <div class="flex" v-if="scope.row.state != 2 && (scope.row.modifyDailyBudget && scope.row.modifyDailyBudget != '')">
92
+                <el-icon color="#00b697" class="rMar5">
93
+                  <CircleCheckFilled />
94
+                </el-icon>
95
+                <span>修改成功</span>
96
+              </div>
97
+              <div class="flex" v-if="scope.row.state == 2">
98
+                <el-icon color="#fb1919" class="rMar5">
99
+                  <CircleCloseFilled />
100
+                </el-icon>
101
+                <span>失败:{{ scope.row.err_msg }}</span>
102
+              </div>
103
+            </template>
104
+          </el-table-column>
105
+        </el-table>
106
+      </div>
107
+    </template>
108
+  </Dialog>
109
+</template>
110
+<script setup lang="ts">
111
+import Dialog from '@/components/capsulationMoudle/_dialog.vue'
112
+import { nextTick, onMounted, reactive, ref } from "vue";
113
+import { ElLoading, ElMessage } from "element-plus";
114
+import _ from 'lodash';
115
+import http from '@/http/http'
116
+import { getDay } from '@/common/common';
117
+
118
+const emit = defineEmits<{
119
+  (event: "confirm", val: string): void;
120
+}>();
121
+
122
+const props = withDefaults(defineProps<{
123
+  title?: string,
124
+}>(), {
125
+  title: '提示',
126
+})
127
+
128
+const modifyRule = [
129
+  { label: '立即生效', value: 1 },
130
+  { label: '次日0时生效', value: 2 }
131
+]
132
+const selectList = [
133
+  { label: '修改为', value: 1, unit: '元' },
134
+  { label: '提高', value: 2, unit: '元' },
135
+  { label: '降低', value: 3, unit: '元' },
136
+  { label: '按 % 提高', value: 4, unit: '%' },
137
+  { label: '按 % 降低', value: 5, unit: '%' },
138
+  { label: '不限', value: 6, unit: '' },
139
+]
140
+const pageInfo: any = reactive({})
141
+const nameRef = ref<{ value: any }>()
142
+const confirmEvent = async () => {
143
+  if (pageInfo.schedule == 1) {
144
+    let isErrItem = false;
145
+    let isEmpty = false
146
+    pageInfo.multipleSelection.forEach((item) => {
147
+      if (item.inputError && item.inputError != '') {
148
+        isErrItem = true
149
+      }
150
+      if (item.modifyDailyBudget && item.modifyDailyBudget != '') {
151
+        isEmpty = true;
152
+      }
153
+    })
154
+    if (isErrItem) {
155
+      ElMessage.error('存在不合法日预算,请重新填写不合法的日预算')
156
+      return
157
+    }
158
+    if (!isEmpty) {
159
+      ElMessage.error(' 请修改至少一个广告主账户的日预算!')
160
+      return
161
+    }
162
+    pageInfo.schedule = 2;
163
+    pageInfo.cancleText = '返回编辑'
164
+    return;
165
+  }
166
+  if (pageInfo.schedule == 2) {
167
+    const loading = ElLoading.service({
168
+      lock: true,
169
+      text: '修改操作进行中...',
170
+      background: 'rgba(255, 255, 255, 0.7)',
171
+    })
172
+    let str_val: any[] = []
173
+    pageInfo.multipleSelection.forEach((item) => {
174
+      if (item.modifyDailyBudget && item.modifyDailyBudget != '') {
175
+        str_val.push({
176
+          "account_id": item.advertiser_id,
177
+          "daily_budget": item.modifyDailyBudget == '不限' ? 0 : item.modifyDailyBudget
178
+        })
179
+      }
180
+    })
181
+
182
+    let params = {
183
+      'str_val': JSON.stringify(str_val)
184
+    }
185
+    if (pageInfo.modifyRuleValue == 1) {
186
+      params['start_time'] = getDay(0, true).now
187
+    }
188
+    if (pageInfo.modifyRuleValue == 2) {
189
+      params['start_time'] = getDay(1, false) + ' 00:00:00'
190
+    }
191
+    const res: any = await http.post('/api/ad/multiUpDailyBudget', params)
192
+    loading.close()
193
+    if (res.errNo == 0) {
194
+      ElMessage.success('修改成功')
195
+      if (res.rst.record_id) {
196
+        getMultiUpDailyBudgetRes(res.rst.record_id, str_val)
197
+      }
198
+    } else {
199
+      ElMessage.error(res.errMsg)
200
+    }
201
+    return
202
+  }
203
+}
204
+/**获取批量修改日预算结果 */
205
+const getMultiUpDailyBudgetRes = async (record_id, str_val) => {
206
+  const loading = ElLoading.service({
207
+    lock: true,
208
+    text: '结果获取中...',
209
+    background: 'rgba(255, 255, 255, 0.7)',
210
+  })
211
+  const res: any = await http.get('/api/ad/multiUpDailyBudgetRes', { record_id })
212
+  loading.close()
213
+  if (res.errNo == 0) {
214
+    pageInfo.schedule = 3;
215
+    pageInfo.cancleText = '关闭'
216
+    pageInfo.hasBtn = true;
217
+    if (Array.isArray(res.rst.result)) {
218
+      pageInfo.multipleSelection.forEach((item) => {
219
+        let arr = str_val.filter((v) => v.account_id == item.advertiser_id)
220
+        if (arr.length > 0) {
221
+          let brr = res.rst.result.filter((v) => { v.account_id == arr[0].account_id })
222
+          if (brr.length > 0) {
223
+            item['state'] = brr[0].state
224
+            item['err_msg'] = brr[0].err_msg
225
+          }
226
+        }
227
+      })
228
+      pageInfo.successLength = str_val.length - res.rst.result?.length
229
+    } else {
230
+      pageInfo.successLength = str_val.length
231
+    }
232
+  } else {
233
+    ElMessage.error(res.errMsg)
234
+  }
235
+}
236
+const closeEvent = () => {
237
+  if (pageInfo.schedule == 1) {
238
+    dialogShow.value = false
239
+  }
240
+  if (pageInfo.schedule == 2) {
241
+    pageInfo.schedule = 1;
242
+    pageInfo.cancleText = '取消'
243
+  }
244
+  if (pageInfo.schedule == 3) {
245
+    dialogShow.value = false
246
+    emit('confirm', '')
247
+  }
248
+}
249
+/**点击应用 */
250
+const application = () => {
251
+  if ((pageInfo.selectValue != 1 && pageInfo.selectValue != 6 && pageInfo.isNoLimit) || pageInfo.mainInputError) {
252
+    ElMessage.error('预算批量规则设置有误')
253
+    return
254
+  }
255
+  if (pageInfo.selectValue != 6 && pageInfo.inputValue == '') {
256
+    pageInfo.mainInputErrHint = '请输入账户日预算,仅支持正整数'
257
+    pageInfo.mainInputError = true;
258
+    ElMessage.error('预算批量规则设置有误')
259
+    return
260
+  }
261
+  if (pageInfo.selectValue == 1) {//修改为
262
+    pageInfo.multipleSelection.forEach((item) => {
263
+      item.modifyDailyBudget = pageInfo.inputValue
264
+    })
265
+  }
266
+  if (pageInfo.selectValue == 2) {//提高
267
+    pageInfo.multipleSelection.forEach((item) => {
268
+      item.modifyDailyBudget = parseFloat((Number(item.daily_budget) + Number(pageInfo.inputValue)).toFixed(2).toString())
269
+    })
270
+  }
271
+  if (pageInfo.selectValue == 3) {//降低
272
+    pageInfo.multipleSelection.forEach((item) => {
273
+      item.modifyDailyBudget = parseFloat((Number(item.daily_budget) - Number(pageInfo.inputValue)).toFixed(2).toString())
274
+    })
275
+  }
276
+  if (pageInfo.selectValue == 4) {//按 % 提高
277
+    pageInfo.multipleSelection.forEach((item) => {
278
+      item.modifyDailyBudget = parseFloat((Number(item.daily_budget) * (Number(pageInfo.inputValue) / 100 + 1)).toFixed(2).toString())
279
+    })
280
+  }
281
+  if (pageInfo.selectValue == 5) {//按 % 降低
282
+    pageInfo.multipleSelection.forEach((item) => {
283
+      item.modifyDailyBudget = parseFloat((Number(item.daily_budget) * (1 - Number(pageInfo.inputValue) / 100)).toFixed(2).toString())
284
+    })
285
+  }
286
+  if (pageInfo.selectValue == 6) {//不限
287
+    pageInfo.multipleSelection.forEach((item) => {
288
+      item.modifyDailyBudget = '不限'
289
+    })
290
+  }
291
+  pageInfo.multipleSelection.forEach((item) => {
292
+    item.inputError = ''
293
+    if (item.modifyDailyBudget == '不限') return
294
+    if (!isPositiveInteger(item.modifyDailyBudget)) {
295
+      item.inputError = '请输入账户日预算,仅支持正整数'
296
+      return
297
+    }
298
+    let isDetermine = isLimit(50, 40000000, item.modifyDailyBudget)
299
+    if (!isDetermine.flag) {
300
+      item.inputError = isDetermine.err
301
+      return
302
+    }
303
+  })
304
+}
305
+// 切换显隐
306
+const dialogShow = ref<boolean>(false)
307
+const switchShow = (val: boolean, multipleSelection_c: any[]) => {
308
+  dialogShow.value = val
309
+  if (val) {
310
+    const initObj = {
311
+      hasBtn: false,
312
+      cancleText: '取消',
313
+      schedule: 1,
314
+      successLength: 0,//修改成功条数
315
+      multipleSelection: [],
316
+      oldMultipleSelection: [],
317
+      isNoLimit: false,//所选账户是否包含不限
318
+      modifyRuleValue: 1,//规则
319
+      inputValue: '',
320
+      mainInputError: false,
321
+      mainInputErrHint: '',
322
+      selectValue: 1,
323
+    }
324
+    for (let key in initObj) {//所有字段 清空重来
325
+      pageInfo[key] = _.cloneDeep(initObj[key])
326
+    }
327
+    pageInfo.oldMultipleSelection = multipleSelection_c;
328
+    pageInfo.multipleSelection = _.cloneDeep(multipleSelection_c)
329
+    pageInfo.multipleSelection.forEach((item) => {
330
+      item['modifyDailyBudget'] = ''
331
+      if (item.daily_budget == 0) {
332
+        pageInfo.isNoLimit = true
333
+      }
334
+    });
335
+  }
336
+}
337
+const selectChange = () => {
338
+  pageInfo.inputValue = ''
339
+  pageInfo.mainInputError = false;
340
+  pageInfo.mainInputErrHint = ''
341
+}
342
+/**input change */
343
+const onChangeInput = (type, index?) => {
344
+  if (type == 'mainInput') {
345
+    pageInfo.mainInputError = false;
346
+    if (pageInfo.selectValue == 1 || pageInfo.selectValue == 2 || pageInfo.selectValue == 3) {
347
+      if (!isPositiveInteger(pageInfo.inputValue)) {
348
+        pageInfo.mainInputError = true;
349
+        pageInfo.mainInputErrHint = '请输入账户日预算,仅支持正整数'
350
+        return
351
+      }
352
+      let isDetermine = isLimit(1, 40000000, pageInfo.inputValue)
353
+      if (!isDetermine.flag) {
354
+        pageInfo.mainInputError = true;
355
+        pageInfo.mainInputErrHint = isDetermine.err
356
+        return
357
+      }
358
+    } else {
359
+      if (!isPositiveNumberWithTwoDecimalPlaces(pageInfo.inputValue)) {
360
+        pageInfo.mainInputError = true;
361
+        pageInfo.mainInputErrHint = '请输入预算调整比例,最多支持小数点后两位'
362
+        return
363
+      }
364
+    }
365
+  }
366
+  if (type == 'tableInput') {
367
+    let item = pageInfo.multipleSelection[index]
368
+    item.inputError = ''
369
+    if (item.modifyDailyBudget == '') return;
370
+    if (item.modifyDailyBudget != '不限') {
371
+      if (!isPositiveInteger(item.modifyDailyBudget)) {
372
+        item.inputError = '请输入账户日预算,仅支持正整数'
373
+        return
374
+      }
375
+      let isDetermine = isLimit(50, 40000000, item.modifyDailyBudget)
376
+      if (!isDetermine.flag) {
377
+        item.inputError = isDetermine.err
378
+        return
379
+      }
380
+    }
381
+  }
382
+}
383
+/**使用正则表达式检查是否为正数且最多两位小数 */
384
+const isPositiveNumberWithTwoDecimalPlaces = (value) => {
385
+  const regex = /^[1-9]\d*(\.\d{1,2})?$|^0\.\d{1,2}$/;
386
+  return regex.test(value.toString());
387
+}
388
+/**判断是否是正整数 */
389
+const isPositiveInteger = (value) => {
390
+  return /^[1-9]\d*$/.test(value.toString());
391
+}
392
+/**判断限额 */
393
+const isLimit = (min: number, max: number, value: number) => {
394
+  if (value < min || value > max) {
395
+    return {
396
+      flag: false,
397
+      err: `日预算范围限制:${min}-${max}`
398
+    }
399
+  } else {
400
+    return {
401
+      flag: true
402
+    }
403
+  }
404
+}
405
+const tableHeaderStyle = ({ row, column, rowIndex, columnIndex }: never) => {
406
+  return {
407
+    backgroundColor: '#FAFAFA',
408
+    color: '#161E46',
409
+    height: '44px'
410
+  }
411
+}
412
+// 父组件共享值
413
+defineExpose({
414
+  switchShow,
415
+});
416
+onMounted(() => {
417
+  nextTick(() => {
418
+
419
+  })
420
+})
421
+</script>
422
+<style lang="scss" scoped>
423
+@import "@/assets/style/batchDialogGdt.scss";
424
+
425
+.batch-title {
426
+  position: relative;
427
+  margin-bottom: 25px;
428
+  font-size: 14px;
429
+  color: #333330;
430
+}
431
+
432
+.error {
433
+  color: #f56c6c;
434
+  line-height: 20px;
435
+  font-size: 12px;
436
+}
437
+
438
+.inputError {
439
+  --el-input-hover-border-color: #f56c6c;
440
+  --el-input-focus-border-color: #f56c6c;
441
+  --el-input-border-color: #f56c6c;
442
+}
443
+
444
+.preview-modified {
445
+  display: flex;
446
+  align-items: center;
447
+
448
+  .budget {
449
+    width: 100px;
450
+    margin-right: 20px;
451
+  }
452
+
453
+  .modified-info {
454
+    display: flex;
455
+    align-items: center;
456
+  }
457
+
458
+  .status {
459
+    width: 70px;
460
+  }
461
+
462
+  .text {
463
+    color: #888;
464
+  }
465
+
466
+  .modified-budget {
467
+    margin-left: 20px;
468
+  }
469
+}
470
+</style>

+ 13 - 2
src/components/businessMoudle/gdtList/index.vue

@@ -9,8 +9,8 @@
9 9
   <!-- 表格组件 -->
10 10
   <keep-alive>
11 11
     <div>
12
-      <account v-show="typeAc == 'account'"  @goAdvert="goAdvert"  @goNewPlan="goNewPlan"></account>
13
-      <plan v-show="typeAc == 'plan'"  @goAdvert="goAdvert"  @goNewPlan="goNewPlan"></plan>
12
+      <account v-show="typeAc == 'account'"  @goPlan="goPlan" @goNewPlan="goNewPlan"></account>
13
+      <plan v-show="typeAc == 'plan'"  ref="planRef" @goAdvert="goAdvert"  @goNewPlan="goNewPlan"></plan>
14 14
       <advert v-show="typeAc == 'advert'" ref="advertRef"
15 15
               @goNewPlan="goNewPlan"
16 16
               :campaign_id="pageInfo.campaign_id"></advert>
@@ -70,6 +70,17 @@ const goAdvert = (campaign_id:any) => {
70 70
   })
71 71
 }
72 72
 
73
+const planRef = ref<{initAll:(advertiser_id)=>void}>()
74
+//去推广计划
75
+const goPlan = (advertiser_id) => {
76
+  let arr:any = typeList.list.filter(n=>{
77
+    return n.key == 'plan'
78
+  })
79
+  switchTypeItem(arr[0])
80
+  nextTick(()=>{
81
+    planRef.value!.initAll(advertiser_id)
82
+  })
83
+}
73 84
 //新建计划
74 85
 const goNewPlan = () => {
75 86
   let newPage:any = router.resolve({

+ 14 - 0
src/components/businessMoudle/gdtList/plan.vue

@@ -385,6 +385,20 @@ const {
385 385
   customIndEvent
386 386
 } = listTs()
387 387
 
388
+const initAll = (account_ids) => {
389
+  if(account_ids) {
390
+    acRef.value!.value = account_ids
391
+  }
392
+  nextTick(async ()=>{
393
+    await init_acList()
394
+    await init()
395
+  })
396
+}
397
+
398
+defineExpose({
399
+  initAll
400
+})
401
+
388 402
 onMounted(()=>{
389 403
   nextTick(async ()=>{
390 404
     await init_acList()