1 |
- webpackJsonp([3],{LsZq:function(t,e){},ScAh:function(t,e){},aGi4:function(t,e){},i5TN:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a={render:function(){var t=this.$createElement;return(this._self._c||t)("div",[this._v("\n \\\n\n")])},staticRenderFns:[]};var s=i("VU/8")({name:"test",data:function(){return{arrList:[11,22,33,44]}},created:function(){},methods:{}},a,!1,function(t){i("aGi4")},"data-v-0a2c4160",null);e.default=s.exports},s8Dy:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a={components:{MaskedInput:i("4q2C").a},data:function(){return{redFlag:!1,spanArr:[],pos:0,spanArr_role:[],pos_role:0,week_val:"",month_val:"",switch_time_btn:0,total:0,page:1,pages:0,page_size:20,loading:!1,infoList:[],infoList_date:[],live_status:1,planFlag:!1,editPlanInfoData:{},pastPlanFlag:!1,pastLivePlanData:{},live_plan_edit_permission:2,time:[],start_time:"",end_time:"",staff_id:"",staffList:[],staffList_filter:[],staffList_filter_zhu:[],staffList_filter_else:[],today_date:"",itemStaff:{},accountList:[],seller_id:"",operationFlag:!1}},beforeUpdate:function(){var t=this;this.$nextTick(function(){t.$refs.tableref.doLayout()})},created:function(){this.userInfo=JSON.parse(this.$localSelfStore.getLocal("userInfo")),1==this.userInfo.is_edit&&(this.operationFlag=!0),this.get_staffList(),this.init_week(),this.get_accountList(),this.today_date=this.time_formatting(new Date)},methods:{addRow:function(t,e){var i=this;if(console.log(e),!this.redFlag){if(0==e.selectVal&&(e.selectVal=""),e.clickOne)return this.$message({message:"请选择人员后再继续添加",type:"warning"}),!1;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.planList_userList,{params:{seller_id:e.sellerId,platform:e.plat_type,station_type:1==e.staff_role?1:2}}).then(function(a){if(i.loading=!1,(a=a.data)&&0==a.errno){var s=a.rst;if(s.forEach(function(t){t.name=t.real_name}),1==e.staff_role?i.staffList_filter_zhu=s:i.staffList_filter_else=s,e.clickOne=!0,0==e.staff_id)return e.selectShow=!0,i.$forceUpdate(),!1;var n=0,l=[],r=[];i.infoList.forEach(function(t,i){t.sellerId==e.sellerId&&(r.push(t.staff_id),l.push(i),t.staff_type==e.staff_type&&(n+=1))});var o=[],f=[];e.date_list.forEach(function(t){o.push(t.date),f.push(t.week)});var c=[];o.forEach(function(t,e){c.push({date:t,week:f[e],plan_ids:[]})});var _={name:e.name,sellerId:e.sellerId,head:e.head,plat_type:e.plat_type,staff_id:0,staff_name:"",station_name:"",staff_role:"",staff_type:e.staff_type,date_list:c,selectVal:"",selectShow:!0,cellClick:!0,havestaffIds:r};i.infoList.splice(t+n,0,_),i.spanArr[l[0]]+=1,i.spanArr.splice(t+n,0,0),i.spanArr_role[t]+=1,i.spanArr_role.splice(t+n,0,0)}else 4002!=a.errno&&i.$message({message:a.err,type:"warning"})}).catch(function(t){i.loading=!1})}},editTimeBlur:function(t,e,i){if(-1!==t.iptVal.indexOf("_"))return!1;var a=t.iptVal.split(" - ")[0],s=t.iptVal.split(" - ")[1];if(a.split(":")[0]>=24||a.split(":")[1]>=60||s.split(":")[0]>=24||s.split(":")[1]>=60)return this.$message({message:"请填写正确时间",type:"warning"}),this.redFlag=!0,!1;this.redFlag=!1;var n=t.start_time.split(" ")[0],l=n+" "+a,r=n+" "+s,o=new Date(l.replace(/-/g,"/")).getTime();new Date(r.replace(/-/g,"/")).getTime()<=o&&(r=this.getAppointDate(n,1)+" "+s),e.staff_id=e.staff_id?e.staff_id:this.itemStaff.id,1==e.staff_type?e.staff_role=1:e.staff_role=e.staff_role?e.staff_role:this.itemStaff.station_id,this.staff_init_new(e.staff_id,e.staff_role,e.sellerId,e.plat_type,l,r,t.id,i)},editTime:function(t){this.redFlag||(t.iptShow=!0,t.iptVal=t.start_time.split(" ")[1].substring(0,5)+" - "+t.end_time.split(" ")[1].substring(0,5))},deleCellTime:function(t,e,i,a,s){this.redFlag||(a.splice(i,1),1==t.staff_type&&(t.staff_role=1),this.staff_init_new(t.staff_id,t.staff_role,t.sellerId,t.plat_type,"","",e.id,s))},addTimeAgain:function(t,e,i){return!this.redFlag&&(i?e.length>0&&0==e[e.length-1].id?(this.$message({message:"请操作时间后再继续添加",type:"warning"}),!1):void e.push({end_time:"",id:0,plan_id:0,start_time:t,iptVal:"",iptShow:!0}):(this.$message({message:"请操作人员后再继续添加",type:"warning"}),!1))},headerStyle:function(t){var e=t.row,i=(t.column,t.rowIndex,t.columnIndex);if(e[1].colSpan=2,e[2].colSpan=0,2===i)return"display: none"},objectSpanMethod:function(t){t.row,t.column;var e=t.rowIndex,i=t.columnIndex;if(0===i){var a=this.spanArr[e];return{rowspan:a,colspan:a>0?1:0}}if(1===i){var s=this.spanArr_role[e];return{rowspan:s,colspan:s>0?1:0}}},changeStaff:function(){this.$forceUpdate()},filterStaff:function(t,e){e.havestaffIds=[],e.forEach(function(t){e.havestaffIds.push(t.staff_id)}),this.$forceUpdate()},getAppointDate:function(t,e){var i=new Date(t);return i.setDate(i.getDate()+e),i.getFullYear()+"-"+(i.getMonth()+1<10?"0"+(i.getMonth()+1):i.getMonth()+1)+"-"+(i.getDate()<10?"0"+i.getDate():i.getDate())},init_month:function(){var t=new Date;this.getMonthStartEnd(t)},init_week:function(){var t=new Date,e=t.getDay();0==e?this.getWeekStartEnd(t,0,6):1==e?this.getWeekStartEnd(t,-1,5):2==e?this.getWeekStartEnd(t,-2,4):3==e?this.getWeekStartEnd(t,-3,3):4==e?this.getWeekStartEnd(t,-4,2):5==e?this.getWeekStartEnd(t,-5,1):6==e&&this.getWeekStartEnd(t,-6,0)},getWeekStartEnd:function(t,e,i){var a=t.getTime();this.start_time=this.time_formatting(new Date(864e5*e+a)),this.end_time=this.time_formatting(new Date(864e5*i+a)),this.init(1)},getMonthStartEnd:function(t){var e=t.setDate(1),i=t.toLocaleString(),a=i.split("/")[0],s=i.split("/")[1],n=new Date(a,s,0).getDate();s=s<10?"0"+s:s,this.start_time=a+"-"+s+"-01",this.end_time=this.time_formatting(new Date(864e5*(n-1)+e)),this.init(1)},time_formatting:function(t){var e=t.getFullYear(),i=t.getMonth()+1,a=t.getDate();return e+"-"+(i=i<10?"0"+i:i)+"-"+(a=a<10?"0"+a:a)},get_staffList:function(){var t=this;this.$axios.get(this.URL.BASEURL+this.URL.userListForFilter,{}).then(function(e){if((e=e.data)&&0==e.errno){var i=e.rst;i.forEach(function(t){t.name=t.real_name}),t.staffList=i}else 4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(t){})},staff_init_new:function(t,e,i,a,s,n,l,r){var o=this;this.loading=!0;var f={id:0==r?"":r,related_id:0==l?"":l,company_id:this.userInfo.company_id,rule_id:0,sellerId:i,start_time:s,end_time:n,staff_id:t,staff_role:e||0,plat_type:a};this.$axios.post(this.URL.BASEURL+this.URL.staffInfoEdit,f).then(function(t){(t=t.data)&&0==t.errno?o.init(1):o.$message({message:t.err,type:"warning"})})},init:function(t){var e=this;this.page=t||this.page,this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.staffWorkListV3,{params:{page:this.page,page_size:this.page_size,start_date:this.start_time,end_date:this.end_time,staff_id:this.staff_id,seller_id:this.seller_id}}).then(function(t){t=t.data;e.loading=!1,t&&0==t.errno?(e.staffList_filter=[].concat(e.staffList),e.infoList=t.rst.data,e.infoList_date=t.rst.date,e.getSpanArr(e.infoList),e.getSpanArrRole(e.infoList),e.infoList.forEach(function(t){t.selectVal=t.staff_id,t.date_list.forEach(function(t){t.iptVal=""})})):4002!=t.errno&&e.$message({message:t.err,type:"warning"})}).catch(function(t){e.loading=!1})},handleCurrentChange:function(t){this.init(t)},getSpanArrRole:function(t){this.spanArr_role=[];for(var e=0;e<t.length;e++)0==e?(this.spanArr_role.push(1),this.pos_role=0):t[e].sellerId===t[e-1].sellerId&&t[e].staff_type===t[e-1].staff_type?(this.spanArr_role[this.pos_role]+=1,this.spanArr_role.push(0)):(this.spanArr_role.push(1),this.pos_role=e)},getSpanArr:function(t){this.spanArr=[];for(var e=0;e<t.length;e++)0===e?(this.spanArr.push(1),this.pos=0):t[e].sellerId===t[e-1].sellerId?(this.spanArr[this.pos]+=1,this.spanArr.push(0)):(this.spanArr.push(1),this.pos=e)},get_accountList:function(){var t=this;this.$axios.get(this.URL.BASEURL+this.URL.user_sellerList,{}).then(function(e){(e=e.data)&&0==e.errno?t.accountList=e.rst:4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(t){})}}},s={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"paiban_managementPage"},[a("div",{staticClass:"commonInfo operation_container flex"},[a("ul",{staticClass:"commonTimeList flex"},[a("div",{staticClass:"commonInfoName"},[t._v("时间筛选")]),t._v(" "),a("div",{staticClass:"switch_btn",class:0==t.switch_time_btn?"switch_btn_active":"",on:{click:function(e){!t.redFlag&&(t.switch_time_btn=0,t.init_week(),t.month_val="")}}},[t._v("周\n ")]),t._v(" "),a("div",{staticClass:"switch_btn",class:1==t.switch_time_btn?"switch_btn_active":"",on:{click:function(e){!t.redFlag&&(t.switch_time_btn=1,t.init_month(),t.week_val="")}}},[t._v("月\n ")]),t._v(" "),a("li",{staticClass:"commonTime_container",staticStyle:{position:"relative",width:"250px",height:"35px"}},[0==t.switch_time_btn?a("el-date-picker",{staticClass:"commonTime_picker",attrs:{type:"week",disabled:t.redFlag,clearable:!1},on:{change:function(e){return t.getWeekStartEnd(t.week_val,-1,5)}},model:{value:t.week_val,callback:function(e){t.week_val=e},expression:"week_val"}}):t._e(),t._v("\n "+t._s(t.start_time)+" 至 "+t._s(t.end_time)),a("i",{staticClass:"iconfont icon-rili_icon",staticStyle:{"margin-left":"20px"}}),t._v(" "),1==t.switch_time_btn?a("el-date-picker",{staticClass:"commonTime_picker",attrs:{type:"month",disabled:t.redFlag,clearable:!1},on:{change:function(e){return t.getMonthStartEnd(t.month_val)}},model:{value:t.month_val,callback:function(e){t.month_val=e},expression:"month_val"}}):t._e()],1)]),t._v(" "),a("div",{staticClass:"commonInfoName",staticStyle:{"margin-left":"20px"}},[t._v("人员筛选")]),t._v(" "),a("el-select",{staticClass:"self_list_input__inner",staticStyle:{width:"150px"},attrs:{disabled:t.redFlag,size:"small",filterable:"",clearable:"",placeholder:"工作人员筛选"},on:{change:function(e){return t.init(1)}},model:{value:t.staff_id,callback:function(e){t.staff_id=e},expression:"staff_id"}},t._l(t.staffList,function(t,e){return a("el-option",{key:e,attrs:{label:t.name,value:t.id}})}),1),t._v(" "),a("div",{staticClass:"commonInfoName",staticStyle:{"margin-left":"20px"}},[t._v("账号筛选")]),t._v(" "),a("el-select",{staticClass:"self_list_input__inner",staticStyle:{width:"150px"},attrs:{size:"small",filterable:"",clearable:"",placeholder:"账号筛选"},on:{change:function(e){return t.init(1)}},model:{value:t.seller_id,callback:function(e){t.seller_id=e},expression:"seller_id"}},t._l(t.accountList,function(e,s){return a("el-option",{key:s,attrs:{label:e.name,value:e.seller_id}},[[a("div",{staticClass:"flex"},[2==e.platform?a("img",{staticStyle:{width:"14px",height:"14px","margin-right":"4px"},attrs:{src:i("AJUD"),alt:""}}):t._e(),t._v(" "),1==e.platform?a("img",{staticStyle:{width:"14px",height:"14px","margin-right":"4px"},attrs:{src:i("FxTv"),alt:""}}):t._e(),t._v(" "),a("span",[t._v(t._s(e.name))])])]],2)}),1)],1),t._v(" "),a("el-table",{ref:"tableref",staticStyle:{width:"100%"},attrs:{border:"","span-method":t.objectSpanMethod,"header-cell-style":t.headerStyle,data:t.infoList,height:"calc(100vh - 240px)"}},[a("el-table-column",{attrs:{fixed:"","class-name":"self-column","min-width":"210"},scopedSlots:t._u([{key:"header",fn:function(e){return e.slot,[a("div",{staticClass:"pad120",staticStyle:{"padding-left":"10px"}},[t._v("账号")])]}},{key:"default",fn:function(e){var i=e.row;return[i.name?[a("img",{staticStyle:{width:"30px","border-radius":"4px",margin:"0 auto","margin-bottom":"6px"},attrs:{src:i.head,alt:""}}),t._v("\n "+t._s(i.name)+"\n ")]:[t._v("-")]]}}])}),t._v(" "),a("el-table-column",{attrs:{fixed:"","class-name":"self-column","min-width":"100"},scopedSlots:t._u([{key:"header",fn:function(e){return e.slot,[a("div",[t._v("人员安排")])]}},{key:"default",fn:function(e){return[a("div",[a("div",[t._v(t._s(1==e.row.staff_role?"主播":"工作人员"))]),t._v(" "),t.operationFlag?a("div",{staticStyle:{"margin-top":"3px","line-height":"10px"},on:{click:function(i){return t.addRow(e.$index,e.row)}}},[a("i",{staticClass:"el-icon-circle-plus-outline pointer f12 c-999"})]):t._e()])]}}])}),t._v(" "),a("el-table-column",{attrs:{fixed:"","class-name":"self-column","min-width":"180"},scopedSlots:t._u([{key:"header",fn:function(e){return e.slot,[a("div",[t._v("人员安排")])]}},{key:"default",fn:function(e){return[a("div",{staticClass:"pad120"},[e.row.staff_name?a("div",[t._v("\n "+t._s(e.row.staff_name)+"\n "),e.row.staff_name&&e.row.station_name?a("span",[t._v("-")]):t._e(),t._v("\n "+t._s(e.row.station_name)+"\n ")]):t._e(),t._v(" "),e.row.selectShow?a("div",[a("el-select",{staticClass:"self_list_input__inner",staticStyle:{width:"150px"},attrs:{disabled:t.redFlag,size:"small",filterable:"",clearable:"",placeholder:"工作人员筛选"},on:{change:function(e){return t.changeStaff()}},model:{value:e.row.selectVal,callback:function(i){t.$set(e.row,"selectVal",i)},expression:"scope.row.selectVal"}},t._l(1==e.row.staff_type?t.staffList_filter_zhu:t.staffList_filter_else,function(i,s){return a("el-option",{key:s,attrs:{label:i.name,disabled:e.row.havestaffIds&&e.row.havestaffIds.indexOf(i.id)>-1,value:i.id}},[a("div",{on:{click:function(e){!t.redFlag&&(t.itemStaff=i)}}},[t._v("\n "+t._s(i.name)+"\n ")])])}),1)],1):t._e(),t._v(" "),e.row.selectShow||e.row.staff_name?t._e():a("div",[t._v("-")])])]}}])}),t._v(" "),t._l(t.infoList_date,function(e,i){return a("el-table-column",{key:i+Math.random(),attrs:{"class-name":"self-column timePlusDad",label:e.date+" ("+e.week+")",width:"210"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.row;return[s.date_list[i].plan_ids.length>0?[t._l(s.date_list[i].plan_ids,function(e,n){return[a("i",{staticClass:"el-icon-circle-plus-outline timePlus",on:{click:function(e){return t.addTimeAgain(s.date_list[i].date,s.date_list[i].plan_ids,s.selectVal)}}}),t._v(" "),a("div",{staticClass:"deleBtn"},[0==e.iptShow?a("div",{on:{dblclick:function(i){t.operationFlag&&!s.cellClick&&t.editTime(e)}}},[e.start_time&&e.end_time?a("div",[a("i",{staticClass:"el-icon-close f12",staticStyle:{opacity:"0"}}),t._v("\n "+t._s(e.start_time.split(" ")[1].substring(0,5)+" - "+e.end_time.split(" ")[1].substring(0,5))+"\n "),a("i",{staticClass:"el-icon-close f12 pointer",on:{click:function(a){return a.stopPropagation(),t.deleCellTime(s,e,n,s.date_list[i].plan_ids,s.plan_list?s.plan_list[i]:0)}}})]):t._e()]):t._e(),t._v(" "),1==e.iptShow?a("masked-input",{staticClass:"c-fff imitateInput textCenter ",staticStyle:{width:"100px"},style:{color:t.redFlag?"red!important":""},attrs:{mask:"11:11 - 11:11",placeholder:"00:00 - 00:00"},nativeOn:{blur:function(a){return t.editTimeBlur(e,s,s.plan_list?s.plan_list[i]:0)}},model:{value:e.iptVal,callback:function(i){t.$set(e,"iptVal",i)},expression:"p.iptVal"}}):t._e()],1)]})]:[a("div",{on:{dblclick:function(e){t.operationFlag&&t.addTimeAgain(s.date_list[i].date,s.date_list[i].plan_ids,s.selectVal)}}},[t._v("-")])]]}}],null,!0)})})],2)],1)},staticRenderFns:[]};var n=i("VU/8")(a,s,!1,function(t){i("ScAh"),i("LsZq")},"data-v-06c0c18d",null);e.default=n.exports}});
|