1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["addVisit"],{"01ab":function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"addVisit"},[t.statusList.headerStatus?s("m-header",{attrs:{name:t.name}}):t._e(),s("van-cell-group",[s("van-field",{attrs:{label:"回访老师",readonly:"","input-align":"right",placeholder:"请选择"},model:{value:t.teacherName,callback:function(e){t.teacherName=e},expression:"teacherName"}})],1),s("van-cell-group",[s("van-field",{attrs:{label:"学员姓名",readonly:"","input-align":"right","is-link":!(t.id||t.userId||t.studentId),placeholder:"请选择"},on:{click:t.onCheckStudent},scopedSlots:t._u([{key:"right-icon",fn:function(){return[t.studentPhone?s("a",{staticClass:"phone_section",attrs:{href:"tel:"+t.studentPhone},on:{click:function(t){t.stopPropagation()}}},[s("img",{staticClass:"iconPhone",attrs:{src:a("5657"),alt:""}})]):t._e()]},proxy:!0}]),model:{value:t.studentName,callback:function(e){t.studentName=e},expression:"studentName"}}),s("van-field",{attrs:{label:"回访类型",readonly:"","input-align":"right","is-link":!t.id&&!t.userId,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"}}),s("van-field",{attrs:{label:"回访目的",readonly:"","input-align":"right","is-link":!t.id&&!t.userId,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),s("van-cell-group",[s("div",{staticClass:"dot"}),s("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),s("van-cell-group",[s("div",{staticClass:"dot"}),s("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),s("van-cell-group",[s("van-field",{staticClass:"visiTimer",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():s("div",{staticClass:"button-group"},[s("van-button",{attrs:{type:"primary",round:"",size:"large"},on:{click:t.onSubmit}},[t._v("确认")])],1),s("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"}}),s("van-popup",{attrs:{position:"bottom"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},[s("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),s("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"}},[s("van-sticky",[s("van-search",{attrs:{"show-action":"",shape:"round","left-icon":t.searchIcon,placeholder:"请输入学生名或手机号"},on:{search:t.onSearch},scopedSlots:t._u([{key:"action",fn:function(){return[s("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),s("div",{staticClass:"paddingB80"},[t.dataShow?s("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"}},[s("van-radio-group",{model:{value:t.radioSelect,callback:function(e){t.radioSelect=e},expression:"radioSelect"}},[s("van-cell-group",t._l(t.dataList,function(e,n){return s("van-cell",{key:n,staticClass:"input-cell",attrs:{center:!0},on:{click:function(a){return t.onCheckboxSelect(e)}}},[s("template",{slot:"icon"},[e.avatar?s("img",{staticClass:"logo",attrs:{src:e.avatar,alt:""}}):s("img",{staticClass:"logo",attrs:{src:a("a7ed"),alt:""}})]),s("template",{slot:"title"},[s("div",{staticClass:"studentName"},[t._v("\n "+t._s(e.userName)+"\n ")])]),s("template",{slot:"label"},[s("span",[t._v(t._s(t.desensitPhone(e.phone)))])]),s("template",{slot:"default"},[s("van-radio",{attrs:{name:e.userId}})],1)],2)}),1)],1)],1):s("m-empty",{key:"data",staticClass:"empty"})],1),s("div",{staticClass:"button-group-popup"},[s("span",{staticClass:"btn",on:{click:t.onPopupCancel}},[t._v("取消")]),s("span",{staticClass:"btn primary",on:{click:t.onPopupSubmit}},[t._v("确认选择")])])],1)],1)},n=[],i=a("a34a"),r=a.n(i),o=a("6e6e"),c=a("ff51"),u=a("d678"),l=a("5a0c"),d=a.n(l),A=a("9afb"),p=a("b562"),h=a("3908");function m(t,e){if(null==t)return{};var a,s,n=f(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)a=i[s],e.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function f(t,e){if(null==t)return{};var a,s,n={},i=Object.keys(t);for(s=0;s<i.length;s++)a=i[s],e.indexOf(a)>=0||(n[a]=t[a]);return n}function v(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,s)}return a}function b(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?v(a,!0).forEach(function(e){y(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):v(a).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function y(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function M(t,e,a,s,n,i,r){try{var o=t[i](r),c=o.value}catch(u){return void a(u)}o.done?e(c):Promise.resolve(c).then(s,n)}function g(t){return function(){var e=this,a=arguments;return new Promise(function(s,n){var i=t.apply(e,a);function r(t){M(i,s,n,r,o,"next",t)}function o(t){M(i,s,n,r,o,"throw",t)}r(void 0)})}}var G={name:"addVisit",components:{MHeader:o["a"],MEmpty:u["a"]},data:function(){var t=this.$route.query;return{id:t.id,name:t.name,userId:t.userId,studentId:t.studentId,inside:t.inside||0,visitFlag:Number(t.visitFlag)||0,dataForm:{status:!1,minDate:new Date(2e3,0,1),maxDate:new Date,currentDate:new Date},statusList:{headerStatus:!0,studentStatus:!1},typeList:[{name:"课程推荐"},{name:"常规回访"},{name:"云教练"},{name:"其它"}],visit:{status:!1,type:null,data:[]},studentName:t.username||null,studentPhone:t.phone||null,teacherName:null,form:{teacherId:null,studentId:t.userId||t.studentId||null,type:t.userId?"云教练":null,purpose:t.userId?"体验回访":null,overview:"",feedback:"",visitTime:t.userId||t.id?d()().format("YYYY年MM月DD日"):null,visiterType:"TEACHER"},loading:!1,finished:!1,params:{search:null,page:1,rows:20},dataShow:!0,radioSelect:null,radioSelectName:null,radioSelectPhone:null,clickStatus:!1,dataList:[],searchIcon:a("1b61")}},mounted:function(){var t=this.$route.query;t.Authorization&&(localStorage.setItem("Authorization",decodeURI(t.Authorization)),localStorage.setItem("userInfo",decodeURI(t.Authorization))),(Object(c["b"])().android||Object(c["b"])().iPhone)&&(this.statusList.headerStatus=!1),document.title=this.name||"新增回访记录",this.__init()},methods:{__init:function(){var t=g(r.a.mark(function t(){var e,a,s,n,i,o,c,u=this;return r.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(p["l"])();case 2:if(e=t.sent,a=e.data,200==e.status?(this.teacherName=a.realName,this.form.teacherId=a.id):this.$toast(e.msg),!this.id){t.next=14;break}return Object(h["a"])(!0),t.next=9,Object(A["cb"])({id:this.id});case 9:s=t.sent,n=s.data,i=this.form,Object(h["a"])(!1),200==n.code?(o=n.data,this.studentName=o.studentName,i.studentId=o.studentId,i.type=o.type,i.purpose=o.purpose,i.overview=o.overview,i.feedback=o.feedback,i.visitTime=d()(o.visitTime).format("YYYY年MM月DD日"),i.visiterType=o.visiterType):this.$toast(e.msg);case 14:if(c=this.userId||this.studentId,!c){t.next=18;break}return t.next=18,Object(A["M"])({userId:c}).then(function(t){var e=t.data;u.studentPhone=e.phone,u.studentName=e.username});case 18:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),onSubmit:function(){var t=g(r.a.mark(function t(){var e,a,s,n,i,o=this;return r.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(h["a"])(!0),a=d()(this.dataForm.currentDate).format("YYYY-MM-DD"),s=b({},e,{visitTime:a}),t.next=37,Object(A["bb"])(b({},s));case 37:if(n=t.sent,i=n.data,Object(h["a"])(!1),200!=i.code){t.next=45;break}this.$toast("添加成功"),setTimeout(function(){if(o.inside)o.onAppBack();else if(o.userId){var t=o.$route.query,e=t.visitFlag,a=m(t,["visitFlag"]);e=0,o.$router.replace({path:"/trainDetail",query:b({},a,{visitFlag:e})})}else o.$router.replace("visitList")},800),t.next=48;break;case 45:return this.$toast(i.msg),this.clickStatus=!1,t.abrupt("return");case 48:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),onAppBack:function(){Object(c["b"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):Object(c["b"])().iPhone&&window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"}))},onCheckStudent:function(){this.id||this.userId||this.studentId||(this.statusList.studentStatus=!0)},onChange:function(t){if(!this.id&&!this.userId){var e=this.visit,a=this.form;if("type"==t)e.data=this.typeList;else if("purpose"==t)if("其它"==a.type)e.data=[{name:"其它"}];else if("课程推荐"==a.type)e.data=[{name:"新课推荐"},{name:"续费提醒"}];else if("常规回访"==a.type)e.data=[{name:"课后及作业回访"},{name:"练习及乐团表现"}];else{if("云教练"!=a.type)return void this.$toast("请选择回访类型");e.data=[{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,this.radioSelectPhone=t.phone},onPopupCancel:function(){this.statusList.studentStatus=!1},onPopupSubmit:function(){this.form.studentId=this.radioSelect,this.studentName=this.radioSelectName,this.studentPhone=this.radioSelectPhone,this.statusList.studentStatus=!1},onCurrentConfirm:function(t){t&&(this.form.visitTime=d()(t).format("YYYY年MM月DD日")),this.dataForm.status=!1},onEnListShow:function(){this.id||this.visitFlag||(this.dataForm.status=!0)},getStudent:function(){var t=this,e=this.params;Object(A["J"])(e).then(function(a){var s=a.data;t.loading=!1,200==s.code&&s.data?(e.page=s.data.pageNo,t.dataList=t.dataList.concat(s.data.rows),e.page>=s.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,a=this.form;"type"==e.type?(a.type=t.name,a.purpose=null):"purpose"==e.type&&(a.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),a=t.substr(-4);return e+"****"+a}}},k=G,S=(a("ea62"),a("2877")),x=Object(S["a"])(k,s,n,!1,null,"993fe5d8",null);e["default"]=x.exports},5657:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAqCAMAAADhynmdAAAAAXNSR0IArs4c6QAAAhBQTFRFAAAAAP8AAP//AICAAP//AP+qAL+/AMzMANWqANXVALa2AMbGALOzAMyzALm5ANG5AL+qAMi2ALuqAMa4ALyuAL+zAMyzAMK2ALyxAMi8AMK4AMazAMG5AL+3AMG5AL22AL+4AMO1AMS3AL+zAL+0AMW5AMG1AL6zAMW1AMW6AMO0AMS1AMKzAMK4AMO1AMS2AMK2AMC0AMG2AMO4AMC1AMG2AMK3AMG3AMK4AMC2AMG3AMK2AMO3AMG0AMG3AMO3AMG1AMK3AMG2AMK3AMC1AMG2AMG3AMO2AMC0AMG1AMO4AMO1AMK2AMK1AMO1AMG0AMK1AMG3AMK2AMK2AMG1AMC0AMO1AsG1AMK1AsC1AsG2AsK1AsK3AsK2AsK1AsK2AsK2AsK2AsG1AsG2AsK3AsC1AsK1AsG1AsK2AsG1AsK2AsG1AsK2AcK2AcK2AcG1AcG2AcG1AcG1AcG0AcG1AcG2AcG2AcK2AcK1AcG2AcG1AcG1AcG1AcG2AcG1AcK2AcG1AcG1AcG2AcG1AcK1AcG1AcG1AcC0AcK2AcG1AcK1AcK2AcG1AcG2AcK1AcG1AcK1AcG1AcG1AcG0AcG2AcG1AcG1AcG1AcG1AcG1AcK2AcG1AcG2AcK1AcG1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