| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["AddressManagement"],{"0ffe":function(e,t,s){"use strict";var a=s("ff2d"),r=s("bc3a"),i=s.n(r),o=s("f121"),n=s.n(o);class d extends a["a"]{constructor(){super(),i.a.defaults.baseURL=n.a.HostShop}async getShopToken(e={}){let t=await this.postAll("Host80","/shop/custom/info/loginByCId",e);return t}async customBalance(e={}){let t=await this.postAll("HostShop","/custom/balance",e);return t}async customLntegralList(e={}){let t=await this.postAll("HostShop","/custom/integral/search/list",e);return t}async commodityTypeList(e={}){let t=await this.postAll("HostShop","/commodity/type/search/list",e);return t}async commodityList(e={}){let t=await this.postAll("HostShop","/commodity/search/list",e);return t}async commoditySingle(e={}){let t=await this.postAll("HostShop","/commodity/search/single",e);return t}async orderAdd(e={}){let t=await this.postAll("HostShop","/order/add",e);return t}async orderUpdate(e={}){let t=await this.postAll("HostShop","/order/update",e);return t}async orderCancel(e={}){let t=await this.postAll("HostShop","/order/cancel",e);return t}async orderComplete(e={}){let t=await this.postAll("HostShop","/order/complete",e);return t}async orderList(e={}){let t=await this.postAll("HostShop","/order/search/list",e);return t}async orderSingle(e={}){let t=await this.postAll("HostShop","/order/search/single",e);return t}async addressAdd(e={}){let t=await this.postAll("HostShop","/custom/address/add",e);return t}async addressDelete(e={}){let t=await this.postAll("HostShop","/custom/address/delete",e);return t}async addressUpdate(e={}){let t=await this.postAll("HostShop","/custom/address/update",e);return t}async addressList(e={}){let t=await this.postAll("HostShop","/custom/address/search/list",e);return t}}t["a"]=new d},"167a":function(e,t,s){},"56ad":function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.pictLoading,expression:"pictLoading"}],attrs:{id:"AddressManagement","element-loading-background":"rgba(43, 48, 67, 0.65)","element-loading-spinner":"el-icon-loading"}},[t("div",{staticClass:"crm-title-box"},[t("div",{staticClass:"header"},[t("span",{staticClass:"user"},[t("i",{staticClass:"iconfont iconyonghu1"}),t("span",{directives:[{name:"t",rawName:"v-t",value:"Shop.Global.CID",expression:"'Shop.Global.CID'"}]}),e._v(": "+e._s(e.user)+" ")]),t("span",{staticClass:"point"},[t("span",{directives:[{name:"t",rawName:"v-t",value:"Shop.Global.Points",expression:"'Shop.Global.Points'"}]}),e._v(": "+e._s(e._f("NumberFormat1")(e.point)))])])]),t("div",{staticClass:"main-content"},[t("div",{staticClass:"content-box"},[t("div",{staticClass:"title-box"},[t("div",{staticClass:"tit crm-cursor"},[t("span",{directives:[{name:"t",rawName:"v-t",value:"Shop.Address.Title",expression:"'Shop.Address.Title'"}]})]),t("span",{staticClass:"btn crm_state_red crm-cursor",on:{click:function(t){return e.openAddBankCard()}}},[t("i",{staticClass:"el-icon-plus"}),t("span",{directives:[{name:"t",rawName:"v-t",value:"Shop.Address.AddAddress",expression:"'Shop.Address.AddAddress'"}]})])]),t("el-collapse-transition",[t("div",{staticClass:"con-box"},[t("el-row",e._l(e.addressList,(function(s,a){return t("el-col",{key:a,class:{activeAll:e.divActiveAll,activeHelf:e.divActiveHelf},staticStyle:{padding:"5px"},attrs:{span:12}},[t("el-form",{ref:"form"+s.id,refInFor:!0,attrs:{model:s,rules:e.rules}},[t("el-row",[t("el-col",{attrs:{span:24}},[t("div",{staticClass:"crm-title-box tit-box"},[t("div",{staticClass:"tit"},[s.isDefault?t("i",{staticClass:"iconfont iconwujiaoxingxingxingshoucang"}):e._e(),s.isDefault?t("span",{directives:[{name:"t",rawName:"v-t",value:"Shop.Address.Default",expression:"'Shop.Address.Default'"}]}):e._e()]),t("div",{staticClass:"btnTab"},[e.btnType==s.id?t("span",[t("span",{directives:[{name:"t",rawName:"v-t",value:"Btn.Save",expression:"'Btn.Save'"}],staticClass:"btn crm_state_blue crm-cursor",on:{click:function(t){return e.toSave(s)}}}),t("span",{directives:[{name:"t",rawName:"v-t",value:"Btn.Cancel",expression:"'Btn.Cancel'"}],staticClass:"btn crm_state_red crm-cursor",on:{click:function(t){return e.cancelSave()}}})]):t("span",{staticClass:"icon",on:{click:function(t){return e.btnTypeTab(s.id)}}},[t("i",{staticClass:"el-icon-edit-outline crm-cursor"})]),t("span",{staticClass:"icon",staticStyle:{"margin-left":"10px"},on:{click:function(t){return e.toDelete(s.id)}}},[t("i",{staticClass:"el-icon-delete crm-cursor"})])])])]),t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{prop:"name"}},[t("div",{staticClass:"select"},[t("div",{staticClass:"prepend"},[t("span",{directives:[{name:"t",rawName:"v-t",value:"Shop.Address.Consignee",expression:"'Shop.Address.Consignee'"}]})]),t("el-input",{attrs:{disabled:e.btnType!=s.id,placeholder:e.$t("placeholder.input")},model:{value:s.name,callback:function(t){e.$set(s,"name",t)},expression:"item.name"}})],1)])],1),t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{prop:"address"}},[t("div",{staticClass:"select"},[t("div",{staticClass:"prepend"},[t("span",{directives:[{name:"t",rawName:"v-t",value:"Shop.Address.DetailedAddress",expression:"'Shop.Address.DetailedAddress'"}]}),e._v(":")]),t("el-input",{attrs:{disabled:e.btnType!=s.id,placeholder:e.$t("placeholder.input")},model:{value:s.address,callback:function(t){e.$set(s,"address",t)},expression:"item.address"}})],1)])],1),t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{prop:"contact"}},[t("div",{staticClass:"select"},[t("div",{staticClass:"prepend"},[t("span",{directives:[{name:"t",rawName:"v-t",value:"Shop.Address.MobilePhone",expression:"'Shop.Address.MobilePhone'"}]})]),t("el-input",{attrs:{disabled:e.btnType!=s.id,placeholder:e.$t("placeholder.input")},model:{value:s.contact,callback:function(t){e.$set(s,"contact",t)},expression:"item.contact"}})],1)])],1),t("el-col",{attrs:{span:24}},[t("div",{staticClass:"select agree"},[t("el-checkbox",{attrs:{disabled:e.btnType!=s.id},model:{value:s.isDefault,callback:function(t){e.$set(s,"isDefault",t)},expression:"item.isDefault"}}),t("div",{directives:[{name:"t",rawName:"v-t",value:"Shop.Address.SetAsDefault",expression:"'Shop.Address.SetAsDefault'"}],staticStyle:{"margin-left":"10px","font-size":"14px"}})],1)])],1)],1)],1)})),1)],1)]),e.pagerInfo.rowTotal?t("div",{staticClass:"crm_pagination"},[t("el-pagination",{staticClass:"page",attrs:{background:"",layout:"prev, pager, next","page-size":e.pagerInfo.row,total:e.pagerInfo.rowTotal},on:{"current-change":e.handleCurrentChange}})],1):e._e()],1)]),t("shop-address",{attrs:{dialogInfoTradingAdd:e.dialogInfoTradingAdd},on:{closeAdd:e.closeAdd,confirmToReload:e.confirmToReload}}),e.dialogInfoTradingAdd?t("div",{staticClass:"crm_verified_info_mask",on:{click:e.closeDiaAdd}}):e._e()],1)},r=[],i=(s("14d9"),s("e9f5"),s("7d54"),s("eec4")),o=s.n(i),n=s("5987"),d=s("0ffe"),l=s("f121"),c=s.n(l);let{Code:p}=c.a;var m={name:"AddressManagement",components:{ShopAddress:n["a"]},data(){return{pictLoading:!1,user:"--",point:"--",addressList:[],btnType:-1,dialogInfoTradingAdd:!1,divActiveAll:!1,divActiveHelf:!1,divActiveAll1:!1,dialogCheck:!1,pagerInfo:{row:2,current:1,pageTotal:0,rowTotal:0},rules:{name:[{required:!0,message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}],contact:[{required:!0,message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}],address:[{required:!0,message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}]}}},methods:{openAddBankCard(){this.dialogInfoTradingAdd=!0},closeDiaAdd(){this.dialogInfoTradingAdd=!1},closeAdd(e){this.dialogInfoTradingAdd=e},confirmToReload(){this.dialogInfoTradingAdd=!1,this.toSearch()},btnTypeTab(e){this.btnType=e},cancelSave(){this.btnType=-1,this.searchFunc()},toSave(e){let t="form"+e.id;this.$refs[t][0].validate(t=>{if(!t)return!1;this.AddressInfoUpdate(e)})},async searchFunc(){this.pictLoading=!0;let e=await d["a"].addressList({page:{current:this.pagerInfo.current,row:this.pagerInfo.row}});e.code==p.StatusOK?(this.addressList=[],e.data&&e.data.forEach(e=>{e.isDefault=!!e.isDefault,this.addressList.push(e)}),null!=e.page?(this.pagerInfo.rowTotal=e.page.rowTotal,this.pagerInfo.pageTotal=e.page.pageTotal):this.pagerInfo.rowTotal=0,this.$pigeon.MessageOK(this.$i18n.t("Msg.SearchSuccess")),this.pictLoading=!1):(this.$pigeon.MessageError(e.msg),this.pictLoading=!1)},async AddressInfoUpdate(e){e.defaultBank=e.defaultBank?1:0;let t=await d["a"].addressUpdate({...e});t.code==p.StatusOK?(this.searchFunc(),this.btnType=-1,this.$pigeon.MessageOK(this.$i18n.t("Msg.Success"))):this.$pigeon.MessageError(t.msg)},toDelete:async function(e){let t=this;this.$pigeon.MessageConfirm(this.$i18n.t("Msg.Delete"),this.$i18n.t("Msg.SystemPrompt"),this.$i18n.t("Btn.Confirm"),this.$i18n.t("Btn.Cancel"),(async function(){let s=await d["a"].addressDelete({id:e});s.code==p.StatusOK?(t.$pigeon.MessageOK(t.$i18n.t("Msg.DeleteSuccess")),t.toSearch()):t.$pigeon.MessageError(s.msg)}),(function(){}))},toSearch(){this.pagerInfo.current=1,this.searchFunc()},handleSizeChange(e){this.pagerInfo.row=e,this.searchFunc()},handleCurrentChange(e){this.pagerInfo.current=e,this.searchFunc()},async getPoint(){let e=await d["a"].customBalance();e.code==p.StatusOK?this.point=e.data:this.$pigeon.MessageError(e.msg)},divInit(){const e=this,t=o()({strategy:"scroll"});t.listenTo(document.getElementById("AddressManagement"),t=>{e.$nextTick(()=>{let s=t.offsetWidth;s<=1300&&s>1e3?(e.divActiveHelf=!0,e.divActiveAll=!1):s<=1e3?(e.divActiveAll=!0,e.divActiveHelf=!1):1300<s&&(e.divActiveAll=!1,e.divActiveHelf=!1)})})}},mounted(){this.user=JSON.parse(this.Session.Get("user",!0)).customInfo.cId,this.divInit(),this.getPoint(),this.searchFunc()}},u=m,h=(s("c37f"),s("bd60"),s("2877")),f=Object(h["a"])(u,a,r,!1,null,"0558511f",null);t["default"]=f.exports},5987:function(e,t,s){"use strict";var a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"InfoBox",class:{active:e.dialogInfoTradingAdd},attrs:{id:"Drawer"}},[t("div",{staticClass:"header"},[t("div",[t("span",{directives:[{name:"t",rawName:"v-t",value:"Shop.Address.NewMailingAddress",expression:"'Shop.Address.NewMailingAddress'"}],staticClass:"title"})]),t("span",{staticClass:"close crm-cursor",on:{click:e.close}},[t("i",{staticClass:"el-icon-close"})])]),t("el-form",{ref:"form",attrs:{rules:e.rules,model:e.form,"label-position":"top"}},[t("el-form-item",{attrs:{prop:"name",label:e.$t("Shop.Address.Consignee")}},[t("el-input",{attrs:{placeholder:e.$t("placeholder.input")},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{prop:"contact",label:e.$t("Shop.Address.MobilePhone")}},[t("el-input",{attrs:{placeholder:e.$t("placeholder.input")},model:{value:e.form.contact,callback:function(t){e.$set(e.form,"contact",t)},expression:"form.contact"}})],1),t("el-form-item",{attrs:{prop:"country",label:e.$t("Shop.Address.DetailedAddress")+"-"+e.$t("PersonalManagement.Label.CountryRegionOfResidence")+":"}},[t("el-select",{staticClass:"crm_search_down crm_select_icon",attrs:{filterable:"",size:"",placeholder:e.$t("placeholder.choose")},on:{change:e.changeCountry},model:{value:e.form.country,callback:function(t){e.$set(e.form,"country",t)},expression:"form.country"}},e._l(e.countries,(function(e,s){return t("el-option",{key:s,attrs:{label:e.enName,value:e.code}})})),1)],1),"CN"==e.form.country?t("el-form-item",{attrs:{prop:"address2",label:e.$t("Shop.Address.DetailedAddress")+"-"+e.$t("PersonalManagement.Label.ProvinceRegion")+":"}},[t("el-select",{staticClass:"crm_search_down crm_select_icon",attrs:{filterable:"",size:"",placeholder:e.$t("placeholder.choose")},on:{change:e.changeState},model:{value:e.form.address2,callback:function(t){e.$set(e.form,"address2",t)},expression:"form.address2"}},e._l(e.states,(function(s,a){return t("el-option",{key:a,attrs:{label:-1!=["cn","zhHant"].indexOf(e.Session.Get("lang"))?s.name:s.enName,value:-1!=["cn","zhHant"].indexOf(e.Session.Get("lang"))?s.name:s.enName}})})),1)],1):e._e(),"CN"==e.form.country?t("el-form-item",{attrs:{prop:"address3",label:e.$t("Shop.Address.DetailedAddress")+"-"+e.$t("PersonalManagement.Label.City")+":"}},[t("el-select",{staticClass:"crm_search_down crm_select_icon",attrs:{filterable:"",size:"",placeholder:e.$t("placeholder.choose")},model:{value:e.form.address3,callback:function(t){e.$set(e.form,"address3",t)},expression:"form.address3"}},e._l(e.cities,(function(s,a){return t("el-option",{key:a,attrs:{label:-1!=["cn","zhHant"].indexOf(e.Session.Get("lang"))?s.name:s.enName,value:-1!=["cn","zhHant"].indexOf(e.Session.Get("lang"))?s.name:s.enName}})})),1)],1):e._e(),e.form.country&&"CN"!=e.form.country?t("el-form-item",{attrs:{prop:"",label:e.$t("Shop.Address.DetailedAddress")+"-"+e.$t("PersonalManagement.Label.ProvinceRegion")+":"}},[t("el-input",{attrs:{placeholder:e.$t("placeholder.input")},model:{value:e.form.address2,callback:function(t){e.$set(e.form,"address2",t)},expression:"form.address2"}})],1):e._e(),e.form.country&&"CN"!=e.form.country?t("el-form-item",{attrs:{prop:"",label:e.$t("Shop.Address.DetailedAddress")+"-"+e.$t("PersonalManagement.Label.City")+":"}},[t("el-input",{attrs:{placeholder:e.$t("placeholder.input")},model:{value:e.form.address3,callback:function(t){e.$set(e.form,"address3",t)},expression:"form.address3"}})],1):e._e(),"CN"==e.form.country?t("el-form-item",{attrs:{prop:"",label:e.$t("Shop.Address.DetailedAddress")+"-"+e.$t("Shop.Address.item")+":"}},[t("el-input",{attrs:{placeholder:e.$t("placeholder.input")},model:{value:e.form.address4,callback:function(t){e.$set(e.form,"address4",t)},expression:"form.address4"}})],1):e._e(),e.form.country&&"CN"!=e.form.country?t("el-form-item",{attrs:{prop:"",label:e.$t("Shop.Address.DetailedAddress")+"-"+e.$t("Shop.Address.item")+":"}},[t("el-input",{attrs:{placeholder:e.$t("placeholder.input")},model:{value:e.form.address4,callback:function(t){e.$set(e.form,"address4",t)},expression:"form.address4"}})],1):e._e(),t("el-form-item",{attrs:{prop:"address5",label:e.$t("Shop.Address.DetailedAddress")+"-"+e.$t("PersonalManagement.Label.DetailedAddress")+":"}},[t("el-input",{attrs:{placeholder:e.$t("placeholder.input")},model:{value:e.form.address5,callback:function(t){e.$set(e.form,"address5",t)},expression:"form.address5"}})],1),"CN"==e.form.country?t("el-form-item",{attrs:{prop:"",label:e.$t("Shop.Address.DetailedAddress")+"-"+e.$t("Shop.Address.item1")+":"}},[t("el-input",{attrs:{placeholder:e.$t("placeholder.input")},model:{value:e.form.address6,callback:function(t){e.$set(e.form,"address6",t)},expression:"form.address6"}})],1):e._e(),e.form.country&&"CN"!=e.form.country?t("el-form-item",{attrs:{prop:"address6",label:e.$t("Shop.Address.DetailedAddress")+"-"+e.$t("Shop.Address.item1")+":"}},[t("el-input",{attrs:{placeholder:e.$t("placeholder.input")},model:{value:e.form.address6,callback:function(t){e.$set(e.form,"address6",t)},expression:"form.address6"}})],1):e._e(),t("el-form-item",{staticClass:"agree",staticStyle:{"margin-top":"10px"},attrs:{prop:""}},[t("el-checkbox",{model:{value:e.form.isDefault,callback:function(t){e.$set(e.form,"isDefault",t)},expression:"form.isDefault"}}),t("span",{directives:[{name:"t",rawName:"v-t",value:"Shop.Address.SetAsDefault",expression:"'Shop.Address.SetAsDefault'"}],staticStyle:{"margin-left":"10px"}})],1)],1),t("span",{staticClass:"btn crm-cursor",on:{click:e.confirm}},[t("span",{directives:[{name:"t",rawName:"v-t",value:"Btn.Confirm",expression:"'Btn.Confirm'"}]})])],1)},r=[],i=(s("e9f5"),s("7d54"),s("0ffe")),o=s("f121"),n=s.n(o),d=s("1dff");let{Code:l}=n.a;var c={name:"Drawer",props:{dialogInfoTradingAdd:{type:Boolean,default:!1},addType:{default:""},editor:{default:""},formInfo:{default:""},information:{default:""}},data(){return{flag:!1,pictLoading:!1,form:{name:"",contact:"",address:"",isDefault:!1,address1:"",address2:"",address3:"",address4:"",address5:"",address6:"",country:""},countries:[],states:[],cities:[],pagerInfo:{row:10,current:1,pageTotal:0,rowTotal:0},rules:{name:[{required:!0,message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}],contact:[{required:!0,message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}],address:[{required:!0,message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}],country:[{required:!0,message:this.$i18n.t("vaildate.select.empty"),trigger:"change"}],address2:[{required:!0,message:this.$i18n.t("vaildate.input.empty"),trigger:"change"}],address3:[{required:!0,message:this.$i18n.t("vaildate.input.empty"),trigger:"change"}],address4:[{required:!0,message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}],address5:[{required:!0,message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}],address6:[{required:!0,message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}]}}},computed:{AccessToken(){return{"Access-Token":this.Session.Get("access_token")}}},methods:{selectChange(){this.$forceUpdate()},close(){this.$emit("closeAdd",!1)},confirmToReload(){this.$emit("confirmToReload",!0)},confirm(){this.$refs["form"].validate(e=>{if(!e)return!1;this.toConfirm()})},toConfirm(){this.flag||(this.flag=!0,this.AddressManagement())},async AddressManagement(){this.form.defaultBank?this.form.defaultBank=1:this.form.defaultBank=0,this.form.address=this.form.address1+" "+this.form.address2+" "+this.form.address3+" "+this.form.address4+" "+this.form.address5+(this.form.address6?" ("+this.form.address6+")":"");let e=await i["a"].addressAdd({...this.form});e.code==l.StatusOK?(this.confirmToReload(),this.$pigeon.MessageOK(this.$i18n.t("Msg.Success")),this.flag=!1):(this.$pigeon.MessageError(e.msg),this.flag=!1)},async getCountry(){let e=await d["a"].Country({});e.code==l.StatusOK?(this.countries=e.data,this.form.country&&this.countries.forEach(e=>{e.code==this.form.country&&this.getState(e.id)})):this.$pigeon.MessageError(e.msg)},async getState(e){let t=await d["a"].Country({pid:e});t.code==l.StatusOK?(this.states=t.data,this.form.address2&&this.states.forEach(e=>{e.name!=this.form.address2&&e.enName!=this.form.address2||this.getCity(e.id)})):this.$pigeon.MessageError(t.msg)},async getCity(e){let t=await d["a"].Country({pid:e});t.code==l.StatusOK?this.cities=t.data:this.$pigeon.MessageError(t.msg)},changeCountry(e){this.form.address2="",this.form.address3="",this.states=[],this.cities=[];let t={};this.countries.forEach(s=>{s.code!=e||(t=s)}),this.form.address1=-1!=["cn","zhHant"].indexOf(this.Session.Get("lang"))?t.name:t.enName,this.getState(t.id)},changeState(e){this.form.address3="";let t={};this.states.forEach(s=>{s.name!=e&&s.enName!=e||(t=s)}),this.getCity(t.id)}},mounted(){},watch:{dialogInfoTradingAdd:function(e){0==e?this.$refs["form"].resetFields():this.getCountry()},formInfo:function(){this.form=this.formInfo}}},p=c,m=s("2877"),u=Object(m["a"])(p,a,r,!1,null,null,null);t["a"]=u.exports},"940b":function(e,t,s){},bd60:function(e,t,s){"use strict";s("940b")},c37f:function(e,t,s){"use strict";s("167a")}}]);
|