Преглед изворни кода

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

朱鑫波 пре 4 година
родитељ
комит
b6c04239a2

+ 7 - 0
src/api/actor.js

@@ -153,6 +153,13 @@ export function fileInsertV2(parameter) {
         data: parameter
     })
 }
+export function orderFileInsert(parameter) {
+    return axios({
+        url: "/platform/file/uploadVideo",
+        method: 'post',
+        data: parameter
+    })
+}
 
 
 export function fileEdit(parameter) {

+ 2 - 1
src/views/modules/Statistics/KSAccountReport.vue

@@ -150,7 +150,8 @@
                 <template slot="title">
                   日期选择具体某一天之后,这里可以查看具体的时间段数据哦~
                 </template>
-                  <a-select  placeholder="请选择具体时间段" style="width: 160px" @change="timeChange"  v-model='timeDefaultValue'  label-in-value class="selectTime" v-show="dateValue[0].format('YYYY-MM-DD')==dateValue[1].format('YYYY-MM-DD')" :disabled='accountId.length==0'>
+                <!-- v-show="dateValue[0].format('YYYY-MM-DD')==dateValue[1].format('YYYY-MM-DD')" -->
+                  <a-select  placeholder="请选择具体时间段" style="width: 160px" @change="timeChange"  v-model='timeDefaultValue'  label-in-value class="selectTime" v-show="dateValue[1].format('YYYY-MM-DD')==moment().format('YYYY-MM-DD')" :disabled='accountId.length==0'>
                     <a-select-option v-for="(i,index) in 24 " :key="index" :value="index" >{{index>=10 ? `00:00-${index}:59` :`00:00-0${index}:59`}}</a-select-option>
                   </a-select>
               </a-tooltip>

+ 2 - 2
src/views/modules/Statistics/accountReport.vue

@@ -150,7 +150,7 @@
                 <template slot="title">
                   日期选择具体某一天之后,这里可以查看具体的时间段数据哦~
                 </template>
-                  <a-select  placeholder="请选择具体时间段" style="width: 160px" @change="timeChange"  v-model='timeDefaultValue'  label-in-value class="selectTime" v-show="dateValue[0].format('YYYY-MM-DD')==dateValue[1].format('YYYY-MM-DD')" :disabled='accountId.length==0'>
+                  <a-select  placeholder="请选择具体时间段" style="width: 160px" @change="timeChange"  v-model='timeDefaultValue'  label-in-value class="selectTime" v-show="dateValue[1].format('YYYY-MM-DD')==moment().format('YYYY-MM-DD')" :disabled='accountId.length==0'>
                     <a-select-option v-for="(i,index) in 24 " :key="index" :value="index" >{{index>=10 ? `00:00-${index}:59` :`00:00-0${index}:59`}}</a-select-option>
                   </a-select>
               </a-tooltip>
@@ -444,7 +444,7 @@ export default {
 
   data() {
     return {
-      
+      todayDate:moment(),
       moment,
       //账户的数据
       accountId:[],

+ 8 - 5
src/views/modules/earlyWarningRules/configRules.vue

@@ -166,7 +166,7 @@
                                         <div class="title">                                            
                                             <a-form-model-item ref="ruleRelationship"  prop="ruleRelationship">
                                                 <span class="condition-title">如果</span>
-                                                <a-select  style="width: 300px" v-model="item.ruleRelationship">
+                                                <a-select  style="width: 300px" v-model="item.ruleRelationship" :disabled="!!item.groupId">
                                                     <a-select-option  value='and'>满足以下所有条件</a-select-option>
                                                     <a-select-option  value='or'>满足以下任意条件</a-select-option>
                                                 </a-select>
@@ -242,7 +242,7 @@
                                                     
                                             </div>
                                                
-                                            <div class="add-rule" @click="addCondition(item,index)" > 添加条件</div>
+                                            <div class="add-rule" @click="addCondition(item,index)" v-show="item.ruleType=='group'"> 添加条件</div>
                                         </div>
                                     </div>
                                     <div class="toolbox-automate-rules-create-content_rules-and-condition_rules">
@@ -424,11 +424,14 @@ export default {
             }
         },
         ruleTypeChange(item){
-            
+            console.log(item)
             if(item.ruleType=='base'){
-                item.isCopy=0
+                item.isCopy=0;
+                item.ruleDetail=item.ruleDetail.filter((item,index)=>{
+                    return index==0
+                })
             }
-            
+            console.log(item)
         },
         inputCheck(val){
             console.log(val)

+ 1 - 0
src/views/modules/earlyWarningRules/ruleModule.vue

@@ -1087,6 +1087,7 @@ export default {
     this.editShow = data.edit
     if (data.edit) {
       this.spinLoading = true
+      
       getAction('/ruleTemplate/queryDetailByAccountIdAndTemplateId', {
         templateId: data.id,
         accountId: data.accountId,

+ 221 - 56
src/views/modules/workBench/designLeader/platForm.vue

@@ -7,11 +7,11 @@
                     <img src="@/assets/touxiang.png"  alt="">
                 </div>  
                 <div class='tip'>
-                    <p class="greet">早安,{{userInfo.username}},祝你开心每一天!</p>
+                    <p class="greet">{{getTimeState()}},{{roleInfo.realname}},祝你开心每一天!</p>
                     <p class="descPosition">
-                        <span>运营经理</span>
+                        <span>{{roleInfo.roleName}}</span>
                         <a-divider type="vertical" />
-                        <span>华北地区-头条事业部</span>
+                        <span>{{roleInfo.area}}地区-{{roleInfo.departName}}</span>
                     </p>
                 </div>
             </div>
@@ -30,16 +30,16 @@
                                     <span>待确定的订单</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.toDecided||0}} <span>个</span></p>
                                 </div>                               
                             </div>
-                            <div class="item" @click="goOrderList(2)">                               
+                            <div class="item" @click="goMaterialList(4)">                               
                                 <div class="title">
                                     <img src="@/assets/work.png" alt="" class="iconImg">
-                                    <span>待指派的订单</span>
+                                    <span>待指派的物料</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.toPayOut||0}} <span>个</span></p>
                                 </div>                               
                             </div>
                             
@@ -49,7 +49,7 @@
                                     <span>我参与的物料</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.myMaterial||0}} <span>个</span></p>
                                 </div>                               
                             </div>
                             
@@ -59,7 +59,7 @@
                                     <span>被驳回的物料</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.rejectMaterial||0}} <span>个</span></p>
                                 </div>                                
                             </div>
                             <div class="item" @click="goOrderList(3)">                               
@@ -68,7 +68,7 @@
                                     <span>已完成的订单</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.finishOrder||0}} <span>个</span></p>
                                 </div>                              
                             </div>
                            
@@ -78,7 +78,7 @@
                                     <span>全部订单</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.allOrder||0}} <span>个</span></p>
                                 </div>                               
                             </div>
                             
@@ -88,31 +88,39 @@
                     <div class="leftBottom">
                         <div class="sectionHead">
                             订单进度
-                             <a-button type="link" class="allOrder" @click="goOrderList(4)">全部订单</a-button>
+                             <!-- <a-button type="link" class="allOrder" @click="goOrderList(4)">全部订单</a-button> -->
                         </div>
                         <div class="orderProgress">
-                            <ul class="orderProgress-list">
+                            <a-spin :spinning="orderProgressSpinning">
+                            <ul class="orderProgress-list" v-if="orderProgressList.length>0">
                                 <li v-for="(item,index) in orderProgressList" :key="index"  >
                                     
                                     <div style="display:flex;align-items: center;" class="orderProgress-list-item" @click="orderDetail(item)">
                                         <div style="display:flex;width:80%; align-items: center;" >
                                             <span class="item-icon"></span>
                                             <div class="content">
-                                                <p class="name">我是一个任务名称嗷嗷嗷啊</p>
-                                                <p class="desc">这是对这个任务的简介,所以得好好寻…</p>
+                                                <p class="name">{{item.orderTitle}}</p>
+                                                <p class="desc">{{item.orderRemark}}</p>
                                             </div>
                                         </div>
                                         
-                                        <div class="progress">
-                                            <a-progress type="circle" :percent="75" :width='30' :showInfo='false'  :strokeWidth='10' />
-                                            <span style="margin-left:15px">75%</span>
+                                        <div class="progress" v-if="item.orderStatus==1||item.orderStatus==3">
+                                            <a-progress type="circle" :percent="(item.materialFinishAmount/item.materialAmount)*100" :width='30' :showInfo='false'  :strokeWidth='10' />
+                                            <span style="margin-left:15px">{{(item.materialFinishAmount/item.materialAmount)*100}}%</span>
+                                        </div>
+                                        <div class="progress" v-else>
+                                            {{item.orderStatus|handleOrderStatus}}
                                         </div>
                                     </div>
                                     
                                 </li>
                             </ul>
+                            <div   v-else style="width:100%;height:585px;line-height:585px;text-align:center">                               
+                                <img src="@/assets/nodata.png" alt="" style="width:300px;text-align:center">
+                            </div>
                             <!-- hideOnSinglePage -->
                             <a-pagination size="small" :total="totalPage" :current='currentPage' class="fenye" :change='pageChange'  show-size-changer show-quick-jumper hideOnSinglePage />
+                            </a-spin>
                         </div>
                     </div>
                 </div>
@@ -123,35 +131,17 @@
                         </div>
                         <div class="optionRecordList">
                             <a-timeline>
-                                <a-timeline-item color='#F0F2F5' style="height:30px">
-                                   <p style="margin-bottom:0px">
-                                    <span class="content-item">Create a services site 2015-09-01</span> 
-                                    <span class="time">1分钟前</span>
-                                   </p>
-                                </a-timeline-item>
-                                <a-timeline-item color='#F0F2F5' style="height:30px">
-                                   <p style="margin-bottom:0px">
-                                    <span class="content-item">Create a services site 2015-09-01</span> 
-                                    <span class="time">1分钟前</span>
-                                   </p>
-                                </a-timeline-item>
-                                <a-timeline-item color='#F0F2F5' style="height:30px">
-                                   <p style="margin-bottom:0px">
-                                    <span class="content-item">Create a services site 2015-09-01</span> 
-                                    <span class="time">1分钟前</span>
-                                   </p>
-                                </a-timeline-item>
-                                <a-timeline-item color='#F0F2F5' style="height:30px">
-                                   <p style="margin-bottom:0px">
-                                    <span class="content-item">Create a services site 2015-09-01</span> 
-                                    <span class="time">1分钟前</span>
-                                   </p>
+                                <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>
                                 </a-timeline-item>
                                 
                             </a-timeline>
                         </div>
                     </div>
-                    <div class="rightBottom">
+                    <!-- <div class="rightBottom">
                         <div class="sectionHead">
                             本周项目燃尽图
                         </div>
@@ -168,7 +158,7 @@
                                 </p>
                              </div>
                         </div>
-                    </div>
+                    </div> -->
                 </div>
                 
             </div>
@@ -184,12 +174,14 @@ export default {
     name:'designlearder-platform',
     data() {
         return {
+            moment,
+            roleInfo:{},
+            orderProgressSpinning:false,
+            countInfo:{},
             touxiang:'@/assets/touxiang.png',
             // 订单进度
             orderProgressList:[
-                {},
-                {},
-                {}
+               
             ],
 
             // 操作记录
@@ -202,7 +194,9 @@ export default {
             totalPage:0,
             currentPage:1,
             userInfo:{},
-            roleCode:''
+            roleCode:'',
+            operateRecordList:[],
+            TimerObj:null
         }
     },
     methods: {
@@ -224,12 +218,130 @@ export default {
         },
         // 分页页码改变
         pageChange(page, pageSize){
-
+             this.currentPage=page;
+            this.getOrderList()
         },
         // 全部订单
         allOrder() {
             this.$router.push('/workBench/orderList')
         },
+        // 获取订单列表
+        getOrderList(){
+            this.orderProgressSpinning=true;
+            let params={
+                design:this.userInfo.id,
+                pageNo:this.currentPage,
+                pageSize:10,
+            }
+            getAction('/platform/order/listByCreatorOrDesignLeader',params).then(res=>{
+                console.log(res);
+                this.loading=false;
+                this.orderProgressSpinning=false;
+                if(res.success){
+                    this.orderProgressList=res.result.list;
+                    this.totalPage=res.result.total;
+
+                }
+            })
+        },
+        // 操作记录
+        getOperationRecord(){
+            this.spinning=true;
+            getAction('/platform/operateRecord/createDesc').then(res=>{
+                console.log(res)
+                 this.spinning=false;
+                if(res.success){
+                    this.operateRecordList=res.result.list.map((item,index)=>{
+                       
+                            let time='';
+                            let startTime=moment(item.createTime)
+                            console.log() 
+                            if(moment().diff(startTime,'minutes')>60){
+                                time=item.createTime.split(/[ ]+/)[1]
+                                return {
+                                    ...item,
+                                    time,
+                                }
+                            }else if(moment().diff(startTime,'minutes')>=1){
+                                time=moment().diff(startTime,'minutes')+'分钟前'
+                                return {
+                                    ...item,
+                                    time,
+                                }
+                            }else if(moment().diff(startTime,'minutes')==0){
+                                time=moment().diff(startTime,'seconds')+'秒前'
+                                return {
+                                    ...item,
+                                    time,
+                                }
+                            }
+                        
+                        
+                    });
+
+                   
+                }
+            })
+        },
+        
+        scrollRecord(){
+            console.log(this.$refs.scrollRecord);
+            this.TimerObj=setInterval(()=>{
+                this.getOperationRecord()
+
+            },60000)            
+        },
+
+        // 获取工作台内容
+        getPlantformInfo(){
+            getAction('/platform/query/jobContent').then(res=>{
+                console.log(res)
+                if(res.success){
+                    if(this.$parent.role=='operator'){
+                        this.countInfo=res.result.operatorJobContent
+                    }else if(this.$parent.role=='design'){
+                        this.countInfo=res.result.designJobContent
+                    }else if(this.$parent.role=='designLeader'){
+                        this.countInfo=res.result.designLeaderJobContent
+                    }
+                }
+            })
+        },
+
+
+         getTimeState () {
+            // 获取当前时间
+            let timeNow = new Date();
+            // 获取当前小时
+            let hours = timeNow.getHours();
+            // 设置默认文字
+            let text = ``;
+            // 判断当前时间段
+            if (hours >= 0 && hours <= 5) {
+                text = `凌晨好`;
+            }else if(hours >= 6 && hours <= 9){
+                text = `早上好`;
+            } else if(hours > 9 && hours <= 12){
+                text = `上午好`;
+            }else if (hours > 12 && hours <= 14) {
+                text = `中午好`;
+            } else if (hours > 14 && hours <= 18) {
+                text = `下午好`;
+            } else if (hours > 18 && hours <= 24) {
+                text = `晚上好`;
+            }
+            // 返回当前时间段对应的状态
+            return text
+        },
+
+        getidentity(){
+            getAction('/platform/query/identity',{}).then(res=>{
+                console.log(res);
+                if(res.success){
+                    this.roleInfo=res.result
+                }
+            })
+        }
         
     },
     mounted(){
@@ -238,9 +350,54 @@ export default {
             this.userInfo=JSON.parse(userInfo).value
         }
         this.roleCode=localStorage.getItem('roleCode')
+        this.getOrderList()
+        this.getOperationRecord()
+        this.scrollRecord()
+        this.getPlantformInfo()
+        this.getidentity();
+    },
+    beforeDestroy(){
+        clearInterval(this.TimerObj)
+    },
+    activated(){
+        let userInfo=localStorage.getItem('pro__Login_Userinfo');
+        if(userInfo){
+            this.userInfo=JSON.parse(userInfo).value
+        }
+        this.roleCode=localStorage.getItem('roleCode')
+        this.getOrderList()
+        this.getOperationRecord()
         
-        
-    }
+        this.getPlantformInfo()
+        this.getidentity();
+    },
+    filters:{
+        handleOrderStatus(val){
+            let text
+            switch (val) {
+                case 0:
+                    text='待接单'
+                    break;
+                case 1:
+                    text='制作中'
+                    break;
+                case 2:
+                    text='已驳回'
+                    break;
+                case 3:
+                    text='已完成'
+                    break;
+                case -1:
+                    text='已撤回'
+                    break;
+            
+                default:
+                    text='出错'
+                    break;
+            }
+            return text
+        }
+    },
 }
 
 </script>
@@ -383,6 +540,7 @@ export default {
                     background: white;
                     .orderProgress{
                         padding: 0 20px;
+                        height: 585px;
                         .orderProgress-list-item{
                             padding: 10px 0;
                             display: flex;
@@ -436,29 +594,36 @@ export default {
             }
             .sectionRightBox{
                 width: 29.5%;
-                // background: white;
+                background: white;
                 margin-left: 12px;
+                height: 1023px;
                 .rightTop{
-                    height: 370px;
-                     background: white;
+                   
+                    
                      .optionRecordList{
-                         padding: 20px;
+                         margin: 20px;
+                          padding: 10px 0;
+                         box-sizing: border-box;
+                          height: 928px;
+                        //  overflow: auto;
+                        overflow: hidden;
                          p{
                              width: 100%;
                          }
                         .content-item{
-                            width: 80%;
+                            width: 70%;
                             display: inline-block;
                             overflow: hidden;
                             text-overflow: ellipsis;
                             white-space: nowrap;
                         }
                         .time{
-                            width: 20%;
+                            width: 30%;
                             display: inline-block;
                             overflow: hidden;
                             text-overflow: ellipsis;
                             white-space: nowrap;
+                            text-align: right;
                         }
                      }
                 }

+ 2 - 2
src/views/modules/workBench/designPeople/index.vue

@@ -11,7 +11,7 @@ import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
 
 export default {
     components:{
-        designrPlatform: () => import('./platForm'), 
+        designPlatform: () => import('./platForm'), 
         orderList: () => import('../orderList'), 
         orderDetail: () => import('../orderDetail'), 
         materialList: () => import('../materialList'), 
@@ -19,7 +19,7 @@ export default {
 
     data() {
         return {
-            currentTabComponent:'designrPlatform',
+            currentTabComponent:'designPlatform',
             orderStatus:undefined,//跳转到订单详情时需要里面的参数  status订单参数 role 当前角色
             role:'design',
             materialStatus:undefined,

+ 228 - 57
src/views/modules/workBench/designPeople/platForm.vue

@@ -7,11 +7,11 @@
                     <img src="@/assets/touxiang.png"  alt="">
                 </div>  
                 <div class='tip'>
-                    <p class="greet">早安,{{userInfo.username}},祝你开心每一天!</p>
+                    <p class="greet">{{getTimeState()}},{{roleInfo.realname}},祝你开心每一天!</p>
                     <p class="descPosition">
-                        <span>运营经理</span>
+                        <span>{{roleInfo.roleName}}</span>
                         <a-divider type="vertical" />
-                        <span>华北地区-头条事业部</span>
+                        <span>{{roleInfo.area}}地区-{{roleInfo.departName}}</span>
                     </p>
                 </div>
             </div>
@@ -30,7 +30,7 @@
                                     <span>指派给我的物料</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.myMaterial || 0}} <span>个</span></p>
                                 </div>
                                 
                             </div>
@@ -40,7 +40,7 @@
                                     <span>被驳回的物料</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.rejectMaterial || 0}} <span>个</span></p>
                                 </div>                                
                             </div>
                             
@@ -50,7 +50,7 @@
                                     <span>已完成的物料</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.finishMaterial || 0}} <span>个</span></p>
                                 </div>                              
                             </div>
                             <div class="item" @click="goMaterialList(4)">                                
@@ -59,7 +59,7 @@
                                     <span>全部物料</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count" >60 <span>个</span></p>
+                                    <p class="count" >{{countInfo.allMaterial || 0}} <span>个</span></p>
                                 </div>                                
                             </div>
                         </div>  
@@ -67,31 +67,40 @@
                     <div class="leftBottom">
                         <div class="sectionHead">
                             订单进度
-                             <a-button type="link" class="allOrder" @click="allOrder">全部订单</a-button>
+                             <!-- <a-button type="link" class="allOrder" @click="goOrderList(4)">全部订单</a-button> -->
                         </div>
                         <div class="orderProgress">
-                            <ul class="orderProgress-list">
+                            <a-spin :spinning="orderProgressSpinning">
+                            <ul class="orderProgress-list" v-if="orderProgressList.length>0">
                                 <li v-for="(item,index) in orderProgressList" :key="index"  >
-                                    <router-link to="/workBench/orderDetail" style="display:block;width:100%">
-                                    <div style="display:flex;align-items: center;" class="orderProgress-list-item">
+                                    
+                                    <div style="display:flex;align-items: center;" class="orderProgress-list-item" @click="orderDetail(item)">
                                         <div style="display:flex;width:80%; align-items: center;" >
                                             <span class="item-icon"></span>
                                             <div class="content">
-                                                <p class="name">我是一个任务名称嗷嗷嗷啊</p>
-                                                <p class="desc">这是对这个任务的简介,所以得好好寻…</p>
+                                                <p class="name">{{item.orderTitle}}</p>
+                                                <p class="desc">{{item.orderRemark}}</p>
                                             </div>
                                         </div>
                                         
-                                        <div class="progress">
-                                            <a-progress type="circle" :percent="75" :width='30' :showInfo='false'  :strokeWidth='10' />
-                                            <span style="margin-left:15px">75%</span>
+                                        <div class="progress" v-if="item.orderStatus==1||item.orderStatus==3">
+                                            <a-progress type="circle" :percent="(item.materialFinishAmount/item.materialAmount)*100" :width='30' :showInfo='false'  :strokeWidth='10' />
+                                            <span style="margin-left:15px">{{(item.materialFinishAmount/item.materialAmount)*100}}%</span>
+                                        </div>
+                                        <div class="progress" v-else>
+                                            {{item.orderStatus|handleOrderStatus}}
                                         </div>
                                     </div>
-                                    </router-link>
+                                    
                                 </li>
                             </ul>
+                            <div   v-else style="width:100%;height:585px;line-height:585px;text-align:center">
+                               
+                                <img src="@/assets/nodata.png" alt="" style="width:300px;text-align:center">
+                            </div>
                             <!-- hideOnSinglePage -->
                             <a-pagination size="small" :total="totalPage" :current='currentPage' class="fenye" :change='pageChange'  show-size-changer show-quick-jumper hideOnSinglePage />
+                            </a-spin>
                         </div>
                     </div>
                 </div>
@@ -102,35 +111,17 @@
                         </div>
                         <div class="optionRecordList">
                             <a-timeline>
-                                <a-timeline-item color='#F0F2F5' style="height:30px">
-                                   <p style="margin-bottom:0px">
-                                    <span class="content-item">Create a services site 2015-09-01</span> 
-                                    <span class="time">1分钟前</span>
-                                   </p>
-                                </a-timeline-item>
-                                <a-timeline-item color='#F0F2F5' style="height:30px">
-                                   <p style="margin-bottom:0px">
-                                    <span class="content-item">Create a services site 2015-09-01</span> 
-                                    <span class="time">1分钟前</span>
-                                   </p>
-                                </a-timeline-item>
-                                <a-timeline-item color='#F0F2F5' style="height:30px">
-                                   <p style="margin-bottom:0px">
-                                    <span class="content-item">Create a services site 2015-09-01</span> 
-                                    <span class="time">1分钟前</span>
-                                   </p>
-                                </a-timeline-item>
-                                <a-timeline-item color='#F0F2F5' style="height:30px">
-                                   <p style="margin-bottom:0px">
-                                    <span class="content-item">Create a services site 2015-09-01</span> 
-                                    <span class="time">1分钟前</span>
-                                   </p>
+                                <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>
                                 </a-timeline-item>
                                 
                             </a-timeline>
                         </div>
                     </div>
-                    <div class="rightBottom">
+                    <!-- <div class="rightBottom">
                         <div class="sectionHead">
                             本周项目燃尽图
                         </div>
@@ -147,7 +138,7 @@
                                 </p>
                              </div>
                         </div>
-                    </div>
+                    </div> -->
                 </div>
                 
             </div>
@@ -163,12 +154,13 @@ export default {
     name:'design-platform',
     data() {
         return {
+            moment,
+            roleInfo:{},
+            orderProgressSpinning:false,
             touxiang:'@/assets/touxiang.png',
             // 订单进度
             orderProgressList:[
-                {},
-                {},
-                {}
+                
             ],
 
             // 操作记录
@@ -181,10 +173,18 @@ export default {
             totalPage:0,
             currentPage:1,
             userInfo:{},
-            roleCode:''
+            roleCode:'',
+            operateRecordList:[],
+            TimerObj:null,
+            countInfo:{},
         }
     },
     methods: {
+        orderDetail(item){
+            console.log(item)
+            this.$parent.currentTabComponent='orderDetail';
+            this.$parent.orderId=item.id
+        },
          goOrderList(val){
             console.log(val);
             // console.log(this.$parent)
@@ -208,6 +208,125 @@ export default {
         sendOrder(){
             this.$router.push('/workBench/placeOrder')
         },
+        
+        // 获取订单列表
+        getOrderList(){
+            this.orderProgressSpinning=true;
+            let params={
+                design:this.userInfo.id,
+                pageNo:this.currentPage,
+                pageSize:10,
+            }
+            getAction('/platform/order/listByCreatorOrDesignLeader',params).then(res=>{
+                console.log(res);
+                this.loading=false;
+                this.orderProgressSpinning=false;
+                if(res.success){
+                    
+                    this.orderProgressList=res.result.list;
+                    this.totalPage=res.result.total;
+
+                }
+            })
+        },
+
+        // 操作记录
+        getOperationRecord(){
+            this.spinning=true;
+            getAction('/platform/operateRecord/createDesc').then(res=>{
+                console.log(res)
+                this.spinning=false;
+                if(res.success){
+                    this.operateRecordList=res.result.list.map((item,index)=>{
+                        
+                        let time='';
+                        let startTime=moment(item.createTime)
+                        console.log() 
+                        if(moment().diff(startTime,'minutes')>60){
+                            time=item.createTime.split(/[ ]+/)[1]
+                            return {
+                                ...item,
+                                time,
+                            }
+                        }else if(moment().diff(startTime,'minutes')>=1){
+                            time=moment().diff(startTime,'minutes')+'分钟前'
+                            return {
+                                ...item,
+                                time,
+                            }
+                        }else if(moment().diff(startTime,'minutes')==0){
+                            time=moment().diff(startTime,'seconds')+'秒前'
+                            return {
+                                ...item,
+                                time,
+                            }
+                        }
+                        
+                    });
+
+                    
+                }
+            })
+        },
+        
+        scrollRecord(){
+            console.log(this.$refs.scrollRecord);
+            this.TimerObj=setInterval(()=>{
+                this.getOperationRecord()
+
+            },60000)            
+        },
+
+        // 获取工作台内容
+        getPlantformInfo(){
+            getAction('/platform/query/jobContent').then(res=>{
+                console.log(res)
+                if(res.success){
+                    if(this.$parent.role=='operator'){
+                        this.countInfo=res.result.operatorJobContent
+                    }else if(this.$parent.role=='design'){
+                        this.countInfo=res.result.designJobContent
+                    }else if(this.$parent.role=='designLeader'){
+                        this.countInfo=res.result.designLeaderJobContent
+                    }
+                }
+            })
+        },
+
+         getTimeState () {
+            // 获取当前时间
+            let timeNow = new Date();
+            // 获取当前小时
+            let hours = timeNow.getHours();
+            // 设置默认文字
+            let text = ``;
+            // 判断当前时间段
+            if (hours >= 0 && hours <= 5) {
+                text = `凌晨好`;
+            }else if(hours >= 6 && hours <= 9){
+                text = `早上好`;
+            } else if(hours > 9 && hours <= 12){
+                text = `上午好`;
+            }else if (hours > 12 && hours <= 14) {
+                text = `中午好`;
+            } else if (hours > 14 && hours <= 18) {
+                text = `下午好`;
+            } else if (hours > 18 && hours <= 24) {
+                text = `晚上好`;
+            }
+            // 返回当前时间段对应的状态
+            return text
+        },
+
+        getidentity(){
+            getAction('/platform/query/identity',{}).then(res=>{
+                console.log(res);
+                if(res.success){
+                    this.roleInfo=res.result
+                }
+            })
+        }
+        
     },
     mounted(){
         let userInfo=localStorage.getItem('pro__Login_Userinfo');
@@ -215,9 +334,53 @@ export default {
             this.userInfo=JSON.parse(userInfo).value
         }
         this.roleCode=localStorage.getItem('roleCode')
-        
-        
-    }
+        this.getOrderList()
+        this.getOperationRecord()
+        this.scrollRecord()
+        this.getPlantformInfo()
+        this.getidentity()
+    },
+    activated(){
+        let userInfo=localStorage.getItem('pro__Login_Userinfo');
+        if(userInfo){
+            this.userInfo=JSON.parse(userInfo).value
+        }
+        this.roleCode=localStorage.getItem('roleCode')
+        this.getOrderList()
+        this.getOperationRecord()
+        this.getPlantformInfo()
+        this.getidentity()
+    },
+    beforeDestroy(){
+        clearInterval(this.TimerObj)
+    },
+    filters:{
+        handleOrderStatus(val){
+            let text
+            switch (val) {
+                case 0:
+                    text='待接单'
+                    break;
+                case 1:
+                    text='制作中'
+                    break;
+                case 2:
+                    text='已驳回'
+                    break;
+                case 3:
+                    text='已完成'
+                    break;
+                case -1:
+                    text='已撤回'
+                    break;
+            
+                default:
+                    text='出错'
+                    break;
+            }
+            return text
+        }
+    },
 }
 
 </script>
@@ -360,6 +523,7 @@ export default {
                     background: white;
                     .orderProgress{
                         padding: 0 20px;
+                        height: 585px;
                         .orderProgress-list-item{
                             padding: 10px 0;
                             display: flex;
@@ -413,31 +577,38 @@ export default {
             }
             .sectionRightBox{
                 width: 29.5%;
-                // background: white;
+                background: white;
                 margin-left: 12px;
+                height: 1023px;
                 .rightTop{
-                    height: 370px;
-                     background: white;
-                     .optionRecordList{
-                         padding: 20px;
+                   
+                    
+                    .optionRecordList{
+                        margin: 20px;
+                        padding: 10px 0;
+                        box-sizing: border-box;
+                          height: 928px;
+                        //  overflow: auto;
+                        overflow: hidden;
                          p{
                              width: 100%;
                          }
                         .content-item{
-                            width: 80%;
+                            width: 70%;
                             display: inline-block;
                             overflow: hidden;
                             text-overflow: ellipsis;
                             white-space: nowrap;
                         }
                         .time{
-                            width: 20%;
+                            width: 30%;
                             display: inline-block;
                             overflow: hidden;
                             text-overflow: ellipsis;
                             white-space: nowrap;
+                            text-align: right;
                         }
-                     }
+                    }
                 }
                 .rightBottom{
                     margin-top: 12px;

Разлика између датотеке није приказан због своје велике величине
+ 1247 - 188
src/views/modules/workBench/materialList.vue


+ 1 - 0
src/views/modules/workBench/operator/index.vue

@@ -19,6 +19,7 @@ export default {
             role:'operator',
             materialStatus:undefined,
             orderId:undefined,
+            isEdit:false,
         }
     },
     components:{   

+ 335 - 138
src/views/modules/workBench/operator/materialList.vue

@@ -227,14 +227,19 @@
     }
 }
 .videoBox{
-    width: 320px;
-    height: 180px;
+   
+    height: 240px;
 }
 .imgBox{
-    width: 100%;
-    height: 180px;
+   
+  width: 90%;
+}
+.videomarterialInfo{
+    position: relative;
+    height: 800px;
 }
 .marterialInfo{
+    overflow: auto;
     
     p{margin-bottom: 0;}
     ul,li{
@@ -245,11 +250,13 @@
         margin-bottom: 20px;
         display: flex;
         // justify-content: center;
-        align-items: center;
+        align-items: flex-start;
         span{
             display: inline-block;
             width: 70px;
             text-align: left;
+            flex-shrink: 0;
+            text-align: right;
         }
         .ant-tag{
             width: auto;
@@ -258,10 +265,13 @@
         }
     }
     .info{
+        width: 100%;
         ul{
+            width: 100%;
             display: flex;
             justify-content: space-between;
             flex-wrap: wrap;
+            width: 100%;
         }
         li{
             width: 33.3%;
@@ -269,14 +279,26 @@
         }
         margin-bottom: 0;
     }
+    
     .bottom-btn{
-        width: 100%;
+        width: 100%; 
         text-align: center;
         position: absolute;
-        bottom: 20px;
+        bottom: 0px;
         left: 0;
+        // margin-top: 20px;
 
     }
+    .scriptbottom-btn{
+        width: 100%; 
+        // height: 60px;  
+        line-height: 60px;   
+        text-align: center;
+        position: absolute;
+        bottom: 20px;
+        left: 0;
+       
+    }
 }
 </style>
 
@@ -316,7 +338,7 @@
                 <div class="section-item">
                     <div class="tabBox">
                         
-                        <div class="search-item">
+                        <!-- <div class="search-item">
                             <span>名称:</span>
                             <a-input placeholder="请输入订单名称" allow-clear v-model="materialName" style="width:300px" />
                         </div>
@@ -333,7 +355,7 @@
                         <div class="opt-item">
                             <a-button type='primary' @click="search" style="margin-right:20px">查询</a-button>
                             <a-button type='default' @click="reset">查询</a-button>
-                        </div>
+                        </div> -->
                     </div>
                         
                     
@@ -350,35 +372,26 @@
                             >
                             <div slot="materialStatus" slot-scope="text" >
                                 <span class="wancheng" v-if="text==7"> </span>
-                                <span class="bohui" v-else-if="text==6||text==4"> </span>
+                                <span class="bohui" v-else-if="text==6||text==3"> </span>
                                 <span class="shenhe" v-else> </span>
-                                {{text | handleMaterialStatus}}
+                                {{text | handlerMaterialStatus}}
                             </div>
                             <div slot="scriptStatus" slot-scope="text,record">
-                                <div v-if="text==0||text==2">脚本未上传</div>
-                                <div v-if="text==1">
-                                    <a href="javascript:;" @click="scriptViewDetails(record)">预览</a>
-                                    <a-divider type="vertical" />
-                                    <a href="javascript:;" @click="scriptApproved(record)">通过</a>
-                                    <a-divider type="vertical" />
-                                    <a href="javascript:;" @click="scriptReject(record)">驳回</a>
-                                </div>
-                                <div v-if="text==3">
-                                     <a href="javascript:;" @click="scriptViewDetails(record)">预览</a>
-                                </div>
+                                <span v-if="record.materialStatus==0">-</span>
+                                <span v-else>
+                                     <a href="javascript:;" @click="scriptViewDetails(record)">{{record.planName}}</a>
+                                </span>
                             </div>
                             <div slot="videoStatus" slot-scope="text,record">
-                                <div v-if="text==0||text==2">视频未上传</div>
-                                <div v-if="text==1">
-                                    <a href="javascript:;" @click="viewDetails(record)">预览</a>
-                                    <a-divider type="vertical" />
-                                    <a href="javascript:;" @click="approved(record)">通过</a>
-                                    <a-divider type="vertical" />
-                                    <a href="javascript:;" @click="reject(record)">驳回</a>
-                                </div>
-                                <div v-if="text==3">
-                                     <a href="javascript:;" @click="viewDetails(record)">预览</a>
-                                </div>
+                                <span v-if="record.materialStatus==0">-</span>
+                                <span v-else>
+                                     <a href="javascript:;" @click="viewDetails(record)">{{record.clipName}}</a>
+                                </span>
+                            </div>
+                            <div slot="orderTitle" slot-scope="text,record">
+                               
+                                <a href="javascript:;" @click="goOrderDetail(record)">{{text}}</a>
+                                
                             </div>
                            
 
@@ -386,110 +399,135 @@
                     </div>
                     <a-drawer
                     title="视频详情"
-                    width="640"
+                    width="700"
                     :placement="placement"
                     :closable="false"
                     :visible="visible"
                     @close="onClose"
                     >
-                        <div class="videoBody">
-                            <div class="videoBox">
-                                <video :src="currentMaterial.src" ></video>
-                            </div>
-                            
-                            <div class="imgBox">
-                                <img src="" alt="">
-                                <img src="" alt="">
-                            </div>
-                        </div>
-                        <div class="marterialInfo">
+
+                        <div class="marterialInfo videomarterialInfo">
                             <div class="info-item">
-                                <span>素材状态:</span>
-                                <p>未审核</p>
+                                <span>视频状态:</span>
+                                <p>{{ currentVideo.videoStatus | handlerVideoStatus }}</p>
                             </div>
                             <div class="info-item">
-                                <span>生成水印:</span>
-                                <a-select :defaultValue="4" v-model="size" style="width:70%;">
-                                    <a-select-option :value="item.id" :key="item.id" v-for="item of sizeType">{{
-                                        item.name
-                                    }}</a-select-option>
-                                </a-select>
-                                
+                                <span>视频预览:</span>
+                                <div class="videoBox" v-if="currentVideo.videoStatus==1||currentVideo.videoStatus==3">
+                                    <video style="height:100%" :src="currentVideo.url" v-if="currentVideo.url" controls></video>
+                                    <img :src="defaultPic" alt="" style="height:100%" v-else>
+                                </div>
                             </div>
                             <div class="info-item">
+                                <span>封面预览:</span>
+                                <div class="imgBox">
+                                    <img  alt="" style="width:100px;margin:0 10px 8px 0" v-for="(item,index) in currentVideo.imgList" :key='index' :src="item">                                   
+                                </div>
+                            </div>
+                            <div class="info-item" v-if="currentVideo.videoStatus==1">
                                 <span>视频标签:</span>
-                                <a-tag>Tag 1</a-tag>
-                                <a-tag>Tag 1</a-tag>
+                                <p>
+                                    <a-tag v-for="(item,index) in currentVideo.tagList" :key="index" style="margin-bottom:8px">{{item}}</a-tag>
+                                    <!-- {{currentVideo.tag}} -->
+                                </p>
                             </div>
                             <div class="info-item info">
                                 <ul>
-                                    <li><span>视频时长:</span> 17秒 </li>
-                                    <li><span>视频尺寸:</span> 1080*1920 </li>
-                                    <li><span>视频大小:</span> 31.42M </li>
-                                    <li><span>策划:</span> 吴永前 </li>
-                                    <li><span>拍摄:</span> 吴永前 </li>
-                                    <li><span>剪辑:</span> 吴永前 </li>                                    
+                                   
+                                    <li><span>编导:</span> {{ currentVideo.planName }} </li>
+                                    <li><span>拍摄:</span> {{ currentVideo.shotName }} </li>
+                                    <li><span>剪辑:</span> {{ currentVideo.clipName }} </li>                                    
                                 </ul>
                             </div>
-                            <div class="info-item">
-                                <span>广告语:</span>
-                                <p>14354534324454354水电费水电费方式手动</p>
+                            <div class="info-item" v-if="currentVideo.videoStatus==2">
+                                <span>驳回理由:</span>
+                                <p>{{ currentVideo.videoAdvise }}</p>
                             </div>
+                            
                             <div class="bottom-btn">
-                                <a-button type='primary' @click="approved" style="margin-right:20px">通过审核</a-button>
-                                <a-button type='default' @click="reject">驳回</a-button>
+                                <a-button type='primary' @click="approved" v-if="currentMaterial.materialStatus==5" :loading='acceptLoading' style="margin-right:20px">通过审核</a-button>                               
+                                <a-button type='default' @click="()=>{videoRejectVisiable=true}" v-if="currentMaterial.materialStatus==5"  style="margin-right:20px">驳回</a-button>
+                                                            
+                                <a-button type='default' @click="onClose">关闭</a-button>
                             </div>
+                            
+                            
                         </div>
                     </a-drawer>
                     <a-drawer
                     title="脚本详情"
-                    width="640"
+                    width="600"
                     :placement="placement"
                     :closable="false"
                     :visible="scriptVisible"
                     @close="scriptClose"
                     >
-                        <div class="videoBody">
-                            <div class="videoBox">
-                                <video :src="currentMaterial.src" ></video>
-                            </div>
-                            
-                            <div class="imgBox">
-                                <img src="" alt="">
-                                <img src="" alt="">
-                            </div>
-                        </div>
+                        
                         <div class="marterialInfo">
                             <div class="info-item">
                                 <span>脚本状态:</span>
-                                <p>未审核</p>
+                                <p>{{ currentScript.scriptStatus | handlerVideoStatus }}</p>
                             </div>
                             <div class="info-item">
                                 <span>所属项目:</span>
-                                <p>所属项目:充电得宝 快手 北京汇创思拓有限公司</p>
+                                <p>{{currentScript.projectName}}</p>
                                 
                             </div>
                             <div class="info-item">
                                 <span>所属物料:</span>
-                                <p>所属项目:充电得宝 快手 北京汇创思拓有限公司</p>
+                                <p>{{currentScript.materialName}}</p>
                             </div>
                             <div class="info-item">
                                 <span>编导:</span>
-                                <p>吴永前</p>
+                                <p>{{currentScript.planName}}</p>
+                            </div>
+                            <div class="info-item" v-if="currentScript.scriptStatus==2">
+                                <span>驳回理由:</span>
+                                <p>{{currentScript.scriptAdvise}}</p>
                             </div>
                             <div class="info-item">
                                 <span>脚本:</span>
-                                <p></p>
+                                <p v-if="currentScript.scriptStatus==0">暂无</p>
+                                <p v-else><a :href="currentScript.url">{{currentScript.scriptName}}</a></p>
+
                             </div>
                                                        
-                            <div class="bottom-btn">
-                                <a-button type='primary' @click="approved" style="margin-right:20px">通过审核</a-button>
-                                <a-button type='default' @click="reject">驳回</a-button>
-                                <a-button type='default' @click="dowmLoadScript">下载脚本</a-button>
+                            <div class="scriptbottom-btn">
+                                <a-button type='primary' @click="scriptApproved" v-if="currentMaterial.materialStatus==2" style="margin-right:20px" >通过审核</a-button>
+                               
+                                <a-button type='default' v-if="currentMaterial.materialStatus==2" @click="()=>{scriptRejectVisiable=true}"  style="margin-right:20px">驳回</a-button>
+                                
                                 <a-button type='default' @click="scriptClose">关闭</a-button>
                             </div>
                         </div>
                     </a-drawer>
+
+                    <!-- bohui -->
+                <a-modal v-model="videoRejectVisiable" title="视频驳回"  width='600px'>
+                     <template slot="footer">
+                        <a-button key="back" @click="()=>{videoRejectVisiable=false}">取消</a-button>
+                        <a-button type="primary"  @click="reject" :loading="loadingElse">确定驳回</a-button>
+                    </template>
+                   <a-textarea
+                    v-model="videoAdvise"
+                    placeholder="请填写驳回理由"
+                    :auto-size="{ minRows: 3, maxRows: 5 }"
+                    />
+                </a-modal>
+                <a-modal v-model="scriptRejectVisiable" title="脚本驳回"  width='600px'>
+                     <template slot="footer">
+                        <a-button key="back" @click="()=>{scriptRejectVisiable=false}">取消</a-button>
+                        <a-button type="primary"  @click="scriptReject" :loading="loadingElse">确定驳回</a-button>
+                    </template>                   
+                    
+                        <a-textarea
+                        v-model="scriptAdvise"
+                        placeholder="请填写驳回理由"
+                        :auto-size="{ minRows: 3, maxRows: 5 }"
+                        />
+                                      
+                </a-modal>
+                
                 </div>
             </div>
         </div>
@@ -505,17 +543,17 @@ import qs from 'qs'
 let columns=[
     {
         title: '物料名称',
-        dataIndex: 'orderTitle',
+        dataIndex: 'materialName',
         align: 'center',        
-        key: 'orderTitle',
-        scopedSlots: { customRender: 'orderTitle' }
+        key: 'materialName',
+        scopedSlots: { customRender: 'materialName' }
     },
     {
         title: '物料编号',
-        dataIndex: 'id',
+        dataIndex: 'materialId',
         align: 'center',        
         key: 'tag',
-        scopedSlots: { customRender: 'id' }
+        scopedSlots: { customRender: 'materialId' }
     },
     {
         title: '物料状态',
@@ -541,10 +579,10 @@ let columns=[
     },
     {
         title: '所属订单',
-        dataIndex: 'materialFinishTime',
+        dataIndex: 'orderTitle',
         align: 'center',        
-        key: 'materialFinishTime',
-        scopedSlots: { customRender: 'materialFinishTime' }
+        key: 'orderTitle',
+        scopedSlots: { customRender: 'orderTitle' }
     },
    
 ]
@@ -559,7 +597,17 @@ export default {
             { title: '视频列表', content: '', key: 2 , },           
         ];
         return {
-            
+            loadingElse:false,
+            videoRejectVisiable:false,
+            scriptRejectVisiable:false,
+
+            acceptLoading:false,
+            videoAdvise:'',
+            scriptAdvise:'',
+            currentScript:{},
+            currentVideo:{},
+
+
             userInfo:{},
             roleCode:'',
 
@@ -603,22 +651,31 @@ export default {
 
             sizeType:[],
             size: "4",
+
+            url:{
+                scriptDetail:'/platform/material/scriptDetail',
+                videoDetail:'/platform/material/videoDetail',
+                scriptAccept:'/platform/material/script/accept',
+                scriptReject:'/platform/material/script/reject',
+                videoAccept:'/platform/material/video/accept',
+                videoReject:'/platform/material/video/reject',
+            }
         }
     },
     methods: {
-        closeBox(){
-
-        },
-        dowmLoadScript(){
-            
+        goOrderDetail(record){
+            console.log(record)
+            this.$parent.currentTabComponent='orderDetail';
+            this.$parent.orderId=record.orderId
         },
+        
         goPlantForm(){
             if(this.$parent.role=='operator'){
                 this.$parent.currentTabComponent='operatorPlatform'
             }else if(this.$parent.role=='designLeader'){
                 this.$parent.currentTabComponent='designleaderPlatform'
             }else if(this.$parent.role=='design'){
-                this.$parent.currentTabComponent='operatorPlatform'
+                this.$parent.currentTabComponent='designPlatform'
             }
         },
         tabChange(key){
@@ -636,16 +693,65 @@ export default {
             );
         },
 
-        // 查看详情
+        // 视频查看详情
         viewDetails(record){
             console.log(record)
-           this.visible=true;
+             this.currentMaterial=record
+            if(record.materialStatus>=4){              
+                this.currentVideo={};                
+                if(record.videoId){
+                    getAction(this.url.videoDetail,{
+                        videoId:record.videoId
+                    }).then(res=>{
+                        console.log(res);
+                        if(res.success){
+                            if(res.result){
+                                let tagList=res.result.tag.split(',')
+                                let imgList=res.result.imageUrl.split(',')
+                                console.log(tagList)
+                                this.currentVideo={
+                                    ...res.result,
+                                    tagList,
+                                    imgList
+                                }
+                            }
+                            
+                            this.visible = true;
+                        }else{
+                            this.currentVideo={};
+                        }
+                    })
+                }else{
+                    this.currentVideo=record
+                    this.visible = true;
+                }
+            }else{
+                this.$message.error('请等待脚本审核通过后,上传视频')
+            }
+            
         },
-        // 查看详情
+        // 脚本查看详情
         scriptViewDetails(record){
             console.log(record)
-            this.scriptVisible=true;
-            // this.$router.push(`/workBench/orderDetail?orderId=${record.id}`)
+            this.currentMaterial=record
+            this.currentScript={};
+            if(record.scriptId){
+                getAction(this.url.scriptDetail,{
+                    scriptId:record.scriptId
+                }).then(res=>{
+                    console.log(res);
+                    if(res.success){
+                        this.currentScript=res.result;
+                        this.scriptVisible = true;
+                    }else{
+                        this.currentScript={};
+                    }
+                })
+            }else{
+                this.currentScript=record
+                this.scriptVisible = true;
+            }
+            
         },
         
         
@@ -680,25 +786,92 @@ export default {
             this.ipagination.current=pagination.current;
 
             this.ipagination.pageSize=pagination.pageSize;
-            this.materialHttp()
-        },
-        // 请求素材
-        materialHttp(){
-            // this.loading=true;           
-            this.data=[];
+            this.tableHttp(this.$parent.materialStatus)
         },
-
+       
         
 
         
 
+        // 脚本通过审核
+        scriptApproved(){
+            postAction(this.url.scriptAccept,{
+                id:this.currentMaterial.materialId,
+                orderCode:this.currentMaterial.orderCode,
+                materialCode:this.currentMaterial.materialCode
+            }).then(res=>{
+                console.log(res);
+
+                this.scriptVisible=false;
+                if(res.success){
+                    this.$message.success(res.message);
+                    this.tableHttp(this.$parent.materialStatus)
+                }else{
+                    this.$message.error(res.message)
+                }
+            })
+        },
+        // 脚本驳回
+        scriptReject(){
+            this.loadingElse=true
+            postAction(this.url.scriptReject,{
+                id:this.currentMaterial.materialId,
+                scriptAdvise:this.scriptAdvise,
+                materialCode:this.currentMaterial.materialCode
+            }).then(res=>{
+                console.log(res);
+
+                this.scriptVisible=false;
+                this.loadingElse=false;
+                this.scriptRejectVisiable=false
+                if(res.success){
+                    this.$message.success(res.message);
+                    this.tableHttp(this.$parent.materialStatus)
+                }else{
+                    this.$message.error(res.message)
+                }
+            })
+        },
         // 视频通过审核
         approved(){
-
+            this.acceptLoading=true;
+            postAction(this.url.videoAccept,{
+                id:this.currentMaterial.materialId,
+                orderCode:this.currentMaterial.orderCode,
+                materialCode:this.currentMaterial.materialCode,
+                videoId:this.currentVideo.videoId
+            }).then(res=>{
+                console.log(res);
+                this.acceptLoading=false;
+                this.visible=false;
+                if(res.success){
+                    this.$message.success(res.message);
+                    this.tableHttp(this.$parent.materialStatus)
+                }else{
+                    this.$message.error(res.message)
+                }
+            })
         },
         // 视频驳回
         reject(){
+            this.loadingElse=true
+            postAction(this.url.videoReject,{
+                id:this.currentMaterial.materialId,
+                videoAdvise:this.videoAdvise,
+                materialCode:this.currentMaterial.materialCode
+            }).then(res=>{
+                console.log(res);
 
+                this.visible=false;
+                this.loadingElse=false;
+                this.videoRejectVisiable=false
+                if(res.success){
+                    this.$message.success(res.message);
+                    this.tableHttp(this.$parent.materialStatus)
+                }else{
+                    this.$message.error(res.message)
+                }
+            })
         },
         
         search(){
@@ -713,6 +886,7 @@ export default {
         },
 
         tableHttp(type){
+            this.loading=true;
             let  params=this.handlerParams(type)
             params={
                 ...params,
@@ -720,10 +894,11 @@ export default {
                 pageSize:this.ipagination.pageSize
             }
             console.log(params)
-            getAction('/platform/designer/listByOperatorUserId',params).then(res=>{
+            getAction('/platform/material/listByOperatorUserId',params).then(res=>{
                 console.log(res);
                 if(res.success){
-                    this.data=res.result.records;
+                    this.loading=false;
+                    this.data=res.result.list;
                     this.ipagination.total=res.result.total;
 
                 }
@@ -734,8 +909,7 @@ export default {
             if(this.$parent.role=='operator'){
                 if(status==1){
                     return {
-                        materialStatus:0,
-                        createBy:this.userInfo.id
+                        operatorUserId:this.userInfo.id
                     }
                 }
             }else if(this.$parent.role=='designLeader'){
@@ -784,50 +958,73 @@ export default {
         }
         this.roleCode=localStorage.getItem('roleCode')
         console.log(this.$parent.materialStatus)
+        this.tableHttp(this.$parent.materialStatus)
+        this.activeKey=this.$parent.materialStatus
     },
     activated() {
         
-        this.activeKey=this.$parent.materialStatus
-        this.tableHttp(this.$parent.materialStatus)
+       
+        // this.tableHttp(this.$parent.materialStatus)
     },
     filters:{
-        handleMaterialStatus(val){
-            let text
-            switch (val) {
+        handlerMaterialStatus(val){
+            let str='';
+            switch(val){
+                
                 case 0:
-                    text='待指派'
+                    str= '待指派'
                     break;
                 case 1:
-                    text='脚本已上传'
+                    str= '脚本待上传'
                     break;
                 case 2:
-                    text='脚本待审核'
+                    str= '脚本待审核'
                     break;
                 case 3:
-                    text='视频待上传'
+                    str= '脚本被驳回'
                     break;
                 case 4:
-                    text='脚本被驳回'
+                    str= '视频待上传'
                     break;
                 case 5:
-                    text='视频待审核'
+                    str= '视频待审核'
                     break;
                 case 6:
-                    text='视频被驳回'
+                    str= '视频被驳回'
                     break;
                 case 7:
-                    text='物料已完成'
+                    str= '物料已完结'
                     break;
-                case -1:
-                    text='已作废'
+                default:
+                    str='出错了'
+                    break;
+            }
+            return str
+        },
+
+        handlerVideoStatus(val){
+            let str='';
+            switch(val){
+                
+                case 0:
+                    str= '待上传'
+                    break;
+                case 1:
+                    str= '待审核'
+                    break;
+                case 2:
+                    str= '被驳回'
+                    break;
+                case 3:
+                    str= '已审核'
                     break;
-            
                 default:
-                    text='出错'
+                    str='出错了'
                     break;
             }
-            return text
-        }
+            return str
+        },
+
     },
 
 }

+ 241 - 55
src/views/modules/workBench/operator/platForm.vue

@@ -7,11 +7,11 @@
                     <img src="@/assets/touxiang.png"  alt="">
                 </div>  
                 <div class='tip'>
-                    <p class="greet">早安,{{userInfo.username}},祝你开心每一天!</p>
+                    <p class="greet">{{getTimeState()}},{{roleInfo.realname}},祝你开心每一天!</p>
                     <p class="descPosition">
-                        <span>运营经理</span>
+                        <span>{{roleInfo.roleName}}</span>
                         <a-divider type="vertical" />
-                        <span>华北地区-头条事业部</span>
+                        <span>{{roleInfo.area}}地区-{{roleInfo.departName}}</span>
                     </p>
                 </div>
                 <a-button type='primary' class="mybtn" @click="sendOrder">
@@ -35,7 +35,7 @@
                                     <span>我发起的订单</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.newOrder || 0}} <span>个</span></p>
                                 </div>
                             </div>
                             <div class="item" @click="goMaterialList(1)">                                
@@ -44,7 +44,7 @@
                                     <span>待审核的物料</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.toAuditMaterial || 0}}<span>个</span></p>
                                 </div>                              
                             </div>
                            
@@ -54,7 +54,7 @@
                                     <span>已完成的订单</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.finishOrder ||0}}<span>个</span></p>
                                 </div>
                             </div>
                             <div class="item" @click="goOrderList(3)">                                
@@ -63,48 +63,57 @@
                                     <span>被驳回的订单</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.rejectOrder || 0}} <span>个</span></p>
                                 </div>
                             </div>
-                            <div class="item" @click="goOrderList(4)">                                
+                            <!-- <div class="item" @click="goOrderList(4)">                                
                                 <div class="title">
                                     <img src="@/assets/work.png" alt="" class="iconImg">
                                     <span>全部订单</span>
                                 </div>
                                 <div class="itemBody">
-                                    <p class="count">60 <span>个</span></p>
+                                    <p class="count">{{countInfo.allOrder}}<span>个</span></p>
                                 </div>                                
-                            </div>
+                            </div> -->
                         </div>  
                     </div>
                     <div class="leftBottom">
                         <div class="sectionHead">
                             订单进度
-                             <a-button type="link" class="allOrder" @click="goOrderList(4)">全部订单</a-button>
+                             <!-- <a-button type="link" class="allOrder" @click="goOrderList(1)">全部订单</a-button> -->
                         </div>
                         <div class="orderProgress">
-                            <ul class="orderProgress-list">
+                            <a-spin :spinning="orderProgressSpinning">
+                            <ul class="orderProgress-list" v-if="orderProgressList.length>0">
                                 <li v-for="(item,index) in orderProgressList" :key="index"  >
                                     <!-- <span  style="display:block;width:100%"> -->
                                     <div style="display:flex;align-items: center;" class="orderProgress-list-item" @click="orderDetail(item)">
                                         <div style="display:flex;width:80%; align-items: center;" >
                                             <span class="item-icon"></span>
                                             <div class="content">
-                                                <p class="name">我是一个任务名称嗷嗷嗷啊</p>
-                                                <p class="desc">这是对这个任务的简介,所以得好好寻…</p>
+                                                <p class="name">{{item.orderTitle}}</p>
+                                                <p class="desc">{{item.orderRemark}}</p>
                                             </div>
                                         </div>
                                         
-                                        <div class="progress">
-                                            <a-progress type="circle" :percent="75" :width='30' :showInfo='false'  :strokeWidth='10' />
-                                            <span style="margin-left:15px">75%</span>
+                                        <div class="progress" v-if="item.orderStatus==1||item.orderStatus==3">
+                                            <a-progress type="circle" :percent="(item.materialFinishAmount/item.materialAmount)*100" :width='30' :showInfo='false'  :strokeWidth='10' />
+                                            <span style="margin-left:15px">{{(item.materialFinishAmount/item.materialAmount)*100}}%</span>
+                                        </div>
+                                        <div class="progress" v-else>
+                                            {{item.orderStatus|handleOrderStatus}}
                                         </div>
                                     </div>
                                     <!-- </span> -->
                                 </li>
                             </ul>
+                            <div   v-else style="width:100%;height:585px;line-height:585px;text-align:center">
+                               
+                                <img src="@/assets/nodata.png" alt="" style="width:300px;text-align:center">
+                            </div>
                             <!-- hideOnSinglePage -->
                             <a-pagination size="small" :total="totalPage" :current='currentPage' class="fenye" :change='pageChange'  show-size-changer show-quick-jumper hideOnSinglePage />
+                            </a-spin>
                         </div>
                     </div>
                 </div>
@@ -113,37 +122,25 @@
                         <div class="sectionHead">
                             操作记录
                         </div>
+                        <a-spin :spinning="spinning">
                         <div class="optionRecordList">
-                            <a-timeline>
-                                <a-timeline-item color='#F0F2F5' style="height:30px">
-                                   <p style="margin-bottom:0px">
-                                    <span class="content-item">Create a services site 2015-09-01</span> 
-                                    <span class="time">1分钟前</span>
-                                   </p>
-                                </a-timeline-item>
-                                <a-timeline-item color='#F0F2F5' style="height:30px">
-                                   <p style="margin-bottom:0px">
-                                    <span class="content-item">Create a services site 2015-09-01</span> 
-                                    <span class="time">1分钟前</span>
-                                   </p>
-                                </a-timeline-item>
-                                <a-timeline-item color='#F0F2F5' style="height:30px">
-                                   <p style="margin-bottom:0px">
-                                    <span class="content-item">Create a services site 2015-09-01</span> 
-                                    <span class="time">1分钟前</span>
-                                   </p>
-                                </a-timeline-item>
-                                <a-timeline-item color='#F0F2F5' style="height:30px">
-                                   <p style="margin-bottom:0px">
-                                    <span class="content-item">Create a services site 2015-09-01</span> 
-                                    <span class="time">1分钟前</span>
-                                   </p>
+                            
+                            <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>
                                 </a-timeline-item>
                                 
                             </a-timeline>
+
+                           
+                            
                         </div>
+                        </a-spin>
                     </div>
-                    <div class="rightBottom">
+                    <!-- <div class="rightBottom">
                         <div class="sectionHead">
                             本周项目燃尽图
                         </div>
@@ -160,7 +157,8 @@
                                 </p>
                              </div>
                         </div>
-                    </div>
+                    </div> -->
+
                 </div>
                 
             </div>
@@ -176,12 +174,17 @@ export default {
     name:'operator-platform',
     data() {
         return {
+            moment,
+            roleInfo:{},
+            todayGreet:moment(),
+            orderProgressSpinning:false,
+            countInfo:{},
+
+            spinning:false,
             touxiang:'@/assets/touxiang.png',
             // 订单进度
             orderProgressList:[
-                {},
-                {},
-                {}
+                
             ],
 
             // 操作记录
@@ -194,7 +197,11 @@ export default {
             totalPage:0,
             currentPage:1,
             userInfo:{},
-            roleCode:''
+            roleCode:'',
+
+            operateRecordList:[],
+
+            TimerObj:null,
         }
     },
     methods: {
@@ -216,7 +223,8 @@ export default {
         },
         // 分页页码改变
         pageChange(page, pageSize){
-
+            this.currentPage=page;
+            this.getOrderList()
         },
         
         // 发起订单
@@ -224,6 +232,129 @@ export default {
             this.$parent.currentTabComponent='placeOrder';
             
         },
+        // 获取订单列表
+        getOrderList(){
+          
+            let params={
+                createBy:this.userInfo.id,
+                pageNo:this.currentPage,
+                pageSize:10,
+            }
+            this.orderProgressSpinning=true;
+            getAction('/platform/order/listByCreatorOrDesignLeader',params).then(res=>{
+                console.log(res);
+                this.loading=false;
+                this.orderProgressSpinning=false;
+                if(res.success){
+
+                    this.orderProgressList=res.result.list;
+                    this.totalPage=res.result.total;
+
+                }
+            })
+        },
+
+        // 操作记录
+        getOperationRecord(){
+            this.spinning=true;
+            getAction('/platform/operateRecord/createDesc').then(res=>{
+                console.log(res)
+                this.spinning=false;
+                if(res.success){
+                    this.operateRecordList=res.result.list.map((item,index)=>{
+                       
+                            let time='';
+                            let startTime=moment(item.createTime)
+                            console.log() 
+                            if(moment().diff(startTime,'minutes')>60){
+                                time=item.createTime.split(/[ ]+/)[1]
+                                return {
+                                    ...item,
+                                    time,
+                                }
+                            }else if(moment().diff(startTime,'minutes')>=1){
+                                time=moment().diff(startTime,'minutes')+'分钟前'
+                                return {
+                                    ...item,
+                                    time,
+                                }
+                            }else if(moment().diff(startTime,'minutes')==0){
+                                time=moment().diff(startTime,'seconds')+'秒前'
+                                return {
+                                    ...item,
+                                    time,
+                                }
+                            }
+                        
+                        
+                        
+                    });
+
+                    
+                }
+            })
+        },
+        
+        scrollRecord(){
+            console.log(this.$refs.scrollRecord);
+            this.TimerObj=setInterval(()=>{
+                this.getOperationRecord()
+
+            },60000)            
+        },
+
+
+        // 获取工作台内容
+        getPlantformInfo(){
+            getAction('/platform/query/jobContent').then(res=>{
+                console.log(res)
+                if(res.success){
+                    if(this.$parent.role=='operator'){
+                        this.countInfo=res.result.operatorJobContent
+                    }else if(this.$parent.role=='design'){
+                        this.countInfo=res.result.designJobContent
+                    }else if(this.$parent.role=='designLeader'){
+                        this.countInfo=res.result.designLeaderJobContent
+                    }
+                }
+            })
+        },
+
+
+        getTimeState () {
+            // 获取当前时间
+            let timeNow = new Date();
+            // 获取当前小时
+            let hours = timeNow.getHours();
+            // 设置默认文字
+            let text = ``;
+            // 判断当前时间段
+            if (hours >= 0 && hours <= 5) {
+                text = `凌晨好`;
+            }else if(hours >= 6 && hours <= 9){
+                text = `早上好`;
+            } else if(hours > 9 && hours <= 12){
+                text = `上午好`;
+            }else if (hours > 12 && hours <= 14) {
+                text = `中午好`;
+            } else if (hours > 14 && hours <= 18) {
+                text = `下午好`;
+            } else if (hours > 18 && hours <= 24) {
+                text = `晚上好`;
+            }
+            // 返回当前时间段对应的状态
+            return text
+        },
+
+        getidentity(){
+            getAction('/platform/query/identity',{}).then(res=>{
+                console.log(res);
+                if(res.success){
+                    this.roleInfo=res.result
+                }
+            })
+        }
+
     },
     mounted(){
         let userInfo=localStorage.getItem('pro__Login_Userinfo');
@@ -231,9 +362,56 @@ export default {
             this.userInfo=JSON.parse(userInfo).value
         }
         this.roleCode=localStorage.getItem('roleCode')
+        this.getOrderList()
+        this.getOperationRecord()
+        this.scrollRecord()
+        this.getPlantformInfo()
+        this.getidentity()
         
+    },
+    activated(){
+        let userInfo=localStorage.getItem('pro__Login_Userinfo');
+        if(userInfo){
+            this.userInfo=JSON.parse(userInfo).value
+        }
+        this.roleCode=localStorage.getItem('roleCode')
+        this.getOrderList()
+        this.getOperationRecord()
         
-    }
+        this.getPlantformInfo()
+        this.getidentity()
+    },
+    beforeDestroy(){
+        clearInterval(this.TimerObj)
+    },
+    filters:{
+        handleOrderStatus(val){
+            let text
+            switch (val) {
+                case 0:
+                    text='待接单'
+                    break;
+                case 1:
+                    text='制作中'
+                    break;
+                case 2:
+                    text='已驳回'
+                    break;
+                case 3:
+                    text='已完成'
+                    break;
+                case -1:
+                    text='已撤回'
+                    break;
+            
+                default:
+                    text='出错'
+                    break;
+            }
+            return text
+        }
+    },
+    
 }
 
 </script>
@@ -376,6 +554,7 @@ export default {
                     background: white;
                     .orderProgress{
                         padding: 0 20px;
+                        height: 585px;
                         .orderProgress-list-item{
                             padding: 10px 0;
                             display: flex;
@@ -429,29 +608,36 @@ export default {
             }
             .sectionRightBox{
                 width: 29.5%;
-                // background: white;
+                background: white;
                 margin-left: 12px;
+                height: 1023px;
                 .rightTop{
-                    height: 370px;
-                     background: white;
+                  
                      .optionRecordList{
-                         padding: 20px;
+                         margin: 20px;
+                         padding: 10px 0;
+                         box-sizing: border-box;
+                          height: 928px;
+                        //  overflow: auto;
+                        overflow: hidden;
+                        position: relative;
                          p{
                              width: 100%;
                          }
                         .content-item{
-                            width: 80%;
+                            width: 70%;
                             display: inline-block;
                             overflow: hidden;
                             text-overflow: ellipsis;
                             white-space: nowrap;
                         }
                         .time{
-                            width: 20%;
+                            width: 30%;
                             display: inline-block;
                             overflow: hidden;
                             text-overflow: ellipsis;
                             white-space: nowrap;
+                            text-align: right;
                         }
                      }
                 }

Разлика између датотеке није приказан због своје велике величине
+ 1460 - 181
src/views/modules/workBench/orderDetail.vue


+ 42 - 31
src/views/modules/workBench/orderList.vue

@@ -319,17 +319,17 @@
                         
                         <div class="search-item">
                             <span>订单名称:</span>
-                            <a-input placeholder="请输入订单名称" allow-clear v-model="orderName" style="width:300px" />
+                            <a-input placeholder="请输入订单名称" allow-clear v-model="orderTitle" style="width:200px" />
                         </div>
                         <div class="search-item">
                             <span>订单编号:</span>
-                            <a-input placeholder="请输入订单编号" allow-clear v-model="orderId" style="width:300px" />
+                            <a-input placeholder="请输入订单编号" allow-clear v-model="id" style="width:200px" />
                         </div>
                         
 
                         <div class="search-item">
                             <span>发起的人:</span>
-                            <a-input placeholder="请输入订单发起人" allow-clear v-model="orderSponsor" style="width:300px" />
+                            <a-input placeholder="请输入订单发起人" allow-clear v-model="createByName" style="width:200px" />
                         </div>
                         <div class="opt-item">
                             <a-button type='primary' @click="search" style="margin-right:20px">查询</a-button>
@@ -357,13 +357,13 @@
                             <span slot="options" slot-scope="text,record">
                                 <a href="javascript:;" @click="viewDetails(record)">详情</a>                                                           
                             </span>
-                            <span slot="materialFinishTime" slot-scope="text">
+                            <span slot="updateTime" slot-scope="text">
                                 {{text||'-'}}                                                    
                             </span>
 
                         </a-table>
                     </div>
-                    <a-drawer
+                    <!-- <a-drawer
                     title="素材详情"
                     width="640"
                     :placement="placement"
@@ -419,7 +419,7 @@
                                 <a-button type='default' @click="reject">驳回</a-button>
                             </div>
                         </div>
-                    </a-drawer>
+                    </a-drawer> -->
                 </div>
             </div>
         </div>
@@ -449,10 +449,10 @@ let listColumns=[
     },
     {
         title: '订单发起人',
-        dataIndex: 'status',
+        dataIndex: 'createByName',
         align: 'center',        
-        key: 'status',
-        scopedSlots: { customRender: 'status' }
+        key: 'createByName',
+        scopedSlots: { customRender: 'createByName' }
     },
     {
         title: '订单状态',
@@ -463,10 +463,10 @@ let listColumns=[
     },
     {
         title: '更新时间',
-        dataIndex: 'materialFinishTime',
+        dataIndex: 'updateTime',
         align: 'center',        
-        key: 'materialFinishTime',
-        scopedSlots: { customRender: 'materialFinishTime' }
+        key: 'updateTime',
+        scopedSlots: { customRender: 'updateTime' }
     },
     {
         title: '操作',
@@ -483,7 +483,6 @@ export default {
     name:'order-list',
     data() {
         const operatorPanes = [
-            { title: '全部订单', content: '', key: 4 , },
             { title: '我发起的', content: '', key: 1 , },           
             { title: '已完成的', content: '', key: 2 ,},
             { title: '被驳回的', content: '', key: 3 , },
@@ -492,11 +491,17 @@ export default {
         const designLeaderPanes=[
             { title: '全部订单', content: '', key: 4 , },
             { title: '待确定的', content: '', key: 1 , },
-            { title: '待指派的', content: '', key: 2 , },
             { title: '已完成的', content: '', key: 3 ,},
             
         ]
         return {
+            orderTitle:'',
+            createByName:'',
+            id:'',
+            loadingElse:false,
+            videoRejectVisiable:false,
+            scriptRejectVisiable:false,
+
             operatorPanes,
             designLeaderPanes,
             userInfo:{},
@@ -550,7 +555,7 @@ export default {
             }else if(this.$parent.role=='designLeader'){
                 this.$parent.currentTabComponent='designleaderPlatform'
             }else if(this.$parent.role=='design'){
-                this.$parent.currentTabComponent='operatorPlatform'
+                this.$parent.currentTabComponent='designPlatform'
             }
         },
         tabChange(key){
@@ -629,19 +634,29 @@ export default {
         },
         
         search(){
-
+            this.tableHttp(this.activeKey)
         },
         reset(){
-            this.orderName='';
-            this.orderId='';
-            this.orderStatus='';
-            this.orderParticipants="";
-            this.orderSponsor='';
+            this.orderTitle='';
+            this.id='';
+            this.createByName='';
+            
         },
 
         tableHttp(type){
             let  params=this.handlerParams(type)
             this.loading=true;
+            if(this.id){
+                params.id=this.id
+            }
+            if(this.orderTitle){
+                params.orderTitle=this.orderTitle
+            }
+            if(this.createByName){
+                params.createByName=this.createByName
+            }
+           
+               
             params={
                 ...params,
                 pageNo:this.ipagination.current,
@@ -651,7 +666,7 @@ export default {
                 console.log(res);
                 this.loading=false;
                 if(res.success){
-                    this.data=res.result.records;
+                    this.data=res.result.list;
                     this.ipagination.total=res.result.total;
 
                 }
@@ -662,7 +677,7 @@ export default {
             if(this.$parent.role=='operator'){
                 if(status==1){
                     return {
-                        orderStatus:0,
+                        
                         createBy:this.userInfo.id
                     }
                 }else if(status==2){
@@ -675,11 +690,7 @@ export default {
                         orderStatus:2,
                         createBy:this.userInfo.id
                     }
-                }else if(status==4){
-                    return {
-                        createBy:this.userInfo.id
-                    }
-                }   
+                } 
             }else if(this.$parent.role=='designLeader'){
                 if(status==1){
                     return {
@@ -726,7 +737,7 @@ export default {
             this.panes=this.designLeaderPanes
         }
         this.activeKey=this.$parent.orderStatus
-
+        this.tableHttp(this.$parent.orderStatus)
 
     },
     filters:{
@@ -737,7 +748,7 @@ export default {
                     text='待接单'
                     break;
                 case 1:
-                    text='已接单'
+                    text='制作中'
                     break;
                 case 2:
                     text='已驳回'
@@ -746,7 +757,7 @@ export default {
                     text='已完成'
                     break;
                 case -1:
-                    text='已作废'
+                    text='已撤回'
                     break;
             
                 default:

+ 243 - 39
src/views/modules/workBench/placeOrder.vue

@@ -193,6 +193,7 @@
             </div>
         </div>
         <div class="section">
+            <a-spin :spinning="placeOrderSpinning">
             <div class="sectionBody">
                 <a-form-model
                 ref="ruleForm"
@@ -254,14 +255,14 @@
                         <div class="input-item"> 
                             <a-form-model-item ref="sysName"  prop="sysName">
                                 <a-radio-group v-model="form.sysName" @change="sysNameChange">
-                                     <a-radio-button :value="3">不限</a-radio-button>
-                                    <a-radio-button :value="1">IOS</a-radio-button>
-                                    <a-radio-button :value="2">安卓</a-radio-button> 
+                                    <a-radio-button value="3">不限</a-radio-button>
+                                    <a-radio-button value="1">IOS</a-radio-button>
+                                    <a-radio-button value="2">安卓</a-radio-button> 
                                 </a-radio-group>
                             </a-form-model-item>
                         </div>
                     </div>
-                    <div class="row-item" v-if="form.sysName==2">
+                    <div class="row-item" v-if="form.sysName=='2'">
                         <div class="hint-item"></div>
                         <div class="label-item">
                             <div class="text-item">APK链接</div>
@@ -346,7 +347,7 @@
                         </div>
                         <div class="input-item"> 
                             <a-form-model-item ref="cutAmount"  prop="cutAmount">
-                                 <a-input-number :min="1" :max="500"  @change="materialAmountDayChange" v-model="form.cutAmount" />
+                                 <a-input-number :min="1" :max="500"  @change="cutAmountChange" v-model="form.cutAmount" />
                             </a-form-model-item>
                         </div>
                     </div>
@@ -374,11 +375,23 @@
                         </div>
                         <div class="input-item"> 
                             <a-form-model-item ref="orderRemark"  prop="orderRemark">
+                                <a :href="form.attachmentUrl" style="margin-right:20px;display:block" v-if="form.attachmentUrl">{{form.attachmentName}}</a>
                                 <a-upload
-                                    action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-                                    :default-file-list="defaultFileList"
-                                >
-                                    <a-button> <a-icon type="upload" /> 上传附件 </a-button>
+                                    name="file"
+                                    :multiple="false"
+                                    :action="uploadAction"
+                                    :headers="tokenHeader"
+                                    :file-list="fileList"
+                                    :showUploadList="false"
+                                    :beforeUpload="beforeUpload"
+                                    @change="handleChange"
+                                    style="margin-right:20px"
+                                        
+                                    >
+                                        <a-button :disabled="loadDisabled">
+                                        <a-icon type="upload" />
+                                            {{loadDisabled?'上传中,请稍后':'文件上传'}}
+                                        </a-button>
                                 </a-upload>
                             </a-form-model-item>
                         </div>
@@ -388,11 +401,14 @@
                     <!-- <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="saveHandler" :loading="saveLoading">下单</a-button>
+                        <a-button type="primary"  style="margin-right:15px" @click="saveHandler" :loading="saveLoading">
+                            {{isEidt?'完成':'下单'}}
+                        </a-button>
                     </div>
                 </div>   
                 </a-form-model>
             </div>
+            </a-spin>
         </div>
     </div>
 </template>
@@ -400,17 +416,40 @@
 <script>
 import moment from 'moment';
 import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
-
+import Vue from 'vue'
+import {ACCESS_TOKEN} from "@/store/mutation-types";
+const fileSuffix = [
+  'rar',
+  'zip',
+  'arj',
+  'gz',
+  'z',
+  '7-zip',
+  'tar',
+  'gzip',
+  'bz2',
+  'jar',
+  'ace',
+  'iso',
+  
+]
 export default {
     data() {
         return {
-            defaultFileList:[],
+            placeOrderSpinning:false,
+            fileList:[],
+            isEidt:false,
+            loadDisabled:false,
+            tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)},
+            uploadAction:'',
+            
+
             saveLoading:false,
             form: {
                 orderTitle: '',               
                 design:undefined,
                 project:undefined,
-                sysName:3,
+                sysName:'3',
                 sysPackage:'',
                 dataValue:[],
                 materialAmount:undefined,
@@ -419,6 +458,8 @@ export default {
                 realAmount:undefined,
                 cutAmount:undefined,
                 orderRemark:'',
+                attachmentName:'',
+                attachmentUrl:'',
 
             },
             rules: {
@@ -435,7 +476,14 @@ export default {
                 materialAmountDay: [{required: true, message: '日均产量必须填写', trigger: 'change' }],
                 project: [{required: true, message: '必须选择关联项目', trigger: 'change' }],
                 design: [{required: true, message: '必须选择设计组长', trigger: 'change' }],
-               
+                cutAmount: [
+                    { required: true, message: '组合模式下,剪辑数量必须填写', trigger: 'blur' },
+                    // { min: 1, message: '组合模式下,剪辑数量不能小于1', trigger: 'blur' },
+                ],
+                realAmount: [
+                    { required: true, message: '组合模式下,真人数量必须填写', trigger: 'blur' },
+                   
+                ],
             },
             // 操作记录
             designLeaderList:[],
@@ -448,7 +496,8 @@ export default {
             totalPage:0,
             currentPage:1,
             userInfo:{},
-            roleCode:''
+            roleCode:'',
+            currentOrderInfo:{},
         }
     },
     methods: {
@@ -469,12 +518,7 @@ export default {
                 option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
             );
         },
-        // 附件上传的方法
-        handleChange({ file, fileList }) {
-        if (file.status !== 'uploading') {
-            console.log(file, fileList);
-        }
-        },
+        
         // form-modal 自带方法
         onSubmit() {
             this.$refs.ruleForm.validate(valid => {
@@ -499,21 +543,70 @@ export default {
         },
         materialAmountChange(e){
             console.log(e)
+            if(this.form.materialType==1){
+                this.form.realAmount=this.form.materialAmount;
+                this.form.cutAmount=0
+            }else if(this.form.materialType==2){
+                this.form.cutAmount=this.form.materialAmount;
+                this.form.realAmount=0
+            }else{
+                if(this.form.materialAmount){
+                    this.form.cutAmount=this.form.materialAmount/2;
+                    this.form.realAmount=this.form.materialAmount/2;
+                }
+                
+            }
         },
         materialAmountDayChange(e){
-
+            console.log(e);
+            if(e>this.form.materialAmount&&this.form.materialAmount){
+                this.$message.error('日均产量不能大于素材总量')
+                this.form.materialAmountDay=this.form.materialAmount
+            }else if(!this.form.materialAmount){
+                 this.$message.error('请先填写素材总量')
+                this.form.materialAmountDay=0
+            }
+            
         },
-        materialTypeChange(val){
-
+        materialTypeChange(e){
+            console.log(e.target.value)
+            if(e.target.value==1){
+                this.form.realAmount=this.form.materialAmount;
+                this.form.cutAmount=0
+            }else if(e.target.value==2){
+                this.form.cutAmount=this.form.materialAmount;
+                this.form.realAmount=0
+            }else{
+                this.form.cutAmount=this.form.materialAmount/2;
+                this.form.realAmount=this.form.materialAmount/2;
+            }
         },
-        realAmountChange(e){
-            console.log(e);
-            this.form.cutAmount=this.form.materialAmount-this.form.realAmount
+        realAmountChange(val){
+            console.log(val);
+            if(this.form.materialAmount){
+                if(val>this.form.materialAmount){
+                    this.$message.error('数量输入有误,不能超过素材总量哦');
+                    this.form.realAmount=this.form.materialAmount-1
+                }
+                this.form.cutAmount=this.form.materialAmount-this.form.realAmount
+            }
+            
+        },
+        cutAmountChange(val){
+            console.log(val);
+            if(this.form.realAmount==null){
+                console.log(1)
+                if(val>this.form.materialAmount){
+                    this.$message.error('数量输入有误,不能超过素材总量哦');
+                    this.form.cutAmount=this.form.materialAmount-1
+                }
+                this.form.realAmount=this.form.materialAmount-this.form.cutAmount
+            }
+            
         },
         goBack() {
-            this.$router.replace('/autoRules')
-            this.$bus.$emit('remove', '/newBlankRule')
-           
+            this.$parent.currentTabComponent='operatorPlatform';
+            this.$parent.isEdit=false;
         },
 
         saveHandler(){
@@ -528,16 +621,32 @@ export default {
                         endDate:this.form.dataValue[1].format('YYYY-MM-DD'),
                     };
 
-                    
-                    postAction('/platform/operator/payout',params).then(res=>{
-                        console.log(res);
-                        if(res.success){
-                             this.$router.push('/workBench')
-                            this.$bus.$emit('remove', '/workBench/placeOrder')
-                        }else{
-                            this.$message.error(res.success)
+                    if(!this.$parent.isEdit){
+                        postAction('/platform/operator/payout',params).then(res=>{
+                            console.log(res);
+                            if(res.success){
+                                this.$parent.currentTabComponent='operatorPlatform';
+                                this.$parent.isEdit=false;
+                            }else{
+                                this.$message.error(res.success)
+                            }
+                        })
+                    }else{
+                        params={
+                            id:this.currentOrderInfo.id,
+                            ...params,
                         }
-                    })
+                        postAction('/platform/operator/rePayout',params).then(res=>{
+                            console.log(res);
+                            if(res.success){
+                                this.$parent.currentTabComponent='operatorPlatform';
+                                this.$parent.isEdit=false;
+                            }else{
+                                this.$message.error(res.success)
+                            }
+                        })
+                    }
+                    
 
                 } else {
                     console.log('error submit!!');
@@ -545,6 +654,96 @@ export default {
                 }
             });
         },
+
+        getOrderInfo(){
+            
+            if(this.$parent.isEdit){
+                this.placeOrderSpinning=true;
+                getAction('/platform/order/queryById',{
+                    id:this.$parent.orderId
+                }).then(res=>{
+                    console.log(res)
+                    this.placeOrderSpinning=false;
+                    this.currentOrderInfo={}
+                    if(res.success){
+                        
+                        this.currentOrderInfo=res.result;
+                        this.form=res.result;
+                        this.form.dataValue=[moment(res.result.startDate),moment(res.result.endDate)]
+                    }
+                })
+            }
+        },
+
+        beforeUpload(file) {
+            // ${this.form.project}
+            this.uploadAction= `http://192.168.1.43:8098/jeecg-boot/platform/file/uploadAttachment?projectId=772`
+            this.loadDisabled = true
+            const size = (Number(file.size) / (1024 * 1024)).toFixed(2)
+            const fileName = file.name
+            const fileStrArr = fileName.split('.')
+            const suffix = fileStrArr[fileStrArr.length - 1]
+
+            let result = fileSuffix.some((item) => {
+                return item === suffix
+            })
+
+            if (!result) {
+                this.$message.error('不支持该文件类型')
+                this.loadDisabled = false
+                return false
+            }
+
+            // if (size > 10) {
+            //     this.$message.error('文件不能大于10MB')
+            //     this.loadDisabled = false
+            //     return false
+            // }
+            
+        },
+        handleChange(info) {
+            // console.log(info)
+            let fileList = [...info.fileList];
+
+            // 1. Limit the number of uploaded files
+            //    Only to show two recent uploaded files, and old ones will be replaced by the new
+            fileList = fileList.slice(-2);
+
+            // 2. read from response and show file link
+            fileList = fileList.map(file => {
+                if (file.response) {
+                    // Component will show file.url as link
+                    file.url = file.response.url;
+                }
+                return file;
+            });
+            if(fileList.length>0){
+                this.fileList = [
+                    {
+                        ...fileList[fileList.length-1]
+                    }
+                ]
+            }else{
+                this.fileList=[]
+            }
+            
+
+
+            if (info.file.status !== 'uploading') {
+                console.log(info.file, info.fileList)
+            }
+            if (info.file.status === 'done') {
+                this.$message.success(`${info.file.name} 上传成功`)
+                this.loadDisabled = false 
+                this.form.attachmentName=info.file.response.result.attachmentName || ''         
+                this.form.attachmentUrl=info.file.response.result.attachmentUrl || ''
+            } else if (info.file.status === 'error') {
+                this.$message.error(`${info.file.name} file upload failed.`)
+                this.loadDisabled = false
+            }
+
+            // console.log(this.form)
+        },
     },
 
     mounted(){
@@ -564,7 +763,12 @@ export default {
             console.log(res);
             this.projectList=res.result
         })
+        this.isEidt=this.$parent.isEdit
+        this.getOrderInfo()
     },
+    activated(){
+        this.getOrderInfo()
+    }
 }
 </script>
 

+ 1 - 1
vue.config.js

@@ -72,7 +72,7 @@ module.exports = {
         // target: 'http://192.168.0.59:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.1.188:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
-        // target: 'http://192.168.1.43:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
+        target: 'http://192.168.1.43:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.43:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.43:8888', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.0.252:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉