chunk-79f66992.42260857.js 9.6 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-79f66992"],{"0c9b":function(t,e,n){"use strict";var s=function(){var t=this,e=t._self._c;return e("transition",{attrs:{name:"el-fade-in"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.toTopShow,expression:"toTopShow"}],staticClass:"page-up",on:{click:t.scrollToTop}},[e("van-icon",{staticStyle:{margin:"10%"},attrs:{name:"back-top",color:"#f9fafb",size:"2rem"}})],1)])},o=[],i={name:"pageup",data:function(){return{toTopShow:!0}},created:function(){},mounted:function(){this.$nextTick((function(){window.addEventListener("scroll",this.handleScroll,!0)}))},destroyed:function(){window.removeEventListener("scroll",this.handleScroll,!0)},methods:{handleScroll:function(){this.scrollTop=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,this.scrollTop>0?this.toTopShow=!0:this.toTopShow=!1},scrollToTop:function(){var t=null,e=this;cancelAnimationFrame(t),t=requestAnimationFrame((function n(){e.scrollTop>1e3||e.scrollTop>1e3&&e.scrollTop<=5e3||e.scrollTop>200&&e.scrollTop<=1e3||e.scrollTop>50&&e.scrollTop<=200||e.scrollTop>0&&e.scrollTop<=50?(e.scrollTop-=0,document.documentElement.scrollTop=0,window.pageYOffset=0,document.body.scrollTop=0,t=requestAnimationFrame(n)):(cancelAnimationFrame(t),e.toTopShow=!1)}))}}},a=i,r=(n("9d9b"),n("2877")),l=Object(r["a"])(a,s,o,!1,null,"03d30358",null);e["a"]=l.exports},4662:function(t,e,n){"use strict";n("68ef"),n("a71a"),n("9d70"),n("3743"),n("09fe"),n("4d75"),n("e3b3"),n("8270"),n("786d"),n("504b")},"5ed1":function(t,e,n){"use strict";n.r(e);n("14d9");var s=function(){var t=this,e=t._self._c;return e("div",[e("van-nav-bar",{staticClass:"shadow mb-2",attrs:{title:t.title,"left-text":"返回","left-arrow":"","right-text":"首页"},on:{"click-left":function(e){return t.$router.back(-1)},"click-right":function(e){return t.$router.push("/")}}}),t.tabIndex>-1?e("van-tabs",{staticClass:"shadow",attrs:{"before-change":t.beforeChange,sticky:""},model:{value:t.tabIndex,callback:function(e){t.tabIndex=e},expression:"tabIndex"}},[e("van-tab",{attrs:{title:"待确认",name:"0",to:{path:"/orders",query:{tabIndex:0}},re:"",lace:""}}),e("van-tab",{attrs:{title:"处理中",name:"1",to:{path:"/orders",query:{tabIndex:1}},replace:""}}),e("van-tab",{attrs:{title:"已完成",name:"2",to:{path:"/orders",query:{tabIndex:2}},replace:""}})],1):t._e(),e("van-search",{attrs:{shape:"round",placeholder:"请输入客户姓名或手机"},on:{search:function(e){return t.beforeChange(t.tabIndex)},clear:function(e){return t.beforeChange(t.tabIndex)}},model:{value:t.keyword,callback:function(e){t.keyword=e},expression:"keyword"}}),e("van-empty",{directives:[{name:"show",rawName:"v-show",value:t.showEmpty,expression:"showEmpty"}],attrs:{description:"暂无订单"}}),e("van-list",{staticClass:"mt-4",attrs:{finished:t.finished,error:t.error,"error-text":"请求失败,点击重新加载","finished-text":""},on:{"update:error":function(e){t.error=e},load:t.loadOrderList},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},t._l(t.orderList,(function(n,s){return e("div",{key:s,staticClass:"bg-white mb-4 w-11/12 p-4 mx-auto text-sm shadow rounded"},[e("div",{staticClass:"pb-2 flex items-center justify-between border-b mb-2"},[e("span",[e("span",{staticClass:"font-bold"},[t._v("工单编号:")]),t._v(t._s(n.order_no))]),e("span",{class:"text-"+n.state_color+" px-2 py-1 rounded-sm"},[t._v(t._s(n.state_name))])]),e("div",{staticClass:"pb-1"},[e("span",{staticClass:"font-bold"},[t._v("报修时间:")]),t._v(t._s(n.created_at))]),e("div",{staticClass:"pb-1"},[e("span",{staticClass:"font-bold"},[t._v("报修姓名:")]),t._v(t._s(n.link_name))]),e("div",{staticClass:"pb-1 flex items-center"},[e("span",{staticClass:"font-bold"},[t._v("联系电话:")]),e("span",{staticClass:"flex items-center"},[e("span",{staticClass:"pr-2"},[t._v(t._s(n.link_phone))]),e("a",{staticClass:"flex",attrs:{href:"tel:"+n.link_phone}},[e("van-icon",{attrs:{name:"phone",size:"22",color:"#009688"}})],1)])]),e("div",{staticClass:"pb-1 text-red-600"},[e("span",{staticClass:"font-bold"},[t._v("是否保修:")]),e("span",[t._v(t._s(n.warranty_period))])]),n.supervisor?e("div",{staticClass:"pb-1 text-yellow-600"},[e("span",{staticClass:"font-bold"},[t._v("项目监理:")]),t._v(t._s(n.supervisor))]):t._e(),e("div",{staticClass:"pb-1"},[e("span",{staticClass:"font-bold"},[t._v("报修地址:")]),t._v(t._s(n.address))]),e("div",{staticClass:"pb-1"},[e("span",{staticClass:"font-bold"},[t._v("故障类型:")]),t._v(t._s(n.type))]),e("div",{staticClass:"pb-1"},[e("span",{staticClass:"font-bold"},[t._v("故障描述:")]),t._v(t._s(n.content))]),e("div",{staticClass:"pb-1"},[e("span",{staticClass:"font-bold"},[t._v("故障图片:")])]),e("div",{staticClass:"pb-1"},[t._l(n.pics,(function(s,o){return["mp4"==s.split("/").pop().split(".").pop()?e("div",{key:o,staticClass:"overflow-hidden flex justify-center items-center",staticStyle:{width:"5rem",height:"5rem",display:"inline-block"}},[e("video",{staticClass:"min-w-full min-h-full",attrs:{src:s},on:{click:function(e){return t.videoPlay(s)}}},[t._v(" 您的浏览器不支持视频播放 ")])]):e("van-image",{key:o,staticClass:"mr-1 border border-gray-100",attrs:{src:s,width:"5rem",height:"5rem"},on:{click:function(e){return t.preview(n.pics,o)}}})]}))],2),e("div",{staticClass:"text-right"},[n.auth.sup_confirm?e("van-button",{staticClass:"ml-2",attrs:{loading:t.loadingConfirm,type:"primary",size:"small"},on:{click:function(e){return t.handleConfirm(n.id)}}},[t._v("立即确认")]):t._e(),n.auth.repairing?e("van-button",{staticClass:"ml-2",attrs:{type:"info",size:"small",to:"/orders/"+n.id+"/schedule"}},[t._v("提交上门时间")]):t._e(),n.auth.feedback?e("van-button",{staticClass:"ml-2",attrs:{type:"warning",size:"small",to:"/orders/"+n.id+"/repair"}},[t._v("维修反馈")]):t._e(),n.auth.repaired?e("van-button",{staticClass:"ml-2",attrs:{loading:t.loadingFinish,type:"danger",size:"small"},on:{click:function(e){return t.handleFinish(n.id)}}},[t._v("提交业主")]):t._e(),e("van-button",{staticClass:"ml-2",attrs:{plain:"",type:"info",to:"/orders/"+n.id+"/info",size:"small"}},[t._v("报修进度")])],1)])})),0),e("ScrollTop"),t.videoShow?e("van-overlay",{staticClass:"flex justify-center items-center",attrs:{show:t.videoShow,"z-index":"1000"}},[e("video",{staticClass:"max-w-full max-h-full",attrs:{src:t.videoUrl,controls:""}},[t._v(" 您的浏览器不支持视频播放 ")]),e("i",{staticClass:"van-icon van-icon-clear van-image-preview__close-icon van-image-preview__close-icon--top-right",attrs:{role:"button"},on:{click:function(e){t.videoShow=!1}}})]):t._e()],1)},o=[],i=(n("4662"),n("28a2")),a=n("e902"),r=n("0c9b"),l={name:"OrderList",components:{ScrollTop:r["a"]},data:function(){return{keyword:"",loadingFinish:!1,loadingConfirm:!1,showEmpty:!1,orderList:[],loading:!1,error:!1,page:1,finished:!1,tabIndex:0,listTypes:{1:{title:"今日工单"},2:{title:"今日回访"}},listType:0,title:"维修列表",videoShow:!1,videoUrl:""}},created:function(){this.$route.query&&this.$route.query.tabIndex>=0?this.tabIndex=this.$route.query.tabIndex:this.$route.query&&this.$route.query.listType>0&&(this.title=this.listTypes[this.$route.query.listType]["title"],this.listType=this.$route.query.listType,this.tabIndex=-2)},beforeRouteEnter:function(t,e,n){n((function(t){t.$store.commit("keepAlive/add","OrderList"),console.log(t.$store.state.keepAlive.list)}))},beforeRouteLeave:function(t,e,n){n()},methods:{videoPlay:function(t){this.videoUrl=t,this.videoShow=!0},handleFinish:function(t){var e=this;this.$dialog.confirm({title:"提示",message:"确认提交维修信息给业主?"}).then((function(){e.loadingFinish=!0,Object(a["b"])(t).then((function(t){e.$toast("操作成功"),e.beforeChange(e.tabIndex),e.loadingFinish=!1})).catch((function(){e.loadingFinish=!1}))})).catch((function(t){console.log(t)}))},handleConfirm:function(t){var e=this;this.loadingConfirm=!0,Object(a["a"])(t).then((function(t){e.$toast("操作成功"),e.beforeChange(e.tabIndex),e.loadingConfirm=!1})).catch((function(){e.loadingConfirm=!1}))},preview:function(t,e){Object(i["a"])({images:t,startPosition:e,closeable:!0})},beforeChange:function(t){return this.finished=!1,this.loading=!1,this.error=!1,this.page=1,this.orderList=[],this.tabIndex=t,this.loadOrderList(),!0},loadOrderList:function(){var t=this;this.loading=!0,Object(a["d"])({tab_index:this.tabIndex,page:this.page++,keyword:this.keyword,list_type:this.listType}).then((function(e){for(var n in t.loading=!1,e.data.length<t.$store.getters.setting.page_size&&(t.finished=!0),e.data)t.orderList.push(e.data[n]);0===t.orderList.length?t.showEmpty=!0:t.showEmpty=!1})).catch((function(){t.loading=!1,t.error=!0}))}}},c=l,d=n("2877"),u=Object(d["a"])(c,s,o,!1,null,null,null);e["default"]=u.exports},"9d9b":function(t,e,n){"use strict";n("daa2")},daa2:function(t,e,n){},e902:function(t,e,n){"use strict";n.d(e,"d",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return a})),n.d(e,"g",(function(){return r})),n.d(e,"f",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"e",(function(){return d}));var s=n("be40");function o(t){return Object(s["a"])({url:"orders",method:"get",params:t})}function i(t){return Object(s["a"])({url:"orders/".concat(t),method:"get"})}function a(t){return Object(s["a"])({url:"orders/".concat(t,"/confirm"),method:"post"})}function r(t,e){return Object(s["a"])({url:"orders/".concat(t,"/schedule"),method:"post",data:e})}function l(t,e){return Object(s["a"])({url:"orders/".concat(t,"/repair"),method:"post",data:e})}function c(t){return Object(s["a"])({url:"orders/".concat(t,"/finish"),method:"post"})}function d(t){return Object(s["a"])({url:"repairs",method:"get",params:t})}}}]);