index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911
  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. ids.value = []
  284. orderList.value.forEach((x,i)=>{
  285. orderList.value[i].selected = false
  286. })
  287. console.log('yijianshifang >orderList>>forEach', orderList.value)
  288. // ccc.value = '完成'
  289. // const params = {
  290. // token: uni.getStorageSync('token'),
  291. // data:{ids:ids.value.toString()}
  292. // }
  293. // console.log('handleRefresh >params>>666',params)
  294. // const {data:res} = await releaseOrder(params)
  295. // if (res.code === 200) {
  296. // if(ids.value.length>0){
  297. // console.log('ids.value',ids.value)
  298. // ids.value.forEach(x=>{
  299. // console.log('orderList',orderList.value)
  300. // const index = orderList.value.findIndex(y=>y.id == x)
  301. // console.log('orderList index',index)
  302. // if(index>-1){
  303. // console.log('orderList',orderList.value)
  304. // orderList.value.splice(index,1)
  305. // console.log('orderList',orderList.value)
  306. // }
  307. // })
  308. // ids.value = []
  309. // }
  310. // }
  311. },500)
  312. const handleRelease = debounce(async()=>{
  313. console.log('ids.value.length',ids.value.length)
  314. const params = {
  315. token: uni.getStorageSync('token'),
  316. data:{ids:ids.value.toString()}
  317. }
  318. console.log('handleRefresh >params>>666',params)
  319. const {data:res} = await releaseOrder(params)
  320. if (res.code === 200) {
  321. console.log('after releaseOrder ids.value',ids.value)
  322. uni.$showMsg(res.msg, 2000)
  323. }
  324. if(ids.value.length==0){
  325. uni.$showMsg('尚未释放处方',2000)
  326. s.value = '1'
  327. return
  328. } else {
  329. uni.$showMsg(res.msg, 2000)
  330. }
  331. ids.value = []
  332. const paramss = {
  333. token: uni.getStorageSync('token'),
  334. data:JSON.stringify({
  335. currentUserId: parseInt(uni.getStorageSync('userId')),
  336. pageNum: page.value,
  337. pageSize: pageSize.value,
  338. status: tabList.value[tabActive.value].status
  339. })
  340. }
  341. console.log('refresh orderList checkIndex params',paramss)
  342. const {data:ress} = await receiveOrderList(paramss)
  343. if (ress.code === 200) {
  344. total.value = res.total
  345. orderList.value = ress.rows
  346. if(orderList.value.length < pageSize.value){
  347. isBottom.value = true
  348. }
  349. if(tabActive.value ==0){
  350. tabList.value[0].leng = orderList.value.length
  351. }
  352. }
  353. s.value = '1'
  354. console.log('after refresh orderList handleRelease ids.value', ids.value)
  355. },500)
  356. const handleSelect = ()=>{
  357. console.log('handleSelect>>',props.v.id)
  358. emit('emitSelect', props.v.id)
  359. oselected.value = !oselected.value
  360. }
  361. const handleGetOffice = (e)=>{
  362. console.log('handleGetOffice', e.detail.value)
  363. console.log('officeIndex', officeIndex)
  364. console.log('officeIndex', officeIndex)
  365. if(e.detail.value==0){
  366. searchDepartment.value = ''
  367. officeIndex.value = e.detail.value
  368. } else {
  369. officeIndex.value = e.detail.value
  370. searchDepartment.value = officeArr.value[officeIndex.value]
  371. }
  372. }
  373. const handleGetType = (e)=>{
  374. console.log('handleGetType', e.detail.value)
  375. console.log('typeIndex', typeIndex)
  376. console.log('typeArr', typeIndex)
  377. typeIndex.value = e.detail.value
  378. if(typeIndex.value ===1 ){
  379. searchName.value = ''
  380. } else {
  381. searchPreNo.value = ''
  382. }
  383. }
  384. const handleGetTags = (v)=>{
  385. console.log('handleGetTags', v)
  386. if(!searchTags.value.includes(v)) {
  387. searchTags.value.push(v)
  388. } else {
  389. searchTags.value.splice(searchTags.value.indexOf(v), 1)
  390. if(v=='门诊' || v=='住院'){
  391. searchPreMzZy.value = ''
  392. console.log('删除了 v searchPreMzZy.value',v,searchPreMzZy.value)
  393. }
  394. if(v=='男' || v=='女'){
  395. searchSex.value = ''
  396. console.log('删除了 v searchSex.value',v,searchSex.value)
  397. }
  398. if(v=='煎煮' || v=='发药'){
  399. searchStatus.value = ''
  400. console.log('删除了 v searchStatus.value',v,searchStatus.value)
  401. }
  402. }
  403. switch (v) {
  404. case '全部':
  405. if(searchTags.value.includes(v)){
  406. searchTags.value = ['全部']
  407. searchTime.value = []
  408. searchDepartment.value = ''
  409. searchName.value = ''
  410. searchPreNo.value = ''
  411. searchSex.value = ''
  412. searchPreMzZy.value = ''
  413. searchStatus.value = ''
  414. officeIndex.value = 0
  415. }
  416. break
  417. case '门诊':
  418. if(searchTags.value.includes(v)){
  419. if(searchTags.value.includes('住院')){
  420. searchTags.value.splice(searchTags.value.indexOf('住院'), 1)
  421. }
  422. if(searchTags.value.includes('全部')){
  423. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  424. }
  425. searchPreMzZy.value = '1'
  426. }
  427. break
  428. case '住院':
  429. if(searchTags.value.includes(v)){
  430. if(searchTags.value.includes('门诊')){
  431. searchTags.value.splice(searchTags.value.indexOf('门诊'), 1)
  432. }
  433. if(searchTags.value.includes('全部')){
  434. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  435. }
  436. searchPreMzZy.value = '2'
  437. }
  438. break
  439. case '男':
  440. if(searchTags.value.includes(v)){
  441. if(searchTags.value.includes('女')){
  442. searchTags.value.splice(searchTags.value.indexOf('女'), 1)
  443. }
  444. if(searchTags.value.includes('全部')){
  445. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  446. }
  447. searchSex.value = '男'
  448. }
  449. break
  450. case '女':
  451. if(searchTags.value.includes(v)){
  452. if(searchTags.value.includes('男')){
  453. searchTags.value.splice(searchTags.value.indexOf('男'), 1)
  454. }
  455. if(searchTags.value.includes('全部')){
  456. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  457. }
  458. searchSex.value = '女'
  459. }
  460. break
  461. case '煎煮':
  462. if(searchTags.value.includes(v)){
  463. if(searchTags.value.includes('发药')){
  464. searchTags.value.splice(searchTags.value.indexOf('发药'), 1)
  465. }
  466. if(searchTags.value.includes('全部')){
  467. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  468. }
  469. searchStatus.value = '2'
  470. }
  471. break
  472. case '发药':
  473. if(searchTags.value.includes(v)){
  474. if(searchTags.value.includes('煎煮')){
  475. searchTags.value.splice(searchTags.value.indexOf('煎煮'), 1)
  476. }
  477. if(searchTags.value.includes('全部')){
  478. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  479. }
  480. searchStatus.value = '3'
  481. }
  482. break
  483. default:
  484. searchTags.value = ['全部']
  485. }
  486. }
  487. // 更新处方列表
  488. const checkIndex = debounce(async(index) => {
  489. tabActive.value = index
  490. page.value= 1
  491. console.log('index',index)
  492. ids.value = []
  493. reset()
  494. tabName.value = tabList.value[index].title
  495. currentStatus.value = parseInt(tabList.value[index].status)
  496. const token = uni.getStorageSync('token')
  497. const paramss = {
  498. token: uni.getStorageSync('token'),
  499. data:JSON.stringify({
  500. currentUserId: parseInt(uni.getStorageSync('userId')),
  501. pageNum: page.value,
  502. pageSize: pageSize.value,
  503. status: tabList.value[tabActive.value].status
  504. })
  505. }
  506. console.log('checkIndex params',paramss)
  507. const {data:res} = await receiveOrderList(paramss)
  508. if (res.code === 200) {
  509. total.value = res.total
  510. orderList.value = res.rows
  511. if(orderList.value.length < pageSize.value){
  512. isBottom.value = true
  513. }
  514. if(tabActive.value ==0){
  515. tabList.value[0].leng = orderList.value.length
  516. }
  517. }
  518. if(tabActive.value==1) {
  519. const param = {
  520. token: uni.getStorageSync('token'),
  521. // data:JSON.stringify({
  522. // currentUserId: parseInt(uni.getStorageSync('userId')),
  523. // page: page.value,
  524. // pageSize: pageSize.value,
  525. // status: tabList.value[tabActive.value].status
  526. // })
  527. }
  528. console.log('checkIndex param',param)
  529. const {data:res} = await selectDepartment(param)
  530. if (res.code === 200) {
  531. officeArr.value.push(...res.data)
  532. console.log('selectDepartment officeArr.value', officeArr.value)
  533. }
  534. }
  535. },500)
  536. const openTime = ()=>{
  537. proxy.$refs.timeslot.open()
  538. }
  539. const loadMoreList = debounce(async()=>{
  540. if(s.value=='0'){
  541. console.log('一键释放模式中,不需要加载更多')
  542. return
  543. }
  544. console.log('loadMoreList>>>')
  545. if(isBottom.value){
  546. return
  547. }
  548. page.value = page.value +1
  549. const params = {
  550. token: uni.getStorageSync('token'),
  551. data: JSON.stringify({
  552. currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
  553. startTime: searchTime.value[0] || '',
  554. endTime: searchTime.value[1] || '',
  555. name: searchName.value.trim() || '',
  556. preNo: searchPreNo.value || '',
  557. department: searchDepartment.value || '',
  558. prescriptionStatus: searchStatus.value || '',//煎煮发药
  559. sex: searchSex.value || '',
  560. preMzZy: searchPreMzZy.value || '',//门诊住院
  561. pageNum: page.value,
  562. pageSize: pageSize.value,
  563. status: tabList.value[tabActive.value].status
  564. })
  565. }
  566. const {data:res} = await receiveOrderList(params)
  567. console.log('orderList.value before',orderList.value)
  568. if (res.code === 200) {
  569. total.value = res.total
  570. console.log('res.rows after',res.rows)
  571. // res.rows.forEach(item=>{
  572. // orderList.value.push(item)
  573. // })
  574. orderList.value.push(...res.rows)
  575. console.log('orderList.value after',orderList.value)
  576. if(total.value == orderList.value.length){
  577. isBottom.value = true
  578. }
  579. if(tabActive.value ==0){
  580. console.log('tabActive===',)
  581. tabList.value[0].leng = orderList.value.length
  582. }
  583. }
  584. },500)
  585. const loadPreList = debounce(async()=>{
  586. console.log('loadPreList>>>')
  587. if(s.value=='0'){
  588. console.log('一键释放模式中,不需要刷新')
  589. return
  590. }
  591. page.value = 1
  592. const params = {
  593. token: uni.getStorageSync('token'),
  594. data: JSON.stringify({
  595. currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
  596. startTime: searchTime.value[0] || '',
  597. endTime: searchTime.value[1] || '',
  598. name: searchName.value.trim() || '',
  599. preNo: searchPreNo.value || '',
  600. department: searchDepartment.value || '',
  601. prescriptionStatus: searchStatus.value || '',//煎煮发药
  602. sex: searchSex.value || '',
  603. preMzZy: searchPreMzZy.value || '',//门诊住院
  604. pageNum: page.value,
  605. pageSize: pageSize.value,
  606. status: tabList.value[tabActive.value].status
  607. })
  608. }
  609. const {data:res} = await receiveOrderList(params)
  610. if (res.code === 200) {
  611. total.value = res.total
  612. orderList.value = res.rows
  613. if(orderList.value.length < pageSize.value){
  614. isBottom.value = true
  615. }
  616. if(tabActive ==0){
  617. tabList.value[0].leng = orderList.value.length
  618. }
  619. }
  620. },500)
  621. </script>
  622. <style lang="scss">
  623. .main {
  624. display: flex;
  625. flex-direction:column;
  626. justify-content:flex-start;
  627. // height: 2000px;
  628. width: 750rpx;
  629. .nav{
  630. display: flex;
  631. height:74.34rpx;
  632. width: 750rpx;
  633. // position: sticky;
  634. // top: 0;
  635. }
  636. .body{
  637. display: flex;
  638. height:calc(100% - 74.34rpx);
  639. flex-direction:column;
  640. justify-content:flex-start;
  641. .tab-box {
  642. display: flex;
  643. position: sticky;
  644. flex-direction:column;
  645. z-index: 100;
  646. .tab-bar{
  647. height: 62.5rpx;
  648. display: flex;
  649. justify-content:center;
  650. width: 100%;
  651. // border: 1px solid #000;
  652. .tab_item{
  653. display: flex;
  654. flex:1;
  655. justify-content:center;
  656. align-items: center;
  657. font-size: 17.5rpx;
  658. background-color: #fff;
  659. color: #000;
  660. }
  661. .active{
  662. border-bottom: 5rpx solid #18C7B0;
  663. }
  664. }
  665. .search-bar{
  666. display: flex;
  667. background-color: #fff;
  668. border-radius: 4rpx;
  669. .today{
  670. display: flex;
  671. flex-direction:row;
  672. justify-content: flex-start;
  673. .search{
  674. width: 453.75rpx;
  675. margin: 13.75rpx 10.1rpx;
  676. :deep(.uni-easyinput__placeholder-class){
  677. font-size: 15rpx;
  678. }
  679. }
  680. .search-button{
  681. display: flex;
  682. justify-content:center;
  683. align-items: center;
  684. width:112.5rpx;
  685. margin: 13.75rpx 10.1rpx;
  686. font-size: 15rpx;
  687. background-color: #18C7B0;
  688. }
  689. .refresh {
  690. display: flex;
  691. justify-content:center;
  692. align-items: center;
  693. width:120rpx;
  694. margin: 13.75px 8rpx;
  695. font-size: 15rpx;
  696. background-color: #18C7B0;
  697. }
  698. .active{
  699. background-color:#DEDEDE;
  700. }
  701. }
  702. .history{
  703. display: flex;
  704. width: 100%;
  705. .searchchoice{
  706. padding: 0 10rpx;
  707. display: flex;
  708. width: 100%;
  709. flex-direction:column;
  710. font-size: 24rpx;
  711. .row1{
  712. display: flex;
  713. width: 100%;
  714. justify-content:flex-start;
  715. align-items: center;
  716. margin: 10rpx 0 10rpx;
  717. font-size: 15rpx;
  718. .timequan{
  719. display: flex;
  720. justify-content:center;
  721. align-items: center;
  722. :deep(.uni-date__x-input){
  723. font-size: 15rpx;
  724. }
  725. .datepick {
  726. z-index: 999;
  727. width: 300rpx;
  728. margin:0 10rpx;
  729. }
  730. }
  731. }
  732. .row2{
  733. display: flex;
  734. width: 100%;
  735. justify-content:flex-start;
  736. align-items: center;
  737. margin: 0 0 10rpx;
  738. .office{
  739. display: flex;
  740. justify-content:center;
  741. align-items: center;
  742. font-size: 15rpx;
  743. .uni-input{
  744. display: flex;
  745. justify-content:center;
  746. align-items: center;
  747. border:1px solid #e1e5f1;
  748. // font-size: 15rpx;
  749. width:190rpx;
  750. // height: 40rpx;
  751. border-radius: 5rpx;
  752. background-color: #e1e5f1;
  753. margin-right: 10rpx;
  754. }
  755. }
  756. .uni-input{
  757. display: flex;
  758. justify-content:center;
  759. align-items: center;
  760. border:1px solid #e1e5f1;
  761. font-size: 15rpx;
  762. width:100rpx;
  763. height: 40rpx;
  764. border-radius: 5rpx;
  765. background-color: #e1e5f1;
  766. margin-right: 10rpx;
  767. }
  768. .search{
  769. width: 187.5rpx;
  770. // height: 40rpx;
  771. // :deep(.easyinput__content-input){
  772. // // height: 40rpx!important;
  773. // }
  774. :deep(.uni-easyinput__placeholder-class){
  775. font-size: 14rpx;
  776. }
  777. }
  778. .search-button{
  779. display: flex;
  780. justify-content:center;
  781. align-items: center;
  782. width:120rpx;
  783. margin: 8rpx 12rpx;
  784. font-size: 14rpx;
  785. height: 40rpx!important;
  786. color: #fff;
  787. background-color: #18C7B0;
  788. }
  789. }
  790. .row3{
  791. display: flex;
  792. width: 100%;
  793. justify-content:flex-start;
  794. align-items: center;
  795. margin: 0 0 18rpx;
  796. .tag-view:deep(.uni-tag){
  797. display: inline;
  798. font-size: 15rpx;
  799. font-weight:500;
  800. margin-right: 16.67rpx;
  801. // height: 40px;
  802. width: 120rpx;
  803. padding: 6rpx 20rpx;
  804. }
  805. }
  806. }
  807. }
  808. }
  809. }
  810. .tab-content{
  811. display: flex;
  812. margin: 8rpx 10rpx;
  813. border-radius: 4rpx;
  814. background-color: #fff;
  815. width: calc(100% - 20rpx);
  816. height: 980rpx;
  817. z-index:10;
  818. .order-list{
  819. padding: 8rpx;
  820. display: flex;
  821. width: 100%;
  822. // height: 100%;
  823. .text{
  824. display: flex;
  825. width: 750rpx;
  826. justify-content:center;
  827. align-items: flex-start;
  828. .zwsj {
  829. margin-top: 103.13rpx;
  830. width: 640.63rpx;
  831. height: 310rpx;
  832. }
  833. }
  834. .order-list-wrap{
  835. display: flex;
  836. .order-card{
  837. display: flex;
  838. width: 100%;
  839. // border-bottom: 1px solid #e6e8ee;;
  840. }
  841. }
  842. }
  843. }
  844. }
  845. }
  846. </style>