receiptpage.vue 37 KB

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