(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c50d75b0"],{"069c":function(e,r,t){},1623:function(e,r,t){"use strict";t("069c")},"569c":function(e,r,t){"use strict";t.r(r);var s=function(){var e=this,r=e._self._c;return r("div",{staticClass:"AddressInfo",staticStyle:{"padding-bottom":"60px"}},[r("div",{staticClass:"Title",staticStyle:{padding:"10px 0 10px 10px",background:"rgb(220,223,230)"}},[e._v("发货地址")]),r("div",{staticClass:"Contain",staticStyle:{"padding-top":"15px"}},[r("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:e.ruleForm,rules:e.rules,"label-width":"120px"}},[r("el-form-item",{attrs:{label:"寄件人姓名",prop:"Name"}},[r("el-input",{staticStyle:{width:"300px"},attrs:{"auto-complete":"on",maxlength:"20",placeholder:"请输入寄件人姓名,最多输入20个字"},model:{value:e.ruleForm.Name,callback:function(r){e.$set(e.ruleForm,"Name",r)},expression:"ruleForm.Name"}})],1),r("el-form-item",{attrs:{label:"寄件人手机号",prop:"Phone"}},[r("el-input",{staticStyle:{width:"300px"},attrs:{"auto-complete":"on",maxlength:"11",placeholder:"请输入寄件人手机号"},model:{value:e.ruleForm.Phone,callback:function(r){e.$set(e.ruleForm,"Phone",r)},expression:"ruleForm.Phone"}})],1),r("el-form-item",{attrs:{prop:"AddressArr",label:"寄件地址",required:""}},[r("el-cascader",{staticStyle:{width:"300px"},attrs:{props:e.props,options:e.dataList,clearable:"",maxlength:"100"},on:{change:e.handleAddressChange},model:{value:e.ruleForm.AddressArr,callback:function(r){e.$set(e.ruleForm,"AddressArr",r)},expression:"ruleForm.AddressArr"}})],1),r("el-form-item",{attrs:{prop:"Address"}},[r("el-input",{staticStyle:{width:"300px"},attrs:{type:"textarea",rows:"3",placeholder:"请填写详细地址"},model:{value:e.ruleForm.Address,callback:function(r){e.$set(e.ruleForm,"Address",r)},expression:"ruleForm.Address"}})],1)],1)],1),r("div",{staticClass:"bottom-save-btn"},[r("el-button",{staticStyle:{width:"240px"},attrs:{type:"primary",loading:e.Savestoreloading},on:{click:e.handleSave}},[e._v("保存")])],1)])},a=[],i=(t("a450"),t("352e"),t("61a9")),n=t("f753"),o=t.n(n),l=(t("26dfe"),t("bfb4")),u={data:function(){return{Savestoreloading:!1,props:{label:"name",value:"id",children:"child"},dataList:[],ruleForm:{Name:"",Phone:"",ProvinceId:"",CityId:"",AreaId:"",Province:"",City:"",Area:"",Address:"",AddressArr:[]},rules:{Name:[{required:!0,message:"请输入寄件人姓名",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],Phone:[{required:!0,message:"请输入寄件人手机号",trigger:"blur"},{min:1,max:11,message:"长度在 1 到 11个数字",trigger:"blur"}],AddressArr:[{required:!0,message:"请选择地址",trigger:"change"}],Address:[{required:!0,message:"请填写详细地址",trigger:"blur"}]}}},created:function(){this.getDataList()},beforeMount:function(){this.getData()},methods:{getData:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,l["a"].expressAssistantIndex();case 2:r=e.sent,this.ruleForm.Address=r.Result.Address,this.ruleForm.AddressArr=[r.Result.Province,r.Result.City,r.Result.Area],this.ruleForm.AreaId=r.Result.Area,this.ruleForm.CityId=r.Result.City,this.ruleForm.Id=r.Result.Id,this.ruleForm.Name=r.Result.Name,this.ruleForm.Phone=r.Result.Phone,this.ruleForm.ProvinceId=r.Result.Province;case 11:case"end":return e.stop()}}),e,this)})));function r(){return e.apply(this,arguments)}return r}(),getDataList:function(){var e=this;o.a.get("https://cdn.dkycn.cn/JSON/gdDistrict-v2.json?v="+(new Date).getTime(),{}).then((function(r){e.dataList=r.data})).catch((function(e){}))},handleSave:function(){var e=this;this.$refs["ruleForm"].validate((function(r){if(!r)return console.log("error submit!!"),!1;e.Savestoreloading=!0,e.saveData()}))},saveData:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var r,t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,r={Name:this.ruleForm.Name,Phone:this.ruleForm.Phone,Province:this.ruleForm.ProvinceId,City:this.ruleForm.CityId,Area:this.ruleForm.AreaId,Address:this.ruleForm.Address,Id:this.ruleForm.Id},e.next=4,l["a"].expressAssistantSave(r);case 4:t=e.sent,t.IsSuccess&&(this.$message({showClose:!0,type:"success",message:"保存成功"}),this.getData()),e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),console.log("e",e.t0);case 11:return e.prev=11,this.Savestoreloading=!1,e.finish(11);case 14:case"end":return e.stop()}}),e,this,[[0,8,11,14]])})));function r(){return e.apply(this,arguments)}return r}(),handleAddressChange:function(){var e=this;this.ruleForm.ProvinceId=this.ruleForm.AddressArr[0],this.ruleForm.CityId=this.ruleForm.AddressArr[1],this.ruleForm.AreaId=this.ruleForm.AddressArr[2],this.dataList.map((function(r){r.id==e.ruleForm.ProvinceId&&(e.ruleForm.Province=r.name,r.child.map((function(r){r.id==e.ruleForm.CityId&&(e.ruleForm.City=r.name,r.child.map((function(r){r.id==e.ruleForm.AreaId&&(e.ruleForm.Area=r.name)})))})))}))}}},d=u,c=(t("1623"),t("829d")),m=Object(c["a"])(d,s,a,!1,null,null,null);r["default"]=m.exports}}]);
//# sourceMappingURL=chunk-c50d75b0.cead5402.js.map