zhuxinbo 5 年 前
コミット
e947ea6be3

+ 3 - 3
src/views/modules/Statistics/components/Treeselect.vue

@@ -13,6 +13,7 @@
       placeholder="请选择项目以及账户"
       v-model="value"
       :value-consists-of="valueConsistsOf"
+      :auto-load-root-options="false"
       @select="update"
       @input="emitValue"
       :limit="2"
@@ -22,7 +23,7 @@
         }
       "
       noChildrenText="该项目下暂无账号"
-      noOptionsText="暂无项目"
+      noOptionsText="loading..."
     />
   </div>
 </template>
@@ -38,7 +39,7 @@ import { getAction, postAction } from '@/api/manage'
 import { mapGetters } from 'vuex'
 // We just use `setTimeout()` here to simulate an async operation
 // instead of requesting a real API server for demo purpose.
-
+let called = false
 export default {
   data: () => ({
     value: null,
@@ -80,7 +81,6 @@ export default {
   methods: {
     ...mapGetters(['nickname', 'avatar', 'userInfo']),
     update(node, id) {
-      console.log(node, id)
 
       getAction('/ctop/userAllocation/getAccountListByProjectId', { projectId: node.id }).then(res => {
         console.log(res)

+ 11 - 2
src/views/modules/kuaishouapp/account/accountIndex.vue

@@ -65,7 +65,7 @@
             }}
             <div style="margin-top:20px">
               <p v-for="(item, index) of visibleData.failInfo" :key="index">
-                <span>名称:{{ item.campaignName }}</span
+                <span>名称:{{ item.campaignName?item.campaignName:item.unitName }}</span
                 ><br />
                 <span>错误信息:{{ item.message }}</span>
               </p>
@@ -163,7 +163,7 @@
           }}</a-select-option>
         </a-select>
       </a-form-item>
-      <copyGroup ref="copyGroup" v-show="unitId != ''" />
+      <copyGroup ref="copyGroup" v-show="unitId != ''" @failInfo="failInfoShow"/>
       <template slot="footer">
         <a-button key="submit" type="primary" @click="handleSubmit">
           确定
@@ -348,6 +348,14 @@ export default {
     }
   },
   methods: {
+    failInfoShow(item){
+        if(item){
+            this.visible = true
+            this.visibleData = item
+        }else{
+            this.$message.success('成功')
+        }
+    },
     handleOkEdit(e) {},
     clear() {
       this.unitId = ''
@@ -358,6 +366,7 @@ export default {
     getUnitData(e) {
       console.log(this.unitId)
       var params = { accountId: this.appId, unitId: this.unitId, campaignId: this.campaignId,planId:this.planId }
+      localStorage.setItem('advertisingGroupKey',this.campaignId)
       this.$refs.copyGroup.handleOk(params)
       //   handleSubmit
     },

+ 16 - 67
src/views/modules/kuaishouapp/account/advertisingGroup.vue

@@ -125,7 +125,7 @@
         修改条数:{{ visibleData.totalCount }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;失败条数:{{ visibleData.failCount }}
         <div style="margin-top:20px">
           <p v-for="(item, index) of visibleData.failInfo" :key="index">
-            <span>名称:{{ item.campaignName }}</span><br />
+            <span>名称:{{ item.campaignName?item.campaignName:item.unitName }}</span><br />
             <span>错误信息:{{ item.message }}</span>
           </p>
         </div>
@@ -599,72 +599,7 @@
       filterOption(input, option) {
         return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       },
-      addGroup() {
-        this.allForm.group.push({
-          bidType: '2',
-          bid: '',
-          cpaBid: '',
-          showTipCheck: false,
-          deepConversionBidCheck: false,
-          unitName: '',
-          unitNameCheck: false,
-          deepConversionType: '',
-          deepConversionBid: ''
-        })
-      },
-      removeGroup(index) {
-        this.allForm.group.splice(index, 1)
-      },
-      resData(index) {
-        this.allForm.group[index].bid = ''
-        this.allForm.group[index].cpaBid = ''
-        this.allForm.group[index].showTipCheck = false
-        this.allForm.group[index].deepConversionBidCheck = false
-        this.allForm.group[index].deepConversionType = ''
-        this.allForm.group[index].deepConversionBid = ''
-      },
-      showTip(index) {
-        if (this.allForm.group[index].bidType == '1') {
-          if (this.allForm.group[index].bid < 0.2 || this.allForm.group[index].bid > this.maxBid) {
-            this.allForm.group[index].showTipCheck = true
-          } else {
-            this.allForm.group[index].showTipCheck = false
-          }
-        } else if (this.allForm.group[index].bidType == '2') {
-          if (this.allForm.group[index].cpaBid < 1 || this.allForm.group[index].cpaBid > this.maxBid) {
-            this.allForm.group[index].showTipCheck = true
-          } else {
-            this.allForm.group[index].showTipCheck = false
-          }
-        } else {
-          if (this.allForm.group[index].cpaBid < 5 || this.allForm.group[index].cpaBid > this.maxBid) {
-            this.allForm.group[index].showTipCheck = true
-          } else {
-            this.allForm.group[index].showTipCheck = false
-          }
-        }
-      },
-      deep_conversion_bidTip(index) {
-        if (
-          this.allForm.group[index].deepConversionBid < this.allForm.group[index].cpaBid ||
-          this.allForm.group[index].deepConversionBid > 3000
-        ) {
-          this.allForm.group[index].deepConversionBidCheck = true
-        } else {
-          this.allForm.group[index].deepConversionBidCheck = false
-        }
-      },
-      checkGroup(e, index) {
-        if (e.target.value != '') {
-          getAction('/kuaishou/batch/checkUnitName', {
-            campaignId: localStorage.getItem('advertisingGroupKey'),
-            unitName: e.target.value
-          }).then(res => {
-            this.allForm.group[index].unitNameCheck = !res.result
-          })
-        }
-
-      },
+      
       remove(targetKey) {
         let activeKey = this.titleKey
         let lastIndex
@@ -1058,6 +993,18 @@
             }
             postAction('/kuaishou/batch/copyUnit', params).then(res => {
               if (res.success) {
+                //   visibleData
+                  if (res.result.failCount > 0) {
+                    this.visible = true
+                    this.visibleData = res.result
+                    this.getDataList(localStorage.getItem('advertisingGroupKey'))
+                  } else {
+                    this.getDataList(localStorage.getItem('advertisingGroupKey'))
+                    this.$message.success('批量修改成功')
+                    this.allMoneyBidProportion = 1.2
+                    this.selectedRowKeysValue = []
+                    this.selectedRowKeys = []
+                  }
                 this.visibleCopy = false
                 this.loading = false
               }
@@ -1080,6 +1027,8 @@
               if (res.success) {
                 this.visibleCopy = false
                 this.loading = false
+                this.getDataList(localStorage.getItem('advertisingGroupKey'))
+
               }
             })
           }

+ 14 - 1
src/views/modules/kuaishouapp/account/copyGroup.vue

@@ -668,7 +668,20 @@
             }
             postAction('/kuaishou/batch/createUnit', params).then(res => {
               if (res.success) {
-
+                if (res.result.failCount > 0) {
+                  this.visible = true
+                  this.visibleData = res.result
+                  this.getDataList(localStorage.getItem('advertisingGroupKey'))
+                  this.$emit('failInfo',res.result)
+                } else {
+                  this.getDataList(localStorage.getItem('advertisingGroupKey'))
+                  this.$message.success('批量修改成功')
+                  this.allMoneyBidProportion = 1.2
+                  this.selectedRowKeysValue = []
+                  this.selectedRowKeys = []
+                  this.$emit('failInfo',null)
+                }
+                
               }
             })
           }

+ 6 - 6
src/views/modules/kuaishouapp/account/editGroup.vue

@@ -502,12 +502,12 @@ export default {
     },
     checkGroup(e, index) {
         if(e.target.value !=''){
-					getAction('/kuaishou/batch/checkUnitName', {
-						campaignId: localStorage.getItem('advertisingGroupKey'),
-						unitName: e.target.value
-					}).then(res => {
-						this.allForm.group[index].unitNameCheck = !res.result
-					})
+            getAction('/kuaishou/batch/checkUnitName', {
+                campaignId: localStorage.getItem('advertisingGroupKey'),
+                unitName: e.target.value
+            }).then(res => {
+                this.allForm.group[index].unitNameCheck = !res.result
+            })
         }
 
     },

+ 26 - 26
src/views/modules/kuaishouapp/account/stepForm/Step2.vue

@@ -49,13 +49,12 @@
           <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="campaignType == '3' ? ' ' : '链接'" :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
-        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }" v-if="campaignType != '2'"
-        :class="{ elseLabel: campaignType == '3' }">
-        <!-- 请填写以http://或者https://开头的落地页地址,长度不超过1000个字符 -->
-        <a-input placeholder="请填写链接"
-          v-decorator="['url', { rules: [{ required: true, message: ' ' }, { validator: handleConfirmValue }] }]" />
+      <a-form-item :label="campaignType == 3 ? ' ' : '链接'" :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }" v-if="campaignType != 2"
+        :class="{ 'else-label': campaignType == 3 }">
+        <a-input placeholder="请填写链接" v-decorator="['url', { rules: [{ required: true,message:'链接不能为空'}] }]" />
       </a-form-item>
       <div style="text-align:center;font-size:16px;margin-bottom:10px">
         目标人群
@@ -586,17 +585,17 @@
         return this.form.getFieldValue(className)
       },
       handleConfirmValue(rule, value, callback) {
-        if (this.campaignType == '3') {
+        if (this.campaignType == 3) {
           if (value == '') {
             callback('请填写链接')
           }
-        } else if (this.campaignType == '4') {
+        } else if (this.campaignType == 4) {
           if (/(http|https):\/\/([\w.]+\/?)\S*/.test(value) && value != '' && value.length < 10000) {
             callback()
           } else {
             callback('链接不能为空且开头为http://或https://,并且长度小于10000')
           }
-        } else if (this.campaignType == '5') {
+        } else if (this.campaignType == 5) {
           if (/(http|https):\/\/([\w.]+\/?)\S*/.test(value) && value != '' && value.length < 10000) {
             callback()
           } else {
@@ -830,23 +829,23 @@
           }
         })
       },
-      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')
@@ -854,6 +853,7 @@
         getAction('/kuaishou/batch/getCampaignList', params).then(res => {
           if (res.success) {
             this.campaignType = res.result.records[0].campaignType
+            console.log(this.campaignType)
           }
         })
       },

+ 96 - 11
src/views/modules/kuaishouapp/account/stepForm/Step3.vue

@@ -1,5 +1,28 @@
 <style scoped lang="scss">
+  .actor-photo-list {
+    display: flex;
+    padding-left: 0;
 
+    li {
+      width: 25%;
+      margin: 10px;
+      position: relative;
+      height: 250px;
+      border: 1px solid #f2f2f2;
+      list-style: none;
+
+      img,
+      video {
+        width: 100%;
+        margin-top: auto;
+        margin-bottom: auto;
+        top: 0;
+        bottom: 0;
+        position: absolute;
+        max-height: 250px;
+      }
+    }
+  }
 </style>
 <template>
   <a-card :body-style="{ padding: '24px 32px' }" :bordered="false" class="only-step3">
@@ -7,8 +30,7 @@
       <a-tab-pane v-for="(pane, bestIndex) in pans" :tab="pane.tab" :key="pane.key" v-model="pansKey" disabled
         :closable="pane.closable">
         <a-form @submit="handleSubmit" :form="form" style="margin-top:20px" :hideRequiredMark="true">
-          <a-form-item label="素材类型" :labelCol="labelCol"
-            :wrapperCol="wrapperCol">
+          <a-form-item label="素材类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-radio-group buttonStyle="solid" v-decorator="['creativeMaterialType', { initialValue: '1' }]">
               <a-radio-button value="1">竖版视频</a-radio-button>
               <a-radio-button value="2">横版视频</a-radio-button>
@@ -33,6 +55,22 @@
                           <video :src="item.videoList.url" controls="controls" style="width:25%"
                             v-if="item.videoList"></video>
                         </a-form-item>
+                        <div class="downLoad" style="overflow:auto">
+                          <a-button @click="onCheckAllImageChange(index,item)" v-if="item.imageUrlList.length > 0">{{
+                            item.checkAllImage ? '取消  (  ' + item.checkArrImage.length + '  )' : '全选'
+                            }}</a-button>
+                          <ul class="actor-photo-list"
+                            :style="{ width: item.imageUrlList.length>4?25 * item.imageUrlList.length + '%':'100%' }"
+                            v-if="item.imageUrlList.length > 0">
+                            <a-checkbox-group v-model="item.checkArrImage"
+                              style="width:100%;  display: flex;padding-left: 0;" @change="onChangeCheckImage">
+                              <li v-for="(item, index) of item.imageUrlList" :key="index">
+                                <a-checkbox :value="item.code" style="position:absolute;z-index: 100"></a-checkbox><img
+                                  class="video" :src="item.url" />
+                              </li>
+                            </a-checkbox-group>
+                          </ul>
+                        </div>
                         <a-form-item label="">
                           <a @click="getVideoList('image', index, item, bestIndex)">选择封面</a>
                           <br />
@@ -143,7 +181,8 @@
           videoList: '',
           imageList: [],
           fail: [],
-          success: []
+          success: [],
+
         },
         form: this.$form.createForm(this),
         list: [],
@@ -178,10 +217,29 @@
           }
         },
         visible: false,
-        loading: false
+        loading: false,
+        imageUrlList: [],
+        checkAllImage: false,
+        checkArrImage: []
       }
     },
     methods: {
+      onCheckAllImageChange(index, item) {
+
+        if (this.pans[index].list[item.key].checkAllImage) {
+          this.pans[index].list[item.key].checkArrImage = []
+        } else {
+          this.pans[index].list[item.key].checkArrImage = this.pans[index].list[item.key].imageUrlList.map(item => {
+            return item.code
+          })
+        }
+        this.pans[index].list[item.key].checkAllImage = !this.pans[index].list[item.key].checkAllImage
+      },
+      onChangeCheckImage(checkedList) {
+        // if (checkedList.length == 0) {
+        //   this.checkAllImage = false
+        // }
+      },
       handleConfirmValue(rule, value, callback) {
         if (/(http|https):\/\/([\w.]+\/?)\S*/.test(value) && value.length < 10000) {
           callback()
@@ -195,13 +253,22 @@
         if (type == 'video') {
           this.pans[index].list[item.key].videoList = item.video
           getAction('/kuaishou/batch/getCreativeCopywriter', {
-            code: item.video.signature
+            code: item.video.signature,
+            accountId: localStorage.getItem('accountId')
           }).then(res => {
             console.log(res)
             if (res.success) {
               this.pans[index].list[item.key].description = res.result.creativeCopywriter
             }
           })
+          getAction('/ctop/MaterialImageInfo/list', {
+            videoId: item.video.signature
+          }).then(res => {
+            console.log(res)
+            if (res.success) {
+              this.pans[index].list[item.key].imageUrlList = res.result
+            }
+          })
         } else {
           this.pans[index].list[item.key].imageList.push(...item.image)
         }
@@ -268,30 +335,45 @@
         e.preventDefault()
         var index = this.pans.findIndex(item => item.key === this.pansKey)
         var data = this.pans[index].list.map(item => {
-          return item.imageList.length
+          return item.imageList.length + item.imageUrlList.length
         })
-        console.log(eval(data.join('+')), data)
         if (eval(data.join('+')) > 15) {
           this.$message.error('封面最多15张')
           return
         }
+        console.log(this.pans[index].list)
+
         this.form.validateFields((err, values) => {
           if (!err) {
             this.loading = true
             var dataJson = this.pans[index].list.map(item => {
               return {
                 description: item.description,
-                imageTokens: item.imageList.map((ele, index) => {
+                imageArr: item.imageList.map((ele, index) => {
                   return {
-                    image: ele.imageToken,
+                    signature: ele.signature,
                     name: index + 1 + '-' + item.name
                   }
                 }),
+                imageArrTwo: item.checkArrImage.map((ele, index) => {
+                  return {
+                    signature: ele,
+                    name: (item.imageList.length + index + 1) + '-' + item.name
+                  }
+                }),
                 photoId: item.videoList.photoId
               }
             })
+            console.log(dataJson)
+            var allJson = dataJson.map(item => {
+              return {
+                description: item.description,
+                imageArr: item.imageArr.concat(item.imageArrTwo),
+                photoId: item.photoId
+              }
+            })
             var params = {
-              dataJson,
+              dataJson: allJson,
               ...values,
               unitId: this.pansKey,
               accountId: localStorage.getItem('accountId')
@@ -334,7 +416,10 @@
             .substr(2, 4),
           description: '',
           creativeMaterialType: '1',
-          actionBarText: ''
+          actionBarText: '',
+          imageUrlList: [],
+          checkArrImage: [],
+          checkAllImage: false
         })
       },
       deleteCreative(bestIndex, index) {

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

@@ -1054,24 +1054,27 @@ export default {
             })
           }
           var jsonData = {}
-          if (this.targeted == '2') {
-            jsonData.population = this.selectedRowKeysValue.map(item => {
-              return item.orientationId
-            })
-          } else if (this.targeted == '3') {
-            jsonData.excludePopulation = this.selectedRowKeysValueNo.map(item => {
-              return item.orientationId
-            })
-          } else if (this.targeted == '4') {
-            jsonData.population = this.selectedRowKeysValue.map(item => {
-              return item.orientationId
-            })
-            jsonData.excludePopulation = this.selectedRowKeysValueNo.map(item => {
-              return item.orientationId
-            })
-          } else {
-            jsonData = {}
+          if(this.people == '3'){
+            if (this.targeted == '2') {
+                jsonData.population = this.selectedRowKeysValue.map(item => {
+                return item.orientationId
+                })
+            } else if (this.targeted == '3') {
+                jsonData.excludePopulation = this.selectedRowKeysValueNo.map(item => {
+                return item.orientationId
+                })
+            } else if (this.targeted == '4') {
+                jsonData.population = this.selectedRowKeysValue.map(item => {
+                return item.orientationId
+                })
+                jsonData.excludePopulation = this.selectedRowKeysValueNo.map(item => {
+                return item.orientationId
+                })
+            } else {
+                jsonData = {}
+            }
           }
+          
           var dataJson = {
             ...values,
             platformOs: this.allForm.platform_os,

+ 37 - 24
src/views/modules/material/videoMaterial.vue

@@ -651,7 +651,7 @@ a {
     <a-modal :title="add?'添加素材':'修改素材'" v-model="visible" @cancel="close" @afterClose="close" :maskClosable="false" :width="800">
       <template slot="footer">
         <a-button key="back" @click="close">取消</a-button>
-        <a-button key="submit" type="primary" :disabled="!confirmLoading" @click="handleOk">
+        <a-button key="submit" type="primary" :disabled="!confirmLoading" :loding="loading" @click="handleOk">
           确定
         </a-button>
       </template>
@@ -1247,6 +1247,7 @@ export default {
       visibleDetail: false,
       personVisible:false,
       confirmLoading: false,
+      loading:false,
       activeKey: 'video',
       active: '0',
       examinelList: [
@@ -1420,7 +1421,7 @@ export default {
         if (res.success) {
           //   this.coverPreviewVisible = false
           getAction('/ctop/MaterialImageInfo/list', {
-            videoId: this.id
+            videoId: this.code
           }).then(res => {
             if (res.success) {
               this.model = res.result.map((item, index) => {
@@ -1462,7 +1463,7 @@ export default {
         if (res.success) {
           //   this.coverPreviewVisible = false
           getAction('/ctop/MaterialImageInfo/list', {
-            videoId: this.id
+            videoId: this.code
           }).then(res => {
             if (res.success) {
               this.checkArrImage = []
@@ -1718,7 +1719,7 @@ export default {
         }
       })
       getAction('/ctop/MaterialImageInfo/list', {
-        videoId: item.id
+        videoId: item.code
       }).then(res => {
         console.log(res)
         if (res.success) {
@@ -1884,7 +1885,7 @@ export default {
     handleOkImage() {
       var params = {}
       params.projectId = this.addImageData.projectId
-      params.videoId = this.addImageData.id
+      params.videoId = this.addImageData.code
       params.imageArr = this.imageArrList
       postAction('/insertImage', params).then(res => {
         console.log(res)
@@ -1902,6 +1903,7 @@ export default {
       })
     },
     handleOk() {
+      this.loading = true
       this.form.validateFieldsAndScroll((err, values) => {
         if (err) {
           // 这里做逻辑处理
@@ -1960,14 +1962,18 @@ export default {
                 this.loadData()
                 this.visible = false
                 this.add = true
+                this.loading = false
                 for (const key in this.role) {
                   if (key == 'roleCode') {
                     this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
                   }
                 }
                 this.$message.success('素材上传成功')
+                this.loading = false
+                
               } else {
                 this.$message.error(res.message)
+                this.loading = false
               }
             })
           } else {
@@ -1975,26 +1981,33 @@ export default {
               ...params,
               status: '0'
             }).then(res => {
-              this.form.resetFields()
-              this.urlList = {
-                url: '',
-                md5: '',
-                name: ''
-              }
-              this.watermarkUrl = {
-                url: '',
-                md5: '',
-                name: ''
-              }
-              this.tags = []
-              this.loadData()
-              this.visible = false
-              this.add = true
-              for (const key in this.role) {
-                if (key == 'roleCode') {
-                  this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
+                if(res.success){
+                    this.form.resetFields()
+                    this.urlList = {
+                        url: '',
+                        md5: '',
+                        name: ''
+                    }
+                    this.watermarkUrl = {
+                        url: '',
+                        md5: '',
+                        name: ''
+                    }
+                    this.tags = []
+                    this.loadData()
+                    this.visible = false
+                    this.add = true
+                    this.loading = false
+                    for (const key in this.role) {
+                        if (key == 'roleCode') {
+                        this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
+                        }
+                    } 
+                }else{
+                    this.$message.error(res.message)
+                    this.loading = false
                 }
-              }
+              
             })
           }
         }