1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8dd06c3c"],{"09eb":function(t,e,a){"use strict";var r=a("314d"),n=a.n(r);n.a},"314d":function(t,e,a){},"622c":function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("Card",{staticClass:"ivu-mt pt10",attrs:{bordered:!1,"dis-hover":""}},[[a("Form",{ref:"formValidate",attrs:{model:t.formValidate,rules:t.ruleValidate,"label-width":120}},[a("FormItem",{attrs:{label:"供应商名称:",prop:"supplier_name"}},[a("Input",{staticClass:"input",attrs:{placeholder:"请输入供应商名称"},model:{value:t.formValidate.supplier_name,callback:function(e){t.$set(t.formValidate,"supplier_name",e)},expression:"formValidate.supplier_name "}})],1),a("FormItem",{attrs:{label:"联系人姓名:",prop:"name"}},[a("Input",{staticClass:"input",attrs:{placeholder:"请输入联系人姓名"},model:{value:t.formValidate.name,callback:function(e){t.$set(t.formValidate,"name",e)},expression:"formValidate.name"}})],1),a("FormItem",{attrs:{label:"联系电话:",prop:"phone"}},[a("Input",{staticClass:"input",attrs:{type:"text",maxlength:"11",placeholder:"请输入联系电话"},model:{value:t.formValidate.phone,callback:function(e){t.$set(t.formValidate,"phone",e)},expression:"formValidate.phone"}})],1),a("FormItem",{attrs:{label:"供应商邮箱",prop:"email"}},[a("Input",{staticClass:"input",attrs:{placeholder:"请输入供应商邮箱"},model:{value:t.formValidate.email,callback:function(e){t.$set(t.formValidate,"email",e)},expression:"formValidate.email"}})],1),a("FormItem",{attrs:{label:"供应商地址:","label-for":"address",prop:"address"}},[a("Cascader",{staticClass:"input",attrs:{data:t.addresData,"load-data":t.loadData},on:{"on-change":t.addchack},model:{value:t.formValidate.addressSelect,callback:function(e){t.$set(t.formValidate,"addressSelect",e)},expression:"formValidate.addressSelect"}})],1),a("FormItem",{attrs:{label:"供应商详细地址:",prop:"detailed_address"}},[a("Input",{staticClass:"input",attrs:{placeholder:"请输入供应商详细地址"},model:{value:t.formValidate.detailed_address,callback:function(e){t.$set(t.formValidate,"detailed_address",e)},expression:"formValidate.detailed_address"}})],1)],1)]],2),a("Card",{staticClass:"fixed-card",attrs:{bordered:!1,"dis-hover":""}},[a("Form",[a("FormItem",[a("Button",{attrs:{type:"primary"},on:{click:function(e){return t.handleSubmit("formValidate")}}},[t._v("保存")])],1)],1)],1)],1)},n=[],i=a("90e7"),o=a("2f62");function s(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function d(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?s(a,!0).forEach((function(e){c(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):s(a).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function c(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var l={name:"index",components:{},data:function(){var t=this,e=function(e,a,r){""===a?r(new Error("请输入联系电话")):""!==t.value&&(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(a)?r():r(new Error("请输入正确的联系电话")))};return{formValidate:{supplier_name:"",name:"",email:"",phone:"",detailed_address:"",province:0,city:0,area:0,street:0,addressSelect:[],address:""},addresData:[],ruleValidate:{supplier_name:[{required:!0,message:"请输入供应商名称",trigger:"blur"}],phone:[{required:!0,message:"请输入联系电话",trigger:"blur"},{validator:e,trigger:"blur"}]}}},created:function(){this.getInfo();var t={pid:0};this.cityInfo(t)},mounted:function(){this.setCopyrightShow({value:!1})},destroyed:function(){this.setCopyrightShow({value:!0})},methods:d({},Object(o["d"])("store/layout",["setCopyrightShow"]),{loadData:function(t,e){t.loading=!0,Object(i["d"])({pid:t.value}).then((function(a){t.children=a.data,t.loading=!1,e()}))},addchack:function(t,e){var a=this;t.forEach((function(t,e){0==e?a.formValidate.province=t:1==e?a.formValidate.city=t:2==e?a.formValidate.area=t:a.formValidate.street=t})),this.formValidate.address=e.map((function(t){return t.label})).join("/")},cityInfo:function(t){var e=this;Object(i["d"])(t).then((function(t){e.addresData=t.data}))},getInfo:function(){var t=this;Object(i["j"])().then((function(e){t.formValidate=e.data;var a=[];e.data.province&&a.push(e.data.province),e.data.city&&a.push(e.data.city),e.data.area&&a.push(e.data.area),e.data.street&&a.push(e.data.street),t.formValidate.addressSelect=a})).catch((function(e){t.$Message.error(e.msg)}))},handleSubmit:function(t){var e=this;if(""!==this.formValidate.email&&!/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/i.test(this.formValidate.email))return this.$Message.error("请输入正确的供应商邮箱");this.$refs[t].validate((function(t){t&&Object(i["g"])(e.formValidate).then((function(t){e.$Message.success(t.msg)})).catch((function(t){e.$Message.error(t.msg)}))}))}})},u=l,f=(a("09eb"),a("2877")),m=Object(f["a"])(u,r,n,!1,null,"27cefde4",null);e["default"]=m.exports},"90e7":function(t,e,a){"use strict";a.d(e,"j",(function(){return n})),a.d(e,"g",(function(){return i})),a.d(e,"d",(function(){return o})),a.d(e,"c",(function(){return s})),a.d(e,"b",(function(){return d})),a.d(e,"a",(function(){return c})),a.d(e,"h",(function(){return l})),a.d(e,"l",(function(){return u})),a.d(e,"m",(function(){return f})),a.d(e,"i",(function(){return m})),a.d(e,"e",(function(){return p})),a.d(e,"k",(function(){return h})),a.d(e,"f",(function(){return b}));var r=a("b6bd");function n(){return Object(r["a"])({url:"/supplier",method:"get"})}function i(t){return Object(r["a"])({url:"/supplier",method:"put",data:t})}function o(t){return Object(r["a"])({url:"city",method:"get",params:t})}function s(t){return Object(r["a"])({url:"admin",method:"get",params:t})}function d(){return Object(r["a"])({url:"admin/create",method:"get"})}function c(t){return Object(r["a"])({url:"admin/".concat(t,"/edit"),method:"get"})}function l(t){return Object(r["a"])({url:"admin/set_status/".concat(t.id,"/").concat(t.status),method:"put"})}function u(t){return Object(r["a"])({url:"setting/shipping_templates/list",method:"get",params:t})}function f(t,e){return Object(r["a"])({url:"setting/shipping_templates/save/".concat(t),method:"post",data:e})}function m(t){return Object(r["a"])({url:"setting/shipping_templates/".concat(t,"/edit"),method:"get"})}function p(t){return Object(r["a"])({url:"city",method:"get",params:t})}function h(t,e){return Object(r["a"])({url:"/system/form/info/".concat(t),method:"get",params:e})}function b(t){return Object(r["a"])({url:"system/config/edit_new_build/"+t,method:"get"})}}}]);
|