receiptpage.vue 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823
  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. <view class="page_item_cont_start emergency1" v-if="item.emergencyType.value == 1">
  39. <image mode="widthFix" class="page_item_cont_start-img" src="../../static/img/icon_shandian.png">
  40. </image>
  41. {{ item.emergencyType.name }}
  42. </view>
  43. <view class="page_item_cont_start emergency" v-if="item.emergencyType.value == 2">
  44. <image mode="widthFix" class="page_item_cont_start-img" src="../../static/img/icon_shandian.png">
  45. </image>
  46. {{ item.emergencyType.name }}
  47. </view>
  48. <view class="page_item_cont_start emergencys" v-if="item.emergencyType.value == 3">
  49. <image mode="widthFix" class="page_item_cont_start-img" src="../../static/img/icon_shandian.png">
  50. </image>
  51. {{ item.emergencyType.name }}
  52. </view>
  53. <view class="page_item_top_R type" style="margin-left: 16rpx;">
  54. {{
  55. item.isHalfInspect === 1 ? "半程陪检" : item.taskType.taskName
  56. }}<template v-if="item.goodsRemark">-{{item.goodsRemark}}</template>
  57. </view>
  58. <!-- <text class="L_time" v-if="item.overdueTime">{{ item.overdueTime }}前送达</text> -->
  59. </view>
  60. <view class="page_item_top_R" v-if="
  61. !(
  62. item.taskType.associationType.value == 'inspect' &&
  63. item.gdState.value == 5
  64. )
  65. ">
  66. <text class="text_big">{{ item.gdState.name }}</text>
  67. </view>
  68. <view class="page_item_top_R" v-if="
  69. item.taskType.associationType.value == 'inspect' &&
  70. item.gdState.value == 5
  71. ">
  72. <text class="text_big">待送回</text>
  73. </view>
  74. <!-- <view class="page_item_top_R type">
  75. {{
  76. item.isHalfInspect === 1 ? "半程陪检" : item.taskType.taskName
  77. }}<template v-if="item.goodsRemark">-{{item.goodsRemark}}</template>
  78. </view> -->
  79. </view>
  80. <view class="page_item_cont" @click="itemInfo(item)">
  81. <view class="page_item_cont_T">
  82. <view class="page_item_cont_title">
  83. <text> <text class="starting">起</text> 点科室 </text>
  84. <text class="text_big">{{ item.startDept.dept }}</text>
  85. </view>
  86. <!-- <view class="page_item_cont_start emergency1" v-if="item.emergencyType.value == 1">
  87. <image mode="widthFix" class="page_item_cont_start-img" src="../../static/img/icon_shandian.png">
  88. </image>
  89. {{ item.emergencyType.name }}
  90. </view>
  91. <view class="page_item_cont_start emergency" v-if="item.emergencyType.value == 2">
  92. <image mode="widthFix" class="page_item_cont_start-img" src="../../static/img/icon_shandian.png">
  93. </image>
  94. {{ item.emergencyType.name }}
  95. </view>
  96. <view class="page_item_cont_start emergencys" v-if="item.emergencyType.value == 3">
  97. <image mode="widthFix" class="page_item_cont_start-img" src="../../static/img/icon_shandian.png">
  98. </image>
  99. {{ item.emergencyType.name }}
  100. </view> -->
  101. </view>
  102. <view class="page_item_conts" v-if="item.taskType.associationType.value == 'specimen'">
  103. <view v-if="item.overdueTime">{{ item.overdueTime }}前送达</view>
  104. <view>扫描标本数量 : {{ item.actualReceiveNum || '无'}}</view>
  105. <view class="line"></view>
  106. </view>
  107. <view class="page_item_conts" v-else-if="item.taskType.associationType.value == 'ordinary' && item.taskType.ordinaryField.value == 'blood'">
  108. <view v-if="item.overdueTime">{{ item.overdueTime }}前送达</view>
  109. <view>接收数量 : {{ item.actualReceiveNum || '无'}}</view>
  110. <view class="line"></view>
  111. </view>
  112. <view class="page_item_conts" v-else-if="item.taskType.associationType.value == 'inspect'">
  113. <view v-if="item.overdueTime">{{ item.overdueTime }}前送达</view>
  114. <view>
  115. 预约时间 : {{ item.yyTime | yyTimeFilter
  116. }}<text v-if="item.reservationNumber">({{ item.reservationNumber }})</text>
  117. </view>
  118. <view>
  119. 床号 : {{ item.patient ? item.patient.patientName : "-" }}({{
  120. item.patient ? item.patient.bedNum : "-"
  121. }})
  122. </view>
  123. <view v-if="item.goods">
  124. 携带设备 :
  125. <text>{{ item.goods || "暂无" }}</text>
  126. </view>
  127. <view style="word-break: break-all;" v-if="item.workOrderRemark">
  128. 备注信息 :
  129. <text>{{ item.workOrderRemark || "暂无" }}</text>
  130. </view>
  131. <view v-if="item.patient.careLevel">
  132. 护理等级 :
  133. <text :class="[
  134. item.patient.careLevel.value == 0 ||
  135. item.patient.careLevel.value == 1
  136. ? 'red'
  137. : 'green',
  138. ]">{{ item.patient.careLevel.name }}</text>
  139. </view>
  140. <view v-if="item.patient.illnessState">
  141. 病情级别 :
  142. <text :class="{
  143. red:
  144. item.patient.illnessState.value == 2 ||
  145. item.patient.illnessState.value == 3,
  146. }">{{ item.patient.illnessState.name }}</text>
  147. </view>
  148. <view v-if="item.isAccompany === 1 || item.isAccompany === 0">
  149. 陪同情况 :
  150. <text :class="{ red: item.isAccompany === 1 }">{{
  151. item.isAccompany === 1 ? "需要医护陪同" : "无需医护陪同"
  152. }}</text>
  153. </view>
  154. <view class="line"></view>
  155. </view>
  156. <view class="page_item_conts" v-else-if="item.taskType.associationType.value == 'patientTransport'">
  157. <view v-if="item.overdueTime">{{ item.overdueTime }}前送达</view>
  158. <view>
  159. 预约时间 : {{ item.yyjdTime | yyTimeFilter
  160. }}<text v-if="item.reservationNumber">({{ item.reservationNumber }})</text>
  161. </view>
  162. <view>
  163. 床号 : {{ item.patient ? item.patient.patientName : "-" }}({{
  164. item.patient ? item.patient.bedNum : "-"
  165. }})
  166. </view>
  167. <view v-if="item.goods">
  168. 携带设备 :
  169. <text>{{ item.goods || "暂无" }}</text>
  170. </view>
  171. <view style="word-break: break-all;" v-if="item.workOrderRemark">
  172. 备注信息 :
  173. <text>{{ item.workOrderRemark || "暂无" }}</text>
  174. </view>
  175. <view v-if="item.patient.careLevel">
  176. 护理等级 :
  177. <text :class="[
  178. item.patient.careLevel.value == 0 ||
  179. item.patient.careLevel.value == 1
  180. ? 'red'
  181. : 'green',
  182. ]">{{ item.patient.careLevel.name }}</text>
  183. </view>
  184. <view v-if="item.patient.illnessState">
  185. 病情级别 :
  186. <text :class="{
  187. red:
  188. item.patient.illnessState.value == 2 ||
  189. item.patient.illnessState.value == 3,
  190. }">{{ item.patient.illnessState.name }}</text>
  191. </view>
  192. <view v-if="item.isAccompany === 1 || item.isAccompany === 0">
  193. 陪同情况 :
  194. <text :class="{ red: item.isAccompany === 1 }">{{
  195. item.isAccompany === 1 ? "需要医护陪同" : "无需医护陪同"
  196. }}</text>
  197. </view>
  198. <view class="line"></view>
  199. </view>
  200. <view class="page_item_conts" v-else-if="item.taskType.associationType.value == 'drugsBag'">
  201. <view v-if="item.overdueTime">{{ item.overdueTime }}前送达</view>
  202. <view>
  203. 药包编码 : {{ item.drugs ? item.drugs.packid : "无" }}
  204. </view>
  205. <view class="line"></view>
  206. </view>
  207. <view class="page_item_conts" v-else-if="item.taskType.associationType.value == 'jPBag'">
  208. <view v-if="item.overdueTime">{{ item.overdueTime }}前送达</view>
  209. <view>
  210. 药包编码 :
  211. {{ item.staticDistri ? item.staticDistri.packid : "无" }}
  212. </view>
  213. <view class="line"></view>
  214. </view>
  215. <view class="page_item_conts" v-else>
  216. <view v-if="item.overdueTime">{{ item.overdueTime }}前送达</view>
  217. <view class="line"></view>
  218. </view>
  219. <view class="page_item_cont_B">
  220. <view class="page_item_cont_title" v-if="item.taskType.associationType.value != 'inspect'">
  221. <text> <text class="End">终</text> 点科室 </text>
  222. <text class="text_big" v-for="(dept, i) of item.endDepts" :key="i">{{ dept.dept }}</text>
  223. </view>
  224. <view class="page_item_cont_title" v-if="item.taskType.associationType.value == 'inspect'">
  225. <text> <text class="End">检</text> 查科室 </text>
  226. <text class="text_big" v-for="(dept, i) of item.middleDept" :key="i">{{ dept.dept }}</text>
  227. </view>
  228. </view>
  229. </view>
  230. <view v-if="
  231. item.taskType.associationType.value == 'inspect' ||
  232. item.taskType.associationType.value == 'patientTransport'
  233. ">
  234. <!-- 待抢单 -->
  235. <text class="red" v-if="item.gdState.value == 2">请扫描患者腕带,或者请扫描科室码</text>
  236. <!-- 待到达 -->
  237. <text class="red" v-if="item.gdState.value == 4">请扫描患者腕带</text>
  238. <!-- 执行中 -->
  239. <text class="red" v-if="item.gdState.value == 8">请扫描检查科室码,并扫描患者腕带</text>
  240. <!-- 待送达 -->
  241. <text class="red" v-if="item.gdState.value == 5">请扫描终点科室码,并扫描患者腕带</text>
  242. </view>
  243. <view v-else-if="item.taskType.associationType.value == 'other'">
  244. <!-- 待到达 -->
  245. <text class="red" v-if="item.gdState.value == 4">可通过扫描科室码或者拍照进行签到</text>
  246. </view>
  247. <!-- 如果不是患者陪检或患者转运或其他,万能交接 -->
  248. <view class="page_item_btn" v-if="
  249. selectedLabelSlots == '执行中' &&
  250. item.taskType.associationType.value != 'patientTransport' &&
  251. item.taskType.associationType.value != 'inspect' &&
  252. item.taskType.associationType.value != 'other' &&
  253. item.taskType.associationType.value != 'ordinary'
  254. " hover-class="seimin-btn-hover">
  255. <smallScreen :sData="item" :sType="2">扫码</smallScreen>
  256. </view>
  257. <!-- 如果不是静配,药配,标本配送,标本轮巡,万能交接 -->
  258. <view class="page_item_btn_wrap" v-if="
  259. selectedLabelSlots == '执行中' &&
  260. item.taskType.associationType.value != 'jPBag' &&
  261. item.taskType.associationType.value != 'drugsBag' &&
  262. item.taskType.associationType.value != 'specimen' &&
  263. item.taskType.associationType.value != 'specimenPlan' &&
  264. item.taskType.associationType.value != 'ordinary'
  265. ">
  266. <view v-if="!(item.taskType.associationType.value == 'other' && item.gdState.value == 5 && item.taskType.carryingCourses[1].actionsSwitch)" class="page_item_btn" hover-class="seimin-btn-hover">
  267. <smallScreen :sData="item" :sType="1">扫码</smallScreen>
  268. </view>
  269. <!-- 其他临床服务-完成工单-待送达 -->
  270. <view v-if="item.taskType.associationType.value == 'other' && item.gdState.value == 5 && item.taskType.carryingCourses[1].actionsSwitch" class="page_item_btn" @click="otherCompleteOrder(item)" hover-class="seimin-btn-hover">完成工单</view>
  271. <!-- 其他临床服务-拍照 -->
  272. <view v-if="item.taskType.associationType.value == 'other' && item.gdState.value == 4 && item.taskType.carryingCourses[0].photoSwitch" class="page_item_btn" @click="photographToOther(item, 'start')" hover-class="seimin-btn-hover">拍照</view>
  273. <view v-if="item.taskType.associationType.value != 'other' && item.gdState.value == 4" class="page_item_btn" @click="photograph(item)" hover-class="seimin-btn-hover">拍照</view>
  274. </view>
  275. <view class="page_item_btn" v-if="selectedLabelSlots == '待接单'" @click="showAlerts(item)" hover-class="seimin-btn-hover">接单</view>
  276. </view>
  277. <view class="L-l"></view>
  278. <view class="R-l"></view>
  279. </view>
  280. </scroll-view>
  281. </view>
  282. <!-- 底部扫一扫 -->
  283. <bigScreen></bigScreen>
  284. <!-- 悬浮按钮 -->
  285. <uni-fab :pattern="pattern" :content="content" :direction="direction" @trigger="trigger"></uni-fab>
  286. <!-- 弹窗 -->
  287. <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content"
  288. @ok="ok" @cancel="cancel" @know="know" :operate="models.operate"></showModel>
  289. <!-- 我的二维码-弹窗 -->
  290. <showMyQrcode v-if="showMyQrcodeModel.disjunctor" :disjunctor="showMyQrcodeModel.disjunctor" @know="closeMyQrcodeModel"></showMyQrcode>
  291. <!-- 手动查询标本弹窗 -->
  292. <handViewSpecimen v-if="speModels.disjunctor" :title="speModels.title" :disjunctor="speModels.disjunctor"
  293. @ok="speOk" @cancel="speCancel">
  294. </handViewSpecimen>
  295. <!-- 手动查询药品弹窗 -->
  296. <handViewDrugsBag v-if="drugbagModels.disjunctor" :title="drugbagModels.title"
  297. :disjunctor="drugbagModels.disjunctor" @ok="drugbagOk" @cancel="drugbagCancel">
  298. </handViewDrugsBag>
  299. <!-- 填写交接人账号弹窗 -->
  300. <selectAccount v-if="hosModels.disjunctor" :title="hosModels.title" :disjunctor="hosModels.disjunctor" @ok="hosOk"
  301. @cancel="hosCancel">
  302. </selectAccount>
  303. </view>
  304. </template>
  305. <script>
  306. import selectAccount from "../../components/selectAccount/selectAccount.vue";
  307. import smallScreen from "../../components/smallScreen/smallScreen.vue";
  308. import showModel from "../../components/showModel/showModel.vue";
  309. import bigScreen from "../../components/bigScreen/bigScreen.vue";
  310. // https://ext.dcloud.net.cn/plugin?id=144
  311. import uniFab from "@/components/uni-fab/uni-fab.vue";
  312. import {
  313. get,
  314. post,
  315. SM,
  316. deleteIt,
  317. webHandle
  318. } from "../../http/http.js";
  319. import {
  320. photographTool,
  321. pathUrl
  322. } from "../../tools/photograph.js";
  323. export default {
  324. data() {
  325. return {
  326. // 填写交接人账号弹窗model
  327. hosModels: {
  328. disjunctor: false,
  329. },
  330. currentCode: '', //当前拍照使用的科室二维码
  331. currentData: {}, //当前小扫描的工单对象
  332. // 弹窗model
  333. showMyQrcodeModel: {
  334. disjunctor: false,
  335. },
  336. SMFlag: true,
  337. // 手动查询标本弹窗model
  338. speModels: {
  339. disjunctor: false,
  340. },
  341. // 手动查询药品弹窗model
  342. drugbagModels: {
  343. disjunctor: false,
  344. },
  345. // 筛选条件
  346. array: [{
  347. id: 0,
  348. name: "全部",
  349. },
  350. {
  351. id: 71,
  352. name: "待到达",
  353. },
  354. {
  355. id: 72,
  356. name: "待送达",
  357. },
  358. {
  359. id: 75,
  360. name: "执行中",
  361. },
  362. ],
  363. index: 0,
  364. arrayKey: 0,
  365. // 当前登录人是否是药房角色
  366. pharmacistFlag: false,
  367. // 抢单的id
  368. qdId: "",
  369. // 弹窗model
  370. models: {
  371. disjunctor: false,
  372. },
  373. // 悬浮按钮样式
  374. pattern: {
  375. buttonColor: "#6cc076",
  376. },
  377. // 悬浮按钮展开菜单显示方式
  378. direction: "vertical",
  379. // 悬浮按钮展开菜单内容配置项
  380. content: [{
  381. text: "我的任务",
  382. }, ],
  383. // 当前选中tab页名称
  384. selectedLabelSlots: "待接单",
  385. // tab页信息
  386. tabs: [{
  387. label: "待接单", //tab页名称
  388. value: "1", //值
  389. num: 0, //数量
  390. },
  391. {
  392. label: "执行中",
  393. value: "2",
  394. num: 0,
  395. },
  396. ],
  397. //列表数据
  398. zxzData: [],
  399. //分页页码
  400. idx: 0,
  401. // 列表项总数
  402. totalNum: -1,
  403. triggered: false, //下拉刷新状态
  404. freshing: false, //上拉加载开关
  405. scroll_top: 0, //距离顶部的距离
  406. scroll_refresher_enabled: true, //是否开启自定义下拉刷新
  407. };
  408. },
  409. filters: {
  410. // 自定义管道 yyTime
  411. yyTimeFilter: function(data) {
  412. if (data) {
  413. let nDate = null;
  414. if (typeof data == 'string') {
  415. let arr = data.split(/[-:\s]/);
  416. nDate = new Date(
  417. arr[0] - 0,
  418. arr[1] - 1,
  419. arr[2] - 0,
  420. arr[3] - 0,
  421. arr[4] - 0,
  422. 0
  423. );
  424. } else if (typeof data == 'number') {
  425. nDate = new Date(data);
  426. }
  427. const month = (nDate.getMonth() + 1).toString().padStart(2, 0);
  428. const date = nDate.getDate().toString().padStart(2, 0);
  429. const hour = nDate.getHours().toString().padStart(2, 0);
  430. const minute = nDate.getMinutes().toString().padStart(2, 0);
  431. return `${month}-${date} ${hour}:${minute}`;
  432. } else {
  433. return "-";
  434. }
  435. },
  436. },
  437. components: {
  438. uniFab,
  439. showModel,
  440. bigScreen,
  441. selectAccount,
  442. },
  443. methods: {
  444. // 前往其他临床服务完成工单确认页面
  445. otherCompleteOrder(data){
  446. console.log(data);
  447. uni.navigateTo({
  448. url: `../otherCompleteOrder/otherCompleteOrder?orderId=${data.id}&taskType=${data.taskType ? encodeURIComponent(JSON.stringify(data.taskType)) : ''}&order=${data ? encodeURIComponent(JSON.stringify(data)) : ''}`,
  449. });
  450. },
  451. // 手动查询药品-确认
  452. drugbagOk(data) {
  453. console.log(data);
  454. if (!data.id) {
  455. //没有查询到药品
  456. uni.showModal({
  457. title: '提示',
  458. content: "没有查询到发药单号!",
  459. showCancel: false,
  460. success: function(res) {
  461. if (res.confirm) {
  462. console.log('用户点击确定');
  463. } else if (res.cancel) {
  464. console.log('用户点击取消');
  465. }
  466. }
  467. });
  468. return;
  469. }
  470. this.drugbagModels.disjunctor = false;
  471. uni.navigateTo({
  472. url: `/pages/scanning_drug/scanning_drug?drugsBagId=${data.id}`,
  473. });
  474. },
  475. // 手动查询药品-取消
  476. drugbagCancel() {
  477. this.drugbagModels.disjunctor = false;
  478. },
  479. // 手动查询药品弹窗
  480. showHandViewDrugsbag() {
  481. console.log(1)
  482. this.drugbagModels = {
  483. title: '填写发药单号',
  484. disjunctor: true,
  485. }
  486. },
  487. // 手动查询标本-确认
  488. speOk(data) {
  489. console.log(data);
  490. if (!data.id) {
  491. //没有查询到标本
  492. uni.showModal({
  493. title: '提示',
  494. content: "没有查询到标本!",
  495. showCancel: false,
  496. success: function(res) {
  497. if (res.confirm) {
  498. console.log('用户点击确定');
  499. } else if (res.cancel) {
  500. console.log('用户点击取消');
  501. }
  502. }
  503. });
  504. return;
  505. }
  506. this.speModels.disjunctor = false;
  507. let infoDATA = {
  508. stype: data.stype,
  509. scode: data.scode,
  510. patientName: data.patientName,
  511. sickRoom: data.sickRoom ?
  512. data.sickRoom.dept : "-",
  513. checkDept: data.checkDept ?
  514. data.checkDept.dept : "-",
  515. bedNum: data.bedNum,
  516. };
  517. uni.navigateTo({
  518. url: `../scanning_B/scanning_B?res=${encodeURIComponent(
  519. JSON.stringify({data,status:666,scanCodeSpecimenOrderSign:data.scanCodeSpecimenOrderSign,workOrder:data.workOrderDTO})
  520. )}&infoDATA=${encodeURIComponent(
  521. JSON.stringify(infoDATA)
  522. )}`,
  523. });
  524. },
  525. // 手动查询标本-取消
  526. speCancel() {
  527. this.speModels.disjunctor = false;
  528. },
  529. // 手动查询标本弹窗
  530. showHandViewSpecimen() {
  531. this.speModels = {
  532. title: '填写标本编码',
  533. disjunctor: true,
  534. }
  535. },
  536. // 执行中筛选
  537. execFilter({
  538. detail: {
  539. value
  540. }
  541. }) {
  542. this.index = value;
  543. this.arrayKey = this.array[value].id;
  544. this.zxzData = [];
  545. this.totalNum = -1;
  546. this.idx = 0;
  547. this.selectedLabelSlots = "执行中";
  548. this.executingOrders(0);
  549. },
  550. // 获取科室二维码设置开关
  551. getMenu() {
  552. let menu = uni.getStorageSync("userData").menu;
  553. //判断当前登陆人具体角色 start
  554. let roles = uni.getStorageSync("userData").user.role;
  555. this.pharmacistFlag = roles.some(
  556. (item) => item.rolecode === "pharmacist"
  557. );
  558. //判断当前登陆人具体角色 end
  559. console.log(menu);
  560. menu.forEach((item) => {
  561. if (item.link === "wxInspect") {
  562. this.content.push({
  563. text: "检查信息",
  564. });
  565. } else if (item.link === "wxPatient") {
  566. this.content.push({
  567. text: "患者信息",
  568. });
  569. } else if (item.link === "wxPharmacy") {
  570. // 如果是配药师人员,则增加药房
  571. if (this.pharmacistFlag) {
  572. this.content.push({
  573. text: "药房",
  574. });
  575. }
  576. } else if (item.link === "wxCode") {
  577. this.content.push({
  578. text: "二维码设置",
  579. });
  580. } else if (item.link === "wxSpecimenEntry") {
  581. this.content.push({
  582. text: "标本录入",
  583. });
  584. } else if (item.link === "wxDrugsbagEntry") {
  585. this.content.push({
  586. text: "药品录入",
  587. });
  588. } else if (item.link === "wxTakeMedicine") {
  589. this.content.push({
  590. text: "摆药取药",
  591. });
  592. } else if (item.link === "myQrcode") {
  593. this.content.push({
  594. text: "我的二维码",
  595. });
  596. }
  597. });
  598. },
  599. // 拍照
  600. photograph(data) {
  601. photographTool(data);
  602. },
  603. // 如果不是静配,药配,标本配送,标本轮巡
  604. // 科室签到(小扫描)-拍照
  605. nextDeptOrder_ss(data, accountObj) {
  606. console.log(this.currentCode);
  607. let isKs = 0;
  608. let ids = [];
  609. let id = data.id;
  610. ids.push(id);
  611. let list = {
  612. code: "",
  613. ids: ids,
  614. };
  615. let code = "";
  616. let type = "";
  617. if (this.currentCode) {
  618. let gdStateValue = data.gdState.value; //工单状态value
  619. let associationTypeValue = data.taskType.associationType.value; //关联类型value
  620. // 其他临床服务,并且工单状态是待到达||工单状态待送达
  621. if (
  622. (associationTypeValue == "other" &&
  623. gdStateValue == "4") ||
  624. gdStateValue == "5"
  625. ) {
  626. code = this.currentCode;
  627. type = "orderSign/" + code;
  628. list = {
  629. ids
  630. };
  631. if (accountObj) {
  632. list.handover = [accountObj.accountId];
  633. }
  634. isKs = 1;
  635. }
  636. uni.showLoading({
  637. title: "加载中",
  638. mask: true,
  639. });
  640. post("/workerOrder/" + type, list).then((res) => {
  641. uni.hideLoading();
  642. if (res) {
  643. if (res.status == 200) {
  644. if (
  645. gdStateValue == "4" &&
  646. associationTypeValue == "other"
  647. ) {
  648. uni.navigateTo({
  649. url: `../../pages/scanning_code/scanning_code?type=${associationTypeValue}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
  650. });
  651. }
  652. if (gdStateValue == "5") {
  653. uni.navigateTo({
  654. url: `../../pages/scanning_code/scanning_code?type=${associationTypeValue}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
  655. });
  656. }
  657. } else {
  658. uni.navigateTo({
  659. url: `../../pages/scanning_Result/scanning_Result?type=${
  660. associationTypeValue
  661. }&type1=${res.type}&id=${data.id}&status=600&msg=${
  662. res.msg
  663. }&isKs=${isKs}&model=${encodeURIComponent(
  664. JSON.stringify(res)
  665. )}&qrcode=${this.currentCode}`,
  666. });
  667. }
  668. } else {
  669. uni.navigateTo({
  670. url: `../../pages/scanning_Result/scanning_Result?id=${data.id}&status=600&msg=扫码失败!请扫描正确的二维码!&isKs=${isKs}&qrcode=${this.currentCode}`,
  671. });
  672. }
  673. });
  674. }
  675. },
  676. // 填写交接人账号-确认
  677. hosOk(data) {
  678. console.log(data);
  679. const {
  680. accountName,
  681. account,
  682. accountId
  683. } = data;
  684. if (!accountName && !account) {
  685. //没有填写交接人
  686. uni.showModal({
  687. title: '提示',
  688. content: "请填写交接人账号!",
  689. showCancel: false,
  690. success: function(res) {
  691. if (res.confirm) {
  692. console.log('用户点击确定');
  693. } else if (res.cancel) {
  694. console.log('用户点击取消');
  695. }
  696. }
  697. });
  698. return;
  699. } else if (!accountName && account || accountName && !account) {
  700. //没有填写交接人
  701. uni.showModal({
  702. title: '提示',
  703. content: "请填写正确的交接人账号!",
  704. showCancel: false,
  705. success: function(res) {
  706. if (res.confirm) {
  707. console.log('用户点击确定');
  708. } else if (res.cancel) {
  709. console.log('用户点击取消');
  710. }
  711. }
  712. });
  713. return;
  714. }
  715. this.hosModels.disjunctor = false;
  716. let associationTypeValue = this.currentData.taskType.associationType.value;
  717. console.log(associationTypeValue)
  718. this.uploadToOther(this.currentData, data, 'start');
  719. },
  720. // 填写交接人账号-取消
  721. hosCancel() {
  722. this.hosModels.disjunctor = false;
  723. },
  724. // 填写交接人账号弹窗
  725. showSelectAccount() {
  726. this.hosModels = {
  727. title: '填写交接人账号',
  728. disjunctor: true,
  729. }
  730. },
  731. // 拍照-上传
  732. uploadToOther(data, accountObj, type){
  733. // 其他临床服务拍照签到
  734. console.log(data, 1111);
  735. let id_seimin;
  736. let asTypeValue_seimin;
  737. let gdStateValue_seimin;
  738. if (data.status != 200 && data.status !== undefined) {
  739. id_seimin = data.id;
  740. asTypeValue_seimin = data.type;
  741. gdStateValue_seimin = JSON.parse(data.model).gdstate2; //type改成gdstate
  742. } else {
  743. id_seimin = data.id;
  744. asTypeValue_seimin = data.taskType.associationType.value;
  745. gdStateValue_seimin = data.gdState.value;
  746. }
  747. //#ifdef H5
  748. uni.chooseImage({
  749. count: 1,
  750. sourceType: ['camera'],
  751. success: (chooseImageRes) => {
  752. console.log(chooseImageRes, pathUrl)
  753. const tempFilePaths = chooseImageRes.tempFilePaths;
  754. const tempFiles = chooseImageRes.tempFiles;
  755. let tp = tempFilePaths[0];
  756. uni.showLoading({
  757. mask: true,
  758. title: '加载中'
  759. });
  760. post('/workerOrder/findRecordInfoByOrderId', {
  761. orderId: id_seimin,
  762. gdOperate: 21,
  763. }).then(result => {
  764. console.log(result)
  765. if (result.state == 200) {
  766. uni.getImageInfo({
  767. src: tp,
  768. success: (res) => {
  769. console.log('压缩前', res)
  770. let canvasWidth = res.width //图片原始长宽
  771. let canvasHeight = res.height
  772. let img = new Image()
  773. img.src = res.path
  774. let canvas = document.createElement('canvas');
  775. let ctx = canvas.getContext('2d')
  776. canvas.width = canvasWidth
  777. canvas.height = canvasHeight
  778. ctx.drawImage(img, 0, 0, canvasWidth, canvasHeight)
  779. canvas.toBlob((fileSrc) => {
  780. tp = window.URL.createObjectURL(fileSrc)
  781. console.log('压缩后', tp);
  782. uni.uploadFile({
  783. url: pathUrl + '/common/common/uploadAttachment/'+(type == 'start' ? 'orderStartPhoto' : 'orderEndPhoto')+'/' + id_seimin + '/' + result.recordId,
  784. filePath: tp,
  785. name: 'file',
  786. formData: {
  787. 'filename': tempFiles[0].name ? tempFiles[0].name.split('.')[0] + '.jpg' : tempFiles[
  788. 0].path.split(
  789. /[\\/]/).reverse()[0].split('.')[0] + '.jpg'
  790. },
  791. success: (uploadFileRes) => {
  792. console.log(uploadFileRes, 10086, asTypeValue_seimin);
  793. this.nextDeptOrder_ss(data, accountObj, type);
  794. },
  795. fail: err => {
  796. console.error(err);
  797. uni.hideLoading();
  798. uni.showToast({
  799. icon: 'none',
  800. title: '上传失败',
  801. duration: 2000
  802. });
  803. }
  804. });
  805. }, 'image/jpeg', 0.3)
  806. },
  807. fail: function () {
  808. uni.hideLoading();
  809. uni.showToast({
  810. icon: 'none',
  811. title: '上传失败',
  812. duration: 2000
  813. });
  814. }
  815. })
  816. } else {
  817. uni.hideLoading();
  818. uni.showToast({
  819. icon: "none",
  820. title: "请求失败!",
  821. });
  822. }
  823. })
  824. }
  825. });
  826. //#endif
  827. //#ifdef APP-PLUS
  828. uni.chooseImage({
  829. count: 1,
  830. sourceType: ['camera'],
  831. sizeType: ['compressed'],
  832. success: (chooseImageRes) => {
  833. console.log(chooseImageRes, pathUrl)
  834. const tempFilePaths = chooseImageRes.tempFilePaths;
  835. const tempFiles = chooseImageRes.tempFiles;
  836. let tp = tempFilePaths[0];
  837. uni.showLoading({
  838. mask: true,
  839. title: '加载中'
  840. });
  841. post('/workerOrder/findRecordInfoByOrderId', {
  842. orderId: id_seimin,
  843. gdOperate: 21,
  844. }).then(result => {
  845. console.log(result)
  846. if (result.state == 200) {
  847. uni.compressImage({
  848. src: tp,
  849. quality: 30,
  850. success: (res) => {
  851. console.log('压缩前', res)
  852. tp = res.tempFilePath;
  853. console.log('压缩后', tp);
  854. uni.uploadFile({
  855. url: pathUrl + '/common/common/uploadAttachment/'+(type == 'start' ? 'orderStartPhoto' : 'orderEndPhoto')+'/' + id_seimin + '/' + result.recordId,
  856. filePath: tp,
  857. name: 'file',
  858. formData: {
  859. 'filename': tempFiles[0].name ? tempFiles[0].name.split('.')[0] + '.jpg' : tempFiles[
  860. 0].path.split(
  861. /[\\/]/).reverse()[0].split('.')[0] + '.jpg'
  862. },
  863. success: (uploadFileRes) => {
  864. console.log(uploadFileRes, 10086, asTypeValue_seimin);
  865. this.nextDeptOrder_ss(data, accountObj, type);
  866. },
  867. fail: err => {
  868. console.error(err);
  869. uni.hideLoading();
  870. uni.showToast({
  871. icon: 'none',
  872. title: '上传失败',
  873. duration: 2000
  874. });
  875. }
  876. });
  877. },
  878. fail: function () {
  879. uni.hideLoading();
  880. uni.showToast({
  881. icon: 'none',
  882. title: '上传失败',
  883. duration: 2000
  884. });
  885. }
  886. })
  887. } else {
  888. uni.hideLoading();
  889. uni.showToast({
  890. icon: "none",
  891. title: "请求失败!",
  892. });
  893. }
  894. })
  895. }
  896. });
  897. //#endif
  898. },
  899. // 拍照-其他
  900. async photographToOther(data, type) {
  901. this.currentData = data;
  902. uni.showLoading({
  903. title: "加载中",
  904. mask: true,
  905. });
  906. // 其他临床服务
  907. let result = await post("/dept/scanning", {
  908. content: type === 'start' ? data.startDept.qrcode : data.endDepts[0].qrcode,
  909. taskTypeId: data.taskType.id,
  910. gdState: data.gdState.id,
  911. });
  912. uni.hideLoading();
  913. this.currentCode = result.code;
  914. if (result.state == 200 || result.state == 201) {
  915. uni.showModal({
  916. title: '提示',
  917. content: '请尽量拍摄角度覆盖清洁区域?',
  918. success: (res) => {
  919. if (res.confirm) {
  920. if (result.account) {
  921. this.uploadToOther(data, {
  922. account: result.account,
  923. accountName: result.name,
  924. accountId: result.id,
  925. }, type);
  926. } else {
  927. this.uploadToOther(data, undefined, type);
  928. }
  929. } else if (res.cancel) {
  930. console.log('用户点击取消');
  931. }
  932. }
  933. });
  934. } else if (result.state == '0000') {
  935. this.showSelectAccount();
  936. } else {
  937. uni.showToast({
  938. icon: "none",
  939. title: "请求失败!",
  940. });
  941. }
  942. //检验二维码的有效性
  943. // post("/dept/scanning", {
  944. // content: type === 'start' ? data.startDept.qrcode : data.endDepts[0].qrcode,
  945. // taskTypeId: data.taskType.id,
  946. // gdState: data.gdState.id,
  947. // }).then((result) => {
  948. // uni.hideLoading();
  949. // this.currentCode = result.code;
  950. // if (result.state == 200 || result.state == 201) {
  951. // if (result.account) {
  952. // this.uploadToOther(data, {
  953. // account: result.account,
  954. // accountName: result.name,
  955. // accountId: result.id,
  956. // }, type);
  957. // } else {
  958. // this.uploadToOther(data, undefined, type);
  959. // }
  960. // } else if (result.state == '0000') {
  961. // this.showSelectAccount();
  962. // } else {
  963. // uni.showToast({
  964. // icon: "none",
  965. // title: "请求失败!",
  966. // });
  967. // }
  968. // });
  969. },
  970. // 悬浮按钮点击事件
  971. trigger(e) {
  972. if (e.item.text === "我的任务") {
  973. uni.navigateTo({
  974. url: "../mypage/mypage",
  975. });
  976. } else if (e.item.text === "退出登录") {
  977. // 假登录
  978. uni.showToast({
  979. title: "退出成功!",
  980. });
  981. let ip = uni.getStorageSync("ip"); //记住域名或ip
  982. let username = uni.getStorageSync("username"); //记住用户名
  983. let password = uni.getStorageSync("password"); //记住密码
  984. let savePasswordTime = uni.getStorageSync("savePasswordTime"); //记住密码的时间戳
  985. let clientid = uni.getStorageSync("clientid");
  986. uni.clearStorageSync();
  987. if (username) {
  988. uni.setStorageSync("ip", ip); //记住域名或ip
  989. uni.setStorageSync("username", username); //记住用户名
  990. uni.setStorageSync("password", password); //记住密码
  991. uni.setStorageSync("savePasswordTime", savePasswordTime); //记住密码的时间戳
  992. }
  993. uni.setStorageSync("clientid", clientid);
  994. uni.navigateTo({
  995. url: "../homePage/homePage",
  996. });
  997. // 假登录
  998. deleteIt("/auth/logout2").then((result) => {
  999. if (result.status == 200) {
  1000. uni.showToast({
  1001. title: "退出成功!",
  1002. });
  1003. let ip = uni.getStorageSync("ip"); //记住域名或ip
  1004. let username = uni.getStorageSync("username"); //记住用户名
  1005. let password = uni.getStorageSync("password"); //记住密码
  1006. let clientid = uni.getStorageSync("clientid");
  1007. uni.clearStorageSync();
  1008. uni.setStorageSync("ip", ip); //记住域名或ip
  1009. uni.setStorageSync("username", username); //记住用户名
  1010. uni.setStorageSync("password", password); //记住密码
  1011. uni.setStorageSync("clientid", clientid);
  1012. uni.navigateTo({
  1013. url: "../homePage/homePage",
  1014. });
  1015. } else {
  1016. uni.showToast({
  1017. icon: "none",
  1018. title: "请求失败!",
  1019. });
  1020. }
  1021. });
  1022. } else if (e.item.text === "药房") {
  1023. uni.navigateTo({
  1024. url: "../pharmacy/pharmacy",
  1025. });
  1026. } else if (e.item.text === "患者信息") {
  1027. uni.navigateTo({
  1028. url: "../patientInformationList/patientInformationList",
  1029. });
  1030. } else if (e.item.text === "负责科室") {
  1031. if (uni.getStorageSync("setDepts")) {
  1032. uni.removeStorageSync("setDepts"); //清空选择的科室,初始化
  1033. }
  1034. let obj = uni.getStorageSync("setDeptConfg");
  1035. uni.navigateTo({
  1036. url: `../setDept/setDept?configName=${obj.configName}&id=${obj.id}&changedept=1`,
  1037. });
  1038. } else if (e.item.text === "检查信息") {
  1039. uni.navigateTo({
  1040. url: "../inspectList/inspectList",
  1041. });
  1042. } else if (e.item.text === "二维码设置") {
  1043. uni.navigateTo({
  1044. url: "../settingCode/settingCode",
  1045. });
  1046. } else if (e.item.text === "标本录入") {
  1047. this.showHandViewSpecimen();
  1048. } else if (e.item.text === "药品录入") {
  1049. this.showHandViewDrugsbag();
  1050. } else if (e.item.text === "摆药取药") {
  1051. this.handleTakeMedicine()
  1052. } else if (e.item.text === "我的二维码") {
  1053. this.myQrcodeHandler()
  1054. }
  1055. },
  1056. // 我的二维码
  1057. myQrcodeHandler(){
  1058. this.showMyQrcodeModel = {
  1059. disjunctor: true,
  1060. };
  1061. },
  1062. closeMyQrcodeModel(){
  1063. this.showMyQrcodeModel.disjunctor = false;
  1064. },
  1065. // 摆药取药
  1066. handleTakeMedicine() {
  1067. if (!this.SMFlag) {
  1068. return;
  1069. }
  1070. this.SMFlag = false;
  1071. SM().then((content) => {
  1072. uni.showLoading({
  1073. title: "加载中",
  1074. mask: true,
  1075. });
  1076. //检验二维码的有效性(扫码前必须验证)
  1077. post("/dept/scanning", {
  1078. content,
  1079. })
  1080. .then((result) => {
  1081. this.currentCode = result.code;
  1082. this.SMFlag = true;
  1083. // 200检测通过,201没有有效期也通过。
  1084. if (result.state == 200 || result.state == 201) {
  1085. uni.hideLoading();
  1086. uni.navigateTo({
  1087. url: `../promptPage/promptPage?code=${result.code}`,
  1088. });
  1089. } else {
  1090. uni.hideLoading();
  1091. uni.showToast({
  1092. icon: "none",
  1093. title: '请求失败',
  1094. });
  1095. }
  1096. })
  1097. }).catch(err => {
  1098. this.SMFlag = true;
  1099. });
  1100. },
  1101. // 点击tab页切换
  1102. clickHandler(key) {
  1103. this.selectedLabelSlots = key;
  1104. this.idx = 0;
  1105. this.totalNum = -1;
  1106. // this.zxzData = [];
  1107. this.scroll_top = Math.random(); //回到顶部
  1108. if (key === "待接单") {
  1109. this.waitingOrders(0);
  1110. } else if (key === "执行中") {
  1111. this.executingOrders(0);
  1112. }
  1113. },
  1114. // 进入详情页
  1115. itemInfo(workOrder) {
  1116. console.log(workOrder);
  1117. uni.navigateTo({
  1118. url: `../receipt_infopage/receipt_infopage?id=${workOrder.id}&associationTypeValue=${workOrder.taskType.associationType.value}`,
  1119. });
  1120. },
  1121. //抢单后知道了
  1122. know() {
  1123. this.models.disjunctor = false;
  1124. this.idx = 0;
  1125. this.totalNum = -1;
  1126. // this.zxzData = [];
  1127. this.executingOrdersGetNum();
  1128. this.waitingOrders(0); //seimin
  1129. this.scroll_top = Math.random(); //回到顶部
  1130. },
  1131. //抢单确定
  1132. ok() {
  1133. this.models.disjunctor = false;
  1134. get("/workerOrder/takeOrder/" + this.qdId.id).then((res) => {
  1135. let msg = "接单失败";
  1136. let icon = "error";
  1137. if (res.status == 200) {
  1138. msg = "接单成功";
  1139. icon = "success";
  1140. }
  1141. this.models = {
  1142. disjunctor: true,
  1143. content: msg,
  1144. icon: icon,
  1145. operate: {
  1146. know: "知道了",
  1147. },
  1148. };
  1149. });
  1150. },
  1151. //抢单取消
  1152. cancel() {
  1153. this.models.disjunctor = false;
  1154. },
  1155. // 抢单
  1156. showAlerts(data) {
  1157. this.qdId = data;
  1158. this.models = {
  1159. disjunctor: true,
  1160. title: "提示",
  1161. content: "是否确定接单?",
  1162. icon: "warn",
  1163. operate: {
  1164. ok: "确定",
  1165. cancel: "取消",
  1166. },
  1167. };
  1168. },
  1169. //执行中列表数据获取
  1170. executingOrders(idx) {
  1171. console.log(this.zxzData.length, this.totalNum);
  1172. if (this.zxzData.length == this.totalNum) {
  1173. uni.showToast({
  1174. icon: "none",
  1175. title: "没有更多数据了!",
  1176. });
  1177. this.freshing = true;
  1178. return;
  1179. }
  1180. let data = {
  1181. idx,
  1182. sum: 20,
  1183. };
  1184. if (this.arrayKey) {
  1185. data.keyWord = this.arrayKey;
  1186. } else {
  1187. delete data.keyWord;
  1188. }
  1189. uni.showLoading({
  1190. title: "加载中",
  1191. mask: true,
  1192. });
  1193. post("/workerOrder/executingOrders", data).then((res) => {
  1194. uni.hideLoading();
  1195. if (res.status == 200) {
  1196. this.triggered = false;
  1197. this.freshing = true;
  1198. this.totalNum = res.data.resultCount;
  1199. if (idx === 0) {
  1200. this.zxzData = res.data.data;
  1201. } else {
  1202. this.zxzData.push(...res.data.data);
  1203. }
  1204. this.tabs[1].num = res.data.resultCount;
  1205. } else {
  1206. uni.showToast({
  1207. icon: "none",
  1208. title: "请求失败!",
  1209. });
  1210. }
  1211. });
  1212. },
  1213. //待抢单列表数据获取
  1214. waitingOrders(idx) {
  1215. if (this.zxzData.length == this.totalNum) {
  1216. uni.showToast({
  1217. icon: "none",
  1218. title: "没有更多数据了!",
  1219. });
  1220. this.freshing = true;
  1221. return;
  1222. }
  1223. let data = {
  1224. idx,
  1225. sum: 20,
  1226. };
  1227. uni.showLoading({
  1228. title: "加载中",
  1229. mask: true,
  1230. });
  1231. // 请求列表数据
  1232. post("/workerOrder/waitingOrders", data).then((res) => {
  1233. uni.hideLoading();
  1234. if (res.status == 200) {
  1235. this.triggered = false;
  1236. this.freshing = true;
  1237. this.totalNum = res.data.resultCount;
  1238. if (idx === 0) {
  1239. this.zxzData = res.data.data;
  1240. } else {
  1241. this.zxzData.push(...res.data.data);
  1242. }
  1243. this.tabs[0].num = res.data.resultCount;
  1244. } else {
  1245. uni.showToast({
  1246. icon: "none",
  1247. title: "请求失败!",
  1248. });
  1249. }
  1250. });
  1251. },
  1252. //刷新
  1253. refresherrefresh() {
  1254. if (this.triggered) {
  1255. return;
  1256. }
  1257. this.triggered = true;
  1258. this.idx = 0;
  1259. this.totalNum = -1;
  1260. if (this.selectedLabelSlots == "待接单") {
  1261. this.waitingOrders(0);
  1262. } else if (this.selectedLabelSlots == "执行中") {
  1263. this.executingOrders(0);
  1264. }
  1265. },
  1266. // 滚动
  1267. scroll(e) {
  1268. if (e.detail.scrollTop < 20) {
  1269. this.scroll_refresher_enabled = true;
  1270. } else {
  1271. this.scroll_refresher_enabled = false;
  1272. }
  1273. },
  1274. // 下拉刷新复位
  1275. refresherrestore() {
  1276. this.triggered = false;
  1277. console.log("下拉刷新复位");
  1278. },
  1279. //下拉刷新中止
  1280. refresherabort() {
  1281. this.triggered = false;
  1282. console.log("下拉刷新中止");
  1283. },
  1284. //分页,上拉加载
  1285. scrolltolower() {
  1286. if (this.freshing) {
  1287. this.freshing = false;
  1288. if (this.selectedLabelSlots == "待接单") {
  1289. this.waitingOrders(++this.idx);
  1290. } else if (this.selectedLabelSlots == "执行中") {
  1291. this.executingOrders(++this.idx);
  1292. }
  1293. }
  1294. },
  1295. // 执行中获取数字
  1296. executingOrdersGetNum() {
  1297. let data = {
  1298. idx: 0,
  1299. sum: 20,
  1300. };
  1301. if (this.arrayKey) {
  1302. data.keyWord = this.arrayKey;
  1303. } else {
  1304. delete data.keyWord;
  1305. }
  1306. post("/workerOrder/executingOrders", data).then((res) => {
  1307. if (res.status == 200) {
  1308. this.tabs[1].num = res.data.resultCount;
  1309. } else {
  1310. uni.showToast({
  1311. icon: "none",
  1312. title: "请求失败!",
  1313. });
  1314. }
  1315. });
  1316. },
  1317. // 待接单获取数字
  1318. waitingOrdersGetNum() {
  1319. let data = {
  1320. idx: 0,
  1321. sum: 20,
  1322. };
  1323. post("/workerOrder/waitingOrders", data).then((res) => {
  1324. if (res.status == 200) {
  1325. this.tabs[0].num = res.data.resultCount;
  1326. } else {
  1327. uni.showToast({
  1328. icon: "none",
  1329. title: "请求失败!",
  1330. });
  1331. }
  1332. });
  1333. },
  1334. // 阻止浏览器滑动
  1335. stop(e) {
  1336. e.preventDefault();
  1337. },
  1338. },
  1339. onLoad() {
  1340. // 获取菜单权限
  1341. this.getMenu();
  1342. post("/auth/getUserWorkDept", {}).then((ress) => {
  1343. if (ress.status == 200) {
  1344. let userId = uni.getStorageSync("userData").user.id;
  1345. let groupManager = ress.settings && ress.settings.groupManager; //当前工作组合选择的组
  1346. let workType = ress.settings ? ress.settings.workType : -1; //1是综合,2是自主
  1347. let ruleType = ress.settings ? ress.settings.ruleType : -1; //3是科室绑定人员,4是科室绑定分组,2是绑定分组
  1348. if (workType == 2 && (ruleType == 3 || (ruleType == 4 && userId == groupManager.manager))) {
  1349. //自选排班,科室绑定分组,当前登陆人是组长
  1350. this.content.unshift({
  1351. text: "负责科室",
  1352. });
  1353. }
  1354. }
  1355. });
  1356. // let setDeptConfg = uni.getStorageSync("setDeptConfg");
  1357. // let manager = uni.getStorageSync("manager");
  1358. // let userId = uni.getStorageSync("userData").user.id;
  1359. // console.log(setDeptConfg, manager, userId);
  1360. // if (
  1361. // setDeptConfg.workSchemeType == 2 &&
  1362. // (setDeptConfg.ruleType == 3 ||
  1363. // (setDeptConfg.ruleType == 4 && userId == manager))
  1364. // ) {
  1365. // //自选排班,科室绑定人员 || 科室绑定分组 && 组长是当前登陆人
  1366. // this.content.unshift({
  1367. // text: "负责科室",
  1368. // });
  1369. // }
  1370. // #ifdef APP-PLUS
  1371. // this.content.push({
  1372. // text: "退出登录",
  1373. // });
  1374. // #endif
  1375. this.selectedLabelSlots = "执行中";
  1376. this.waitingOrdersGetNum();
  1377. this.executingOrders(0);
  1378. // #ifdef APP-PLUS
  1379. webHandle("no", "app");
  1380. // #endif
  1381. // #ifdef H5
  1382. webHandle("no", "wx");
  1383. // #endif
  1384. },
  1385. onShow() {
  1386. this.SMFlag = true;
  1387. // #ifdef H5
  1388. document.body.addEventListener("touchmove", this.stop, {
  1389. passive: false,
  1390. });
  1391. // #endif
  1392. },
  1393. onHide() {
  1394. // #ifdef H5
  1395. document.body.removeEventListener("touchmove", this.stop, {
  1396. passive: false,
  1397. });
  1398. // #endif
  1399. },
  1400. };
  1401. </script>
  1402. <style lang="less">
  1403. .Receiptpage {
  1404. width: 100%;
  1405. height: 100%;
  1406. position: relative;
  1407. .red {
  1408. color: red !important;
  1409. font-weight: bold !important;
  1410. }
  1411. .page_tab {
  1412. width: 100%;
  1413. height: 96rpx;
  1414. display: flex;
  1415. position: fixed;
  1416. left: 0;
  1417. top: 0;
  1418. z-index: 999;
  1419. .page_tab_bar {
  1420. flex: 1;
  1421. font-size: 36rpx;
  1422. background: #fff;
  1423. display: flex;
  1424. justify-content: center;
  1425. align-items: center;
  1426. position: relative;
  1427. &:after {
  1428. content: "";
  1429. position: absolute;
  1430. left: 0;
  1431. bottom: 0;
  1432. height: 2rpx;
  1433. width: 100%;
  1434. background-color: transparent;
  1435. }
  1436. .tab_num {
  1437. color: #ff3b53;
  1438. margin-left: 8rpx;
  1439. }
  1440. .more {
  1441. position: absolute;
  1442. right: 20rpx;
  1443. width: 40rpx;
  1444. height: 4rpx;
  1445. border-top: 2px solid #49b856;
  1446. border-bottom: 2px solid #49b856;
  1447. background-color: #49b856;
  1448. padding: 5px 0;
  1449. background-clip: content-box;
  1450. }
  1451. .more_picker {
  1452. position: absolute;
  1453. right: 0;
  1454. height: 100%;
  1455. opacity: 0;
  1456. }
  1457. &.active {
  1458. color: #49b856;
  1459. &:after {
  1460. background-color: #49b856;
  1461. }
  1462. }
  1463. }
  1464. }
  1465. .zwsj {
  1466. position: absolute;
  1467. left: 50%;
  1468. top: 180rpx;
  1469. transform: translateX(-50%);
  1470. .zwsj-img {
  1471. width: 560rpx;
  1472. }
  1473. .zwsj-txt {
  1474. font-size: 36rpx;
  1475. font-weight: 700;
  1476. margin-top: 20rpx;
  1477. text-align: center;
  1478. }
  1479. }
  1480. .page_items {
  1481. height: calc(100vh - 214rpx);
  1482. padding: 0 20rpx;
  1483. // padding-bottom: 88rpx;
  1484. padding-top: 96rpx;
  1485. .page_items_scroll {
  1486. height: 100%;
  1487. .page_item_wrap {
  1488. position: relative;
  1489. margin-bottom: 32rpx;
  1490. .page_item {
  1491. margin-bottom: 16rpx;
  1492. // min-height: 356rpx;
  1493. background: #fff;
  1494. border-radius: 8rpx;
  1495. overflow: hidden;
  1496. border: 2rpx solid #e5e9ed;
  1497. .L {
  1498. width: 40rpx;
  1499. height: 40rpx;
  1500. border-radius: 50%;
  1501. background: #f9fafb;
  1502. position: absolute;
  1503. left: -24rpx;
  1504. top: 68rpx;
  1505. border: 2rpx solid #e5e9ed;
  1506. }
  1507. .R {
  1508. width: 40rpx;
  1509. height: 40rpx;
  1510. border-radius: 50%;
  1511. background: #f9fafb;
  1512. position: absolute;
  1513. float: right;
  1514. right: -24rpx;
  1515. top: 68rpx;
  1516. border: 2rpx solid #e5e9ed;
  1517. }
  1518. .starting {
  1519. width: 40rpx;
  1520. height: 40rpx;
  1521. color: #fff;
  1522. background: #49b856;
  1523. display: inline-block;
  1524. border-radius: 50%;
  1525. text-align: center;
  1526. line-height: 40rpx;
  1527. font-size: 28rpx;
  1528. }
  1529. .End {
  1530. width: 40rpx;
  1531. height: 40rpx;
  1532. color: #fff;
  1533. background: #39b199;
  1534. display: inline-block;
  1535. border-radius: 50%;
  1536. text-align: center;
  1537. line-height: 40rpx;
  1538. font-size: 28rpx;
  1539. }
  1540. .page_item_top {
  1541. height: 86rpx;
  1542. border-bottom: 2rpx dashed #e5e9ed;
  1543. padding: 0 16rpx;
  1544. .page_item_top_L {
  1545. height: 100%;
  1546. float: left;
  1547. line-height: 88rpx;
  1548. display: flex;
  1549. align-items: center;
  1550. .emergencys {
  1551. background: #ff3b53 !important;
  1552. width: 124rpx !important;
  1553. }
  1554. .emergency {
  1555. background: #ff3b53 !important;
  1556. }
  1557. .emergency1 {
  1558. background: #49b856 !important;
  1559. }
  1560. .page_item_cont_start {
  1561. text-align: center;
  1562. height: 44rpx;
  1563. width: 104rpx;
  1564. line-height: 44rpx;
  1565. border-radius: 8rpx;
  1566. background: #49b856;
  1567. color: #fff;
  1568. .page_item_cont_start-img {
  1569. width: 22rpx;
  1570. position: relative;
  1571. top: 6rpx;
  1572. margin-right: 8rpx;
  1573. }
  1574. }
  1575. .L_iocn {
  1576. display: inline-block;
  1577. width: 44rpx;
  1578. height: 44rpx;
  1579. line-height: 42rpx;
  1580. border-radius: 100rpx;
  1581. color: #6cc076;
  1582. font-size: 32rpx;
  1583. border: 4rpx solid #6cc076;
  1584. background: #f0f6ed;
  1585. text-align: center;
  1586. margin-right: 8rpx;
  1587. }
  1588. .L_time {
  1589. color: #6cc076;
  1590. font-size: 32rpx;
  1591. }
  1592. .L_text {
  1593. font-size: 32rpx;
  1594. }
  1595. }
  1596. .page_item_top_R {
  1597. height: 100%;
  1598. float: right;
  1599. line-height: 88rpx;
  1600. font-size: 32rpx;
  1601. &.type {
  1602. margin-right: 32rpx;
  1603. color: red;
  1604. max-width: 260rpx;
  1605. white-space: nowrap;
  1606. text-overflow: ellipsis;
  1607. overflow: hidden;
  1608. }
  1609. .text_big{
  1610. font-weight: bold;
  1611. }
  1612. }
  1613. }
  1614. .page_item_cont {
  1615. min-height: 180rpx;
  1616. padding: 0 16rpx;
  1617. text-align: left;
  1618. position: relative;
  1619. display: flex;
  1620. flex-direction: column;
  1621. justify-content: space-between;
  1622. .text_big {
  1623. font-size: 32rpx;
  1624. margin-left: 10rpx;
  1625. font-weight: 700;
  1626. }
  1627. .line {
  1628. height: 100%;
  1629. width: 2rpx;
  1630. border-left: 2rpx solid #e5e9ed;
  1631. position: absolute;
  1632. // top: 70rpx;
  1633. top: 50%;
  1634. left: 20rpx;
  1635. transform: translateY(-50%);
  1636. }
  1637. .lines {
  1638. height: 40%;
  1639. width: 2rpx;
  1640. border-left: 2rpx solid #e5e9ed;
  1641. position: absolute;
  1642. top: 23%;
  1643. left: 36rpx;
  1644. }
  1645. .emergencys {
  1646. background: #ff3b53 !important;
  1647. width: 124rpx !important;
  1648. }
  1649. .emergency {
  1650. background: #ff3b53 !important;
  1651. }
  1652. .emergency1 {
  1653. background: #49b856 !important;
  1654. }
  1655. .page_item_cont_T {
  1656. // min-height: 80rpx;
  1657. // max-height: 324rpx;
  1658. font-size: 28rpx;
  1659. margin-top: 16rpx;
  1660. display: flex;
  1661. justify-content: space-between;
  1662. .page_item_cont_title {
  1663. height: 100%;
  1664. // float: left;
  1665. }
  1666. .page_item_cont_start {
  1667. text-align: center;
  1668. // float: right;
  1669. height: 44rpx;
  1670. width: 104rpx;
  1671. line-height: 44rpx;
  1672. border-radius: 8rpx;
  1673. background: #49b856;
  1674. color: #fff;
  1675. .page_item_cont_start-img {
  1676. width: 22rpx;
  1677. position: relative;
  1678. top: 6rpx;
  1679. margin-right: 8rpx;
  1680. }
  1681. }
  1682. }
  1683. .page_item_conts {
  1684. min-height: 30rpx;
  1685. color: rgb(102, 102, 102);
  1686. padding-left: 50rpx;
  1687. font-size: 28rpx;
  1688. margin: 16rpx 0;
  1689. position: relative;
  1690. view:not(.line) {
  1691. line-height: 1.2;
  1692. }
  1693. text {
  1694. color: #49b856;
  1695. }
  1696. }
  1697. .page_item_cont_B {
  1698. // padding-top: 20rpx;
  1699. font-size: 28rpx;
  1700. // overflow: hidden;
  1701. margin-bottom: 16rpx;
  1702. .page_item_cont_title {
  1703. height: 100%;
  1704. float: left;
  1705. }
  1706. }
  1707. }
  1708. .page_item_btn_wrap {
  1709. display: flex;
  1710. justify-content: space-between;
  1711. .page_item_btn {
  1712. height: 88rpx;
  1713. flex: 1;
  1714. margin-left: 1%;
  1715. margin-right: 1%;
  1716. background-image: linear-gradient(to right, #72c172, #3bb197);
  1717. border-radius: 8rpx;
  1718. line-height: 88rpx;
  1719. color: #fff;
  1720. font-size: 36rpx;
  1721. font-weight: 700;
  1722. text-align: center;
  1723. }
  1724. }
  1725. .page_item_btn {
  1726. height: 88rpx;
  1727. background-image: linear-gradient(to right, #72c172, #3bb197);
  1728. border-radius: 8rpx;
  1729. line-height: 88rpx;
  1730. color: #fff;
  1731. font-size: 36rpx;
  1732. font-weight: 700;
  1733. text-align: center;
  1734. }
  1735. }
  1736. .L-l {
  1737. width: 2rpx;
  1738. height: 40rpx;
  1739. background: #f9fafb;
  1740. position: absolute;
  1741. left: 20rpx;
  1742. top: 72rpx;
  1743. display: none;
  1744. }
  1745. .R-l {
  1746. width: 2rpx;
  1747. height: 40rpx;
  1748. background: #f9fafb;
  1749. position: absolute;
  1750. right: 20rpx;
  1751. top: 72rpx;
  1752. display: none;
  1753. }
  1754. }
  1755. }
  1756. }
  1757. .text {
  1758. font-size: 36rpx;
  1759. }
  1760. .wt_icon {
  1761. font-size: 40rpx;
  1762. }
  1763. }
  1764. </style>