(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-70414a8d"],{"02e1":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticStyle:{margin:"20px"}},[a("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.listQuery.equipmentId?"btn.edit":"btn.add")))]),t._v(" "),a("div",{staticStyle:{margin:"0 15px"}},[a("el-form",{ref:"dataForm",attrs:{model:t.dataForm,rules:t.rules,size:"medium","label-width":"220px"}},[a("el-row",[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("module.basicData.equipment.EquipmentName"),prop:"name"}},[a("el-input",{style:{width:"100%"},attrs:{autofocus:"",disabled:t.isdetail,placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.equipment.EquipmentName")]),clearable:""},model:{value:t.dataForm.name,callback:function(e){t.$set(t.dataForm,"name",e)},expression:"dataForm.name"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("module.basicData.equipment.EquipmentCode"),prop:"code"}},[a("el-input",{style:{width:"100%"},attrs:{disabled:t.isdetail,placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.equipment.EquipmentCode")]),clearable:""},model:{value:t.dataForm.code,callback:function(e){t.$set(t.dataForm,"code",e)},expression:"dataForm.code"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("module.basicData.visual.EnglishName"),prop:"enName"}},[a("el-input",{style:{width:"100%"},attrs:{disabled:t.isdetail,placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.EnglishName")]),clearable:""},model:{value:t.dataForm.enName,callback:function(e){t.$set(t.dataForm,"enName",e)},expression:"dataForm.enName"}})],1)],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("module.basicData.visual.Abbreviation"),prop:"abbr"}},[a("el-input",{style:{width:"100%"},attrs:{disabled:t.isdetail,placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.Abbreviation")]),clearable:""},model:{value:t.dataForm.abbr,callback:function(e){t.$set(t.dataForm,"abbr",e)},expression:"dataForm.abbr"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("module.basicData.equipment.EquipmentType"),prop:"equipmentType"}},[a("el-select",{attrs:{placeholder:this.$t("module.basicData.cache.logisticsEquipment"),default:""},model:{value:t.dataForm.equipmentType,callback:function(e){t.$set(t.dataForm,"equipmentType",e)},expression:"dataForm.equipmentType"}},t._l(t.options,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("module.basicData.visual.enterTime"),prop:"enterTime"}},[a("el-date-picker",{style:{width:"100%"},attrs:{disabled:t.isdetail,format:"yyyy-MM-dd","value-format":"yyyy-MM-ddT00:00:00",placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.enterTime")]),clearable:""},model:{value:t.dataForm.enterTime,callback:function(e){t.$set(t.dataForm,"enterTime",e)},expression:"dataForm.enterTime"}})],1)],1)],1),t._v(" "),a("el-row"),t._v(" "),a("el-row",[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("module.basicData.visual.Manufacturer"),prop:"manufacturer"}},[a("el-input",{style:{width:"100%"},attrs:{disabled:t.isdetail,placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.Manufacturer")]),clearable:""},model:{value:t.dataForm.manufacturer,callback:function(e){t.$set(t.dataForm,"manufacturer",e)},expression:"dataForm.manufacturer"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("module.basicData.visual.Remarks"),prop:"remark"}},[a("el-input",{style:{width:"100%"},attrs:{disabled:t.isdetail,placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.Remarks")]),clearable:""},model:{value:t.dataForm.remark,callback:function(e){t.$set(t.dataForm,"remark",e)},expression:"dataForm.remark"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("module.basicData.visual.Description"),prop:"description"}},[a("el-input",{style:{width:"100%"},attrs:{disabled:t.isdetail,placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.Description")]),clearable:""},model:{value:t.dataForm.description,callback:function(e){t.$set(t.dataForm,"description",e)},expression:"dataForm.description"}})],1)],1)],1),t._v(" "),a("el-row"),t._v(" "),a("el-row"),t._v(" "),a("el-row",[a("el-col",{attrs:{span:9}},[t.isdetail?a("el-form-item",{attrs:{label:t.$t("module.basicData.equipment.equipmentImg"),prop:"upInfo"}},t._l(t.imgList,(function(e){return a("div",{key:e.id},[t._v("\n "+t._s(e.fileName)+" "),a("el-button",{attrs:{size:"small",type:"primary",icon:"el-icon-upload"},on:{click:function(a){return t.downloadFile(e.fileId)}}},[t._v(t._s(t._f("i18nFilter")("btn.download")))])],1)})),0):t._e()],1),t._v(" "),a("el-col",{attrs:{span:9}},[t.listQuery.equipmentId&&!t.isdetail?a("el-form-item",{attrs:{label:t.$t("module.basicData.equipment.equipmentInfo"),prop:"eInfo"}},[a("el-upload",{ref:"eInfo",attrs:{"on-success":t.saveUpload,name:"files",data:t.typeCode,"file-list":t.eInfofileList,action:t.eInfoAction,multiple:"","before-upload":t.eInfoBeforeUpload}},[a("el-button",{attrs:{size:"small",type:"primary",icon:"el-icon-upload"}},[t._v(t._s(t._f("i18nFilter")("btn.upload")))])],1)],1):t._e(),t._v(" "),t.isdetail?a("el-form-item",{attrs:{label:t.$t("module.basicData.equipment.equipmentInfo"),prop:"upInfo"}},t._l(t.fileList,(function(e){return a("div",{key:e.id},[t._v("\n "+t._s(e.fileName)+" "),a("el-button",{attrs:{size:"small",type:"primary",icon:"el-icon-upload"},on:{click:function(a){return t.downloadFile(e.fileId)}}},[t._v(t._s(t._f("i18nFilter")("btn.download")))])],1)})),0):t._e()],1)],1)],1),t._v(" "),a("div",{staticStyle:{margin:"20px"}},[a("el-button",{attrs:{type:"success"},on:{click:function(e){return t.goback()}}},[t._v(t._s(t._f("i18nFilter")("btn.back")))]),t._v(" "),t.isdetail?a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.goEdit()}}},[t._v(t._s(t._f("i18nFilter")("btn.edit")))]):t._e(),t._v(" "),t.isdetail?t._e():a("span",[a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.dataFormSubmit()}}},[t._v(t._s(t._f("i18nFilter")("btn.save")))]),t._v(" "),t.listQuery.equipmentId?a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.addNew()}}},[t._v(t._s(t._f("i18nFilter")("btn.addattr")))]):t._e()],1)],1),t._v(" "),a("div",{staticStyle:{overflow:"auto",height:"380px"}},[a("base-table",{attrs:{page:t.listQuery.current,limit:t.listQuery.size,"table-config":t.tableProps,"table-data":t.list,"is-loading":t.listLoading}},[t.isdetail?t._e():a("method-btn",{attrs:{slot:"handleBtn","method-list":t.tableBtn},on:{clickBtn:t.handleClick},slot:"handleBtn"})],1)],1)],1),t._v(" "),t.addOrUpdateVisible?a("equipment-info-attr-add",{ref:"addOrUpdate",attrs:{"equipment-id":t.listQuery.equipmentId},on:{refreshDataList:t.getList}}):t._e()],1)},n=[],r=(a("3b2b"),a("7f7f"),a("3393")),l=a.n(r),o=a("a3e3"),s=a.n(o),d=a("52da"),u=a.n(d),c=a("65b8"),m=a.n(c),p=a("9923"),b=a("abd6"),f=a("b775");function h(t){return Object(f["a"])({url:"/api/wms/equipment/attr",method:"post",data:t})}function v(t){return Object(f["a"])({url:"/api/wms/equipment/attrById",method:"post",data:{id:t}})}function F(t){return Object(f["a"])({url:"/api/wms/equipment/updateattr",method:"post",data:t})}function y(t){return Object(f["a"])({url:"/api/wms/equipment/addattr",method:"post",data:t})}function g(t){return Object(f["a"])({url:"/api/wms/equipment/deleteattr",method:"post",data:{id:t}})}var $=a("c0ee"),_=a("ebe9"),q=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-drawer",{attrs:{"append-to-body":!0,"show-close":!1,visible:t.visible,size:"40%"},on:{"update:visible":function(e){t.visible=e}}},[a("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(" "),a("el-form",{ref:"dataForm",attrs:{model:t.dataForm,rules:t.dataRule,"label-width":"130px"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.dataFormSubmit()}}},[a("el-form-item",{attrs:{label:t.$t("module.basicData.visual.AttributeName"),prop:"attrName"}},[a("el-input",{attrs:{placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.AttributeName")]),clearable:""},model:{value:t.dataForm.attrName,callback:function(e){t.$set(t.dataForm,"attrName",e)},expression:"dataForm.attrName"}})],1),t._v(" "),a("el-form-item",{attrs:{label:t.$t("module.basicData.visual.AttributeValue"),prop:"attrContent"}},[a("el-input",{attrs:{placeholder:t.$i18nForm(["placeholder.input",t.$t("module.basicData.visual.AttributeValue")]),clearable:""},model:{value:t.dataForm.attrContent,callback:function(e){t.$set(t.dataForm,"attrContent",e)},expression:"dataForm.attrContent"}})],1)],1),t._v(" "),a("div",{staticClass:"drawer-footer"},[a("el-button",{on:{click:function(e){t.visible=!1}}},[t._v(t._s(t._f("i18nFilter")("btn.cancel")))]),t._v(" "),a("el-button",{attrs:{type:"primary",loading:t.btnLoading},on:{click:function(e){return t.dataFormSubmit()}}},[t._v(t._s(t._f("i18nFilter")("btn.confirm")))])],1)],1)},w=[],k={props:{equipmentId:{type:String,default:function(){return""}}},data:function(){return{visible:!1,btnLoading:!1,dataForm:{id:0,attrName:"",attrContent:"",remark:""},dataRule:{attrName:[{required:!0,message:this.$i18nForm(["placeholder.input",this.$t("module.basicData.visual.AttributeName")]),trigger:"blur"}],attrContent:[{required:!0,message:this.$i18nForm(["placeholder.input",this.$t("module.basicData.visual.AttributeValue")]),trigger:"blur"}]}}},methods:{init:function(t){var e=this;this.dataForm.id=t||"",this.btnLoading=!1,this.visible=!0,this.$nextTick((function(){e.$refs["dataForm"].resetFields(),e.dataForm.id&&v(e.dataForm.id).then((function(t){console.log(t),e.dataForm=t.data}))}))},dataFormSubmit:function(){var t=this;this.btnLoading=!0,this.$refs["dataForm"].validate((function(e){if(e){var a={attrName:t.dataForm.attrName,attrContent:t.dataForm.attrContent,remark:t.dataForm.remark,equipmentId:t.equipmentId,id:t.dataForm.id};t.dataForm.id?F(a).then((function(e){t.$message({message:t.$t("module.basicData.visual.success"),type:"success",duration:1500,onClose:function(){t.visible=!1,t.$emit("refreshDataList")}})})):y(a).then((function(e){t.$message({message:t.$t("module.basicData.visual.success"),type:"success",duration:1500,onClose:function(){t.visible=!1,t.$emit("refreshDataList")}})}))}}))}}},D=k,I=(a("637d"),a("2877")),C=Object(I["a"])(D,q,w,!1,null,"55723996",null),x=C.exports,N="/api/common/attachment/uploadFileFormData",T=a("8975");function O(t){return Object(f["a"])({url:"/common/attachment/downloadFile",method:"get",responseType:"blob",params:t,timeout:6e4})}var L=[{type:"edit",btnName:"btn.edit"},{type:"delete",btnName:"btn.delete"}],j=[{prop:"createTime",label:p["a"].t("module.basicData.factory.createTime"),filter:T["timeFormatter"],align:"center"},{prop:"attrName",label:p["a"].t("module.basicData.visual.AttributeName"),align:"center"},{prop:"attrContent",label:p["a"].t("module.basicData.visual.AttributeValue"),align:"center"}],B={components:{BaseTable:$["a"],MethodBtn:_["a"],equipmentInfoAttrAdd:x},data:function(){return{addOrUpdateVisible:!1,tableBtn:L,trueWidth:200,tableProps:j,list:[],listLoading:!1,dataForm:{name:"",code:"",enName:"",abbr:"",equipmentType:"1",spec:"",createTime:"",enterTime:"",debugTime:"",debugPeriod:"",manufacturer:"",intellectualProperty:"",rangeNumber:"",remark:"",description:"",groupId:"",eImg:null,eInfo:null,communication:0,controlStatus:0,plcVersion:"",eapVersion:"",activiation:0,estatus:0,maintenanceTime:"",maintenanceCycle:""},options:[{value:"1",label:this.$t("module.basicData.cache.logisticsEquipment")},{value:"2",label:this.$t("module.basicData.cache.processEquipment")}],rules:{name:[{required:!0,message:this.$i18nForm(["placeholder.input",this.$t("module.basicData.equipment.EquipmentName")]),trigger:"blur"}],code:[{required:!0,message:this.$i18nForm(["placeholder.input",this.$t("module.basicData.equipment.EquipmentCode")]),trigger:"blur"}],equipmentType:[{required:!0,message:this.$i18nForm(["placeholder.select",this.$t("module.basicData.equipment.EquipmentType")]),trigger:"blur"}]},typeCode:{},eImgAction:N,eImgfileList:[],eInfoAction:N,eInfofileList:[],equipmentTypeOption:[],equipmentGroupOption:[],listQuery:{current:1,size:990,equipmentId:""},isdetail:!1,downloadList:[],fileList:[],imgList:[]}},created:function(){this.listQuery.equipmentId=this.$route.query.id,this.init(),this.getList()},methods:{init:function(){var t=this;this.isdetail=!1,this.isdetail=Boolean(this.$route.query.isdetail),this.$nextTick((function(){t.$refs["dataForm"].resetFields(),t.listQuery.equipmentId?(t.listLoading=!0,Object(b["d"])(t.listQuery.equipmentId).then((function(e){t.dataForm=e.data,console.log(t.dataForm)})),h(t.listQuery).then((function(e){var a;e.data.records?t.list=e.data.records:l()(a=t.list).call(a,0,t.list.length);t.listLoading=!1}))):Object(b["b"])().then((function(e){t.dataForm.code=e.data}))}))},getList:function(){var t=this;this.listLoading=!0,h(this.listQuery).then((function(e){var a;e.data.records?t.list=e.data.records:l()(a=t.list).call(a,0,t.list.length);t.listLoading=!1}))},handleClick:function(t){var e,a=this;"delete"===t.type?this.$confirm(s()(e="".concat(this.$t("module.basicData.visual.TipsBefore"),"[")).call(e,t.data.name,"]?"),this.$t("module.basicData.visual.Tips"),{confirmButtonText:this.$t("module.basicData.visual.confirmButtonText"),cancelButtonText:this.$t("module.basicData.visual.cancelButtonText"),type:"warning"}).then((function(){g(t.data.id).then((function(t){a.$message({message:a.$t("module.basicData.visual.success"),type:"success",duration:1500,onClose:function(){a.getList()}})}))}))["catch"]((function(){})):this.addNew(t.data.id)},dataFormSubmit:function(){var t=this;this.$refs["dataForm"].validate((function(e){if(e){var a=t.dataForm;a.id=t.listQuery.equipmentId,t.listQuery.equipmentId?Object(b["g"])(a).then((function(e){t.$message({message:t.$t("module.basicData.visual.success"),type:"success",duration:1500})})):(console.log(a),Object(b["a"])(a).then((function(e){t.$message({message:t.$t("module.basicData.visual.success"),type:"success",duration:1500}),t.listQuery.equipmentId=e.data.id})))}}))},addNew:function(t){var e=this;this.addOrUpdateVisible=!0,this.$nextTick((function(){e.$refs.addOrUpdate.init(t)}))},goback:function(){this.$router.go(-1)},goEdit:function(){this.isdetail=!1},eImgBeforeUpload:function(t){this.typeCode.typeCode="equipmentInfoImage";var e=t.size/1024/1024<10;e||this.$message.error(this.$t("upload.picSizeAlarm"));var a=new RegExp("image/*").test(t.type);return a||this.$message.error(this.$t("upload.picAlarm")),e&&a},eInfoBeforeUpload:function(t){this.typeCode.typeCode="equipmentInfoFile";var e=t.size/1024/1024<10;return e||this.$message.error(this.$t("upload.picSizeAlarm")),e},submitUpload:function(){this.$refs["eInfo"].submit()},saveUpload:function(t){var e={equipmentId:this.listQuery.equipmentId,fileId:t.data[0].id,fileName:t.data[0].fileName,fileUrl:t.data[0].fileUrl,typeCode:this.typeCode.typeCode};Object(b["e"])(e).then((function(t){}))},downloadFile:function(t){O({attachmentId:t,type:1}).then((function(t){var e="",a=t.headers["content-disposition"];a&&(e=u()(a).call(a,m()(a).call(a,"filename=")+9));var i=new Blob([t.data]),n=new FileReader;n.readAsDataURL(i),n.onload=function(t){var a=document.createElement("a");a.download=e,a.href=t.target.result,document.body.appendChild(a),a.click(),document.body.removeChild(a)}}))}}},E=B,A=(a("fc35"),Object(I["a"])(E,i,n,!1,null,"a897ac3c",null));e["default"]=A.exports},"06d9":function(t,e,a){},"377b":function(t,e,a){},"637d":function(t,e,a){"use strict";a("377b")},abd6:function(t,e,a){"use strict";a.d(e,"f",(function(){return n})),a.d(e,"h",(function(){return r})),a.d(e,"d",(function(){return l})),a.d(e,"g",(function(){return o})),a.d(e,"a",(function(){return s})),a.d(e,"b",(function(){return d})),a.d(e,"c",(function(){return u})),a.d(e,"e",(function(){return c}));var i=a("b775");function n(t){return Object(i["a"])({url:"/api/wms/equipment/page",method:"post",data:t})}function r(t){return Object(i["a"])({url:"/api/process/work-sequence/equipmentlistList",method:"post",data:t})}function l(t){return Object(i["a"])({url:"/api/wms/equipment/get",method:"post",data:{id:t}})}function o(t){return Object(i["a"])({url:"/api/wms/equipment/update",method:"post",data:t})}function s(t){return Object(i["a"])({url:"/api/wms/equipment/add",method:"post",data:t})}function d(){return Object(i["a"])({url:"/api/wms/equipment/getCode",method:"post"})}function u(t){return Object(i["a"])({url:"/api/wms/equipment/delete",method:"post",data:{id:t}})}function c(t){return Object(i["a"])({url:"/api/wms/equipment-file/update-file",method:"post",data:t})}},fc35:function(t,e,a){"use strict";a("06d9")}}]);