3 lines
12 KiB
JavaScript
3 lines
12 KiB
JavaScript
(self["webpackChunkuniapp"]=self["webpackChunkuniapp"]||[]).push([[492],{4946:function(t,e,n){var i=n(5270);i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.id,i,""]]),i.locals&&(t.exports=i.locals);var r=n(5472).Z;r("5b0d3a82",i,!0,{sourceMap:!1,shadowMode:!1})},2498:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return f}});var i,r={uButton:n(7344).Z,uList:n(4307).Z,uSwipeAction:n(3309).Z,uListItem:n(8556).Z,uSwipeActionItem:n(8268).Z,uCell:n(7981).Z,uIcon:n(5862).Z,uActionSheet:n(7030).Z},o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"page"},[n("v-uni-view",{staticClass:"add-button"},[n("u-button",{attrs:{type:"primary",icon:"plus",shape:"circle",size:"large"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.add.apply(void 0,arguments)}}})],1),n("u-list",{staticClass:"list",on:{scrolltolower:function(e){arguments[0]=e=t.$handleEvent(e),t.reachBottom.apply(void 0,arguments)}}},[n("u-swipe-action",t._l(t.list,(function(e){return n("u-list-item",{key:e.id},[n("u-swipe-action-item",{attrs:{options:t.swipeOption,name:e.id},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.swipeClick.apply(void 0,arguments)}}},[n("u-cell",{attrs:{size:"large",url:"/pages/record/detail?id="+e.id}},[n("v-uni-view",{staticClass:"title",attrs:{slot:"title"},slot:"title"},[n("v-uni-view",{staticClass:"list-item-title"},[t._v("医师: "+t._s(e.doctor?e.doctor.name:""))]),n("v-uni-view",{staticClass:"list-item-price"},[n("v-uni-text",{staticStyle:{color:"#dd524d","font-size":"19px"}},[n("u-icon",{attrs:{name:"rmb",color:"#dd524d",size:"19px"}}),t._v(t._s(e.sell_price))],1),n("v-uni-text",{staticStyle:{color:"#c0c0c0","text-decoration":"line-through"}},[t._v(t._s(e.origin_price))])],1)],1),n("v-uni-view",{staticClass:"label",attrs:{slot:"label"},slot:"label"},[t._v("时间: "+t._s(e.treat_at))])],1)],1)],1)})),1)],1),n("u-action-sheet",{attrs:{actions:t.option.list,title:t.option.title,show:t.option.show,closeOnClickOverlay:!0},on:{close:function(e){arguments[0]=e=t.$handleEvent(e),t.closeOption.apply(void 0,arguments)},select:function(e){arguments[0]=e=t.$handleEvent(e),t.chooseOption.apply(void 0,arguments)}}})],1)},a=[],c=n(3762),s=n(3062),u=(n(6228),{data:function(){return{patient_id:"",patient:{},typeIndex:0,perPage:20,typeList:[],list:[],option:{id:"",show:!1,list:[{name:"详细",color:"#4cd964",action:"detail"},{name:"修改",color:"#007aff",action:"edit"},{name:"删除",color:"#dd524d",action:"delete"}],title:""},swipeOption:[{text:"删除",style:{backgroundColor:"#dd524d"}}]}},onLoad:function(t){this.patient_id=t.patient,this.init()},onShow:function(){this.loadData(!0)},onPullDownRefresh:function(){this.loadData(!0)},methods:{init:function(){var t=this;return(0,s.Z)((0,c.Z)().mark((function e(){var n;return(0,c.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$ajax.get("/admin-api/patient/".concat(t.patient_id),{params:{_action:"getData"}});case 2:n=e.sent,0==n.status&&(t.patient=n.data,uni.setNavigationBarTitle({title:"".concat(t.patient.name,"-病历记录")})),t.loadData(!0);case 5:case"end":return e.stop()}}),e)})))()},changeType:function(t){this.typeIndex=t,this.loadData(!0)},loadData:function(t){var e=this;t&&(this.list=[],this.page=1),uni.showLoading();var n={_action:"getData",page:this.page,perPage:this.perPage,patient_id:this.patient_id};this.$ajax.get("/admin-api/record?",{params:n}).then((function(t){uni.stopPullDownRefresh(),0==t.status&&(e.list=e.list.concat(t.data.items),e.total=t.data.total)})).catch((function(t){uni.stopPullDownRefresh()}))},reachBottom:function(){this.list.length<this.total&&(this.page++,this.loadData())},openOption:function(t){var e=this.list[t];this.option.title=e.name,this.option.id=e.id,this.option.show=!0},closeOption:function(){this.option.show=!1},chooseOption:function(t){var e=this.option.id;return"detail"==t.action?uni.navigateTo({url:"/pages/record/detail?id=".concat(e)}):"edit"==t.action?uni.navigateTo({url:"/pages/record/form?id=".concat(e,"&patient=").concat(this.patient_id)}):void 0},swipeClick:function(t){var e=this,n=t.index;if(0==n)return uni.showModal({title:"删除病历记录",content:"是否确定?",success:function(n){n.confirm&&e.handleDelete(t.name)}})},handleDelete:function(t){var e=this;uni.showLoading(),this.$ajax.delete("/admin-api/record/".concat(t)).then((function(t){0==t.status&&(uni.showToast({title:"删除成功",icon:"success"}),setTimeout((function(){e.loadData(!0)}),1e3))}))},add:function(){var t=this.typeList[this.typeIndex];return uni.navigateTo({url:"/pages/record/form?patient=".concat(this.patient_id,"&type=").concat(t.id)})}}}),l=u,h=(n(4946),n(1503)),p=(0,h.Z)(l,o,a,!1,null,"a61be2da",null,!1,r,i),f=p.exports},6916:function(t,e,n){var i=n(555);i("asyncIterator")},5270:function(t,e,n){"use strict";n.r(e);var i=n(2916),r=n.n(i),o=n(3282),a=n.n(o),c=a()(r());c.push([t.id,".page[data-v-a61be2da]{padding-top:20px}.list[data-v-a61be2da]{background:#fff}.list .title[data-v-a61be2da]{display:flex;flex-direction:row;justify-content:space-between;font-size:18px}.list .label[data-v-a61be2da]{color:gray;margin-top:10px}.list-item-price[data-v-a61be2da] .u-icon{display:inline-block}.add-button[data-v-a61be2da]{position:absolute;bottom:100px;right:50px;z-index:999}",""]),e["default"]=c},3062:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});n(5827);function i(t,e,n,i,r,o,a){try{var c=t[o](a),s=c.value}catch(u){return void n(u)}c.done?e(s):Promise.resolve(s).then(i,r)}function r(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function c(t){i(a,r,o,c,s,"next",t)}function s(t){i(a,r,o,c,s,"throw",t)}c(void 0)}))}}},3762:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});n(5231),n(1260),n(3575),n(5827),n(485),n(8023),n(930),n(6916),n(1229),n(7611),n(8283),n(2883),n(6007),n(7143),n(1136),n(9312);var i=n(9684);function r(){
|
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
r=function(){return e};var t,e={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function p(t,e,n,i){var r=e&&e.prototype instanceof w?e:w,o=Object.create(r.prototype),c=new T(i||[]);return a(o,"_invoke",{value:Z(t,n,c)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",g="completed",m={};function w(){}function b(){}function x(){}var _={};h(_,s,(function(){return this}));var L=Object.getPrototypeOf,E=L&&L(L(S([])));E&&E!==n&&o.call(E,s)&&(_=E);var O=x.prototype=w.prototype=Object.create(_);function k(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(r,a,c,s){var u=f(t[r],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==(0,i.Z)(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,c,s)}),(function(t){n("throw",t,c,s)})):e.resolve(h).then((function(t){l.value=t,c(l)}),(function(t){return n("throw",t,c,s)}))}s(u.arg)}var r;a(this,"_invoke",{value:function(t,i){function o(){return new e((function(e,r){n(t,i,e,r)}))}return r=r?r.then(o,o):o()}})}function Z(e,n,i){var r=d;return function(o,a){if(r===y)throw new Error("Generator is already running");if(r===g){if("throw"===o)throw a;return{value:t,done:!0}}for(i.method=o,i.arg=a;;){var c=i.delegate;if(c){var s=P(c,i);if(s){if(s===m)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===d)throw r=g,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=y;var u=f(e,n,i);if("normal"===u.type){if(r=i.done?g:v,u.arg===m)continue;return{value:u.arg,done:i.done}}"throw"===u.type&&(r=g,i.method="throw",i.arg=u.arg)}}}function P(e,n){var i=n.method,r=e.iterator[i];if(r===t)return n.delegate=null,"throw"===i&&e.iterator["return"]&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),m;var o=f(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function S(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function n(){for(;++r<e.length;)if(o.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError((0,i.Z)(e)+" is not iterable")}return b.prototype=x,a(O,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},k(j.prototype),h(j.prototype,u,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new j(p(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(O),h(O,l,"Generator"),h(O,s,(function(){return this})),h(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},e.values=S,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(D),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(i,r){return c.type="throw",c.arg=e,n.next=i,r&&(n.method="next",n.arg=t),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],c=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=t,a.arg=e,r?(this.method="next",this.next=r.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),D(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;D(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:S(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),m}},e}}}]); |