index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113
  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}}</text>
  10. </view>
  11. </view>
  12. <view class="search-bar">
  13. <view v-if="tabActive === 0" class="today">
  14. <!-- 搜索框注销
  15. <view class="search">
  16. <uni-easyinput prefixIcon="search" v-model="searchVal" placeholder="请输入姓名" />
  17. </view> -->
  18. <!-- 6.2、新增三个字段展示位置 20240105 neo-->
  19. <view class="tongji">
  20. <span class="tongji-kongxi" style="background-color: antiquewhite;height: 40rpx;display: flex;justify-content:center;align-items: center;">待调配处方数:{{tongji.dtpcfs}}张</span>
  21. <span class="tongji-kongxi">已调配处方数:{{tongji.ytpcfs}}张</span>
  22. <span class="tongji-kongxi">已调配处方剂数:{{tongji.ytpcfjs}}剂</span>
  23. </view>
  24. <button type="primary" @click="handleSearch" class="search-button">刷 新</button>
  25. </view>
  26. <view v-else class="history">
  27. <view class="searchchoice">
  28. <view class="row1">
  29. <view class="timequan">
  30. <text class="time_t">时间区间:</text>
  31. <uni-datetime-picker v-model="searchTime[0]" placeholder="开始时间" type="datetime" :hide-second="true" class="datepick"/>
  32. <uni-datetime-picker v-model="searchTime[1]" placeholder="结束时间" type="datetime" :hide-second="true" class="datepick"/>
  33. </view>
  34. </view>
  35. <view class="row2">
  36. <view class="office">
  37. <view class="time_t">
  38. 科室:
  39. </view>
  40. <picker @change="handleGetOffice" placeholder="请选择" :value="officeIndex" :range="officeArr">
  41. <view class="uni-input">{{officeArr[officeIndex]}}</view>
  42. </picker>
  43. </view>
  44. <view class="presid">
  45. <picker @change="handleGetType" :value="typeIndex" :range="typeArr">
  46. <view class="uni-input">{{typeArr[typeIndex]}}</view>
  47. </picker>
  48. </view>
  49. <view v-if="typeIndex === 0" class="search">
  50. <uni-easyinput prefixIcon="search" v-model="searchName" placeholder="请输入姓名" />
  51. </view>
  52. <view v-else class="search">
  53. <uni-easyinput prefixIcon="search" v-model="searchPreNo" placeholder="请输入处方号" />
  54. </view>
  55. <button type="primary" @click="handleSearch" class="search-button">搜索</button>
  56. </view>
  57. <view class="row3">
  58. <view class="tag-view" v-for="(v, i) in tags" :key="i">
  59. <uni-tag :circle="true" :inverted="!searchTags.includes(v)" :text=v @click="handleGetTags(v)" />
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="tab-content" :style="tabActive === 1?'height:880rpx!important':''">
  67. <view class="order-list">
  68. <scroll-view
  69. v-if="orderList.length > 0"
  70. class="order-list-wrap"
  71. scroll-y="true"
  72. :scroll-top="0"
  73. refresher-enabled="true"
  74. :refresher-triggered="trigger"
  75. @refresherrefresh="loadPreList"
  76. @scrolltolower="loadMoreList"
  77. >
  78. <!-- @scrolltoupper="loadPreList" -->
  79. <template v-for="(v,i) in orderList" :key="i">
  80. <orderCard v-if="v " :s="s" :v="v" :work-Status="workStatus" :c="tabActive"
  81. @emit-select="emitSelect"
  82. />
  83. </template>
  84. <view v-if="isBottom" class="order-bottom">
  85. <view class="text" style="margin-top: 30rpx;font-size: 20rpx;color: #18C7B0;">-- 没有更多数据 --</view>
  86. </view>
  87. </scroll-view>
  88. <view v-else class="text">
  89. <image class="zwsj" aspectFill :src="'/static/zwsj.png'" />
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. <uni-popup ref="message" type="message">
  95. <uni-popup-message type="warn" message="您有一个新的处方" :duration="2000"></uni-popup-message>
  96. </uni-popup>
  97. <button class="tiaopei" @click="handletiaopei">
  98. <span class="tiaopei-wenzi">调配扫码</span>
  99. </button>
  100. <button class="fuhe" @click="handleScanbara">
  101. <span class="fuhe-wenzi">复核扫码</span>
  102. </button>
  103. </view>
  104. </template>
  105. <script setup>
  106. import NavBar from "@/components/nav-bar/nav-bar.vue"
  107. import OrderCard from "@/components/order-card/order-card.vue"
  108. import { onMounted,ref, getCurrentInstance } from 'vue'
  109. import { onLoad, onPullDownRefresh } from "@dcloudio/uni-app"
  110. import {receiveOrderList, selectDepartment, getIp } from "@/static/js/api.js"
  111. import {releaseOrder} from "@/static/js/request.js"
  112. import debounce from 'lodash.debounce'
  113. import {updateWorkStatus, updateOnlineStatus, saveReview } from "@/static/js/api.js"
  114. // import { ID_INJECTION_KEY } from 'element-plus'
  115. const trigger = ref(false)
  116. const userInfo = ref({
  117. ip:'',
  118. port:'9100'
  119. })
  120. const workStatus = ref('0')
  121. const tabList = ref([
  122. {title:"今日待完成", status: '0', leng:0},
  123. {title:"历史处方", status: '1'},
  124. ])
  125. const currentStatus = ref(0)
  126. const tabActive = ref(0)
  127. const tabName = ref('今日待完成')
  128. // const tags = ref([])
  129. const orderList = ref([])
  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. // 新增的三个统计字段
  163. const tongji = ref({
  164. dtpcfs:'',
  165. ytpcfs:'',
  166. ytpcfjs: ''
  167. })
  168. const plug= uni.requireNativePlugin('Html5app-Gprinter')
  169. const {proxy} = getCurrentInstance()
  170. onMounted(async() => {
  171. userInfo.value.ip = uni.getStorageSync('printerIp')
  172. userInfo.value.username = uni.getStorageSync('username')
  173. if (userInfo.value.ip =='') {
  174. const {data: res} = await getIp({
  175. token:uni.getStorageSync('token'),
  176. data:JSON.stringify({
  177. userId: uni.getStorageSync('userId')+''
  178. })
  179. })
  180. if(res.code === 200){
  181. userInfo.value.ip = res.data.ip || ''
  182. userInfo.value.port = res.data.port || ''
  183. }
  184. }
  185. const ipReg = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/
  186. if(ipReg.test(userInfo.value.ip)){
  187. if(RegExp.$1<256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256){
  188. plug.connectIP({"ip":userInfo.value.ip,"port":userInfo.value.port},ret=>{
  189. const res = JSON.parse(JSON.stringify(ret))
  190. if(res.code==3){
  191. // initPrint.value = true
  192. uni.setStorageSync('hasPrinter', '1')
  193. uni.setStorageSync('printerIp', userInfo.value.ip)
  194. // _this.tip=JSON.stringify(ret);
  195. // console.log(_this.tip);
  196. // 关闭配置页操作
  197. }
  198. })
  199. }
  200. }
  201. })
  202. onLoad(async (option) => {
  203. console.log('>>>>>666',option)
  204. if(option.tips == '1') {
  205. console.log('>>>>>777',option)
  206. // plus.nativeUI.toast("I'am toast information!");
  207. }
  208. const token = uni.getStorageSync('token')
  209. uni.$on('notf',(data)=>{
  210. console.log('index get notfi>>>>')
  211. // proxy.$refs.message.open()
  212. })
  213. // userInfo.value.username = uni.getStorageSync('username')
  214. userInfo.value.nickName = uni.getStorageSync('nickName')
  215. userInfo.value.ip = uni.getStorageSync('printerIp') || ''
  216. workStatus.value = uni.getStorageSync('workStatus') || '0'
  217. const params = {
  218. token: token,
  219. data:JSON.stringify({
  220. currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
  221. pageNum: page.value,
  222. pageSize: pageSize.value,
  223. status: '0'
  224. })
  225. }
  226. const {data:res} = await receiveOrderList(params)
  227. if (res.code === 200) {
  228. total.value = res.total
  229. orderList.value = res.rows
  230. console.log("orderList---",orderList)
  231. console.log('测试列表----',res)
  232. console.log("cetongji---------------",res.extra)
  233. // 新增三个统计
  234. tongji.value.dtpcfs = res.extra.dtpcfs
  235. tongji.value.ytpcfs = res.extra.ytpcfs
  236. tongji.value.ytpcfjs = res.extra.ytpcfjs
  237. console.log('res20231222',orderList.value.length)
  238. if(total.value == orderList.value.length){
  239. isBottom.value = true
  240. } else {
  241. isBottom.value = false
  242. }
  243. if(tabActive.value ==0){
  244. tabList.value[0].leng = orderList.value.length
  245. if(tabList.value[0].leng>0){
  246. tabList.value[0].title = tabName.value //+ '(' + tabList.value[0].leng + ')'
  247. }
  248. }
  249. }
  250. })
  251. const reset = ()=>{
  252. searchTime.value =[]
  253. officeIndex.value =0
  254. searchName.value =''
  255. searchPreNo.value =''
  256. searchSex.value =''
  257. searchPreMzZy.value =''
  258. searchStatus.value =''
  259. searchVal.value = ''
  260. officeArr.value = ['全部']
  261. }
  262. // 子传父,更新userInfo
  263. const updateUser = (v)=>{
  264. workStatus.value = v+''
  265. }
  266. const emitSelect = (v)=>{
  267. const index1 = orderList.value.findIndex(x=>x.id==v.id)
  268. if (index1>-1){
  269. orderList.value[index1].selected = v.selected
  270. }
  271. // 查在ids中查找v,如果存在就删除,如果不存在就添加
  272. const index = ids.value.findIndex(x=>x==v.id)
  273. if (index>-1){
  274. ids.value.splice(index, 1)
  275. } else {
  276. ids.value.push(v.id)
  277. }
  278. }
  279. const handleSearch = debounce(async()=>{
  280. if(tabActive.value ===0) {
  281. const params = {
  282. token: uni.getStorageSync('token'),
  283. data: JSON.stringify({
  284. currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
  285. name: searchVal.value.trim(),
  286. pageNum: page.value,
  287. pageSize: pageSize.value,
  288. status: tabList.value[tabActive.value].status,
  289. })
  290. }
  291. const {data:res} = await receiveOrderList(params)
  292. if (res.code === 200) {
  293. total.value = res.total
  294. orderList.value = res.rows
  295. if(total.value == orderList.value.length){
  296. isBottom.value = true
  297. } else {
  298. isBottom.value = false
  299. }
  300. }
  301. }
  302. if(tabActive.value==1){
  303. const params = {
  304. token: uni.getStorageSync('token'),
  305. data: JSON.stringify({
  306. currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
  307. startTime: searchTime.value[0] || '',
  308. endTime: searchTime.value[1] || '',
  309. name: searchName.value.trim() || '',
  310. preNo: searchPreNo.value || '',
  311. department: searchDepartment.value || '',
  312. prescriptionStatus: searchStatus.value || '',//煎煮发药
  313. sex: searchSex.value || '',
  314. preMzZy: searchPreMzZy.value || '',//门诊住院
  315. pageNum: page.value,
  316. pageSize: pageSize.value,
  317. status: tabList.value[tabActive.value].status
  318. })
  319. }
  320. const {data:res} = await receiveOrderList(params)
  321. if (res.code === 200) {
  322. total.value = res.total
  323. orderList.value = res.rows
  324. if(total.value == orderList.value.length){
  325. isBottom.value = true
  326. } else {
  327. isBottom.value = false
  328. }
  329. if(tabActive.value ==0){
  330. tabList.value[0].leng = orderList.value.length
  331. }
  332. }
  333. }
  334. },500)
  335. const handleRefresh = async()=>{
  336. const params = {
  337. token: uni.getStorageSync('token'),
  338. data: JSON.stringify({
  339. currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
  340. name: searchVal.value.trim(),
  341. pageNum: page.value,
  342. pageSize: pageSize.value,
  343. status: tabList.value[tabActive.value].status,
  344. })
  345. }
  346. const {data:res} = await receiveOrderList(params)
  347. if (res.code === 200) {
  348. total.value = res.total
  349. orderList.value = res.rows
  350. if(total.value == orderList.value.length){
  351. isBottom.value = true
  352. } else {
  353. isBottom.value = false
  354. }
  355. }
  356. s.value = '0'
  357. ids.value = []
  358. orderList.value.forEach((x,i)=>{
  359. orderList.value[i].selected = false
  360. })
  361. }
  362. const handleRelease = async()=>{
  363. const params = {
  364. token: uni.getStorageSync('token'),
  365. data:{ids:ids.value.toString()}
  366. }
  367. const {data:res} = await releaseOrder(params)
  368. if (res.code === 200) {
  369. uni.$showMsg(res.msg, 2000)
  370. }
  371. if(ids.value.length==0){
  372. uni.$showMsg('尚未释放处方',2000)
  373. s.value = '1'
  374. return
  375. } else {
  376. uni.$showMsg(res.msg, 2000)
  377. }
  378. ids.value = []
  379. const paramss = {
  380. token: uni.getStorageSync('token'),
  381. data:JSON.stringify({
  382. currentUserId: parseInt(uni.getStorageSync('userId')),
  383. pageNum: page.value,
  384. pageSize: pageSize.value,
  385. status: tabList.value[tabActive.value].status
  386. })
  387. }
  388. const {data:ress} = await receiveOrderList(paramss)
  389. if (ress.code === 200) {
  390. total.value = ress.total
  391. orderList.value = ress.rows
  392. if(total.value == orderList.value.length){
  393. isBottom.value = true
  394. } else {
  395. isBottom.value = false
  396. }
  397. if(tabActive.value ==0){
  398. tabList.value[0].leng = orderList.value.length
  399. }
  400. }
  401. s.value = '1'
  402. }
  403. const handleGetOffice = (e)=>{
  404. if(e.detail.value==0){
  405. searchDepartment.value = ''
  406. officeIndex.value = e.detail.value
  407. } else {
  408. officeIndex.value = e.detail.value
  409. searchDepartment.value = officeArr.value[officeIndex.value]
  410. }
  411. }
  412. const handleGetType = (e)=>{
  413. typeIndex.value = e.detail.value
  414. if(typeIndex.value ===1 ){
  415. searchName.value = ''
  416. } else {
  417. searchPreNo.value = ''
  418. }
  419. }
  420. const handleGetTags = (v)=>{
  421. if(!searchTags.value.includes(v)) {
  422. searchTags.value.push(v)
  423. } else {
  424. searchTags.value.splice(searchTags.value.indexOf(v), 1)
  425. if(v=='门诊' || v=='住院'){
  426. searchPreMzZy.value = ''
  427. }
  428. if(v=='男' || v=='女'){
  429. searchSex.value = ''
  430. }
  431. if(v=='煎煮' || v=='发药'){
  432. searchStatus.value = ''
  433. }
  434. }
  435. switch (v) {
  436. case '全部':
  437. if(searchTags.value.includes(v)){
  438. searchTags.value = ['全部']
  439. searchTime.value = []
  440. searchDepartment.value = ''
  441. searchName.value = ''
  442. searchPreNo.value = ''
  443. searchSex.value = ''
  444. searchPreMzZy.value = ''
  445. searchStatus.value = ''
  446. officeIndex.value = 0
  447. }
  448. break
  449. case '门诊':
  450. if(searchTags.value.includes(v)){
  451. if(searchTags.value.includes('住院')){
  452. searchTags.value.splice(searchTags.value.indexOf('住院'), 1)
  453. }
  454. if(searchTags.value.includes('全部')){
  455. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  456. }
  457. searchPreMzZy.value = '1'
  458. }
  459. break
  460. case '住院':
  461. if(searchTags.value.includes(v)){
  462. if(searchTags.value.includes('门诊')){
  463. searchTags.value.splice(searchTags.value.indexOf('门诊'), 1)
  464. }
  465. if(searchTags.value.includes('全部')){
  466. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  467. }
  468. searchPreMzZy.value = '2'
  469. }
  470. break
  471. case '男':
  472. if(searchTags.value.includes(v)){
  473. if(searchTags.value.includes('女')){
  474. searchTags.value.splice(searchTags.value.indexOf('女'), 1)
  475. }
  476. if(searchTags.value.includes('全部')){
  477. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  478. }
  479. searchSex.value = '男'
  480. }
  481. break
  482. case '女':
  483. if(searchTags.value.includes(v)){
  484. if(searchTags.value.includes('男')){
  485. searchTags.value.splice(searchTags.value.indexOf('男'), 1)
  486. }
  487. if(searchTags.value.includes('全部')){
  488. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  489. }
  490. searchSex.value = '女'
  491. }
  492. break
  493. case '煎煮':
  494. if(searchTags.value.includes(v)){
  495. if(searchTags.value.includes('发药')){
  496. searchTags.value.splice(searchTags.value.indexOf('发药'), 1)
  497. }
  498. if(searchTags.value.includes('全部')){
  499. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  500. }
  501. searchStatus.value = '2'
  502. }
  503. break
  504. case '发药':
  505. if(searchTags.value.includes(v)){
  506. if(searchTags.value.includes('煎煮')){
  507. searchTags.value.splice(searchTags.value.indexOf('煎煮'), 1)
  508. }
  509. if(searchTags.value.includes('全部')){
  510. searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
  511. }
  512. searchStatus.value = '3'
  513. }
  514. break
  515. default:
  516. searchTags.value = ['全部']
  517. }
  518. }
  519. // 更新处方列表
  520. const checkIndex = async(index) => {
  521. tabActive.value = index
  522. page.value= 1
  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. const {data:res} = await receiveOrderList(paramss)
  538. if (res.code === 200) {
  539. total.value = res.total
  540. orderList.value = res.rows
  541. if(total.value == orderList.value.length){
  542. isBottom.value = true
  543. } else {
  544. isBottom.value = false
  545. }
  546. if(tabActive.value ==0){
  547. tabList.value[0].leng = orderList.value.length
  548. }
  549. }
  550. if(tabActive.value==1) {
  551. const param = {
  552. token: uni.getStorageSync('token'),
  553. }
  554. const {data:res} = await selectDepartment(param)
  555. if (res.code === 200) {
  556. officeArr.value.push(...res.data)
  557. }
  558. } else {
  559. if(orderList.value.length>0){
  560. tabList.value[0].leng = orderList.value.length
  561. tabList.value[0].title = tabName.value //+ '(' + tabList.value[0].leng + ')'
  562. }
  563. }
  564. }
  565. const loadMoreList = async()=>{
  566. if(isBottom.value){
  567. return
  568. }
  569. page.value = page.value +1
  570. const params = {
  571. token: uni.getStorageSync('token'),
  572. data: JSON.stringify({
  573. currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
  574. startTime: searchTime.value[0] || '',
  575. endTime: searchTime.value[1] || '',
  576. name: searchName.value.trim() || '',
  577. preNo: searchPreNo.value || '',
  578. department: searchDepartment.value || '',
  579. prescriptionStatus: searchStatus.value || '',
  580. sex: searchSex.value || '',
  581. preMzZy: searchPreMzZy.value || '',
  582. pageNum: page.value,
  583. pageSize: pageSize.value,
  584. status: tabList.value[tabActive.value].status
  585. })
  586. }
  587. const {data:res} = await receiveOrderList(params)
  588. if (res.code === 200) {
  589. total.value = res.total
  590. orderList.value.push(...res.rows)
  591. if(total.value == orderList.value.length){
  592. isBottom.value = true
  593. } else {
  594. isBottom.value = false
  595. }
  596. if(tabActive.value ==0){
  597. tabList.value[0].leng = orderList.value.length
  598. tabList.value[0].title = tabName.value + '(' + tabList.value[0].leng + ')'
  599. }
  600. }
  601. }
  602. const loadPreList = async()=>{
  603. trigger.value = true;
  604. page.value = 1
  605. const params = {
  606. token: uni.getStorageSync('token'),
  607. data: JSON.stringify({
  608. currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
  609. startTime: searchTime.value[0] || '',
  610. endTime: searchTime.value[1] || '',
  611. name: searchName.value.trim() || '',
  612. preNo: searchPreNo.value || '',
  613. department: searchDepartment.value || '',
  614. prescriptionStatus: searchStatus.value || '',//煎煮发药
  615. sex: searchSex.value || '',
  616. preMzZy: searchPreMzZy.value || '',//门诊住院
  617. pageNum: page.value,
  618. pageSize: pageSize.value,
  619. status: tabList.value[tabActive.value].status
  620. })
  621. }
  622. const {data:res} = await receiveOrderList(params)
  623. if (res.code === 200) {
  624. total.value = res.total
  625. orderList.value = res.rows
  626. if(orderList.value.length < pageSize.value){
  627. isBottom.value = true
  628. } else {
  629. isBottom.value = false
  630. }
  631. if(tabActive ==0){
  632. tabList.value[0].leng = orderList.value.length
  633. }
  634. }
  635. setTimeout(() => {
  636. trigger.value = false;
  637. }, 1000)
  638. }
  639. // 调配扫码
  640. const handletiaopei = ()=>{
  641. uni.scanCode({
  642. // scanType: ['barCode'],
  643. // success: async(res) => {
  644. // const data = JSON.stringify({
  645. // userId:uni.getStorageSync('userId'),
  646. // preNo: parseInt(res.result)
  647. // })
  648. // console.log('res.charSet--------' + res.charSet);
  649. // console.log('res.result--------------------' + res.result);
  650. // uni.navigateTo({
  651. // url:`/pages/edit/edit?preNo=${res.result}&depolyStatus=1`
  652. // })
  653. // },
  654. scanType: ['barCode'],
  655. success: function (res) {
  656. // const data = JSON.stringify({
  657. // userId:uni.getStorageSync('userId'),
  658. // preNo: parseInt(res.result)
  659. // })
  660. console.log('扫码信息res.result--------' + res.result);
  661. // 舟山项目扫描有时候会出现结果为8位数的数字,当扫描为8位数数字时提示用户
  662. // if(res.result.length==8){
  663. // uni.$showMsg('请重新扫描', 2000)
  664. // }else{
  665. // uni.navigateTo({
  666. // url:`/pages/edit/edit?preNo=${res.result}&depolyStatus=1`
  667. // })
  668. // }
  669. uni.navigateTo({
  670. url:`/pages/edit/edit?preNo=${res.result}&depolyStatus=1`
  671. })
  672. },
  673. fail: (res) => {
  674. console.log('扫码结果:' + res);
  675. // uni.navigateBack()
  676. // uni.$showMsg(res, 2000)
  677. }
  678. });
  679. }
  680. // 复核扫码
  681. const handleScanbara = ()=>{
  682. uni.scanCode({
  683. scanType: ['barCode'],
  684. success: async(res) => {
  685. const data = JSON.stringify({
  686. userId:uni.getStorageSync('userId'),
  687. preNo: parseInt(res.result)
  688. })
  689. const {data:res1} = await saveReview({
  690. token: uni.getStorageSync('token'),
  691. data: data
  692. })
  693. if(res1.code===500){
  694. if(res1.msg=='未查询到有效数据'){
  695. uni.$showMsg(res1.msg, 2000)
  696. }
  697. else if(res1.msg=='处方已复核,无需重复操作!'){
  698. uni.$showMsg(res1.msg, 2000)
  699. } else {
  700. uni.navigateTo({
  701. url:`/pages/review/review?preNo=${res.result}&depolyStatus=2`
  702. })
  703. }
  704. }
  705. },
  706. fail: (res) => {
  707. console.log('扫码结果:' + res);
  708. }
  709. });
  710. }
  711. </script>
  712. <style lang="scss">
  713. .main {
  714. display: flex;
  715. flex-direction:column;
  716. justify-content:flex-start;
  717. // height: 2000px;
  718. width: 750rpx;
  719. .nav{
  720. display: flex;
  721. height: 75rpx;
  722. width: 750rpx;
  723. }
  724. .body{
  725. display: flex;
  726. height:calc(100% - 74.34rpx);
  727. flex-direction:column;
  728. justify-content:flex-start;
  729. .tab-box {
  730. display: flex;
  731. position: sticky;
  732. flex-direction:column;
  733. z-index: 100;
  734. .tab-bar{
  735. height: 62.5rpx;
  736. display: flex;
  737. justify-content:center;
  738. width: 100%;
  739. // border: 1px solid #000;
  740. .tab_item{
  741. display: flex;
  742. flex:1;
  743. justify-content:center;
  744. align-items: center;
  745. font-size: 17.5rpx;
  746. background-color: #fff;
  747. color: #000;
  748. }
  749. .active{
  750. border-bottom: 5rpx solid #18C7B0;
  751. }
  752. }
  753. .search-bar{
  754. display: flex;
  755. background-color: #fff;
  756. border-radius: 4rpx;
  757. // 外框
  758. .today{
  759. display: flex;
  760. flex-direction:row;
  761. justify-content: flex-start;
  762. // background-color: #DEDEDE;
  763. // padding-bottom: 10rpx;
  764. // 搜索姓名框注销
  765. // .search{
  766. // width: 453.75rpx;
  767. // margin: 13.75rpx 10.1rpx;
  768. // :deep(.uni-easyinput__placeholder-class){
  769. // font-size: 15rpx;
  770. // }
  771. // }
  772. .tongji{
  773. font-size: 17rpx;
  774. display: flex;
  775. justify-content:center;
  776. align-items: center;
  777. // padding: 0 10rpx;
  778. margin-left: 30rpx;
  779. // background-color: #e1e5f1;
  780. .tongji-kongxi{
  781. margin-right: 30rpx;
  782. }
  783. }
  784. .search-button{
  785. display: flex;
  786. justify-content:center;
  787. align-items: center;
  788. width:112.5rpx;
  789. margin: 13.75rpx 10.1rpx;
  790. font-size: 15rpx;
  791. background-color: #18C7B0;
  792. }
  793. .refresh {
  794. display: flex;
  795. justify-content:center;
  796. align-items: center;
  797. width:120rpx;
  798. margin: 13.75px 8rpx;
  799. font-size: 15rpx;
  800. background-color: #18C7B0;
  801. }
  802. .active{
  803. background-color:#DEDEDE;
  804. }
  805. }
  806. .history{
  807. // display: flex;
  808. // width: 100%;
  809. display: flex;
  810. flex-direction:row;
  811. justify-content: flex-start;
  812. .searchchoice{
  813. padding: 0 10rpx;
  814. display: flex;
  815. width: 100%;
  816. flex-direction:column;
  817. font-size: 24rpx;
  818. .row1{
  819. display: flex;
  820. width: 100%;
  821. justify-content:flex-start;
  822. align-items: center;
  823. margin: 10rpx 0 10rpx;
  824. font-size: 15rpx;
  825. .timequan{
  826. display: flex;
  827. justify-content:center;
  828. align-items: center;
  829. :deep(.uni-date__x-input){
  830. font-size: 15rpx;
  831. }
  832. .datepick {
  833. z-index: 999;
  834. width: 300rpx;
  835. margin:0 10rpx;
  836. }
  837. }
  838. }
  839. .row2{
  840. display: flex;
  841. width: 100%;
  842. justify-content:flex-start;
  843. align-items: center;
  844. margin: 0 0 10rpx;
  845. .office{
  846. display: flex;
  847. justify-content:center;
  848. align-items: center;
  849. font-size: 15rpx;
  850. .uni-input{
  851. display: flex;
  852. justify-content:center;
  853. align-items: center;
  854. border:1px solid #e1e5f1;
  855. // font-size: 15rpx;
  856. width:190rpx;
  857. // height: 40rpx;
  858. border-radius: 5rpx;
  859. background-color: #e1e5f1;
  860. margin-right: 10rpx;
  861. }
  862. }
  863. .uni-input{
  864. display: flex;
  865. justify-content:center;
  866. align-items: center;
  867. border:1px solid #e1e5f1;
  868. font-size: 15rpx;
  869. width:100rpx;
  870. height: 40rpx;
  871. border-radius: 5rpx;
  872. background-color: #e1e5f1;
  873. margin-right: 10rpx;
  874. }
  875. .search{
  876. width: 187.5rpx;
  877. // height: 40rpx;
  878. // :deep(.easyinput__content-input){
  879. // // height: 40rpx!important;
  880. // }
  881. :deep(.uni-easyinput__placeholder-class){
  882. font-size: 14rpx;
  883. }
  884. }
  885. .search-button{
  886. display: flex;
  887. justify-content:center;
  888. align-items: center;
  889. width:120rpx;
  890. margin: 8rpx 12rpx;
  891. font-size: 14rpx;
  892. height: 40rpx!important;
  893. color: #fff;
  894. background-color: #18C7B0;
  895. }
  896. }
  897. .row3{
  898. display: flex;
  899. width: 100%;
  900. justify-content:flex-start;
  901. align-items: center;
  902. margin: 0 0 18rpx;
  903. .tag-view:deep(.uni-tag){
  904. display: inline;
  905. font-size: 15rpx;
  906. font-weight:500;
  907. margin-right: 16.67rpx;
  908. // height: 40px;
  909. width: 120rpx;
  910. padding: 6rpx 20rpx;
  911. }
  912. }
  913. }
  914. }
  915. }
  916. }
  917. .tab-content{
  918. display: flex;
  919. margin: 8rpx 0;
  920. border-radius: 4rpx;
  921. background-color: #fff;
  922. width: calc(100%);
  923. height: 980rpx;//980rpx
  924. z-index:10;
  925. .order-list{
  926. padding: 8rpx;
  927. display: flex;
  928. width: 100%;
  929. // height: 100%;
  930. .text{
  931. display: flex;
  932. width: 750rpx;
  933. justify-content:center;
  934. align-items: flex-start;
  935. .zwsj {
  936. margin-top: 103.13rpx;
  937. width: 640.63rpx;
  938. height: 310rpx;
  939. }
  940. }
  941. .order-list-wrap{
  942. display: flex;
  943. .order-card{
  944. display: flex;
  945. width: 100%;
  946. // border-bottom: 1px solid #e6e8ee;;
  947. }
  948. }
  949. }
  950. }
  951. }
  952. .tiaopei{
  953. position: fixed;
  954. width: 110rpx;
  955. height: 110rpx;
  956. border-radius: 50%;
  957. top: 47%;
  958. right: 3%;
  959. z-index: 100;
  960. background-color: #18C7B0;
  961. color: #fff;
  962. align-items: center;
  963. .tiaopei-wenzi{
  964. display: flex;
  965. margin-top: 30rpx;
  966. }
  967. }
  968. .fuhe{
  969. position: fixed;
  970. width: 110rpx;
  971. height: 110rpx;
  972. border-radius: 50%;
  973. top: 60%;
  974. right: 3%;
  975. z-index: 100;
  976. background-color: #E7B140;
  977. color: #fff;
  978. align-items: center;
  979. .fuhe-wenzi{
  980. display: flex;
  981. margin-top: 30rpx;
  982. }
  983. }
  984. }
  985. </style>