Browse Source

批量修改

zhuxinbo 5 năm trước cách đây
mục cha
commit
5d02e54472

+ 7 - 4
src/views/modules/kuaishouapp/account/accountIndex.vue

@@ -163,9 +163,9 @@
           }}</a-select-option>
         </a-select>
       </a-form-item>
-      <copyGroup ref="copyGroup" v-show="unitId != ''" @failInfo="failInfoShow"/>
+      <copyGroup ref="copyGroup" v-show="unitId != ''" @failInfo="failInfoShow" :loadingGroup.sync="loadingGroup" :jihua.sync="jihua"/>
       <template slot="footer">
-        <a-button key="submit" type="primary" @click="handleSubmit">
+        <a-button key="submit" type="primary" @click="handleSubmit" :loading="loadingGroup">
           确定
         </a-button>
       </template>
@@ -277,6 +277,7 @@ export default {
       jihua: false,
       refuseReason: '',
       visibleEdit: false,
+      loadingGroup:false,
       allType: '1',
       duration: 1000,
       showEdit: false,
@@ -353,7 +354,8 @@ export default {
             this.visible = true
             this.visibleData = item
         }else{
-            this.$message.success('成功')
+            this.$message.success('创建成功')
+            this.addUser()
         }
     },
     handleOkEdit(e) {},
@@ -371,7 +373,7 @@ export default {
       //   handleSubmit
     },
     handleSubmit(e) {
-
+      
       this.$refs.copyGroup.handleSubmit(e)
     },
     toDetail(record) {
@@ -423,6 +425,7 @@ export default {
             this.planId = res.result
             this.campaignId = item.campaignId
             this.getDataList(item.campaignId)
+            this.addUser()
           } else {
             this.$message.error(res.message)
           }

+ 49 - 22
src/views/modules/kuaishouapp/account/advertisingGroup.vue

@@ -174,6 +174,12 @@
         ]" :max="10" :min="1" style="width:100%">
           </a-input-number>
         </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">
+          <a-input v-decorator="[
+          'unitName',
+           { rules: [{ required: true, message: '请输入广告组名称' }]} ]" />
+        </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">
           <a-radio-group buttonStyle="solid" v-decorator="[
@@ -599,7 +605,7 @@
       filterOption(input, option) {
         return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       },
-      
+
       remove(targetKey) {
         let activeKey = this.titleKey
         let lastIndex
@@ -756,7 +762,7 @@
           this.campaignId = localStorage.getItem('advertisingGroupKey')
           this.visibleBatch = true
         } else {
-          
+
           var params = {}
           params.accountId = localStorage.getItem('accountId')
           params.putStatus = this.allType
@@ -972,8 +978,14 @@
       },
       handleSubmitCopy(e) {
         if (this.getData('createCount') == 1) {
-          this.visibleCopy = false
-          this.$refs.editGroup.handleOk(this.copyData, 'copy', this.getData('campaignId'))
+
+          this.form.validateFields((err, values) => {
+            if (!err) {
+              this.visibleCopy = false
+              this.$refs.editGroup.handleOk(this.copyData, 'copy', this.getData('campaignId'), values.unitName)
+            }
+          })
+
           // postAction('/kuaishou/batch/copyUnit', params).then(res => {})
         } else if (this.getData('createCount') > 1) {
           this.loading = true
@@ -994,19 +1006,22 @@
             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
+                if (res.result.failCount > 0) {
+                  this.visible = true
+                  this.visibleData = res.result
+                } else {
+                  this.$message.success('批量复制成功')
+                  this.allMoneyBidProportion = 1.2
+                  this.selectedRowKeysValue = []
+                  this.selectedRowKeys = []
+
+                }
+                setTimeout(() => {
+                  this.visibleCopy = false
+                  this.loading = false
+                  this.getDataList(localStorage.getItem('advertisingGroupKey'))
+                }, 1000)
+                // this.getDataList(localStorage.getItem('advertisingGroupKey'))
               }
             })
           } else if (this.getData('createType') == '2') {
@@ -1025,10 +1040,22 @@
             }
             postAction('/kuaishou/batch/copyUnit', params).then(res => {
               if (res.success) {
-                this.visibleCopy = false
-                this.loading = false
-                this.getDataList(localStorage.getItem('advertisingGroupKey'))
+                if (res.result.failCount > 0) {
+                  this.visible = true
+                  this.visibleData = res.result
+                } else {
+                  this.$message.success('批量复制成功')
+                  this.allMoneyBidProportion = 1.2
+                  this.selectedRowKeysValue = []
+                  this.selectedRowKeys = []
+                }
+                setTimeout(() => {
+                  this.visibleCopy = false
+                  this.loading = false
+                  this.getDataList(localStorage.getItem('advertisingGroupKey'))
+                }, 1000)
 
+                // this.getDataList(localStorage.getItem('advertisingGroupKey'))
               }
             })
           }
@@ -1115,10 +1142,10 @@
       dataValue(n, o) {
         this.indeterminate = !!this.dataValue.length && this.dataValue.length < this.showList.length
         this.checkAll = this.dataValue.length === this.showList.length
-      }
+      },
     },
     computed: {},
-    activated() {
+    mounted() {
       var data = JSON.parse(localStorage.getItem('advertisingGroup'))
       this.titleKey = localStorage.getItem('advertisingGroupKey')
       this.title = data.map(item => {

+ 8 - 11
src/views/modules/kuaishouapp/account/copyGroup.vue

@@ -628,6 +628,7 @@
         //   this.$refs.population.handleSubmit()
         e.preventDefault()
         this.$refs.population.handleSubmit()
+        this.$emit('update:loadingGroup', true)
         this.form.validateFields((err, values) => {
           if (!err) {
             this.loading = true
@@ -669,19 +670,15 @@
             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)
+                  this.$emit('update:loadingGroup', false)
+                  this.$emit('update:jihua', false)
+                  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)
+                  this.$emit('failInfo', null)
+                  this.$emit('update:loadingGroup', false)
+                  this.$emit('update:jihua', false)
                 }
-                
+
               }
             })
           }

+ 9 - 5
src/views/modules/kuaishouapp/account/editGroup.vue

@@ -645,7 +645,7 @@ export default {
     addApplication() {
       this.$refs.application.showApplication()
     },
-    handleOk(item,type,campaignId) {
+    handleOk(item,type,campaignId,unitNameCopy) {
       this.visible = true
       //   /kuaishou/batch/getUnitDetail
       this.typeCopy = type
@@ -677,7 +677,7 @@ export default {
               cpaBid: dataJson.cpaBid / 1000,
               showTipCheck: false,
               deepConversionBidCheck: false,
-              unitName: dataJson.unitName,
+              unitName: unitNameCopy?unitNameCopy:dataJson.unitName,
               unitNameCheck: false,
               deepConversionType: dataJson.deepConversionType,
               deepConversionBid: dataJson.deepConversionBid
@@ -792,9 +792,13 @@ export default {
             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'))
+                    setTimeout(()=>{
+                      this.visible = false
+                      this.loading = false
+                      this.$emit('getList', localStorage.getItem('advertisingGroupKey'))
+                    },1000)
+                }else{
+                    this.$message.error(res.message)
                 }
                 
             })

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

@@ -513,6 +513,7 @@ li:hover {
         style="width: 100%"
         optionFilterProp="children"
         showSearch
+        showArrow
         :filterOption="filterOption"
         v-decorator="['interestVideo', { rules: [{ required: true, message: '请选择视频标签' }] }]"
       >

+ 36 - 6
src/views/modules/material/videoMaterial.vue

@@ -1157,7 +1157,6 @@ a {
             </a-select>
           </a-form-item>
         </a-form>
-          
     </a-modal>
 
 
@@ -2123,19 +2122,49 @@ export default {
             url: this.urlListImage.url[i],
             materialName: this.urlListImage.name[i]
           })
+          alert(i)
         } else {
+
           img.onload = () => {
+            if (img.width == 720) {
+                if (img.height == 1280) {
+                  that.material.push(true)
+                } else {
+                  that.material.push(false)
+                }
+            } else if (img.width == 1080) {
+                if (img.height == 1920) {
+                  that.material.push(true)
+                } else {
+                  that.material.push(false)
+                }
+            } else if (img.width == 1280) {
+                if (img.height == 720) {
+                  that.material.push(true)
+                } else {
+                  that.material.push(false)
+                }
+            } else if (img.width == 1920) {
+                if (img.height == 1080) {
+                  that.material.push(true)
+                } else {
+                  that.material.push(false)
+                }
+            } else {
+                that.material.push(false)
+            }
             that.imageArrList.push({
               width: img.width,
               height: img.height,
-              size: that.urlListImage.size[that.urlListImage.url.length - 1],
-              code: that.urlListImage.md5[that.urlListImage.url.length - 1],
-              url: that.urlListImage.url[that.urlListImage.url.length - 1],
-              materialName: that.urlListImage.name[that.urlListImage.url.length - 1]
+              size: that.urlListImage.size[i-1],
+              code: that.urlListImage.md5[i-1],
+              url: that.urlListImage.url[i-1],
+              materialName: that.urlListImage.name[i-1]
             })
           }
         }
       }
+      console.log(this.imageArrList)
     },
     file(file) {
       var bmf = new BMF()
@@ -2169,7 +2198,8 @@ export default {
           bmf.md5(file[i], (err, md5) => {
             fileCheckImage({
               code: md5,
-              projectId: that.getData('projectId')
+              projectId: that.getData('projectId'),
+              videoId:that.addImageData.code
             }).then(res => {
               if (res.code == 0) {
                 that.$message.error('此素材已经上传')