receiptpage.vue 40 KB

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