2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4a7c82da"],{"0317":function(e,t,s){"use strict";s("5b29")},"0736":function(e,t,s){"use strict";s.d(t,"c",(function(){return r})),s.d(t,"a",(function(){return o})),s.d(t,"b",(function(){return n}));var a=s("b775");function r(e){return new Promise((t,s)=>{Object(a["a"])({url:"/housekeepingServ.updateHousekeepingServ",method:"post",data:e}).then(e=>{const a=e.data;0===a.code?t(a):s(a.msg)}).catch(e=>{s(e)})})}function o(e){return new Promise((t,s)=>{Object(a["a"])({url:"/housekeepingType.queryHousekeepingType",method:"get",params:e}).then(e=>{const s=e.data;t(s)}).catch(e=>{s(e)})})}function n(e){return new Promise((t,s)=>{Object(a["a"])({url:"/housekeepingServ.queryAdminServ",method:"get",params:e}).then(e=>{const s=e.data;t(s)}).catch(e=>{s(e)})})}},5267:function(e,t,s){"use strict";s.d(t,"b",(function(){return r})),s.d(t,"d",(function(){return o})),s.d(t,"a",(function(){return n}));var a=s("b775");function r(e){return new Promise((t,s)=>{Object(a["a"])({url:"/housekeepingServ.queryHousekeepingServ",method:"get",params:e}).then(e=>{const s=e.data;t(s)}).catch(e=>{s(e)})})}function o(e){return new Promise((t,s)=>{Object(a["a"])({url:"/housekeepingServ.saveHousekeepingServ",method:"post",data:e}).then(e=>{const a=e.data;0===a.code?t(a):s(a.msg)}).catch(e=>{s(e)})})}function n(e){return new Promise((t,s)=>{Object(a["a"])({url:"/housekeepingServ.deleteHousekeepingServ",method:"post",data:{servId:e}}).then(e=>{const a=e.data;0===a.code?t(a):s(a.msg)}).catch(e=>{s(e)})})}},"5b29":function(e,t,s){},fa1c:function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e._self._c;return t("div",[t("el-card",{staticClass:"ibox"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v("服务信息")])]),t("div",{},[t("el-form",{attrs:{"label-width":"120px"}},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"服务名称",prop:"servName"}},[t("el-input",{attrs:{placeholder:"必填,请填写服务名称"},model:{value:e.addHousekeepingServInfo.servName,callback:function(t){e.$set(e.addHousekeepingServInfo,"servName",t)},expression:"addHousekeepingServInfo.servName"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"服务类型",prop:"hktId"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择服务类型"},model:{value:e.addHousekeepingServInfo.hktId,callback:function(t){e.$set(e.addHousekeepingServInfo,"hktId",t)},expression:"addHousekeepingServInfo.hktId"}},e._l(e.addHousekeepingServInfo.housekeepingTypes,(function(e,s){return t("el-option",{key:s,attrs:{label:e.hktName,value:e.hktId}})})),1)],1)],1)],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"关键词",prop:"keyword"}},[t("el-input",{attrs:{placeholder:"必填,请填写关键词,多个关键词用;分隔"},model:{value:e.addHousekeepingServInfo.keyword,callback:function(t){e.$set(e.addHousekeepingServInfo,"keyword",t)},expression:"addHousekeepingServInfo.keyword"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"回访方式",prop:"returnVisitFlag"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择回访方式"},model:{value:e.addHousekeepingServInfo.returnVisitFlag,callback:function(t){e.$set(e.addHousekeepingServInfo,"returnVisitFlag",t)},expression:"addHousekeepingServInfo.returnVisitFlag"}},e._l(e.addHousekeepingServInfo.returnVisitFlags,(function(e){return t("el-option",{key:e.statusCd,attrs:{label:e.name,value:e.statusCd}})})),1)],1)],1)],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"销量",prop:"sales"}},[t("el-input",{attrs:{placeholder:"选填,请填写销量"},model:{value:e.addHousekeepingServInfo.sales,callback:function(t){e.$set(e.addHousekeepingServInfo,"sales",t)},expression:"addHousekeepingServInfo.sales"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"排序",prop:"sort"}},[t("el-input",{attrs:{placeholder:"选填,请填写排序"},model:{value:e.addHousekeepingServInfo.sort,callback:function(t){e.$set(e.addHousekeepingServInfo,"sort",t)},expression:"addHousekeepingServInfo.sort"}})],1)],1)],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"上架状态",prop:"state"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择上架状态"},model:{value:e.addHousekeepingServInfo.state,callback:function(t){e.$set(e.addHousekeepingServInfo,"state",t)},expression:"addHousekeepingServInfo.state"}},e._l(e.addHousekeepingServInfo.states,(function(e){return t("el-option",{key:e.statusCd,attrs:{label:e.name,value:e.statusCd}})})),1)],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"派单方式",prop:"repairWay"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择派单方式"},model:{value:e.addHousekeepingServInfo.repairWay,callback:function(t){e.$set(e.addHousekeepingServInfo,"repairWay",t)},expression:"addHousekeepingServInfo.repairWay"}},e._l(e.addHousekeepingServInfo.repairWays,(function(e){return t("el-option",{key:e.statusCd,attrs:{label:e.name,value:e.statusCd}})})),1)],1)],1)],1),t("el-row",[t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{label:"服务描述",prop:"servDesc"}},[t("el-input",{attrs:{type:"textarea",placeholder:"必填,请填写服务描述",rows:3,maxlength:"250"},model:{value:e.addHousekeepingServInfo.servDesc,callback:function(t){e.$set(e.addHousekeepingServInfo,"servDesc",t)},expression:"addHousekeepingServInfo.servDesc"}})],1)],1)],1)],1)],1)]),t("el-card",{staticClass:"ibox"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v("服务图片")])]),t("div",{},[t("el-form",{attrs:{"label-width":"120px"}},[t("el-row",[t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{label:"服务封面"}},[t("upload-image-url",{ref:"coverUpload",attrs:{"image-count":1},on:{notifyUploadCoverImage:e.handleCoverUploadSuccess}})],1)],1)],1),t("el-row",[t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{label:"服务轮播"}},[t("upload-image-url",{ref:"carouselUpload",attrs:{"image-count":3},on:{notifyUploadCoverImage:e.handleCarouselUploadSuccess}})],1)],1)],1)],1)],1)]),t("el-card",{staticClass:"ibox"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v("服务扩展")])]),t("div",{},[t("el-form",{attrs:{"label-width":"120px"}},[t("el-row",[t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{label:"服务详情"}},[t("RichTextEditor",{on:{input:e.handleContentChange},model:{value:e.addHousekeepingServInfo.context,callback:function(t){e.$set(e.addHousekeepingServInfo,"context",t)},expression:"addHousekeepingServInfo.context"}})],1)],1)],1)],1),t("div",{staticStyle:{"margin-top":"20px","text-align":"right"}},[t("el-button",{attrs:{type:"warning"},on:{click:e.handleCancel}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.saveHousekeepingServInfo}},[t("i",{staticClass:"el-icon-check"}),e._v("保存 ")])],1)],1)])],1)},r=[],o=s("5e31"),n=s("e01b"),i=s("5267"),l=s("0736"),d=s("7323"),u={name:"AddHousekeepingServ",components:{UploadImageUrl:o["a"],RichTextEditor:n["a"]},data(){return{addHousekeepingServInfo:{servId:"",servName:"",servDesc:"",hktId:"",sales:"",sort:"",state:"",states:[],repairWay:"",returnVisitFlag:"",keyword:"",coverPhoto:"",context:"",areaCode:"",carouselFigurePhoto:[],housekeepingTypes:[],repairWays:[],returnVisitFlags:[]}}},created(){this.initData()},methods:{async initData(){await this._listAddHousekeepingTypes(),await this.getDictData()},async getDictData(){try{const{data:e}=await Object(d["e"])("housekeeping_serv","repair_way");this.addHousekeepingServInfo.repairWays=e;const{data:t}=await Object(d["e"])("housekeeping_serv","state");this.addHousekeepingServInfo.states=t;const{data:s}=await Object(d["e"])("housekeeping_serv","return_visit_flag");this.addHousekeepingServInfo.returnVisitFlags=s}catch(e){console.error("获取字典数据失败:",e)}},handleCoverUploadSuccess(e){e&&e.length>0?this.addHousekeepingServInfo.coverPhoto=e[0]:this.addHousekeepingServInfo.coverPhoto=""},handleCarouselUploadSuccess(e){e&&e.length>0?this.addHousekeepingServInfo.carouselFigurePhoto=e:this.addHousekeepingServInfo.carouselFigurePhoto=[]},handleContentChange(e){this.addHousekeepingServInfo.context=e},handleCancel(){this.$router.go(-1)},async _listAddHousekeepingTypes(){try{const e=await Object(l["a"])({page:1,row:50,typeCd:1001,shopId:Object(d["f"])()});this.addHousekeepingServInfo.housekeepingTypes=e.data}catch(e){console.error("获取服务类型失败:",e)}},async saveHousekeepingServInfo(){if(this.validateForm()){this.addHousekeepingServInfo.shopId=Object(d["f"])(),this.addHousekeepingServInfo.areaCode=Object(d["b"])();try{const e=await Object(i["d"])(this.addHousekeepingServInfo);0===e.code?(this.$message.success("添加成功"),this.$router.go(-1)):this.$message.error(e.msg||"添加失败")}catch(e){console.error("保存失败:",e),this.$message.error("保存失败")}}},validateForm(){return this.addHousekeepingServInfo.servName?this.addHousekeepingServInfo.servName.length>128?(this.$message.error("服务名称不能超过128位"),!1):this.addHousekeepingServInfo.hktId?this.addHousekeepingServInfo.keyword?this.addHousekeepingServInfo.keyword.length>256?(this.$message.error("关键词不能超过256位"),!1):this.addHousekeepingServInfo.returnVisitFlag?this.addHousekeepingServInfo.state?this.addHousekeepingServInfo.repairWay?this.addHousekeepingServInfo.servDesc?this.addHousekeepingServInfo.servDesc.length>256?(this.$message.error("服务描述不能超过256位"),!1):!!this.addHousekeepingServInfo.context||(this.$message.error("服务详情不能为空"),!1):(this.$message.error("服务描述不能为空"),!1):(this.$message.error("派单方式不能为空"),!1):(this.$message.error("上架状态不能为空"),!1):(this.$message.error("回访方式不能为空"),!1):(this.$message.error("关键词不能为空"),!1):(this.$message.error("服务类型不能为空"),!1):(this.$message.error("服务名称不能为空"),!1)}}},c=u,p=(s("0317"),s("2877")),g=Object(p["a"])(c,a,r,!1,null,"af4d3b3c",null);t["default"]=g.exports}}]);
|
|
//# sourceMappingURL=chunk-4a7c82da.3787a0d6.js.map
|