ERP/static/js/chunk-775d.17b9521e.js
beyond e4cd916a0c beyond 8.1 version2
beyond 8.1 version2
2019-08-01 19:52:12 +08:00

1 line
18 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-775d"],{FXfK:function(e,t,l){"use strict";l.r(t);var a=l("VG0r"),r={name:"NewProduct",components:{MyEmp:l("777i").a},data:function(){return{empcontrol:!1,picidsVisible:!1,picidsImageUrl:"",picidsData:{type:2},detailpicVisible:!1,detailpicImageUrl:"",detailpicData:{type:7},categorys:[],types:[],levels:[],supplierid:"",personalForm:{code:"",barcode:"",productname:"",typeid:"",categoryid:"",color:"",brand:"",kpigrade:"",point:"",zhibaoqi:"",weight:"",volume:"",costprice:"",tradeprice:"",saleprice:"",purchaseprice:"",lowerprice:"",createid:"",level:"",purchasemeasurement:"",salemeasurement:"",stockmeasurement:"",producemeasurement:"",source:"",valuation:"",isactive:"",picids:[],detailpicid:[],memberprice:""},personalrules:{code:[{required:!0,message:"请输入物料编码",trigger:"blur"}],productname:[{required:!0,message:"请输入产品名称",trigger:"blur"}],valuation:[{required:!0,message:"请选择计价方式",trigger:"change"}],costprice:[{required:!0,message:"请输入成本价",trigger:"blur"}],saleprice:[{required:!0,message:"请输入零售价",trigger:"blur"}],purchaseprice:[{required:!0,message:"请输入采购价",trigger:"blur"}]}}},created:function(){this.getcategorys()},methods:{getcategorys:function(){var e=this;Object(a.l)(1).then(function(t){console.log(t),200===t.data.ret?e.categorys=t.data.data.content.list:e.$notify.error({title:"错误",message:"出错了",offset:100})}),Object(a.l)(2).then(function(t){200===t.data.ret?e.types=t.data.data.content.list:e.$notify.error({title:"错误",message:"出错了",offset:100})}),Object(a.l)(3).then(function(t){200===t.data.ret?e.levels=t.data.data.content.list:e.$notify.error({title:"错误",message:"出错了",offset:100})})},submitUpload:function(){this.$refs.upload.submit()},handlepicRemove:function(e,t){console.log(e,t)},handlepicPreview:function(e){this.picidsImageUrl=e.url,this.picidsVisible=!0},handlepicsuccess:function(e){this.personalForm.picids.push(e.data.content.picId),console.log(e.data.content.picId)},detailpicsubmitUpload:function(){this.$refs.detailpicupload.submit()},handledetailpicRemove:function(e,t){console.log(e,t)},handledetailpicPreview:function(e){this.picidsImageUrl=e.url,this.picidsVisible=!0},handledetailpicsuccess:function(e){this.personalForm.detailpicid.push(e.data.content.picId),console.log(e.data.content.picId)},handlesave:function(){var e=this;this.$refs.personalForm.validate(function(t){if(!t)return e.$notify.error({title:"错误",message:"信息未填完整",offset:100}),!1;e.$refs.personalForm2.validate(function(t){if(!t)return e.$notify.error({title:"错误",message:"信息未填完整",offset:100}),!1;Object(a.d)(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.detailpicupload.clearFiles(),e.$refs.upload.clearFiles()):e.$notify.error({title:"错误",message:t.data.msg,offset:100})})})})},restAllForm:function(){this.personalForm={code:"",barcode:"",productname:"",typeid:"",categoryid:"",color:"",brand:"",kpigrade:"",point:"",zhibaoqi:"",weight:"",volume:"",costprice:"",tradeprice:"",saleprice:"",purchaseprice:"",lowerprice:"",supplierid:"",createid:"",level:"",purchasemeasurement:"",salemeasurement:"",stockmeasurement:"",producemeasurement:"",source:"",valuation:"",isactive:"",picids:[],detailpicid:[],memberprice:""},this.supplierid=""},handleentry:function(){var e=this;this.$refs.personalForm.validate(function(t){if(!t){e.$notify.error({title:"错误",message:"信息未填完整",offset:100});var l=e.$refs.lianxi.offsetTop;return console.log(l),document.documentElement.scrollTop=l-100,!1}e.$refs.personalForm2.validate(function(t){if(!t){e.$notify.error({title:"错误",message:"信息未填完整",offset:100});var l=e.$refs.lianxi.offsetTop;return console.log(l),document.documentElement.scrollTop=l-100,!1}Object(a.d)(e.personalForm).then(function(t){if(console.log(t),200===t.data.ret){e.$notify({title:"成功",message:"保存成功",type:"success",offset:100});var l=e.$refs.geren.offsetTop;console.log(l),document.documentElement.scrollTop=l-100,e.restAllForm(),e.$refs.personalForm.clearValidate(),e.$refs.personalForm.resetFields(),e.$refs.personalForm2.clearValidate(),e.$refs.personalForm2.resetFields(),e.$refs.detailpicupload.clearFiles(),e.$refs.upload.clearFiles()}else e.$notify.error({title:"错误",message:t.data.msg,offset:100})})})})},handlecancel:function(){this.$router.go(-1);this.$store.dispatch("delView",{path:"/Product/NewProduct",name:"NewProduct",fullPath:"/Product/NewProduct",title:"NewProduct"}).then(function(e){e.visitedViews})},handlechoose:function(){this.empcontrol=!0},personName:function(e){console.log(e),this.supplierid=e.supplierName,this.personalForm.supplierid=e.id}}},o=(l("nK1L"),l("KHd+")),s=Object(o.a)(r,function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("div",{staticClass:"ERP-container"},[l("div",{staticClass:"app-container"},[l("h2",{ref:"geren",staticClass:"form-name"},[e._v("基本信息")]),e._v(" "),l("div",{staticClass:"container"},[l("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"}},[l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.code"),prop:"code"}},[l("el-input",{attrs:{placeholder:"请输入物料编码",clearable:""},model:{value:e.personalForm.code,callback:function(t){e.$set(e.personalForm,"code",t)},expression:"personalForm.code"}})],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.productname"),prop:"productname"}},[l("el-input",{attrs:{placeholder:"请输入产品名称",clearable:""},model:{value:e.personalForm.productname,callback:function(t){e.$set(e.personalForm,"productname",t)},expression:"personalForm.productname"}})],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.barcode")}},[l("el-input",{attrs:{placeholder:"请输入条码",clearable:""},model:{value:e.personalForm.barcode,callback:function(t){e.$set(e.personalForm,"barcode",t)},expression:"personalForm.barcode"}})],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.categoryid")}},[l("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择物品分类"},model:{value:e.personalForm.categoryid,callback:function(t){e.$set(e.personalForm,"categoryid",t)},expression:"personalForm.categoryid"}},e._l(e.categorys,function(e,t){return l("el-option",{key:t,attrs:{label:e.categoryName,value:e.id}})}))],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.typeid")}},[l("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.types,function(e,t){return l("el-option",{key:t,attrs:{label:e.categoryName,value:e.id}})}))],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.purchasemeasurement")}},[l("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择采购计量单位"},model:{value:e.personalForm.purchasemeasurement,callback:function(t){e.$set(e.personalForm,"purchasemeasurement",t)},expression:"personalForm.purchasemeasurement"}},[l("el-option",{attrs:{value:"1",label:"类1"}}),e._v(" "),l("el-option",{attrs:{value:"2",label:"类2"}})],1)],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.salemeasurement")}},[l("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择销售计量单位"},model:{value:e.personalForm.salemeasurement,callback:function(t){e.$set(e.personalForm,"salemeasurement",t)},expression:"personalForm.salemeasurement"}},[l("el-option",{attrs:{value:"1",label:"类1"}}),e._v(" "),l("el-option",{attrs:{value:"2",label:"类2"}})],1)],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.stockmeasurement")}},[l("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择库存计量单位"},model:{value:e.personalForm.stockmeasurement,callback:function(t){e.$set(e.personalForm,"stockmeasurement",t)},expression:"personalForm.stockmeasurement"}},[l("el-option",{attrs:{value:"1",label:"类1"}}),e._v(" "),l("el-option",{attrs:{value:"2",label:"类2"}})],1)],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.producemeasurement")}},[l("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择生产计量单位"},model:{value:e.personalForm.producemeasurement,callback:function(t){e.$set(e.personalForm,"producemeasurement",t)},expression:"personalForm.producemeasurement"}},[l("el-option",{attrs:{value:"1",label:"类1"}}),e._v(" "),l("el-option",{attrs:{value:"2",label:"类2"}})],1)],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.color")}},[l("el-input",{attrs:{placeholder:"请输入颜色",clearable:""},model:{value:e.personalForm.color,callback:function(t){e.$set(e.personalForm,"color",t)},expression:"personalForm.color"}})],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.brand")}},[l("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择品牌"},model:{value:e.personalForm.brand,callback:function(t){e.$set(e.personalForm,"brand",t)},expression:"personalForm.brand"}},[l("el-option",{attrs:{value:"1",label:"类1"}}),e._v(" "),l("el-option",{attrs:{value:"2",label:"类2"}})],1)],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.level")}},[l("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择档次级别"},model:{value:e.personalForm.level,callback:function(t){e.$set(e.personalForm,"level",t)},expression:"personalForm.level"}},e._l(e.levels,function(e,t){return l("el-option",{key:t,attrs:{label:e.categoryName,value:e.id}})}))],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.supplierid")}},[l("el-input",{attrs:{placeholder:"请选择供应商"},on:{focus:e.handlechoose},model:{value:e.supplierid,callback:function(t){e.supplierid=t},expression:"supplierid"}})],1),e._v(" "),l("my-emp",{attrs:{control:e.empcontrol},on:{"update:control":function(t){e.empcontrol=t},personName:e.personName}}),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.source")}},[l("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择来源"},model:{value:e.personalForm.source,callback:function(t){e.$set(e.personalForm,"source",t)},expression:"personalForm.source"}},[l("el-option",{attrs:{value:"1",label:"类1"}}),e._v(" "),l("el-option",{attrs:{value:"2",label:"类2"}})],1)],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.kpigrade")}},[l("el-input",{attrs:{placeholder:"请输入绩效分",clearable:""},model:{value:e.personalForm.kpigrade,callback:function(t){e.$set(e.personalForm,"kpigrade",t)},expression:"personalForm.kpigrade"}})],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.point")}},[l("el-input",{attrs:{placeholder:"请输入商品积分",clearable:""},model:{value:e.personalForm.point,callback:function(t){e.$set(e.personalForm,"point",t)},expression:"personalForm.point"}})],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.zhibaoqi")}},[l("el-input",{attrs:{placeholder:"请输入质保期",clearable:""},model:{value:e.personalForm.zhibaoqi,callback:function(t){e.$set(e.personalForm,"zhibaoqi",t)},expression:"personalForm.zhibaoqi"}},[l("template",{slot:"append"},[e._v("天")])],2)],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.weight")}},[l("el-input",{attrs:{placeholder:"请输入重量",clearable:""},model:{value:e.personalForm.weight,callback:function(t){e.$set(e.personalForm,"weight",t)},expression:"personalForm.weight"}},[l("template",{slot:"append"},[e._v("KG")])],2)],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.volume")}},[l("el-input",{attrs:{placeholder:"请输入体积",clearable:""},model:{value:e.personalForm.volume,callback:function(t){e.$set(e.personalForm,"volume",t)},expression:"personalForm.volume"}},[l("template",{slot:"append"},[e._v("m³")])],2)],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.isactive")}},[l("el-radio-group",{staticStyle:{width:"80%"},model:{value:e.personalForm.isactive,callback:function(t){e.$set(e.personalForm,"isactive",t)},expression:"personalForm.isactive"}},[l("el-radio",{staticStyle:{width:"50%"},attrs:{label:1}},[e._v("YES")]),e._v(" "),l("el-radio",{attrs:{label:2}},[e._v("NO")])],1)],1)],1)],1),e._v(" "),l("h2",{ref:"lianxi",staticClass:"form-name"},[e._v("价格信息")]),e._v(" "),l("div",{staticClass:"container"},[l("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"}},[l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.valuation"),prop:"valuation"}},[l("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择"},model:{value:e.personalForm.valuation,callback:function(t){e.$set(e.personalForm,"valuation",t)},expression:"personalForm.valuation"}},[l("el-option",{attrs:{value:"1",label:"类1"}}),e._v(" "),l("el-option",{attrs:{value:"2",label:"类2"}})],1)],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.costprice"),prop:"costprice"}},[l("el-input",{attrs:{placeholder:"请输入成本价",clearable:""},model:{value:e.personalForm.costprice,callback:function(t){e.$set(e.personalForm,"costprice",t)},expression:"personalForm.costprice"}})],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.tradeprice")}},[l("el-input",{attrs:{placeholder:"请输入批发价",clearable:""},model:{value:e.personalForm.tradeprice,callback:function(t){e.$set(e.personalForm,"tradeprice",t)},expression:"personalForm.tradeprice"}})],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.saleprice"),prop:"saleprice"}},[l("el-input",{attrs:{placeholder:"请输入零售价",clearable:""},model:{value:e.personalForm.saleprice,callback:function(t){e.$set(e.personalForm,"saleprice",t)},expression:"personalForm.saleprice"}})],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.purchaseprice"),prop:"purchaseprice"}},[l("el-input",{attrs:{placeholder:"请输入采购价",clearable:""},model:{value:e.personalForm.purchaseprice,callback:function(t){e.$set(e.personalForm,"purchaseprice",t)},expression:"personalForm.purchaseprice"}})],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.lowerprice")}},[l("el-input",{attrs:{placeholder:"请输入最低价",clearable:""},model:{value:e.personalForm.lowerprice,callback:function(t){e.$set(e.personalForm,"lowerprice",t)},expression:"personalForm.lowerprice"}})],1),e._v(" "),l("el-form-item",{staticStyle:{width:"40%","margin-top":"1%"},attrs:{label:e.$t("Product.memberprice")}},[l("el-input",{attrs:{placeholder:"请输入会员价",clearable:""},model:{value:e.personalForm.memberprice,callback:function(t){e.$set(e.personalForm,"memberprice",t)},expression:"personalForm.memberprice"}})],1)],1)],1),e._v(" "),l("h2",{staticClass:"form-name"},[e._v("图片信息")]),e._v(" "),l("div",{staticClass:"container"},[l("el-form",{staticClass:"demo-ruleForm",staticStyle:{"margin-left":"30px"},attrs:{model:e.personalForm,inline:!0,"status-icon":"","label-position":"top","label-width":"300px"}},[l("el-form-item",{staticStyle:{width:"100%","margin-top":"1%"},attrs:{label:e.$t("Product.picids")}},[l("el-button",{staticStyle:{"margin-bottom":"10px"},attrs:{size:"small",type:"success"},on:{click:e.submitUpload}},[e._v(e._s(e.$t("public.uploadimage")))]),e._v(" "),l("el-upload",{ref:"upload",attrs:{"on-preview":e.handlepicPreview,"on-remove":e.handlepicRemove,"on-success":e.handlepicsuccess,data:e.picidsData,"auto-upload":!1,action:"http://192.168.1.26:9090/upload/uploadpic","list-type":"picture-card"}},[l("i",{staticClass:"el-icon-plus"})]),e._v(" "),l("el-dialog",{attrs:{visible:e.picidsVisible},on:{"update:visible":function(t){e.picidsVisible=t}}},[l("img",{attrs:{src:e.picidsImageUrl,width:"100%",alt:""}})])],1),e._v(" "),l("el-form-item",{staticStyle:{width:"100%","margin-top":"1%"},attrs:{label:e.$t("Product.detailpicid")}},[l("el-button",{staticStyle:{"margin-bottom":"10px"},attrs:{size:"small",type:"success"},on:{click:e.detailpicsubmitUpload}},[e._v(e._s(e.$t("public.uploadimage")))]),e._v(" "),l("el-upload",{ref:"detailpicupload",attrs:{"on-preview":e.handledetailpicPreview,"on-remove":e.handledetailpicRemove,"on-success":e.handledetailpicsuccess,data:e.detailpicData,"auto-upload":!1,action:"http://192.168.1.26:9090/upload/uploadpic","list-type":"picture-card"}},[l("i",{staticClass:"el-icon-plus"})]),e._v(" "),l("el-dialog",{attrs:{visible:e.detailpicVisible},on:{"update:visible":function(t){e.detailpicVisible=t}}},[l("img",{attrs:{src:e.detailpicImageUrl,width:"100%",alt:""}})])],1)],1)],1),e._v(" "),l("div",{staticClass:"buttons",staticStyle:{"margin-top":"20px"}},[l("el-button",{attrs:{type:"primary"},on:{click:function(t){e.handlesave()}}},[e._v("保存")]),e._v(" "),l("el-button",{attrs:{type:"success"},on:{click:function(t){e.handleentry()}}},[e._v("继续录入")]),e._v(" "),l("el-button",{attrs:{type:"danger"},on:{click:function(t){e.handlecancel()}}},[e._v("取消")])],1)])])},[],!1,null,"144f8c54",null);s.options.__file="NewProduct.vue";t.default=s.exports},gOyQ:function(e,t,l){},nK1L:function(e,t,l){"use strict";var a=l("gOyQ");l.n(a).a}}]);