Procházet zdrojové kódy

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-vue

朱鑫波 před 4 roky
rodič
revize
6f688c1bd5

+ 227 - 114
src/views/modules/Statistics/imageStatics/imageCostReport.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="vsummary">
+  <div class="imageCostReport">
       <div class="tabspane">
         <a-tabs v-model="tabKeys" @change="tabChange">
             <a-tab-pane :key="1" tab="头条">           
@@ -75,7 +75,9 @@
         style="word-break: break-all;"
         >
         <div slot="imageUrl" slot-scope="text,records">
+          <span v-if="text=='总计'">{{text}}</span>
             <img
+            v-else
             :src="text"
             alt
             style="width:80px"
@@ -169,15 +171,15 @@ const TTcolumns = [
     width: 200,
     fixed: 'left'
   },
-    {
-    title:'相关平面',
-    dataIndex:'operation',
-    key:'operation',
-    scopedSlots: { customRender: 'operation' },
-    align: 'center',
-    width:150,
-    fixed: 'left'
-  },
+  //   {
+  //   title:'相关平面',
+  //   dataIndex:'operation',
+  //   key:'operation',
+  //   scopedSlots: { customRender: 'operation' },
+  //   align: 'center',
+  //   width:150,
+  //   fixed: 'left'
+  // },
   
   {
     title: '消耗(元)',
@@ -269,15 +271,15 @@ const KScolumns = [
     width: 200,
     fixed: 'left'
   },
-    {
-    title:'相关平面',
-    dataIndex:'operation',
-    key:'operation',
-    scopedSlots: { customRender: 'operation' },
-    align: 'center',
-    width:150,
-    fixed: 'left'
-  },
+  //   {
+  //   title:'相关平面',
+  //   dataIndex:'operation',
+  //   key:'operation',
+  //   scopedSlots: { customRender: 'operation' },
+  //   align: 'center',
+  //   width:150,
+  //   fixed: 'left'
+  // },
   
   {
     title: '消耗',
@@ -432,24 +434,30 @@ export default {
         accountID:undefined,
         ipagination: {
             current: 1,
-            pageSize: 10,
+            pageSize: 11,
             //   pageSizeOptions: ['10', '20', '30'],
             showTotal: (total, range) => {
-                return range[0] + "-" + range[1] + " 共" + total + "条"
+              console.log(total,range)
+              if(range[0]>1){
+                return (range[0]-this.ipagination.current+1) + "-" + (range[1]-this.ipagination.current) + " 共" + (total-Math.ceil(this.pageTotal/10)) + "条"
+              }else{
+                return range[0] + "-" + (range[1]-1) + " 共" + (total-Math.ceil(this.pageTotal/10)) + "条"
+              }
+                
             },
             showQuickJumper: true,
-            showSizeChanger:true,
-            pageSizeOptions: ['10', '30', '50'],
+            // showSizeChanger:true,
+            // pageSizeOptions: ['10', '30', '50'],
             total: 0,
-            onChange: (current, pageSize) => {
-                // 切换分页时的回调,
-                // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
-                this.ipagination.current = current;
-                this.ipagination.pageSize= pageSize;
-            }
+            // onChange: (current, pageSize) => {
+            //     // 切换分页时的回调,
+            //     // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
+            //     this.ipagination.current = current;
+            //     this.ipagination.pageSize= pageSize;
+            // }
         },
 
-
+        pageTotal:0,
 
         relevantPeopleVisible:false,
       relevantPeopleData:{},
@@ -490,7 +498,17 @@ export default {
       //
       form: [],
       videoID: '',
-      timedata: []
+      timedata: [],
+      bytedanceUrl:{
+        cost:'/image/bytedance/cost',
+        totalCost:'image/bytedance/costTotal'
+      },
+      kuaishouUrl:{
+        cost:'/image/kuaishou/cost',
+        totalCost:'image/kuaishou/costTotal',
+      },
+
+      totalCost:{},
     }
   },
   // mixins: [JeecgListMixin],
@@ -503,19 +521,20 @@ export default {
         tabChange(val){
           this.accountIds=[];
           this.data=[]
-          this.ipagination.current=1
+          this.ipagination.current=1;
+          this.totalCost={}
           if(this.tabKeys==1){
                 this.treeData=this.TTaccountList;
                 this.columns=this.TTcolumns;
                 this.target='cost';
                 this.scrollX=0;
-                this.HttpPost('/image/bytedance/cost')
+                this.getTableData(this.bytedanceUrl)
             }else if (this.tabKeys==2){
                 this.treeData=this.KSaccountList;
                 this.columns=this.KScolumns
                 this.target='cost'
                 this.scrollX=2500
-                this.HttpPost('/image/kuaishou/cost')
+                this.getTableData(this.kuaishouUrl)
             } 
         },
         treeChange(val) {
@@ -571,8 +590,8 @@ export default {
         })
         },
         sort(pagination, filters, sorter, { currentDataSource }){
-            console.log(pagination, filters, sorter)
-            if(sorter.order == 'ascend'){            
+          console.log(pagination, filters, sorter)
+          if(sorter.order == 'ascend'){            
               this.order='asc'
               this.target=sorter.columnKey;
           }else if(sorter.order == 'descend'){
@@ -584,11 +603,11 @@ export default {
           }   
             this.ipagination.current=pagination.current
             this.ipagination.pageSize= pagination.pageSize;
-
+            
             if(this.tabKeys==1){               
-                this.HttpPost('/image/bytedance/cost')
+                this.getTableData(this.bytedanceUrl)
             }else if (this.tabKeys==2){
-                this.HttpPost('/image/kuaishou/cost')
+                this.getTableData(this.kuaishouUrl)
             } 
         },
         moment,
@@ -615,12 +634,102 @@ export default {
         searchRes() {
             this.data=[];
             this.ipagination.current=1
+            this.totalCost={};
             if(this.tabKeys==1){               
-                this.HttpPost('/image/bytedance/cost')
+                this.getTableData(this.bytedanceUrl)
             }else if (this.tabKeys==2){
-                this.HttpPost('/image/kuaishou/cost')
+                this.getTableData(this.kuaishouUrl)
             } 
         },
+
+        getTableData(type){
+            this.loading=true
+            // this.data=[];
+            let HttpPost = new Promise((resolve, reject) => {
+              postAction(type.cost, {
+                startDate: this.dateValue[0].format('YYYY-MM-DD'),
+                endDate: this.dateValue[1].format('YYYY-MM-DD'),        
+                code: this.videoID,
+                pageNumber:this.ipagination.current,
+                pageSize:this.ipagination.pageSize-1,
+                accountList:this.accountIds,
+                order:this.order,
+                target:this.target,
+              }).then(res => {
+                  let resArr = []
+                  
+                  if (res.success) {
+                    resArr = res.data.list.map((item,index)=>{
+                        return {
+                            ...item,
+                            key:item.signature
+                        }
+                    })
+                    this.pageTotal=res.data.total;
+                    this.ipagination.total = res.data.total+Math.ceil(res.data.total/10)
+                    
+                    resolve(resArr)
+                  }else{
+                      
+                      reject('失败')
+                  }
+              })
+              
+            })
+
+            let totalCostHttp = new Promise((resolve, reject) => {
+              if(this.totalCost.key){
+                  resolve(this.totalCost)
+              }else{
+                postAction(type.totalCost, {
+                  startDate: this.dateValue[0].format('YYYY-MM-DD'),
+                  endDate: this.dateValue[1].format('YYYY-MM-DD'),        
+                  code: this.videoID,
+                  pageNumber:this.ipagination.current,
+                  pageSize:this.ipagination.pageSize,
+                  accountList:this.accountIds,
+                }).then(res => {
+                    console.log(res)
+                    let resArr = []
+                    
+                    if (res.success) {
+                      resArr = res.data;
+                      resArr.imageUrl='总计';
+                      resArr.projectName='-';
+                      resArr.signature='-';
+                      resArr.key='total';
+                      this.totalCost=resArr;
+                      resolve(resArr)
+                    }else{
+                        
+                        reject('失败')
+                    }
+                })
+              }
+              
+            })
+
+
+            Promise.all([HttpPost, totalCostHttp]).then((result) => {
+              console.log(result);             //['成功了', 'success']
+              this.data=[];
+              
+              
+              if(result[0].length){
+                this.data=[
+                  result[1],
+                  ...result[0]
+                ]
+              }
+              
+              console.log(this.data,'---------------------------------------------')
+              this.$forceUpdate()
+              this.loading=false;
+            }).catch((error) => {
+              console.log(error)
+            })
+        },
+
         loadShow(){
             show++
             if(this.data.length>0){
@@ -630,80 +739,73 @@ export default {
             }
         },
         //网络请求table数据函数
-        HttpPost(url){
-          this.loading=true;
-          this.data=[]
-          show = 0
-          postAction(url, {
-              startDate: this.dateValue[0].format('YYYY-MM-DD'),
-              endDate: this.dateValue[1].format('YYYY-MM-DD'),        
-              code: this.videoID,
-              pageNumber:this.ipagination.current,
-              pageSize:this.ipagination.pageSize,
-              accountList:this.accountIds,
-              order:this.order,
-              target:this.target,
-          }).then(res => {
-              let resArr = []
-              this.loading=false;
-              if (res.success) {
-              //   let result = res.result
-              //   this.data.push({ ...result, key: 1 })
-              //   result.map((item, index) => {
-              //     item.key = index
-              //   })
-              this.data = res.data.list.map((item,index)=>{
-                  return {
-                      ...item,
-                      key:index
-                  }
-              })
-              this.ipagination.total = res.data.total
-              this.loading = false
+        // HttpPost(url){
+        //   this.loading=true;
+        //   this.data=[]
+        //   show = 0
+        //   postAction(url, {
+        //       startDate: this.dateValue[0].format('YYYY-MM-DD'),
+        //       endDate: this.dateValue[1].format('YYYY-MM-DD'),        
+        //       code: this.videoID,
+        //       pageNumber:this.ipagination.current,
+        //       pageSize:this.ipagination.pageSize,
+        //       accountList:this.accountIds,
+        //       order:this.order,
+        //       target:this.target,
+        //   }).then(res => {
+        //       let resArr = []
+        //       this.loading=false;
+        //       if (res.success) {
+        //       this.data = res.data.list.map((item,index)=>{
+        //           return {
+        //               ...item,
+        //               key:index
+        //           }
+        //       })
+        //       this.ipagination.total = res.data.total
+        //       this.loading = false
               
-              }else{
-                  this.loading = false
-              }
-          })
-        },
+        //       }else{
+        //           this.loading = false
+        //       }
+        //   })
+        // },
         //导出报表
         exportExcel() {
           this.exportExcelIsOk=true;
         
-        // let column = this.columns.map((item, index) => {
-        //     return item.dataIndex
-        // })
-        //     let columns=['url',...column]
-        let url=''
-        if(this.tabKeys==1){
-          url='/image/bytedance/cost/export'
-        }else{
-          url='/image/kuaishou/cost/export'
-        }
+          // let column = this.columns.map((item, index) => {
+          //     return item.dataIndex
+          // })
+          //     let columns=['url',...column]
+          let url=''
+          if(this.tabKeys==1){
+            url='/image/bytedance/cost/export'
+          }else{
+            url='/image/kuaishou/cost/export'
+          }
             
-        downFilePost(url, {
-              
+          downFilePost(url, {              
               startDate: this.dateValue[0].format('YYYY-MM-DD'),
               endDate: this.dateValue[1].format('YYYY-MM-DD'),        
               code: this.videoID,
               accountList:this.accountIds,
               order:this.order,
               target:this.target,
-        }).then(res => {
-         
-            let blob = new Blob([res], {
-              type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
-            })
-            let downloadElement = document.createElement('a')
-            let href = window.URL.createObjectURL(blob) //创建下载的链接
-            downloadElement.href = href
-            downloadElement.download =  '图片消耗.xlsx' //下载后文件名
-            document.body.appendChild(downloadElement)
-            downloadElement.click() //点击下载
-            document.body.removeChild(downloadElement) //下载完成移除元素
-            window.URL.revokeObjectURL(href) //释放掉blob对象
-            this.exportExcelIsOk=false;
-        })
+            }).then(res => {        
+                let blob = new Blob([res], {
+                  type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+                })
+                let downloadElement = document.createElement('a')
+                let href = window.URL.createObjectURL(blob) //创建下载的链接
+                downloadElement.href = href
+                downloadElement.download =  '图片消耗.xlsx' //下载后文件名
+                document.body.appendChild(downloadElement)
+                downloadElement.click() //点击下载
+                document.body.removeChild(downloadElement) //下载完成移除元素
+                window.URL.revokeObjectURL(href) //释放掉blob对象
+                this.exportExcelIsOk=false;
+          })
         },
 
         //日期选择回调
@@ -800,12 +902,17 @@ export default {
 
 
   },
-  // watch:{
-  //     'ipagination.current':function(n,o){
-  //         console.log(n,o)
-  //         this.HttpPost()
-  //     }
-  // },
+  watch:{
+      // 'ipagination.current':function(n,o){
+      //     console.log(n,o)
+          
+      //       if(this.tabKeys==1){               
+      //           this.getTableData(this.bytedanceUrl)
+      //       }else if (this.tabKeys==2){
+      //           this.getTableData(this.kuaishouUrl)
+      //       } 
+      // }
+  },
  
   filters: {
     
@@ -905,10 +1012,11 @@ export default {
     dateValue:{
         deep:true,
         handler(){
+          this.totalCost={};
             if(this.tabKeys==1){               
-                this.HttpPost('/image/bytedance/cost')
+                this.getTableData(this.bytedanceUrl)
             }else if (this.tabKeys==2){
-                this.HttpPost('/image/kuaishou/cost')
+                this.getTableData(this.kuaishouUrl)
             } 
         }
       }
@@ -918,7 +1026,8 @@ export default {
     
    
    
-    this.HttpPost('/image/bytedance/cost')
+    // this.HttpPost('/image/bytedance/cost')
+    this.getTableData(this.bytedanceUrl)
     this.accountHttp(1);
     this.accountHttp(2);
     
@@ -930,18 +1039,22 @@ export default {
 // .ant-table .ant-table-fixed-left .ant-table-thead {
 //   height: 108px !important ;
 // }
-.vsummary{
+.imageCostReport{
   .ant-table .ant-table-thead .ant-table-header-column .ant-table-column-title {
     // display:block;
     white-space: normal;
     word-break: break-all;
   }
+  
+  .ant-table-tbody .ant-table-row-level-0:first-child{
+    background: #e8e9ea;
+  }
 }
 
 </style>
 
 <style lang="scss" scoped>
-.vsummary {
+.imageCostReport {
   width: 100%;
   height: 100%;
   background:  #fff;

+ 34 - 28
src/views/modules/earlyWarningRules/configRules.vue

@@ -254,9 +254,9 @@
                                                     <div class="rules-list-item">
                                                         <div class="rules-list-item-subject" >
                                                             <a-form-model-item ref="processMethod"  prop="processMethod">
-                                                                <a-select   v-model="item.processMethod" :disabled="!!item.groupId">
+                                                                <a-select   v-model="item.operate" :disabled="!!item.groupId">
                                                                     <a-select-option  value='SEND'>仅发送通知</a-select-option>
-                                                                    <a-select-option  value='PAUSE' >关停</a-select-option>
+                                                                    <a-select-option  value='PAUSE' >关停并发送通知</a-select-option>
                                                                     
                                                                 </a-select>
                                                             </a-form-model-item>
@@ -264,10 +264,10 @@
                                                         <div class="rules-list-item-subject" >
                                                             <a-form-model-item ref="processMethod"  prop="processMethod">
                                                                 <a-select   v-model="item.sendType" :disabled="!!item.groupId">
-                                                                    <a-select-option  value='message' >短信</a-select-option>
-                                                                    <a-select-option  value='enterpriseWechat'>企业微信</a-select-option>
-                                                                    <a-select-option  value='email'>邮箱</a-select-option>
-                                                                    <a-select-option  value='phone'>电话</a-select-option>
+                                                                    <!-- <a-select-option  value='message' >短信</a-select-option> -->
+                                                                    <a-select-option  value='Wechat'>企业微信</a-select-option>
+                                                                    <a-select-option  value='EMAIL'>邮箱</a-select-option>
+                                                                    <!-- <a-select-option  value='phone'>电话</a-select-option> -->
                                                                 </a-select>
                                                             </a-form-model-item>
                                                         </div>
@@ -361,8 +361,8 @@ export default {
                                 isUnlimited:1,
                             },
                         ],
-                        processMethod:'SEND',//预警方式
-                        sendType:'enterpriseWechat',//通知方式
+                        operate:'SEND',//预警方式
+                        sendType:'Wechat',//通知方式
                     },
                 ],
             },
@@ -396,32 +396,38 @@ export default {
     methods: {
         blurTemplateName(){
             console.log(this.form)
-            if(this.templateNameTrue){
-                if(this.form.templateName!=''){
-                    putAction('/ruleTemplate/edit',{id:this.form.templateId,templateName:this.form.templateName}).then(res=>{
+            if(this.currentRuleId){
+                if(this.templateNameTrue){
+                    if(this.form.templateName!=''){
+                        putAction('/ruleTemplate/edit',{id:this.form.templateId,templateName:this.form.templateName}).then(res=>{
+                            if(res.success){
+
+                            }else{
+                            this.$message.error(res.message) 
+                            }
+                        })
+                    }else{
+                        this.$message.error('模板名称不可以为空!!!')
+                    }
+                }
+            }
+            
+        },
+        blurGroupName(item){
+            if(this.currentRuleId){
+                if(item.groupName!=''&&item.remark!=''){
+                    putAction('/ruleGroup/edit',{id:item.groupId,groupName:item.groupName,remark:item.remark}).then(res=>{
                         if(res.success){
 
                         }else{
-                           this.$message.error(res.message) 
+                        this.$message.error(res.message)  
                         }
                     })
                 }else{
-                    this.$message.error('模板名称不可以为空!!!')
+                    this.$message.error('规则名称和规则描述不可以为空!!!')
                 }
             }
-        },
-        blurGroupName(item){
-            if(item.groupName!=''&&item.remark!=''){
-                putAction('/ruleGroup/edit',{id:item.groupId,groupName:item.groupName,remark:item.remark}).then(res=>{
-                    if(res.success){
-
-                    }else{
-                       this.$message.error(res.message)  
-                    }
-                })
-            }else{
-                this.$message.error('规则名称和规则描述不可以为空!!!')
-            }
+            
         },
         ruleTypeChange(item){
             console.log(item)
@@ -530,8 +536,8 @@ export default {
                     ruleRelationship:"and",
                     ruleType:'base',
                     remark:'',
-                    processMethod:'SEND',//预警方式
-                    sendType:'enterpriseWechat',//通知方式
+                    operate:'SEND',//预警方式
+                    sendType:'Wechat',//通知方式
                     isRequired:1,
                     isCopy:0,
                     ruleDetail:[

+ 12 - 5
src/views/modules/workBench/designLeader/platForm.vue

@@ -129,17 +129,23 @@
                         <div class="sectionHead">
                             操作记录
                         </div>
+                        <a-spin :spinning="spinning">
                         <div class="optionRecordList">
-                            <a-timeline>
+                            
+                            <a-timeline >
                                 <a-timeline-item color='#F0F2F5' style="height:46px" v-for="(item,index) in operateRecordList" :key="index">
-                                    <p style="margin-bottom:0px">
-                                        <span class="content-item">{{item.userName}}{{item.operate}}{{item.materialName||item.orderTitle}}</span> 
-                                        <span class="time">{{item.time}}</span>
-                                    </p>
+                                <p style="margin-bottom:0px">
+                                    <span class="content-item">{{item.userName}}{{item.operate}}{{item.materialName||item.orderTitle}}</span> 
+                                    <span class="time">{{item.time}}</span>
+                                </p>
                                 </a-timeline-item>
                                 
                             </a-timeline>
+
+                           
+                            
                         </div>
+                        </a-spin>
                     </div>
                     <!-- <div class="rightBottom">
                         <div class="sectionHead">
@@ -174,6 +180,7 @@ export default {
     name:'designlearder-platform',
     data() {
         return {
+            spinning:false,
             moment,
             roleInfo:{},
             orderProgressSpinning:false,

+ 12 - 5
src/views/modules/workBench/designPeople/platForm.vue

@@ -109,17 +109,23 @@
                         <div class="sectionHead">
                             操作记录
                         </div>
+                        <a-spin :spinning="spinning">
                         <div class="optionRecordList">
-                            <a-timeline>
+                            
+                            <a-timeline >
                                 <a-timeline-item color='#F0F2F5' style="height:46px" v-for="(item,index) in operateRecordList" :key="index">
-                                    <p style="margin-bottom:0px">
-                                        <span class="content-item">{{item.userName}}{{item.operate}}{{item.materialName||item.orderTitle}}</span> 
-                                        <span class="time">{{item.time}}</span>
-                                    </p>
+                                <p style="margin-bottom:0px">
+                                    <span class="content-item">{{item.userName}}{{item.operate}}{{item.materialName||item.orderTitle}}</span> 
+                                    <span class="time">{{item.time}}</span>
+                                </p>
                                 </a-timeline-item>
                                 
                             </a-timeline>
+
+                           
+                            
                         </div>
+                        </a-spin>
                     </div>
                     <!-- <div class="rightBottom">
                         <div class="sectionHead">
@@ -154,6 +160,7 @@ export default {
     name:'design-platform',
     data() {
         return {
+            spinning:false,
             moment,
             roleInfo:{},
             orderProgressSpinning:false,

+ 10 - 3
src/views/modules/workBench/placeOrder.vue

@@ -612,7 +612,7 @@ export default {
         saveHandler(){
              this.$refs.ruleForm.validate(valid=> {
                 if (valid) {
-                    
+                    this.saveLoading=true;
                     console.log(valid,this.form);
                     let params={
                         ...this.form,
@@ -624,9 +624,12 @@ export default {
                     if(!this.$parent.isEdit){
                         postAction('/platform/operator/payout',params).then(res=>{
                             console.log(res);
+                            this.saveLoading=false;
                             if(res.success){
-                                this.$parent.currentTabComponent='operatorPlatform';
+                                this.$parent.orderId=res.result.id
                                 this.$parent.isEdit=false;
+                                this.$parent.currentTabComponent='orderDetail';
+                                
                             }else{
                                 this.$message.error(res.success)
                             }
@@ -638,9 +641,13 @@ export default {
                         }
                         postAction('/platform/operator/rePayout',params).then(res=>{
                             console.log(res);
+                            this.saveLoading=false;
                             if(res.success){
-                                this.$parent.currentTabComponent='operatorPlatform';
                                 this.$parent.isEdit=false;
+                                this.$parent.orderId=this.currentOrderInfo.id
+                                this.$parent.currentTabComponent='orderDetail';
+
+                                
                             }else{
                                 this.$message.error(res.success)
                             }