index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871
  1. <template>
  2. <view class="main">
  3. <NavBar :user-info="userInfo" :work-Status="workStatus" @update-user="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}}{{tabActive===0 && index==0 && orderList.length>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" v-if="s=='1'" :disabled="workStatus==='1'?false:true" @click="handleRefresh" :class="workStatus==='1'?'refresh':'refresh active'">{{ccc}}</button>
  19. <button type="primary" v-else @click="handleRelease" :class="'refresh'">完成释放</button>
  20. </view>
  21. <view v-else class="history">
  22. <view class="searchchoice">
  23. <view class="row1">
  24. <view class="timequan">
  25. <text class="time_t">时间区间:</text>
  26. <uni-datetime-picker v-model="searchTime[0]" placeholder="开始时间" type="datetime" :hide-second="true" class="datepick"/>
  27. <uni-datetime-picker v-model="searchTime[1]" placeholder="结束时间" type="datetime" :hide-second="true" class="datepick"/>
  28. <!-- <timeSlot
  29. ref="timeslot"
  30. :title="'选择时间段'"
  31. @confirm="confirmTime">
  32. </timeSlot> -->
  33. <!-- <el-date-picker
  34. v-model="searchTime"
  35. type="datetimerange"
  36. range-separator="-"
  37. start-placeholder="开始时间"
  38. end-placeholder="结束时间"
  39. /> -->
  40. </view>
  41. </view>
  42. <view class="row2">
  43. <view class="office">
  44. <view class="time_t">
  45. 科室:
  46. </view>
  47. <picker @change="handleGetOffice" placeholder="请选择" :value="officeIndex" :range="officeArr">
  48. <view class="uni-input">{{officeArr[officeIndex]}}</view>
  49. </picker>
  50. </view>
  51. <view class="presid">
  52. <picker @change="handleGetType" :value="typeIndex" :range="typeArr">
  53. <view class="uni-input">{{typeArr[typeIndex]}}</view>
  54. </picker>
  55. </view>
  56. <view v-if="typeIndex === 0" class="search">
  57. <uni-easyinput prefixIcon="search" v-model="searchName" placeholder="请输入姓名" />
  58. </view>
  59. <view v-else class="search">
  60. <uni-easyinput prefixIcon="search" v-model="searchPreNo" placeholder="请输入处方号" />
  61. </view>
  62. <button type="primary" @click="handleSearch" class="search-button">搜索</button>
  63. </view>
  64. <view class="row3">
  65. <view class="tag-view" v-for="(v, i) in tags" :key="i">
  66. <uni-tag :circle="true" :inverted="!searchTags.includes(v)" :text=v @click="handleGetTags(v)" />
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="tab-content">
  74. <view class="order-list">
  75. <scroll-view
  76. v-if="orderList.length > 0"
  77. class="order-list-wrap"
  78. scroll-y="true"
  79. :scroll-top="50"
  80. @scrolltoupper="loadPreList"
  81. @scrolltolower="loadMoreList"
  82. >
  83. <template v-for="(v,i) in orderList" :key="i">
  84. <orderCard v-if="v " :s="s" :v="v" :work-Status="workStatus" :c="tabActive"
  85. @emit-select="emitSelect"
  86. />
  87. </template>
  88. <view v-if="isBottom" class="order-bottom">
  89. <view class="text">-- 没有更多数据 --</view>
  90. </view>
  91. </scroll-view>
  92. <view v-else class="text">
  93. <image class="zwsj" aspectFill :src="'/static/zwsj.png'" />
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. </template>
  100. <script setup>
  101. import NavBar from "@/components/nav-bar/nav-bar.vue"
  102. import OrderCard from "@/components/order-card/order-card.vue"
  103. import { onMounted,ref, getCurrentInstance } from 'vue'
  104. import { onLoad, onPullDownRefresh } from "@dcloudio/uni-app"
  105. import {receiveOrderList, selectDepartment } from "@/static/js/api.js"
  106. import {releaseOrder} from "@/static/js/request.js"
  107. import debounce from 'lodash.debounce'
  108. // import { ID_INJECTION_KEY } from 'element-plus'
  109. const userInfo = ref({})
  110. const workStatus = ref('0')
  111. const tabList = ref([
  112. {title:"今日待完成", status: '0', leng:0},
  113. {title:"历史处方", status: '1'},
  114. ])
  115. const currentStatus = ref(0)
  116. const tabActive = ref(0) // 当前tab Index
  117. const tabName = ref('今日待完成') // 当前tab Name
  118. // const tags = ref([])
  119. const orderList = ref([
  120. // {id:1,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'},
  121. // {id:2,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'},
  122. // {id:3,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'},
  123. // {id:4,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'},
  124. // {id:5,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'}
  125. ])
  126. const isBottom = ref(false) // 是否触底
  127. const officeArr = ref(['全部'])
  128. const officeIndex = ref(0)
  129. const typeArr = ref(['姓名:','处方号:'])
  130. const typeIndex = ref(0)
  131. const searchVal = ref('')
  132. const searchTime =ref([])
  133. const searchDepartment = ref('')
  134. const searchName = ref('')
  135. const searchPreNo = ref('')
  136. const searchSex = ref('')
  137. const searchPreMzZy = ref('')
  138. const searchStatus = ref('')
  139. const searchTags = ref([])
  140. const tags = ref(['全部','门诊','住院','男','女','煎煮','发药'])
  141. const deployArr = ref([
  142. {name:'抓药', id: '1' },
  143. {name:'复核', id: '2' },
  144. {name:'浸泡', id: '3' },
  145. {name:'煎煮', id: '4' },
  146. {name:'打包', id: '5' },
  147. ])
  148. const page = ref(1)
  149. const pageSize = ref(10)
  150. const total = ref(0)
  151. const status = ref('')
  152. const s = ref('1')
  153. const ccc = ref('一键释放')
  154. const ids = ref([])
  155. const today =ref({
  156. leng: 0,
  157. })
  158. // app.provide(ID_INJECTION_KEY, {
  159. // prefix: Math.floor(Math.random() * 10000),
  160. // current: 0,
  161. // })
  162. const {proxy} = getCurrentInstance()
  163. onMounted(() => {
  164. })
  165. onLoad(async () => {
  166. const token = uni.getStorageSync('token')
  167. userInfo.value.name = uni.getStorageSync('username')
  168. workStatus.value = uni.getStorageSync('workStatus') || '0'
  169. const params = {
  170. token: token,
  171. data:JSON.stringify({
  172. currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
  173. pageNum: page.value,
  174. pageSize: pageSize.value,
  175. status: '0'
  176. })
  177. }
  178. const {data:res} = await receiveOrderList(params)
  179. if (res.code === 200) {
  180. total.value = res.total
  181. orderList.value = res.rows
  182. if(orderList.value.length < pageSize.value){
  183. isBottom.value = true
  184. }
  185. if(tabActive.value ==0){
  186. tabList.value[0].leng = orderList.value.length
  187. }
  188. }
  189. })
  190. const reset = ()=>{
  191. searchTime.value =[]
  192. officeIndex.value =0
  193. searchName.value =''
  194. searchPreNo.value =''
  195. searchSex.value =''
  196. searchPreMzZy.value =''
  197. searchStatus.value =''
  198. searchVal.value = ''
  199. officeArr.value = ['全部']
  200. }
  201. // 子传父,更新userInfo
  202. const updateUser = (v)=>{
  203. console.log('updateUserStatus', v)
  204. workStatus.value = v+''
  205. console.log('workStatus.value', workStatus.value)
  206. }
  207. const emitSelect = (v)=>{
  208. console.log('emitSelect', v)
  209. // 查在ids中查找v,如果存在就删除,如果不存在就添加
  210. const index = ids.value.findIndex(x=>x==v)
  211. if (index>-1){
  212. ids.value.splice(index, 1)
  213. } else {
  214. ids.value.push(v)
  215. }
  216. }
  217. const handleSearch = debounce(async()=>{
  218. console.log('handleSearch searchPreMzZy',searchPreMzZy.value)
  219. console.log('handleSearch searchStatus',searchStatus.value)
  220. console.log('handleSearch searchSex',searchSex.value)
  221. if(tabActive.value ===0) {
  222. const params = {
  223. token: uni.getStorageSync('token'),
  224. data: JSON.stringify({
  225. currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
  226. name: searchVal.value.trim(),
  227. pageNum: page.value,
  228. pageSize: pageSize.value,
  229. status: tabList.value[tabActive.value].status,
  230. })
  231. }
  232. const {data:res} = await receiveOrderList(params)
  233. if (res.code === 200) {
  234. total.value = res.total
  235. orderList.value = res.rows
  236. if(orderList.value.length < pageSize.value){
  237. isBottom.value = true
  238. }
  239. }
  240. }
  241. if(tabActive.value==1){
  242. const params = {
  243. token: uni.getStorageSync('token'),
  244. data: JSON.stringify({
  245. currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
  246. startTime: searchTime.value[0] || '',
  247. endTime: searchTime.value[1] || '',
  248. name: searchName.value.trim() || '',
  249. preNo: searchPreNo.value || '',
  250. department: searchDepartment.value || '',
  251. prescriptionStatus: searchStatus.value || '',//煎煮发药
  252. sex: searchSex.value || '',
  253. preMzZy: searchPreMzZy.value || '',//门诊住院
  254. pageNum: page.value,
  255. pageSize: pageSize.value,
  256. status: tabList.value[tabActive.value].status
  257. })
  258. }
  259. console.log('历史记录查询params',params)
  260. const {data:res} = await receiveOrderList(params)
  261. if (res.code === 200) {
  262. total.value = res.total
  263. orderList.value = res.rows
  264. if(orderList.value.length < pageSize.value){
  265. isBottom.value = true
  266. }
  267. if(tabActive.value ==0){
  268. tabList.value[0].leng = orderList.value.length
  269. }
  270. }
  271. }
  272. },500)
  273. const handleRefresh = debounce(()=>{
  274. console.log('yijianshifang >orderList>>', orderList.value)
  275. // let ids = ''
  276. // orderList.value.forEach((v)=>{if(v.id){
  277. // ids= ids+v.id+','
  278. // console.log('yijianshifang >orderList>>',ids)
  279. // }})
  280. // console.log('yijianshifang >orderList>>666',ids)
  281. s.value = '0'
  282. console.log('handleRefresh>>ids.value ',ids.value)
  283. // ccc.value = '完成'
  284. // const params = {
  285. // token: uni.getStorageSync('token'),
  286. // data:{ids:ids.value.toString()}
  287. // }
  288. // console.log('handleRefresh >params>>666',params)
  289. // const {data:res} = await releaseOrder(params)
  290. // if (res.code === 200) {
  291. // if(ids.value.length>0){
  292. // console.log('ids.value',ids.value)
  293. // ids.value.forEach(x=>{
  294. // console.log('orderList',orderList.value)
  295. // const index = orderList.value.findIndex(y=>y.id == x)
  296. // console.log('orderList index',index)
  297. // if(index>-1){
  298. // console.log('orderList',orderList.value)
  299. // orderList.value.splice(index,1)
  300. // console.log('orderList',orderList.value)
  301. // }
  302. // })
  303. // ids.value = []
  304. // }
  305. // }
  306. },500)
  307. const handleRelease = debounce(async()=>{
  308. const params = {
  309. token: uni.getStorageSync('token'),
  310. data:{ids:ids.value.toString()}
  311. }
  312. console.log('handleRefresh >params>>666',params)
  313. const {data:res} = await releaseOrder(params)
  314. if (res.code === 200) {
  315. if(ids.value.length>0){
  316. console.log('ids.value',ids.value)
  317. ids.value.forEach(x=>{
  318. console.log('orderList',orderList.value)
  319. const index = orderList.value.findIndex(y=>y.id == x)
  320. console.log('orderList index',index)
  321. if(index>-1){
  322. console.log('orderList',orderList.value)
  323. orderList.value.splice(index,1)
  324. console.log('orderList',orderList.value)
  325. }
  326. })
  327. ids.value = []
  328. uni.$showMsg(res.msg, 2000)
  329. }
  330. } else {
  331. uni.$showMsg(res.msg, 2000)
  332. }
  333. s.value = '1'
  334. console.log('after handleRelease ids.value', ids.value)
  335. },500)
  336. const handleGetOffice = (e)=>{
  337. console.log('handleGetOffice', e.detail.value)
  338. console.log('officeIndex', officeIndex)
  339. console.log('officeIndex', officeIndex)
  340. if(e.detail.value==0){
  341. searchDepartment.value = ''
  342. officeIndex.value = e.detail.value
  343. } else {
  344. officeIndex.value = e.detail.value
  345. searchDepartment.value = officeArr.value[officeIndex.value]
  346. }
  347. }
  348. const handleGetType = (e)=>{
  349. console.log('handleGetType', e.detail.value)
  350. console.log('typeIndex', typeIndex)
  351. console.log('typeArr', typeIndex)
  352. typeIndex.value = e.detail.value
  353. if(typeIndex.value ===1 ){
  354. searchName.value = ''
  355. } else {
  356. searchPreNo.value = ''
  357. }
  358. }
  359. const handleGetTags = (v)=>{
  360. console.log('handleGetTags', v)
  361. if(!searchTags.value.includes(v)) {
  362. searchTags.value.push(v)
  363. } else {
  364. searchTags.value.splice(searchTags.value.indexOf(v), 1)
  365. if(v=='门诊' || v=='住院'){
  366. searchPreMzZy.value = ''
  367. console.log('删除了 v searchPreMzZy.value',v,searchPreMzZy.value)
  368. }
  369. if(v=='男' || v=='女'){
  370. searchSex.value = ''
  371. console.log('删除了 v searchSex.value',v,searchSex.value)
  372. }
  373. if(v=='煎煮' || v=='发药'){
  374. searchStatus.value = ''
  375. console.log('删除了 v searchStatus.value',v,searchStatus.value)
  376. }
  377. }
  378. switch (v) {
  379. case '全部':
  380. if(searchTags.value.includes(v)){
  381. searchTags.value = ['全部']
  382. searchTime.value = []
  383. searchDepartment.value = ''
  384. searchName.value = ''
  385. searchPreNo.value = ''
  386. searchSex.value = ''
  387. searchPreMzZy.value = ''
  388. searchStatus.value = ''
  389. officeIndex.value = 0
  390. }
  391. break
  392. case '门诊':
  393. if(searchTags.value.includes(v)){
  394. if(searchTags.value.includes('住院')){
  395. searchTags.value.splice(searchTags.value.indexOf('住院'), 1)
  396. }
  397. if(searchTags.value.includes('全部')){
  398. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  399. }
  400. searchPreMzZy.value = '1'
  401. }
  402. break
  403. case '住院':
  404. if(searchTags.value.includes(v)){
  405. if(searchTags.value.includes('门诊')){
  406. searchTags.value.splice(searchTags.value.indexOf('门诊'), 1)
  407. }
  408. if(searchTags.value.includes('全部')){
  409. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  410. }
  411. searchPreMzZy.value = '2'
  412. }
  413. break
  414. case '男':
  415. if(searchTags.value.includes(v)){
  416. if(searchTags.value.includes('女')){
  417. searchTags.value.splice(searchTags.value.indexOf('女'), 1)
  418. }
  419. if(searchTags.value.includes('全部')){
  420. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  421. }
  422. searchSex.value = '男'
  423. }
  424. break
  425. case '女':
  426. if(searchTags.value.includes(v)){
  427. if(searchTags.value.includes('男')){
  428. searchTags.value.splice(searchTags.value.indexOf('男'), 1)
  429. }
  430. if(searchTags.value.includes('全部')){
  431. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  432. }
  433. searchSex.value = '女'
  434. }
  435. break
  436. case '煎煮':
  437. if(searchTags.value.includes(v)){
  438. if(searchTags.value.includes('发药')){
  439. searchTags.value.splice(searchTags.value.indexOf('发药'), 1)
  440. }
  441. if(searchTags.value.includes('全部')){
  442. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  443. }
  444. searchStatus.value = '2'
  445. }
  446. break
  447. case '发药':
  448. if(searchTags.value.includes(v)){
  449. if(searchTags.value.includes('煎煮')){
  450. searchTags.value.splice(searchTags.value.indexOf('煎煮'), 1)
  451. }
  452. if(searchTags.value.includes('全部')){
  453. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  454. }
  455. searchStatus.value = '3'
  456. }
  457. break
  458. default:
  459. searchTags.value = ['全部']
  460. }
  461. }
  462. // 更新处方列表
  463. const checkIndex = debounce(async(index) => {
  464. tabActive.value = index
  465. page.value= 1
  466. console.log('index',index)
  467. ids.value = []
  468. reset()
  469. tabName.value = tabList.value[index].title
  470. currentStatus.value = parseInt(tabList.value[index].status)
  471. const token = uni.getStorageSync('token')
  472. const paramss = {
  473. token: uni.getStorageSync('token'),
  474. data:JSON.stringify({
  475. currentUserId: parseInt(uni.getStorageSync('userId')),
  476. pageNum: page.value,
  477. pageSize: pageSize.value,
  478. status: tabList.value[tabActive.value].status
  479. })
  480. }
  481. console.log('checkIndex params',paramss)
  482. const {data:res} = await receiveOrderList(paramss)
  483. if (res.code === 200) {
  484. total.value = res.total
  485. orderList.value = res.rows
  486. if(orderList.value.length < pageSize.value){
  487. isBottom.value = true
  488. }
  489. if(tabActive.value ==0){
  490. tabList.value[0].leng = orderList.value.length
  491. }
  492. }
  493. if(tabActive.value==1) {
  494. const param = {
  495. token: uni.getStorageSync('token'),
  496. // data:JSON.stringify({
  497. // currentUserId: parseInt(uni.getStorageSync('userId')),
  498. // page: page.value,
  499. // pageSize: pageSize.value,
  500. // status: tabList.value[tabActive.value].status
  501. // })
  502. }
  503. console.log('checkIndex param',param)
  504. const {data:res} = await selectDepartment(param)
  505. if (res.code === 200) {
  506. officeArr.value.push(...res.data)
  507. console.log('selectDepartment officeArr.value', officeArr.value)
  508. }
  509. }
  510. },500)
  511. const openTime = ()=>{
  512. proxy.$refs.timeslot.open()
  513. }
  514. const loadMoreList = debounce(async()=>{
  515. console.log('loadMoreList>>>')
  516. if(isBottom){
  517. return
  518. }
  519. page.value = page.value +1
  520. const params = {
  521. token: uni.getStorageSync('token'),
  522. data: JSON.stringify({
  523. currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
  524. startTime: searchTime.value[0] || '',
  525. endTime: searchTime.value[1] || '',
  526. name: searchName.value.trim() || '',
  527. preNo: searchPreNo.value || '',
  528. department: searchDepartment.value || '',
  529. prescriptionStatus: searchStatus.value || '',//煎煮发药
  530. sex: searchSex.value || '',
  531. preMzZy: searchPreMzZy.value || '',//门诊住院
  532. pageNum: page.value,
  533. pageSize: pageSize.value,
  534. status: tabList.value[tabActive.value].status
  535. })
  536. }
  537. const {data:res} = await receiveOrderList(params)
  538. console.log('orderList.value before',orderList.value)
  539. if (res.code === 200) {
  540. total.value = res.total
  541. if(total.value< pageSize.value){
  542. isBottom.value = true
  543. }
  544. console.log('res.rows after',res.rows)
  545. res.rows.forEach(item=>{
  546. orderList.value.push(item)
  547. })
  548. console.log('orderList.value after',orderList.value)
  549. if(tabActive.value ==0){
  550. console.log('tabActive===',)
  551. tabList.value[0].leng = orderList.value.length
  552. }
  553. }
  554. },500)
  555. const loadPreList = debounce(async()=>{
  556. console.log('loadPreList>>>')
  557. page.value = 1
  558. const params = {
  559. token: uni.getStorageSync('token'),
  560. data: JSON.stringify({
  561. currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
  562. startTime: searchTime.value[0] || '',
  563. endTime: searchTime.value[1] || '',
  564. name: searchName.value.trim() || '',
  565. preNo: searchPreNo.value || '',
  566. department: searchDepartment.value || '',
  567. prescriptionStatus: searchStatus.value || '',//煎煮发药
  568. sex: searchSex.value || '',
  569. preMzZy: searchPreMzZy.value || '',//门诊住院
  570. pageNum: page.value,
  571. pageSize: pageSize.value,
  572. status: tabList.value[tabActive.value].status
  573. })
  574. }
  575. const {data:res} = await receiveOrderList(params)
  576. if (res.code === 200) {
  577. total.value = res.total
  578. orderList.value = res.rows
  579. if(orderList.value.length < pageSize.value){
  580. isBottom.value = true
  581. }
  582. if(tabActive ==0){
  583. tabList.value[0].leng = orderList.value.length
  584. }
  585. }
  586. },500)
  587. </script>
  588. <style lang="scss">
  589. .main {
  590. display: flex;
  591. flex-direction:column;
  592. justify-content:flex-start;
  593. // height: 2000px;
  594. width: 750rpx;
  595. .nav{
  596. display: flex;
  597. height:74.34rpx;
  598. width: 750rpx;
  599. // position: sticky;
  600. // top: 0;
  601. }
  602. .body{
  603. display: flex;
  604. height:calc(100% - 74.34rpx);
  605. flex-direction:column;
  606. justify-content:flex-start;
  607. .tab-box {
  608. display: flex;
  609. position: sticky;
  610. flex-direction:column;
  611. z-index: 100;
  612. .tab-bar{
  613. height: 62.5rpx;
  614. display: flex;
  615. justify-content:center;
  616. width: 100%;
  617. // border: 1px solid #000;
  618. .tab_item{
  619. display: flex;
  620. flex:1;
  621. justify-content:center;
  622. align-items: center;
  623. font-size: 17.5rpx;
  624. background-color: #fff;
  625. color: #000;
  626. }
  627. .active{
  628. border-bottom: 5rpx solid #18C7B0;
  629. }
  630. }
  631. .search-bar{
  632. display: flex;
  633. background-color: #fff;
  634. border-radius: 4rpx;
  635. .today{
  636. display: flex;
  637. flex-direction:row;
  638. justify-content: flex-start;
  639. .search{
  640. width: 453.75rpx;
  641. margin: 13.75rpx 10.1rpx;
  642. :deep(.uni-easyinput__placeholder-class){
  643. font-size: 15rpx;
  644. }
  645. }
  646. .search-button{
  647. display: flex;
  648. justify-content:center;
  649. align-items: center;
  650. width:112.5rpx;
  651. margin: 13.75rpx 10.1rpx;
  652. font-size: 15rpx;
  653. background-color: #18C7B0;
  654. }
  655. .refresh {
  656. display: flex;
  657. justify-content:center;
  658. align-items: center;
  659. width:120rpx;
  660. margin: 13.75px 8rpx;
  661. font-size: 15rpx;
  662. background-color: #18C7B0;
  663. }
  664. .active{
  665. background-color:#DEDEDE;
  666. }
  667. }
  668. .history{
  669. display: flex;
  670. width: 100%;
  671. .searchchoice{
  672. padding: 0 10rpx;
  673. display: flex;
  674. width: 100%;
  675. flex-direction:column;
  676. font-size: 24rpx;
  677. .row1{
  678. display: flex;
  679. width: 100%;
  680. justify-content:flex-start;
  681. align-items: center;
  682. margin: 10rpx 0 10rpx;
  683. font-size: 15rpx;
  684. .timequan{
  685. display: flex;
  686. justify-content:center;
  687. align-items: center;
  688. :deep(.uni-date__x-input){
  689. font-size: 15rpx;
  690. }
  691. .datepick {
  692. z-index: 999;
  693. width: 300rpx;
  694. margin:0 10rpx;
  695. }
  696. }
  697. }
  698. .row2{
  699. display: flex;
  700. width: 100%;
  701. justify-content:flex-start;
  702. align-items: center;
  703. margin: 0 0 10rpx;
  704. .office{
  705. display: flex;
  706. justify-content:center;
  707. align-items: center;
  708. font-size: 15rpx;
  709. .uni-input{
  710. display: flex;
  711. justify-content:center;
  712. align-items: center;
  713. border:1px solid #e1e5f1;
  714. // font-size: 15rpx;
  715. width:190rpx;
  716. // height: 40rpx;
  717. border-radius: 5rpx;
  718. background-color: #e1e5f1;
  719. margin-right: 10rpx;
  720. }
  721. }
  722. .uni-input{
  723. display: flex;
  724. justify-content:center;
  725. align-items: center;
  726. border:1px solid #e1e5f1;
  727. font-size: 15rpx;
  728. width:100rpx;
  729. height: 40rpx;
  730. border-radius: 5rpx;
  731. background-color: #e1e5f1;
  732. margin-right: 10rpx;
  733. }
  734. .search{
  735. width: 187.5rpx;
  736. // height: 40rpx;
  737. // :deep(.easyinput__content-input){
  738. // // height: 40rpx!important;
  739. // }
  740. :deep(.uni-easyinput__placeholder-class){
  741. font-size: 14rpx;
  742. }
  743. }
  744. .search-button{
  745. display: flex;
  746. justify-content:center;
  747. align-items: center;
  748. width:120rpx;
  749. margin: 8rpx 12rpx;
  750. font-size: 14rpx;
  751. height: 40rpx!important;
  752. color: #fff;
  753. background-color: #18C7B0;
  754. }
  755. }
  756. .row3{
  757. display: flex;
  758. width: 100%;
  759. justify-content:flex-start;
  760. align-items: center;
  761. margin: 0 0 18rpx;
  762. .tag-view:deep(.uni-tag){
  763. display: inline;
  764. font-size: 15rpx;
  765. font-weight:500;
  766. margin-right: 16.67rpx;
  767. // height: 40px;
  768. width: 120rpx;
  769. padding: 6rpx 20rpx;
  770. }
  771. }
  772. }
  773. }
  774. }
  775. }
  776. .tab-content{
  777. display: flex;
  778. margin: 8rpx 10rpx;
  779. border-radius: 4rpx;
  780. background-color: #fff;
  781. width: calc(100% - 20rpx);
  782. height: 980rpx;
  783. z-index:10;
  784. .order-list{
  785. padding: 8rpx;
  786. display: flex;
  787. width: 100%;
  788. // height: 100%;
  789. .text{
  790. display: flex;
  791. width: 750rpx;
  792. justify-content:center;
  793. align-items: flex-start;
  794. .zwsj {
  795. margin-top: 103.13rpx;
  796. width: 640.63rpx;
  797. height: 310rpx;
  798. }
  799. }
  800. .order-list-wrap{
  801. display: flex;
  802. .order-card{
  803. display: flex;
  804. width: 100%;
  805. // border-bottom: 1px solid #e6e8ee;;
  806. }
  807. }
  808. }
  809. }
  810. }
  811. }
  812. </style>