specimenHandoverNew.vue 15 KB

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