1 line
34 KiB
JavaScript
1 line
34 KiB
JavaScript
webpackJsonp([44],{"2AJW":function(e,t,a){"use strict";var r=a("d7EF"),s=a.n(r),o=a("//Fk"),i=a.n(o),n=a("GKmE"),l={name:"dialogChoosePlan",props:{id:{type:String,default:""},visible:{type:Boolean,default:!1}},watch:{visible:function(e,t){e!==t&&(e&&this.initData(),this.innerVisible=e)},innerVisible:function(e,t){e!==t&&this.$emit("update:visible",e)}},data:function(){return{subsetList:[],subsetAll:[],subsetTotal:0,searchData_Subset:{pageno:1,pagesize:5},getUserList:[],innerVisible:this.visible,loading:!1,dialogLoading:!1,statusList:[],addVisible:!1,planTime:""}},computed:{},methods:{initData:function(){var e=this;i.a.all([this.$api.commonAPI.getUsers(),this.$api.dictAPI.getDictsByType("task_status")]).then(function(t){var a=s()(t,2),r=a[0],o=a[1];0===r.code&&(e.getUserList=r.datas),0===o.code&&(e.statusList=o.datas)}).catch(function(e){console.log(e)}),this.searchSubset()},searchSubset:function(e){var t=this;e&&(this.searchData_Subset.pageno=1),this.planTime?(this.searchData_Subset.startTime=Object(n.b)(this.planTime[0]),this.searchData_Subset.endTime=Object(n.b)(this.planTime[1])):(this.searchData_Subset.startTime="",this.searchData_Subset.endTime=""),this.dialogLoading=!0,this.$api.upkeepPlanAPI.planListForUser(this.searchData_Subset).then(function(e){t.dialogLoading=!1,0===e.code&&(t.subsetList=e.data?e.data.datas:[],t.subsetTotal=e.data?e.data.totalRows:0)})},submit:function(e){this.$emit("change",e),this.innerVisible=!1},subsetSizeChange:function(e){this.searchData_Subset.pagesize=e,this.searchSubset()},subsetCurrentChange:function(e){this.searchData_Subset.pageno=e,this.searchSubset()}}},c={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{center:"",title:"选择保养计划",visible:e.innerVisible,width:"1000px"},on:{"update:visible":function(t){e.innerVisible=t}}},[a("div",[a("el-form",{attrs:{inline:""}},[a("el-form-item",{attrs:{label:"计划名称"}},[a("el-input",{attrs:{placeholder:"请输入计划名称"},model:{value:e.searchData_Subset.planName,callback:function(t){e.$set(e.searchData_Subset,"planName",t)},expression:"searchData_Subset.planName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"计划状态"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择任务状态"},model:{value:e.searchData_Subset.status,callback:function(t){e.$set(e.searchData_Subset,"status",t)},expression:"searchData_Subset.status"}},e._l(e.statusList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"计划时间"}},[a("el-date-picker",{attrs:{type:"daterange",clearable:"","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:e.planTime,callback:function(t){e.planTime=t},expression:"planTime"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.searchSubset(1)}}},[e._v("查询")])],1)],1)],1),e._v(" "),a("div",{staticClass:"sys-table"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.dialogLoading,expression:"dialogLoading"}],attrs:{data:e.subsetList,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}}},[a("el-table-column",{attrs:{prop:"work_orderNo",align:"center",label:"计划单号","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"name",label:"保养计划名称","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"startTime",align:"center",label:"计划开始时间","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"endTime",align:"center",label:"计划完成时间","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"",align:"center",label:"设备名称","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"model",align:"center",label:"规格型号","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"man_hour",align:"center",label:"保养工时"}}),e._v(" "),a("el-table-column",{attrs:{prop:"userName",align:"center",label:"保养负责人","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"statusName",align:"center",label:"计划状态"}}),e._v(" "),a("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.submit(t.row)}}},[e._v("选择")])]}}])})],1)],1),e._v(" "),a("div",{staticClass:"sys-pagination"},[a("el-pagination",{attrs:{"current-page":e.searchData_Subset.pageno,"page-sizes":[5,10,20],"page-size":e.searchData_Subset.pagesize,layout:"total, sizes, prev, pager, next, jumper",total:e.subsetTotal},on:{"update:currentPage":function(t){return e.$set(e.searchData_Subset,"pageno",t)},"update:current-page":function(t){return e.$set(e.searchData_Subset,"pageno",t)},"size-change":e.subsetSizeChange,"current-change":e.subsetCurrentChange}})],1)])},staticRenderFns:[]},u=a("VU/8")(l,c,!1,null,null,null);t.a=u.exports},"5hb4":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("mvHQ"),s=a.n(r),o=a("BO1k"),i=a.n(o),n=a("d7EF"),l=a.n(n),c=a("//Fk"),u=a.n(c),d=a("woOf"),m=a.n(d),p=a("Dd8w"),f=a.n(p),h=a("ysqt"),b=a("NYxO"),v=a("cXln"),g=a("CdUU"),D=a("2AJW"),_=a("G9gL"),y=a("3MlD"),k=a("bzuE"),$={name:"upkeep_execution_add",components:{btnInput:h.a,ChooseParts:g.a,ChoosePlan:D.a,ChooseDevices:_.a,DialogChooseSingleUser:y.a,ChooseProjects:v.a},data:function(){return{depOptions:[],selectDeptId:[],formDetail:{},formData:{deptId:"",deviceName:"",deviceId:"",engineerName:"",engineerId:""},start_datetime:{},end_datetime:{},ruleForm:{engineerName:[{required:!0,message:"请选择保养负责人",trigger:"change"}],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"}],status:[{required:!0,message:"请选择使用状况",trigger:"change"}],downHour:[{required:!0,message:"请输入停机时间(小时)",trigger:"blur"}],type:[{required:!0,message:"请选择保养级别",trigger:"change"}]},planId:"",recordId:"",choosePlanVisible:!1,choosePlan:{},planList:[],levelList:[],projects:[],statusList:[],getUserList:[],chooseProjects:[],choosePartsVisible:!1,isDisabled:!1,parts:[],choosePartss:[],chooseDevicesVisible:!1,chooseUserVisible:!1,chooseVisible:!1,config:k.a,bymcList:[]}},watch:{projects:{handler:function(e,t){var a=0;e.forEach(function(e){void 0!=e.manHourCost&&(a+=e.manHourCost)}),this.$set(this.formData,"manHourCost",a)},immediate:!0,deep:!0},parts:{handler:function(e,t){var a=0;e.forEach(function(e){void 0!=e.salePrice&&void 0!=e.num&&(a+=e.salePrice*e.num)}),this.$set(this.formData,"cost",a)},immediate:!0,deep:!0},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="")},deep:!0}},mounted:function(){this.initialize(),this.$route.query.id&&(this.planId=this.$route.query.planid,this.recordId=this.$route.query.id,this.getPlanDetail())},methods:f()({},Object(b.d)({removeTagNav:"tagNav/removeTagNav"}),{setTotal:function(e){return e.num&&e.salePrice?(e.num*e.salePrice).toFixed(2):0},getDevice:function(e){e&&(this.$set(this.formData,"deviceId",e.id),this.$set(this.formData,"deviceModel",e.model),this.$set(this.formData,"deviceUser",e.userName),this.$set(this.formData,"deviceSite",e.site),this.$set(this.formData,"deviceDept",e.deptName),this.$set(this.formData,"deviceName",e.name))},getUser:function(e){var t=this,a=this;e&&(this.$set(this.formData,"engineerId",e.id),this.$set(this.formData,"engineerName",e.name),this.$set(this.formData,"cellphone",e.mobile),this.getUserList.forEach(function(r){e.id!==r.id||t.$set(a.formData,"selectDeptId",r.deptId)}),this.setDefaultDept())},getProject:function(e){var t=this;e&&e.forEach(function(e){var a={id:e.id,name:e.name,function:e.function,result:"1"};t.projects.push(a)})},removeProject:function(){var e=this;this.chooseProjects&&this.chooseProjects.forEach(function(t){var a=e.projects.findIndex(function(e){if(e.id==t.id)return!0});e.projects.splice(a,1)})},handleProjectChange:function(e){this.chooseProjects=e},getPlanDetail:function(){var e=this;this.$api.upkeepPlanAPI.oneRecordDetail(this.recordId).then(function(t){if(0===t.code){for(var a in e.formData=m()({},e.formData,t.data.record[0]),e.formData.deviceName=t.data.record[0].deviceName,e.formData.deviceModel=t.data.record[0].model,e.formData.deviceUser=t.data.record[0].userName,e.formData.deviceSite=t.data.record[0].site,e.formData.deviceDept=t.data.record[0].useDeptName,e.formData.workOrderno=t.data.record[0].work_orderNo,e.formData.deviceId=t.data.record[0].deviceId,e.formData.name=t.data.record[0].plan_name,e.formData.engineerName=t.data.record[0].engineerName,e.formData.engineerId=t.data.record[0].engineerId,e.formData.cellphone=t.data.record[0].mobile,e.formData.startTime=t.data.record[0].planStarttime,e.formData.endTime=t.data.record[0].planendtime,e.formData.expireday=t.data.record[0].expireday,e.formData.intervalTime=t.data.record[0].interval_time,e.formData.type=t.data.record[0].typeId,e.formData.deptId=t.data.record[0].upkeepDeptId,e.formData.status=t.data.record[0].using_status_id,e.formData.downHour=t.data.record[0].downHour,e.$set(e.formData,"selectDeptId",t.data.record[0].upkeepDeptId),e.formData)void 0==e.formData[a]&&(e.formData[a]="");e.setDefaultDept(),t.data.project&&t.data.project.forEach(function(t){var a={result:""+t.result,remark:t.remark,function:t.function,name:t.name,manhour:t.manhour,manHourCost:t.manHourCost,id:t.proId};e.projects.push(a)}),t.data.part&&t.data.part.forEach(function(t){var a={serialNo:t.code,name:t.spartName,specification:t.type,unitUomName:t.spart_unit,num:t.spart_amount,id:t.part_id,salePrice:t.price,remark:t.remark};e.parts.push(a)})}})},getPlan:function(e){e&&(this.planId=e.id,this.getPlanDetail())},getPart:function(e){var t=this;e&&e.forEach(function(e){t.parts.push(e)})},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)})},handlePartChange:function(e){this.chooseParts=e},initialize:function(){var e=this;u.a.all([this.$api.commonAPI.getUsers(),this.$api.commonAPI.getDeptsTree(),this.$api.dictAPI.getDictsByType("device_status"),this.$api.dictAPI.getDictsByType("device_upkeep"),this.$api.upkeepPlanAPI.planListForUser({pageno:1,pagesize:9999})]).then(function(t){var a=l()(t,5),r=a[0],s=a[1],o=a[2],i=a[3],n=a[4];0===r.code&&(e.getUserList=r.datas),0===s.code&&(e.depOptions=s.data.children,e.setDeptList(e.depOptions),e.setDefaultDept()),0===o.code&&(e.statusList=o.datas),0===i.code&&(e.levelList=i.datas),0==n.code&&(console.log(n.data),e.bymcList=n.data.datas)}).catch(function(e){console.log(e)})},treeFindPath:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e)return[];var r=!0,s=!1,o=void 0;try{for(var n,l=i()(e);!(r=(n=l.next()).done);r=!0){var c=n.value;if(a.push(c.id),t(c))return a;if(c.children){var u=this.treeFindPath(c.children,t,a);if(u.length)return u}a.pop()}}catch(e){s=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(s)throw o}}return[]},setDeptList:function(e){var t=!0,a=!1,r=void 0;try{for(var s,o=i()(e);!(t=(s=o.next()).done);t=!0){var n=s.value;n.hasChildren?this.setDeptList(n.children):n.children=void 0}}catch(e){a=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(a)throw r}}},setDefaultDept:function(){if(this.depOptions.length>0&&this.formData.selectDeptId){var e=s()(this.formData.selectDeptId),t=this.treeFindPath(this.depOptions,function(t){return t.id===e});this.selectDeptId=JSON.parse(s()(t))}},handleChange:function(e){this.formData.deptId=e.length>=1?e[e.length-1]:"",this.selectDeptId=e},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/upkeep/execution"})},tempSave:function(e){var t=this;this.$refs[e].validate(function(e){if(!e)return!1;if(0!=t.projects.length){for(var a=0;a<t.projects.length;a++){if(!t.projects[a].manhour)return void t.$alert("请填写保养项目【"+t.projects[a].name+"】的保养工时","提示",{confirmButtonText:"知道啦"});if(!t.projects[a].manHourCost)return void t.$alert("请填写保养项目【"+t.projects[a].name+"】的保养工时费","提示",{confirmButtonText:"知道啦"});if(!t.projects[a].result)return void t.$alert("请选择保养项目【"+t.projects[a].name+"】的保养结果","提示",{confirmButtonText:"知道啦"})}var r=[];if(t.projects.forEach(function(e){var t={projectId:e.id,manhour:e.manhour,result:e.result,remark:e.remark,manHourCost:e.manHourCost};r.push(t)}),t.formData.projectArray=s()(r),t.parts&&t.parts.length>0){var o=[];t.parts.forEach(function(e){var t=parseInt(e.num),a={partId:e.id,spartAmount:t||0,spartPrice:e.salePrice?e.salePrice:0,spartSum:parseFloat(e.salePrice)*t?(parseFloat(e.salePrice)*t).toFixed(2):0,remark:e.remark};o.push(a)}),t.formData.partArray=s()(o)}t.isDisabled||(t.isDisabled=!0,t.$api.upkeepPlanAPI.recordOfNoPlan(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"})}))}else t.$alert("请选择保养项目!","提示",{confirmButtonText:"知道啦"})})},save:function(e){var t=this;this.$refs[e].validate(function(e){if(!e)return!1;if(new Date(t.formData.endTime).getTime()-new Date(t.formData.startTime).getTime()<0)t.$alert("计划完成时间必须大于计划开始时间!","提示",{confirmButtonText:"知道啦"});else if(0!=t.projects.length){for(var a=0;a<t.projects.length;a++){if(!t.projects[a].manhour)return void t.$alert("请填写保养项目【"+t.projects[a].name+"】的保养工时","提示",{confirmButtonText:"知道啦"});if(!t.projects[a].manHourCost)return void t.$alert("请填写保养项目【"+t.projects[a].name+"】的保养工时费","提示",{confirmButtonText:"知道啦"});if(!t.projects[a].result)return void t.$alert("请选择保养项目【"+t.projects[a].name+"】的保养结果","提示",{confirmButtonText:"知道啦"})}var r=[];if(t.projects.forEach(function(e){var t={projectId:e.id,manhour:e.manhour,result:parseInt(e.result),remark:e.remark,manHourCost:e.manHourCost};r.push(t)}),t.formData.projectArray=s()(r),t.parts&&t.parts.length>0){var o=[];t.parts.forEach(function(e){var t=parseInt(e.num),a={partId:e.id,spartAmount:t||0,spartPrice:e.salePrice?e.salePrice:0,spartSum:parseFloat(e.salePrice)*t?(parseFloat(e.salePrice)*t).toFixed(2):0,remark:e.remark};o.push(a)}),t.formData.partArray=s()(o)}t.isDisabled||(t.isDisabled=!0,t.$api.upkeepPlanAPI.sumitNoPlanOfRecord(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"})}))}else t.$alert("请选择保养项目!","提示",{confirmButtonText:"知道啦"})})}})},w={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))]),e._v(" "),a("el-button",{attrs:{type:"primary",disabled:e.isDisabled},on:{click:function(t){return e.tempSave("form")}}},[e._v("暂存")]),e._v(" "),a("el-button",{attrs:{type:"primary",disabled:e.isDisabled},on:{click:function(t){return e.save("form")}}},[e._v("提交")])],1),e._v(" "),a("div",{staticClass:"sys-form"},[a("el-form",{ref:"form",attrs:{"label-width":"130px",model:e.formData,rules:e.ruleForm}},[a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"保养单号"}},[a("el-input",{attrs:{placeholder:"保养单号系统自动生成",disabled:""},model:{value:e.formData.workOrderno,callback:function(t){e.$set(e.formData,"workOrderno",t)},expression:"formData.workOrderno"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"保养名称",prop:"planName"}},[a("el-input",{attrs:{placeholder:"请输入保养名称"},model:{value:e.formData.planName,callback:function(t){e.$set(e.formData,"planName",t)},expression:"formData.planName"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"设备名称",prop:"deviceName"}},[a("btn-input",{attrs:{valueText:e.formData.deviceName,valueId:e.formData.deviceId,chooseVisible:e.chooseDevicesVisible},on:{"update:valueText":function(t){return e.$set(e.formData,"deviceName",t)},"update:value-text":function(t){return e.$set(e.formData,"deviceName",t)},"update:valueId":function(t){return e.$set(e.formData,"deviceId",t)},"update:value-id":function(t){return e.$set(e.formData,"deviceId",t)},"update:chooseVisible":function(t){e.chooseDevicesVisible=t},"update:choose-visible":function(t){e.chooseDevicesVisible=t}}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"规格型号"}},[a("el-input",{attrs:{disabled:""},model:{value:e.formData.deviceModel,callback:function(t){e.$set(e.formData,"deviceModel",t)},expression:"formData.deviceModel"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"使用部门"}},[a("el-input",{attrs:{disabled:""},model:{value:e.formData.deviceDept,callback:function(t){e.$set(e.formData,"deviceDept",t)},expression:"formData.deviceDept"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"负责人"}},[a("el-input",{attrs:{disabled:""},model:{value:e.formData.deviceUser,callback:function(t){e.$set(e.formData,"deviceUser",t)},expression:"formData.deviceUser"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"保养级别",prop:"type"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择保养级别"},on:{change:function(t){return e.$forceUpdate()}},model:{value:e.formData.type,callback:function(t){e.$set(e.formData,"type",t)},expression:"formData.type"}},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:"engineerName"}},[a("btn-input",{attrs:{valueText:e.formData.engineerName,valueId:e.formData.engineerId,chooseVisible:e.chooseUserVisible},on:{"update:valueText":function(t){return e.$set(e.formData,"engineerName",t)},"update:value-text":function(t){return e.$set(e.formData,"engineerName",t)},"update:valueId":function(t){return e.$set(e.formData,"engineerId",t)},"update:value-id":function(t){return e.$set(e.formData,"engineerId",t)},"update:chooseVisible":function(t){e.chooseUserVisible=t},"update:choose-visible":function(t){e.chooseUserVisible=t}}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"负责人电话"}},[a("el-input",{attrs:{disabled:""},model:{value:e.formData.cellphone,callback:function(t){e.$set(e.formData,"cellphone",t)},expression:"formData.cellphone"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"保养部门"}},[a("el-cascader",{staticStyle:{width:"100%"},attrs:{clearable:"",disabled:"",options:e.depOptions,props:{expandTrigger:"hover",label:"text",value:"id",checkStrictly:!0}},on:{change:e.handleChange},model:{value:e.selectDeptId,callback:function(t){e.selectDeptId=t},expression:"selectDeptId"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"计划开始时间",prop:"startTime"}},[a("el-date-picker",{attrs:{"picker-options":e.start_datetime,format:"yyyy-MM-dd HH:mm:ss","value-format":"yyyy-MM-dd HH:mm:ss",type:"datetime",clearable:"",placeholder:"选择日期"},model:{value:e.formData.startTime,callback:function(t){e.$set(e.formData,"startTime",t)},expression:"formData.startTime"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"计划完成时间",prop:"endTime"}},[a("el-date-picker",{attrs:{"picker-options":e.end_datetime,"value-format":"yyyy-MM-dd HH:mm:ss",type:"datetime",clearable:"",format:"yyyy-MM-dd HH:mm:ss",placeholder:"选择日期"},model:{value:e.formData.endTime,callback:function(t){e.$set(e.formData,"endTime",t)},expression:"formData.endTime"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"停机时间(小时)",prop:"downHour"}},[a("el-input-number",{staticStyle:{width:"100%"},attrs:{min:0},model:{value:e.formData.downHour,callback:function(t){e.$set(e.formData,"downHour",t)},expression:"formData.downHour"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"使用状况",prop:"status"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择使用状况"},on:{change:function(t){return e.$forceUpdate()}},model:{value:e.formData.status,callback:function(t){e.$set(e.formData,"status",t)},expression:"formData.status"}},e._l(e.statusList,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:"manHourCost"}},[a("el-input",{attrs:{placeholder:"请输入工时费合计(元)",readonly:""},model:{value:e.formData.manHourCost,callback:function(t){e.$set(e.formData,"manHourCost",t)},expression:"formData.manHourCost"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"材料费合计(元)",prop:"cost"}},[a("el-input",{attrs:{placeholder:"请输入材料费合计(元)",readonly:""},model:{value:e.formData.cost,callback:function(t){e.$set(e.formData,"cost",t)},expression:"formData.cost"}})],1)],1),e._v(" "),a("el-divider",{attrs:{"content-position":"left"}},[e._v("保养情况")]),e._v(" "),a("el-form-item",{attrs:{label:"",required:""}},[a("div",{staticClass:"sys-operate"},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.chooseVisible=!0}}},[e._v("选择保养项目")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.removeProject()}}},[e._v("删除")])],1),e._v(" "),a("el-table",{attrs:{data:e.projects,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"},border:""},on:{"selection-change":e.handleProjectChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"name",label:"保养项目"}}),e._v(" "),a("el-table-column",{attrs:{prop:"function",label:"保养方法","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"manhour",label:"保养工时(小时)*","min-width":"110"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,size:"small","controls-position":"right"},model:{value:t.row.manhour,callback:function(a){e.$set(t.row,"manhour",a)},expression:"scope.row.manhour"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"manHourCost",label:"保养工时费(元)*","min-width":"110"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,size:"small","controls-position":"right"},model:{value:t.row.manHourCost,callback:function(a){e.$set(t.row,"manHourCost",a)},expression:"scope.row.manHourCost"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"result",label:"保养结果*",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-radio",{attrs:{label:"1"},model:{value:t.row.result,callback:function(a){e.$set(t.row,"result",a)},expression:"scope.row.result"}},[e._v("正常")]),e._v(" "),a("el-radio",{attrs:{label:"0"},model:{value:t.row.result,callback:function(a){e.$set(t.row,"result",a)},expression:"scope.row.result"}},[e._v("异常")])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"remark",label:"保养备注"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{size:"small","controls-position":"right"},model:{value:t.row.remark,callback:function(a){e.$set(t.row,"remark",a)},expression:"scope.row.remark"}})]}}])})],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"保养总结"}},[a("el-input",{attrs:{type:"textarea",autosize:{minRows:4},placeholder:"请简要填写保养总结"},model:{value:e.formData.content,callback:function(t){e.$set(e.formData,"content",t)},expression:"formData.content"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"使用备件"}},[a("div",{staticClass:"sys-operate"},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.choosePartsVisible=!0}}},[e._v("选择备件")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.removePart()}}},[e._v("删除")])],1),e._v(" "),a("el-table",{attrs:{data:e.parts,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"},border:""},on:{"selection-change":e.handlePartChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"serialNo",label:"备件编号",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"name",width:"200",align:"center","show-overflow-tooltip":"",label:"备件名称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"specification",align:"center","show-overflow-tooltip":"",label:"备件型号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"num",align:"center",width:"120",label:"使用数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,size:"small","controls-position":"right"},model:{value:t.row.num,callback:function(a){e.$set(t.row,"num",a)},expression:"scope.row.num"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"salePrice",align:"center",width:"120",label:"单价(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,size:"small","controls-position":"right"},model:{value:t.row.salePrice,callback:function(a){e.$set(t.row,"salePrice",a)},expression:"scope.row.salePrice"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"金额(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(e.setTotal(t.row)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"unitUomName",align:"center",label:"单位"}}),e._v(" "),a("el-table-column",{attrs:{prop:"remark","show-overflow-tooltipalign":"",label:"备注"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{size:"small","controls-position":"right"},model:{value:t.row.remark,callback:function(a){e.$set(t.row,"remark",a)},expression:"scope.row.remark"}})]}}])})],1)],1)],1)],1),e._v(" "),a("ChooseParts",{attrs:{visible:e.choosePartsVisible},on:{"update:visible":function(t){e.choosePartsVisible=t},change:e.getPart}}),e._v(" "),a("ChoosePlan",{attrs:{visible:e.choosePlanVisible},on:{"update:visible":function(t){e.choosePlanVisible=t},change:e.getPlan}}),e._v(" "),a("ChooseDevices",{attrs:{visible:e.chooseDevicesVisible},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("ChooseProjects",{attrs:{visible:e.chooseVisible},on:{"update:visible":function(t){e.chooseVisible=t},change:e.getProject}})],1)},staticRenderFns:[]};var C=a("VU/8")($,w,!1,function(e){a("rJ/o"),a("7p1H")},"data-v-63eb0404",null);t.default=C.exports},"7p1H":function(e,t){},cXln:function(e,t,a){"use strict";var r=a("bzuE"),s={name:"ChooseProjects",props:{id:{type:String,default:""},visible:{type:Boolean,default:!1}},watch:{visible:function(e,t){e!==t&&(e&&this.initData(),this.innerVisible=e)},innerVisible:function(e,t){e!==t&&this.$emit("update:visible",e)}},data:function(){return{ruleForm:{name:[{required:!0,message:"请填写保养项目",trigger:"blur"}],function:[{required:!0,message:"请填写保养方法",trigger:"blur"}]},form:{code:"",deviceTepy:"",name:"",function:""},subsetList:[],subsetAll:[],subsetTotal:0,searchData_Subset:{pageno:1,pagesize:5},callBackData:[],innerVisible:this.visible,loading:!1,dialogLoading:!1,deviceType:[],addVisible:!1,config:r.a}},computed:{},methods:{clickRow:function(e){this.$refs.tb.toggleRowSelection(e)},initData:function(){var e=this;this.$api.dictAPI.getDictsByType("device_type").then(function(t){0===t.code&&(e.deviceType=t.datas)}),this.searchSubset()},searchSubset:function(e){var t=this;e&&(this.searchData_Subset.pageno=1),this.dialogLoading=!0,this.$api.upkeepPlanAPI.findProjects(this.searchData_Subset).then(function(e){console.log(e),t.dialogLoading=!1,0===e.code&&(t.subsetList=e.data?e.data.datas:[],t.subsetTotal=e.data?e.data.totalRows:0)})},addProject:function(){this.form={},this.addVisible=!0,this.resetFields()},save:function(e){var t=this;this.$refs[e].validate(function(e){if(!e)return!1;t.$api.upkeepPlanAPI.addProjects(t.form).then(function(e){0===e.code?(t.$message({message:e.msg,type:"success"}),t.addVisible=!1,t.searchSubset()):t.$message({message:e.msg,type:"error"})})})},ckSubsetAll:function(e){this.subsetAll=e},subsetSizeChange:function(e){this.searchData_Subset.pagesize=e,this.searchSubset()},subsetCurrentChange:function(e){this.searchData_Subset.pageno=e,this.searchSubset()},submit:function(e){var t=[];this.subsetAll.length>0&&this.subsetAll.forEach(function(e){t.push(e)}),console.log(t),this.$emit("change",t),this.innerVisible=!1},resetFields:function(){this.$refs.form&&this.$refs.form.resetFields()}}},o={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-dialog",{attrs:{center:"",title:"选择保养项目",visible:e.innerVisible,width:"900px"},on:{"update:visible":function(t){e.innerVisible=t}}},[a("div",[a("el-form",{attrs:{inline:""}},[a("el-form-item",{attrs:{label:"保养项目"}},[a("el-input",{attrs:{placeholder:"保养项目"},model:{value:e.searchData_Subset.name,callback:function(t){e.$set(e.searchData_Subset,"name",t)},expression:"searchData_Subset.name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"保养方法"}},[a("el-input",{attrs:{placeholder:"保养方法"},model:{value:e.searchData_Subset.function,callback:function(t){e.$set(e.searchData_Subset,"function",t)},expression:"searchData_Subset.function"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"保养模板"}},[a("el-input",{attrs:{placeholder:"保养模板"},model:{value:e.searchData_Subset.bymb,callback:function(t){e.$set(e.searchData_Subset,"bymb",t)},expression:"searchData_Subset.bymb"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.searchSubset(1)}}},[e._v("查询")])],1)],1)],1),e._v(" "),a("div",{staticClass:"sys-table"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.dialogLoading,expression:"dialogLoading"}],ref:"tb",attrs:{data:e.subsetList,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}},on:{"row-click":e.clickRow,"selection-change":e.ckSubsetAll}},[a("el-table-column",{attrs:{type:"selection",width:"50",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"name",label:"保养项目",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"function","show-overflow-tooltip":"",label:"保养方法",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"bymb",label:"保养模板",align:"center"}})],1)],1),e._v(" "),a("div",{staticClass:"sys-pagination"},[a("el-pagination",{attrs:{"current-page":e.searchData_Subset.pageno,"page-sizes":[5,10,20,50,100],"page-size":e.searchData_Subset.pagesize,layout:"total, sizes, prev, pager, next, jumper",total:e.subsetTotal},on:{"update:currentPage":function(t){return e.$set(e.searchData_Subset,"pageno",t)},"update:current-page":function(t){return e.$set(e.searchData_Subset,"pageno",t)},"size-change":e.subsetSizeChange,"current-change":e.subsetCurrentChange}})],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary",loading:e.loading},on:{click:function(t){return e.submit()}}},[e._v("确定")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.innerVisible=!1}}},[e._v(e._s(e.config.cancelText))]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.addProject()}}},[e._v("增加项目")])],1)]),e._v(" "),a("el-dialog",{attrs:{center:"",title:"添加保养项目",visible:e.addVisible,width:"600px"},on:{"update:visible":function(t){e.addVisible=t}}},[a("el-form",{ref:"form",attrs:{"label-width":"90px",model:e.form,rules:e.ruleForm}},[a("el-form-item",{attrs:{label:"编号"}},[a("el-input",{attrs:{placeholder:"请填写编号"},model:{value:e.form.code,callback:function(t){e.$set(e.form,"code",t)},expression:"form.code"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"保养项目",prop:"name"}},[a("el-input",{attrs:{placeholder:"请填写保养项目"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"保养模板",prop:"bymb"}},[a("el-input",{attrs:{placeholder:"请填写保养模板"},model:{value:e.form.bymb,callback:function(t){e.$set(e.form,"bymb",t)},expression:"form.bymb"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"保养方法",prop:"function"}},[a("el-input",{attrs:{placeholder:"请填写保养方法",autosize:{minRows:4},type:"textarea"},model:{value:e.form.function,callback:function(t){e.$set(e.form,"function",t)},expression:"form.function"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.save("form")}}},[e._v("保存")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.addVisible=!1}}},[e._v(e._s(e.config.cancelText))])],1)],1)],1)},staticRenderFns:[]},i=a("VU/8")(s,o,!1,null,null,null);t.a=i.exports},"rJ/o":function(e,t){}}); |