浏览代码

发版提交

zhuxinbo 4 年之前
父节点
当前提交
8d851ca4dd

+ 32 - 20
src/views/modules/BatchCreate/TouTiaoBatch.vue

@@ -18,7 +18,10 @@
                         {{currentPlan.name }}	 <a-icon type="close" @click="clearPlan" />
                     </a-tag>
                 </a-tab-pane>
-                <a-button type='primary'  slot="tabBarExtraContent" @click="goBatch" v-if="tabkey=='group'">
+                <a-button type='primary'  slot="tabBarExtraContent" @click="goBatch" >
+                   + 头条批量创建
+                </a-button>
+                <!-- <a-button type='primary'  slot="tabBarExtraContent" @click="goBatch" v-if="tabkey=='group'">
                    + 头条批量创建
                 </a-button>
                 <a-button type='primary'  slot="tabBarExtraContent" @click="createPlan" v-if="tabkey=='plan'">
@@ -26,7 +29,7 @@
                 </a-button>
                 <a-button type='primary'  slot="tabBarExtraContent" @click="createIdea" v-if="tabkey=='idea'">
                    + 新建创意
-                </a-button>
+                </a-button> -->
 
             </a-tabs>
         </div>
@@ -806,9 +809,7 @@ export default {
         //跳转到批量页面
         goBatch(){
             this.$router.push('/modules/BatchCreate/newGroup')
-            // if(this.tabkey=='idea'){
-            //      this.$router.push('/modules/BatchCreate/newCreate')
-            // }
+            
         },
         createPlan(){
             if(this.currentGroup.name){
@@ -1019,6 +1020,8 @@ export default {
                 status,
             })).then((res)=>{
                 console.log(res);
+                // this.loading=false
+                this.optValue=undefined;
                 if(res.success){
                     this.$message.success(res.message)
                     // this.data=[];
@@ -1031,11 +1034,12 @@ export default {
                         pageNo:this.ipagination.current
                     })
                 }else{
-                    if(this.selectedRows.length>0){
-                        this.selectedRows.forEach(item=>{
-                            item.spin=false;
-                        })
-                    }
+                    this.loading=false
+                    // if(this.selectedRows.length>0){
+                    //     this.selectedRows.forEach(item=>{
+                    //         item.spin=false;
+                    //     })
+                    // }
                     this.selectedRowKeys=[];
                     this.selectedRows=[];
                     this.optValue=undefined;
@@ -1050,16 +1054,19 @@ export default {
         isOkHandle(){
             console.log(this.optValue&&this.selectedRowKeys.length>0)
             if(this.optValue&&this.selectedRowKeys.length>0){
-                this.selectedRows.forEach(item=>{
-                    item.spin=true;
-                })
+                // this.selectedRows.forEach(item=>{
+                //     item.spin=true;
+                // })
+                // this.loading=true;
                 if(this.optValue=='pause'){   
+                    
                     if(this.tabkey=='group'){
-                        console.log(this.selectedRows);
+                        console.log(this.selectedRows);                       
                         this.editGroupStatus('/ctop/byteDanceCampaign/editStatus')
 
                     }else if(this.tabkey=='plan'){
                         console.log(0)
+                        this.loading=true;
                         if(this.selectedRowKeys.length>0){
                             this.selectedRows.forEach((item)=>{
                                 item.toutiaoStatus='AD_STATUS_DISABLE'
@@ -1068,10 +1075,12 @@ export default {
                         console.log(0)
                         this.batchEditHttp('status',this.selectedRows)
                     }else if(this.tabkey=='idea'){
+                        this.loading=true;
                         this.editGroupStatus('/ctop/byteDanceCreative/editStatus')
                     }
 
                 }else if(this.optValue=='open'){
+                    
                     if(this.tabkey=='group'){
                         this.editGroupStatus('/ctop/byteDanceCampaign/editStatus');
                     }else if(this.tabkey=='plan'){
@@ -1089,14 +1098,16 @@ export default {
               
                 // this.selectedRows=[];
                 // this.selectedRowKeys=[];
-                this.optValue=undefined;
+                
             }
             
         },
         //确定删除
         confirm(e) {
             // console.log(e);
+                this.loading=true;
                 if(this.optValue=='delete'){
+                    
                      if(this.tabkey=='group'){
                          this.editGroupStatus('/ctop/byteDanceCampaign/editStatus')
                     }else if(this.tabkey=='plan'){
@@ -1221,6 +1232,7 @@ export default {
         batchEditHttp(type,params){
             postAction(`/ctop/byteDanceAdvertisePlan/batchEdit/${type}`,params).then((res)=>{
                 // console.log(res);
+                this.optValue=undefined;
                 if(res.success){
                     if(res.result.length>0){
                         this.modifyTableData=[]
@@ -1245,9 +1257,10 @@ export default {
                     this.$message.success(res.message)
                 }else{
                     // params.spin=false;
-                    params.forEach(item=>{
-                        item.spin=false;
-                    })
+                    // params.forEach(item=>{
+                    //     item.spin=false;
+                    // })
+                    this.loading=false;
                     this.getplanList({
                         accountId:this.accountID,
                         name:this.optionId,
@@ -1381,8 +1394,7 @@ export default {
             this.loading = false;
             if (res.success) {
                 this.ipagination.total = res.result.total
-                
-                
+                         
                 this.data = res.result.records.map(item=>{
 
                     return {

+ 4 - 3
src/views/modules/BatchCreate/newCreate.vue

@@ -356,7 +356,7 @@
         <!-- <div class="moduler-title">计划名称</div> -->
         <div class="opt">
           <a-button type="default" style="margin-right:15px" @click="goBack">取消</a-button>
-          <a-button type="danger" style="margin-right:15px" @click="goSave" :loading="loading">立即创建</a-button>
+          <a-button type="primary" style="margin-right:15px" @click="goSave" :loading="loading">立即创建</a-button>
         </div>
       </div>
     </a-form>
@@ -606,7 +606,7 @@
           )
 
           console.log(dataCreatives, this.$refs.material.titleData)
-          this.form.validateFieldsAndScroll((err, values) => {
+          this.form.validateFields((err, values) => {
             if (!err) {
               var params = {
                 ...values
@@ -661,7 +661,8 @@
                 })
             } else {
 
-              console.log(err)
+              // console.log(err)
+              this.$message.error('请正确填写必填项目')
             }
           })
 

+ 2 - 2
src/views/modules/BatchCreate/newGroup.vue

@@ -89,8 +89,8 @@
             </div>
             <div class="creatBody">
                 <a-button type='default' class="goback" @click="goback">返回</a-button>
-                <a-button type='primary' @click="goShowTable" style="margin-right:20px">保存并返回</a-button>
-                <a-button type='danger' @click="nextHandle" :loading='nextLoading'>创建并下一步</a-button>
+                <a-button type='danger' @click="goShowTable" style="margin-right:20px">保存并返回</a-button>
+                <a-button  type='primary' @click="nextHandle" :loading='nextLoading'>创建并下一步</a-button>
             </div>
         </div>
     </div>

+ 11 - 9
src/views/modules/BatchCreate/newPlan.vue

@@ -157,8 +157,8 @@
             <div class="input-item">
               <!-- , {rules:validationRules.url} -->
               <a-form-item>                  
-                <a-input v-decorator="['downloadUrl']" autocomplete="off"/>
-                <!-- <input type="text" v-decorator="['downloadUrl']" > -->
+                <!-- <a-input v-decorator="['downloadUrl']" autocomplete="off"/> -->
+                <a-input  v-decorator="['downloadUrl', {rules:validationRules.url}]" />
               </a-form-item>
               <span style="display:inline-block;margin-top:15px">
                 <a-checkbox
@@ -813,8 +813,8 @@
         <!-- <div class="moduler-title">计划名称</div> -->
         <div class="opt">
           <a-button type="default" style="margin-right:15px" @click="goBack">取消</a-button>
-          <a-button type="primary" style="margin-right:15px" @click="goPlanShow" :loading="goPlanShowloading">保存并关闭</a-button>
-          <a-button type="danger"  @click="goNext"  :loading="goNextloading">保存并新建创意</a-button>
+          <a-button type="danger"  style="margin-right:15px" @click="goPlanShow" :loading="goPlanShowloading">保存并关闭</a-button>
+          <a-button type="primary" @click="goNext"  :loading="goNextloading">保存并新建创意</a-button>
         </div>
       </div>
     </a-form>
@@ -855,7 +855,7 @@ export default {
         url: [   
           {          
             required: true,
-            // validator: this.validateURL,
+            validator: this.validateURL,
           },
         ],
         name:[{
@@ -1131,7 +1131,7 @@ export default {
           this.$refs.directedPackage.getValuehandle()
         }
         if (this.validatorName()) {
-          this.form.validateFieldsAndScroll((err, values) => {
+          this.form.validateFields((err, values) => {
             if (!err) {
               this.goPlanShowloading=true;
               console.log('Received values of form: ', values)
@@ -1180,7 +1180,8 @@ export default {
                 }
               })
             }else{
-              console.log(err)
+              // console.log(err)
+              this.$message.error('请正确填写必填项目')
             }
           })
         }
@@ -1196,7 +1197,7 @@ export default {
           console.log(this.$refs.directedPackage)
         }
         if (this.validatorName()) {
-          this.form.validateFieldsAndScroll((err, values) => {
+          this.form.validateFields((err, values) => {
             if (!err) {
 
               console.log('Received values of form: ', values)
@@ -1253,8 +1254,9 @@ export default {
                 }
               })
             }else{
-              console.log(err)
+              // console.log(err)
               // this.$message.error(err)
+              this.$message.error('请正确填写必填项目')
             }
           })
         }

+ 7 - 1
src/views/modules/BatchCreate/selectPlanList.vue

@@ -209,7 +209,13 @@ import qs from 'qs'
     },
   }
 </script>
-
+<style lang="less">
+.selectPlan{
+  .ant-btn-danger {
+    background-color: #ff4d4f !important; 
+  }
+}
+</style>
 <style lang="less" scoped>
 .selectPlan{
   ul,li{

+ 1 - 0
vue.config.js

@@ -71,6 +71,7 @@ module.exports = {
         // target: 'http://192.168.1.251/', //请求本地 需要jeecg-boot后台项目 
         target:'http://118.24.244.213:8804',
 
+
         ws: false,
         changeOrigin: true,
         // pathRewrite: {