UNPKG

beehole-store-server

Version:

www.bee-hole.com

1 lines 5.55 kB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2fde7ddd","chunk-60523790"],{"4c35":function(t,e,o){"use strict";o.r(e);o("b0c0");var n=function(){var t=this,e=t._self._c;return e("ant-modal",{attrs:{visible:t.open,"modal-title":t.formTitle,"adjust-size":!0,modalWidth:"800",modalHeight:"400"},on:{cancel:t.cancel}},[e("a-form-model",{ref:"form",attrs:{slot:"content",model:t.form,rules:t.rules,layout:"vertical"},slot:"content"},[e("a-row",{staticClass:"form-row",attrs:{gutter:32}},[e("a-col",{attrs:{lg:24,md:12,sm:24}},[e("a-form-model-item",{attrs:{label:t.$t("view.postfee.area_name"),prop:"fare_name"}},[e("a-input",{attrs:{placeholder:t.$t("component.postfee.input.area_name")},model:{value:t.form.fare_name,callback:function(e){t.$set(t.form,"fare_name",e)},expression:"form.fare_name"}})],1)],1),e("a-col",{attrs:{lg:24,md:12,sm:24}},[e("a-form-item",{attrs:{label:t.$t("view.postfee.area"),prop:"region"}},[e("a-checkbox-group",{model:{value:t.form.region,callback:function(e){t.$set(t.form,"region",e)},expression:"form.region"}},t._l(t.CountryList,(function(o){return e("a-checkbox",{key:o.simple_speech,attrs:{value:o.simple_speech}},[t._v(t._s(t.$t(o.name)))])})),1)],1)],1)],1)],1),e("template",{slot:"footer"},[e("a-button",{on:{click:t.cancel}},[t._v(" "+t._s(t.$t("component.postfee.cancle.btn"))+" ")]),e("a-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v(" "+t._s(t.$t("component.postfee.save.btn"))+" ")])],1)],2)},r=[],i=o("5530"),s=o("5a92"),a=Object(i["a"])({},s["default"]),c=a,u=(o("bc84"),o("2877")),f=Object(u["a"])(c,n,r,!1,null,null,null);e["default"]=f.exports},"5a92":function(t,e,o){"use strict";o.r(e);var n=o("5530"),r=o("2dd7"),i=o("f214"),s=o("c7a1"),a=o("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(n["a"])({},Object(a["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 o=t.fare_id;Object(i["a"])(o).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(o){t.$notification["error"]({message:"警告",description:o})}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(o){if(!o)return!1;var n=JSON.parse(JSON.stringify(t.form));if(void 0!==n.fare_id){if(!n.region.length)return e.$message.error("没有选择国家,无法保存",3),!1;n.region=JSON.stringify(n.region),Object(i["e"])(n).then((function(e){t.$message.success("修改成功",3),t.open=!1,t.$emit("ok"),t.$emit("close")}))}else{if(!n.region.length)return e.$message.error("没有选择国家,无法保存",3),!1;n.region=JSON.stringify(n.region),Object(i["e"])(n).then((function(o){e.$message.success("新增成功",3),e.open=!1,e.$emit("ok"),t.$emit("close")}))}}))}}}},bc84:function(t,e,o){"use strict";o("e057")},c7a1:function(t,e,o){"use strict";o.d(e,"a",(function(){return i})),o.d(e,"b",(function(){return s})),o.d(e,"d",(function(){return a})),o.d(e,"e",(function(){return c})),o.d(e,"f",(function(){return u})),o.d(e,"g",(function(){return f})),o.d(e,"c",(function(){return m}));var n=o("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(n["b"])({url:r.configAdd,method:"post",data:t})}function s(t){return Object(n["b"])({url:r.configList,method:"post",params:t})}function a(t){return Object(n["b"])({url:r.huobiGet,method:"get",params:t})}function c(t){return Object(n["b"])({url:r.huobiSet,method:"post",params:t})}function u(t){return Object(n["b"])({url:r.systemGet,method:"post",params:t})}function f(t){return Object(n["b"])({url:r.systemSet,method:"post",data:t})}function m(t){return Object(n["b"])({url:r.copyrightApi,method:"post",data:t})}},e057:function(t,e,o){},f214:function(t,e,o){"use strict";o.d(e,"c",(function(){return r})),o.d(e,"a",(function(){return i})),o.d(e,"e",(function(){return s})),o.d(e,"d",(function(){return a})),o.d(e,"b",(function(){return c}));var n=o("b775");function r(t){return Object(n["b"])({url:"/postfee/list",method:"post",params:t})}function i(t){return Object(n["b"])({url:"/postfee/list",method:"post",params:{fare_id:t}})}function s(t){return Object(n["b"])({url:"/postfee/add",method:"post",params:t})}function a(t){return Object(n["b"])({url:"/postfee/mode-add",method:"post",params:t})}function c(t){return Object(n["b"])({url:"/postfee/mode-list",method:"post",params:t})}}}]);