(this.webpackJsonp=this.webpackJsonp||[]).push([["chunk-1572"],{"9NYO":function(e,t,a){},NklB:function(e,t,a){},OO5O:function(e,t,a){"use strict";var r=a("9NYO");a.n(r).a},SGJW:function(e,t,a){"use strict";var r=a("NklB");a.n(r).a},YReu:function(e,t,a){"use strict";t.__esModule=!0,t.default=function(e,t){var a={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(a[r]=e[r]);return a}},a4YA:function(e,t,a){"use strict";a.r(t);var r=a("cLjf"),o=a.n(r),l=a("YReu"),i=a.n(l),s=a("omC7"),n=a.n(s),c=a("hDQ3"),p=a.n(c),u=a("jJIE"),m=a.n(u),d=a("3sVZ"),f={name:"groundForm",components:{},props:["workerList","departList"],data:function(){return{fileRoad:"http://222.92.213.22:8006/zhongtai/task/web/upload",uploadForm:{},header:{Authorization:""},fileList:[],disabled:!1,form:{operatorUids:[],workType:4,workLevel:0,workContent:"",workLocation:"",workDetail:{operationDepId:null,gbScope:"",gbMethod:"",gbPath:[],otherSpecialWork:[]},workTimeLine:[],expStartTime:"",expEndTime:""},imgLimit:5,uploadUrl:"",dialogVisible:!1,dialogImageUrl:null,csDepList:[{label:"单位一",value:1},{label:"单位二",value:2},{label:"单位三",value:3},{label:"单位四",value:4},{label:"单位五",value:5},{label:"单位六",value:6}],otherWorkList:[{label:"动火作业",value:1},{label:"受限空间作业",value:2},{label:"吊装作业",value:3},{label:"动土作业",value:4},{label:"断路作业",value:5},{label:"高处作业",value:6},{label:"临时用电作业",value:7},{label:"盲板抽堵作业",value:8}],applyRules:{operatorUids:[{required:!0,message:"该内容不能为空",trigger:"change"}],workType:[{required:!0,message:"该内容不能为空",trigger:"blur"}],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.operationDepId":[{required:!0,message:"该内容不能为空",trigger:"blur"}],"workDetail.gbScope":[{required:!0,message:"该内容不能为空",trigger:"blur"}],"workDetail.gbMethod":[{required:!0,message:"该内容不能为空",trigger:"blur"}],"workDetail.gbPath":[{required:!0,message:"该内容不能为空",trigger:"blur"}]}}},methods:{submitForm:function(){var e=this;this.$refs.ruleFormRef.validate(function(){var t=p()(o.a.mark(function t(a,r){var l,s,c;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!a){t.next=12;break}return e.form.expStartTime=JSON.parse(n()(e.form.workTimeLine))[0],e.form.expEndTime=JSON.parse(n()(e.form.workTimeLine))[1],l=JSON.parse(n()(e.form)),l.workTimeLine,(s=i()(l,["workTimeLine"])).workDetail.otherSpecialWork=s.workDetail.otherSpecialWork.join(","),s.workDetail.gbPath=n()(e.fileList.map(function(e){return e.url.substring("http://222.92.213.22:8006/zhongtai/upload/".length)})),t.next=8,Object(d.a)().postGroundApply(s);case 8:"200"===(c=t.sent).data.code?(e.$message({type:"success",message:"提交成功!"}),e.$refs.ruleFormRef.clearValidate(),e.form={operatorUids:[],workType:2,workLevel:0,workContent:"",workLocation:"",workDetail:{csDepId:null,csName:"",csOriginalName:"",otherSpecialWork:[]},workTimeLine:[],expStartTime:"",hazardIdentification:"",expEndTime:""},e.fileList=[]):e.$message({type:"warning",message:c.data.msg}),t.next=13;break;case 12:console.log("error submit!",r);case 13:case"end":return t.stop()}},t,e)}));return function(e,a){return t.apply(this,arguments)}}())},handleChangeFile:function(){this.header.Authorization=m.a.get("token")},onFileSuccess:function(e){"200"===e.code?(this.fileList.push({url:"http://222.92.213.22:8006/zhongtai/upload/"+e.result.path}),this.$notify({type:"success",duration:2e3,message:"上传成功",title:"成功"})):this.$message({message:res.data.message,type:"warning"})},handleFile:function(e){this.dialogImageUrl=e.url,this.dialogVisible=!0},showImg:function(e){window.open(e,"_blank")},handleRemove:function(e,t){var a=this;return this.$confirm("确定移除 "+e.uid+"?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){a.fileList.splice(t,1)})}}},k=(a("OO5O"),a("SGJW"),a("ZrdR")),g=Object(k.a)(f,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"home-container"},[a("div",{staticStyle:{height:"100%"}},[a("el-form",{ref:"ruleFormRef",attrs:{model:e.form,"label-width":"150px",rules:e.applyRules}},[a("div",{staticClass:"homeCard"},[a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"作业人",prop:"operatorUids"}},[a("el-select",{attrs:{multiple:""},model:{value:e.form.operatorUids,callback:function(t){e.$set(e.form,"operatorUids",t)},expression:"form.operatorUids"}},e._l(e.workerList,function(e){return a("el-option",{key:e.id,attrs:{label:e.realname,value:e.id}})}))],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"作业内容",prop:"workContent"}},[a("el-input",{attrs:{autosize:"",type:"textarea",placeholder:"请输入作业内容"},model:{value:e.form.workContent,callback:function(t){e.$set(e.form,"workContent",t)},expression:"form.workContent"}})],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"作业时间",prop:"workTimeLine"}},[a("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(t){e.$set(e.form,"workTimeLine",t)},expression:"form.workTimeLine"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"作业地址",prop:"workLocation"}},[a("el-input",{attrs:{autosize:"",type:"textarea",placeholder:"请输入作业地址"},model:{value:e.form.workLocation,callback:function(t){e.$set(e.form,"workLocation",t)},expression:"form.workLocation"}})],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"作业单位",prop:"workDetail.operationDepId"}},[a("el-select",{model:{value:e.form.workDetail.operationDepId,callback:function(t){e.$set(e.form.workDetail,"operationDepId",t)},expression:"form.workDetail.operationDepId"}},e._l(e.departList,function(e){return a("el-option",{key:e.id,attrs:{label:e.department,value:e.id}})}))],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"范围",prop:"workDetail.gbScope"}},[a("el-input",{attrs:{autosize:"",type:"textarea",placeholder:"请输入"},model:{value:e.form.workDetail.gbScope,callback:function(t){e.$set(e.form.workDetail,"gbScope",t)},expression:"form.workDetail.gbScope"}})],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"动土方式",prop:"workDetail.gbMethod"}},[a("el-input",{attrs:{autosize:"",type:"textarea",placeholder:"请输入"},model:{value:e.form.workDetail.gbMethod,callback:function(t){e.$set(e.form.workDetail,"gbMethod",t)},expression:"form.workDetail.gbMethod"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"危险辨识",prop:"hazardIdentification"}},[a("el-input",{attrs:{autosize:"",type:"textarea",placeholder:"请输入危险辨识"},model:{value:e.form.hazardIdentification,callback:function(t){e.$set(e.form,"hazardIdentification",t)},expression:"form.hazardIdentification"}})],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"关联作业",prop:"workDetail.otherSpecialWork"}},[a("el-select",{attrs:{multiple:""},model:{value:e.form.workDetail.otherSpecialWork,callback:function(t){e.$set(e.form.workDetail,"otherSpecialWork",t)},expression:"form.workDetail.otherSpecialWork"}},e._l(e.otherWorkList,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{xs:24,sm:24,md:24,lg:24,xl:24}},[a("el-form-item",{attrs:{label:"隐患上报图",prop:"img"}},[a("el-upload",{ref:"upload",staticClass:"upload-demo",attrs:{accept:".pdf,.jpg,.png",action:e.fileRoad,headers:e.header,data:e.uploadForm,"list-type":"picture-card","file-list":e.fileList,"on-change":e.handleChangeFile,"on-success":e.onFileSuccess,multiple:!1,"auto-upload":!0},scopedSlots:e._u([{key:"file",fn:function(t){var r=t.file;return a("div",{},[a("img",{staticClass:"el-upload-list__item-thumbnail",attrs:{src:r.url,alt:""}}),e._v(" "),a("span",{staticClass:"el-upload-list__item-actions"},[a("span",{staticClass:"el-upload-list__item-preview",on:{click:function(t){e.handleFile(r)}}},[a("i",{staticClass:"el-icon-zoom-in"})]),e._v(" "),e.disabled?e._e():a("span",{staticClass:"el-upload-list__item-delete",on:{click:function(t){e.handleRemove(r,r.$index)}}},[a("i",{staticClass:"el-icon-delete"})])])])}}]),model:{value:e.form.workDetail.gbPath,callback:function(t){e.$set(e.form.workDetail,"gbPath",t)},expression:"form.workDetail.gbPath"}},[a("i",{staticClass:"el-icon-plus",attrs:{slot:"default"},slot:"default"})])],1)],1)],1)],1)]),e._v(" "),a("div",{staticClass:"applyBtn"},[a("el-button",{attrs:{type:"primary",size:"large",plain:""},on:{click:function(t){e.submitForm()}}},[e._v("发起申请")])],1)],1),e._v(" "),a("el-dialog",{model:{value:e.dialogVisible,callback:function(t){e.dialogVisible=t},expression:"dialogVisible"}},[a("img",{attrs:{"w-full":"",src:e.dialogImageUrl,alt:"Preview Image"}})])],1)},[],!1,null,"9248f9d8",null);g.options.__file="ground.vue";t.default=g.exports}}]);
|