You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
5.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["package_sub/order/assignOrder"],{330:function(e,t,n){"use strict";(function(e,t){var r=n(4);n(26);r(n(25));var u=r(n(331));e.__webpack_require_UNI_MP_PLUGIN__=n,t(u.default)}).call(this,n(1)["default"],n(2)["createPage"])},331:function(e,t,n){"use strict";n.r(t);var r=n(332),u=n(334);for(var o in u)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return u[e]}))}(o);n(336);var a,s=n(35),i=Object(s["default"])(u["default"],r["render"],r["staticRenderFns"],!1,null,"38f3c378",null,!1,r["components"],a);i.options.__file="package_sub/order/assignOrder.vue",t["default"]=i.exports},332:function(e,t,n){"use strict";n.r(t);var r=n(333);n.d(t,"render",(function(){return r["render"]})),n.d(t,"staticRenderFns",(function(){return r["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return r["recyclableRender"]})),n.d(t,"components",(function(){return r["components"]}))},333:function(e,t,n){"use strict";var r;n.r(t),n.d(t,"render",(function(){return u})),n.d(t,"staticRenderFns",(function(){return a})),n.d(t,"recyclableRender",(function(){return o})),n.d(t,"components",(function(){return r}));try{r={uNavbar:function(){return n.e("uview-ui/components/u-navbar/u-navbar").then(n.bind(null,338))},uSearch:function(){return n.e("uview-ui/components/u-search/u-search").then(n.bind(null,512))},uAvatar:function(){return n.e("uview-ui/components/u-avatar/u-avatar").then(n.bind(null,519))},uIcon:function(){return n.e("uview-ui/components/u-icon/u-icon").then(n.bind(null,390))},uEmpty:function(){return n.e("uview-ui/components/u-empty/u-empty").then(n.bind(null,359))},uLoadmore:function(){return n.e("uview-ui/components/u-loadmore/u-loadmore").then(n.bind(null,352))},uButton:function(){return n.e("uview-ui/components/u-button/u-button").then(n.bind(null,345))}}}catch(s){if(-1===s.message.indexOf("Cannot find module")||-1===s.message.indexOf(".vue"))throw s;console.error(s.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范文档https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var u=function(){var e=this,t=e.$createElement,n=(e._self._c,{background:"#1479ff"}),r=e.hasNurseList?e.__map(e.nurseList,(function(t,n){var r=e.__get_orig(t),u=e.getNurseAvatar(t);return{$orig:r,m0:u}})):null;e.$mp.data=Object.assign({},{$root:{a0:n,l0:r}})},o=!1,a=[];u._withStripped=!0},334:function(e,t,n){"use strict";n.r(t);var r=n(335),u=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(o);t["default"]=u.a},335:function(e,t,n){"use strict";(function(e){var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=r(n(30)),o=r(n(18)),a=r(n(32)),s={data:function(){return{orderId:"",nurseList:[],selectedNurseId:null,searchKeyword:"",loadStatus:"loadmore",page:1,pageSize:10,hasMore:!0}},onLoad:function(e){e.id&&(this.orderId=e.id),this.getNurseList()},methods:{getNurseList:function(){var t=arguments,n=this;return(0,a.default)(u.default.mark((function r(){var a,s,i,c;return u.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return a=t.length>0&&void 0!==t[0]&&t[0],r.prev=1,a||(n.page=1,n.nurseList=[]),s={page:n.page,page_size:n.pageSize},n.searchKeyword&&(s["filter[0][key]"]="name",s["filter[0][op]"]="like",s["filter[0][value]"]=n.searchKeyword),s["filter[1][key]"]="status",s["filter[1][op]"]="eq",s["filter[1][value]"]=1,r.next=10,n.$u.api.nurseIndex(s);case 10:i=r.sent,i&&i.data?(a?(c=n.nurseList).push.apply(c,(0,o.default)(i.data)):n.nurseList=i.data,n.hasMore=i.data.length===n.pageSize,n.loadStatus=n.hasMore?"loadmore":"nomore"):(n.loadStatus="nomore",a||(n.nurseList=[])),r.next=19;break;case 14:r.prev=14,r.t0=r["catch"](1),console.error("获取护工列表失败:",r.t0),n.loadStatus="nomore",e.showToast({title:"获取护工列表失败",icon:"none"});case 19:case"end":return r.stop()}}),r,null,[[1,14]])})))()},searchNurse:function(){this.getNurseList()},loadMoreNurses:function(){this.hasMore&&"loadmore"===this.loadStatus&&(this.page++,this.getNurseList(!0))},selectNurse:function(e){this.selectedNurseId=e.id},assignOrder:function(){var t=this;return(0,a.default)(u.default.mark((function n(){var r;return u.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t.selectedNurseId){n.next=3;break}return e.showToast({title:"请选择护工",icon:"none"}),n.abrupt("return");case 3:return n.prev=3,n.next=6,t.$u.api.operatorOrderSave({id:t.orderId,nurse_id:t.selectedNurseId});case 6:r=n.sent,0===r.errorCode||void 0===r.errorCode||null===r.errorCode?(e.showToast({title:"分配成功",icon:"success"}),setTimeout((function(){e.navigateBack()}),1500)):e.showToast({title:"分配失败",icon:"none"}),n.next=14;break;case 10:n.prev=10,n.t0=n["catch"](3),console.error("分配订单失败:",n.t0),e.showToast({title:"分配失败",icon:"none"});case 14:case"end":return n.stop()}}),n,null,[[3,10]])})))()},getNurseAvatar:function(e){return e.avatar?e.avatar_detail.url:"/static/default-avatar.png"}},computed:{hasNurseList:function(){return this.nurseList.length>0}}};t.default=s}).call(this,n(2)["default"])},336:function(e,t,n){"use strict";n.r(t);var r=n(337),u=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(o);t["default"]=u.a},337:function(e,t,n){}},[[330,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/package_sub/order/assignOrder.js.map