index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <view class="main">
  3. <NavBar :userInfo="userInfo" @updateInfo="updateUser" />
  4. <view class="body">
  5. <view class="tab-box">
  6. <view class="tab-bar">
  7. <view class="tab_item" v-for="(tab, index) in tabList" :key="index"
  8. :class="{'active':tabActive==index}" @click="checkIndex(index)">
  9. <text class="text">{{tab.title}}{{index===0?"("+orderList.length+")":""}}</text>
  10. </view>
  11. </view>
  12. <view class="search-bar">
  13. <view v-if="tabActive === 0" class="today">
  14. <view class="search">
  15. <uni-easyinput prefixIcon="search" v-model="searchVal" placeholder="请输入姓名" />
  16. </view>
  17. <button type="primary" @click="handleSearch" class="search-button">搜索</button>
  18. <button type="primary" @click="handleRefresh" class="refresh">刷新</button>
  19. </view>
  20. <view v-else class="history">
  21. <view class="searchchoice">
  22. <view class="row1">
  23. <view class="timequan">
  24. <text class="time_t">时间区间:</text>
  25. <uni-datetime-picker v-model="datetimerange" type="datetimerange" :hide-second="true" rangeSeparator=" - " />
  26. </view>
  27. <view class="office">
  28. <view class="uni-list-cell-left office_t">
  29. 科室:
  30. </view>
  31. <picker @change="handleGetOffice" :value="officeIndex" :range="officeArr">
  32. <view class="uni-input">{{officeArr[officeIndex]}}</view>
  33. </picker>
  34. </view>
  35. </view>
  36. <view class="row2">
  37. <view class="presid">
  38. <picker @change="handleGetType" :value="typeIndex" :range="typeArr">
  39. <view class="uni-input">{{typeArr[typeIndex]}}</view>
  40. </picker>
  41. </view>
  42. <view v-if="typeIndex === 0" class="search">
  43. <uni-easyinput prefixIcon="search" v-model="searchName" placeholder="请输入姓名" />
  44. </view>
  45. <view v-else class="search">
  46. <uni-easyinput prefixIcon="search" v-model="searchPres" placeholder="请输入处方号" />
  47. </view>
  48. <button type="primary" @click="handleSearch" class="search-button">搜索</button>
  49. </view>
  50. <view class="row3">
  51. <view class="tag-view" v-for="(v, i) in tags" :key="i">
  52. <uni-tag :circle="true" :inverted="!searchTags.includes(v)" :text=v type="primary" @click="handleGetTags(v)" />
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="tab-content">
  60. <view class="order-list">
  61. <scroll-view v-if="orderList.length > 0" class="order-list-wrap" scroll-y="true" :scroll-top="50">
  62. <template v-for="(v,i) in orderList" :key="i">
  63. <orderCard v-if="v" :v="v" :index="i" :c=tabActive class="order-card"
  64. @update-list="updateList"
  65. />
  66. </template>
  67. </scroll-view>
  68. <view v-else class="text">-- 没有更多数据 --</view>
  69. </view>
  70. <view v-if="isBottom" class="order-bottom">
  71. <view class="text">-- 没有更多数据 --</view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <script setup>
  78. import NavBar from "@/components/nav-bar/nav-bar.vue"
  79. import OrderCard from "@/components/order-card/order-card.vue"
  80. import { onMounted,ref } from 'vue'
  81. const userInfo = ref({})
  82. const searchVal = ref('')
  83. const tabList = ref([
  84. {title:"今日待完成", status: 0},
  85. {title:"历史处方", status: 1},
  86. ])
  87. const currentStatus = ref(0)
  88. const tabActive = ref(1) // 当前tab Index
  89. const tabName = ref('今日待完成') // 当前tab Name
  90. // const tags = ref([])
  91. const orderList = ref([
  92. {prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'1'},
  93. {prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'1'},
  94. {prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'2'},
  95. {prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'1'},
  96. {prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'2'}
  97. ])
  98. const isBottom = ref(false) // 是否触底
  99. const datetimerange = ref([])
  100. const officeArr = ref(['全部','中医骨伤科门诊一','中医内科门诊一','中医儿科门诊'])
  101. const officeIndex = ref(0)
  102. const typeArr = ref(['姓名:','处方号:'])
  103. const typeIndex = ref(0)
  104. const searchName = ref('')
  105. const searchPres = ref('')
  106. const searchTags = ref([])
  107. const tags = ref(['全部','门诊','住院','男','女','煎煮','发药'])
  108. const page = ref(0)
  109. onMounted(() => {
  110. })
  111. // 子传父,更新userInfo
  112. const updateUser = (v)=>{
  113. console.log('updateUser', v)
  114. }
  115. const updateList = (v)=>{
  116. console.log('updateList', v)
  117. }
  118. const handleSearch = ()=>{
  119. console.log('handleSearch searchVal', searchVal.value)
  120. }
  121. const handleRefresh = ()=>{
  122. console.log('handleSearch', v)
  123. }
  124. const handleGetOffice = (e)=>{
  125. console.log('handleGetOffice', e.detail.value)
  126. console.log('officeIndex', officeIndex)
  127. console.log('officeIndex', officeIndex)
  128. officeIndex.value = e.detail.value
  129. }
  130. const handleGetType = (e)=>{
  131. console.log('handleGetType', e.detail.value)
  132. console.log('typeIndex', typeIndex)
  133. console.log('typeArr', typeIndex)
  134. typeIndex.value = e.detail.value
  135. }
  136. const handleGetTags = (v)=>{
  137. console.log('handleGetTags', v)
  138. if(!searchTags.value.includes(v)) {
  139. searchTags.value.push(v)
  140. } else {
  141. searchTags.value.splice(searchTags.value.indexOf(v), 1)
  142. }
  143. }
  144. // 更新处方列表
  145. const checkIndex = async(index) => {
  146. tabActive.value = index
  147. tabName.value = tabList.value[index].title
  148. currentStatus.value = parseInt(tabList.value[index].status)
  149. const params = {
  150. // token: userStore.token,
  151. // appId: userStore.userInfo.appId,
  152. // uId: userStore.userInfo.uId,
  153. page: page.value,
  154. pageSize: 10,
  155. status: currentStatus.value,
  156. }
  157. console.log('checkIndex params',params)
  158. // const { data: res } = await getOrderList(params)
  159. // if(res.code===0) {
  160. // orderList.value = res.data.list
  161. // total.value = res.data.total
  162. // page.value = res.data.page
  163. // pageSize.value = res.data.pageSize
  164. // console.log('checkIndex orderList>>>', orderList.value)
  165. // }
  166. }
  167. </script>
  168. <style lang="scss">
  169. .main {
  170. display: flex;
  171. flex-direction:column;
  172. justify-content:flex-start;
  173. height: 2000px;
  174. width: 1200px;
  175. .nav{
  176. display: flex;
  177. height:140px;
  178. width: 1200px;
  179. // position: sticky;
  180. // top: 0;
  181. }
  182. .body{
  183. display: flex;
  184. height:calc(100% - 100px);
  185. flex-direction:column;
  186. justify-content:flex-start;
  187. .tab-box {
  188. display: flex;
  189. position: sticky;
  190. flex-direction:column;
  191. .tab-bar{
  192. height: 78px;
  193. display: flex;
  194. justify-content:center;
  195. width: 100%;
  196. // border: 1px solid #000;
  197. .tab_item{
  198. display: flex;
  199. flex:1;
  200. justify-content:center;
  201. align-items: center;
  202. font-size: 30px;
  203. background-color: #999;
  204. color: #000;
  205. }
  206. .active{
  207. background-color: #fff!important;
  208. color:#000!important;
  209. }
  210. }
  211. .search-bar{
  212. display: flex;
  213. background-color: #fff;
  214. margin: 8px 10px;
  215. border-radius: 4px;
  216. width: calc(100% - 20px);
  217. .today{
  218. width: 100%;
  219. display: flex;
  220. flex-direction:row;
  221. justify-content: flex-start;
  222. .search{
  223. width: 100%;
  224. margin: 8px 12px;
  225. }
  226. .search-button{
  227. width:100px;
  228. margin: 8px 12px;
  229. font-size: 18px;
  230. }
  231. .refresh {
  232. width:100px;
  233. margin: 8px 12px;
  234. font-size: 18px;
  235. }
  236. }
  237. .history{
  238. display: flex;
  239. width: 100%;
  240. .searchchoice{
  241. padding: 0 20px;
  242. display: flex;
  243. width: 100%;
  244. flex-direction:column;
  245. font-size: 24px;
  246. .row1{
  247. display: flex;
  248. width: 100%;
  249. justify-content:flex-start;
  250. align-items: center;
  251. margin: 10px 0 10px;
  252. // height: 80px;
  253. .timequan{
  254. display: flex;
  255. justify-content:center;
  256. align-items: center;
  257. width:70%;
  258. .time_t{}
  259. }
  260. .office{
  261. display: flex;
  262. margin-left: 60px;
  263. justify-content:center;
  264. align-items: center;
  265. .uni-input{
  266. display: flex;
  267. justify-content:center;
  268. align-items: center;
  269. border:1px solid #e1e5f1;
  270. font-size: 18px;
  271. width:190px;
  272. height: 40px;
  273. border-radius: 5px;
  274. background-color: #e1e5f1;
  275. margin-right: 10px;
  276. }
  277. }
  278. }
  279. .row2{
  280. display: flex;
  281. width: 100%;
  282. justify-content:flex-start;
  283. align-items: center;
  284. margin: 0 0 10px;
  285. .uni-input{
  286. display: flex;
  287. justify-content:center;
  288. align-items: center;
  289. border:1px solid #e1e5f1;
  290. font-size: 18px;
  291. width:100px;
  292. height: 40px;
  293. border-radius: 5px;
  294. background-color: #e1e5f1;
  295. margin-right: 10px;
  296. }
  297. .search{
  298. width: 77%;
  299. }
  300. .search-button{
  301. width:120px;
  302. margin: 8px 12px;
  303. font-size: 16px;
  304. }
  305. }
  306. .row3{
  307. display: flex;
  308. width: 100%;
  309. justify-content:flex-start;
  310. align-items: center;
  311. margin: 0 0 18px;
  312. .tag-view:deep(.uni-tag){
  313. display: inline;
  314. font-size: 20px;
  315. margin-right: 40px;
  316. // height: 40px;
  317. width: 120px;
  318. padding: 6px 20px;
  319. }
  320. }
  321. }
  322. }
  323. }
  324. }
  325. .tab-content{
  326. display: flex;
  327. margin: 8px 10px;
  328. border-radius: 4px;
  329. background-color: #fff;
  330. width: calc(100% - 20px);
  331. height: 100%;
  332. .order-list{
  333. padding: 8px;
  334. display: flex;
  335. width: 100%;
  336. // height: 100%;
  337. .order-list-wrap{
  338. display: flex;
  339. .order-card{
  340. display: flex;
  341. width: 100%;
  342. border-bottom: 1px solid #e6e8ee;;
  343. }
  344. }
  345. }
  346. }
  347. }
  348. }
  349. </style>