beehole-store-server
Version:
www.bee-hole.com
1 lines • 3.93 kB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-60523790"],{"5a92":function(t,e,n){"use strict";n.r(e);var o=n("5530"),r=n("2dd7"),i=n("f214"),s=n("c7a1"),c=n("5880");e["default"]={name:"CreateForm",props:{shop_id:0},components:{AntModal:r["a"]},data:function(){return{open:!1,attachmentRefName:"addUploaderFile",editAttachmentRefName:"editUploaderFile",formId:"",labelCol:{span:4},wrapperCol:{span:14},loading:!1,total:0,id:void 0,formTitle:"",contentEditorEdit:"",form:{fare_id:void 0,fare_name:"",region:[]},rules:{},CountryList:[]}},filters:{},created:function(){},computed:Object(o["a"])({},Object(c["mapGetters"])(["shopId"])),watch:{},mounted:function(){},methods:{cancel:function(){this.open=!1,this.reset(),this.$emit("close")},reset:function(){this.form={fare_id:void 0,fare_name:"",region:[]},this.form1={}},handleAdd:function(){this.reset(),this.open=!0,this.formTitle=this.$t("view.postfee.add.area"),this.getCountryList()},handleUpdate:function(t){var e=this;this.reset(),this.getCountryList();var n=t.fare_id;Object(i["a"])(n).then((function(t){e.open=!0,e.form=t.list[0],e.form.region=JSON.parse(e.form.region),e.formTitle=e.$t("view.postfee.update.area")}))},getCountryList:function(){var t=this;Object(s["b"])({shop_id:this.shopId,name:"PsCountry"}).then((function(e){if(e.list&&e.list[0].config)try{t.CountryList=JSON.parse(e.list[0].config)}catch(n){t.$notification["error"]({message:"警告",description:n})}else t.$notification["error"]({message:"警告",description:"请去配置可发货国家"})}))},submitForm:function(){var t=this,e=this;e.shop_id&&(this.form.shop_id=e.shopId),this.$refs.form.validate((function(n){if(!n)return!1;var o=JSON.parse(JSON.stringify(t.form));if(void 0!==o.fare_id){if(!o.region.length)return e.$message.error("没有选择国家,无法保存",3),!1;o.region=JSON.stringify(o.region),Object(i["e"])(o).then((function(e){t.$message.success("修改成功",3),t.open=!1,t.$emit("ok"),t.$emit("close")}))}else{if(!o.region.length)return e.$message.error("没有选择国家,无法保存",3),!1;o.region=JSON.stringify(o.region),Object(i["e"])(o).then((function(n){e.$message.success("新增成功",3),e.open=!1,e.$emit("ok"),t.$emit("close")}))}}))}}}},c7a1:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return c})),n.d(e,"e",(function(){return u})),n.d(e,"f",(function(){return a})),n.d(e,"g",(function(){return f})),n.d(e,"c",(function(){return d}));var o=n("b775"),r={configAdd:"/mallconfig/save",configList:"/mallconfig/list",huobiGet:"/pmethod/currency/get",huobiSet:"/pmethod/currencyrates/set",systemGet:"/config/sys/get",systemSet:"/config/sys/set",copyrightApi:"/config/copyright"};function i(t){return Object(o["b"])({url:r.configAdd,method:"post",data:t})}function s(t){return Object(o["b"])({url:r.configList,method:"post",params:t})}function c(t){return Object(o["b"])({url:r.huobiGet,method:"get",params:t})}function u(t){return Object(o["b"])({url:r.huobiSet,method:"post",params:t})}function a(t){return Object(o["b"])({url:r.systemGet,method:"post",params:t})}function f(t){return Object(o["b"])({url:r.systemSet,method:"post",data:t})}function d(t){return Object(o["b"])({url:r.copyrightApi,method:"post",data:t})}},f214:function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"e",(function(){return s})),n.d(e,"d",(function(){return c})),n.d(e,"b",(function(){return u}));var o=n("b775");function r(t){return Object(o["b"])({url:"/postfee/list",method:"post",params:t})}function i(t){return Object(o["b"])({url:"/postfee/list",method:"post",params:{fare_id:t}})}function s(t){return Object(o["b"])({url:"/postfee/add",method:"post",params:t})}function c(t){return Object(o["b"])({url:"/postfee/mode-add",method:"post",params:t})}function u(t){return Object(o["b"])({url:"/postfee/mode-list",method:"post",params:t})}}}]);