transferWorkOrderPatient.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view class="transferWorkOrder">
  3. <mSearch class="search" :mode="2" button="inside" placeholder="请搜索患者名称、住院号" v-model="keyword"></mSearch>
  4. <scroll-view scroll-y class="list">
  5. <view class="item tac"><text class="green">接收人:</text>{{userDTO.name}}({{userDTO.account}})</view>
  6. <view class="item" v-for="item in listComputed" :key="item.id" @click="selectItem(item)">
  7. <view>{{item.patientName}}({{item.residenceNo}})</view>
  8. <view><checkbox color="#49B856" value="item.id" :checked="item.checked" /></view>
  9. </view>
  10. </scroll-view >
  11. <view class="footer">
  12. <view class="btn gray" hover-class="seimin-btn-hover" @click="toTransferWorkOrderUser()">切换人员</view>
  13. <view class="btn" hover-class="seimin-btn-hover" @click="submit()">提交</view>
  14. </view>
  15. <!-- 弹窗 -->
  16. <!-- 弹窗 -->
  17. <showModel :title="models1.title" :icon="models1.icon" :disjunctor="models1.disjunctor" :content="models1.content" :operate="models1.operate" @ok="ok1" @cancel="cancel1"></showModel>
  18. </view>
  19. </template>
  20. <script>
  21. import { get, post, SM, webHandle } from "../../http/http.js";
  22. import mSearch from "@/components/mehaotian-search-revision/mehaotian-search-revision.vue";
  23. export default {
  24. onLoad(options) {
  25. console.log('options', options);
  26. this.options = options || {};
  27. this.userDTO = { id: +this.options.userId, name: this.options.userName, account: this.options.userAccount };
  28. this.getList();
  29. },
  30. components: {
  31. //引用mSearch组件,如不需要删除即可
  32. mSearch,
  33. },
  34. data() {
  35. return {
  36. keyword: '',
  37. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  38. list: [],
  39. options: {},
  40. userDTO: {},
  41. // 弹窗model1
  42. models1: {
  43. disjunctor: false,
  44. },
  45. };
  46. },
  47. computed: {
  48. listComputed() {
  49. if(this.keyword){
  50. return this.list.filter( v => v.patientName.includes(this.keyword) || v.residenceNo.includes(this.keyword))
  51. }else{
  52. return this.list;
  53. }
  54. }
  55. },
  56. methods:{
  57. submit(){
  58. let patientList = this.listComputed.filter(v => v.checked);
  59. if(!patientList.length){
  60. uni.showToast({
  61. icon: "none",
  62. title: "请选择患者!",
  63. });
  64. return;
  65. }
  66. this.models1 = {
  67. disjunctor: true,
  68. content: `您确认将<b style='color:red'>${patientList.map(v => v.patientName).join('、')}</b>相关陪检任务转交给<b style='color:red'>${this.userDTO.name}</b>吗`,
  69. icon: "warn",
  70. operate: {
  71. ok: "确定",
  72. cancel: "取消",
  73. },
  74. };
  75. },
  76. // 确定
  77. ok1() {
  78. this.models1.disjunctor = false;
  79. uni.showLoading({
  80. title: "加载中",
  81. mask: true,
  82. });
  83. post("/patient/patientHandover", {
  84. id: this.userDTO.id,
  85. patientCodes: this.listComputed.filter(v => v.checked).map(v => v.patientCode).toString(),
  86. }).then((result) => {
  87. uni.hideLoading();
  88. if (result.state == 200) {
  89. uni.showToast({
  90. icon: "none",
  91. mask: true,
  92. title: "交接成功!",
  93. });
  94. setTimeout(() => {
  95. uni.navigateTo({
  96. url: `/pages/receiptpage/receiptpage`,
  97. });
  98. },300)
  99. } else {
  100. uni.showToast({
  101. icon: "none",
  102. title: result.msg || "接口获取数据失败!",
  103. });
  104. }
  105. });
  106. },
  107. // 取消
  108. cancel1() {
  109. this.models1.disjunctor = false;
  110. },
  111. toTransferWorkOrderUser() {
  112. uni.redirectTo({
  113. url: `/pages/transferWorkOrder/transferWorkOrderUser`,
  114. });
  115. },
  116. selectItem(patient){
  117. this.list.forEach(v => {
  118. if(v.id === patient.id){
  119. v.checked ? this.$set(v, 'checked', false) : this.$set(v, 'checked', true)
  120. }
  121. })
  122. },
  123. getList(keyword){
  124. uni.showLoading({
  125. title: "加载中",
  126. });
  127. post("/nurse/patientInspect/getUserOrderPatient", {}).then((result) => {
  128. uni.hideLoading();
  129. if (result.status == 200) {
  130. this.list = result.list || [];
  131. } else {
  132. uni.showToast({
  133. icon: "none",
  134. title: result.msg || "接口获取数据失败!",
  135. });
  136. }
  137. });
  138. },
  139. }
  140. }
  141. </script>
  142. <style lang="less" scoped>
  143. .transferWorkOrder{
  144. width: 100%;
  145. height: 100vh;
  146. display: flex;
  147. flex-direction: column;
  148. /deep/ uni-checkbox:not([disabled]) .uni-checkbox-input:hover{
  149. border-color: #49B856!important;
  150. }
  151. .green{
  152. color: #49B856;
  153. font-size: 24rpx;
  154. }
  155. .search{
  156. padding: 10rpx 24rpx;
  157. }
  158. .list{
  159. flex: 1;
  160. min-height: 0;
  161. background-color: #fff;
  162. .item{
  163. height: 100rpx;
  164. line-height: 100rpx;
  165. font-size: 26rpx;
  166. border-bottom: 1rpx solid #D5D5D5;
  167. padding: 0 32rpx;
  168. display: flex;
  169. align-items: center;
  170. justify-content: space-between;
  171. &.tac{
  172. justify-content: center;
  173. }
  174. }
  175. }
  176. .footer{
  177. margin-top: 24rpx;
  178. margin-bottom: 24rpx;
  179. line-height: 80rpx;
  180. height: 80rpx;
  181. background: #fff;
  182. display: flex;
  183. align-items: center;
  184. .btn {
  185. height: 80rpx;
  186. flex: 1;
  187. margin: 0 24rpx 0 0;
  188. background-color: #49B856;
  189. color: #fff;
  190. border-radius: 8rpx;
  191. font-size: 34rpx;
  192. text-align: center;
  193. &:first-of-type{
  194. margin-left: 24rpx;
  195. }
  196. &.gray{
  197. background-color: #8F939C;
  198. }
  199. }
  200. }
  201. }
  202. </style>