choosePrescription.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view class="choosePrescription">
  3. <!-- 搜索框 -->
  4. <view class="searchPrescription">
  5. <uni-forms class="search_forms">
  6. <uni-forms-item label="处方编号">
  7. <uni-easyinput v-model="pageData.cfbh" placeholder="请输入处方编号" />
  8. </uni-forms-item>
  9. <uni-forms-item label="患者编码">
  10. <uni-easyinput v-model="pageData.djdsh" placeholder="请输入患者编码" />
  11. </uni-forms-item>
  12. <uni-forms-item label="患者姓名">
  13. <uni-easyinput v-model="pageData.hzxm" placeholder="请输入患者姓名" />
  14. </uni-forms-item>
  15. <uni-forms-item label="医疗机构">
  16. <superwei-combox :candidates="yljgList.value" :isJSON="true" keyName="name" placeholder="请输入医疗机构"
  17. v-model="pageData.deptName" @input="comboxInput" @select="comboxInput"></superwei-combox>
  18. </uni-forms-item>
  19. </uni-forms>
  20. <view class="search_button_group">
  21. <button class="reset_button" @click="reset">重置</button>
  22. <button class="search_button" @click="search">搜索</button>
  23. </view>
  24. </view>
  25. <!-- 处方列表 -->
  26. <uni-card v-for="(item,index) in pageData.cfInfo" class="cfInfo" @click="chooseCf(item)">
  27. <view class="cfInfo_title">
  28. <view class="cfInfo_text_name">处方编号</view>
  29. <view class="cfInfo_text">{{item.cfbm}}</view>
  30. </view>
  31. <view class="cfInfo_title">
  32. <view class="cfInfo_text_name">院内处方编号</view>
  33. <view class="cfInfo_text">{{item.yncfbh}}</view>
  34. </view>
  35. <view class="cfInfo_title">
  36. <view class="cfInfo_text_name">患者编码</view>
  37. <view class="cfInfo_text">{{item.djdsh}}</view>
  38. </view>
  39. <view class="cfInfo_title">
  40. <view class="cfInfo_text_name">患者姓名</view>
  41. <view class="cfInfo_text">{{item.hzxm}}</view>
  42. </view>
  43. <view class="cfInfo_title">
  44. <view class="cfInfo_text_name">医疗机构</view>
  45. <view class="cfInfo_text">{{item.yljgmc}}</view>
  46. </view>
  47. <view class="cfInfo_title">
  48. <view class="cfInfo_text_name">开方日期</view>
  49. <view class="cfInfo_text">{{item.kfrq}}</view>
  50. </view>
  51. <view class="cfInfo_title">
  52. <view class="cfInfo_text_name">贴数</view>
  53. <view class="cfInfo_text">{{item.ts}}</view>
  54. </view>
  55. <view class="cfInfo_title">
  56. <view class="cfInfo_text_name">处方内容</view>
  57. <view class="cfInfo_text">{{item.cfnr}}</view>
  58. </view>
  59. </uni-card>
  60. <!-- 对话框 -->
  61. <uni-popup ref="chooseDialog" type="dialog">
  62. <uni-popup-dialog type="info" confirmText="确定" cancelText="取消" title="选择处方" :content="pageData.popupMessage.showMessage" @confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
  63. </uni-popup>
  64. <view>
  65. <uni-load-more :status="loadingData.status" :contentText="loadingData.contentText"></uni-load-more>
  66. </view>
  67. </view>
  68. </template>
  69. <script setup>
  70. import { reactive,ref } from "vue";
  71. import {onLoad,onShow,onUnload,onPullDownRefresh,onReachBottom} from "@dcloudio/uni-app";
  72. import http from '@/utils/request';
  73. import uniComboxVue from "../../../uni_modules/uni-combox/components/uni-combox/uni-combox.vue";
  74. import uniCombox from "../../../uni_modules/uni-combox/components/uni-combox/uni-combox";
  75. const pageData=reactive({
  76. //机构名称
  77. deptName:'',
  78. //机构Code
  79. deptCode:'',
  80. // 处方编号
  81. cfbh:'',
  82. // 平台唯一编号
  83. ptwybh:'',
  84. // 患者编码
  85. djdsh:'',
  86. // 患者姓名
  87. hzxm:'',
  88. // 处方信息列表
  89. cfInfo:[],
  90. // 处方状态
  91. cfStatus:'',
  92. // 发药方式类型
  93. fyfslx:'',
  94. chooseDialog:'',
  95. // 弹出框内容
  96. popupMessage:{
  97. showMessage:''
  98. }
  99. })
  100. const formData=reactive({
  101. cfbm:'',
  102. djdsh:'',
  103. hzxm:'',
  104. yljgdm:'',
  105. cflx:[],
  106. pageNum:1,
  107. pageSize:10
  108. })
  109. const orgName = reactive({});
  110. const yljgList = reactive([]);
  111. // 医疗机构选择事件
  112. const comboxInput =(e)=>{
  113. formData.yljgdm = e.id
  114. console.log(e.id);
  115. }
  116. const comboxSelect =(e)=>{
  117. formData.yljgdm = e.id
  118. }
  119. // 获取医疗机构列表
  120. const getYljgList = () =>{
  121. http.get("app-api/cf/findYljgList").then(res=>{
  122. yljgList.value = res
  123. })
  124. }
  125. const loadingData = reactive({
  126. // 加载true,到底false
  127. reload: false,
  128. status: 'more',
  129. contentText: {
  130. contentdown: '上拉加载更多',
  131. contentrefresh: '加载中',
  132. contentnomore: '已经全部加载完毕'
  133. }
  134. })
  135. // 定义弹出框
  136. const chooseDialog = ref()
  137. // 弹出框确定事件
  138. const dialogConfirm=()=>{
  139. dialogClose()
  140. let url=''
  141. // 跳转到下一个页面
  142. if(pageData.fyfslx=='2' || pageData.fyfslx=='3'){
  143. url='/pages/ypczk/zkTask/djTask?cfbh='+pageData.cfbh+'&fyfslx='+pageData.fyfslx+'&ptwybh='+pageData.cfbh+'&state=add'
  144. }else if(pageData.fyfslx=='4' || pageData.fyfslx=='5'){
  145. url='/pages/ypczk/zkTask/dpTask?cfbh='+pageData.cfbh+'&fyfslx='+pageData.fyfslx+'&ptwybh='+pageData.cfbh+'&state=add'
  146. }
  147. uni.navigateTo({
  148. url:url,
  149. })
  150. }
  151. // 弹出框取消事件
  152. const dialogClose=()=>{
  153. chooseDialog._value.close()
  154. }
  155. // 重置
  156. const reset=()=>{
  157. pageData.cfbh=''
  158. pageData.hzxm=''
  159. pageData.djdsh=''
  160. getUserInfo()
  161. formData.yljgdm=pageData.deptCode
  162. search()
  163. }
  164. // 搜索
  165. const search=()=>{
  166. formData.cfbm=pageData.cfbh
  167. formData.hzxm=pageData.hzxm
  168. formData.djdsh=pageData.djdsh
  169. formData.pageNum=1
  170. pageData.cfInfo=[]
  171. getCfData()
  172. }
  173. // 选择处方
  174. const chooseCf=(e)=>{
  175. // 点击处方,弹出对话框
  176. chooseDialog._value.open()
  177. pageData.popupMessage.showMessage="处方编号:"+e.cfbm+"\n"+"患者姓名:"+e.hzxm+"\n"+"是否确认选择该处方?"
  178. pageData.cfbh=e.cfbm
  179. pageData.fyfslx=e.cflx[0]
  180. pageData.ptwybh=e.ptwybh
  181. }
  182. // 获取处方信息
  183. const getCfData=()=>{
  184. let fyfslxList=[]
  185. if(pageData.cfStatus=='dj'){
  186. fyfslxList=[2,3]
  187. }else{
  188. fyfslxList=[4,5]
  189. }
  190. formData.cflx=fyfslxList
  191. // pageData.cfInfo=[]
  192. http.get("app-api/cf/findList",formData).then(res=>{
  193. pageData.cfInfo=pageData.cfInfo.concat(res.data)
  194. if (formData.pageSize > res.data.length) {
  195. loadingData.reload = false
  196. loadingData.status = 'noMore'
  197. uni.stopPullDownRefresh();
  198. } else {
  199. loadingData.status = 'more'
  200. loadingData.reload = true
  201. }
  202. })
  203. setTimeout(()=>{
  204. uni.stopPullDownRefresh();
  205. },1000)
  206. }
  207. // 上拉加载
  208. onReachBottom(()=>{
  209. if (loadingData.reload) {
  210. formData.pageNum++;
  211. loadingData.status = 'loading'
  212. getCfData();
  213. }
  214. })
  215. // 下拉刷新
  216. onPullDownRefresh(()=>{
  217. formData.pageNum = 1;
  218. loadingData.reload = true
  219. pageData.cfInfo = []
  220. getCfData();
  221. })
  222. onShow(()=>{
  223. getUserInfo()
  224. getYljgList()
  225. pageData.cfbh=""
  226. formData.yljgdm = pageData.deptCode
  227. pageData.cfInfo = []
  228. getCfData()
  229. })
  230. onLoad((type)=>{
  231. if(type.taskStatus!=null){
  232. pageData.cfStatus=type.taskStatus
  233. }
  234. })
  235. const getUserInfo=()=>{
  236. try{
  237. const value=uni.getStorageSync("userInfo")
  238. pageData.deptCode = value.deptCode
  239. pageData.deptName = value.orgName
  240. }catch(e){
  241. //TODO handle the exception
  242. }
  243. }
  244. </script>
  245. <style lang="scss" scoped>
  246. @import './index.scss'
  247. </style>