addVisit.efad7df7.js 19 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["addVisit"],{"01ab":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"addVisit"},[t.statusList.headerStatus?a("m-header",{attrs:{name:t.name}}):t._e(),a("van-cell-group",[a("van-field",{attrs:{label:"回访老师",readonly:"","input-align":"right",placeholder:"请选择"},model:{value:t.teacherName,callback:function(e){t.teacherName=e},expression:"teacherName"}})],1),a("van-cell-group",[a("van-field",{attrs:{label:"学员姓名",readonly:"","input-align":"right","is-link":!t.id,placeholder:"请选择"},on:{click:t.onCheckStudent},model:{value:t.studentName,callback:function(e){t.studentName=e},expression:"studentName"}}),a("van-field",{attrs:{label:"回访类型",readonly:"","input-align":"right","is-link":!t.id,placeholder:"请选择"},on:{click:function(e){return t.onChange("type")}},model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}}),a("van-field",{attrs:{label:"回访目的",readonly:"","input-align":"right","is-link":!t.id,placeholder:"请选择"},on:{click:function(e){return t.onChange("purpose")}},model:{value:t.form.purpose,callback:function(e){t.$set(t.form,"purpose",e)},expression:"form.purpose"}})],1),a("van-cell-group",[a("van-field",{staticClass:"textarea",attrs:{label:"当前学生情况",readonly:!!t.id,rows:"2",autosize:"",type:"textarea",maxlength:"50",placeholder:"请输入留言","show-word-limit":!t.id},model:{value:t.form.overview,callback:function(e){t.$set(t.form,"overview",e)},expression:"form.overview"}})],1),a("van-cell-group",[a("van-field",{staticClass:"textarea",attrs:{label:"沟通后家长反馈",readonly:!!t.id,rows:"2",autosize:"",type:"textarea",maxlength:"50",placeholder:"请输入留言","show-word-limit":!t.id},model:{value:t.form.feedback,callback:function(e){t.$set(t.form,"feedback",e)},expression:"form.feedback"}})],1),a("van-cell-group",[a("van-field",{attrs:{label:"回访时间",readonly:"","input-align":"right","is-link":!t.id,placeholder:"请选择"},on:{click:t.onEnListShow},model:{value:t.form.visitTime,callback:function(e){t.$set(t.form,"visitTime",e)},expression:"form.visitTime"}})],1),t.id?t._e():a("div",{staticClass:"button-group"},[a("van-button",{attrs:{type:"primary",round:"",size:"large"},on:{click:t.onSubmit}},[t._v("确认")])],1),a("van-action-sheet",{attrs:{actions:t.visit.data,"cancel-text":"取消"},on:{cancel:function(e){t.visit.status=!1},select:t.onModeSelect},model:{value:t.visit.status,callback:function(e){t.$set(t.visit,"status",e)},expression:"visit.status"}}),a("van-popup",{attrs:{position:"bottom"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},[a("van-datetime-picker",{attrs:{type:"date","min-date":t.dataForm.minDate,"max-date":t.dataForm.maxDate,formatter:t.formatter},on:{cancel:function(e){t.dataForm.status=!1},confirm:t.onCurrentConfirm},model:{value:t.dataForm.currentDate,callback:function(e){t.$set(t.dataForm,"currentDate",e)},expression:"dataForm.currentDate"}})],1),a("van-popup",{style:{height:"180%"},attrs:{"lock-scroll":!0,position:"bottom"},model:{value:t.statusList.studentStatus,callback:function(e){t.$set(t.statusList,"studentStatus",e)},expression:"statusList.studentStatus"}},[a("van-sticky",[a("van-search",{attrs:{"show-action":"",shape:"round",placeholder:"请输入学生名或手机号"},on:{search:t.onSearch},scopedSlots:t._u([{key:"action",fn:function(){return[a("div",{on:{click:t.onSearch}},[t._v("搜索")])]},proxy:!0}]),model:{value:t.params.search,callback:function(e){t.$set(t.params,"search",e)},expression:"params.search"}})],1),a("div",{staticClass:"paddingB80"},[t.dataShow?a("van-list",{key:"data",staticClass:"studentContainer",attrs:{finished:t.finished,"finished-text":""},on:{load:t.getStudent},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},[a("van-radio-group",{model:{value:t.radioSelect,callback:function(e){t.radioSelect=e},expression:"radioSelect"}},[a("van-cell-group",t._l(t.dataList,(function(e,r){return a("van-cell",{key:r,staticClass:"input-cell",attrs:{center:!0},on:{click:function(n){return t.onCheckboxSelect(e)}}},[a("template",{slot:"icon"},[e.avatar?a("img",{staticClass:"logo",attrs:{src:e.avatar,alt:""}}):a("img",{staticClass:"logo",attrs:{src:n("a7ed"),alt:""}})]),a("template",{slot:"title"},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(e.userName)+"\n\t\t\t\t\t\t\t")]),a("template",{slot:"label"},[a("span",[t._v(t._s(t.desensitPhone(e.phone)))])]),a("template",{slot:"default"},[a("van-radio",{attrs:{name:e.userId}})],1)],2)})),1)],1)],1):a("m-empty",{key:"data",staticClass:"empty"})],1),a("div",{staticClass:"button-group-popup"},[a("span",{staticClass:"btn",on:{click:t.onPopupCancel}},[t._v("取消")]),a("span",{staticClass:"btn primary",on:{click:t.onPopupSubmit}},[t._v("确定")])])],1)],1)},r=[],i=n("a34a"),s=n.n(i),u=n("6e6e"),o=n("ff51"),c=n("d678"),d=n("5a0c"),l=n.n(d),h=n("9afb"),f=n("b562"),p=n("3908");function m(t,e,n,a,r,i,s){try{var u=t[i](s),o=u.value}catch(c){return void n(c)}u.done?e(o):Promise.resolve(o).then(a,r)}function v(t){return function(){var e=this,n=arguments;return new Promise((function(a,r){var i=t.apply(e,n);function s(t){m(i,a,r,s,u,"next",t)}function u(t){m(i,a,r,s,u,"throw",t)}s(void 0)}))}}var g={name:"addVisit",components:{MHeader:u["a"],MEmpty:c["a"]},data:function(){var t=this.$route.query;return{id:t.id,name:t.name,dataForm:{status:!1,minDate:new Date(2e3,0,1),maxDate:new Date,currentDate:new Date},statusList:{headerStatus:!0,studentStatus:!1},typeList:[{name:"课程推荐"},{name:"常规回访"},{name:"其它"}],visit:{status:!1,type:null,data:[]},studentName:null,teacherName:null,form:{teacherId:null,studentId:null,type:null,purpose:null,overview:null,feedback:null,visitTime:null,visiterType:"TEACHER"},loading:!1,finished:!1,params:{search:null,page:1,rows:20},dataShow:!0,radioSelect:null,radioSelectName:null,clickStatus:!1,dataList:[]}},mounted:function(){var t=this.$route.query;t.Authorization&&(localStorage.setItem("Authorization",decodeURI(t.Authorization)),localStorage.setItem("userInfo",decodeURI(t.Authorization))),(Object(o["b"])().android||Object(o["b"])().iPhone)&&(this.statusList.headerStatus=!1),document.title=this.name,this.__init()},methods:{__init:function(){var t=v(s.a.mark((function t(){var e,n,a,r,i,u;return s.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(f["l"])();case 2:if(e=t.sent,n=e.data,200==e.status?(this.teacherName=n.realName,this.form.teacherId=n.id):this.$toast(e.msg),!this.id){t.next=14;break}return Object(p["a"])(!0),t.next=9,Object(h["T"])({id:this.id});case 9:a=t.sent,r=a.data,i=this.form,Object(p["a"])(!1),200==r.code?(u=r.data,this.studentName=u.studentName,i.studentId=u.studentId,i.type=u.type,i.purpose=u.purpose,i.overview=u.overview,i.feedback=u.feedback,i.visitTime=l()(u.visitTime).format("YYYY-MM-DD"),i.visiterType=u.visiterType):this.$toast(e.msg);case 14:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),onSubmit:function(){var t=v(s.a.mark((function t(){var e,n,a;return s.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e=this.form,e.studentId){t.next=6;break}return this.$toast("请选择学员"),t.abrupt("return");case 6:if(e.type){t.next=11;break}return this.$toast("请选择回访类型"),t.abrupt("return");case 11:if(e.purpose){t.next=16;break}return this.$toast("请选择回访目的"),t.abrupt("return");case 16:if(e.overview){t.next=21;break}return this.$toast("请输入当前学生情况"),t.abrupt("return");case 21:if(e.feedback){t.next=26;break}return this.$toast("请输入沟通后家长反馈"),t.abrupt("return");case 26:if(e.visitTime){t.next=29;break}return this.$toast("请选择回访时间"),t.abrupt("return");case 29:if(!this.clickStatus){t.next=31;break}return t.abrupt("return");case 31:return this.clickStatus=!0,Object(p["a"])(!0),t.next=35,Object(h["S"])(e);case 35:if(n=t.sent,a=n.data,Object(p["a"])(!1),200!=a.code){t.next=43;break}this.$toast("添加成功"),this.$router.push("visitList"),t.next=46;break;case 43:return this.$toast(a.msg),this.clickStatus=!1,t.abrupt("return");case 46:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),onCheckStudent:function(){this.id||(this.statusList.studentStatus=!0)},onChange:function(t){if(!this.id){var e=this.visit,n=this.form;if("type"==t)e.data=this.typeList;else if("purpose"==t)if("其它"==n.type)e.data=[{name:"其它"}];else if("课程推荐"==n.type)e.data=[{name:"新课推荐"},{name:"续费提醒"}];else{if("常规回访"!=n.type)return void this.$toast("请选择回访类型");e.data=[{name:"课后及作业回访"},{name:"练习及乐团表现"}]}e.status=!0,e.type=t}},onSearch:function(){this.params.page=1,this.dataList=[],this.dataShow=!0,this.loading=!0,this.finished=!1,this.getStudent()},onCheckboxSelect:function(t){this.radioSelect=t.userId,this.radioSelectName=t.userName},onPopupCancel:function(){this.statusList.studentStatus=!1},onPopupSubmit:function(){this.form.studentId=this.radioSelect,this.studentName=this.radioSelectName,this.statusList.studentStatus=!1},onCurrentConfirm:function(t){t&&(this.form.visitTime=l()(t).format("YYYY-MM-DD")),this.dataForm.status=!1},onEnListShow:function(){this.id||(this.dataForm.status=!0)},getStudent:function(){var t=this,e=this.params;Object(h["C"])(e).then((function(n){var a=n.data;t.loading=!1,200==a.code?(e.page=a.data.pageNo,t.dataList=t.dataList.concat(a.data.rows),e.page>=a.data.totalPage&&(t.finished=!0),t.params.page++):t.finished=!0,t.dataList.length<=0&&(t.dataShow=!1)}))},onModeSelect:function(t){var e=this.visit,n=this.form;"type"==e.type?(n.type=t.name,n.purpose=null):"purpose"==e.type&&(n.purpose=t.name),e.status=!1},formatter:function(t,e){return"year"===t?"".concat(e,"年"):"month"===t?"".concat(e,"月"):"day"===t?"".concat(e,"日"):e},desensitPhone:function(t){var e=t.substr(0,3),n=t.substr(-4);return e+"****"+n}}},y=g,$=(n("41db"),n("2877")),b=Object($["a"])(y,a,r,!1,null,"11b1eeb4",null);e["default"]=b.exports},"41db":function(t,e,n){"use strict";var a=n("e7b1"),r=n.n(a);r.a},"5a0c":function(t,e,n){!function(e,n){t.exports=n()}(0,(function(){"use strict";var t="millisecond",e="second",n="minute",a="hour",r="day",i="week",s="month",u="quarter",o="year",c="date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d+)?$/,l=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h=function(t,e,n){var a=String(t);return!a||a.length>=e?t:""+Array(e+1-a.length).join(n)+t},f={s:h,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),a=Math.floor(n/60),r=n%60;return(e<=0?"+":"-")+h(a,2,"0")+":"+h(r,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var a=12*(n.year()-e.year())+(n.month()-e.month()),r=e.add(a,s),i=n-r<0,u=e.add(a+(i?-1:1),s);return+(-(a+(n-r)/(i?r-u:u-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(d){return{M:s,y:o,w:i,d:r,D:c,h:a,m:n,s:e,ms:t,Q:u}[d]||String(d||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m="en",v={};v[m]=p;var g=function(t){return t instanceof S},y=function(t,e,n){var a;if(!t)return m;if("string"==typeof t)v[t]&&(a=t),e&&(v[t]=e,a=t);else{var r=t.name;v[r]=t,a=r}return!n&&a&&(m=a),a||!n&&m},$=function(t,e){if(g(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new S(n)},b=f;b.l=y,b.i=g,b.w=function(t,e){return $(t,{locale:e.$L,utc:e.$u,$offset:e.$offset})};var S=function(){function h(t){this.$L=this.$L||y(t.locale,null,!0),this.parse(t)}var f=h.prototype;return f.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var a=e.match(d);if(a){var r=a[2]-1||0,i=(a[7]||"0").substring(0,3);return n?new Date(Date.UTC(a[1],r,a[3]||1,a[4]||0,a[5]||0,a[6]||0,i)):new Date(a[1],r,a[3]||1,a[4]||0,a[5]||0,a[6]||0,i)}}return new Date(e)}(t),this.init()},f.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},f.$utils=function(){return b},f.isValid=function(){return!("Invalid Date"===this.$d.toString())},f.isSame=function(t,e){var n=$(t);return this.startOf(e)<=n&&n<=this.endOf(e)},f.isAfter=function(t,e){return $(t)<this.startOf(e)},f.isBefore=function(t,e){return this.endOf(e)<$(t)},f.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},f.unix=function(){return Math.floor(this.valueOf()/1e3)},f.valueOf=function(){return this.$d.getTime()},f.startOf=function(t,u){var d=this,l=!!b.u(u)||u,h=b.p(t),f=function(t,e){var n=b.w(d.$u?Date.UTC(d.$y,e,t):new Date(d.$y,e,t),d);return l?n:n.endOf(r)},p=function(t,e){return b.w(d.toDate()[t].apply(d.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(e)),d)},m=this.$W,v=this.$M,g=this.$D,y="set"+(this.$u?"UTC":"");switch(h){case o:return l?f(1,0):f(31,11);case s:return l?f(1,v):f(0,v+1);case i:var $=this.$locale().weekStart||0,S=(m<$?m+7:m)-$;return f(l?g-S:g+(6-S),v);case r:case c:return p(y+"Hours",0);case a:return p(y+"Minutes",1);case n:return p(y+"Seconds",2);case e:return p(y+"Milliseconds",3);default:return this.clone()}},f.endOf=function(t){return this.startOf(t,!1)},f.$set=function(i,u){var d,l=b.p(i),h="set"+(this.$u?"UTC":""),f=(d={},d[r]=h+"Date",d[c]=h+"Date",d[s]=h+"Month",d[o]=h+"FullYear",d[a]=h+"Hours",d[n]=h+"Minutes",d[e]=h+"Seconds",d[t]=h+"Milliseconds",d)[l],p=l===r?this.$D+(u-this.$W):u;if(l===s||l===o){var m=this.clone().set(c,1);m.$d[f](p),m.init(),this.$d=m.set(c,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},f.set=function(t,e){return this.clone().$set(t,e)},f.get=function(t){return this[b.p(t)]()},f.add=function(t,u){var c,d=this;t=Number(t);var l=b.p(u),h=function(e){var n=$(d);return b.w(n.date(n.date()+Math.round(e*t)),d)};if(l===s)return this.set(s,this.$M+t);if(l===o)return this.set(o,this.$y+t);if(l===r)return h(1);if(l===i)return h(7);var f=(c={},c[n]=6e4,c[a]=36e5,c[e]=1e3,c)[l]||1,p=this.$d.getTime()+t*f;return b.w(p,this)},f.subtract=function(t,e){return this.add(-1*t,e)},f.format=function(t){var e=this;if(!this.isValid())return"Invalid Date";var n=t||"YYYY-MM-DDTHH:mm:ssZ",a=b.z(this),r=this.$locale(),i=this.$H,s=this.$m,u=this.$M,o=r.weekdays,c=r.months,d=function(t,a,r,i){return t&&(t[a]||t(e,n))||r[a].substr(0,i)},h=function(t){return b.s(i%12||12,t,"0")},f=r.meridiem||function(t,e,n){var a=t<12?"AM":"PM";return n?a.toLowerCase():a},p={YY:String(this.$y).slice(-2),YYYY:this.$y,M:u+1,MM:b.s(u+1,2,"0"),MMM:d(r.monthsShort,u,c,3),MMMM:d(c,u),D:this.$D,DD:b.s(this.$D,2,"0"),d:String(this.$W),dd:d(r.weekdaysMin,this.$W,o,2),ddd:d(r.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(i),HH:b.s(i,2,"0"),h:h(1),hh:h(2),a:f(i,s,!0),A:f(i,s,!1),m:String(s),mm:b.s(s,2,"0"),s:String(this.$s),ss:b.s(this.$s,2,"0"),SSS:b.s(this.$ms,3,"0"),Z:a};return n.replace(l,(function(t,e){return e||p[t]||a.replace(":","")}))},f.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},f.diff=function(t,c,d){var l,h=b.p(c),f=$(t),p=6e4*(f.utcOffset()-this.utcOffset()),m=this-f,v=b.m(this,f);return v=(l={},l[o]=v/12,l[s]=v,l[u]=v/3,l[i]=(m-p)/6048e5,l[r]=(m-p)/864e5,l[a]=m/36e5,l[n]=m/6e4,l[e]=m/1e3,l)[h]||m,d?v:b.a(v)},f.daysInMonth=function(){return this.endOf(s).$D},f.$locale=function(){return v[this.$L]},f.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),a=y(t,e,!0);return a&&(n.$L=a),n},f.clone=function(){return b.w(this.$d,this)},f.toDate=function(){return new Date(this.valueOf())},f.toJSON=function(){return this.isValid()?this.toISOString():null},f.toISOString=function(){return this.$d.toISOString()},f.toString=function(){return this.$d.toUTCString()},h}(),k=S.prototype;return $.prototype=k,[["$ms",t],["$s",e],["$m",n],["$H",a],["$W",r],["$M",s],["$y",o],["$D",c]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),$.extend=function(t,e){return t(e,S,$),$},$.locale=y,$.isDayjs=g,$.unix=function(t){return $(1e3*t)},$.en=v[m],$.Ls=v,$}))},b562:function(t,e,n){"use strict";n.d(e,"s",(function(){return u})),n.d(e,"m",(function(){return o})),n.d(e,"n",(function(){return c})),n.d(e,"r",(function(){return d})),n.d(e,"e",(function(){return h})),n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return p})),n.d(e,"o",(function(){return m})),n.d(e,"j",(function(){return v})),n.d(e,"g",(function(){return S})),n.d(e,"h",(function(){return k})),n.d(e,"p",(function(){return g})),n.d(e,"q",(function(){return y})),n.d(e,"l",(function(){return w})),n.d(e,"d",(function(){return $})),n.d(e,"i",(function(){return b})),n.d(e,"f",(function(){return D})),n.d(e,"a",(function(){return M})),n.d(e,"k",(function(){return l}));var a=n("4328"),r=n.n(a),i=n("981f").default,s="/api-teacher",u=function(t){return i({url:"/api-auth/usernameLogin",method:"post",data:r.a.stringify(t)})},o=function(t){return i({url:"/api-student/code/sendSms",method:"post",data:r.a.stringify(t)})},c=function(t){return i({url:"/api-auth/smsLogin",method:"post",data:r.a.stringify(t)})},d=function(t){return i({url:"/api-auth/user/setPassword",method:"post",data:r.a.stringify(t)})},l=function(t){return i({url:"/api-auth/user/noAuth/queryUserByPhone",method:"get",params:t})},h=function(t){return i({url:"/api-student/courseGroup/getGroupDetail",method:"get",params:t})},f=function(t){return i({url:"/api-student/courseGroup/buyCourseGroup",method:"post",data:r.a.stringify(t)})},p=function(t){return i({url:s+"/courseGroup/createCourseGroup",method:"post",data:t})},m=function(t){return i({url:s+"/sysTenantAccount/get",method:"get",params:t})},v=function(t){return i({url:s+"/sysTenantAccount/queryTenantAccountDetail",method:"get",params:t})},g=function(t){return i({url:s+"/teacherCourseSchedule/teacherCourseMinutes",method:"get",params:t})},y=function(t){return i({url:s+"/tenantEntryActivities/queryPage",method:"get",params:t})},$=function(t){return i({url:s+"/tenantPaymentOrder/createOrder",method:"post",data:r.a.stringify(t)})},b=function(t){return i({url:s+"/teacherOrder/queryByOrderNo",method:"get",params:t})},S=function(t){return i({url:"/api-cms/helpCenterCatalog/list",method:"get",params:t})},k=function(t){return i({url:"/api-cms/helpCenterContent/list",method:"get",params:t})},w=function(t){return i({url:"/api-auth/queryUserInfo",method:"get",params:t})},D=function(t){return i({url:s+"/courseReview/getStuAndTeaReview",method:"get",params:t})},M=function(t){return i({url:s+"/courseReview/batchAdd",method:"post",data:t})}},e7b1:function(t,e,n){}}]);