1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
webpackJsonp([205],{"0/Do":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"),f=a.n(h),u=a("//Fk"),d=a.n(u),m=a("BO1k"),p=a.n(m),b=a("Xxa5"),v=a.n(b),D=a("exGp"),g=a.n(D),y=a("Dd8w"),j=a.n(y),x=(a("GKmE"),a("ysqt")),z=a("OG67"),w=a("VTHH"),$=a("G9gL"),k=a("3MlD"),_=a("NYxO"),I=a("bzuE"),C=a("lbHh"),P=a.n(C),S="/apis/mdh/hcl/add",N="/apis/mdh/hcl/detail",U="/apis/mdh/hcl/edit",V="/apis/mdh/hcl/getCode",L={name:"hclbg-add",components:{btnInput:x.a,chooseSbjh:w.a,ChooseDevices:$.a,DialogChooseSingleUser:k.a,dialogChooseSingleParts:z.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:I.a,chooseSbjhVisible:!1,bbList:[],currentChildIndex:0,userInfo:{}}},mounted:function(){this.userInfo=JSON.parse(P.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:j()({},Object(_.d)({removeTagNav:"tagNav/removeTagNav"}),(i={currentIndex:function(e){this.currentChildIndex=e},handleChangeHcljz:function(){var e=this.formData.zbList.reduce(function(e,t){return e+t.hcljz},0);this.formData.hcljz=e,this.formData=j()({},this.formData)},fetchCode:function(){var e=this;return g()(v.a.mark(function t(){var a;return v.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.formData.sbjh&&e.formData.xb){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.$api.yxkAPI.yxkGet(V,{sbjh:e.formData.sbjh,xb:e.formData.xb});case 4:a=t.sent,e.$set(e.formData,"hcljh",a.data),console.log(a,"res");case 7:case"end":return t.stop()}},t,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),this.fetchCode()},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==t)return!0});e.formData.zbList.splice(a,1)}),this.handleChangeHcljz())},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;d.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=f()(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(N,{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.formData.zt=2,this.$api.yxkAPI.yxkPost(this.formData.id?U:S,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.hcljz||!e.czy})?(t.$message({message:"请完善后处理报工的必填项",type:"error"}),!1):(t.isDisabled=!0,t.formData.zczt=1,t.formData.zt=3,void t.$api.yxkAPI.yxkPost(t.formData.id?U:S,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))},T={render:function(){var e=this,t=this,a=t.$createElement,i=t._self._c||a;return i("div",{staticClass:"sys-box plan-box"},[i("div",{staticClass:"sys-operate"},[i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.back()}}},[t._v(t._s(t.config.cancelText))]),t._v(" "),i("el-button",{attrs:{type:"primary",disabled:t.isDisabled},on:{click:function(e){return t.tempSave("form")}}},[t._v("暂存")]),t._v(" "),i("el-button",{attrs:{type:"primary",disabled:t.isDisabled},on:{click:function(e){return t.save("form")}}},[t._v("提交")])],1),t._v(" "),i("div",{staticClass:"sys-form"},[i("el-form",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"form",attrs:{"label-width":"120px",model:t.formData,rules:t.ruleForm}},[i("div",{staticClass:"flex"},[i("el-form-item",{staticClass:"form-inline",attrs:{label:"生箔卷号",prop:"sbjh"}},[i("btn-input",{attrs:{valueText:t.formData.sbjh,valueId:t.formData.sbjhid,chooseVisible:t.chooseSbjhVisible},on:{"update:valueText":function(e){return t.$set(t.formData,"sbjh",e)},"update:value-text":function(e){return t.$set(t.formData,"sbjh",e)},"update:valueId":function(e){return t.$set(t.formData,"sbjhid",e)},"update:value-id":function(e){return t.$set(t.formData,"sbjhid",e)},"update:chooseVisible":function(e){t.chooseSbjhVisible=e},"update:choose-visible":function(e){t.chooseSbjhVisible=e}}})],1),t._v(" "),i("el-form-item",{staticClass:"form-inline",attrs:{label:"规格型号",prop:"ggxh"}},[i("el-input",{attrs:{placeholder:"规格型号",disabled:""},model:{value:t.formData.ggxh,callback:function(e){t.$set(t.formData,"ggxh",e)},expression:"formData.ggxh"}})],1),t._v(" "),i("el-form-item",{staticClass:"form-inline",attrs:{label:"克重(g/m³)",prop:"kz"}},[i("el-input",{attrs:{placeholder:"克重",disabled:""},model:{value:t.formData.kz,callback:function(e){t.$set(t.formData,"kz",e)},expression:"formData.kz"}})],1),t._v(" "),i("el-form-item",{staticClass:"form-inline",attrs:{label:"生箔卷重",prop:"sbjz"}},[i("el-input",{attrs:{placeholder:"生箔卷重",disabled:""},model:{value:t.formData.sbjz,callback:function(e){t.$set(t.formData,"sbjz",e)},expression:"formData.sbjz"}})],1),t._v(" "),i("el-form-item",{staticClass:"form-inline",attrs:{label:"线别",prop:"xbid"}},[i("el-select",{attrs:{clearable:"",placeholder:"线别"},on:{change:function(a){t.formData.xb=t.levelList.filter(function(e){return e.id==a})[0].name,e.fetchCode()}},model:{value:t.formData.xbid,callback:function(e){t.$set(t.formData,"xbid",e)},expression:"formData.xbid"}},t._l(t.levelList,function(e){return i("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),t._v(" "),i("el-form-item",{staticClass:"form-inline",attrs:{label:"后处理卷号",prop:"hcljh"}},[i("el-input",{attrs:{placeholder:"系统生成",disabled:""},model:{value:t.formData.hcljh,callback:function(e){t.$set(t.formData,"hcljh",e)},expression:"formData.hcljh"}})],1),t._v(" "),i("el-form-item",{staticClass:"form-inline",attrs:{label:"上卷时间",prop:"sjsj"}},[i("el-date-picker",{attrs:{type:"datetime",placeholder:"选择日期时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.formData.sjsj,callback:function(e){t.$set(t.formData,"sjsj",e)},expression:"formData.sjsj"}})],1),t._v(" "),i("el-form-item",{staticClass:"form-inline",attrs:{label:"下卷时间",prop:"xjsj"}},[i("el-date-picker",{attrs:{type:"datetime",placeholder:"选择日期时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.formData.xjsj,callback:function(e){t.$set(t.formData,"xjsj",e)},expression:"formData.xjsj"}})],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"备注"}},[i("el-input",{attrs:{type:"textarea",autosize:{minRows:4},placeholder:"请简要填写备注内容"},model:{value:t.formData.bz,callback:function(e){t.$set(t.formData,"bz",e)},expression:"formData.bz"}})],1),t._v(" "),i("el-form-item",{attrs:{required:""}},[i("div",{staticClass:"sys-operate"},[i("el-button",{attrs:{type:"primary"},on:{click:function(){t.formData.zbList.push(JSON.parse(JSON.stringify({czy:t.userInfo.name,czyid:t.userInfo.userId,hcljz:0})))}}},[t._v("新增")]),t._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.removeProject()}}},[t._v("删除")])],1),t._v(" "),i("el-table",{attrs:{data:t.formData.zbList,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"},border:"","show-summary":""},on:{"selection-change":t.handleProjectChange}},[i("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),t._v(" "),i("el-table-column",{attrs:{prop:"bb",width:"200",align:"center","show-overflow-tooltip":""},scopedSlots:t._u([{key:"header",fn:function(e){return[i("span",[t._v("班别/组号")]),t._v(" "),i("span",{staticStyle:{color:"red"}},[t._v("*")])]}},{key:"default",fn:function(e){return[i("el-select",{attrs:{clearable:"",placeholder:"班别/组号"},on:{change:function(a){e.row.bb=t.bbList.filter(function(e){return e.id==a})[0].name}},model:{value:e.row.bbid,callback:function(a){t.$set(e.row,"bbid",a)},expression:"scope.row.bbid"}},t._l(t.bbList,function(e){return i("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"czy",align:"center",width:"200","show-overflow-tooltip":""},scopedSlots:t._u([{key:"header",fn:function(e){return[i("span",[t._v("操作员")]),t._v(" "),i("span",{staticStyle:{color:"red"}},[t._v("*")])]}},{key:"default",fn:function(e){return[i("btn-input",{attrs:{valueText:e.row.czy,valueId:e.row.czyid,index:e.$index,chooseVisible:t.chooseUserVisible},on:{"update:valueText":function(a){return t.$set(e.row,"czy",a)},"update:value-text":function(a){return t.$set(e.row,"czy",a)},"update:valueId":function(a){return t.$set(e.row,"czyid",a)},"update:value-id":function(a){return t.$set(e.row,"czyid",a)},currentIndex:t.currentIndex,"update:chooseVisible":function(e){t.chooseUserVisible=e},"update:choose-visible":function(e){t.chooseUserVisible=e}}})]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"hcljz",width:"200",align:"center","show-overflow-tooltip":""},scopedSlots:t._u([{key:"header",fn:function(e){return[i("span",[t._v("后处理卷重(kg)")]),t._v(" "),i("span",{staticStyle:{color:"red"}},[t._v("*")])]}},{key:"default",fn:function(e){return[i("el-input-number",{on:{change:t.handleChangeHcljz},model:{value:e.row.hcljz,callback:function(a){t.$set(e.row,"hcljz",a)},expression:"scope.row.hcljz"}})]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"fbl",label:"废箔量",align:"center",width:"200","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-input-number",{model:{value:e.row.fbl,callback:function(a){t.$set(e.row,"fbl",a)},expression:"scope.row.fbl"}})]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"tbzlwtjl",label:"铜箔质量问题记录",align:"center",width:"250","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-input",{model:{value:e.row.tbzlwtjl,callback:function(a){t.$set(e.row,"tbzlwtjl",a)},expression:"scope.row.tbzlwtjl"}})]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"bz",label:"备注",width:"200",align:"center","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-input",{model:{value:e.row.bz,callback:function(a){t.$set(e.row,"bz",a)},expression:"scope.row.bz"}})]}}])})],1)],1)],1)],1),t._v(" "),i("dialogChooseSingleParts",{attrs:{visible:t.chooseMaterielVisible},on:{"update:visible":function(e){t.chooseMaterielVisible=e},change:t.getPart}}),t._v(" "),i("ChooseDevices",{attrs:{visible:t.chooseDevicesVisible,canUsed:"canUsed"},on:{"update:visible":function(e){t.chooseDevicesVisible=e},change:t.getDevice}}),t._v(" "),i("DialogChooseSingleUser",{attrs:{visible:t.chooseUserVisible},on:{"update:visible":function(e){t.chooseUserVisible=e},change:t.getUser}}),t._v(" "),i("chooseSbjh",{attrs:{visible:t.chooseSbjhVisible},on:{"update:visible":function(e){t.chooseSbjhVisible=e},change:t.getSbjh}})],1)},staticRenderFns:[]};var O=a("VU/8")(L,T,!1,function(e){a("4T8m"),a("4Xsp")},"data-v-4960b7cc",null);t.default=O.exports},"4T8m":function(e,t){},"4Xsp":function(e,t){}}); |