You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
17 KiB
1 lines
17 KiB
webpackJsonp([78],{DhQI:function(e,t){},MItE:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r("mvHQ"),i=r.n(a),s=r("Gu7T"),o=r.n(s),n=r("//Fk"),l=r.n(n),u=r("d7EF"),m=r.n(u),c=r("Dd8w"),d=r.n(c),b=r("Xxa5"),p=r.n(b),_=r("exGp"),f=r.n(_),h=r("NYxO"),g=r("PJh5"),v=r.n(g),F={data:function(){var e=this;return{pickerOptions:{disabledDate:function(e){return e.getTime()>1e3*(v()(v()(Date.now()).format("YYYY-MM-DD")).unix()+86400-1)}},navTitle:"",base_city:[],base_store:[],showMap:!1,have_user_id:!1,fdd_agreement:{},subForm:{id:0,admin_id:0,admin_name:0,partner_id:0,partner_name:0,user_id:0,nickName:"",coach_name:"",mobile:"",sex:0,birthday:"",work_time:"",city_id:"",store_id:"",lng:"",lat:"",address:"",text:"",id_code:"",id_card:[],license:[],work_img:[],self_img:[],video:"",status:2,order_num:0,is_work:1,start_time:"00:00",end_time:"23:59"},subFormRules:{coach_name:{required:!0,validator:this.$reg.isNotNull,text:this.$t("action.attendantName")+"姓名",reg_type:2,trigger:"blur"},mobile:{required:!0,validator:this.$reg.isTel,text:"手机号",reg_type:2,trigger:"blur"},sex:{required:!0,type:"number",message:"请选择",trigger:"blur"},birthday:{required:!0,type:"number",message:"请选择日期",trigger:"blur"},work_time:{required:!0,type:"number",message:"请输入从业年份",trigger:"blur"},city_id:{required:!0,type:"number",message:"请选择意向工作城市",trigger:"blur"},address:{required:!0,type:"string",message:"请输入地址",trigger:"blur"},lng:{required:!0,validator:this.$reg.isLng,trigger:"blur"},lat:{required:!0,validator:this.$reg.isLat,trigger:"blur"},id_code:{required:!0,validator:this.$reg.isIdCard,trigger:"blur"},text:{required:!0,type:"string",message:"请输入"+this.$t("action.attendantName")+"简介",trigger:"blur"},id_card:{required:!0,type:"array",message:"请上传图片",trigger:"blur"},license:{required:!0,type:"array",message:"请上传图片",trigger:"blur"},work_img:{required:!0,type:"array",message:"请上传图片",trigger:"blur"},self_img:{required:!0,type:"array",message:"请上传图片",trigger:"blur"},order_num:{required:!0,validator:this.$reg.isNum,trigger:"blur"},is_work:{required:!0,type:"number",message:"请选择",trigger:"blur"},start_time:{required:!0,validator:function(t,r,a){var i=e.subForm,s=i.is_work,o=void 0===s?0:s,n=i.start_time,l=i.end_time;!o||n&&l?a():a(new Error(n?"请选择结束时间":"请选择开始时间"))},trigger:"blur"}},searchForm:{page:1,limit:10,nickName:""},total:0,loading:!1,tableData:[],currentRow:{},showDialog:!1,showFile:!1}},created:function(){var e=this;return f()(p.a.mark(function t(){var r;return p.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=e.$route.query.id)){t.next=5;break}return e.subForm.id=r,t.next=5,e.getDetail(r);case 5:e.navTitle=e.$t(r?"menu.TechnicianEdit":"menu.TechnicianAdd"),e.getBaseInfo();case 7:case"end":return t.stop()}},t,e)}))()},computed:d()({},Object(h.d)({routesItem:function(e){return e.routes}})),methods:{getBaseInfo:function(){var e=this;return f()(p.a.mark(function t(){var r,a,i,s,o,n;return p.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.subForm.admin_id,a=void 0===r?0:r,t.next=3,l.a.all([e.$api.system.citySelect(),e.$api.technician.storeSelect({admin_id:a})]);case 3:i=t.sent,s=m()(i,2),o=s[0],n=s[1],e.base_city=o.data,e.base_store=n.data;case 9:case"end":return t.stop()}},t,e)}))()},getCover:function(e,t){this.subForm[t]=e},getBannerList:function(e,t){var r;(r=this.subForm[t]).push.apply(r,o()(e))},getLatLng:function(e){this.subForm.lat=e.lat,this.subForm.lng=e.lng},getDetail:function(e){var t=this;return f()(p.a.mark(function r(){var a,i,s,o;return p.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$api.technician.coachInfo({id:e});case 2:if(a=r.sent,i=a.code,s=a.data,200===i){r.next=7;break}return r.abrupt("return");case 7:for(o in s.nickName=s.user_id?s.nickName||"用户ID "+s.user_id:"",s.store_id=s.store_id||"",s.birthday=s.birthday?1e3*s.birthday:"",s.work_img=[{url:s.work_img}],["id_card","license","self_img"].map(function(e){s[e]=s[e]&&s[e].length>0?s[e].map(function(e){return{url:e}}):[]}),t.subForm)t.subForm[o]=s[o];t.fdd_agreement=s.fdd_agreement,t.have_user_id=s.id&&s.user_id;case 16:case"end":return r.stop()}},r,t)}))()},getFile:function(e,t){var r=e.length-1;this.subForm[t]=e[r].url},changeStore:function(e){var t=this.base_store.filter(function(t){return t.id===e});this.subForm.admin_id=t[0].admin_id},toShowDialog:function(){var e=this;return f()(p.a.mark(function t(){return p.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.have_user_id){t.next=3;break}return t.abrupt("return");case 3:return e.searchForm.nickName="",t.next=6,e.getTableDataList();case 6:e.showDialog=!e.showDialog;case 7:case"end":return t.stop()}},t,e)}))()},resetForm:function(e){this.$refs[e].resetFields(),this.getTableDataList(1)},handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;return f()(p.a.mark(function r(){var a,s,o,n;return p.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return e&&(t.searchForm.page=1),t.loading=!0,a=JSON.parse(i()(t.searchForm)),r.next=5,t.$api.technician.coachUserList(a);case 5:if(s=r.sent,o=s.code,n=s.data,t.loading=!1,200===o){r.next=11;break}return r.abrupt("return");case 11:t.tableData=n.data,t.total=n.total;case 13:case"end":return r.stop()}},r,t)}))()},handleSelectionChange:function(e){var t=e=JSON.parse(i()(e)),r=t.id,a=t.nickName;e.nickName=a||"用户ID "+r,this.currentRow=e},handleDialogConfirm:function(){if(null!==this.currentRow&&this.currentRow.id){var e=this.currentRow,t=e.id,r=void 0===t?0:t,a=e.nickName,i=void 0===a?"":a;this.subForm.user_id=r,this.subForm.nickName=i,this.showDialog=!1}else this.$message.error("请选择用户")},submitForm:function(){var e=this,t=!0;if(this.$refs.subForm.validate(function(e){e||(t=!1)}),t){var r=JSON.parse(i()(this.subForm));if(r.id_card.length<3)return void this.$message.error("身份证照片请分别上传身份证人像面、身份证国徽面、手持身份证照片");r.birthday=r.birthday/1e3;["id_card","license","self_img"].map(function(e){r[e]=r[e].map(function(e){return e.url})}),r.work_img=r.work_img[0].url,delete r.nickName,delete r.admin_name,delete r.partner_name;var a=r.id?"coachDataUpdate":"coachAdd";this.$api.technician[a](r).then(function(t){200===t.code&&(e.$message.success(e.$t(r.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}},filters:{handleStartEndTime:function(e){var t="",r=e.start_time,a=e.end_time,i=v()(Date.now()).format("YYYY-MM-DD");return r&&a&&v()(i+" "+a).unix()<v()(i+" "+r).unix()&&(t="次日"),t},handleFileName:function(e){var t="请上传视频";return e&&(t=e.substring(e.lastIndexOf("/")+1)),t}}},k={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-technician-edit"},[r("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),r("div",{staticClass:"page-main"},[r("el-form",{ref:"subForm",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"130px"},nativeOn:{submit:function(e){e.preventDefault()}}},[r("el-form-item",{attrs:{label:"关联用户",prop:"user_id"}},[r("el-tag",{staticClass:"cursor-pointer",attrs:{type:e.have_user_id?"info":"primary"},on:{click:e.toShowDialog}},[e._v(e._s(e.subForm.user_id?e.subForm.nickName:"选择关联用户"))])],1),e._v(" "),r("el-form-item",{attrs:{label:e.$t("action.attendantName")+"姓名",prop:"coach_name"}},[r("el-input",{attrs:{maxlength:"15","show-word-limit":"",placeholder:"请输入"+e.$t("action.attendantName")+"姓名"},model:{value:e.subForm.coach_name,callback:function(t){e.$set(e.subForm,"coach_name",t)},expression:"subForm.coach_name"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"性别",prop:"sex"}},[r("el-radio-group",{model:{value:e.subForm.sex,callback:function(t){e.$set(e.subForm,"sex",t)},expression:"subForm.sex"}},[r("el-radio",{attrs:{label:0}},[e._v("男")]),e._v(" "),r("el-radio",{attrs:{label:1}},[e._v("女")])],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"生日",prop:"birthday"}},[r("el-date-picker",{attrs:{type:"date",placeholder:"请选择日期","value-format":"timestamp","picker-options":e.pickerOptions},model:{value:e.subForm.birthday,callback:function(t){e.$set(e.subForm,"birthday",t)},expression:"subForm.birthday"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"手机号",prop:"mobile"}},[r("el-input",{attrs:{placeholder:"请输入手机号"},model:{value:e.subForm.mobile,callback:function(t){e.$set(e.subForm,"mobile",t)},expression:"subForm.mobile"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"从业年份",prop:"work_time"}},[r("el-input",{attrs:{placeholder:"请输入从业年份"},model:{value:e.subForm.work_time,callback:function(t){e.$set(e.subForm,"work_time",e._n(t))},expression:"subForm.work_time"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"意向工作城市",prop:"city_id"}},[r("el-select",{attrs:{placeholder:"请选择"},model:{value:e.subForm.city_id,callback:function(t){e.$set(e.subForm,"city_id",t)},expression:"subForm.city_id"}},e._l(e.base_city,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),e.subForm.partner_id&&e.subForm.partner_name?r("el-form-item",{attrs:{label:"所属经纪人",prop:""}},[r("div",[e._v(e._s(e.subForm.partner_name))])]):e._e(),e._v(" "),e.subForm.admin_id&&e.subForm.admin_name?r("el-form-item",{attrs:{label:"所属代理商",prop:""}},[r("div",[e._v(e._s(e.subForm.admin_name))])]):e._e(),e._v(" "),e.routesItem.auth.store&&(!e.subForm.id||e.subForm.admin_id&&e.base_store.length>0)?r("el-form-item",{attrs:{label:"挂靠门店",prop:"store_id"}},[r("el-select",{attrs:{filterable:"",clearable:"",placeholder:"请选择"},on:{change:e.changeStore},model:{value:e.subForm.store_id,callback:function(t){e.$set(e.subForm,"store_id",t)},expression:"subForm.store_id"}},e._l(e.base_store,function(e){return r("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"所在地址",prop:"address"}},[r("el-input",{attrs:{placeholder:"请输入所在地址"},model:{value:e.subForm.address,callback:function(t){e.$set(e.subForm,"address",t)},expression:"subForm.address"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"经度",prop:"lng"}},[r("el-input",{attrs:{placeholder:"请输入经度"},model:{value:e.subForm.lng,callback:function(t){e.$set(e.subForm,"lng",t)},expression:"subForm.lng"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"纬度",prop:"lat"}},[r("el-input",{attrs:{placeholder:"请输入纬度"},model:{value:e.subForm.lat,callback:function(t){e.$set(e.subForm,"lat",t)},expression:"subForm.lat"}}),e._v(" "),r("lb-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:function(t){e.showMap=!0}}},[e._v("获取经纬度")])],1),e._v(" "),r("el-form-item",{attrs:{label:e.$t("action.attendantName")+"简介",prop:"text"}},[r("el-input",{attrs:{type:"textarea",rows:10,maxlength:"300",resize:"none","show-word-limit":"",placeholder:"请输入"+e.$t("action.attendantName")+"简介"},model:{value:e.subForm.text,callback:function(t){e.$set(e.subForm,"text",t)},expression:"subForm.text"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"身份证号",prop:"id_code"}},[r("el-input",{attrs:{placeholder:"请输入身份证号"},model:{value:e.subForm.id_code,callback:function(t){e.$set(e.subForm,"id_code",t)},expression:"subForm.id_code"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"身份证照片",prop:"id_card"}},[r("lb-cover",{attrs:{fileList:e.subForm.id_card,fileType:"image",type:"more",fileSize:3},on:{selectedFiles:function(t){return e.getBannerList(t,"id_card")}}}),e._v(" "),r("lb-tool-tips",[e._v("请分别上传身份证人像面、身份证国徽面、手持身份证照片")])],1),e._v(" "),r("el-form-item",{attrs:{label:"资格证书",prop:"license"}},[r("lb-cover",{attrs:{fileList:e.subForm.license,fileType:"image",type:"more",fileSize:15},on:{selectedFiles:function(t){return e.getBannerList(t,"license")}}})],1),e._v(" "),r("el-form-item",{attrs:{label:"工作形象照",prop:"work_img"}},[r("lb-cover",{attrs:{fileList:e.subForm.work_img},on:{selectedFiles:function(t){return e.getCover(t,"work_img")}}}),e._v(" "),r("lb-tool-tips",[e._v("图片建议尺寸: 750 * 750")])],1),e._v(" "),r("el-form-item",{attrs:{label:"个人生活照",prop:"self_img"}},[r("lb-cover",{attrs:{fileList:e.subForm.self_img,fileType:"image",type:"more",tips:"750 * n",fileSize:9},on:{selectedFiles:function(t){return e.getBannerList(t,"self_img")}}})],1),e._v(" "),r("el-form-item",{attrs:{label:"个人视频介绍",prop:"video"}},[r("div",{staticClass:"lb-file-input flex-between"},[r("div",{class:[{"c-title":e.subForm.video}]},[e._v("\n "+e._s(e._f("handleFileName")(e.subForm.video))+"\n ")]),e._v(" "),r("lb-cover",{attrs:{type:"button",fileType:"video",fileSize:1},on:{selectedFiles:function(t){return e.getFile(t,"video")}}})],1)]),e._v(" "),r("el-form-item",{attrs:{label:"虚拟订单量",prop:"order_num"}},[r("el-input",{attrs:{placeholder:"请输入虚拟订单量"},model:{value:e.subForm.order_num,callback:function(t){e.$set(e.subForm,"order_num",e._n(t))},expression:"subForm.order_num"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"是否接单",prop:"is_work"}},[r("el-radio-group",{model:{value:e.subForm.is_work,callback:function(t){e.$set(e.subForm,"is_work",t)},expression:"subForm.is_work"}},[r("el-radio",{attrs:{label:1}},[e._v("接单")]),e._v(" "),r("el-radio",{attrs:{label:0}},[e._v("休息")])],1)],1),e._v(" "),e.subForm.is_work?r("el-form-item",{attrs:{label:"选择接单时间",prop:"start_time"}},[r("el-time-select",{staticStyle:{width:"150px"},attrs:{placeholder:"开始时间","picker-options":{start:"00:00",step:"00:01",end:"24:00"}},model:{value:e.subForm.start_time,callback:function(t){e.$set(e.subForm,"start_time",t)},expression:"subForm.start_time"}}),e._v(" "),r("block",[e._v("至"+e._s(e._f("handleStartEndTime")(e.subForm)))]),e._v(" "),r("el-time-select",{staticStyle:{width:"150px"},attrs:{placeholder:"结束时间","picker-options":{start:"00:00",step:"00:01",end:"24:00"}},model:{value:e.subForm.end_time,callback:function(t){e.$set(e.subForm,"end_time",t)},expression:"subForm.end_time"}})],1):e._e(),e._v(" "),e.fdd_agreement&&e.fdd_agreement.id&&(1===e.routesItem.userInfo.is_admin||0===e.routesItem.userInfo.is_admin&&e.routesItem.userInfo.id===e.subForm.admin_id)?r("el-form-item",{attrs:{label:"电子签约:"}},[r("div",{staticClass:"cursor-pointer c-link",on:{click:function(t){e.showFile=!0}}},[e._v("\n 查看签约合同\n ")])]):e._e(),e._v(" "),r("el-form-item",[r("lb-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),r("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1),e._v(" "),r("el-dialog",{attrs:{title:"关联用户",visible:e.showDialog,width:"800px",center:""},on:{"update:visible":function(t){e.showDialog=t}}},[0===e.routesItem.userInfo.is_admin?r("lb-tips",[e._v("请输入用户昵称/手机号后点击查询数据")]):e._e(),e._v(" "),r("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm,"label-width":"70px"}},[r("el-form-item",{attrs:{label:"输入查询",prop:"nickName"}},[r("el-input",{attrs:{placeholder:"请输入用户昵称/手机号"},model:{value:e.searchForm.nickName,callback:function(t){e.$set(e.searchForm,"nickName",t)},expression:"searchForm.nickName"}})],1),e._v(" "),r("el-form-item",[r("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1)}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),r("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("searchForm")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1),e._v(" "),r("el-table",{ref:"singleTable",staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"},"tooltip-effect":"dark","highlight-current-row":""},on:{"current-change":e.handleSelectionChange}},[r("el-table-column",{attrs:{prop:"id",label:"用户ID"}}),e._v(" "),r("el-table-column",{attrs:{prop:"avatarUrl",label:"头像"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("lb-image",{attrs:{src:e.row.avatarUrl}})]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"nickName",label:"昵称"}}),e._v(" "),r("el-table-column",{attrs:{prop:"phone",label:"手机号"}})],1),e._v(" "),r("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}}),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.showDialog=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.handleDialogConfirm}},[e._v("确 定")])],1)],1),e._v(" "),r("el-dialog",{attrs:{title:"签约合同",visible:e.showFile,"append-to-body":!0,width:"1000px",center:""},on:{"update:visible":function(t){e.showFile=t}}},[e.fdd_agreement&&e.fdd_agreement?r("iframe",{attrs:{frameborder:"0",src:e.fdd_agreement.viewpdf_url,width:"100%",height:"800px"}}):e._e()]),e._v(" "),r("lb-map",{attrs:{dialogVisible:e.showMap},on:{"update:dialogVisible":function(t){e.showMap=t},"update:dialog-visible":function(t){e.showMap=t},selectedLatLng:e.getLatLng}})],1)],1)},staticRenderFns:[]};var w=r("VU/8")(F,k,!1,function(e){r("DhQI")},"data-v-3ae8618e",null);t.default=w.exports}}); |