webpackJsonp([69],{Hgpp:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("mvHQ"),l=a.n(r),o=a("Xxa5"),i=a.n(o),n=a("exGp"),s=a.n(n),c={data:function(){return{navTitle:"",base_cate:[],subForm:{title:"",sub_title:"",cate_id:[],cover:[],price:"",material_price:"",sale:"",true_sale:"",time_long:"",com_balance:"",status:1,coach:[],top:0,is_add:1},subFormRules:{title:{required:!0,validator:this.$reg.isNotNull,text:"服务名称",reg_type:2,trigger:"blur"},sub_title:{required:!0,validator:this.$reg.isNotNull,text:"副标题",reg_type:2,trigger:"blur"},cover:{required:!0,type:"array",message:"请上传图片",trigger:["blur","change"]},price:{required:!0,validator:this.$reg.isMoney,text:"服务价格",trigger:"blur"},material_price:{required:!0,validator:this.$reg.isMoney,text:"物料费",trigger:"blur"},sale:{required:!0,validator:this.$reg.isNum,trigger:"blur"},time_long:{required:!0,validator:this.$reg.isNum,reg_type:2,trigger:"blur"},com_balance:{required:!0,validator:this.$reg.isPercent,text:"分销返佣",trigger:"blur"},top:{required:!0,type:"number",message:"请输入排序值",trigger:"blur"},coach:{required:!0,type:"array",message:"请选择关联"+this.$t("action.attendantName"),trigger:"blur"}},searchForm:{page:1,limit:10,status:2,name:""},total:0,loading:!1,tableData:[],multipleSelection:[],showDialog:!1}},created:function(){var e=this;return s()(i.a.mark(function t(){var a;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.$route.query.id,t.next=3,e.getBaseInfo();case 3:a&&(e.subForm.id=a,e.getDetail(a)),e.navTitle=e.$t(a?"menu.ServiceBellEdit":"menu.ServiceBellAdd");case 5:case"end":return t.stop()}},t,e)}))()},methods:{getBaseInfo:function(){var e=this;return s()(i.a.mark(function t(){var a,r;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$api.service.cateSelect();case 2:a=t.sent,r=a.data,e.base_cate=r;case 5:case"end":return t.stop()}},t,e)}))()},getCover:function(e){this.subForm.cover=e},getDetail:function(e){var t=this;return s()(i.a.mark(function a(){var r,l,o,n;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t.$api.service.serviceInfo({id:e});case 2:if(r=a.sent,l=r.code,o=r.data,200===l){a.next=7;break}return a.abrupt("return");case 7:for(n in o.cover=[{url:o.cover}],t.subForm)t.subForm[n]=o[n];case 9:case"end":return a.stop()}},a,t)}))()},toShowDialog:function(){var e=this;return s()(i.a.mark(function t(){return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.searchForm.name="",t.next=3,e.getTableDataList();case 3:e.showDialog=!e.showDialog;case 4: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 s()(i.a.mark(function a(){var r,l,o;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(t.searchForm.page=1),t.tableData=[],t.loading=!0,a.next=5,t.$api.technician.coachList(t.searchForm);case 5:if(r=a.sent,l=r.code,o=r.data,t.loading=!1,200===l){a.next=11;break}return a.abrupt("return");case 11:t.tableData=o.data,t.total=o.total;case 13:case"end":return a.stop()}},a,t)}))()},handleSelectionChange:function(e){this.multipleSelection=e},handleDialogConfirm:function(){var e=JSON.parse(l()(this.subForm.coach)),t=e.length>0?e.map(function(e){return e.id}):[];this.multipleSelection.map(function(a){t.includes(a.id)||e.push(a)}),this.subForm.coach=e,this.showDialog=!1},confirmDel:function(e){var t=this.subForm.coach.findIndex(function(t){return t.id===e});this.subForm.coach.splice(t,1)},submitForm:function(){var e=this,t=!0;if(this.$refs.subForm.validate(function(e){e||(t=!1)}),t){var a=JSON.parse(l()(this.subForm));a.cover=a.cover[0].url;var r=a.coach.map(function(e){return e.id});a.coach=r;var o=a.id?"serviceUpdate":"serviceAdd";this.$api.service[o](a).then(function(t){200===t.code&&(e.$message.success(e.$t(a.id?"tips.successRev":"tips.successSub")),e.$router.back(-1))})}}}},u={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-system-banner-edit"},[a("top-nav",{attrs:{title:e.navTitle,isBack:!0}}),e._v(" "),a("div",{staticClass:"page-main"},[a("el-form",{ref:"subForm",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"130px"},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"服务名称",prop:"title"}},[a("el-input",{attrs:{maxlength:"15","show-word-limit":"",placeholder:"请输入服务名称"},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"所属分类",prop:"cate_id"}},[a("el-select",{attrs:{multiple:"","collapse-tags":"",filterable:"",clearable:"",placeholder:"请选择"},model:{value:e.subForm.cate_id,callback:function(t){e.$set(e.subForm,"cate_id",t)},expression:"subForm.cate_id"}},e._l(e.base_cate,function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"封面图",prop:"cover"}},[a("lb-cover",{attrs:{fileList:e.subForm.cover},on:{selectedFiles:e.getCover}}),e._v(" "),a("lb-tool-tips",[e._v("图片建议尺寸: 400 * 400")])],1),e._v(" "),a("el-form-item",{attrs:{label:"服务价格",prop:"price"}},[a("el-input",{attrs:{placeholder:"请输入服务价格"},model:{value:e.subForm.price,callback:function(t){e.$set(e.subForm,"price",t)},expression:"subForm.price"}},[a("template",{slot:"append"},[e._v("元")])],2)],1),e._v(" "),a("el-form-item",{attrs:{label:"物料费",prop:"material_price"}},[a("el-input",{attrs:{placeholder:"请输入物料费"},model:{value:e.subForm.material_price,callback:function(t){e.$set(e.subForm,"material_price",t)},expression:"subForm.material_price"}},[a("template",{slot:"append"},[e._v("元")])],2),e._v(" "),a("lb-tool-tips",[e._v("服务过程中消耗的物料费,例如:一次性衣物,物料费不计入"+e._s(e.$t("action.attendantName"))+"提成")])],1),e._v(" "),a("el-form-item",{attrs:{label:"虚拟销售量",prop:"sale"}},[a("el-input",{attrs:{placeholder:"请输入虚拟销售量"},model:{value:e.subForm.sale,callback:function(t){e.$set(e.subForm,"sale",t)},expression:"subForm.sale"}},[a("template",{slot:"append"},[e._v("人选择")])],2),e._v(" "),a("lb-tool-tips",[e._v("该虚拟销售量=虚拟+实际销售量")])],1),e._v(" "),a("el-form-item",{attrs:{label:"服务时长",prop:"time_long"}},[a("el-input",{attrs:{placeholder:"请输入服务时长"},model:{value:e.subForm.time_long,callback:function(t){e.$set(e.subForm,"time_long",t)},expression:"subForm.time_long"}},[a("template",{slot:"append"},[e._v("分钟")])],2),e._v(" "),a("lb-tool-tips",[e._v("一次服务的时间段,一般为60分钟")])],1),e._v(" "),a("el-form-item",{attrs:{label:"分销返佣",prop:"com_balance"}},[a("el-input",{attrs:{placeholder:"请输入分销返佣"},model:{value:e.subForm.com_balance,callback:function(t){e.$set(e.subForm,"com_balance",t)},expression:"subForm.com_balance"}},[a("template",{slot:"append"},[e._v("%")])],2),e._v(" "),a("lb-tool-tips",[e._v("实际支付金额的百分比")])],1),e._v(" "),a("el-form-item",{attrs:{label:"排序值",prop:"top"}},[a("el-input-number",{staticClass:"lb-input-number",attrs:{min:0,controls:!1,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),a("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1),e._v(" "),a("el-form-item",{attrs:{label:"关联"+e.$t("action.attendantName"),prop:"coach"}},[a("lb-button",{attrs:{type:"primary",icon:"el-icon-plus"},on:{click:e.toShowDialog}},[e._v("选择"+e._s(e.$t("action.attendantName")))]),e._v(" "),a("el-table",{staticClass:"mt-lg",staticStyle:{width:"100%"},attrs:{data:e.subForm.coach,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"id",label:e.$t("action.attendantName")+"ID"}}),e._v(" "),a("el-table-column",{attrs:{prop:"work_img",label:e.$t("action.attendantName")+"头像"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("lb-image",{attrs:{src:e.row.work_img}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"coach_name",label:e.$t("action.attendantName")+"名称"}}),e._v(" "),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[a("lb-button",{attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(a){return e.confirmDel(t.row.id)}}},[e._v(e._s(e.$t("action.delete")))])],1)]}}])})],1)],1),e._v(" "),a("el-form-item",[a("lb-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("action.submit")))]),e._v(" "),a("lb-button",{on:{click:function(t){return e.$router.back(-1)}}},[e._v(e._s(e.$t("action.back")))])],1)],1),e._v(" "),a("el-dialog",{attrs:{title:"关联"+e.$t("action.attendantName"),visible:e.showDialog,width:"800px",center:""},on:{"update:visible":function(t){e.showDialog=t}}},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm,"label-width":"70px"}},[a("el-form-item",{attrs:{label:"输入查询",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入"+e.$t("action.attendantName")+"姓名/手机号"},model:{value:e.searchForm.name,callback:function(t){e.$set(e.searchForm,"name",t)},expression:"searchForm.name"}})],1),e._v(" "),a("el-form-item",[a("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(" "),a("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(" "),a("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"},"tooltip-effect":"dark"},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),a("el-table-column",{attrs:{prop:"id",label:e.$t("action.attendantName")+"ID"}}),e._v(" "),a("el-table-column",{attrs:{prop:"work_img",label:e.$t("action.attendantName")+"头像"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("lb-image",{attrs:{src:e.row.work_img}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"coach_name",label:e.$t("action.attendantName")+"姓名"}}),e._v(" "),a("el-table-column",{attrs:{prop:"mobile",label:"手机号"}})],1),e._v(" "),a("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(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.showDialog=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.handleDialogConfirm}},[e._v("确 定")])],1)],1)],1)],1)},staticRenderFns:[]};var m=a("VU/8")(c,u,!1,function(e){a("ZSHj")},"data-v-4bc32870",null);t.default=m.exports},ZSHj:function(e,t){}});