receiptpage.vue 39 KB

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