index.vue 26 KB

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