1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3c7f905e"],{"269d":function(t,e,a){"use strict";var s=a("b323"),r=a("d9dc"),n=a("9bfa"),i=a("bf2e"),o=a("9612"),d=a("45dd"),l=a("942d"),c=a("d53b"),u=a("29cd"),h=a("70d8"),f=a("33e9"),p=f("splice"),m=Math.max,b=Math.min;s({target:"Array",proto:!0,forced:!p},{splice:function(t,e){var a,s,f,p,v,g,_=r(this),y=o(_),C=n(t,y),O=arguments.length;for(0===O?a=s=0:1===O?(a=0,s=y-C):(a=O-2,s=b(m(i(e),0),y-C)),l(y+a-s),f=c(_,s),p=0;p<s;p++)v=C+p,v in _&&u(f,p,_[v]);if(f.length=s,a<s){for(p=C;p<y-s;p++)v=p+s,g=p+a,v in _?_[g]=_[v]:h(_,g);for(p=y;p>y-s+a;p--)h(_,p-1)}else if(a>s)for(p=y-s;p>C;p--)v=p+s-1,g=p+a-1,v in _?_[g]=_[v]:h(_,g);for(p=0;p<a;p++)_[p+C]=arguments[p+2];return d(_,y-s+a),f}})},"6d3c":function(t,e,a){"use strict";a.d(e,"f",(function(){return r})),a.d(e,"e",(function(){return n})),a.d(e,"d",(function(){return i})),a.d(e,"a",(function(){return o})),a.d(e,"h",(function(){return d})),a.d(e,"b",(function(){return l})),a.d(e,"c",(function(){return c})),a.d(e,"g",(function(){return u})),a.d(e,"i",(function(){return h}));var s=a("9550");function r(t){return Object(s["a"])({url:"orders",method:"get",params:t})}function n(t){return Object(s["a"])({url:"orders/".concat(t),method:"get"})}function i(t){return Object(s["a"])({url:"orders/".concat(t),method:"delete"})}function o(t,e){return Object(s["a"])({url:"orders/".concat(t,"/allot"),method:"post",data:e})}function d(t,e){return Object(s["a"])({url:"orders/".concat(t,"/allot"),method:"put",data:e})}function l(t,e){return Object(s["a"])({url:"orders/".concat(t,"/check"),method:"post",data:e})}function c(t){return Object(s["a"])({url:"orders/".concat(t,"/complete"),method:"post"})}function u(t,e){return Object(s["a"])({url:"orders/".concat(t,"/issue"),method:"post",data:e})}function h(t,e){return Object(s["a"])({url:"orders/".concat(t,"/suspend"),method:"post",data:e})}},"70d8":function(t,e,a){"use strict";var s=a("1dbe"),r=TypeError;t.exports=function(t,e){if(!delete t[e])throw r("Cannot delete property "+s(e)+" of "+s(t))}},"720f":function(t,e,a){"use strict";a.r(e);a("7bb1");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:"待审核 ("+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,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(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(s,r){return e("van-image",{key:r,staticClass:"mr-1 border border-gray-100",attrs:{src:s,width:"5rem",height:"5rem"},on:{click:function(e){return t.preview(a.pics,r)}}})})),1),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)],1)},r=[],n=(a("8623"),a("b9f9")),i=(a("844d"),a("b1dc"),a("269d"),a("1d82"),a("933e"),a("ad74"),a("6d3c")),o=a("9550");function d(){return Object(o["a"])({url:"statis/order",method:"get"})}var l=a("aebe"),c=a("c690"),u={name:"OrderList",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}},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:{updateOrder:function(t){for(var e=this,a=-1,s=0;s<this.orderList.length;s++)this.orderList[s].id===parseInt(t)&&(a=s);if(a<0)return!1;Object(i["f"])({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;d().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(n["a"])({images:t,startPosition:e})},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(i["d"])(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(i["c"])(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){var e=this;this.$dialog.confirm({title:"提示",message:"确认要审核通过吗?"}).then((function(){e.loadingConfirm=!0,Object(i["b"])(t).then((function(a){e.$toast("操作成功"),e.updateOrder(t),e.loadingConfirm=!1})).catch((function(){e.loadingConfirm=!1}))})).catch((function(t){console.log(t)}))},loadOrderList:function(){var t=this;this.loading=!0,Object(i["f"])({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("e607"),p=Object(f["a"])(h,s,r,!1,null,null,null);e["default"]=p.exports},8623:function(t,e,a){"use strict";a("f9d9"),a("004e"),a("6e6b"),a("d23c"),a("e3d2"),a("0165"),a("b3c7"),a("3de1"),a("5ff9"),a("baa3")},aebe:function(t,e,a){"use strict";var s="Servicer-Storage";e["a"]={get:function(t){var e=window.localStorage.getItem(s+"_"+t);return e?window.JSON.parse(e):""},set:function(t,e){window.localStorage.setItem(s+"_"+t,window.JSON.stringify(e))},del:function(t,e){window.localStorage.removeItem(s+"_"+t)}}},c690:function(t,e,a){"use strict";a.d(e,"a",(function(){return r}));var s=a("9550");function r(t){return Object(s["a"])({url:"leaders",method:"get",params:t})}}}]);
|