(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-534c3dec"],{5901:function(t,a,e){"use strict";e("c6c9")},"6d16":function(t,a,e){"use strict";e.d(a,"e",(function(){return r})),e.d(a,"d",(function(){return l})),e.d(a,"f",(function(){return n})),e.d(a,"a",(function(){return o})),e.d(a,"b",(function(){return s})),e.d(a,"c",(function(){return d}));var i=e("b775");function r(t){return Object(i["a"])({url:"/api/wms/material/page",method:"post",data:t})}function l(t){return Object(i["a"])({url:"/api/wms/material/get",method:"post",data:{id:t}})}function n(t){return Object(i["a"])({url:"/api/wms/material/update",method:"post",data:t})}function o(t){return Object(i["a"])({url:"/api/wms/material/add",method:"post",data:t})}function s(){return Object(i["a"])({url:"/api/wms/material/get-code",method:"post"})}function d(t){return Object(i["a"])({url:"/api/wms/material/delete",method:"post",data:{id:t}})}},addf:function(t,a,e){"use strict";e.d(a,"e",(function(){return r})),e.d(a,"d",(function(){return l})),e.d(a,"f",(function(){return n})),e.d(a,"a",(function(){return o})),e.d(a,"b",(function(){return s})),e.d(a,"c",(function(){return d}));var i=e("b775");function r(t){return Object(i["a"])({url:"/api/wms/material-type/page",method:"post",data:t})}function l(t){return Object(i["a"])({url:"/api/wms/material-type/get",method:"post",data:{id:t}})}function n(t){return Object(i["a"])({url:"/api/wms/material-type/update",method:"post",data:t})}function o(t){return Object(i["a"])({url:"/api/wms/material-type/add",method:"post",data:t})}function s(){return Object(i["a"])({url:"/api/wms/material-type/get-code",method:"post"})}function d(t){return Object(i["a"])({url:"/api/wms/material-type/delete",method:"post",data:{id:t}})}},c6c9:function(t,a,e){},d1a8:function(t,a,e){"use strict";e.r(a);var i=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticStyle:{margin:"20px"}},[e("div",{staticStyle:{"background-color":"#02BCFF","font-size":"1.5em",color:"white",padding:"5px 20px",margin:"20px"},attrs:{slot:"title"},slot:"title"},[t._v(t._s(t._f("i18nFilter")(t.isdetail?"btn.detail":t.dataForm.id?"btn.edit":"btn.add")))]),t._v(" "),e("div",{staticStyle:{margin:"0 15px"}},[e("el-form",{ref:"dataForm",attrs:{model:t.dataForm,rules:t.dataRule,"label-width":"140px"},nativeOn:{keyup:function(a){return!a.type.indexOf("key")&&t._k(a.keyCode,"enter",13,a.key,"Enter")?null:t.dataFormSubmit()}}},[e("el-form-item",{attrs:{label:t.$t("module.basicData.material.MaterialName"),prop:"name"}},[e("el-input",{attrs:{disabled:t.isdetail,placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.material.MaterialName")]),clearable:""},model:{value:t.dataForm.name,callback:function(a){t.$set(t.dataForm,"name",a)},expression:"dataForm.name"}})],1),t._v(" "),e("el-form-item",{attrs:{label:t.$t("module.basicData.material.MaterialCoding"),prop:"code"}},[e("el-input",{attrs:{disabled:t.isdetail,placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.material.MaterialCoding")]),clearable:""},model:{value:t.dataForm.code,callback:function(a){t.$set(t.dataForm,"code",a)},expression:"dataForm.code"}})],1),t._v(" "),e("el-form-item",{attrs:{label:t.$t("module.basicData.visual.EnglishName"),prop:"enName"}},[e("el-input",{attrs:{disabled:t.isdetail,placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.EnglishName")]),clearable:""},model:{value:t.dataForm.enName,callback:function(a){t.$set(t.dataForm,"enName",a)},expression:"dataForm.enName"}})],1),t._v(" "),e("el-form-item",{attrs:{label:t.$t("module.basicData.visual.Abbreviation"),prop:"abbr"}},[e("el-input",{attrs:{disabled:t.isdetail,placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.Abbreviation")]),clearable:""},model:{value:t.dataForm.abbr,callback:function(a){t.$set(t.dataForm,"abbr",a)},expression:"dataForm.abbr"}})],1),t._v(" "),e("el-form-item",{attrs:{label:t.$t("module.basicData.material.MaterialType"),prop:"category"}},[e("el-select",{attrs:{disabled:t.isdetail,filterable:"",placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.material.MaterialType")]),clearable:""},model:{value:t.dataForm.category,callback:function(a){t.$set(t.dataForm,"category",a)},expression:"dataForm.category"}},t._l(t.categoryArr,(function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t.name}})})),1)],1),t._v(" "),e("el-form-item",{attrs:{label:t.$t("module.basicData.visual.Description"),prop:"description"}},[e("el-input",{attrs:{disabled:t.isdetail,placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.Description")]),clearable:""},model:{value:t.dataForm.description,callback:function(a){t.$set(t.dataForm,"description",a)},expression:"dataForm.description"}})],1),t._v(" "),e("el-form-item",{attrs:{label:t.$t("module.basicData.visual.Remarks"),prop:"remark"}},[e("el-input",{attrs:{disabled:t.isdetail,placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.Remarks")]),clearable:""},model:{value:t.dataForm.remark,callback:function(a){t.$set(t.dataForm,"remark",a)},expression:"dataForm.remark"}})],1)],1),t._v(" "),e("div",{staticStyle:{margin:"20px"}},[e("el-button",{attrs:{type:"success"},on:{click:function(a){return t.goback()}}},[t._v(t._s(t._f("i18nFilter")("btn.back")))]),t._v(" "),t.isdetail?e("el-button",{attrs:{type:"primary"},on:{click:function(a){return t.goEdit()}}},[t._v(t._s(t._f("i18nFilter")("btn.edit")))]):t._e(),t._v(" "),t.isdetail?t._e():e("span",[e("el-button",{attrs:{type:"primary"},on:{click:function(a){return t.dataFormSubmit()}}},[t._v(t._s(t._f("i18nFilter")("btn.save")))]),t._v(" "),t.listQuery.materialId?e("el-button",{attrs:{type:"primary"},on:{click:function(a){return t.addNew()}}},[t._v(t._s(t._f("i18nFilter")("btn.addattr")))]):t._e()],1)],1),t._v(" "),e("div",{staticStyle:{height:"380px",overflow:"auto"}},[e("base-table",{attrs:{page:t.listQuery.current,limit:t.listQuery.size,"table-config":t.tableProps,"table-data":t.list}},[t.isdetail?t._e():e("method-btn",{attrs:{slot:"handleBtn","method-list":t.tableBtn},on:{clickBtn:t.handleClick},slot:"handleBtn"})],1)],1)],1),t._v(" "),t.addOrUpdateVisible?e("material-attr-add",{ref:"addOrUpdate",attrs:{"material-id":t.listQuery.materialId},on:{refreshDataList:t.getList}}):t._e()],1)},r=[],l=(e("7f7f"),e("3393")),n=e.n(l),o=e("a3e3"),s=e.n(o),d=e("9923"),u=e("6d16"),c=e("b775");function m(t){return Object(c["a"])({url:"/api/wms/material-attr/page",method:"post",data:t})}function b(t){return Object(c["a"])({url:"/api/wms/material-attr/get",method:"post",data:{id:t}})}function p(t){return Object(c["a"])({url:"/api/wms/material-attr/update",method:"post",data:t})}function f(t){return Object(c["a"])({url:"/api/wms/material-attr/add",method:"post",data:t})}function h(t){return Object(c["a"])({url:"/api/wms/material-attr/delete",method:"post",data:{id:t}})}var v=e("addf"),F=e("c0ee"),g=e("ebe9"),$=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("el-drawer",{attrs:{"append-to-body":!0,"show-close":!1,visible:t.visible,size:"40%"},on:{"update:visible":function(a){t.visible=a}}},[e("div",{staticStyle:{"background-color":"#02BCFF","font-size":"1.5em",color:"white",padding:"5px 20px"},attrs:{slot:"title"},slot:"title"},[t._v("\n "+t._s(t._f("i18nFilter")(t.dataForm.id?"btn.edit":"btn.add"))+"\n ")]),t._v(" "),e("el-form",{ref:"dataForm",attrs:{model:t.dataForm,rules:t.dataRule,"label-width":"140px"},nativeOn:{keyup:function(a){return!a.type.indexOf("key")&&t._k(a.keyCode,"enter",13,a.key,"Enter")?null:t.dataFormSubmit()}}},[e("el-form-item",{attrs:{label:t.$t("module.basicData.visual.AttributeName"),prop:"attrName"}},[e("el-input",{attrs:{placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.AttributeName")]),clearable:""},model:{value:t.dataForm.attrName,callback:function(a){t.$set(t.dataForm,"attrName",a)},expression:"dataForm.attrName"}})],1),t._v(" "),e("el-form-item",{attrs:{label:t.$t("module.basicData.visual.AttributeValue"),prop:"attrValue"}},[e("el-input",{attrs:{placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.AttributeValue")]),clearable:""},model:{value:t.dataForm.attrValue,callback:function(a){t.$set(t.dataForm,"attrValue",a)},expression:"dataForm.attrValue"}})],1)],1),t._v(" "),e("div",{staticClass:"drawer-footer"},[e("el-button",{on:{click:function(a){t.visible=!1}}},[t._v(t._s(t._f("i18nFilter")("btn.cancel")))]),t._v(" "),e("el-button",{attrs:{type:"primary",loading:t.btnLoading},on:{click:function(a){return t.dataFormSubmit()}}},[t._v(t._s(t._f("i18nFilter")("btn.confirm")))])],1)],1)},y=[],_={props:{materialId:{type:String,default:function(){return""}}},data:function(){return{visible:!1,btnLoading:!1,dataForm:{id:0,attrName:"",attrValue:""},dataRule:{attrName:[{required:!0,message:this.$i18nForm(["placeholder.input",this.$t("module.basicData.visual.AttributeName")]),trigger:"blur"}],attrValue:[{required:!0,message:this.$i18nForm(["placeholder.input",this.$t("module.basicData.visual.AttributeValue")]),trigger:"blur"}]}}},methods:{init:function(t){var a=this;this.dataForm.id=t||"",this.btnLoading=!1,this.visible=!0,this.$nextTick((function(){a.$refs["dataForm"].resetFields(),a.dataForm.id&&b(a.dataForm.id).then((function(t){a.dataForm.attrName=t.data.attrName,a.dataForm.attrValue=t.data.attrValue}))}))},dataFormSubmit:function(){var t=this;this.btnLoading=!0,this.$refs["dataForm"].validate((function(a){if(a){var e={attrName:t.dataForm.attrName,attrValue:t.dataForm.attrValue,materialId:t.materialId,id:t.dataForm.id};t.dataForm.id?p(e).then((function(a){t.$message({message:t.$t("module.basicData.visual.success"),type:"success",duration:1500,onClose:function(){t.visible=!1,t.$emit("refreshDataList")}})})):f(e).then((function(a){t.$message({message:t.$t("module.basicData.visual.success"),type:"success",duration:1500,onClose:function(){t.visible=!1,t.$emit("refreshDataList")}})}))}}))}}},k=_,D=(e("5901"),e("2877")),w=Object(D["a"])(k,$,y,!1,null,"5cb9bb4a",null),N=w.exports,O=e("8975"),x=[{type:"edit",btnName:"btn.edit"},{type:"delete",btnName:"btn.delete"}],j=[{prop:"createTime",label:d["a"].t("module.basicData.factory.createTime"),filter:O["timeFormatter"],align:"center"},{prop:"attrName",label:d["a"].t("module.basicData.visual.AttributeName"),align:"center"},{prop:"attrValue",label:d["a"].t("module.basicData.visual.AttributeValue"),align:"center"}],V={components:{BaseTable:F["a"],MethodBtn:g["a"],materialAttrAdd:N},data:function(){return{addOrUpdateVisible:!1,categoryArr:[],tableBtn:x,trueWidth:200,tableProps:j,list:[],dataForm:{name:"",code:"",enName:"",abbr:"",category:"",description:"",remark:""},dataRule:{name:[{required:!0,message:this.$i18nForm(["placeholder.input",this.$t("module.basicData.material.MaterialName")]),trigger:"blur"}],code:[{required:!0,message:this.$i18nForm(["placeholder.input",this.$t("module.basicData.material.MaterialCoding")]),trigger:"blur"}]},listQuery:{current:1,size:990,materialId:""},isdetail:!1}},created:function(){this.listQuery.materialId=this.$route.query.id,this.init()},methods:{init:function(){var t,a=this;this.isdetail=!1,this.isdetail=Boolean(this.$route.query.isdetail),n()(t=this.list).call(t,0,this.list.length),Object(v["e"])(this.listQuery).then((function(t){a.categoryArr=t.data.records})),this.$nextTick((function(){a.$refs["dataForm"].resetFields(),a.listQuery.materialId?(Object(u["d"])(a.listQuery.materialId).then((function(t){a.dataForm=t.data})),m(a.listQuery).then((function(t){var e;t.data.records?a.list=t.data.records:n()(e=a.list).call(e,0,a.list.length)}))):Object(u["b"])().then((function(t){a.dataForm.code=t.data}))}))},getList:function(){var t=this;m(this.listQuery).then((function(a){var e;a.data.records?t.list=a.data.records:n()(e=t.list).call(e,0,t.list.length)}))},handleClick:function(t){var a,e=this;"delete"===t.type?this.$confirm(s()(a="".concat(this.$t("module.basicData.visual.TipsBefore"),"[")).call(a,t.data.attrName,"]?"),this.$t("module.basicData.visual.Tips"),{confirmButtonText:this.$t("module.basicData.visual.confirmButtonText"),cancelButtonText:this.$t("module.basicData.visual.cancelButtonText"),type:"warning"}).then((function(){h(t.data.id).then((function(t){e.$message({message:e.$t("module.basicData.visual.success"),type:"success",duration:1500,onClose:function(){e.getList()}})}))}))["catch"]((function(){})):this.addNew(t.data.id)},dataFormSubmit:function(){var t=this;this.$refs["dataForm"].validate((function(a){if(a){var e={name:t.dataForm.name,code:t.dataForm.code,enName:t.dataForm.enName,description:t.dataForm.description,remark:t.dataForm.remark,abbr:t.dataForm.abbr,category:t.dataForm.category,id:t.listQuery.materialId};t.listQuery.materialId?Object(u["f"])(e).then((function(a){t.$message({message:t.$t("module.basicData.visual.success"),type:"success",duration:1500})})):Object(u["a"])(e).then((function(a){t.$message({message:t.$t("module.basicData.visual.success"),type:"success",duration:1500}),t.listQuery.materialId=a.data.id}))}}))},addNew:function(t){var a=this;this.addOrUpdateVisible=!0,this.$nextTick((function(){a.$refs.addOrUpdate.init(t)}))},goEdit:function(){this.isdetail=!1},goback:function(){this.$router.go(-1)}}},A=V,B=(e("e14a"),Object(D["a"])(A,i,r,!1,null,"0d4d3fb0",null));a["default"]=B.exports},e14a:function(t,a,e){"use strict";e("f629")},f629:function(t,a,e){}}]);