chunk-c58f40fe.aedde24b.js 10 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c58f40fe"],{"3f93":function(e,a,r){"use strict";r.r(a);var t=function(){var e=this,a=e.$createElement,r=e._self._c||a;return r("div",{staticClass:"container"},[r("Header",{attrs:{title:"隐患上报"}}),r("div",{staticClass:"main"},[r("Uploader",{attrs:{title:"隐患照片",verify:!0},model:{value:e.addForm.fileList,callback:function(a){e.$set(e.addForm,"fileList",a)},expression:"addForm.fileList"}}),r("Time",{attrs:{title:"发现时间",verify:!0},model:{value:e.addForm.registTime,callback:function(a){e.$set(e.addForm,"registTime",a)},expression:"addForm.registTime"}}),r("Input",{attrs:{title:"隐患名称",verify:!0},model:{value:e.addForm.dangerName,callback:function(a){e.$set(e.addForm,"dangerName",a)},expression:"addForm.dangerName"}}),r("Input",{attrs:{title:"隐患描述",verify:!1},model:{value:e.dangerDesc,callback:function(a){e.dangerDesc=a},expression:"dangerDesc"}}),r("Select",{attrs:{verify:!0,title:"所在区域",options:e.getAreaTree},model:{value:e.addForm.areaId,callback:function(a){e.$set(e.addForm,"areaId",a)},expression:"addForm.areaId"}}),r("Select",{attrs:{verify:!0,title:"隐患来源",options:e.dangerSrcList},model:{value:e.addForm.dangerSrc,callback:function(a){e.$set(e.addForm,"dangerSrc",a)},expression:"addForm.dangerSrc"}}),r("Select",{attrs:{verify:!0,title:"隐患类型",options:e.dangerTypeList},model:{value:e.addForm.hazardDangerType,callback:function(a){e.$set(e.addForm,"hazardDangerType",a)},expression:"addForm.hazardDangerType"}}),r("Radio",{attrs:{verify:!0,title:"隐患等级",option:e.dangerLevelOptions},model:{value:e.addForm.dangerLevel,callback:function(a){e.$set(e.addForm,"dangerLevel",a)},expression:"addForm.dangerLevel"}}),r("Radio",{attrs:{verify:!0,title:"治理类型",option:e.dangerManageTypeOptions},model:{value:e.addForm.dangerManageType,callback:function(a){e.$set(e.addForm,"dangerManageType",a)},expression:"addForm.dangerManageType"}}),r("Input",{attrs:{title:"任务名称",verify:!1},model:{value:e.controlMeasures,callback:function(a){e.controlMeasures=a},expression:"controlMeasures"}}),r("p",{staticClass:"textTitle"},[e._v("整改信息")]),r("Select",{attrs:{verify:!0,title:"整改部门",options:e.getDeptTree},model:{value:e.addForm.deptId,callback:function(a){e.$set(e.addForm,"deptId",a)},expression:"addForm.deptId"}}),r("Select",{attrs:{verify:!0,title:"整改负责人",options:e.getDeptUserTree},model:{value:e.addForm.manageUserId,callback:function(a){e.$set(e.addForm,"manageUserId",a)},expression:"addForm.manageUserId"}}),r("Time",{attrs:{title:"整改期限",verify:!0},model:{value:e.addForm.dangerManageDeaddline,callback:function(a){e.$set(e.addForm,"dangerManageDeaddline",a)},expression:"addForm.dangerManageDeaddline"}}),r("Input",{attrs:{title:"整改建议",verify:!1},model:{value:e.suggest,callback:function(a){e.suggest=a},expression:"suggest"}}),r("van-button",{staticStyle:{"margin-top":"15px"},attrs:{type:"primary"},on:{click:e.add}},[e._v("提交")])],1)],1)},n=[],d=(r("d3b7"),r("ac1f"),r("466d"),r("1276"),r("5cc6"),r("9a8c"),r("a975"),r("735e"),r("c1ac"),r("d139"),r("3a7b"),r("d5d6"),r("82f8"),r("e91f"),r("60bd"),r("5f96"),r("3280"),r("3fcc"),r("ca91"),r("25a1"),r("cd26"),r("3c5d"),r("2954"),r("649e"),r("219c"),r("170b"),r("b39a"),r("72f7"),r("96cf"),r("1da1")),o=r("5530"),s=r("668b"),i=r("2f62"),c=r("3e48"),m={name:"Vueh5CbsAddDanger",computed:Object(o["a"])({},Object(i["b"])("baseUrl",["baseUrl"]),{},Object(i["b"])("dangerList",["dangerSrcList","dangerTypeList","getAreaTree","getDeptTree","getDeptUserTree"])),data:function(){return{dangerImage:"",dangerDesc:"",controlMeasures:"",suggest:"",addForm:{fileList:[],registTime:"",dangerName:"",areaId:"",dangerLevel:0,dangerSrc:"",hazardDangerType:"",dangerManageType:0,deptId:"",manageUserId:"",dangerManageDeaddline:""},itemForm:{},dangerManageTypeOptions:[{name:"即查即改",id:0},{name:"限期整改",id:1}],dangerLevelOptions:[{name:"一般隐患",id:0},{name:"重大隐患",id:1}]}},created:function(){var e=this;console.log(this.getAreaTree),this.$route.params.id&&(this.addForm.areaId=this.$route.params.id),this.$route.query.id&&Object(c["h"])(this.$route.query.id).then((function(a){var r=a.data;if(200===r.code){e.itemForm=r.data,e.dangerDesc=r.data.dangerDesc,e.controlMeasures=r.data.controlMeasures,e.suggest=r.data.suggest,e.addForm.registTime=r.data.registTime,e.addForm.dangerName=r.data.dangerName,e.addForm.areaId=r.data.areaId,e.addForm.dangerLevel=r.data.dangerLevel,e.addForm.dangerSrc=r.data.dangerSrc,e.addForm.hazardDangerType=r.data.hazardDangerType,e.addForm.deptId=r.data.deptId,e.addForm.dangerManageType=r.data.dangerManageType,e.addForm.manageUserId=r.data.manageUserId,e.addForm.dangerManageDeaddline=r.data.dangerManageDeaddline,console.log(r.data.dangerImage.split(",,"));var t=r.data.dangerImage.split(",,");e.toBase(t),console.log(e.addForm)}}))},methods:{toBase:function(e){var a=this;return Object(d["a"])(regeneratorRuntime.mark((function r(){var t,n,d,o,i,m,g,l,u;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:t=!0,n=!1,r.prev=2,o=Object(s["a"])(e);case 4:return r.next=6,o.next();case 6:return i=r.sent,t=i.done,r.next=10,i.value;case 10:if(m=r.sent,t){r.next=27;break}return g=m,r.next=15,Object(c["c"])({url:g});case 15:if(l=r.sent,u=l.data,console.log(u),200!==u.code){r.next=22;break}a.addForm.fileList.push({content:u.msg,file:""}),r.next=24;break;case 22:return a.$notify({type:"danger",message:u.msg,duration:1e3}),r.abrupt("return");case 24:t=!0,r.next=4;break;case 27:r.next=33;break;case 29:r.prev=29,r.t0=r["catch"](2),n=!0,d=r.t0;case 33:if(r.prev=33,r.prev=34,t||null==o.return){r.next=38;break}return r.next=38,o.return();case 38:if(r.prev=38,!n){r.next=41;break}throw d;case 41:return r.finish(38);case 42:return r.finish(33);case 43:case"end":return r.stop()}}),r,null,[[2,29,33,43],[34,,38,42]])})))()},dataURLtoBlob:function(e){var a=e.split(","),r=a[0].match(/:(.*?);/)[1],t=window.atob(a[1]),n=t.length,d=new Uint8Array(n);while(n--)d[n]=t.charCodeAt(n);return new Blob([d],{type:r})},add:function(){var e=this;return Object(d["a"])(regeneratorRuntime.mark((function a(){var r,t,n,d,i,m,g,l,u,p,f,F;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(console.log(e.addForm),!0!==e.$examine(e.addForm)){a.next=54;break}e.dangerImage="",console.log("可以提交",e.addForm),r=!0,t=!1,a.prev=6,d=Object(s["a"])(e.addForm.fileList);case 8:return a.next=10,d.next();case 10:return i=a.sent,r=i.done,a.next=14,i.value;case 14:if(m=a.sent,r){a.next=35;break}return g=m,l=new window.File([e.dataURLtoBlob(g.content)],"图片.jpg",{type:"jpg"}),console.log(g.file),u=new FormData,u.append("file",l),a.next=23,Object(c["p"])(u);case 23:if(p=a.sent,f=p.data,console.log(f),200!==f.code){a.next=30;break}e.dangerImage?e.dangerImage+=",,"+f.fileName:e.dangerImage+=f.fileName,a.next=32;break;case 30:return e.$notify({type:"danger",message:f.msg,duration:1e3}),a.abrupt("return");case 32:r=!0,a.next=8;break;case 35:a.next=41;break;case 37:a.prev=37,a.t0=a["catch"](6),t=!0,n=a.t0;case 41:if(a.prev=41,a.prev=42,r||null==d.return){a.next=46;break}return a.next=46,d.return();case 46:if(a.prev=46,!t){a.next=49;break}throw n;case 49:return a.finish(46);case 50:return a.finish(41);case 51:e.$route.query.id?(e.itemForm.dangerDesc=e.dangerDesc,e.itemForm.controlMeasures=e.controlMeasures,e.itemForm.suggest=e.suggest,e.itemForm.registTime=e.addForm.registTime,e.itemForm.dangerName=e.addForm.dangerName,e.itemForm.areaId=e.addForm.areaId,e.itemForm.dangerLevel=e.addForm.dangerLevel,e.itemForm.dangerSrc=e.addForm.dangerSrc,e.itemForm.hazardDangerType=e.addForm.hazardDangerType,e.itemForm.deptId=e.addForm.deptId,e.itemForm.dangerManageType=e.addForm.dangerManageType,e.itemForm.manageUserId=e.addForm.manageUserId,e.itemForm.dangerManageDeaddline=e.addForm.dangerManageDeaddline,e.itemForm.dangerImage=e.dangerImage,Object(c["e"])(e.itemForm).then((function(a){var r=a.data;200===r.code&&(e.$notify({type:"success",message:r.msg,duration:1e3}),e.$router.go(-1))}))):Object(c["a"])({areaId:e.addForm.areaId,controlMeasures:e.controlMeasures,dangerDesc:e.dangerDesc,dangerImage:e.dangerImage,dangerLevel:e.addForm.dangerLevel,dangerManageDeaddline:e.addForm.dangerManageDeaddline,dangerManageType:e.addForm.dangerManageType,dangerName:e.addForm.dangerName,dangerSrc:e.addForm.dangerSrc,deptId:e.addForm.deptId,hazardDangerType:e.addForm.hazardDangerType,manageUserId:e.addForm.manageUserId,registTime:e.addForm.registTime,suggest:e.suggest}).then((function(a){var r=a.data;200===r.code&&(e.$notify({type:"success",message:r.msg,duration:1e3}),e.$router.go(-1))})),a.next=57;break;case 54:F=e.$examine(e.addForm),e.addForm=Object(o["a"])({},F[0]),setTimeout((function(){e.addForm=Object(o["a"])({},F[1]),console.log(e.addForm.manageUserId)}),0);case 57:case"end":return a.stop()}}),a,null,[[6,37,41,51],[42,,46,50]])})))()}}},g=m,l=(r("a13b"),r("2877")),u=Object(l["a"])(g,t,n,!1,null,"8172798a",null);a["default"]=u.exports},"668b":function(e,a,r){"use strict";r.d(a,"a",(function(){return t}));r("a4d3"),r("e01a"),r("b636"),r("d28b"),r("e260"),r("d3b7"),r("e6cf"),r("3ca3"),r("ddb0");function t(e){var a,r,t,d=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,t=Symbol.iterator);d--;){if(r&&null!=(a=e[r]))return a.call(e);if(t&&null!=(a=e[t]))return new n(a.call(e));r="@@asyncIterator",t="@@iterator"}throw new TypeError("Object is not async iterable")}function n(e){function a(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var a=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:a}}))}return n=function(e){this.s=e,this.n=e.next},n.prototype={s:null,n:null,next:function(){return a(this.n.apply(this.s,arguments))},return:function(e){var r=this.s["return"];return void 0===r?Promise.resolve({value:e,done:!0}):a(r.apply(this.s,arguments))},throw:function(e){var r=this.s["return"];return void 0===r?Promise.reject(e):a(r.apply(this.s,arguments))}},new n(e)}},a13b:function(e,a,r){"use strict";var t=r("d115"),n=r.n(t);n.a},b636:function(e,a,r){var t=r("e065");t("asyncIterator")},d115:function(e,a,r){}}]);