receiptpage.vue 38 KB

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