ERP/static/js/chunk-ad8d.e3274a9c.js
2019-03-11 19:01:31 +08:00

1 line
No EOL
19 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-ad8d"],{afU4:function(e,t,r){"use strict";var a=r("bAeg");r.n(a).a},bAeg:function(e,t,r){},rB3V:function(e,t,r){"use strict";r.r(t);var a=r("6HaC"),l=r("/PQ/"),o={name:"NewSupplier",components:{MyEmp:r("EAXk").a},data:function(){return{groupIds:[],paymentIds:[],levelIds:[],transportIds:[],giveIds:[],typeIds:[],empcontrol:!1,nations:[],provinces:[],cities:[],regions:[],props:{value:"id",label:"regionName",children:"regionListVos"},buyerId:"",perregions:[],personalForm:{createId:this.$store.getters.userId,supplierName:"",typeId:"",supplierShortName:"",supplierIntroduction:"",countryId:"",provinceId:"",cityId:"",detailAddress:"",groupId:"",zipCode:"",contactPersonName:"",contactPersonPhone:"",regionId:"",giveId:"",transportId:"",levelId:"",isHot:"",isEffective:"",buyerId:"",businessScopeIntroduction:"",paymentId:"",moneyId:"",bankName:"",accountName:"",account:"",establishDate:"",legalPerson:"",taxNumber:"",businessLicense:"",companyTypeId:""},personalrules:{supplierName:[{required:!0,message:"请输入供应商名称",trigger:"blur"}],typeId:[{required:!0,message:"请选择供应商类别",trigger:"change"}],groupId:[{required:!0,message:"请选择供应商分组",trigger:"change"}],isHot:[{required:!0,message:"请选择",trigger:"change"}],countryId:[{required:!0,message:"请选择国家",trigger:"change"}]}}},created:function(){this.getnationlist()},methods:{getnationlist:function(){var e=this;Object(a.b)().then(function(t){200===t.data.ret?e.nations=t.data.data.content:e.$notify.error({title:"错误",message:"出错了",offset:100})}),Object(a.d)().then(function(t){200===t.data.ret?e.regions=e.tranKTree(t.data.data.content):e.$notify.error({title:"错误",message:"出错了",offset:100})}),Object(l.i)(1).then(function(t){200===t.data.ret?e.typeIds=t.data.data.content.list:e.$notify.error({title:"错误",message:"出错了",offset:100})}),Object(l.i)(2).then(function(t){200===t.data.ret?e.giveIds=t.data.data.content.list:e.$notify.error({title:"错误",message:"出错了",offset:100})}),Object(l.i)(3).then(function(t){200===t.data.ret?e.transportIds=t.data.data.content.list:e.$notify.error({title:"错误",message:"出错了",offset:100})}),Object(l.i)(4).then(function(t){200===t.data.ret?e.levelIds=t.data.data.content.list:e.$notify.error({title:"错误",message:"出错了",offset:100})}),Object(l.i)(5).then(function(t){200===t.data.ret?e.paymentIds=t.data.data.content.list:e.$notify.error({title:"错误",message:"出错了",offset:100})}),Object(l.k)().then(function(t){200===t.data.ret?e.groupIds=t.data.data.content:e.$notify.error({title:"错误",message:"出错了",offset:100})})},handlechange:function(e){var t=this;Object(a.c)(e).then(function(e){200===e.data.ret?t.provinces=e.data.data.content:t.$notify.error({title:"错误",message:"出错了",offset:100})})},handlechange2:function(e){var t=this;Object(a.a)(e).then(function(e){console.log(e),200===e.data.ret?t.cities=e.data.data.content:t.$notify.error({title:"错误",message:"出错了",offset:100})})},tranKTree:function(e){var t=this;if(e&&e.length)return e.map(function(e){return{id:e.id,regionName:e.regionName,regionListVos:t.tranKTree(e.regionListVos)}})},handlesave:function(){var e=this;this.personalForm.regionId=this.perregions[this.perregions.length-1],this.$refs.personalForm.validate(function(t){if(!t)return e.$notify.error({title:"错误",message:"信息未填完整",offset:100}),!1;Object(l.b)(e.personalForm).then(function(t){console.log(t),200===t.data.ret?(e.$notify({title:"成功",message:"保存成功",type:"success",offset:100}),e.restAllForm(),e.$refs.personalForm.clearValidate(),e.$refs.personalForm.resetFields(),e.$refs.personalForm2.clearValidate(),e.$refs.personalForm2.resetFields(),e.$refs.personalForm3.clearValidate(),e.$refs.personalForm3.resetFields(),e.$refs.personalForm4.clearValidate(),e.$refs.personalForm4.resetFields()):e.$notify.error({title:"错误",message:t.data.msg,offset:100})})})},restAllForm:function(){this.personalForm={supplierName:"",typeId:"",supplierShortName:"",supplierIntroduction:"",countryId:"",provinceId:"",cityId:"",detailAddress:"",groupId:"",zipCode:"",contactPersonName:"",contactPersonPhone:"",regionId:"",giveId:"",transportId:"",levelId:"",isHot:"",isEffective:"",buyerId:"",businessScopeIntroduction:"",paymentId:"",moneyId:"",bankName:"",accountName:"",account:"",establishDate:"",legalPerson:"",taxNumber:"",businessLicense:"",companyTypeId:""},this.perregions=[],this.buyerId=""},handleentry:function(){var e=this;this.personalForm.regionId=this.perregions[this.perregions.length-1],this.$refs.personalForm.validate(function(t){if(!t){e.$notify.error({title:"错误",message:"信息未填完整",offset:100});var r=e.$refs.geren.offsetTop;return console.log(r),document.documentElement.scrollTop=r-100,!1}Object(l.b)(e.personalForm).then(function(t){if(console.log(t),200===t.data.ret){e.$notify({title:"成功",message:"保存成功",type:"success",offset:100}),e.restAllForm(),e.$refs.personalForm.clearValidate(),e.$refs.personalForm.resetFields(),e.$refs.personalForm2.clearValidate(),e.$refs.personalForm2.resetFields(),e.$refs.personalForm3.clearValidate(),e.$refs.personalForm3.resetFields(),e.$refs.personalForm4.clearValidate(),e.$refs.personalForm4.resetFields();var r=e.$refs.geren.offsetTop;console.log(r),document.documentElement.scrollTop=r-100}else e.$notify.error({title:"错误",message:t.data.msg,offset:100})})})},handlecancel:function(){this.$router.go(-1);this.$store.dispatch("delView",{path:"/Supplier/NewSupplier",name:"NewSupplier",fullPath:"/Supplier/NewSupplier",title:"NewSupplier"}).then(function(e){e.visitedViews})},handlechoose:function(){this.empcontrol=!0},personName:function(e){console.log(e),this.buyerId=e.personName,this.personalForm.buyerId=e.id}}},s=(r("afU4"),r("KHd+")),n=Object(s.a)(o,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"ERP-container"},[r("div",{staticClass:"app-container"},[r("h2",{ref:"geren",staticClass:"form-name"},[e._v("基本信息")]),e._v(" "),r("div",{staticClass:"container"},[r("el-form",{ref:"personalForm",staticClass:"demo-ruleForm",staticStyle:{"margin-left":"30px"},attrs:{model:e.personalForm,rules:e.personalrules,inline:!0,"status-icon":"","label-position":"top","label-width":"300px"}},[r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.supplierName"),prop:"supplierName"}},[r("el-input",{attrs:{placeholder:"请输入供应商名称",clearable:""},model:{value:e.personalForm.supplierName,callback:function(t){e.$set(e.personalForm,"supplierName",t)},expression:"personalForm.supplierName"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.typeId"),prop:"typeId"}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择供应商类别"},model:{value:e.personalForm.typeId,callback:function(t){e.$set(e.personalForm,"typeId",t)},expression:"personalForm.typeId"}},e._l(e.typeIds,function(e,t){return r("el-option",{key:t,attrs:{label:e.categoryName,value:e.id}})}))],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.supplierShortName"),prop:"supplierShortName"}},[r("el-input",{attrs:{placeholder:"请输入供应商简称",clearable:""},model:{value:e.personalForm.supplierShortName,callback:function(t){e.$set(e.personalForm,"supplierShortName",t)},expression:"personalForm.supplierShortName"}})],1),r("br"),e._v(" "),r("el-form-item",{staticStyle:{width:"80%","margin-top":"1%"},attrs:{label:e.$t("Supplier.supplierIntroduction")}},[r("el-input",{attrs:{type:"textarea",clearable:""},model:{value:e.personalForm.supplierIntroduction,callback:function(t){e.$set(e.personalForm,"supplierIntroduction",t)},expression:"personalForm.supplierIntroduction"}})],1)],1)],1),e._v(" "),r("h2",{ref:"lianxi",staticClass:"form-name"},[e._v("业务信息")]),e._v(" "),r("div",{staticClass:"container"},[r("el-form",{ref:"personalForm2",staticClass:"demo-ruleForm",staticStyle:{"margin-left":"30px"},attrs:{model:e.personalForm,rules:e.personalrules,inline:!0,"status-icon":"","label-position":"top","label-width":"300px"}},[r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("public.countyrId"),prop:"countryId"}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"国家"},on:{change:e.handlechange},model:{value:e.personalForm.countryId,callback:function(t){e.$set(e.personalForm,"countryId",t)},expression:"personalForm.countryId"}},e._l(e.nations,function(e,t){return r("el-option",{key:t,attrs:{label:e.name,value:e.id}})}))],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("public.provinceId")}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择省"},on:{change:e.handlechange2},model:{value:e.personalForm.provinceId,callback:function(t){e.$set(e.personalForm,"provinceId",t)},expression:"personalForm.provinceId"}},e._l(e.provinces,function(e,t){return r("el-option",{key:t,attrs:{label:e.name,value:e.id}})}))],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("public.cityId")}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择市"},model:{value:e.personalForm.cityId,callback:function(t){e.$set(e.personalForm,"cityId",t)},expression:"personalForm.cityId"}},e._l(e.cities,function(e,t){return r("el-option",{key:t,attrs:{label:e.name,value:e.id}})}))],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("public.address")}},[r("el-input",{attrs:{placeholder:"请输入地址",clearable:""},model:{value:e.personalForm.detailAddress,callback:function(t){e.$set(e.personalForm,"detailAddress",t)},expression:"personalForm.detailAddress"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.groupId")}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择供应商分组"},model:{value:e.personalForm.groupId,callback:function(t){e.$set(e.personalForm,"groupId",t)},expression:"personalForm.groupId"}},e._l(e.groupIds,function(e,t){return r("el-option",{key:t,attrs:{label:e.groupName,value:e.id}})}))],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.zipCode")}},[r("el-input",{attrs:{placeholder:"请输入邮编",clearable:""},model:{value:e.personalForm.zipCode,callback:function(t){e.$set(e.personalForm,"zipCode",t)},expression:"personalForm.zipCode"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.contactPersonName")}},[r("el-input",{attrs:{placeholder:"请输入联系人",clearable:""},model:{value:e.personalForm.contactPersonName,callback:function(t){e.$set(e.personalForm,"contactPersonName",t)},expression:"personalForm.contactPersonName"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.contactPersonPhone")}},[r("el-input",{attrs:{placeholder:"请输入电话",clearable:""},model:{value:e.personalForm.contactPersonPhone,callback:function(t){e.$set(e.personalForm,"contactPersonPhone",t)},expression:"personalForm.contactPersonPhone"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.regionId"),prop:"regionid"}},[r("el-cascader",{staticStyle:{width:"100%"},attrs:{options:e.regions,props:e.props,"show-all-levels":!1,placeholder:"请选择区域","change-on-select":"",filterable:"",clearable:""},model:{value:e.perregions,callback:function(t){e.perregions=t},expression:"perregions"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.giveId")}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择交货方式"},model:{value:e.personalForm.giveId,callback:function(t){e.$set(e.personalForm,"giveId",t)},expression:"personalForm.giveId"}},e._l(e.giveIds,function(e,t){return r("el-option",{key:t,attrs:{label:e.categoryName,value:e.id}})}))],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.transportId")}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择运送方式"},model:{value:e.personalForm.transportId,callback:function(t){e.$set(e.personalForm,"transportId",t)},expression:"personalForm.transportId"}},e._l(e.transportIds,function(e,t){return r("el-option",{key:t,attrs:{label:e.categoryName,value:e.id}})}))],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.levelId")}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择供应商优质级别"},model:{value:e.personalForm.levelId,callback:function(t){e.$set(e.personalForm,"levelId",t)},expression:"personalForm.levelId"}},e._l(e.levelIds,function(e,t){return r("el-option",{key:t,attrs:{label:e.categoryName,value:e.id}})}))],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.isHot"),prop:"isHot"}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择"},model:{value:e.personalForm.isHot,callback:function(t){e.$set(e.personalForm,"isHot",t)},expression:"personalForm.isHot"}},[r("el-option",{attrs:{label:"是",value:"1"}}),e._v(" "),r("el-option",{attrs:{label:"否",value:"2"}})],1)],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.isEffective")}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择启用状态"},model:{value:e.personalForm.isEffective,callback:function(t){e.$set(e.personalForm,"isEffective",t)},expression:"personalForm.isEffective"}},[r("el-option",{attrs:{label:"启用",value:"1"}}),e._v(" "),r("el-option",{attrs:{label:"未启用",value:"2"}})],1)],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.buyerId")}},[r("el-input",{attrs:{placeholder:"请输入采购员"},on:{focus:e.handlechoose},model:{value:e.buyerId,callback:function(t){e.buyerId=t},expression:"buyerId"}})],1),e._v(" "),r("br"),e._v(" "),r("my-emp",{attrs:{control:e.empcontrol},on:{"update:control":function(t){e.empcontrol=t},personName:e.personName}}),e._v(" "),r("el-form-item",{staticStyle:{width:"80%","margin-top":"1%"},attrs:{label:e.$t("Supplier.businessScopeIntroduction")}},[r("el-input",{attrs:{type:"textarea",clearable:""},model:{value:e.personalForm.businessScopeIntroduction,callback:function(t){e.$set(e.personalForm,"businessScopeIntroduction",t)},expression:"personalForm.businessScopeIntroduction"}})],1)],1)],1),e._v(" "),r("h2",{staticClass:"form-name"},[e._v("财务信息")]),e._v(" "),r("div",{staticClass:"container"},[r("el-form",{ref:"personalForm3",staticClass:"demo-ruleForm",staticStyle:{"margin-left":"30px"},attrs:{model:e.personalForm,rules:e.personalrules,inline:!0,"status-icon":"","label-position":"top","label-width":"300px"}},[r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.paymentId")}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择结算方式"},model:{value:e.personalForm.paymentId,callback:function(t){e.$set(e.personalForm,"paymentId",t)},expression:"personalForm.paymentId"}},e._l(e.paymentIds,function(e,t){return r("el-option",{key:t,attrs:{label:e.categoryName,value:e.id}})}))],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.moneyId")}},[r("el-select",{staticStyle:{width:"100%"},attrs:{value:e.personalForm.moneyId,placeholder:"请选择币种"},model:{value:e.personalForm.moneyId,callback:function(t){e.$set(e.personalForm,"moneyId",t)},expression:"personalForm.moneyId"}},[r("el-option",{attrs:{label:"RMB",value:"1"}}),e._v(" "),r("el-option",{attrs:{label:"USD",value:"2"}})],1)],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.bankName")}},[r("el-input",{attrs:{placeholder:"请输入开户行",clearable:""},model:{value:e.personalForm.bankName,callback:function(t){e.$set(e.personalForm,"bankName",t)},expression:"personalForm.bankName"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.accountName")}},[r("el-input",{attrs:{placeholder:"请输入户名",clearable:""},model:{value:e.personalForm.accountName,callback:function(t){e.$set(e.personalForm,"accountName",t)},expression:"personalForm.accountName"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.account")}},[r("el-input",{attrs:{placeholder:"请输入账号",clearable:""},model:{value:e.personalForm.account,callback:function(t){e.$set(e.personalForm,"account",t)},expression:"personalForm.account"}})],1)],1)],1),e._v(" "),r("h2",{ref:"fuzhu",staticClass:"form-name"},[e._v("辅助信息")]),e._v(" "),r("div",{staticClass:"container"},[r("el-form",{ref:"personalForm4",staticClass:"demo-ruleForm",staticStyle:{"margin-left":"30px"},attrs:{model:e.personalForm,rules:e.personalrules,inline:!0,"status-icon":"","label-position":"top","label-width":"300px"}},[r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.establishDate")}},[r("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"选择成立时间","value-format":"yyyy-MM-dd",clearable:""},model:{value:e.personalForm.establishDate,callback:function(t){e.$set(e.personalForm,"establishDate",t)},expression:"personalForm.establishDate"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.legalPerson")}},[r("el-input",{attrs:{placeholder:"请输入法人代表",clearable:""},model:{value:e.personalForm.legalPerson,callback:function(t){e.$set(e.personalForm,"legalPerson",t)},expression:"personalForm.legalPerson"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.taxNumber")}},[r("el-input",{attrs:{placeholder:"请输入税务登记号",clearable:""},model:{value:e.personalForm.taxNumber,callback:function(t){e.$set(e.personalForm,"taxNumber",t)},expression:"personalForm.taxNumber"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.businessLicense")}},[r("el-input",{attrs:{placeholder:"请输入营业执照号",clearable:""},model:{value:e.personalForm.businessLicense,callback:function(t){e.$set(e.personalForm,"businessLicense",t)},expression:"personalForm.businessLicense"}})],1),e._v(" "),r("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Supplier.companyTypeId")}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择单位性质"},model:{value:e.personalForm.companyTypeId,callback:function(t){e.$set(e.personalForm,"companyTypeId",t)},expression:"personalForm.companyTypeId"}},[r("el-option",{attrs:{label:"类型1",value:"1"}}),e._v(" "),r("el-option",{attrs:{label:"类型2",value:"2"}})],1)],1)],1)],1),e._v(" "),r("div",{staticClass:"buttons",staticStyle:{"margin-top":"20px"}},[r("el-button",{attrs:{type:"primary"},on:{click:function(t){e.handlesave()}}},[e._v("保存")]),e._v(" "),r("el-button",{attrs:{type:"success"},on:{click:function(t){e.handleentry()}}},[e._v("继续录入")]),e._v(" "),r("el-button",{attrs:{type:"danger"},on:{click:function(t){e.handlecancel()}}},[e._v("取消")])],1)])])},[],!1,null,"7d89ecb9",null);n.options.__file="NewSupplier.vue";t.default=n.exports}}]);