40.01bd352f70a3198fecba.1706754571694+.js 6.1 KB

1
  1. webpackJsonp([40],{Kw4w:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});i("i0mo");var n=i("Hkar"),a=(i("MY4N"),i("0zAV")),s=i("7+uW"),o=(i("4yKu"),i("wolx")),r=i("TIfe");s.a.use(o.a);var l={name:"EventSelector",props:{title:{type:String,default:"选择事件"},point_type:{type:String,default:"BF"}},watch:{"filter.keyword":{deep:!0,handler:Object(r.a)(function(){this.refresh(function(){})})},visible_:function(e){var t=this;e&&this.$nextTick(function(){t.$refs.scroller&&t.$refs.scroller.finishInfinite(!1)})}},data:function(){var e=0,t=this.$getTypes;for(var i in t)this.point_type==t[i].code&&(e=t[i].id);return{employee_map:this.$getEmployeeMap(),com_height:"100%",visible_:!1,list:[],data_item:null,filter:{pt_id:e,keyword:"",page_size:30,page:1}}},created:function(){"all"==this.point_type&&delete this.filter.pt_id},mounted:function(){var e=this;this.$nextTick(function(){e.$refs.scroller&&e.$refs.scroller.finishInfinite(!1)}),document.documentElement.style.height&&(this.com_height=document.documentElement.style.height)},methods:{confirm1:function(e){this.data_item=e},confirm:function(){this.$emit("confirm",this.data_item),this.visible_=!1},getContainer:function(){return document.querySelector("body")},get_list:function(e){var t=this;this.$axiosUser("get","/api/pro/integral/statistics/integral",t.filter,"v3").then(function(i){if(e(),1===i.data.code){for(var n in t.$refs.scroller.finishInfinite(30!=i.data.data.list.length),i.data.data.list)t.list.push(i.data.data.list[n]);t.filter.page++}else t.$refs.scroller.finishInfinite(!0)})},refresh:function(e){var t=this,i=this;setTimeout(function(){t.filter.page=1,t.get_list(function(){i.list=[],e()})},100)},infinite:function(e){this.get_list(e)}}},c={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"display-inline"},[i("a",{staticClass:"btn",attrs:{href:"javascript:void(0);"},on:{click:function(t){e.visible_=!0}}},[e._v(e._s(e.title))]),e._v(" "),i("van-popup",{staticClass:"employee_selector_popup",style:"height:"+e.com_height,attrs:{duration:.2,overlay:!1,position:"bottom","get-container":e.getContainer},model:{value:e.visible_,callback:function(t){e.visible_=t},expression:"visible_"}},[i("van-nav-bar",{attrs:{title:"选择B分事件","left-text":"取消","right-text":"确定"},on:{"click-right":e.confirm,"click-left":function(t){e.visible_=!1}}}),e._v(" "),i("van-search",{attrs:{placeholder:"请输入姓名或事件内容搜索"},model:{value:e.filter.keyword,callback:function(t){e.$set(e.filter,"keyword",t)},expression:"filter.keyword"}}),e._v(" "),i("div",{staticClass:"body_com has_header"},[i("scroller",{ref:"scroller",attrs:{"on-refresh":e.refresh,"on-infinite":e.infinite}},[i("van-cell-group",e._l(e.list,function(t,n){return i("van-cell",{key:n,attrs:{title:t.remark},on:{click:function(i){return e.confirm1(t)}}},[i("template",{slot:"right-icon"},[i("span",{staticClass:"point_text",class:{red:t.point>0,green:t.point<0}},[i("span",{directives:[{name:"show",rawName:"v-show",value:t.point>0,expression:"item.point > 0"}]},[e._v("+")]),e._v("\n "+e._s(t.point)+"\n ")])]),e._v(" "),i("template",{slot:"label"},[i("span",[e._v(e._s(t.event_time))]),e._v(" "),e.employee_map[t.employee_id]?i("span",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}]},[e._v(e._s(e.employee_map[t.employee_id].name))]):e._e(),e._v(" "),null!=e.data_item&&e.data_item.id==t.id?i("span",{staticStyle:{float:"right",position:"absolute",color:"#4BD964",right:"0.32rem"}},[i("van-icon",{attrs:{name:"success"}})],1):e._e()])],2)}),1),e._v(" "),0==e.list.length?i("van-empty",{attrs:{description:"暂无数据..."}}):e._e()],1)],1)],1)],1)},staticRenderFns:[]};var f=i("VU/8")(l,c,!1,function(e){i("XRW4")},"data-v-799c9ff0",null).exports,u=i("wcFf");s.a.use(n.a).use(a.a);var d={name:"issue_lottery_ticket",data:function(){return{message:"",loading:!1,employeeList:[]}},components:{EmployeeSelectorCell:u.a,EventSelector:f},computed:{manageScope:function(){return this.$userInfo().employee_detail.manage_scope}},methods:{onRelatedEvents:function(e){this.message=e.remark},submitHandle:function(){var e=this;this.validator(function(t){if(t)e.$toast.fail(t.message);else{e.loading=!0;var i=e.getFormData();e.$axiosUser("put","/api/pro/integral/ticket",i).then(function(t){1===t.data.code?(e.$toast.success("发放成功"),e.$route_back()):e.$toast.fail(t.data.msg)}).finally(function(){return e.loading=!1})}})},getFormData:function(){var e=this;return{items:this.employeeList.map(function(t){return{employee_id:t.id,count:1,remark:e.message}})}},validator:function(e){if("function"!=typeof e)throw new Error("callback is not a function");0===this.employeeList.length?e(new Error("必须选择发放对象")):this.message&&this.message.trim()?e():e(new Error("奖票原因为必填项"))}}},m={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"issue-ticket__container"},[i("van-nav-bar",{attrs:{title:"发放奖票","left-text":"返回","left-arrow":""},on:{"click-left":e.$route_back}}),e._v(" "),i("div",{staticClass:"issue-ticket__content"},[i("van-cell-group",[i("EmployeeSelectorCell",{directives:[{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],attrs:{is_employee_list:"",required:"",title:"发放对象",name:"发放对象",max:10,employee_list:e.manageScope},model:{value:e.employeeList,callback:function(t){e.employeeList=t},expression:"employeeList"}})],1),e._v(" "),i("div",{staticClass:"related-events__wrap"},[i("EventSelector",{attrs:{title:"关联已有事件",point_type:"all"},on:{confirm:e.onRelatedEvents}})],1),e._v(" "),i("div",[i("van-field",{attrs:{required:"",rows:"4",label:"奖票原因",type:"textarea",maxlength:"50",placeholder:"请输入","show-word-limit":""},model:{value:e.message,callback:function(t){e.message=t},expression:"message"}})],1),e._v(" "),i("div",{staticClass:"submit-button__wrap"},[i("van-button",{attrs:{round:"",block:"",type:"info",loading:e.loading},on:{click:e.submitHandle}},[e._v("提交")])],1)],1)],1)},staticRenderFns:[]};var p=i("VU/8")(d,m,!1,function(e){i("VQjE")},"data-v-0f4e7bf5",null);t.default=p.exports},VQjE:function(e,t){},XRW4:function(e,t){}});