receiptpage.vue 42 KB

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