specimenHandoverNew.vue 13 KB

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