chunk-700f1c3d.4a45dad2.js 17 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-700f1c3d"],{"083a":function(t,e,a){"use strict";var n=a("0d51"),r=TypeError;t.exports=function(t,e){if(!delete t[e])throw new r("Cannot delete property "+n(e)+" of "+n(t))}},3375:function(t,e,a){"use strict";a.d(e,"a",(function(){return n}));a("d401"),a("4de4"),a("4160"),a("b64b"),a("d3b7"),a("4d63"),a("c607"),a("ac1f"),a("2c3e"),a("25f0"),a("4d90"),a("5319"),a("159b");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 r in n)a=new RegExp("("+r+")").exec(t),a&&(t=t.replace(a[1],1==a[1].length?n[r]:n[r].padStart(a[1].length,"0")));return t}},4662:function(t,e,a){"use strict";a("68ef"),a("a71a"),a("9d70"),a("3743"),a("09fe"),a("4d75"),a("e3b3"),a("8270"),a("786d"),a("504b")},"4c10":function(t,e,a){"use strict";a.d(e,"g",(function(){return r})),a.d(e,"f",(function(){return i})),a.d(e,"e",(function(){return s})),a.d(e,"a",(function(){return o})),a.d(e,"j",(function(){return l})),a.d(e,"c",(function(){return c})),a.d(e,"d",(function(){return d})),a.d(e,"i",(function(){return u})),a.d(e,"k",(function(){return h})),a.d(e,"h",(function(){return f})),a.d(e,"b",(function(){return p}));var n=a("1808");function r(t){return Object(n["a"])({url:"orders",method:"get",params:t})}function i(t){return Object(n["a"])({url:"orders/".concat(t),method:"get"})}function s(t){return Object(n["a"])({url:"orders/".concat(t),method:"delete"})}function o(t,e){return Object(n["a"])({url:"orders/".concat(t,"/allot"),method:"post",data:e})}function l(t,e){return Object(n["a"])({url:"orders/".concat(t,"/allot"),method:"put",data:e})}function c(t,e){return Object(n["a"])({url:"orders/".concat(t,"/check"),method:"post",data:e})}function d(t){return Object(n["a"])({url:"orders/".concat(t,"/complete"),method:"post"})}function u(t,e){return Object(n["a"])({url:"orders/".concat(t,"/issue"),method:"post",data:e})}function h(t,e){return Object(n["a"])({url:"orders/".concat(t,"/suspend"),method:"post",data:e})}function f(t){return Object(n["a"])({url:"workorders",method:"get",params:t})}function p(t,e){return Object(n["a"])({url:"extension/".concat(t,"/check"),method:"post",data:e})}},"70aa":function(t,e,a){"use strict";a.d(e,"a",(function(){return r}));var n=a("1808");function r(t){return Object(n["a"])({url:"leaders",method:"get",params:t})}},"9d0a":function(t,e,a){"use strict";var n="Servicer-Storage";e["a"]={get:function(t){var e=window.localStorage.getItem(n+"_"+t);return e?window.JSON.parse(e):""},set:function(t,e){window.localStorage.setItem(n+"_"+t,window.JSON.stringify(e))},del:function(t,e){window.localStorage.removeItem(n+"_"+t)}}},a297:function(t,e,a){"use strict";a.r(e);a("14d9");var n=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:{sticky:""},on:{change:t.beforeChange},model:{value:t.tabIndex,callback:function(e){t.tabIndex=e},expression:"tabIndex"}},[e("van-tab",{attrs:{title:"待审核 ("+t.statisOrder.created+")",name:"0",to:{path:"/orders",query:{tabIndex:0}},replace:""}}),e("van-tab",{attrs:{title:"待维修 ("+t.statisOrder.allotted+")",name:"1",to:{path:"/orders",query:{tabIndex:1}},replace:""}}),e("van-tab",{attrs:{title:"处理中 ("+t.statisOrder.repairing+")",name:"2",to:{path:"/orders",query:{tabIndex:2}},replace:""}}),e("van-tab",{attrs:{title:"已完结 ("+t.statisOrder.completed+")",name:"3",to:{path:"/orders",query:{tabIndex:3}},replace:""}})],1):t._e(),e("van-search",{attrs:{shape:"round",placeholder:"请输入客户姓名或手机"},on:{search:t.beforeChange,clear:t.beforeChange},model:{value:t.keyword,callback:function(e){t.keyword=e},expression:"keyword"}}),e("van-dropdown-menu",[e("van-dropdown-item",{attrs:{options:t.leaderList},on:{change:t.beforeChange},model:{value:t.leaderID,callback:function(e){t.leaderID=e},expression:"leaderID"}}),e("van-dropdown-item",{attrs:{options:t.typeList},on:{change:t.beforeChange},model:{value:t.typeID,callback:function(e){t.typeID=e},expression:"typeID"}})],1),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,"immediate-check":!1,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(a,n){return e("div",{key:n,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(a.order_no))]),e("span",{class:"text-"+a.state_color+" rounded-sm",staticStyle:{width:"3.7rem",height:"100%","text-align":"center",border:"1px solid","border-radius":"5%"}},[t._v(t._s(a.state_name))])]),e("div",{staticClass:"pb-1"},[e("span",{staticClass:"font-bold"},[t._v("报修时间:")]),t._v(t._s(a.created_at))]),e("div",{staticClass:"pb-1"},[e("span",{staticClass:"font-bold"},[t._v("报修姓名:")]),t._v(t._s(a.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(a.link_phone))]),e("a",{staticClass:"flex",attrs:{href:"tel:"+a.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(a.warranty_period))])]),a.leader?e("div",{staticClass:"pb-1 flex items-center text-green-600"},[e("span",{staticClass:"font-bold"},[t._v("工程队长:")]),e("span",{staticClass:"flex items-center"},[e("span",[t._v(t._s(a.leader_info.username))]),a.leader_info.phone?e("span",{staticClass:"flex items-center"},[t._v("("+t._s(a.leader_info.phone)+")"),e("a",{staticClass:"flex items-center",attrs:{href:"tel:"+a.leader_info.phone}},[e("van-icon",{attrs:{name:"phone",size:"22",color:"#009688"}})],1)]):t._e()])]):t._e(),a.recent_visit_time?e("div",{staticClass:"pb-1 text-yellow-600"},[e("span",{staticClass:"font-semibold"},[t._v("预计回访:")]),t._v(t._s(a.recent_visit_time))]):t._e(),e("div",{staticClass:"pb-1"},[e("span",{staticClass:"font-bold"},[t._v("报修地址:")]),t._v(t._s(a.address))]),e("div",{staticClass:"pb-1"},[e("span",{staticClass:"font-bold"},[t._v("故障类型:")]),t._v(t._s(a.type))]),e("div",{staticClass:"pb-1"},[e("span",{staticClass:"font-bold"},[t._v("故障描述:")]),t._v(t._s(a.content))]),e("div",{staticClass:"pb-1"},[e("span",{staticClass:"font-bold"},[t._v("故障图片:")])]),e("div",{staticClass:"pb-1"},[t._l(a.pics,(function(n,r){return["mp4"==n.split("/").pop().split(".").pop()?e("div",{key:r,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:n},on:{click:function(e){return t.videoPlay(n)}}},[t._v(" 您的浏览器不支持视频播放 ")])]):e("van-image",{key:r,staticClass:"mr-1 border border-gray-100",attrs:{src:n,width:"5rem",height:"5rem"},on:{click:function(e){return t.preview(a.pics,r)}}})]}))],2),e("div",{staticClass:"text-right"},[a.auth.check?e("van-button",{staticClass:"ml-2",attrs:{loading:t.loadingCheck,type:"primary",size:"small"},on:{click:function(e){return t.handleCheck(a.id)}}},[t._v("审核通过")]):t._e(),a.auth.allot?e("van-button",{staticClass:"ml-2",attrs:{type:"info",size:"small",to:"/orders/"+a.id+"/allot"}},[t._v("分配工单")]):t._e(),a.auth.re_allot?e("van-button",{staticClass:"ml-2",attrs:{type:"info",size:"small",to:"/orders/"+a.id+"/allot"}},[t._v("重新分配")]):t._e(),a.auth.suspend?e("van-button",{staticClass:"ml-2",attrs:{type:"warning",size:"small",to:"/orders/"+a.id+"/suspend"}},[t._v("标记待定")]):t._e(),a.auth.delete?e("van-button",{staticClass:"ml-2",attrs:{loading:t.loadingDelete,type:"danger",size:"small"},on:{click:function(e){return t.handleDelete(a.id)}}},[t._v("删除工单")]):t._e(),a.auth.complete?e("van-button",{staticClass:"ml-2",attrs:{type:"danger",size:"small"},on:{click:function(e){return t.handleComplete(a.id)}}},[t._v("完结工单")]):t._e(),0===a.is_issue?e("van-button",{staticClass:"ml-2",attrs:{type:"primary",size:"small",to:"/orders/"+a.id+"/issue"}},[t._v("问题分类")]):t._e(),1===a.is_issue?e("van-button",{staticClass:"ml-2",attrs:{type:"danger",size:"small",to:"/orders/"+a.id+"/issue"}},[t._v("编辑问题")]):t._e(),e("van-button",{staticClass:"ml-2",attrs:{plain:"",type:"info",to:"/orders/"+a.id+"/info",size:"small"}},[t._v("报修进度")])],1)])})),0),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(),e("van-popup",{attrs:{closeable:"",round:"",position:"bottom"},model:{value:t.checkShow,callback:function(e){t.checkShow=e},expression:"checkShow"}},[e("div",{staticClass:"mt-2 text-center leading-10 text-lg"},[t._v("审核通过")]),e("DatetimeSelect",{attrs:{name:"业主维修时间",label:"业主维修时间",placeholder:"业主维修时间",type:"datetime"},model:{value:t.checkFrom.time,callback:function(e){t.$set(t.checkFrom,"time",e)},expression:"checkFrom.time"}}),e("van-button",{attrs:{size:"large",type:"info"},on:{click:function(e){return t.checkCheck(t.checkFrom.id)}}},[t._v("提交")])],1)],1)},r=[],i=(a("4662"),a("28a2")),s=(a("4160"),a("c975"),a("a434"),a("d3b7"),a("e25e"),a("159b"),a("4c10")),o=a("ad7b"),l=a("9d0a"),c=a("70aa"),d=a("b1a4"),u={name:"OrderList",components:{DatetimeSelect:d["a"]},data:function(){return{statisOrder:{created:0,allotted:0,repairing:0,completed:0},loadingCheck:!1,loadingDelete:!1,keyword:"",showEmpty:!1,orderList:[],loading:!1,error:!1,page:1,finished:!1,tabIndex:0,listTypes:{1:{title:"今日工单"},2:{title:"今日回访"}},listType:0,title:"维修列表",typeList:[],typeID:0,leaderList:[],leaderID:0,videoShow:!1,videoUrl:"",checkShow:!1,checkFrom:{}}},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=-1),console.log("created"),this.loadOrderStatis(),this.loadLeaderList(),this.loadTypeList(),this.loadOrderList()},activated:function(){var t=l["a"].get("updateOrderID");t>0&&(this.updateOrder(t),l["a"].del("updateOrderID")),console.log("activated")},beforeRouteEnter:function(t,e,a){a((function(t){t.$store.commit("keepAlive/add","OrderList"),console.log(t.$store.state.keepAlive.list)}))},beforeRouteLeave:function(t,e,a){["orderInfo","addVisit","editVisit","orderSuspend","orderIssue","orderAllot"].indexOf(t.name)<0&&(console.log("remove cache"),this.$store.commit("keepAlive/remove","OrderList")),a()},methods:{videoPlay:function(t){this.videoUrl=t,this.videoShow=!0},updateOrder:function(t){for(var e=this,a=-1,n=0;n<this.orderList.length;n++)this.orderList[n].id===parseInt(t)&&(a=n);if(a<0)return!1;Object(s["g"])({tab_index:this.tabIndex,keyword:this.keyword,list_type:this.listType,id:t}).then((function(t){t.data.length>0?e.orderList.splice(a,1,t.data[0]):e.orderList.splice(a,1)})),this.loadOrderStatis()},loadLeaderList:function(){var t=this;Object(c["a"])({show_all:1}).then((function(e){var a=[{text:"选择队长",value:0}];e.data.forEach((function(t){a.push({text:t.username,value:t.id})})),t.leaderList=a}))},loadTypeList:function(){var t=[{text:"选择报修类型",value:0}];this.typeList=t},handlePickLeader:function(){},loadOrderStatis:function(){var t=this;Object(o["b"])().then((function(e){t.statisOrder=e.data,t.statisOrder.created=Math.min(t.statisOrder.created,999),t.statisOrder.repairing=Math.min(t.statisOrder.repairing,999),t.statisOrder.allotted=Math.min(t.statisOrder.allotted,999),t.statisOrder.completed=Math.min(t.statisOrder.completed,999)}))},preview:function(t,e){Object(i["a"])({images:t,startPosition:e,closeable:!0})},beforeChange:function(){return this.finished=!1,this.loading=!1,this.error=!1,this.page=1,this.orderList=[],this.loadOrderStatis(),this.loadOrderList(),!0},handleDelete:function(t){var e=this;this.$dialog.confirm({title:"提示",message:"确认要删除工单吗?"}).then((function(){e.loadingDelete=!0,Object(s["e"])(t).then((function(a){e.$toast("操作成功"),e.updateOrder(t),e.loadingDelete=!1})).catch((function(){e.loadingDelete=!1}))})).catch((function(t){console.log(t)}))},handleComplete:function(t){var e=this;this.$dialog.confirm({title:"提示",message:"确认要完结工单吗?"}).then((function(){e.loadingConfirm=!0,Object(s["d"])(t).then((function(a){e.$toast("操作成功"),e.updateOrder(t),e.loadingConfirm=!1})).catch((function(){e.loadingConfirm=!1}))})).catch((function(t){console.log(t)}))},handleCheck:function(t){this.checkFrom={id:t},this.checkShow=!0},checkCheck:function(t){var e=this;this.$dialog.confirm({title:"提示",message:"确认要审核通过吗?"}).then((function(){e.loadingConfirm=!0,Object(s["c"])(t,e.checkFrom).then((function(a){e.$toast("操作成功"),e.updateOrder(t),e.loadingConfirm=!1,e.checkShow=!1})).catch((function(){e.loadingConfirm=!1}))})).catch((function(t){console.log(t)}))},loadOrderList:function(){var t=this;this.loading=!0,Object(s["g"])({tab_index:this.tabIndex,page:this.page++,keyword:this.keyword,list_type:this.listType,leader_id:this.leaderID}).then((function(e){for(var a in t.loading=!1,e.data.length<t.$store.getters.setting.page_size&&(t.finished=!0),e.data)t.orderList.push(e.data[a]);0===t.orderList.length?t.showEmpty=!0:t.showEmpty=!1})).catch((function(){t.loading=!1,t.error=!0}))}}},h=u,f=a("2877"),p=Object(f["a"])(h,n,r,!1,null,null,null);e["default"]=p.exports},a434:function(t,e,a){"use strict";var n=a("23e7"),r=a("7b0b"),i=a("23cb"),s=a("5926"),o=a("07fa"),l=a("3a34"),c=a("3511"),d=a("65f0"),u=a("8418"),h=a("083a"),f=a("1dde"),p=f("splice"),m=Math.max,v=Math.min;n({target:"Array",proto:!0,forced:!p},{splice:function(t,e){var a,n,f,p,b,g,_=r(this),y=o(_),w=i(t,y),k=arguments.length;for(0===k?a=n=0:1===k?(a=0,n=y-w):(a=k-2,n=v(m(s(e),0),y-w)),c(y+a-n),f=d(_,n),p=0;p<n;p++)b=w+p,b in _&&u(f,p,_[b]);if(f.length=n,a<n){for(p=w;p<y-n;p++)b=p+n,g=p+a,b in _?_[g]=_[b]:h(_,g);for(p=y;p>y-n+a;p--)h(_,p-1)}else if(a>n)for(p=y-n;p>w;p--)b=p+n-1,g=p+a-1,b in _?_[g]=_[b]:h(_,g);for(p=0;p<a;p++)_[p+w]=arguments[p+2];return l(_,y-n+a),f}})},ad7b:function(t,e,a){"use strict";a.d(e,"b",(function(){return r})),a.d(e,"c",(function(){return i})),a.d(e,"a",(function(){return s}));var n=a("1808");function r(){return Object(n["a"])({url:"statis/order",method:"get"})}function i(){return Object(n["a"])({url:"statis/repair",method:"get"})}function s(){return Object(n["a"])({url:"statis/extension",method:"get"})}},b1a4:function(t,e,a){"use strict";a("4de4"),a("d3b7");var n=function(){var t=this,e=t._self._c;return e("div",[e("van-field",{attrs:{readonly:"",clickable:t.edit,border:t.border,label:t.label,value:t.showFormat?t.showFormat(t.value):t.value?t.dateFormat("datetime"==t.type?"YYYY-mm-dd HH:MM":"YYYY-mm-dd",new Date(1e3*t.value)):"",placeholder:t.placeholder,disabled:t.disabled,rules:t.rules},on:{click:t.showSelect}}),e("van-popup",{attrs:{round:"",position:"bottom"},model:{value:t.showPicker,callback:function(e){t.showPicker=e},expression:"showPicker"}},[e("van-datetime-picker",{attrs:{type:t.type,title:t.label,value:t.value?new Date(1e3*t.value):new Date,"min-date":t.minDate,"max-date":t.maxDate,filter:t.filter,formatter:t.formatter},on:{cancel:function(e){t.showPicker=!1},confirm:t.onConfirm}})],1)],1)},r=[],i=(a("e25e"),a("3375")),s={name:"DatetimeSelect",components:{},props:{value:{default:""},label:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},border:{type:Boolean,default:!1},type:{type:String,default:"date"},edit:{type:Boolean,default:!0},minDate:{type:Date,default:function(){return new Date(1900,0,1)}},maxDate:{type:Date,default:function(){return new Date(2100,0,1)}},rules:{type:Array,default:function(){return[]}},filter:Function,formatter:{type:Function,default:function(t,e){return e}},showFormat:{type:Function,default:void 0}},data:function(){return{showPicker:!1}},methods:{dateFormat:i["a"],showSelect:function(){this.edit&&(this.showPicker=!0)},onConfirm:function(t){t=parseInt(t.getTime()/1e3);this.$emit("input",t),this.showPicker=!1}}},o=s,l=a("2877"),c=Object(l["a"])(o,n,r,!1,null,"24ef799b",null);e["a"]=c.exports}}]);