receiptpage.vue 39 KB

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