chunk-4d82c95a.7d52869a.js 5.2 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4d82c95a"],{"6d3c":function(t,e,n){"use strict";n.d(e,"f",(function(){return a})),n.d(e,"e",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return s})),n.d(e,"h",(function(){return d})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return u})),n.d(e,"g",(function(){return l})),n.d(e,"i",(function(){return f}));var o=n("9550");function a(t){return Object(o["a"])({url:"orders",method:"get",params:t})}function r(t){return Object(o["a"])({url:"orders/".concat(t),method:"get"})}function i(t){return Object(o["a"])({url:"orders/".concat(t),method:"delete"})}function s(t,e){return Object(o["a"])({url:"orders/".concat(t,"/allot"),method:"post",data:e})}function d(t,e){return Object(o["a"])({url:"orders/".concat(t,"/allot"),method:"put",data:e})}function c(t,e){return Object(o["a"])({url:"orders/".concat(t,"/check"),method:"post",data:e})}function u(t){return Object(o["a"])({url:"orders/".concat(t,"/complete"),method:"post"})}function l(t,e){return Object(o["a"])({url:"orders/".concat(t,"/issue"),method:"post",data:e})}function f(t,e){return Object(o["a"])({url:"orders/".concat(t,"/suspend"),method:"post",data:e})}},aebe:function(t,e,n){"use strict";var o="Servicer-Storage";e["a"]={get:function(t){var e=window.localStorage.getItem(o+"_"+t);return e?window.JSON.parse(e):""},set:function(t,e){window.localStorage.setItem(o+"_"+t,window.JSON.stringify(e))},del:function(t,e){window.localStorage.removeItem(o+"_"+t)}}},ba7a:function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t._self._c;return e("div",[e("van-nav-bar",{staticClass:"shadow mb-4",staticStyle:{"font-weight":"bold"},attrs:{title:"分配工单","left-text":"返回","left-arrow":""},on:{"click-left":function(e){return t.$router.back(-1)}}}),e("van-form",{staticClass:"w-11/12 mx-auto",on:{submit:t.onSubmit}},[e("van-empty",{directives:[{name:"show",rawName:"v-show",value:t.showEmpty,expression:"showEmpty"}],attrs:{description:"暂无订单"}}),e("van-radio-group",{model:{value:t.allotForm.leader_id,callback:function(e){t.$set(t.allotForm,"leader_id",e)},expression:"allotForm.leader_id"}},[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.loadLeaderList},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},t._l(t.leaderList,(function(n,o){return e("div",{key:o,staticClass:"flex items-center justify-between bg-white shadow px-4 h-32 mb-4 rounded",staticStyle:{height:"auto","padding-top":"2%","padding-bottom":"2%","min-height":"8rem"},on:{click:function(e){return t.choose(n.id)}}},[e("div",{staticClass:"flex flex-col justify-between",staticStyle:{width:"87%"}},[e("div",[e("span",{staticClass:"font-bold"},[t._v("姓名:")]),t._v(t._s(n.username)+" ")]),e("div",[e("span",{staticClass:"font-bold"},[t._v("电话:")]),t._v(t._s(n.phone)+" ")]),e("div",[e("span",{staticClass:"font-bold"},[t._v("角色:")]),t._v(t._s(n.role_names)+" ")])]),e("div",{staticClass:"flex flex-col items-center justify-between h-20"},[e("span",{staticClass:"flex-grow"},[t._v("正常")]),e("van-radio",{attrs:{name:n.id}})],1)])})),0)],1),e("div",{staticClass:"mt-8 fixed bottom-4 w-2/4 inset-x-1/4"},[e("van-button",{attrs:{loading:t.submitLoading,block:"",type:"info","loading-text":"加载中...","native-type":"submit"}},[t._v(t._s(t.btnText))])],1)],1)],1)},a=[],r=(n("7bb1"),n("c690")),i=n("6d3c"),s=n("aebe"),d={data:function(){return{id:0,page:1,leader:0,leaderList:[],showEmpty:!1,orderList:[],loading:!1,error:!1,submitLoading:!1,btnText:"确认分配",allotForm:{leader_id:0},finished:!1}},created:function(){this.$route.params&&this.$route.params.id>=0&&(this.id=this.$route.params.id),this.loadOrderInfo()},methods:{loadOrderInfo:function(){var t=this;Object(i["e"])(this.id).then((function(e){t.allotForm.leader_id=e.data.info.leader,t.leader=e.data.info.leader,t.leader>0&&(t.btnText="重新分配")}))},onSubmit:function(){var t=this,e=this;this.$dialog.confirm({title:"提示",message:"确定要分配吗?"}).then((function(){t.submitLoading=!0,t.leader>0?Object(i["h"])(t.id,t.allotForm).then((function(t){s["a"].set("updateOrderID",e.id),e.$toast.success({message:"操作成功",duration:1e3,onClose:function(){e.$router.back(-1)}})})).catch((function(){t.submitLoading=!1})):Object(i["a"])(t.id,t.allotForm).then((function(t){s["a"].set("updateOrderID",e.id),e.$toast.success({message:"操作成功",duration:1e3,onClose:function(){e.$router.back(-1)}})})).catch((function(){t.submitLoading=!1}))})).catch((function(t){console.log(t)}))},choose:function(t){this.allotForm.leader_id=t},loadLeaderList:function(){var t=this;this.loading=!0,Object(r["a"])({page:this.page++}).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.leaderList.push(e.data[n]);0===t.leaderList.length?t.showEmpty=!0:t.showEmpty=!1})).catch((function(){t.loading=!1,t.error=!0}))}}},c=d,u=n("e607"),l=Object(u["a"])(c,o,a,!1,null,null,null);e["default"]=l.exports},c690:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var o=n("9550");function a(t){return Object(o["a"])({url:"leaders",method:"get",params:t})}}}]);