receiptpage.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192
  1. <template>
  2. <view class="Receiptpage">
  3. <view class="page_tab">
  4. <view class="page_tab_bar" :class="{ active: item.label === selectedLabelSlots }" v-for="item in tabs"
  5. :key="item.value" @click="clickHandler(item.label)">
  6. {{ item.label }}<text class="tab_num">( {{ item.num }} )</text>
  7. </view>
  8. </view>
  9. <view v-if="zxzData.length == 0" class="zwsj">
  10. <image class="zwsj-img" mode="widthFix" src="../../static/img/zanwushuju.png"></image>
  11. <view class="zwsj-txt">暂无数据</view>
  12. </view>
  13. <view class="page_items">
  14. <scroll-view class="page_items_scroll" scroll-y :refresher-enabled="scroll_refresher_enabled"
  15. :refresher-triggered="triggered" @refresherrefresh="refresherrefresh" @refresherrestore="refresherrestore"
  16. @scroll="scroll" @scrolltolower="scrolltolower" :scroll-top="scroll_top" @refresherabort="refresherabort">
  17. <view class="page_item_wrap" v-for="(item, index) of zxzData" :key="index">
  18. <view class="page_item">
  19. <view class="L"></view>
  20. <view class="R"></view>
  21. <view class="page_item_top">
  22. <view class="page_item_top_L">
  23. <text class="L_iocn" v-if="item.taskType.associationType.value == 'specimen'">标</text>
  24. <text class="L_iocn" v-if="item.taskType.associationType.value == 'drugsBag'">药</text>
  25. <text class="L_iocn" v-if="item.taskType.associationType.value == 'specimenPlan'">巡</text>
  26. <text class="L_iocn" v-if="item.taskType.associationType.value == 'jPBag'">静</text>
  27. <text class="L_iocn" v-if="item.taskType.associationType.value == 'inspect'">病</text>
  28. <text class="L_iocn" v-if="
  29. item.taskType.associationType.value == 'patientTransport'
  30. ">病</text>
  31. <text class="L_iocn" v-if="item.taskType.associationType.value == 'other'">其</text>
  32. <text class="L_time" v-if="item.overdueTime">{{ item.overdueTime }}前送达</text>
  33. </view>
  34. <view class="page_item_top_R" v-if="
  35. !(
  36. item.taskType.associationType.value == 'inspect' &&
  37. item.gdState.value == 5
  38. )
  39. ">
  40. {{ item.gdState.name }}
  41. <!-- 待取货 -->
  42. </view>
  43. <view class="page_item_top_R" v-if="
  44. item.taskType.associationType.value == 'inspect' &&
  45. item.gdState.value == 5
  46. ">
  47. 待送回
  48. <!-- 待取货 -->
  49. </view>
  50. <view class="page_item_top_R type">
  51. {{item.taskType.taskName}}
  52. </view>
  53. </view>
  54. <view class="page_item_cont" @click="itemInfo(item.id)">
  55. <view class="page_item_cont_T">
  56. <view class="page_item_cont_title">
  57. <text> <text class="starting">起</text> 点科室 </text>
  58. <text class="text_big">{{ item.startDept.dept }}</text>
  59. </view>
  60. <view class="page_item_cont_start emergency1" v-if="item.emergencyType.value == 1">
  61. <image mode="widthFix" class="page_item_cont_start-img" src="../../static/img/icon_shandian.png">
  62. </image>
  63. {{ item.emergencyType.name }}
  64. </view>
  65. <view class="page_item_cont_start emergency" v-if="item.emergencyType.value == 2">
  66. <image mode="widthFix" class="page_item_cont_start-img" src="../../static/img/icon_shandian.png">
  67. </image>
  68. {{ item.emergencyType.name }}
  69. </view>
  70. <view class="page_item_cont_start emergencys" v-if="item.emergencyType.value == 3">
  71. <image mode="widthFix" class="page_item_cont_start-img" src="../../static/img/icon_shandian.png">
  72. </image>
  73. {{ item.emergencyType.name }}
  74. </view>
  75. </view>
  76. <view class="page_item_conts" v-if="item.taskType.associationType.value == 'inspect'">
  77. <view>
  78. 预约时间 : {{ item.yyTime | yyTimeFilter
  79. }}<text v-if="item.reservationNumber">({{ item.reservationNumber }})</text>
  80. </view>
  81. <view>
  82. 床号 : {{ item.patient ? item.patient.patientName : "-" }}({{
  83. item.patient ? item.patient.bedNum : "-"
  84. }})
  85. </view>
  86. <view>
  87. 携带设备 :
  88. <text>{{ item.goods || "暂无" }}</text>
  89. </view>
  90. <view v-if="item.patient.careLevel">
  91. 护理等级 :
  92. <text
  93. :class="[(item.patient.careLevel.value==0||item.patient.careLevel.value==1)?'red':'green']">{{ item.patient.careLevel.name}}</text>
  94. </view>
  95. <view v-if="item.patient.illnessState">
  96. 病情级别 :
  97. <text
  98. :class="{red:item.patient.illnessState.value==2||item.patient.illnessState.value==3}">{{ item.patient.illnessState.name}}</text>
  99. </view>
  100. <view v-if="item.isAccompany===1||item.isAccompany===0">
  101. 陪同情况 :
  102. <text :class="{red:item.isAccompany===1}">{{ item.isAccompany===1?'需要医护陪同':'无需医护陪同'}}</text>
  103. </view>
  104. </view>
  105. <view class="page_item_conts" v-if="item.taskType.associationType.value == 'patientTransport'">
  106. <view>
  107. 床号 : {{ item.patient ? item.patient.patientName : "-" }}({{
  108. item.patient ? item.patient.bedNum : "-"
  109. }})
  110. </view>
  111. <view>
  112. 携带设备 :
  113. <text>{{ item.goods || "暂无" }}</text>
  114. </view>
  115. <view v-if="item.patient.careLevel">
  116. 护理等级 :
  117. <text
  118. :class="[(item.patient.careLevel.value==0||item.patient.careLevel.value==1)?'red':'green']">{{ item.patient.careLevel.name}}</text>
  119. </view>
  120. <view v-if="item.patient.illnessState">
  121. 病情级别 :
  122. <text
  123. :class="{red:item.patient.illnessState.value==2||item.patient.illnessState.value==3}">{{ item.patient.illnessState.name}}</text>
  124. </view>
  125. <view v-if="item.isAccompany===1||item.isAccompany===0">
  126. 陪同情况 :
  127. <text :class="{red:item.isAccompany===1}">{{ item.isAccompany===1?'需要医护陪同':'无需医护陪同'}}</text>
  128. </view>
  129. </view>
  130. <view class="page_item_conts" v-if="item.taskType.associationType.value == 'drugsBag'">
  131. <view>
  132. 药包编码 : {{ item.drugs?item.drugs.packid:'无'}}
  133. </view>
  134. </view>
  135. <view class="page_item_conts" v-if="item.taskType.associationType.value == 'jPBag'">
  136. <view>
  137. 药包编码 : {{ item.staticDistri?item.staticDistri.packid:'无'}}
  138. </view>
  139. </view>
  140. <view class="line"></view>
  141. <view class="page_item_cont_B">
  142. <view class="page_item_cont_title" v-if="item.taskType.associationType.value != 'inspect'">
  143. <text> <text class="End">终</text> 点科室 </text>
  144. <text class="text_big" v-for="(dept, i) of item.endDepts" :key="i">{{ dept.dept }}</text>
  145. </view>
  146. <view class="page_item_cont_title" v-if="item.taskType.associationType.value == 'inspect'">
  147. <text> <text class="End">检</text> 查科室 </text>
  148. <text class="text_big" v-for="(dept, i) of item.middleDept" :key="i">{{ dept.dept }}</text>
  149. </view>
  150. </view>
  151. <view v-if="
  152. item.taskType.associationType.value == 'inspect' ||
  153. item.taskType.associationType.value == 'patientTransport'
  154. ">
  155. <!-- 待抢单 -->
  156. <text class="red" v-if="item.gdState.value == 2">请扫描患者腕带,或者请扫描科室码</text>
  157. <!-- 待到达 -->
  158. <text class="red" v-if="item.gdState.value == 4">请扫描患者腕带</text>
  159. <!-- 执行中 -->
  160. <text class="red" v-if="item.gdState.value == 8">请扫描检查科室码,并扫描患者腕带</text>
  161. <!-- 待送达 -->
  162. <text class="red" v-if="item.gdState.value == 5">请扫描终点科室码,并扫描患者腕带</text>
  163. </view>
  164. </view>
  165. <!-- 如果不是患者陪检或患者转运或其他 -->
  166. <view class="page_item_btn" v-if="
  167. selectedLabelSlots == '执行中' &&
  168. item.taskType.associationType.value != 'patientTransport' &&
  169. item.taskType.associationType.value != 'inspect' &&
  170. item.taskType.associationType.value != 'other'
  171. " @click="Scan_s(item)" hover-class="seimin-btn-hover">扫码</view>
  172. <!-- 如果不是静配,药配,标本配送,标本轮巡 -->
  173. <view class="page_item_btn_wrap" v-if="
  174. selectedLabelSlots == '执行中' &&
  175. item.taskType.associationType.value != 'jPBag' &&
  176. item.taskType.associationType.value != 'drugsBag' &&
  177. item.taskType.associationType.value != 'specimen' &&
  178. item.taskType.associationType.value != 'specimenPlan'
  179. ">
  180. <view class="page_item_btn" :style="{
  181. width:
  182. item.taskType.associationType.value != 'other' &&
  183. item.gdState.value == 4
  184. ? '50%'
  185. : '100%',
  186. }" @click="Scan_ss(item)" hover-class="seimin-btn-hover">扫码</view>
  187. <view v-if="
  188. item.taskType.associationType.value != 'other' &&
  189. item.gdState.value == 4
  190. " class="page_item_btn" @click="photograph(item)" hover-class="seimin-btn-hover">拍照</view>
  191. </view>
  192. <view class="page_item_btn" v-if="selectedLabelSlots == '待接单'" @click="showAlerts(item)"
  193. hover-class="seimin-btn-hover">抢单</view>
  194. </view>
  195. <view class="L-l"></view>
  196. <view class="R-l"></view>
  197. </view>
  198. </scroll-view>
  199. </view>
  200. <!-- 底部扫一扫 -->
  201. <bigScreen></bigScreen>
  202. <!-- 悬浮按钮 -->
  203. <uni-fab :pattern="pattern" :content="content" :direction="direction" @trigger="trigger"></uni-fab>
  204. <!-- 弹窗 -->
  205. <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content"
  206. @ok="ok" @cancel="cancel" @know="know" :operate="models.operate"></showModel>
  207. </view>
  208. </template>
  209. <script>
  210. import showModel from "../../components/showModel/showModel.vue";
  211. import bigScreen from "../../components/bigScreen/bigScreen.vue";
  212. // https://ext.dcloud.net.cn/plugin?id=144
  213. import uniFab from "@/components/uni-fab/uni-fab.vue";
  214. import {
  215. get,
  216. post,
  217. SM,
  218. deleteIt,
  219. webHandle
  220. } from "../../http/http.js";
  221. import {
  222. photographTool
  223. } from "../../tools/photograph.js";
  224. export default {
  225. data() {
  226. return {
  227. // 当前登录人是否是药房角色
  228. pharmacistFlag: false,
  229. // 抢单的id
  230. qdId: "",
  231. // 弹窗model
  232. models: {
  233. disjunctor: false,
  234. },
  235. // 悬浮按钮样式
  236. pattern: {
  237. buttonColor: "#6cc076",
  238. },
  239. // 悬浮按钮展开菜单显示方式
  240. direction: "vertical",
  241. // 悬浮按钮展开菜单内容配置项
  242. content: [{
  243. text: "检查信息",
  244. },
  245. {
  246. text: "患者信息",
  247. },
  248. {
  249. text: "我的任务",
  250. },
  251. {
  252. text: "二维码设置",
  253. },
  254. ],
  255. // 当前选中tab页名称
  256. selectedLabelSlots: "待接单",
  257. // tab页信息
  258. tabs: [{
  259. label: "待接单", //tab页名称
  260. value: "1", //值
  261. num: 0, //数量
  262. },
  263. {
  264. label: "执行中",
  265. value: "2",
  266. num: 0,
  267. },
  268. ],
  269. //列表数据
  270. zxzData: [],
  271. //分页页码
  272. idx: 0,
  273. // 列表项总数
  274. totalNum: -1,
  275. triggered: false, //下拉刷新状态
  276. freshing: false, //上拉加载开关
  277. scroll_top: 0, //距离顶部的距离
  278. scroll_refresher_enabled: true, //是否开启自定义下拉刷新
  279. };
  280. },
  281. filters: {
  282. // 自定义管道 yyTime
  283. yyTimeFilter: function(data) {
  284. if (data) {
  285. let arr = data.split(/[-:\s]/);
  286. const nDate = new Date(
  287. arr[0] - 0,
  288. arr[1] - 1,
  289. arr[2] - 0,
  290. arr[3] - 0,
  291. arr[4] - 0,
  292. 0
  293. );
  294. const month = (nDate.getMonth() + 1).toString().padStart(2, 0);
  295. const day = nDate.getDay().toString().padStart(2, 0);
  296. const hour = nDate.getHours().toString().padStart(2, 0);
  297. const minute = nDate.getMinutes().toString().padStart(2, 0);
  298. return `${month}-${day} ${hour}:${minute}`;
  299. } else {
  300. return "-";
  301. }
  302. },
  303. },
  304. components: {
  305. uniFab,
  306. showModel,
  307. bigScreen,
  308. },
  309. methods: {
  310. // 拍照
  311. photograph(data) {
  312. photographTool(data);
  313. },
  314. // 悬浮按钮点击事件
  315. trigger(e) {
  316. if (e.item.text === "我的任务") {
  317. uni.navigateTo({
  318. url: "../mypage/mypage",
  319. });
  320. } else if (e.item.text === "退出登录") {
  321. deleteIt("/auth/logout2").then((result) => {
  322. if (result.status == 200) {
  323. uni.showToast({
  324. title: "退出成功!",
  325. });
  326. let ip = uni.getStorageSync("ip"); //记住域名或ip
  327. let username = uni.getStorageSync("username"); //记住用户名
  328. let password = uni.getStorageSync("password"); //记住密码
  329. let clientid = uni.getStorageSync("clientid");
  330. uni.clearStorageSync();
  331. uni.setStorageSync("ip", ip); //记住域名或ip
  332. uni.setStorageSync("username", username); //记住用户名
  333. uni.setStorageSync("password", password); //记住密码
  334. uni.setStorageSync("clientid", clientid);
  335. uni.navigateTo({
  336. url: "../homePage/homePage",
  337. });
  338. } else {
  339. uni.showToast({
  340. icon: "none",
  341. title: "请求失败!",
  342. });
  343. }
  344. });
  345. } else if (e.item.text === "药房") {
  346. uni.navigateTo({
  347. url: "../pharmacy/pharmacy",
  348. });
  349. } else if (e.item.text === "患者信息") {
  350. uni.navigateTo({
  351. url: "../patientInformationList/patientInformationList",
  352. });
  353. } else if (e.item.text === "负责科室") {
  354. let obj = uni.getStorageSync("setDeptConfg");
  355. uni.navigateTo({
  356. url: `../setDept/setDept?configName=${obj.configName}&id=${obj.id}&changedept=1`,
  357. });
  358. } else if (e.item.text === "检查信息") {
  359. uni.navigateTo({
  360. url: "../inspectList/inspectList",
  361. });
  362. } else if (e.item.text === "二维码设置") {
  363. uni.navigateTo({
  364. url: "../settingCode/settingCode",
  365. });
  366. }
  367. },
  368. // 点击tab页切换
  369. clickHandler(key) {
  370. this.selectedLabelSlots = key;
  371. this.idx = 0;
  372. this.totalNum = -1;
  373. // this.zxzData = [];
  374. this.scroll_top = Math.random(); //回到顶部
  375. if (key === "待接单") {
  376. this.waitingOrders(0);
  377. } else if (key === "执行中") {
  378. this.executingOrders(0);
  379. }
  380. },
  381. // 进入详情页
  382. itemInfo(id) {
  383. uni.navigateTo({
  384. url: `../receipt_infopage/receipt_infopage?id=${id}`,
  385. });
  386. },
  387. //抢单后知道了
  388. know() {
  389. this.models.disjunctor = false;
  390. this.idx = 0;
  391. this.totalNum = -1;
  392. // this.zxzData = [];
  393. this.executingOrdersGetNum();
  394. this.waitingOrders(0); //seimin
  395. this.scroll_top = Math.random(); //回到顶部
  396. },
  397. //抢单确定
  398. ok() {
  399. this.models.disjunctor = false;
  400. get("/workerOrder/takeOrder/" + this.qdId.id).then((res) => {
  401. let msg = "抢单失败";
  402. let icon = "error";
  403. if (res.status == 200) {
  404. msg = "抢单成功";
  405. icon = "success";
  406. }
  407. this.models = {
  408. disjunctor: true,
  409. content: msg,
  410. icon: icon,
  411. operate: {
  412. know: "知道了",
  413. },
  414. };
  415. });
  416. },
  417. //抢单取消
  418. cancel() {
  419. this.models.disjunctor = false;
  420. },
  421. // 抢单
  422. showAlerts(data) {
  423. this.qdId = data;
  424. this.models = {
  425. disjunctor: true,
  426. title: "提示",
  427. content: "是否确定抢单?",
  428. icon: "warn",
  429. operate: {
  430. ok: "确定",
  431. cancel: "取消",
  432. },
  433. };
  434. },
  435. // 如果不是静配,药配,标本配送,标本轮巡
  436. // 扫码(小扫描)
  437. Scan_ss(data) {
  438. let isKs = 0;
  439. let ids = [];
  440. let id = data.id;
  441. ids.push(id);
  442. let list = {
  443. code: "",
  444. ids: ids,
  445. };
  446. let code = "";
  447. let type = "";
  448. SM().then((ress1) => {
  449. uni.showLoading({
  450. title: "加载中",
  451. mask: true,
  452. });
  453. //检验二维码的有效性
  454. post("/dept/scanning", {
  455. content: ress1,
  456. }).then((result) => {
  457. if (result.state == 200 || result.state == 201) {
  458. let ress = result.code;
  459. if (ress) {
  460. if (
  461. data.gdState.value == "4" &&
  462. data.taskType.associationType.value == "inspect"
  463. ) {
  464. list.code = ress; //其他
  465. type = "handleIns";
  466. }
  467. if (
  468. (data.taskType.associationType.value == "other" &&
  469. data.gdState.value == "4") ||
  470. data.gdState.value == "5"
  471. ) {
  472. code = ress; //其他=终点
  473. type = "orderSign/" + code;
  474. list = ids;
  475. isKs = 1;
  476. }
  477. if (
  478. (data.gdState.value == "5" &&
  479. data.taskType.associationType.value == "inspect") ||
  480. data.taskType.associationType.value == "patientTransport"
  481. ) {
  482. code = ress; //患者转运--起点
  483. type = "orderSign/" + code;
  484. list = ids;
  485. isKs = 1;
  486. }
  487. if (data.gdState.value == "8") {
  488. code = ress; //患者陪检--检查
  489. type = "orderSign/" + code;
  490. list = ids;
  491. isKs = 1;
  492. }
  493. if (
  494. data.gdState.value == "4" &&
  495. data.taskType.associationType.value == "patientTransport"
  496. ) {
  497. list = {
  498. code: ress, //患者转运--检查
  499. ids: ids,
  500. };
  501. type = "handleTrans";
  502. }
  503. post("/workerOrder/" + type, list).then((res) => {
  504. uni.hideLoading();
  505. if (res) {
  506. if (res.status == 200) {
  507. if (
  508. data.gdState.value == "4" &&
  509. data.taskType.associationType.value == "other"
  510. ) {
  511. uni.navigateTo({
  512. url: `../scanning_code/scanning_code?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}`,
  513. });
  514. }
  515. if (
  516. data.gdState.value == "4" &&
  517. data.taskType.associationType.value != "other"
  518. ) {
  519. uni.navigateTo({
  520. url: `../scanning_Result/scanning_Result?type=${
  521. data.taskType.associationType.value
  522. }&type1=${res.type}&id=${data.id}&deptCode=${
  523. list.code
  524. }&patient=${res.patient}&patientCode=${
  525. res.patientCode
  526. }&deptName=${res.deptName}&bedNum=${
  527. res.bedNum
  528. }&status=${res.status}&msg=${
  529. res.msg
  530. }&model=${encodeURIComponent(JSON.stringify(res))}`,
  531. });
  532. }
  533. if (data.gdState.value == "8") {
  534. uni.navigateTo({
  535. url: `../scanning_code/scanning_code?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}`,
  536. });
  537. }
  538. if (data.gdState.value == "5") {
  539. uni.navigateTo({
  540. url: `../scanning_code/scanning_code?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}`,
  541. });
  542. }
  543. } else {
  544. console.log(res, "扫描失败");
  545. if (res.type == "trans-ddd-1") {
  546. //起点科室扫描腕带码失败
  547. uni.navigateTo({
  548. url: `../scanning_Result/scanning_Result?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&status=600&msg=${res.msg}`,
  549. });
  550. } else {
  551. uni.navigateTo({
  552. url: `../scanning_Result/scanning_Result?type=${
  553. data.taskType.associationType.value
  554. }&type1=${res.type}&id=${data.id}&status=600&msg=${
  555. res.msg
  556. }&isKs=${isKs}&model=${encodeURIComponent(
  557. JSON.stringify(res)
  558. )}`,
  559. });
  560. }
  561. }
  562. } else {
  563. uni.navigateTo({
  564. url: `../scanning_Result/scanning_Result?id=${data.id}&status=600&msg=扫码失败!请扫描正确的二维码!&isKs=${isKs}`,
  565. });
  566. }
  567. });
  568. }
  569. } else {
  570. uni.hideLoading();
  571. uni.showToast({
  572. icon: "none",
  573. title: "请求失败!",
  574. });
  575. }
  576. });
  577. });
  578. },
  579. // 如果不是患者陪检或患者转运或其他
  580. // 扫码
  581. Scan_s(data) {
  582. let ids = [];
  583. let id = data.id;
  584. ids.push(id);
  585. let code = "";
  586. SM().then((ress1) => {
  587. uni.showLoading({
  588. title: "加载中",
  589. mask: true,
  590. });
  591. //检验二维码的有效性
  592. post("/dept/scanning", {
  593. content: ress1,
  594. }).then((result) => {
  595. if (result.state == 200 || result.state == 201) {
  596. let ress = result.code;
  597. if (ress) {
  598. code = ress;
  599. // 科室签到
  600. post("/workerOrder/orderSign/" + code, ids).then((res) => {
  601. uni.hideLoading();
  602. if (res.status == 200) {
  603. // 跳转到扫描科室
  604. // type1: res.type, //type类型
  605. // id: data.id, //工单ID
  606. // deptCode: code, //二维码
  607. // dept: res.dept //科室名称
  608. uni.navigateTo({
  609. url: `../scanning_code/scanning_code?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}`,
  610. });
  611. } else {
  612. uni.navigateTo({
  613. url: `../scanning_Result/scanning_Result?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&status=600&msg=${res.msg}&isKs=1`,
  614. });
  615. }
  616. });
  617. }
  618. } else {
  619. uni.hideLoading();
  620. uni.showToast({
  621. icon: "none",
  622. title: "请求失败!",
  623. });
  624. }
  625. });
  626. });
  627. },
  628. //执行中列表数据获取
  629. executingOrders(idx) {
  630. if (this.zxzData.length == this.totalNum) {
  631. uni.showToast({
  632. icon: "none",
  633. title: "没有更多数据了!",
  634. });
  635. this.freshing = true;
  636. return;
  637. }
  638. let data = {
  639. idx,
  640. sum: 20,
  641. };
  642. uni.showLoading({
  643. title: "加载中",
  644. mask: true,
  645. });
  646. post("/workerOrder/executingOrders", data).then((res) => {
  647. uni.hideLoading();
  648. if (res.status == 200) {
  649. this.triggered = false;
  650. this.freshing = true;
  651. this.totalNum = res.data.resultCount;
  652. if (idx === 0) {
  653. this.zxzData = res.data.data;
  654. } else {
  655. this.zxzData.push(...res.data.data);
  656. }
  657. this.tabs[1].num = res.data.resultCount;
  658. } else {
  659. uni.showToast({
  660. icon: "none",
  661. title: "请求失败!",
  662. });
  663. }
  664. });
  665. },
  666. //待抢单列表数据获取
  667. waitingOrders(idx) {
  668. if (this.zxzData.length == this.totalNum) {
  669. uni.showToast({
  670. icon: "none",
  671. title: "没有更多数据了!",
  672. });
  673. this.freshing = true;
  674. return;
  675. }
  676. let data = {
  677. idx,
  678. sum: 20,
  679. };
  680. uni.showLoading({
  681. title: "加载中",
  682. mask: true,
  683. });
  684. // 请求列表数据
  685. post("/workerOrder/waitingOrders", data).then((res) => {
  686. uni.hideLoading();
  687. if (res.status == 200) {
  688. this.triggered = false;
  689. this.freshing = true;
  690. this.totalNum = res.data.resultCount;
  691. if (idx === 0) {
  692. this.zxzData = res.data.data;
  693. } else {
  694. this.zxzData.push(...res.data.data);
  695. }
  696. this.tabs[0].num = res.data.resultCount;
  697. } else {
  698. uni.showToast({
  699. icon: "none",
  700. title: "请求失败!",
  701. });
  702. }
  703. });
  704. },
  705. //刷新
  706. refresherrefresh() {
  707. if (this.triggered) {
  708. return;
  709. }
  710. this.triggered = true;
  711. this.idx = 0;
  712. this.totalNum = -1;
  713. if (this.selectedLabelSlots == "待接单") {
  714. this.waitingOrders(0);
  715. } else if (this.selectedLabelSlots == "执行中") {
  716. this.executingOrders(0);
  717. }
  718. },
  719. // 滚动
  720. scroll(e) {
  721. if (e.detail.scrollTop < 20) {
  722. this.scroll_refresher_enabled = true;
  723. } else {
  724. this.scroll_refresher_enabled = false;
  725. }
  726. },
  727. // 下拉刷新复位
  728. refresherrestore() {
  729. this.triggered = false;
  730. console.log("下拉刷新复位");
  731. },
  732. //下拉刷新中止
  733. refresherabort() {
  734. this.triggered = false;
  735. console.log("下拉刷新中止");
  736. },
  737. //分页,上拉加载
  738. scrolltolower() {
  739. if (this.freshing) {
  740. this.freshing = false;
  741. if (this.selectedLabelSlots == "待接单") {
  742. this.waitingOrders(++this.idx);
  743. } else if (this.selectedLabelSlots == "执行中") {
  744. this.executingOrders(++this.idx);
  745. }
  746. }
  747. },
  748. // 执行中获取数字
  749. executingOrdersGetNum() {
  750. let data = {
  751. idx: 0,
  752. sum: 20,
  753. };
  754. post("/workerOrder/executingOrders", data).then((res) => {
  755. if (res.status == 200) {
  756. this.tabs[1].num = res.data.resultCount;
  757. } else {
  758. uni.showToast({
  759. icon: "none",
  760. title: "请求失败!",
  761. });
  762. }
  763. });
  764. },
  765. // 待接单获取数字
  766. waitingOrdersGetNum() {
  767. let data = {
  768. idx: 0,
  769. sum: 20,
  770. };
  771. post("/workerOrder/waitingOrders", data).then((res) => {
  772. if (res.status == 200) {
  773. this.tabs[0].num = res.data.resultCount;
  774. } else {
  775. uni.showToast({
  776. icon: "none",
  777. title: "请求失败!",
  778. });
  779. }
  780. });
  781. },
  782. // 阻止浏览器滑动
  783. stop(e) {
  784. e.preventDefault();
  785. },
  786. },
  787. onLoad() {
  788. //判断当前登陆人具体角色 start
  789. let roles = uni.getStorageSync("userData").user.role;
  790. this.pharmacistFlag = roles.some(item => item.rolecode === "pharmacist");
  791. //判断当前登陆人具体角色 end
  792. if (uni.getStorageSync("setDeptConfg")) {
  793. //如果有设置科室的配置,则显示
  794. this.content.unshift({
  795. text: "负责科室",
  796. });
  797. }
  798. // 如果是配药师人员,则增加药房
  799. if (this.pharmacistFlag) {
  800. this.content.unshift({
  801. text: "药房",
  802. });
  803. }
  804. // #ifdef APP-PLUS
  805. this.content.push({
  806. text: "退出登录",
  807. });
  808. // #endif
  809. this.selectedLabelSlots = "执行中";
  810. this.waitingOrdersGetNum();
  811. this.executingOrders(0);
  812. uni.removeStorageSync("speNum");
  813. // #ifdef APP-PLUS
  814. webHandle("no", "app");
  815. // #endif
  816. // #ifdef H5
  817. webHandle("no", "wx");
  818. // #endif
  819. },
  820. onShow() {
  821. // #ifdef H5
  822. document.body.addEventListener("touchmove", this.stop, {
  823. passive: false,
  824. });
  825. // #endif
  826. },
  827. onHide() {
  828. // #ifdef H5
  829. document.body.removeEventListener("touchmove", this.stop, {
  830. passive: false,
  831. });
  832. // #endif
  833. },
  834. };
  835. </script>
  836. <style lang="less">
  837. .Receiptpage {
  838. width: 100%;
  839. height: 100%;
  840. position: relative;
  841. .red {
  842. color: red !important;
  843. font-weight: bold !important;
  844. }
  845. .page_tab {
  846. width: 100%;
  847. height: 96rpx;
  848. display: flex;
  849. position: fixed;
  850. left: 0;
  851. top: 0;
  852. z-index: 999;
  853. .page_tab_bar {
  854. flex: 1;
  855. font-size: 36rpx;
  856. background: #fff;
  857. display: flex;
  858. justify-content: center;
  859. align-items: center;
  860. position: relative;
  861. &:after {
  862. content: "";
  863. position: absolute;
  864. left: 0;
  865. bottom: 0;
  866. height: 2rpx;
  867. width: 100%;
  868. background-color: transparent;
  869. }
  870. .tab_num {
  871. color: #ff3b53;
  872. margin-left: 8rpx;
  873. }
  874. &.active {
  875. color: #49b856;
  876. &:after {
  877. background-color: #49b856;
  878. }
  879. }
  880. }
  881. }
  882. .zwsj {
  883. position: absolute;
  884. left: 50%;
  885. top: 180rpx;
  886. transform: translateX(-50%);
  887. .zwsj-img {
  888. width: 560rpx;
  889. }
  890. .zwsj-txt {
  891. font-size: 36rpx;
  892. font-weight: 700;
  893. margin-top: 20rpx;
  894. text-align: center;
  895. }
  896. }
  897. .page_items {
  898. height: calc(100vh - 184rpx);
  899. padding: 0 20rpx;
  900. // padding-bottom: 88rpx;
  901. padding-top: 96rpx;
  902. .page_items_scroll {
  903. height: 100%;
  904. .page_item_wrap {
  905. position: relative;
  906. margin-bottom: 32rpx;
  907. .page_item {
  908. margin-bottom: 16rpx;
  909. min-height: 356rpx;
  910. background: #fff;
  911. border-radius: 8rpx;
  912. overflow: hidden;
  913. border: 2rpx solid #e5e9ed;
  914. .L {
  915. width: 40rpx;
  916. height: 40rpx;
  917. border-radius: 50%;
  918. background: #f9fafb;
  919. position: absolute;
  920. left: -24rpx;
  921. top: 68rpx;
  922. border: 2rpx solid #e5e9ed;
  923. }
  924. .R {
  925. width: 40rpx;
  926. height: 40rpx;
  927. border-radius: 50%;
  928. background: #f9fafb;
  929. position: absolute;
  930. float: right;
  931. right: -24rpx;
  932. top: 68rpx;
  933. border: 2rpx solid #e5e9ed;
  934. }
  935. .starting {
  936. width: 40rpx;
  937. height: 40rpx;
  938. color: #fff;
  939. background: #49b856;
  940. display: inline-block;
  941. border-radius: 50%;
  942. text-align: center;
  943. line-height: 40rpx;
  944. font-size: 28rpx;
  945. }
  946. .End {
  947. width: 40rpx;
  948. height: 40rpx;
  949. color: #fff;
  950. background: #39b199;
  951. display: inline-block;
  952. border-radius: 50%;
  953. text-align: center;
  954. line-height: 40rpx;
  955. font-size: 28rpx;
  956. }
  957. .page_item_top {
  958. height: 86rpx;
  959. border-bottom: 2rpx dashed #e5e9ed;
  960. padding: 0 16rpx;
  961. .page_item_top_L {
  962. height: 100%;
  963. float: left;
  964. line-height: 88rpx;
  965. .L_iocn {
  966. display: inline-block;
  967. width: 44rpx;
  968. height: 44rpx;
  969. line-height: 42rpx;
  970. border-radius: 100rpx;
  971. color: #6cc076;
  972. font-size: 32rpx;
  973. border: 4rpx solid #6cc076;
  974. background: #f0f6ed;
  975. text-align: center;
  976. margin-right: 8rpx;
  977. }
  978. .L_time {
  979. color: #6cc076;
  980. font-size: 32rpx;
  981. }
  982. .L_text {
  983. font-size: 32rpx;
  984. }
  985. }
  986. .page_item_top_R {
  987. height: 100%;
  988. float: right;
  989. line-height: 88rpx;
  990. font-size: 32rpx;
  991. &.type {
  992. margin-right: 32rpx;
  993. color: red;
  994. max-width: 260rpx;
  995. white-space: nowrap;
  996. text-overflow: ellipsis;
  997. overflow: hidden;
  998. }
  999. }
  1000. }
  1001. .page_item_cont {
  1002. min-height: 180rpx;
  1003. padding: 0 16rpx;
  1004. text-align: left;
  1005. position: relative;
  1006. .text_big {
  1007. font-size: 32rpx;
  1008. margin-left: 10rpx;
  1009. font-weight: 700;
  1010. }
  1011. .line {
  1012. height: 40rpx;
  1013. width: 2rpx;
  1014. border-left: 2rpx solid #e5e9ed;
  1015. position: absolute;
  1016. top: 70rpx;
  1017. left: 36rpx;
  1018. }
  1019. .lines {
  1020. height: 40%;
  1021. width: 2rpx;
  1022. border-left: 2rpx solid #e5e9ed;
  1023. position: absolute;
  1024. top: 23%;
  1025. left: 36rpx;
  1026. }
  1027. .emergencys {
  1028. background: #ff3b53 !important;
  1029. width: 124rpx !important;
  1030. }
  1031. .emergency {
  1032. background: #ff3b53 !important;
  1033. }
  1034. .emergency1 {
  1035. background: #49b856 !important;
  1036. }
  1037. .page_item_cont_T {
  1038. min-height: 80rpx;
  1039. max-height: 324rpx;
  1040. font-size: 28rpx;
  1041. padding-top: 16rpx;
  1042. .page_item_cont_title {
  1043. height: 100%;
  1044. float: left;
  1045. }
  1046. .page_item_cont_start {
  1047. text-align: center;
  1048. float: right;
  1049. height: 44rpx;
  1050. width: 104rpx;
  1051. line-height: 44rpx;
  1052. border-radius: 8rpx;
  1053. background: #49b856;
  1054. color: #fff;
  1055. .page_item_cont_start-img {
  1056. width: 22rpx;
  1057. position: relative;
  1058. top: 6rpx;
  1059. margin-right: 8rpx;
  1060. }
  1061. }
  1062. }
  1063. .page_item_conts {
  1064. color: rgb(102, 102, 102);
  1065. padding-left: 18%;
  1066. font-size: 28rpx;
  1067. view {
  1068. margin-bottom: 10rpx;
  1069. }
  1070. text {
  1071. color: #49b856;
  1072. }
  1073. .num {
  1074. float: right;
  1075. }
  1076. }
  1077. .page_item_cont_B {
  1078. padding-top: 20rpx;
  1079. font-size: 28rpx;
  1080. overflow: hidden;
  1081. .page_item_cont_title {
  1082. height: 100%;
  1083. float: left;
  1084. }
  1085. }
  1086. }
  1087. .page_item_btn_wrap {
  1088. display: flex;
  1089. justify-content: space-between;
  1090. .page_item_btn {
  1091. height: 88rpx;
  1092. width: 49%;
  1093. background-image: linear-gradient(to right, #72c172, #3bb197);
  1094. border-radius: 8rpx;
  1095. line-height: 88rpx;
  1096. color: #fff;
  1097. font-size: 36rpx;
  1098. font-weight: 700;
  1099. text-align: center;
  1100. }
  1101. }
  1102. .page_item_btn {
  1103. height: 88rpx;
  1104. background-image: linear-gradient(to right, #72c172, #3bb197);
  1105. border-radius: 8rpx;
  1106. line-height: 88rpx;
  1107. color: #fff;
  1108. font-size: 36rpx;
  1109. font-weight: 700;
  1110. text-align: center;
  1111. }
  1112. }
  1113. .L-l {
  1114. width: 2rpx;
  1115. height: 40rpx;
  1116. background: #f9fafb;
  1117. position: absolute;
  1118. left: 20rpx;
  1119. top: 72rpx;
  1120. display: none;
  1121. }
  1122. .R-l {
  1123. width: 2rpx;
  1124. height: 40rpx;
  1125. background: #f9fafb;
  1126. position: absolute;
  1127. right: 20rpx;
  1128. top: 72rpx;
  1129. display: none;
  1130. }
  1131. }
  1132. }
  1133. }
  1134. .text {
  1135. font-size: 36rpx;
  1136. }
  1137. .wt_icon {
  1138. font-size: 40rpx;
  1139. }
  1140. }
  1141. </style>