specimenHandoverNew.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. <template>
  2. <view class="Scanning_Result">
  3. <view class="Scanning_top">
  4. <view class="Scanning_top_icon">
  5. <text class="cubeic-ok newicon newicon-duigou"></text>
  6. <view class="text1"> 签到成功 </view>
  7. </view>
  8. <view class="Scanning_top_text">
  9. 您已到达{{queryObj.dept}},请核对填写以下标本信息
  10. </view>
  11. </view>
  12. <view class="Scanning_cont">
  13. <view class="Scanning_cont_head">
  14. <view class="Scanning_cont_head_item" :class="{active: type == key}" v-for="(item, key) in typeList" :key="item.id" @click="clickTab(key)">
  15. {{item.name}}
  16. </view>
  17. </view>
  18. <view class="Scanning_cont_list">
  19. <view class="Scanning_cont_list_item Scanning_cont_list_head">
  20. <view class="name" v-if="type === 'patient'">
  21. 患者名称<text class="red">({{typeList.patient.titleCount}})</text>
  22. </view>
  23. <view class="name" v-if="type === 'specimenDesc'">
  24. 项目名称<text class="red">({{typeList.specimenDesc.titleCount}})</text>
  25. </view>
  26. <view class="name" v-if="type === 'speTubeType'">
  27. 试管类型<text class="red">({{typeList.speTubeType.titleCount}})</text>
  28. </view>
  29. <view class="value" v-if="type === 'speTubeType'">
  30. <view>
  31. 标本数量<text class="red">({{typeList.speTubeType.count}})</text>
  32. </view>
  33. </view>
  34. <view class="value" v-if="type === 'patient'">
  35. <view>
  36. 标本数量<text class="red">({{typeList.patient.count}})</text>
  37. </view>
  38. </view>
  39. <view class="value" v-if="type === 'specimenDesc'">
  40. <view>
  41. 标本数量<text class="red">({{typeList.specimenDesc.count}})</text>
  42. </view>
  43. </view>
  44. </view>
  45. <scroll-view scroll-y="true" class="Scanning_cont_list_scroll">
  46. <view class="Scanning_cont_list_item" @click="clickRow(item)" v-for="(item, j) in dataList" :key="j">
  47. <view class="name" v-if="type === 'patient'">
  48. {{item.patientname}}
  49. </view>
  50. <view class="name" v-if="type === 'specimenDesc'">
  51. {{item.specimen_desc}}
  52. </view>
  53. <view class="name" v-if="type === 'speTubeType'">
  54. {{item.tubeTypeName}}
  55. </view>
  56. <view class="value" v-if="type === 'speTubeType'">
  57. <view>
  58. {{item.count}}
  59. </view>
  60. </view>
  61. <view class="value" v-if="type != 'speTubeType'">
  62. <view>
  63. {{item.count}}
  64. </view>
  65. </view>
  66. </view>
  67. </scroll-view>
  68. </view>
  69. </view>
  70. <view class="foot_btn">
  71. <view class="btn" @click="goBack()"> 取消 </view>
  72. <view class="btn" @click="onClick()" v-if="dataList.length"> 确认交接 </view>
  73. </view>
  74. <!-- 填写交接人工号弹窗 -->
  75. <selectAccount @click.stop.native v-if="hosModels.disjunctor" :disjunctor="hosModels.disjunctor" @ok="hosOk"
  76. @cancel="hosCancel" :content="hosModels.content">
  77. </selectAccount>
  78. <!-- 弹窗 -->
  79. <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content"
  80. @ok="ok" @cancel="cancel" :operate="models.operate"></showModel>
  81. </view>
  82. </template>
  83. <script>
  84. import {
  85. get,
  86. post,
  87. SM,
  88. webHandle
  89. } from "@/http/http.js";
  90. export default {
  91. data() {
  92. return {
  93. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  94. type: '',//patient|speTubeType|specimenDesc
  95. queryObj: {}, //路由传递过来的数据
  96. taskTypeConfig: {}, //页面控制
  97. typeList: {},
  98. dataList: [],
  99. // 填写交接人工号弹窗model
  100. hosModels: {
  101. disjunctor: false,
  102. },
  103. // 弹窗model
  104. models: {
  105. disjunctor: false,
  106. },
  107. };
  108. },
  109. methods: {
  110. getSpecimenTaskTypeConfig(){
  111. uni.showLoading({
  112. title: "加载中",
  113. mask: true,
  114. });
  115. post("/simple/data/fetchDataList/taskTypeConfig", {
  116. "idx": 0,
  117. "sum": 1,
  118. "taskTypeConfig": {
  119. "taskTypeDTO": {
  120. "hosId": {
  121. "id": this.hosId
  122. },
  123. "associationType": {
  124. "key": "association_types",
  125. "value": "specimen"
  126. }
  127. }
  128. }
  129. }).then((result) => {
  130. uni.hideLoading();
  131. if (result.status == 200) {
  132. if(result.list.length){
  133. this.taskTypeConfig = result.list[0] || {};
  134. if(this.taskTypeConfig.speExpandTube == 1){
  135. this.typeList = {
  136. "patient": {
  137. id: -1,
  138. name: '患者标本',
  139. count: 0,
  140. titleCount: 0,
  141. },
  142. "speTubeType":{
  143. id: -3,
  144. name: '试管类型',
  145. count: 0,
  146. titleCount: 0,
  147. },
  148. "specimenDesc": {
  149. id: -2,
  150. name: '检验项目',
  151. count: 0,
  152. titleCount: 0,
  153. }
  154. }
  155. if(this.taskTypeConfig.speHandoverTubeType == 1){
  156. // 患者
  157. this.type = 'patient';
  158. }else if(this.taskTypeConfig.speHandoverTubeType == 2){
  159. // 试管类型
  160. this.type = 'speTubeType';
  161. }else if(this.taskTypeConfig.speHandoverTubeType == 3){
  162. // 检验标本
  163. this.type = 'specimenDesc';
  164. }else{
  165. // 默认-患者
  166. this.type = 'patient';
  167. }
  168. }else{
  169. this.typeList = {
  170. "patient": {
  171. id: -1,
  172. name: '患者标本',
  173. count: 0,
  174. titleCount: 0,
  175. },
  176. "specimenDesc": {
  177. id: -2,
  178. name: '检验项目',
  179. count: 0,
  180. titleCount: 0,
  181. }
  182. }
  183. if(this.taskTypeConfig.speHandoverTubeType == 1){
  184. // 患者
  185. this.type = 'patient';
  186. }else if(this.taskTypeConfig.speHandoverTubeType == 2){
  187. // 试管类型-默认患者
  188. this.type = 'patient';
  189. }else if(this.taskTypeConfig.speHandoverTubeType == 3){
  190. // 检验标本
  191. this.type = 'specimenDesc';
  192. }else{
  193. // 默认-患者
  194. this.type = 'patient';
  195. }
  196. }
  197. this.clickTab(this.type);
  198. }else{
  199. uni.showToast({
  200. icon: "none",
  201. title: "请配置标本配送任务类型!",
  202. });
  203. }
  204. } else {
  205. uni.showToast({
  206. icon: "none",
  207. title: result.msg || "接口获取数据失败!",
  208. });
  209. }
  210. });
  211. },
  212. ok(){
  213. this.models.disjunctor = false;
  214. uni.showLoading({
  215. title: "加载中",
  216. mask: true,
  217. });
  218. post("/simple/data/fetchDataList/taskType", {
  219. "idx": 0,
  220. "sum": 1,
  221. "taskType": {
  222. "hosId": {
  223. "id": this.hosId
  224. },
  225. "associationType": {
  226. "key": "association_types",
  227. "value": "specimen"
  228. }
  229. }
  230. }).then((result) => {
  231. uni.hideLoading();
  232. if (result.status == 200) {
  233. if(result.list.length){
  234. // 标本-运送过程-终点科室-是否填写交接人
  235. if(result.list[0].carryingCourses[1].handoverSwitch){
  236. this.showSelectAccount();
  237. }else{
  238. this.orderDeptHandler();
  239. }
  240. }else{
  241. uni.showToast({
  242. icon: "none",
  243. title: "请配置标本配送任务类型!",
  244. });
  245. }
  246. } else {
  247. uni.showToast({
  248. icon: "none",
  249. title: result.msg || "接口获取数据失败!",
  250. });
  251. }
  252. });
  253. },
  254. // 取消
  255. cancel() {
  256. this.models.disjunctor = false;
  257. },
  258. //核对完成
  259. allStart() {
  260. this.models = {
  261. disjunctor: true,
  262. title: "提示",
  263. content: "是否确定交接?",
  264. icon: "warn",
  265. operate: {
  266. ok: "确定",
  267. cancel: "取消",
  268. },
  269. };
  270. },
  271. // 填写交接人工号-确认
  272. hosOk(data) {
  273. console.log(data);
  274. const {
  275. accountName,
  276. account,
  277. accountId
  278. } = data;
  279. if (!accountName && !account) {
  280. //没有填写交接人
  281. uni.showModal({
  282. title: "提示",
  283. content: "请填写交接人工号!",
  284. showCancel: false,
  285. success: function(res) {
  286. if (res.confirm) {
  287. console.log("用户点击确定");
  288. } else if (res.cancel) {
  289. console.log("用户点击取消");
  290. }
  291. },
  292. });
  293. return;
  294. } else if ((!accountName && account) || (accountName && !account)) {
  295. //没有填写交接人
  296. uni.showModal({
  297. title: "提示",
  298. content: "请填写正确的交接人工号!",
  299. showCancel: false,
  300. success: function(res) {
  301. if (res.confirm) {
  302. console.log("用户点击确定");
  303. } else if (res.cancel) {
  304. console.log("用户点击取消");
  305. }
  306. },
  307. });
  308. return;
  309. }
  310. this.hosModels.disjunctor = false;
  311. this.orderDeptHandler(data);
  312. },
  313. // 填写交接人工号-取消
  314. hosCancel() {
  315. this.hosModels.disjunctor = false;
  316. },
  317. // 填写交接人工号弹窗
  318. showSelectAccount() {
  319. this.hosModels = {
  320. content: '确定交接完成,请输入交接人员工号',
  321. disjunctor: true,
  322. };
  323. },
  324. orderDeptHandler(accountObj){
  325. uni.showLoading({
  326. title: "加载中",
  327. mask: true,
  328. });
  329. post("/workerOrder/ordersSpeSign", {
  330. deptId: this.queryObj.deptId,
  331. orderIds: JSON.parse(this.queryObj.ids).toString(),
  332. handover: accountObj ? accountObj.accountId : undefined
  333. }).then((result) => {
  334. uni.hideLoading();
  335. if (result.state == 200) {
  336. uni.navigateTo({
  337. url: `/pages/specimenOrderComplete/specimenOrderComplete?deptName=${this.queryObj.dept}&ids=${this.queryObj.ids}`
  338. })
  339. } else {
  340. uni.showToast({
  341. icon: "none",
  342. title: result.msg || "接口获取数据失败!",
  343. });
  344. }
  345. });
  346. },
  347. goBack(){
  348. uni.navigateBack();
  349. },
  350. clickTab(key){
  351. this.type = key;
  352. this.getInfo(key);
  353. },
  354. onClick(){
  355. this.allStart();
  356. },
  357. clickRow(data){
  358. uni.navigateTo({
  359. url: `/pages/specimenDetail/specimenDetail?speIds=${data.ids || ''}`
  360. })
  361. },
  362. getInfo(type){
  363. uni.showLoading({
  364. title: "加载中",
  365. mask: true,
  366. });
  367. post("/workerOrder/ordersSpeInfo", {
  368. type,
  369. deptId: this.queryObj.deptId,
  370. orderIds: JSON.parse(this.queryObj.ids).toString(),
  371. }).then((result) => {
  372. uni.hideLoading();
  373. if (result.state == 200) {
  374. this.typeList[type].count = result.count || 0;
  375. this.typeList[type].titleCount = result.title || 0;
  376. if(this.type === type){
  377. this.dataList = result.data || [];
  378. console.log(7777,this.dataList)
  379. }
  380. } else {
  381. uni.showToast({
  382. icon: "none",
  383. title: result.msg || "接口获取数据失败!",
  384. });
  385. }
  386. });
  387. },
  388. initData(){
  389. this.getSpecimenTaskTypeConfig();
  390. },
  391. },
  392. onShow(){
  393. // #ifdef APP-PLUS
  394. uni.$off('scan') // 每次进来先 移除全局自定义事件监听器
  395. // #endif
  396. },
  397. onLoad(options) {
  398. console.log(JSON.parse(options.model), "result");
  399. this.queryObj = options;
  400. this.initData();
  401. // #ifdef APP-PLUS
  402. webHandle("no", "app");
  403. // #endif
  404. // #ifdef H5
  405. webHandle("no", "wx");
  406. // #endif
  407. },
  408. };
  409. </script>
  410. <style lang="less" scoped>
  411. .Scanning_Result {
  412. height: 98vh;
  413. display: flex;
  414. flex-direction: column;
  415. background-color: #fafbfd;
  416. .Scanning_top {
  417. flex-shrink: 0;
  418. .Scanning_top_icon {
  419. padding-top: 26rpx;
  420. display: flex;
  421. justify-content: center;
  422. align-items: center;
  423. .cubeic-ok {
  424. font-size: 58rpx;
  425. color: #35b34a;
  426. }
  427. .text1 {
  428. font-size: 48rpx;
  429. font-weight: bold;
  430. }
  431. }
  432. .Scanning_top_text{
  433. text-align: center;
  434. font-size: 28rpx;
  435. font-weight: bold;
  436. padding: 8rpx 0 23rpx 0;
  437. }
  438. }
  439. .Scanning_cont {
  440. flex: 1;
  441. min-height: 0;
  442. display: flex;
  443. flex-direction: column;
  444. width: 710rpx;
  445. margin: 0 20rpx;
  446. background-color: #fff;
  447. .Scanning_cont_head{
  448. flex-shrink: 0;
  449. height: 78rpx;
  450. display: flex;
  451. border-top: 1rpx solid #EEEEEE;
  452. border-bottom: 1rpx solid #EEEEEE;
  453. .Scanning_cont_head_item{
  454. flex: 1;
  455. font-size: 28rpx;
  456. font-weight: bold;
  457. display: flex;
  458. justify-content: center;
  459. align-items: center;
  460. position: relative;
  461. &.active{
  462. color: #49B856;
  463. &::before{
  464. content: '';
  465. width: 70rpx;
  466. height: 10rpx;
  467. background-color: #49B856;
  468. position: absolute;
  469. left: 50%;
  470. bottom: 0;
  471. transform: translateX(-50%);
  472. border-radius: 6rpx;
  473. }
  474. }
  475. &::after{
  476. content: '';
  477. width: 2rpx;
  478. height: 44rpx;
  479. background-color: #D1D1D1;
  480. position: absolute;
  481. right: 0;
  482. top: 50%;
  483. transform: translateY(-50%);
  484. }
  485. &:last-of-type::after{
  486. opacity: 0;
  487. }
  488. }
  489. }
  490. .Scanning_cont_list{
  491. flex: 1;
  492. min-height: 0;
  493. display: flex;
  494. flex-direction: column;
  495. .Scanning_cont_list_scroll{
  496. flex: 1;
  497. min-height: 0;
  498. }
  499. .Scanning_cont_list_item{
  500. height: 70rpx;
  501. display: flex;
  502. align-items: center;
  503. font-size: 28rpx;
  504. border-bottom: 1rpx solid #CCCCCC;
  505. &.Scanning_cont_list_head{
  506. font-weight: bold;
  507. font-size: 28rpx;
  508. border-bottom: none;
  509. flex-shrink: 0;
  510. }
  511. .underline{
  512. text-decoration: underline;
  513. }
  514. .name,
  515. .value{
  516. padding: 0 40rpx;
  517. flex: 1;
  518. }
  519. .value {
  520. view{
  521. width: 7em;
  522. text-align: center;
  523. }
  524. }
  525. }
  526. }
  527. }
  528. .foot_btn {
  529. flex-shrink: 0;
  530. line-height: 66rpx;
  531. display: flex;
  532. justify-content: center;
  533. padding: 0 20rpx;
  534. .btn {
  535. height: 66rpx;
  536. flex: 1;
  537. margin-right: 4%;
  538. background-image: linear-gradient(to right, #72c172, #3bb197);
  539. color: #fff;
  540. border-radius: 8rpx;
  541. font-size: 28rpx;
  542. text-align: center;
  543. &:last-of-type{
  544. margin-right: 0;
  545. }
  546. }
  547. }
  548. }
  549. </style>