1 line
18 KiB
JavaScript
1 line
18 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-10999506"],{16879:function(t,e,a){},"67ad":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"divBox"},[a("div",{staticClass:"selCard"},[a("el-form",{ref:"searchForm",attrs:{model:t.tableFrom,size:"small","label-width":"90px",inline:""}},[a("el-form-item",{attrs:{label:"是否开启:",prop:"status"}},[a("el-select",{staticClass:"selWidth",attrs:{placeholder:"请选择",clearable:""},on:{change:function(e){return t.getList(1)}},model:{value:t.tableFrom.status,callback:function(e){t.$set(t.tableFrom,"status",e)},expression:"tableFrom.status"}},t._l(t.applyStatus,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"配送方式:",prop:"type"}},[a("el-select",{staticClass:"selWidth",attrs:{placeholder:"请选择",clearable:""},on:{change:function(e){return t.getList(1)}},model:{value:t.tableFrom.type,callback:function(e){t.$set(t.tableFrom,"type",e)},expression:"tableFrom.type"}},t._l(t.deliveryPoint,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"发货点名称:",prop:"station_name"}},[a("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入发货点名称",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getList(1)}},model:{value:t.tableFrom.station_name,callback:function(e){t.$set(t.tableFrom,"station_name",e)},expression:"tableFrom.station_name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"关键字:",prop:"keyword"}},[a("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入联系人姓名或电话",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getList(1)}},model:{value:t.tableFrom.keyword,callback:function(e){t.$set(t.tableFrom,"keyword",e)},expression:"tableFrom.keyword"}})],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.getList(1)}}},[t._v("搜索")]),t._v(" "),a("el-button",{attrs:{size:"small"},on:{click:function(e){return t.searchReset()}}},[t._v("重置")])],1)],1)],1),t._v(" "),a("el-card",{staticClass:"mt14"},[a("el-button",{staticClass:"mb20",attrs:{size:"small",type:"primary"},on:{click:t.add}},[t._v("添加发货点")]),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.tableData.data,size:"small"}},[a("el-table-column",{attrs:{label:"序号",prop:"station_id","min-width":"50"}}),t._v(" "),a("el-table-column",{attrs:{prop:"station_name",label:"发货点名称","min-width":"100"}}),t._v(" "),a("el-table-column",{attrs:{prop:"type",label:"配送方","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v("\n "+t._s(1==e.row.type?"达达":"UU")+"\n ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"contact_name",label:"联系人姓名","min-width":"60"}}),t._v(" "),a("el-table-column",{attrs:{prop:"phone",label:"联系人电话","min-width":"100"}}),t._v(" "),a("el-table-column",{attrs:{label:"是否开启","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-text":"是","inactive-text":"否"},nativeOn:{click:function(a){return t.onchangeIsShow(e.row)}},model:{value:e.row.status,callback:function(a){t.$set(e.row,"status",a)},expression:"scope.row.status"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"创建时间","min-width":"100"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"100",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.onEdit(e.row.station_id)}}},[t._v("编辑")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.onRemark(e.row.station_id)}}},[t._v("备注")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.onDetails(e.row.station_id)}}},[t._v("详情")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.onDelete(e.row.station_id,e.$index)}}},[t._v("删除")])]}}])})],1),t._v(" "),a("div",{staticClass:"block"},[a("el-pagination",{attrs:{background:"","page-size":t.tableFrom.limit,"current-page":t.tableFrom.page,layout:"total, prev, pager, next, jumper",total:t.tableData.total},on:{"size-change":t.handleSizeChange,"current-change":t.pageChange}})],1)],1),t._v(" "),a("add-store",{ref:"addStore",attrs:{mapKey:t.mapKey,keyUrl:t.keyUrl,deliveryType:t.delivery_type},on:{getList:t.getList}}),t._v(" "),t.dialogVisible?a("el-dialog",{attrs:{title:"发货点详情",visible:t.dialogVisible,width:"470px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[a("div",{staticClass:"description"},[a("div",{staticClass:"acea-row"},[a("div",{staticClass:"description-term"},[t._v("商户名称:"+t._s(t.storeDetail.merchant&&t.storeDetail.merchant.mer_name))]),t._v(" "),a("div",{staticClass:"description-term"},[t._v("发货点名称:"+t._s(t.storeDetail.station_name))]),t._v(" "),a("div",{staticClass:"description-term"},[t._v("配送方:"+t._s(1==t.storeDetail.type?"达达":"UU"))]),t._v(" "),a("div",{staticClass:"description-term"},[t._v("联系电话:"+t._s(t.storeDetail.phone))]),t._v(" "),a("div",{staticClass:"description-term"},[t._v("配送品类:"+t._s(t.storeDetail.business&&t.storeDetail.business.label))]),t._v(" "),a("div",{staticClass:"description-term"},[t._v("发货点联系人:"+t._s(t.storeDetail.contact_name))]),t._v(" "),a("div",{staticClass:"description-term"},[t._v("发货点联系电话:"+t._s(t.storeDetail.phone))]),t._v(" "),a("div",{staticClass:"description-term"},[t._v("经纬度:"+t._s(t.storeDetail.lat)+","+t._s(t.storeDetail.lng))]),t._v(" "),a("div",{staticClass:"description-term"},[t._v("详细地址:"+t._s(t.storeDetail.station_address))]),t._v(" "),a("div",{staticClass:"description-term"},[t._v("是否显示:"+t._s(1==t.storeDetail.status?"显示":"不显示"))]),t._v(" "),a("div",{staticClass:"description-term"},[t._v("备注:"+t._s(t.storeDetail.mark||"无"))])])])])]):t._e()],1)},s=[],l=a("a7a4"),n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{title:t.station_id?"编辑发货点":"添加发货点",visible:t.dialogVisible,width:"540px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("div",{staticClass:"description"},[a("div",[a("el-form",{ref:"formValidate",attrs:{size:"small",model:t.formValidate,rules:t.rules,"label-width":"110px"}},[a("el-form-item",{attrs:{label:"发货点名称:",prop:"station_name"}},[a("el-input",{staticClass:"width100",attrs:{placeholder:"请输入发货点名称"},model:{value:t.formValidate.station_name,callback:function(e){t.$set(t.formValidate,"station_name",e)},expression:"formValidate.station_name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"配送品类:",prop:"business"}},[a("el-select",{staticClass:"width100",attrs:{placeholder:"请选择",clearable:""},model:{value:t.formValidate.business,callback:function(e){t.$set(t.formValidate,"business",e)},expression:"formValidate.business"}},t._l(t.categoryList,(function(t){return a("el-option",{attrs:{label:t.label,value:t.key}})})),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"所属城市:",prop:"city_name"}},[a("el-select",{staticClass:"width100",attrs:{placeholder:"请选择",filterable:"",clearable:""},model:{value:t.formValidate.city_name,callback:function(e){t.$set(t.formValidate,"city_name",e)},expression:"formValidate.city_name"}},t._l(t.cityList,(function(t){return a("el-option",{key:t.key,attrs:{label:t.label,value:t.key}})})),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"发货点地址:",prop:"station_address"}},[a("el-input",{staticClass:"width100",attrs:{placeholder:"请输入发货点地址"},model:{value:t.formValidate.station_address,callback:function(e){t.$set(t.formValidate,"station_address",e)},expression:"formValidate.station_address"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"经纬度:",prop:"location"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{"enter-button":"查找位置",placeholder:"请查找位置"},model:{value:t.formValidate.location,callback:function(e){t.$set(t.formValidate,"location",e)},expression:"formValidate.location"}},[a("el-button",{attrs:{slot:"append"},on:{click:t.onSearchs},slot:"append"},[t._v("查找位置")])],1),t._v(" "),a("div",{attrs:{slot:"content"},slot:"content"},[t._v("请点击查找位置选择位置")])],1),t._v(" "),a("el-form-item",{attrs:{label:"联系人姓名:",prop:"contact_name"}},[a("el-input",{staticClass:"width100",attrs:{placeholder:"请输入联系人姓名"},model:{value:t.formValidate.contact_name,callback:function(e){t.$set(t.formValidate,"contact_name",e)},expression:"formValidate.contact_name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"联系人电话:",prop:"phone"}},[a("el-input",{staticClass:"width100",attrs:{placeholder:"请输入联系人电话"},model:{value:t.formValidate.phone,callback:function(e){t.$set(t.formValidate,"phone",e)},expression:"formValidate.phone"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"联系人身份证:"}},[a("el-input",{staticClass:"width100",attrs:{placeholder:"请输入联系人身份证"},model:{value:t.formValidate.id_card,callback:function(e){t.$set(t.formValidate,"id_card",e)},expression:"formValidate.id_card"}})],1),t._v(" "),1==t.deliveryType?a("el-form-item",{attrs:{label:"达达商家app账号:",required:""}},[a("el-input",{staticClass:"width100",attrs:{placeholder:"请输入app账号(必须是手机号)"},model:{value:t.formValidate.username,callback:function(e){t.$set(t.formValidate,"username",e)},expression:"formValidate.username"}})],1):t._e(),t._v(" "),1==t.deliveryType?a("el-form-item",{attrs:{label:"达达商家app密码:",required:""}},[a("el-input",{staticClass:"width100",attrs:{placeholder:"请输入商家app密码"},model:{value:t.formValidate.password,callback:function(e){t.$set(t.formValidate,"password",e)},expression:"formValidate.password"}})],1):t._e(),t._v(" "),a("el-form-item",{attrs:{label:"状态:"}},[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,width:55,"active-text":"开启","inactive-text":"关闭"},model:{value:t.formValidate.status,callback:function(e){t.$set(t.formValidate,"status",e)},expression:"formValidate.status"}})],1)],1),t._v(" "),a("span",{staticClass:"dialog-footerdialog-footer"},[a("el-button",{staticStyle:{width:"100%"},attrs:{type:"primary"},on:{click:function(e){return t.submitForm("formValidate")}}},[t._v("提交")])],1)],1),t._v(" "),t.modalMap?a("el-dialog",{staticClass:"mapBox",attrs:{visible:t.modalMap,title:"选择位置","close-on-click-modal":"","custom-class":"dialog-scustom","append-to-body":!0},on:{"update:visible":function(e){t.modalMap=e}},model:{value:t.modalMap,callback:function(e){t.modalMap=e},expression:"modalMap"}},[a("iframe",{attrs:{id:"mapPage",width:"100%",height:"500px",frameborder:"0",src:t.keyUrl}})]):t._e()],1)])},r=[],o=(a("28a5"),a("7f7f"),a("c5f6"),{name:"addStore",props:{mapKey:{type:String,default:""},keyUrl:{type:String,default:""},deliveryType:{type:Number,default:1}},data:function(){return{dialogVisible:!1,loading:!1,listLoading:!0,modalMap:!1,station_id:"",formValidate:{location:""},categoryList:[],cityList:[],rules:{station_name:[{required:!0,message:"请输入发货点名称",trigger:"blur"}],business:[{required:!0,message:"请选择配送品类",trigger:"change"}],station_address:[{required:!0,message:"请输入发货点地址",trigger:"blur"}],location:[{required:!0,message:"请选择经纬度",trigger:"blur"}],contact_name:[{required:!0,message:"请输入联系人姓名",trigger:"blur"}],phone:[{required:!0,message:"请输入联系人电话",trigger:"blur"},{pattern:/^1[3456789]\d{9}$/,message:"请输入正确的手机号",trigger:"blur"}]}}},mounted:function(){window.addEventListener("message",(function(t){var e=t.data;e&&"locationPicker"===e.module&&window.parent.selectAdderss(e)}),!1),window.selectAdderss=this.selectAdderss,this.getCategoryList(),this.getCityList()},methods:{onSearchs:function(){this.mapKey&&""!=this.mapKey?this.modalMap=!0:this.$message.error("平台未配置腾讯地图KEY")},selectAdderss:function(t){this.formValidate.lat=t.latlng.lat,this.formValidate.lng=t.latlng.lng,this.formValidate.location=t.latlng.lat+","+t.latlng.lng,this.modalMap=!1},getCategoryList:function(){var t=this;Object(l["k"])().then((function(e){t.categoryList=e.data})).catch((function(e){t.$message.error(e.message)}))},getCityList:function(){var t=this;Object(l["i"])().then((function(e){t.cityList=e.data})).catch((function(e){t.$message.error(e.message)}))},getDetails:function(t){var e=this;this.dialogVisible=!0,this.station_id=t,Object(l["d"])(t).then((function(t){var a=t.data;e.formValidate={station_name:a.station_name,business:a.business&&a.business.key,station_address:a.station_address,location:a.lat+","+a.lng,contact_name:a.contact_name,phone:a.phone,id_card:a.id_card,username:a.username,password:a.password,status:a.status,city_name:a.city_name}})).catch((function(t){e.$message.error(t.message)}))},submitForm:function(t){var e=this;this.$refs[t].validate((function(t){if(t){e.formValidate.lat=e.formValidate.location.split(",")[0],e.formValidate.lng=e.formValidate.location.split(",")[1];var a=/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;if(e.formValidate.id_card&&!a.test(e.formValidate.id_card))return e.$message.warning("请输入正确的身份证号!");e.station_id?Object(l["h"])(e.station_id,e.formValidate).then((function(t){e.dialogVisible=!1,e.station_id="",e.$message.success(t.message),e.$emit("getList","")})).catch((function(t){var a=t.message;e.$message.error(a)})):Object(l["b"])(e.formValidate).then((function(t){e.dialogVisible=!1,e.$message.success(t.message),e.$emit("getList","")})).catch((function(t){var a=t.message;e.$message.error(a)}))}}))},addStore:function(){this.dialogVisible=!0,this.station_id="",this.$refs["formValidate"].resetFields()}}}),c=o,d=a("2877"),u=Object(d["a"])(c,n,r,!1,null,"999a919c",null),m=u.exports,p={components:{addStore:m},data:function(){return{dialogVisible:!1,storeDetail:{},tableData:{data:[],total:0},mapKey:"",keyUrl:"",listLoading:!0,loading:!0,tableFrom:{keyword:"",status:"",station_name:"",page:1,limit:20},applyStatus:[{value:1,label:"是"},{value:0,label:"否"}],deliveryPoint:[{value:1,label:"达达"},{value:2,label:"UU"}],delivery_type:1}},mounted:function(){this.getMapKey(),this.getList(1)},methods:{searchReset:function(){this.$refs.searchForm.resetFields(),this.getList(1)},add:function(){this.$refs.addStore.addStore()},onEdit:function(t){this.$refs.addStore.getDetails(t)},getMapKey:function(){var t=this;Object(l["j"])().then((function(e){t.mapKey=e.data.tx_map_key;var a=e.data.tx_map_key;t.keyUrl="https://apis.map.qq.com/tools/locpicker?type=1&key=".concat(a,"&referer=myapp"),t.delivery_type=e.data.delivery_type})).catch((function(e){t.$message.error(e.message)}))},getList:function(t){var e=this;this.listLoading=!0,this.tableFrom.page=t||this.tableFrom.page,Object(l["e"])(this.tableFrom).then((function(t){e.tableData.data=t.data.list,e.tableData.total=t.data.count,e.listLoading=!1})).catch((function(t){e.$message.error(t.message),e.listLoading=!1}))},pageChange:function(t){this.tableFrom.page=t,this.getList("")},handleSizeChange:function(t){this.tableFrom.limit=t,this.getList("")},onDetails:function(t){var e=this;this.dialogVisible=!0,Object(l["d"])(t).then((function(t){e.storeDetail=t.data,e.loading=!1})).catch((function(t){e.$message.error(t.message),e.loading=!1}))},onRemark:function(t){var e=this;this.$modalForm(Object(l["f"])(t)).then((function(){return e.getList("")}))},onDelete:function(t,e){var a=this;this.$modalSureDelete("确定删除该门店").then((function(){Object(l["c"])(t).then((function(t){var i=t.message;a.$message.success(i),a.tableData.data.splice(e,1)})).catch((function(t){var e=t.message;a.$message.error(e)}))}))},onchangeIsShow:function(t){var e=this;Object(l["g"])(t.station_id,{status:t.status}).then((function(t){var a=t.message;e.$message.success(a),e.getList()})).catch((function(t){var a=t.message;e.$message.error(a)}))}}},f=p,v=(a("82f3"),Object(d["a"])(f,i,s,!1,null,"59d6c354",null));e["default"]=v.exports},"82f3":function(t,e,a){"use strict";a("16879")},a7a4:function(t,e,a){"use strict";a.d(e,"a",(function(){return s})),a.d(e,"k",(function(){return l})),a.d(e,"b",(function(){return n})),a.d(e,"e",(function(){return r})),a.d(e,"d",(function(){return o})),a.d(e,"f",(function(){return c})),a.d(e,"g",(function(){return d})),a.d(e,"j",(function(){return u})),a.d(e,"h",(function(){return m})),a.d(e,"c",(function(){return p})),a.d(e,"i",(function(){return f})),a.d(e,"l",(function(){return v})),a.d(e,"o",(function(){return g})),a.d(e,"m",(function(){return b})),a.d(e,"n",(function(){return _})),a.d(e,"p",(function(){return h}));var i=a("0c6d");function s(t){return i["a"].get("config/".concat(t))}function l(){return i["a"].get("delivery/station/business")}function n(t){return i["a"].post("delivery/station/create",t)}function r(t){return i["a"].get("delivery/station/lst",t)}function o(t){return i["a"].get("delivery/station/detail/".concat(t))}function c(t){return i["a"].get("delivery/station/mark/".concat(t,"/form"))}function d(t,e){return i["a"].post("delivery/station/status/".concat(t),e)}function u(){return i["a"].get("config")}function m(t,e){return i["a"].post("delivery/station/update/".concat(t),e)}function p(t){return i["a"].delete("delivery/station/delete/".concat(t))}function f(){return i["a"].get("delivery/station/getCity")}function v(t){return i["a"].post("service/reply/create",t)}function g(t,e){return i["a"].get("service/reply/list",{page:t,limit:e})}function b(t){return i["a"].delete("service/reply/delete/".concat(t))}function _(t,e){return i["a"].post("service/reply/update/".concat(t),e)}function h(t,e){return i["a"].post("service/reply/status/".concat(t),{status:e})}}}]); |