Your Name
2022-10-25 df7046445cfdb39857f9fe1dc747ab04a61c860e
1
(this.webpackJsonp=this.webpackJsonp||[]).push([["chunk-5fb9"],{"HJ/K":function(e,r,t){"use strict";var o=t("Sl1c");t.n(o).a},Pl8i:function(e,r,t){"use strict";t.r(r);var o=t("cLjf"),a=t.n(o),i=t("YReu"),l=t.n(i),s=t("omC7"),n=t.n(s),m=t("hDQ3"),c=t.n(m),p=t("3sVZ"),u={name:"hoistForm",components:{},props:["workerList"],data:function(){return{form:{operatorUids:[],workType:3,workLevel:null,workContent:"",workLocation:"",workDetail:{hoistingToolName:"",weightMass:null},workTimeLine:[],expStartTime:"",hazardIdentification:"",expEndTime:""},workLevelList:[{label:"一级吊装作业",value:8},{label:"二级吊装作业",value:9},{label:"三级吊装作业",value:10}],applyRules:{operatorUids:[{required:!0,message:"该内容不能为空",trigger:"change"}],workType:[{required:!0,message:"该内容不能为空",trigger:"blur"}],workLevel:[{required:!0,message:"该内容不能为空",trigger:"change"}],workContent:[{required:!0,message:"该内容不能为空",trigger:"blur"}],hazardIdentification:[{required:!0,message:"该内容不能为空",trigger:"blur"}],workLocation:[{required:!0,message:"该内容不能为空",trigger:"blur"}],workTimeLine:[{required:!0,message:"该内容不能为空",trigger:"blur"}],"workDetail.hoistingToolName":[{required:!0,message:"该内容不能为空",trigger:"blur"}],"workDetail.weightMass":[{required:!0,message:"该内容不能为空",trigger:"blur"}]}}},methods:{submitForm:function(e){var r=this;this.$refs.ruleFormRef.validate(function(){var e=c()(a.a.mark(function e(t,o){var i,s,m;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=11;break}return r.form.expStartTime=JSON.parse(n()(r.form.workTimeLine))[0],r.form.expEndTime=JSON.parse(n()(r.form.workTimeLine))[1],i=JSON.parse(n()(r.form)),i.workTimeLine,(s=l()(i,["workTimeLine"])).workDetail.weightMass=Number(s.workDetail.weightMass),e.next=7,Object(p.a)().postHoistApply(s);case 7:"200"===(m=e.sent).data.code?(r.$message({type:"success",message:"提交成功!"}),r.$refs.ruleFormRef.clearValidate(),r.form={operatorUids:[],workType:3,workLevel:null,workContent:"",workLocation:"",workDetail:{hoistingToolName:"",weightMass:null},workTimeLine:[],expStartTime:"",hazardIdentification:"",expEndTime:""}):r.$message({type:"warning",message:m.data.msg}),e.next=12;break;case 11:console.log("error submit!",o);case 12:case"end":return e.stop()}},e,r)}));return function(r,t){return e.apply(this,arguments)}}())}}},f=(t("HJ/K"),t("ZrdR")),d=Object(f.a)(u,function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("div",{staticClass:"home-container"},[t("div",{staticStyle:{height:"100%"}},[t("el-form",{ref:"ruleFormRef",attrs:{model:e.form,"label-width":"150px",rules:e.applyRules}},[t("div",{staticClass:"homeCard"},[t("el-row",[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"作业人",prop:"operatorUids"}},[t("el-select",{attrs:{multiple:""},model:{value:e.form.operatorUids,callback:function(r){e.$set(e.form,"operatorUids",r)},expression:"form.operatorUids"}},e._l(e.workerList,function(e){return t("el-option",{key:e.id,attrs:{label:e.realname+"("+e.username.toString().replace(/^(\d{3})\d{4}(\d{4})$/,"$1****$2")+")",value:e.id}})}))],1)],1),e._v(" "),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"作业等级",prop:"workLevel"}},[t("el-select",{model:{value:e.form.workLevel,callback:function(r){e.$set(e.form,"workLevel",r)},expression:"form.workLevel"}},e._l(e.workLevelList,function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1)],1)],1),e._v(" "),t("el-row",[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"危险辨识",prop:"hazardIdentification"}},[t("el-input",{attrs:{autosize:"",type:"textarea",placeholder:"请输入危险辨识"},model:{value:e.form.hazardIdentification,callback:function(r){e.$set(e.form,"hazardIdentification",r)},expression:"form.hazardIdentification"}})],1)],1),e._v(" "),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"作业时间",prop:"workTimeLine"}},[t("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd HH:mm:ss",type:"datetimerange","range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间"},model:{value:e.form.workTimeLine,callback:function(r){e.$set(e.form,"workTimeLine",r)},expression:"form.workTimeLine"}})],1)],1)],1),e._v(" "),t("el-row",[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"作业内容",prop:"workContent"}},[t("el-input",{attrs:{autosize:"",type:"textarea",placeholder:"请输入作业内容"},model:{value:e.form.workContent,callback:function(r){e.$set(e.form,"workContent",r)},expression:"form.workContent"}})],1)],1),e._v(" "),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"作业地址",prop:"workLocation"}},[t("el-input",{attrs:{autosize:"",type:"textarea",placeholder:"请输入作业地址"},model:{value:e.form.workLocation,callback:function(r){e.$set(e.form,"workLocation",r)},expression:"form.workLocation"}})],1)],1)],1),e._v(" "),t("el-row",[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"吊装工具名称",prop:"workDetail.hoistingToolName"}},[t("el-input",{attrs:{autosize:"",type:"textarea",placeholder:"请输入"},model:{value:e.form.workDetail.hoistingToolName,callback:function(r){e.$set(e.form.workDetail,"hoistingToolName",r)},expression:"form.workDetail.hoistingToolName"}})],1)],1),e._v(" "),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"起吊物体质量",prop:"workDetail.weightMass"}},[t("el-input",{attrs:{type:"number",placeholder:"请输入"},model:{value:e.form.workDetail.weightMass,callback:function(r){e.$set(e.form.workDetail,"weightMass",r)},expression:"form.workDetail.weightMass"}},[[e._v("吨(t)")]],2)],1)],1)],1)],1)]),e._v(" "),t("div",{staticClass:"applyBtn"},[t("el-button",{attrs:{type:"primary",size:"large",plain:""},on:{click:function(r){e.submitForm()}}},[e._v("发起申请")])],1)],1)])},[],!1,null,"6edae804",null);d.options.__file="hoist.vue";r.default=d.exports},Sl1c:function(e,r,t){},YReu:function(e,r,t){"use strict";r.__esModule=!0,r.default=function(e,r){var t={};for(var o in e)r.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}}}]);