receiptpage.vue 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209
  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. // 假登录
  322. uni.showToast({
  323. title: "退出成功!",
  324. });
  325. let ip = uni.getStorageSync("ip"); //记住域名或ip
  326. let username = uni.getStorageSync("username"); //记住用户名
  327. let password = uni.getStorageSync("password"); //记住密码
  328. let clientid = uni.getStorageSync("clientid");
  329. uni.clearStorageSync();
  330. uni.setStorageSync("ip", ip); //记住域名或ip
  331. uni.setStorageSync("username", username); //记住用户名
  332. uni.setStorageSync("password", password); //记住密码
  333. uni.setStorageSync("clientid", clientid);
  334. uni.navigateTo({
  335. url: "../homePage/homePage",
  336. });
  337. // 假登录
  338. deleteIt("/auth/logout2").then((result) => {
  339. if (result.status == 200) {
  340. uni.showToast({
  341. title: "退出成功!",
  342. });
  343. let ip = uni.getStorageSync("ip"); //记住域名或ip
  344. let username = uni.getStorageSync("username"); //记住用户名
  345. let password = uni.getStorageSync("password"); //记住密码
  346. let clientid = uni.getStorageSync("clientid");
  347. uni.clearStorageSync();
  348. uni.setStorageSync("ip", ip); //记住域名或ip
  349. uni.setStorageSync("username", username); //记住用户名
  350. uni.setStorageSync("password", password); //记住密码
  351. uni.setStorageSync("clientid", clientid);
  352. uni.navigateTo({
  353. url: "../homePage/homePage",
  354. });
  355. } else {
  356. uni.showToast({
  357. icon: "none",
  358. title: "请求失败!",
  359. });
  360. }
  361. });
  362. } else if (e.item.text === "药房") {
  363. uni.navigateTo({
  364. url: "../pharmacy/pharmacy",
  365. });
  366. } else if (e.item.text === "患者信息") {
  367. uni.navigateTo({
  368. url: "../patientInformationList/patientInformationList",
  369. });
  370. } else if (e.item.text === "负责科室") {
  371. let obj = uni.getStorageSync("setDeptConfg");
  372. uni.navigateTo({
  373. url: `../setDept/setDept?configName=${obj.configName}&id=${obj.id}&changedept=1`,
  374. });
  375. } else if (e.item.text === "检查信息") {
  376. uni.navigateTo({
  377. url: "../inspectList/inspectList",
  378. });
  379. } else if (e.item.text === "二维码设置") {
  380. uni.navigateTo({
  381. url: "../settingCode/settingCode",
  382. });
  383. }
  384. },
  385. // 点击tab页切换
  386. clickHandler(key) {
  387. this.selectedLabelSlots = key;
  388. this.idx = 0;
  389. this.totalNum = -1;
  390. // this.zxzData = [];
  391. this.scroll_top = Math.random(); //回到顶部
  392. if (key === "待接单") {
  393. this.waitingOrders(0);
  394. } else if (key === "执行中") {
  395. this.executingOrders(0);
  396. }
  397. },
  398. // 进入详情页
  399. itemInfo(id) {
  400. uni.navigateTo({
  401. url: `../receipt_infopage/receipt_infopage?id=${id}`,
  402. });
  403. },
  404. //抢单后知道了
  405. know() {
  406. this.models.disjunctor = false;
  407. this.idx = 0;
  408. this.totalNum = -1;
  409. // this.zxzData = [];
  410. this.executingOrdersGetNum();
  411. this.waitingOrders(0); //seimin
  412. this.scroll_top = Math.random(); //回到顶部
  413. },
  414. //抢单确定
  415. ok() {
  416. this.models.disjunctor = false;
  417. get("/workerOrder/takeOrder/" + this.qdId.id).then((res) => {
  418. let msg = "抢单失败";
  419. let icon = "error";
  420. if (res.status == 200) {
  421. msg = "抢单成功";
  422. icon = "success";
  423. }
  424. this.models = {
  425. disjunctor: true,
  426. content: msg,
  427. icon: icon,
  428. operate: {
  429. know: "知道了",
  430. },
  431. };
  432. });
  433. },
  434. //抢单取消
  435. cancel() {
  436. this.models.disjunctor = false;
  437. },
  438. // 抢单
  439. showAlerts(data) {
  440. this.qdId = data;
  441. this.models = {
  442. disjunctor: true,
  443. title: "提示",
  444. content: "是否确定抢单?",
  445. icon: "warn",
  446. operate: {
  447. ok: "确定",
  448. cancel: "取消",
  449. },
  450. };
  451. },
  452. // 如果不是静配,药配,标本配送,标本轮巡
  453. // 扫码(小扫描)
  454. Scan_ss(data) {
  455. let isKs = 0;
  456. let ids = [];
  457. let id = data.id;
  458. ids.push(id);
  459. let list = {
  460. code: "",
  461. ids: ids,
  462. };
  463. let code = "";
  464. let type = "";
  465. SM().then((ress1) => {
  466. uni.showLoading({
  467. title: "加载中",
  468. mask: true,
  469. });
  470. //检验二维码的有效性
  471. post("/dept/scanning", {
  472. content: ress1,
  473. }).then((result) => {
  474. if (result.state == 200 || result.state == 201) {
  475. let ress = result.code;
  476. if (ress) {
  477. if (
  478. data.gdState.value == "4" &&
  479. data.taskType.associationType.value == "inspect"
  480. ) {
  481. list.code = ress; //其他
  482. type = "handleIns";
  483. }
  484. if (
  485. (data.taskType.associationType.value == "other" &&
  486. data.gdState.value == "4") ||
  487. data.gdState.value == "5"
  488. ) {
  489. code = ress; //其他=终点
  490. type = "orderSign/" + code;
  491. list = ids;
  492. isKs = 1;
  493. }
  494. if (
  495. (data.gdState.value == "5" &&
  496. data.taskType.associationType.value == "inspect") ||
  497. data.taskType.associationType.value == "patientTransport"
  498. ) {
  499. code = ress; //患者转运--起点
  500. type = "orderSign/" + code;
  501. list = ids;
  502. isKs = 1;
  503. }
  504. if (data.gdState.value == "8") {
  505. code = ress; //患者陪检--检查
  506. type = "orderSign/" + code;
  507. list = ids;
  508. isKs = 1;
  509. }
  510. if (
  511. data.gdState.value == "4" &&
  512. data.taskType.associationType.value == "patientTransport"
  513. ) {
  514. list = {
  515. code: ress, //患者转运--检查
  516. ids: ids,
  517. };
  518. type = "handleTrans";
  519. }
  520. post("/workerOrder/" + type, list).then((res) => {
  521. uni.hideLoading();
  522. if (res) {
  523. if (res.status == 200) {
  524. if (
  525. data.gdState.value == "4" &&
  526. data.taskType.associationType.value == "other"
  527. ) {
  528. uni.navigateTo({
  529. url: `../scanning_code/scanning_code?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}`,
  530. });
  531. }
  532. if (
  533. data.gdState.value == "4" &&
  534. data.taskType.associationType.value != "other"
  535. ) {
  536. uni.navigateTo({
  537. url: `../scanning_Result/scanning_Result?type=${
  538. data.taskType.associationType.value
  539. }&type1=${res.type}&id=${data.id}&deptCode=${
  540. list.code
  541. }&patient=${res.patient}&patientCode=${
  542. res.patientCode
  543. }&deptName=${res.deptName}&bedNum=${
  544. res.bedNum
  545. }&status=${res.status}&msg=${
  546. res.msg
  547. }&model=${encodeURIComponent(JSON.stringify(res))}`,
  548. });
  549. }
  550. if (data.gdState.value == "8") {
  551. uni.navigateTo({
  552. url: `../scanning_code/scanning_code?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}`,
  553. });
  554. }
  555. if (data.gdState.value == "5") {
  556. uni.navigateTo({
  557. url: `../scanning_code/scanning_code?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}`,
  558. });
  559. }
  560. } else {
  561. console.log(res, "扫描失败");
  562. if (res.type == "trans-ddd-1") {
  563. //起点科室扫描腕带码失败
  564. uni.navigateTo({
  565. url: `../scanning_Result/scanning_Result?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&status=600&msg=${res.msg}`,
  566. });
  567. } else {
  568. uni.navigateTo({
  569. url: `../scanning_Result/scanning_Result?type=${
  570. data.taskType.associationType.value
  571. }&type1=${res.type}&id=${data.id}&status=600&msg=${
  572. res.msg
  573. }&isKs=${isKs}&model=${encodeURIComponent(
  574. JSON.stringify(res)
  575. )}`,
  576. });
  577. }
  578. }
  579. } else {
  580. uni.navigateTo({
  581. url: `../scanning_Result/scanning_Result?id=${data.id}&status=600&msg=扫码失败!请扫描正确的二维码!&isKs=${isKs}`,
  582. });
  583. }
  584. });
  585. }
  586. } else {
  587. uni.hideLoading();
  588. uni.showToast({
  589. icon: "none",
  590. title: "请求失败!",
  591. });
  592. }
  593. });
  594. });
  595. },
  596. // 如果不是患者陪检或患者转运或其他
  597. // 扫码
  598. Scan_s(data) {
  599. let ids = [];
  600. let id = data.id;
  601. ids.push(id);
  602. let code = "";
  603. SM().then((ress1) => {
  604. uni.showLoading({
  605. title: "加载中",
  606. mask: true,
  607. });
  608. //检验二维码的有效性
  609. post("/dept/scanning", {
  610. content: ress1,
  611. }).then((result) => {
  612. if (result.state == 200 || result.state == 201) {
  613. let ress = result.code;
  614. if (ress) {
  615. code = ress;
  616. // 科室签到
  617. post("/workerOrder/orderSign/" + code, ids).then((res) => {
  618. uni.hideLoading();
  619. if (res.status == 200) {
  620. // 跳转到扫描科室
  621. // type1: res.type, //type类型
  622. // id: data.id, //工单ID
  623. // deptCode: code, //二维码
  624. // dept: res.dept //科室名称
  625. uni.navigateTo({
  626. url: `../scanning_code/scanning_code?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}`,
  627. });
  628. } else {
  629. uni.navigateTo({
  630. url: `../scanning_Result/scanning_Result?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&status=600&msg=${res.msg}&isKs=1`,
  631. });
  632. }
  633. });
  634. }
  635. } else {
  636. uni.hideLoading();
  637. uni.showToast({
  638. icon: "none",
  639. title: "请求失败!",
  640. });
  641. }
  642. });
  643. });
  644. },
  645. //执行中列表数据获取
  646. executingOrders(idx) {
  647. if (this.zxzData.length == this.totalNum) {
  648. uni.showToast({
  649. icon: "none",
  650. title: "没有更多数据了!",
  651. });
  652. this.freshing = true;
  653. return;
  654. }
  655. let data = {
  656. idx,
  657. sum: 20,
  658. };
  659. uni.showLoading({
  660. title: "加载中",
  661. mask: true,
  662. });
  663. post("/workerOrder/executingOrders", data).then((res) => {
  664. uni.hideLoading();
  665. if (res.status == 200) {
  666. this.triggered = false;
  667. this.freshing = true;
  668. this.totalNum = res.data.resultCount;
  669. if (idx === 0) {
  670. this.zxzData = res.data.data;
  671. } else {
  672. this.zxzData.push(...res.data.data);
  673. }
  674. this.tabs[1].num = res.data.resultCount;
  675. } else {
  676. uni.showToast({
  677. icon: "none",
  678. title: "请求失败!",
  679. });
  680. }
  681. });
  682. },
  683. //待抢单列表数据获取
  684. waitingOrders(idx) {
  685. if (this.zxzData.length == this.totalNum) {
  686. uni.showToast({
  687. icon: "none",
  688. title: "没有更多数据了!",
  689. });
  690. this.freshing = true;
  691. return;
  692. }
  693. let data = {
  694. idx,
  695. sum: 20,
  696. };
  697. uni.showLoading({
  698. title: "加载中",
  699. mask: true,
  700. });
  701. // 请求列表数据
  702. post("/workerOrder/waitingOrders", data).then((res) => {
  703. uni.hideLoading();
  704. if (res.status == 200) {
  705. this.triggered = false;
  706. this.freshing = true;
  707. this.totalNum = res.data.resultCount;
  708. if (idx === 0) {
  709. this.zxzData = res.data.data;
  710. } else {
  711. this.zxzData.push(...res.data.data);
  712. }
  713. this.tabs[0].num = res.data.resultCount;
  714. } else {
  715. uni.showToast({
  716. icon: "none",
  717. title: "请求失败!",
  718. });
  719. }
  720. });
  721. },
  722. //刷新
  723. refresherrefresh() {
  724. if (this.triggered) {
  725. return;
  726. }
  727. this.triggered = true;
  728. this.idx = 0;
  729. this.totalNum = -1;
  730. if (this.selectedLabelSlots == "待接单") {
  731. this.waitingOrders(0);
  732. } else if (this.selectedLabelSlots == "执行中") {
  733. this.executingOrders(0);
  734. }
  735. },
  736. // 滚动
  737. scroll(e) {
  738. if (e.detail.scrollTop < 20) {
  739. this.scroll_refresher_enabled = true;
  740. } else {
  741. this.scroll_refresher_enabled = false;
  742. }
  743. },
  744. // 下拉刷新复位
  745. refresherrestore() {
  746. this.triggered = false;
  747. console.log("下拉刷新复位");
  748. },
  749. //下拉刷新中止
  750. refresherabort() {
  751. this.triggered = false;
  752. console.log("下拉刷新中止");
  753. },
  754. //分页,上拉加载
  755. scrolltolower() {
  756. if (this.freshing) {
  757. this.freshing = false;
  758. if (this.selectedLabelSlots == "待接单") {
  759. this.waitingOrders(++this.idx);
  760. } else if (this.selectedLabelSlots == "执行中") {
  761. this.executingOrders(++this.idx);
  762. }
  763. }
  764. },
  765. // 执行中获取数字
  766. executingOrdersGetNum() {
  767. let data = {
  768. idx: 0,
  769. sum: 20,
  770. };
  771. post("/workerOrder/executingOrders", data).then((res) => {
  772. if (res.status == 200) {
  773. this.tabs[1].num = res.data.resultCount;
  774. } else {
  775. uni.showToast({
  776. icon: "none",
  777. title: "请求失败!",
  778. });
  779. }
  780. });
  781. },
  782. // 待接单获取数字
  783. waitingOrdersGetNum() {
  784. let data = {
  785. idx: 0,
  786. sum: 20,
  787. };
  788. post("/workerOrder/waitingOrders", data).then((res) => {
  789. if (res.status == 200) {
  790. this.tabs[0].num = res.data.resultCount;
  791. } else {
  792. uni.showToast({
  793. icon: "none",
  794. title: "请求失败!",
  795. });
  796. }
  797. });
  798. },
  799. // 阻止浏览器滑动
  800. stop(e) {
  801. e.preventDefault();
  802. },
  803. },
  804. onLoad() {
  805. //判断当前登陆人具体角色 start
  806. let roles = uni.getStorageSync("userData").user.role;
  807. this.pharmacistFlag = roles.some(item => item.rolecode === "pharmacist");
  808. //判断当前登陆人具体角色 end
  809. if (uni.getStorageSync("setDeptConfg")) {
  810. //如果有设置科室的配置,则显示
  811. this.content.unshift({
  812. text: "负责科室",
  813. });
  814. }
  815. // 如果是配药师人员,则增加药房
  816. if (this.pharmacistFlag) {
  817. this.content.unshift({
  818. text: "药房",
  819. });
  820. }
  821. // #ifdef APP-PLUS
  822. this.content.push({
  823. text: "退出登录",
  824. });
  825. // #endif
  826. this.selectedLabelSlots = "执行中";
  827. this.waitingOrdersGetNum();
  828. this.executingOrders(0);
  829. uni.removeStorageSync("speNum");
  830. // #ifdef APP-PLUS
  831. webHandle("no", "app");
  832. // #endif
  833. // #ifdef H5
  834. webHandle("no", "wx");
  835. // #endif
  836. },
  837. onShow() {
  838. // #ifdef H5
  839. document.body.addEventListener("touchmove", this.stop, {
  840. passive: false,
  841. });
  842. // #endif
  843. },
  844. onHide() {
  845. // #ifdef H5
  846. document.body.removeEventListener("touchmove", this.stop, {
  847. passive: false,
  848. });
  849. // #endif
  850. },
  851. };
  852. </script>
  853. <style lang="less">
  854. .Receiptpage {
  855. width: 100%;
  856. height: 100%;
  857. position: relative;
  858. .red {
  859. color: red !important;
  860. font-weight: bold !important;
  861. }
  862. .page_tab {
  863. width: 100%;
  864. height: 96rpx;
  865. display: flex;
  866. position: fixed;
  867. left: 0;
  868. top: 0;
  869. z-index: 999;
  870. .page_tab_bar {
  871. flex: 1;
  872. font-size: 36rpx;
  873. background: #fff;
  874. display: flex;
  875. justify-content: center;
  876. align-items: center;
  877. position: relative;
  878. &:after {
  879. content: "";
  880. position: absolute;
  881. left: 0;
  882. bottom: 0;
  883. height: 2rpx;
  884. width: 100%;
  885. background-color: transparent;
  886. }
  887. .tab_num {
  888. color: #ff3b53;
  889. margin-left: 8rpx;
  890. }
  891. &.active {
  892. color: #49b856;
  893. &:after {
  894. background-color: #49b856;
  895. }
  896. }
  897. }
  898. }
  899. .zwsj {
  900. position: absolute;
  901. left: 50%;
  902. top: 180rpx;
  903. transform: translateX(-50%);
  904. .zwsj-img {
  905. width: 560rpx;
  906. }
  907. .zwsj-txt {
  908. font-size: 36rpx;
  909. font-weight: 700;
  910. margin-top: 20rpx;
  911. text-align: center;
  912. }
  913. }
  914. .page_items {
  915. height: calc(100vh - 184rpx);
  916. padding: 0 20rpx;
  917. // padding-bottom: 88rpx;
  918. padding-top: 96rpx;
  919. .page_items_scroll {
  920. height: 100%;
  921. .page_item_wrap {
  922. position: relative;
  923. margin-bottom: 32rpx;
  924. .page_item {
  925. margin-bottom: 16rpx;
  926. min-height: 356rpx;
  927. background: #fff;
  928. border-radius: 8rpx;
  929. overflow: hidden;
  930. border: 2rpx solid #e5e9ed;
  931. .L {
  932. width: 40rpx;
  933. height: 40rpx;
  934. border-radius: 50%;
  935. background: #f9fafb;
  936. position: absolute;
  937. left: -24rpx;
  938. top: 68rpx;
  939. border: 2rpx solid #e5e9ed;
  940. }
  941. .R {
  942. width: 40rpx;
  943. height: 40rpx;
  944. border-radius: 50%;
  945. background: #f9fafb;
  946. position: absolute;
  947. float: right;
  948. right: -24rpx;
  949. top: 68rpx;
  950. border: 2rpx solid #e5e9ed;
  951. }
  952. .starting {
  953. width: 40rpx;
  954. height: 40rpx;
  955. color: #fff;
  956. background: #49b856;
  957. display: inline-block;
  958. border-radius: 50%;
  959. text-align: center;
  960. line-height: 40rpx;
  961. font-size: 28rpx;
  962. }
  963. .End {
  964. width: 40rpx;
  965. height: 40rpx;
  966. color: #fff;
  967. background: #39b199;
  968. display: inline-block;
  969. border-radius: 50%;
  970. text-align: center;
  971. line-height: 40rpx;
  972. font-size: 28rpx;
  973. }
  974. .page_item_top {
  975. height: 86rpx;
  976. border-bottom: 2rpx dashed #e5e9ed;
  977. padding: 0 16rpx;
  978. .page_item_top_L {
  979. height: 100%;
  980. float: left;
  981. line-height: 88rpx;
  982. .L_iocn {
  983. display: inline-block;
  984. width: 44rpx;
  985. height: 44rpx;
  986. line-height: 42rpx;
  987. border-radius: 100rpx;
  988. color: #6cc076;
  989. font-size: 32rpx;
  990. border: 4rpx solid #6cc076;
  991. background: #f0f6ed;
  992. text-align: center;
  993. margin-right: 8rpx;
  994. }
  995. .L_time {
  996. color: #6cc076;
  997. font-size: 32rpx;
  998. }
  999. .L_text {
  1000. font-size: 32rpx;
  1001. }
  1002. }
  1003. .page_item_top_R {
  1004. height: 100%;
  1005. float: right;
  1006. line-height: 88rpx;
  1007. font-size: 32rpx;
  1008. &.type {
  1009. margin-right: 32rpx;
  1010. color: red;
  1011. max-width: 260rpx;
  1012. white-space: nowrap;
  1013. text-overflow: ellipsis;
  1014. overflow: hidden;
  1015. }
  1016. }
  1017. }
  1018. .page_item_cont {
  1019. min-height: 180rpx;
  1020. padding: 0 16rpx;
  1021. text-align: left;
  1022. position: relative;
  1023. .text_big {
  1024. font-size: 32rpx;
  1025. margin-left: 10rpx;
  1026. font-weight: 700;
  1027. }
  1028. .line {
  1029. height: 40rpx;
  1030. width: 2rpx;
  1031. border-left: 2rpx solid #e5e9ed;
  1032. position: absolute;
  1033. top: 70rpx;
  1034. left: 36rpx;
  1035. }
  1036. .lines {
  1037. height: 40%;
  1038. width: 2rpx;
  1039. border-left: 2rpx solid #e5e9ed;
  1040. position: absolute;
  1041. top: 23%;
  1042. left: 36rpx;
  1043. }
  1044. .emergencys {
  1045. background: #ff3b53 !important;
  1046. width: 124rpx !important;
  1047. }
  1048. .emergency {
  1049. background: #ff3b53 !important;
  1050. }
  1051. .emergency1 {
  1052. background: #49b856 !important;
  1053. }
  1054. .page_item_cont_T {
  1055. min-height: 80rpx;
  1056. max-height: 324rpx;
  1057. font-size: 28rpx;
  1058. padding-top: 16rpx;
  1059. .page_item_cont_title {
  1060. height: 100%;
  1061. float: left;
  1062. }
  1063. .page_item_cont_start {
  1064. text-align: center;
  1065. float: right;
  1066. height: 44rpx;
  1067. width: 104rpx;
  1068. line-height: 44rpx;
  1069. border-radius: 8rpx;
  1070. background: #49b856;
  1071. color: #fff;
  1072. .page_item_cont_start-img {
  1073. width: 22rpx;
  1074. position: relative;
  1075. top: 6rpx;
  1076. margin-right: 8rpx;
  1077. }
  1078. }
  1079. }
  1080. .page_item_conts {
  1081. color: rgb(102, 102, 102);
  1082. padding-left: 18%;
  1083. font-size: 28rpx;
  1084. view {
  1085. margin-bottom: 10rpx;
  1086. }
  1087. text {
  1088. color: #49b856;
  1089. }
  1090. .num {
  1091. float: right;
  1092. }
  1093. }
  1094. .page_item_cont_B {
  1095. padding-top: 20rpx;
  1096. font-size: 28rpx;
  1097. overflow: hidden;
  1098. .page_item_cont_title {
  1099. height: 100%;
  1100. float: left;
  1101. }
  1102. }
  1103. }
  1104. .page_item_btn_wrap {
  1105. display: flex;
  1106. justify-content: space-between;
  1107. .page_item_btn {
  1108. height: 88rpx;
  1109. width: 49%;
  1110. background-image: linear-gradient(to right, #72c172, #3bb197);
  1111. border-radius: 8rpx;
  1112. line-height: 88rpx;
  1113. color: #fff;
  1114. font-size: 36rpx;
  1115. font-weight: 700;
  1116. text-align: center;
  1117. }
  1118. }
  1119. .page_item_btn {
  1120. height: 88rpx;
  1121. background-image: linear-gradient(to right, #72c172, #3bb197);
  1122. border-radius: 8rpx;
  1123. line-height: 88rpx;
  1124. color: #fff;
  1125. font-size: 36rpx;
  1126. font-weight: 700;
  1127. text-align: center;
  1128. }
  1129. }
  1130. .L-l {
  1131. width: 2rpx;
  1132. height: 40rpx;
  1133. background: #f9fafb;
  1134. position: absolute;
  1135. left: 20rpx;
  1136. top: 72rpx;
  1137. display: none;
  1138. }
  1139. .R-l {
  1140. width: 2rpx;
  1141. height: 40rpx;
  1142. background: #f9fafb;
  1143. position: absolute;
  1144. right: 20rpx;
  1145. top: 72rpx;
  1146. display: none;
  1147. }
  1148. }
  1149. }
  1150. }
  1151. .text {
  1152. font-size: 36rpx;
  1153. }
  1154. .wt_icon {
  1155. font-size: 40rpx;
  1156. }
  1157. }
  1158. </style>