chunk-645fe493.9eca36fd.js 9.4 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-645fe493"],{"0870":function(t,e,a){"use strict";a("67dd")},"09bb":function(t,e,a){"use strict";a.d(e,"b",(function(){return i})),a.d(e,"a",(function(){return o}));var n=a("f0e1");function i(t){return Object(n["a"])({url:"qiniu/token",method:"get",params:t})}function o(t){return Object(n["a"])({url:"send_verify_code",method:"get",params:t})}},"18da":function(t,e,a){},"1ae6":function(t,e,a){"use strict";var n=a("9c15"),i=a("9901").map,o=a("462a"),s=o("map");n({target:"Array",proto:!0,forced:!s},{map:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},"22b4":function(t,e,a){"use strict";var n,i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("van-field",{attrs:{readonly:"",border:t.border,label:t.label,placeholder:t.placeholder,disabled:t.disabled},scopedSlots:t._u([{key:"input",fn:function(){return[a("van-uploader",{attrs:{accept:t.accept,"before-read":t.beforeUpload,"after-read":t.afterRead,disabled:t.disabled,"show-upload":t.edit,deletable:t.edit},on:{delete:t.update},scopedSlots:t._u([{key:"preview-cover",fn:function(e){return[e.url&&"mp4"==e.url.split("/").pop().split(".").pop()?a("div",{staticClass:"\n w-full\n h-full\n overflow-hidden\n flex\n justify-center\n items-center\n "},[a("video",{staticClass:"min-w-full min-h-full",attrs:{src:e.url},on:{click:function(a){return t.videoPlay(e.url)}}},[t._v(" 您的浏览器不支持视频播放 ")])]):t._e()]}}]),model:{value:t.fileList,callback:function(e){t.fileList=e},expression:"fileList"}})]},proxy:!0}])}),t.videoShow?a("van-overlay",{staticClass:"flex justify-center items-center",attrs:{show:t.videoShow,"z-index":"1000"}},[a("video",{staticClass:"max-w-full max-h-full",attrs:{src:t.videoUrl,controls:""}},[t._v(" 您的浏览器不支持视频播放 ")]),a("i",{staticClass:"\n van-icon van-icon-clear\n van-image-preview__close-icon van-image-preview__close-icon--top-right\n ",attrs:{role:"button"},on:{click:function(e){t.videoShow=!1}}})]):t._e()],1)},o=[],s=(a("5ae2"),a("7ba3")),r=a("d696"),c=(a("fb38"),a("2ff1")),l=(a("878a"),a("8620")),d=(a("1ae6"),a("f8c2"),a("c08f"),a("09ed"),a("509f"),a("5456"),a("09bb")),u={name:"UploadList",components:(n={},Object(r["a"])(n,l["a"].name,l["a"]),Object(r["a"])(n,c["a"].name,c["a"]),n),props:{value:{type:Array,default:function(){return[]}},label:{type:String,default:""},placeholder:{type:String,default:""},accept:{type:String,default:"image/*"},disabled:{type:Boolean,default:!1},border:{type:Boolean,default:!1},edit:{type:Boolean,default:!0}},watch:{value:{deep:!0,imediate:!0,handler:function(t){this.fileList=t.map((function(t){return{url:t}}))}}},data:function(){return{dataObj:{},fileList:[],videoShow:!1,videoUrl:""}},created:function(){this.fileList=this.value.map((function(t){return{url:t}}))},methods:{videoPlay:function(t){this.videoUrl=t,this.videoShow=!0},beforeUpload:function(t){if("video/mp4"===t.type){if(t.size/1024/1024>30)return Object(s["a"])({type:"danger",message:"上传视频大小不能超过 30MB!"}),!1}else if(t.size/1024/1024>5)return Object(s["a"])({type:"danger",message:"上传图片大小不能超过 5MB!"}),!1;var e="";if(console.log(t.type),"image/png"===t.type)e="png";else if("image/jpeg"===t.type)e="jpg";else{if("video/mp4"!==t.type)return Object(s["a"])({type:"danger",message:"上传格式有误!"}),!1;e="mp4"}var a=this;return new Promise((function(n,i){Object(d["b"])({file_type:e}).then((function(e){var i=e.data.key,o=e.data.token;a._data.dataObj.token=o,a._data.dataObj.key=i,n(t)})).catch((function(t){console.log(t),i()}))}))},afterRead:function(t){var e=this;console.log(t),t.status="uploading",t.message="上传中...";var a=new FormData;a.append("file",t.file),Object.keys(this.dataObj).forEach((function(t){a.append(t,e.dataObj[t])})),this.$axios({method:"post",url:"https://upload.qiniup.com",data:a}).then((function(a){console.log(a),t.url=e.$store.getters.setting.img_host+a.data.key,t.status="done",t.message="上传成功",e.update()})).catch((function(){t.status="failed",t.message="上传失败",e.update()}))},update:function(){var t=this.fileList.filter((function(t){return!t.status||"done"==t.status})).map((function(t){return t.url}));this.$emit("input",t),console.log(t)}}},f=u,p=(a("0870"),a("cba8")),h=Object(p["a"])(f,i,o,!1,null,"af1cdf26",null);e["a"]=h.exports},"45b2":function(t,e,a){"use strict";a("18da")},5456:function(t,e,a){"use strict";var n=a("9c15"),i=a("9901").filter,o=a("462a"),s=o("filter");n({target:"Array",proto:!0,forced:!s},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},"67dd":function(t,e,a){},a3ad0:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.worksite.id?a("div",[a("van-nav-bar",{staticClass:"shadow mb-4",attrs:{title:"工地详情","left-text":"返回","left-arrow":""},on:{"click-left":function(e){return t.$router.back(-1)}}}),a("div",{staticClass:"shadow w-11/12 mx-auto"},[a("p",{staticClass:"bg-yellow-600 bg-opacity-80 text-white px-4 py-2"},[t._v("工地详情")]),a("div",{staticClass:"px-4 bg-white py-2 text-sm"},[a("div",{staticClass:"pb-1"},[a("span",{staticClass:"font-semibold"},[t._v("决算编号:")]),t._v(t._s(t.worksite.id)+" ")]),a("div",{staticClass:"pb-1"},[a("span",[a("span",{staticClass:"font-semibold",staticStyle:{"font-weight":"bold"}},[t._v(" 业主信息:")]),t._v(t._s(t.worksite.username))]),a("span",{staticClass:"text-gray-400"},[t._v(" "+t._s(t.worksite.phone))])]),a("div",{staticClass:"pb-1"},[a("span",{staticClass:"font-semibold"},[t._v("装修地址:")]),a("span",[t._v(t._s(t.worksite.address)+" "+t._s(t.worksite.village)+" "+t._s(t.worksite.room_no))]),t.worksite.area?a("span",{staticClass:"text-gray-400"},[t._v(" "+t._s(t.worksite.area)+"㎡")]):t._e()]),t.worksite.manager_id?a("div",{staticClass:"pb-1 flex items-center"},[a("span",{staticClass:"font-bold"},[t._v("项目经理:")]),a("span",{staticClass:"flex items-center"},[a("span",[t._v(t._s(t.worksite.manager_name))]),t.worksite.manager_phone?a("span",{staticClass:"flex items-center"},[t._v("("+t._s(t.worksite.manager_phone)+")"),a("a",{staticClass:"flex items-center",attrs:{href:"tel:"+t.worksite.manager_phone}},[a("van-icon",{attrs:{name:"phone",size:"22",color:"#009688"}})],1)]):t._e()])]):t._e()])]),a("van-cell-group",{staticClass:"shadow w-11/12 mx-auto mt-6"},t._l(t.tables,(function(e,n){return a("van-cell",{key:n,attrs:{title:e.name,"is-link":"",value:t.tableState[e.state],to:"/table/"+e.id}},[a("template",{slot:"label"},[0!=e.state?a("span",[t._v("合计金额: "+t._s(e.total))]):t._e()])],2)})),1)],1):t._e()},i=[],o=(a("e7ec"),a("5435")),s=a("d696"),r=a("da1a"),c=a("46e0"),l=a("ae79"),d=a("22b4"),u={components:{UploadList:d["a"]},data:function(){var t;return{id:0,worksite:{},worksiteState:{0:"待开工",1:"已开工",2:"已完工",3:"已停工"},tables:[],tableState:(t={},Object(s["a"])(t,-1,"已驳回"),Object(s["a"])(t,0,"待提交"),Object(s["a"])(t,1,"工程队长审核"),Object(s["a"])(t,2,"预审审核"),Object(s["a"])(t,3,"店长审核"),Object(s["a"])(t,4,"财务审核"),Object(s["a"])(t,5,"已完成"),t)}},created:function(){this.$route.params&&this.$route.params.id&&(this.id=this.$route.params.id),this.loadWorksite()},methods:{checkAuth:c["a"],dateFormat:l["a"],jsonArray:l["c"],start:function(){var t=this;o["a"].confirm({message:"确认开工吗"}).then((function(){t.$store.commit("loading/showLoading"),Object(r["workSiteStart"])(t.id).then((function(e){t.loadWorksite()})).catch((function(){t.$store.commit("loading/hideLoading")}))})).catch((function(){}))},loadWorksite:function(){var t=this;this.$store.commit("loading/showLoading"),Object(r["r"])(this.id).then((function(e){t.worksite=e.data,t.loadDispatchSiteTable()})).catch((function(){t.$store.commit("loading/hideLoading")}))},loadDispatchSiteTable:function(){var t=this;this.$store.commit("loading/showLoading"),Object(r["p"])({site_id:this.id}).then((function(e){t.$store.commit("loading/hideLoading"),t.tables=e.data.list})).catch((function(){t.$store.commit("loading/hideLoading")}))}}},f=u,p=(a("45b2"),a("cba8")),h=Object(p["a"])(f,n,i,!1,null,"4e890b82",null);e["default"]=h.exports},ae79:function(t,e,a){"use strict";a.d(e,"a",(function(){return n})),a.d(e,"b",(function(){return i})),a.d(e,"c",(function(){return o}));a("f8c2"),a("4d38"),a("d64c"),a("27d3"),a("a692"),a("a405"),a("3714"),a("5550"),a("5456"),a("c08f"),a("09ed");function n(t,e){var a,n={"Y+":e.getFullYear().toString(),"m+":(e.getMonth()+1).toString(),"d+":e.getDate().toString(),"H+":e.getHours().toString(),"M+":e.getMinutes().toString(),"S+":e.getSeconds().toString()};for(var i in n)a=new RegExp("("+i+")").exec(t),a&&(t=t.replace(a[1],1==a[1].length?n[i]:n[i].padStart(a[1].length,"0")));return t}function i(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=0,n=0,i=0;t>86400&&(a=Math.floor(t/86400),t%=86400),t>3600&&(n=Math.floor(t/3600),t%=3600),t>60&&(i=Math.floor(t/60),t%=60);var o=t+"秒";return(i>0||n>0||a>0)&&(o=i+"分"+(e?o:"")),(n>0||a>0)&&(o=n+"小时"+(e?o:"")),a>0&&(o=a+"天"+(e?o:"")),o}function o(t){if("string"===typeof t)try{return JSON.parse(t)}catch(e){return[]}return t instanceof Array?t:[]}},d696:function(t,e,a){"use strict";function n(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}a.d(e,"a",(function(){return n}))}}]);