1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
webpackJsonp([255],{EJws:function(e,t){},yIHO:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,s=a("bOdI"),o=a.n(s),r=a("mvHQ"),n=a.n(r),l=a("woOf"),c=a.n(l),h=a("d7EF"),d=a.n(h),u=a("//Fk"),f=a.n(u),m=a("BO1k"),p=a.n(m),b=a("Dd8w"),v=a.n(b),g=(a("GKmE"),a("ysqt")),D=a("OG67"),y=a("VTHH"),j=a("G9gL"),x=a("3MlD"),w=a("NYxO"),$=a("bzuE"),z=a("lbHh"),k=a.n(z),_="/apis/mdh/hcl/add",I="/apis/mdh/hcl/detail",P="/apis/mdh/hcl/edit",C={name:"hclbg-add",components:{btnInput:g.a,chooseSbjh:y.a,ChooseDevices:j.a,DialogChooseSingleUser:x.a,dialogChooseSingleParts:D.a},data:function(){return{depOptions:[],selectDeptId:[],formData:{zbList:[]},start_datetime:{disabledDate:function(e){return e.getTime()<Date.now()}},end_datetime:{disabledDate:function(e){return e.getTime()<Date.now()}},ruleForm:{sbjh:[{required:!0,message:"请选择生箔卷号",trigger:"change"}],xbid:[{required:!0,message:"请选择线别",trigger:"blur"}],deviceName:[{required:!0,message:"请选择设备",trigger:"change"}],startTime:[{required:!0,message:"请选择计划开始时间",trigger:"change"}],endTime:[{required:!0,message:"请选择计划完成时间",trigger:"change"}],expireday:[{required:!0,message:"请填写提醒天数",trigger:"blur"}],intervalTime:[{required:!0,message:"请填写间隔天数",trigger:"blur"}],type:[{required:!0,message:"请选择保养级别",trigger:"change"}]},chooseMaterielVisible:!1,chooseDevicesVisible:!1,chooseUserVisible:!1,getUserList:[],levelList:[],tableData:[],deptList:[],chooseVisible:!1,projects:[],chooseProjects:[],choosePartsVisible:!1,parts:[],choosePartss:[],loading:!1,isDisabled:!1,config:$.a,chooseSbjhVisible:!1,bbList:[],currentChildIndex:0,userInfo:{}}},mounted:function(){this.userInfo=JSON.parse(k.a.get("userInfo")),this.initialize(),this.$route.query.id&&(this.formData.id=this.$route.query.id,this.getDetail())},watch:{formData:{handler:function(e,t){""==e.deviceId&&(this.formData.deviceModel="",this.formData.deviceUser="",this.formData.deviceSite="",this.formData.deviceDept="",this.formData.deviceName=""),""==e.engineerId&&(this.formData.engineerName="",this.formData.cellphone="",this.formData.deptId="",this.selectDeptId=[])},deep:!0}},methods:v()({},Object(w.d)({removeTagNav:"tagNav/removeTagNav"}),(i={currentIndex:function(e){this.currentChildIndex=e},getSbjh:function(e){this.$set(this.formData,"scrwdh",e.scrwdh),this.$set(this.formData,"sbjh",e.jh),this.$set(this.formData,"sbjhid",e.id),this.$set(this.formData,"ggxh",e.ggxh),this.$set(this.formData,"kz",e.kz),this.$set(this.formData,"sbjz",e.sbjz)},getPart:function(e){e?(e.convCoefficient&&this.formData.countSupport&&(this.formData.count=this.formData.countSupport*e.convCoefficient),this.$set(this.formData,"materielId",e.id),this.$set(this.formData,"materielName",e.name?e.name:""),this.$set(this.formData,"materielSerialNo",e.serialNo?e.serialNo:""),this.$set(this.formData,"specification",e.specification?e.specification:""),this.$set(this.formData,"unitUomName",e.unitUomName?e.unitUomName:""),this.formData.supportUomName=e.supportUomName?e.supportUomName:"",this.formData.supportUom=e.supportUom,this.formData.convCoefficient=e.convCoefficient):(this.$set(this.formData,"materielId",""),this.$set(this.formData,"materielName",""),this.$set(this.formData,"materielSerialNo",""),this.$set(this.formData,"specification",""),this.$set(this.formData,"unitUomName",""))},setTotal:function(e){return e.num&&e.salePrice?parseFloat(e.num)*parseFloat(e.salePrice):0},treeFindPath:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e)return[];var i=!0,s=!1,o=void 0;try{for(var r,n=p()(e);!(i=(r=n.next()).done);i=!0){var l=r.value;if(a.push(l.id),t(l))return a;if(l.children){var c=this.treeFindPath(l.children,t,a);if(c.length)return c}a.pop()}}catch(e){s=!0,o=e}finally{try{!i&&n.return&&n.return()}finally{if(s)throw o}}return[]},setDeptList:function(e){var t=!0,a=!1,i=void 0;try{for(var s,o=p()(e);!(t=(s=o.next()).done);t=!0){var r=s.value;r.hasChildren?this.setDeptList(r.children):r.children=void 0}}catch(e){a=!0,i=e}finally{try{!t&&o.return&&o.return()}finally{if(a)throw i}}},handleChange:function(e){this.formData.deptId=e.length>=1?e[e.length-1]:"",this.selectDeptId=e},getDevice:function(e){e&&(this.formData.deviceId=e.id,this.formData.deviceModel=e.model,this.formData.deviceUser=e.userName,this.formData.deviceSite=e.site,this.formData.deviceDept=e.deptName,this.formData.deviceName=e.name)},getUser:function(e){e&&(this.$set(this.formData.zbList[this.currentChildIndex],"czyid",e.id),this.$set(this.formData.zbList[this.currentChildIndex],"czy",e.name))},getProject:function(e){var t=this;e&&e.forEach(function(e){t.projects.push(e)})},removeProject:function(){var e=this;this.chooseProjects&&this.chooseProjects.forEach(function(t){var a=e.formData.zbList.findIndex(function(e){if(e.id==t.id)return!0});e.formData.zbList.splice(a,1)})},handleProjectChange:function(e){this.chooseProjects=e}},o()(i,"getPart",function(e){var t=this;e&&e.forEach(function(e){t.parts.push(e)})}),o()(i,"removePart",function(){var e=this;this.chooseParts&&this.chooseParts.forEach(function(t){var a=e.parts.findIndex(function(e){if(e.id==t.id)return!0});e.parts.splice(a,1)})}),o()(i,"handlePartChange",function(e){this.chooseParts=e}),o()(i,"initialize",function(){var e=this;f.a.all([this.$api.commonAPI.getUsers(),this.$api.commonAPI.getDeptsTree(),this.$api.dictAPI.getDictsByType("xb"),this.$api.dictAPI.getDictsByType("bz")]).then(function(t){var a=d()(t,4),i=a[0],s=a[1],o=a[2],r=a[3];0===i.code&&(e.getUserList=i.datas),0===s.code&&(e.depOptions=s.data.children,e.setDeptList(e.depOptions),e.setDefaultDept()),0===o.code&&(e.levelList=o.datas),0==r.code&&(e.bbList=r.datas)}).catch(function(e){console.log(e)})}),o()(i,"back",function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/basic/hclbg",query:{t:Date.now()}})}),o()(i,"getDetail",function(){var e=this;this.loading=!0,this.$api.yxkAPI.yxkGet(I,{id:this.formData.id}).then(function(t){0==t.code&&(e.formData=c()({},t.data)),e.loading=!1}).catch(function(t){e.loading=!1})}),o()(i,"setDefaultDept",function(){if(this.depOptions.length>0&&this.formData.selectDeptId){var e=n()(this.formData.selectDeptId),t=this.treeFindPath(this.depOptions,function(t){return t.id===e});this.selectDeptId=JSON.parse(n()(t))}}),o()(i,"tempSave",function(e){var t=this;this.isDisabled=!0,this.formData.zczt=0,this.$api.yxkAPI.yxkPost(_,this.formData).then(function(e){t.isDisabled=!1,0==e.code?(t.$message({message:e.msg,type:"success"}),t.back()):t.$message({message:e.msg,type:"error"})})}),o()(i,"save",function(e){var t=this;this.$refs[e].validate(function(e){return!!e&&(0!=t.formData.zbList.length?t.formData.zbList.some(function(e){return!e.bz||!e.czy})?(t.$message({message:"请完善后处理报工的必填项",type:"error"}),!1):(t.isDisabled=!0,t.formData.zczt=1,void t.$api.yxkAPI.yxkPost(t.formData.id?P:_,t.formData).then(function(e){t.isDisabled=!1,0==e.code?(t.$message({message:e.msg,type:"success"}),t.back()):t.$message({message:e.msg,type:"error"})})):void t.$message({message:"请至少加入一条数据",type:"error"}))})}),i))},S={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sys-box plan-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.back()}}},[e._v(e._s(e.config.cancelText))])],1),e._v(" "),a("div",{staticClass:"sys-form"},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"form",attrs:{"label-width":"120px",model:e.formData,disabled:"",rules:e.ruleForm}},[a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"生箔卷号",prop:"sbjh"}},[a("btn-input",{attrs:{valueText:e.formData.sbjh,valueId:e.formData.sbjhid,chooseVisible:e.chooseSbjhVisible},on:{"update:valueText":function(t){return e.$set(e.formData,"sbjh",t)},"update:value-text":function(t){return e.$set(e.formData,"sbjh",t)},"update:valueId":function(t){return e.$set(e.formData,"sbjhid",t)},"update:value-id":function(t){return e.$set(e.formData,"sbjhid",t)},"update:chooseVisible":function(t){e.chooseSbjhVisible=t},"update:choose-visible":function(t){e.chooseSbjhVisible=t}}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"规格型号",prop:"ggxh"}},[a("el-input",{attrs:{placeholder:"规格型号",disabled:""},model:{value:e.formData.ggxh,callback:function(t){e.$set(e.formData,"ggxh",t)},expression:"formData.ggxh"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"克重(g/m³)",prop:"kz"}},[a("el-input",{attrs:{placeholder:"克重",disabled:""},model:{value:e.formData.kz,callback:function(t){e.$set(e.formData,"kz",t)},expression:"formData.kz"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"生箔卷重",prop:"sbjz"}},[a("el-input",{attrs:{placeholder:"生箔卷重",disabled:""},model:{value:e.formData.sbjz,callback:function(t){e.$set(e.formData,"sbjz",t)},expression:"formData.sbjz"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"线别",prop:"xbid"}},[a("el-select",{attrs:{clearable:"",placeholder:"线别"},on:{change:function(t){e.formData.xb=e.levelList.filter(function(e){return e.id==t})[0].name}},model:{value:e.formData.xbid,callback:function(t){e.$set(e.formData,"xbid",t)},expression:"formData.xbid"}},e._l(e.levelList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"后处理卷号",prop:"hcljh"}},[a("el-input",{attrs:{placeholder:"系统生成",disabled:""},model:{value:e.formData.hcljh,callback:function(t){e.$set(e.formData,"hcljh",t)},expression:"formData.hcljh"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"上卷时间",prop:"sjsj"}},[a("el-date-picker",{attrs:{type:"datetime",placeholder:"选择日期时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.formData.sjsj,callback:function(t){e.$set(e.formData,"sjsj",t)},expression:"formData.sjsj"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"下卷时间",prop:"xjsj"}},[a("el-date-picker",{attrs:{type:"datetime",placeholder:"选择日期时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.formData.xjsj,callback:function(t){e.$set(e.formData,"xjsj",t)},expression:"formData.xjsj"}})],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"备注"}},[a("el-input",{attrs:{type:"textarea",autosize:{minRows:4},placeholder:"请简要填写备注内容"},model:{value:e.formData.bz,callback:function(t){e.$set(e.formData,"bz",t)},expression:"formData.bz"}})],1),e._v(" "),a("el-form-item",{attrs:{required:""}},[a("div",{staticClass:"sys-operate"}),e._v(" "),a("el-table",{attrs:{data:e.formData.zbList,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"},border:"","show-summary":""},on:{"selection-change":e.handleProjectChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"bb",width:"200",align:"center","show-overflow-tooltip":""},scopedSlots:e._u([{key:"header",fn:function(t){return[a("span",[e._v("班别/组号")]),e._v(" "),a("span",{staticStyle:{color:"red"}},[e._v("*")])]}},{key:"default",fn:function(t){return[a("el-select",{attrs:{clearable:"",placeholder:"班别/组号"},on:{change:function(a){t.row.bb=e.bbList.filter(function(e){return e.id==a})[0].name}},model:{value:t.row.bbid,callback:function(a){e.$set(t.row,"bbid",a)},expression:"scope.row.bbid"}},e._l(e.bbList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"czy",align:"center",width:"200","show-overflow-tooltip":""},scopedSlots:e._u([{key:"header",fn:function(t){return[a("span",[e._v("操作员")]),e._v(" "),a("span",{staticStyle:{color:"red"}},[e._v("*")])]}},{key:"default",fn:function(t){return[a("btn-input",{attrs:{valueText:t.row.czy,valueId:t.row.czyid,index:t.$index,chooseVisible:e.chooseUserVisible},on:{"update:valueText":function(a){return e.$set(t.row,"czy",a)},"update:value-text":function(a){return e.$set(t.row,"czy",a)},"update:valueId":function(a){return e.$set(t.row,"czyid",a)},"update:value-id":function(a){return e.$set(t.row,"czyid",a)},currentIndex:e.currentIndex,"update:chooseVisible":function(t){e.chooseUserVisible=t},"update:choose-visible":function(t){e.chooseUserVisible=t}}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"hcljz",width:"200",align:"center","show-overflow-tooltip":""},scopedSlots:e._u([{key:"header",fn:function(t){return[a("span",[e._v("后处理卷重(kg)")]),e._v(" "),a("span",{staticStyle:{color:"red"}},[e._v("*")])]}},{key:"default",fn:function(t){return[a("el-input-number",{on:{change:e.handleChangeHcljz},model:{value:t.row.hcljz,callback:function(a){e.$set(t.row,"hcljz",a)},expression:"scope.row.hcljz"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"fbl",label:"废箔量",align:"center",width:"200","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{model:{value:t.row.fbl,callback:function(a){e.$set(t.row,"fbl",a)},expression:"scope.row.fbl"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"tbzlwtjl",label:"铜箔质量问题记录",align:"center",width:"250","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input",{model:{value:t.row.tbzlwtjl,callback:function(a){e.$set(t.row,"tbzlwtjl",a)},expression:"scope.row.tbzlwtjl"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"bz",label:"备注",width:"200",align:"center","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input",{model:{value:t.row.bz,callback:function(a){e.$set(t.row,"bz",a)},expression:"scope.row.bz"}})]}}])})],1)],1)],1)],1),e._v(" "),a("dialogChooseSingleParts",{attrs:{visible:e.chooseMaterielVisible},on:{"update:visible":function(t){e.chooseMaterielVisible=t},change:e.getPart}}),e._v(" "),a("ChooseDevices",{attrs:{visible:e.chooseDevicesVisible,canUsed:"canUsed"},on:{"update:visible":function(t){e.chooseDevicesVisible=t},change:e.getDevice}}),e._v(" "),a("DialogChooseSingleUser",{attrs:{visible:e.chooseUserVisible},on:{"update:visible":function(t){e.chooseUserVisible=t},change:e.getUser}}),e._v(" "),a("chooseSbjh",{attrs:{visible:e.chooseSbjhVisible},on:{"update:visible":function(t){e.chooseSbjhVisible=t},change:e.getSbjh}})],1)},staticRenderFns:[]};var N=a("VU/8")(C,S,!1,function(e){a("EJws"),a("z5H6")},"data-v-1224545c",null);t.default=N.exports},z5H6:function(e,t){}}); |