zhuxinbo před 5 roky
rodič
revize
fe6c88f839

+ 4 - 4
src/views/modules/Statistics/caicaicai/dayStatistics.vue

@@ -157,7 +157,7 @@ import timeCheck from '../components/timeCheck'
 import Treeselect from '../components/Treeselect.vue'
 import { mapGetters } from 'vuex'
 import { JeecgListMixin } from '@/mixins/ipagination'
-
+import qs from 'qs'
 var length = 0
 var active = 1
 const columns = [
@@ -366,12 +366,12 @@ export default {
     exportExcel() {
       var params = {}
       params.projectId = this.projectId
-      params.disCount = this.discount
-      params.statDate = this.statDate.format('YYYY-MM-DD')
+      params.systemType = this.systemType == '1' ? '' : this.systemType
+      var param = qs.stringify(params)
       var name = this.dataElse.filter(item => {
         return item.projectId == this.projectId
       })[0].projectName
-      downFilePost('/ctop/yiche/report/exportDailyReport', params).then(res => {
+      downFilePost('/ctop/advertiser/exportXxlDailyReport', param).then(res => {
         let blob = new Blob([res], {
           type: 'application/vnd.ms-excel'
         })

+ 99 - 34
src/views/modules/kuaishouapp/account/advertisingGroup.vue

@@ -125,7 +125,7 @@
         修改条数:{{ visibleData.totalCount }}       失败条数:{{ visibleData.failCount }}
         <div style="margin-top:20px">
           <p v-for="(item, index) of visibleData.failInfo" :key="index">
-            <span>名称:{{ item.unitName }}</span><br />
+            <span>名称:{{ item.campaignName }}</span><br />
             <span>错误信息:{{ item.message }}</span>
           </p>
         </div>
@@ -179,11 +179,16 @@
           <a-radio-group buttonStyle="solid" v-decorator="[
           'createType',
            {
-            initialValue:'1' } ]">
+            initialValue:'1' } ]" @change="createUnitName">
             <a-radio-button value="1">系统生成</a-radio-button>
             <a-radio-button value="2">自定义</a-radio-button>
           </a-radio-group>
         </a-form-item>
+        <a-form-item label="广告组名称输入" :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }"
+          :wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }"
+          v-if="getData('createCount')>1&&getData('createType')=='2'">
+          <a-input v-for="(item,key) in unitNameList" :key="key" v-model="item.unitName" />
+        </a-form-item>
       </a-form>
       <template slot="footer">
         <a-button key="submit" type="primary" @click="handleSubmitCopy" :loading='loading'>
@@ -426,6 +431,7 @@
         campaignType: '2',
         campaignId: localStorage.getItem('advertisingGroupKey'),
         createCount: 1,
+        unitNameList: [],
         form: this.$form.createForm(this),
         campaignList: [],
         showEdit: false,
@@ -579,6 +585,14 @@
       //     }
       //   }
       // },
+      createUnitName() {
+        this.unitNameList = []
+        for (let i = 0; i < this.getData('createCount'); i++) {
+          this.unitNameList.push({
+            unitName: ""
+          })
+        }
+      },
       getData(className) {
         return this.form.getFieldValue(className)
       },
@@ -678,7 +692,7 @@
         }
       },
       editDetail(item) {
-        this.$refs.editGroup.handleOk(item)
+        this.$refs.editGroup.handleOk(item, 'edit')
       },
       copyDetail(item) {
         this.visibleCopy = true
@@ -804,20 +818,27 @@
           this.visibleEditAll = true
         } else if (this.allType == '5') {
           this.getCampaignList()
+          this.campaignId = localStorage.getItem('advertisingGroupKey')
           this.visibleBatch = true
         } else {
+          
           var params = {}
           params.accountId = localStorage.getItem('accountId')
           params.putStatus = this.allType
           params.userId = this.userInfo().id
           params.unitIds = this.selectedRowKeysValue
           postAction('/kuaishou/batch/batchUpdateUnitStatus', params).then(res => {
-            console.log(res)
-            this.getDataList(localStorage.getItem('advertisingGroupKey'))
-            this.$message.success('批量修改成功')
-            this.allType = '1'
-            this.selectedRowKeysValue = []
-            this.selectedRowKeys = []
+            if (res.result.failCount > 0) {
+              this.visible = true
+              this.visibleData = res.result
+            } else {
+              this.getDataList(localStorage.getItem('advertisingGroupKey'))
+              this.$message.success('批量修改成功')
+              this.allType = '1'
+              this.selectedRowKeysValue = []
+              this.selectedRowKeys = []
+            }
+
           })
         }
       },
@@ -971,6 +992,7 @@
                 showSwich: v.putStatus == 1 ? true : false
               }
             })
+            this.ipagination.total = res.result.total
           }
         })
       },
@@ -1014,35 +1036,78 @@
         })
       },
       handleSubmitCopy(e) {
-        this.loading = true
+        if (this.getData('createCount') == 1) {
+          this.visibleCopy = false
+          this.$refs.editGroup.handleOk(this.copyData, 'copy', this.getData('campaignId'))
+          // postAction('/kuaishou/batch/copyUnit', params).then(res => {})
+        } else if (this.getData('createCount') > 1) {
+          this.loading = true
+          //  v-if="getData('createCount')>1&&getData('createType')=='2'">
+          //           <a-input v-for="(item,key) in unitNameList"
 
-        var groupArr = this.allForm.group.map(item => {
-          return {
-            ...item,
-            cpaBid: item.cpaBid != '' ? item.cpaBid * 1000 : '',
-            bid: item.bid != '' ? item.bid * 1000 : '',
-            deepConversionBid: item.deepConversionBid != '' ? item.deepConversionBid * 1000 : '',
-            ocpxActionType: item.bidType,
-            bidType: item.bidType == '1' ? '2' : '6'
+          if (this.getData('createType') == '1') {
+            var params = {
+              // ...this.copyData,
+              // groupArr: groupArr,
+              type: 'copy',
+              unitId: this.copyData.unitId,
+              copyToCampaignId: this.getData('campaignId'),
+              createCount: this.getData('createCount'),
+              createType: this.getData('createType'),
+              accountId: this.copyData.accountId
+            }
+            postAction('/kuaishou/batch/copyUnit', params).then(res => {
+              if (res.success) {
+                this.visibleCopy = false
+                this.loading = false
+              }
+            })
+          } else if (this.getData('createType') == '2') {
+            var params = {
+              // ...this.copyData,
+              // groupArr: groupArr,
+              type: 'copy',
+              unitId: this.copyData.unitId,
+              copyToCampaignId: this.getData('campaignId'),
+              createCount: this.getData('createCount'),
+              createType: this.getData('createType'),
+              accountId: this.copyData.accountId,
+              unitNames: this.unitNameList.map(item => {
+                return item.unitName
+              })
+            }
+            postAction('/kuaishou/batch/copyUnit', params).then(res => {
+              if (res.success) {
+                this.visibleCopy = false
+                this.loading = false
+              }
+            })
           }
-        })
-        var params = {
-          ...this.copyData,
-          groupArr: groupArr,
-          type: 'copy',
-          copyUnitId: this.copyData.unitId,
-          copyToCampaignId: this.campaignId
+          //   var groupArr = this.allForm.group.map(item => {
+          //     return {
+          //       ...item,
+          //       cpaBid: item.cpaBid != '' ? item.cpaBid * 1000 : '',
+          //       bid: item.bid != '' ? item.bid * 1000 : '',
+          //       deepConversionBid: item.deepConversionBid != '' ? item.deepConversionBid * 1000 : '',
+          //       ocpxActionType: item.bidType,
+          //       bidType: item.bidType == '1' ? '2' : '6'
+          //     }
+          //   })
+
+
+          // postAction('/kuaishou/batch/createUnit', params).then(res => {
+          //   if (res.success) {
+          //     this.loading = false
+          //     this.visibleCopy = false
+          //     this.form.resetFields()
+          //     this.getDataList(localStorage.getItem('advertisingGroupKey'))
+
+          //     this.allForm.group = []
+          //   }
+          // })
         }
-        postAction('/kuaishou/batch/createUnit', params).then(res => {
-          if (res.success) {
-            this.loading = false
-            this.visibleCopy = false
-            this.form.resetFields()
-            this.getDataList(localStorage.getItem('advertisingGroupKey'))
 
-            this.allForm.group = []
-          }
-        })
+
       },
       handleSubmit(e) {
         //   this.$refs.population.handleSubmit()

+ 57 - 29
src/views/modules/kuaishouapp/account/editGroup.vue

@@ -456,8 +456,11 @@ export default {
         success: [],
         sceneId:[7]
       },
+      typeCopy:"edit",
       dataList: [],
-      unitId: ''
+      unitId: '',
+      oneCampaignId:'',
+      copyCampaignId:''
     }
   },
   computed: {},
@@ -642,10 +645,15 @@ export default {
     addApplication() {
       this.$refs.application.showApplication()
     },
-    handleOk(item) {
+    handleOk(item,type,campaignId) {
       this.visible = true
       //   /kuaishou/batch/getUnitDetail
-      console.log(item)
+      this.typeCopy = type
+      if(campaignId){
+        this.oneCampaignId = item.campaignId
+        this.copyCampaignId =campaignId
+      }
+      console.log(item.campaignId,campaignId)
       this.unitId = item.unitId
       var params = {}
       params.accountId = item.accountId
@@ -727,6 +735,7 @@ export default {
     },
     handleSubmit(e) {
       //   this.$refs.population.handleSubmit()
+
       e.preventDefault()
       this.$refs.population.handleSubmit()
       this.form.validateFields((err, values) => {
@@ -746,11 +755,11 @@ export default {
           var params = {
             ...this.populationData,
             ...json,
-            ...groupArr,
+            
             accountId: localStorage.getItem('accountId'),
             unitId: this.unitId,
             unitType: 4,
-            beginTime: moment(this.timeRange[0]).format('YYYY-MM-DD'),
+            beginTime: this.allForm.time == '2' ?moment(this.timeRange[0]).format('YYYY-MM-DD'):moment().startOf('day').format('YYYY-MM-DD'),
             endTime: this.allForm.time == '2' ? moment(this.timeRange[1]).format('YYYY-MM-DD') : '',
             scheduleTime: this.allForm.scheduleTimeData
           }
@@ -763,15 +772,34 @@ export default {
               templateContent: JSON.stringify(this.populationData)
             }).then(res => {})
           }
-          postAction('/kuaishou/batch/updateUnit', params).then(res => {
-            if (res.result.code == 0) {
-              this.visible = false
-              this.$emit('getList', localStorage.getItem('advertisingGroupKey'))
-              this.loading = false
-            } else {
-              this.loading = false
-            }
-          })
+          if(this.typeCopy == 'edit'){
+            var param = {...params,...groupArr}
+            postAction('/kuaishou/batch/updateUnit', param).then(res => {
+              if (res.result.code == 0) {
+                this.visible = false
+                this.$emit('getList', localStorage.getItem('advertisingGroupKey'))
+                this.loading = false
+              } else {
+                this.loading = false
+              }
+            })
+          }else if(this.typeCopy == 'copy'){
+            params.type= 'copy'
+            params.copyUnitId=  this.unitId
+            params.copyToCampaignId=  this.copyCampaignId
+            params.campaignId=  this.oneCampaignId
+            params.createCount = 1
+            params.groupArr= [groupArr]
+            postAction('/kuaishou/batch/copyUnit', params).then(res => {
+                if(res.success){
+                this.visible = false
+                this.loading = false
+                this.$emit('getList', localStorage.getItem('advertisingGroupKey'))
+                }
+                
+            })
+          }
+
         }
       })
     },
@@ -842,21 +870,21 @@ export default {
         }
       })
     },
-    getPeople(e) {
-      console.log(e.target.value)
-      if (e.target.value == 3) {
-        getAction('/kuaishou/batch/getPopulationList', { accountId: localStorage.getItem('accountId') }).then(res => {
-          if (res.success) {
-            this.data = res.result.map((item, index) => {
-              return {
-                ...item,
-                key: index
-              }
-            })
-          }
-        })
-      }
-    },
+    // getPeople(e) {
+    //   console.log(e.target.value)
+    //   if (e.target.value == 3) {
+    //     getAction('/kuaishou/batch/getPopulationList', { accountId: localStorage.getItem('accountId') }).then(res => {
+    //       if (res.success) {
+    //         this.data = res.result.map((item, index) => {
+    //           return {
+    //             ...item,
+    //             key: index
+    //           }
+    //         })
+    //       }
+    //     })
+    //   }
+    // },
     getCampaignList() {
       var params = {}
       params.accountId = localStorage.getItem('accountId')

+ 33 - 33
src/views/modules/kuaishouapp/account/stepForm/stepModule/targetedPopulation.vue

@@ -724,39 +724,39 @@ export default {
 
           this.targeted = n.excludePopulation ? (n.population ? '4' : '3') : '2'
           this.people = n.excludePopulation ? '3' : n.population ? '3' : '2'
-          this.getPeople().then(res => {
-            if (n.excludePopulation) {
-              this.keyValueNo = ''
-              this.selectedRowKeysValueNo = []
-              for (let i = 0; i < res.length; i++) {
-                for (let j = 0; j < n.excludePopulation.length; j++) {
-                  if (res[i].orientationId == n.excludePopulation[j]) {
-                    this.keyValueNo += res[i].orientationName + '   '
-                    this.selectedRowKeysValueNo.push({
-                      orientationId: res[i].orientationId,
-                      orientationName: res[i].orientationName
-                    })
-                    this.selectedRowKeysNo.push()
-                  }
-                }
-              }
-            }
-            if (n.population) {
-              this.keyValue = ''
-              this.selectedRowKeysValue = []
-              for (let i = 0; i < res.length; i++) {
-                for (let j = 0; j < n.population.length; j++) {
-                  if (res[i].orientationId == n.population[j]) {
-                    this.keyValue += res[i].orientationName + '   '
-                    this.selectedRowKeysValue.push({
-                      orientationId: res[i].orientationId,
-                      orientationName: res[i].orientationName
-                    })
-                  }
-                }
-              }
-            }
-          })
+        //   this.getPeople().then(res => {
+        //     if (n.excludePopulation) {
+        //       this.keyValueNo = ''
+        //       this.selectedRowKeysValueNo = []
+        //       for (let i = 0; i < res.length; i++) {
+        //         for (let j = 0; j < n.excludePopulation.length; j++) {
+        //           if (res[i].orientationId == n.excludePopulation[j]) {
+        //             this.keyValueNo += res[i].orientationName + '   '
+        //             this.selectedRowKeysValueNo.push({
+        //               orientationId: res[i].orientationId,
+        //               orientationName: res[i].orientationName
+        //             })
+        //             this.selectedRowKeysNo.push()
+        //           }
+        //         }
+        //       }
+        //     }
+        //     if (n.population) {
+        //       this.keyValue = ''
+        //       this.selectedRowKeysValue = []
+        //       for (let i = 0; i < res.length; i++) {
+        //         for (let j = 0; j < n.population.length; j++) {
+        //           if (res[i].orientationId == n.population[j]) {
+        //             this.keyValue += res[i].orientationName + '   '
+        //             this.selectedRowKeysValue.push({
+        //               orientationId: res[i].orientationId,
+        //               orientationName: res[i].orientationName
+        //             })
+        //           }
+        //         }
+        //       }
+        //     }
+        //   })
           this.$nextTick(() => {
             this.form.setFieldsValue(
               pick(n, [