| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7076a4d0"],{"54f9":function(e,n,t){"use strict";var o=t("8c8e"),r=t.n(o);r.a},"8c8e":function(e,n,t){},c3d3:function(e,n,t){"use strict";t.r(n);var o=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"shop-list"},[t("cl-crud",{on:{load:e.onLoad},scopedSlots:e._u([{key:"table-column-gatheringCode",fn:function(n){var o=n.scope;return[o.row.gatheringCode?t("el-link",{on:{click:function(n){return e.download("gatheringCode",o.row.id)}}},[e._v("下载")]):e._e()]}},{key:"table-column-applyMemberCode",fn:function(n){var o=n.scope;return[o.row.applyMemberCode?t("el-link",{on:{click:function(n){return e.download("applyMemberCode",o.row.id)}}},[e._v("下载")]):e._e()]}},{key:"slot-top-add",fn:function(){return[t("el-button",{attrs:{size:"mini"},on:{click:e.shopAdd}},[e._v("添加门店")]),t("el-button",{attrs:{size:"mini"},on:{click:e.shopPic}},[e._v("门店图片")])]},proxy:!0}])})],1)},r=[],a=(t("a15b"),t("d81d"),t("b0c0"),t("ac1f"),t("1276"),t("3835")),i=t("5530"),l=(t("51be"),{data:function(){return{crud:null}},methods:{onLoad:function(e){var n=this,t=e.ctx,o=e.app;this.$createElement;this.crud=o,t.service({page:function(e){return n.$service.shop.list(e).then((function(n){return{list:n.list,pagination:{page:e.page,size:20,total:0}}}))},add:function(e){return n.$service.shop.add(Object(i["a"])({},e,{openTime:e.openTime.join("-")}))},update:function(e){return n.$service.shop.update(Object(i["a"])({},e,{openTime:e.openTime.join("-")}))},delete:function(e){return n.$service.shop.delete({id:e.ids})}}).set("table",{columns:[{label:"ID",prop:"id",align:"center"},{label:"门店名称",prop:"shopName",align:"center"},{label:"营业时间",prop:"openTime",align:"center"},{label:"联系电话",prop:"telephone",align:"center"},{label:"累计收入",prop:"totalIncome",align:"center"},{label:"地址",prop:"fullAddress",align:"center"},{label:"收款码",prop:"gatheringCode",align:"center"},{label:"注册会员码",prop:"applyMemberCode",align:"center"}]}).set("upsert",{items:[{label:"门店名称",prop:"shopName",component:{name:"el-input"},rules:{required:!0,message:"门店名称不能为空"}},{label:"营业时间",prop:"openTime",value:["08:00","22:00"],component:{name:"el-time-picker",props:{"is-range":!0,"arrow-control":!0,"value-format":"HH:mm"}},rules:{required:!0,message:"营业时间不能为空"}},{label:"联系电话",prop:"telephone",component:{name:"el-input",attrs:{placeholder:"联系电话"}},rules:{required:!0,message:"联系电话不能为空"}},{label:"所在城市",prop:"provinceCity",component:{name:"shop-city",attrs:{options:[]},props:{value:null,options:Array},data:function(){return{value2:this.value}},watch:{value:function(e){this.value2=e}},methods:{change:function(e){var n=Object(a["a"])(e,3),t=n[0],r=n[1];n[2];o.setForm("province",t),o.setForm("city",r),o.setForm("lat",""),o.setForm("long",""),o.setForm("address","")}},render:function(){var e=this,n=arguments[0];return n("el-cascader",{on:{change:this.change},attrs:{options:this.options},props:Object(i["a"])({},{props:{label:"name",value:"name",children:"children"}}),model:{value:e.value2,callback:function(n){e.value2=n}}})}},rules:{required:!0,validator:function(e,n,t){var r=o.getForm(),a=r.province,i=r.city;if(!a||!i)return t(new Error("所在城市不能为空"));t()}}},{label:"地址",prop:"address",component:{name:"shop-address",props:{value:null},data:function(){return{value2:this.value}},watch:{value:function(e){this.value2=e}},methods:{querySearchAsync:function(e,n){return o.getForm("city")?e?void this.$service.single.mapSuggestion({region:o.getForm("city"),keyword:e}).then((function(e){var t=e.data;t=t.map((function(e){return e.value=e.address,e})),n(t)})):(n([]),!1):(this.$message.error("请先选择城市"),n([]),!1)},select:function(e){o.setForm("lat",e.location.lat),o.setForm("long",e.location.lng),this.$emit("input",e.address)}},render:function(){var e=this,n=arguments[0];return n("el-autocomplete",{attrs:{"fetch-suggestions":this.querySearchAsync},on:{select:this.select},model:{value:e.value2,callback:function(n){e.value2=n}}})}},rules:{required:!0,message:"地址不能为空"}},{label:"门牌号",prop:"floor",component:{name:"el-input",attrs:{placeholder:"请填写楼号门牌号"}}},{label:"简介",prop:"",component:{name:"el-input",props:{type:"textarea"},attrs:{rows:4}}}]}).set("layout",[["flex1","slot-top-add","refresh-btn"],["data-table"]]).on("info",(function(e,n){var t=n.done;console.log(e),t(Object(i["a"])({},e,{openTime:e.openTime.split("-"),provinceCity:[e.province,e.city]}))})).done(),o.refresh(),this.getCityData()},getCityData:function(){var e=this;this.$service.order.orderRelate().then((function(n){var t=n.region,o=[];if(t.length>0)for(var r in t)if(o.push({id:t[r].id,name:t[r].name,children:[]}),t[r].children&&t[r].children.length>0)for(var a in t[r].children)o[r].children.push({id:t[r].children[a].id,name:t[r].children[a].name});e.crud.setData("upsert.items[prop:provinceCity].component.attrs.options",o)}))},download:function(e,n){var t=null;"gatheringCode"==e?t=this.$service.shop.downloadGatheringCode(n):"applyMemberCode"==e&&(t=this.$service.shop.downloadApplyMemberCode(n)),location.href=t},shopAdd:function(){this.crud.add()},shopPic:function(){this.$router.push("/ad/list")}}}),s=l,c=(t("54f9"),t("2877")),p=Object(c["a"])(s,o,r,!1,null,"434b0aa4",null);n["default"]=p.exports}}]);
|