transferWorkOrderPatient.vue 6.3 KB

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