smallScreen.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. <template>
  2. <view class="smallScreen">
  3. <view class="smallScreen_scan" @click="getInspectAndPatientTransform(sData,sType)">
  4. <slot></slot>
  5. </view>
  6. <!-- 填写交接人工号弹窗 -->
  7. <selectAccount v-if="hosModels.disjunctor" :disjunctor="hosModels.disjunctor" @ok="hosOk"
  8. @cancel="hosCancel">
  9. </selectAccount>
  10. <!-- 弹窗 -->
  11. <showModel :title="models4.title" :icon="models4.icon" :disjunctor="models4.disjunctor"
  12. :radioInspectionDistanceItem="models4.radioInspectionDistanceItem" @ok="ok4" @cancel="cancel4" @radioChange="radioChange4" :operate="models4.operate">
  13. </showModel>
  14. </view>
  15. </template>
  16. <script>
  17. import showModel from "../../components/showModel/showModel.vue";
  18. import selectAccount from "../../components/selectAccount/selectAccount.vue";
  19. import {
  20. post,
  21. SM
  22. } from "../../http/http.js";
  23. export default {
  24. data() {
  25. return {
  26. selectRadio: [], //单选框选中的数据,第一项是qrcode,第二项是名称
  27. // 单选框弹窗model1
  28. models4: {
  29. disjunctor: false,
  30. },
  31. hosId: uni.getStorageSync("userData").user.currentHospital.id,
  32. currentCode: '', //当前小扫描的科室二维码
  33. currentData: {}, //当前小扫描的工单对象
  34. // 填写交接人工号弹窗model
  35. hosModels: {
  36. disjunctor: false,
  37. },
  38. SMFlag:true,
  39. }
  40. },
  41. props: {
  42. sData: {
  43. type: Object
  44. },
  45. sType: {
  46. type: Number
  47. }
  48. },
  49. methods: {
  50. // 获取是否需要选择陪检方式
  51. getInspectAndPatientTransform(sData,sType){
  52. console.log(this.sData,this.sType);
  53. // 患者陪检,患者其他服务,工单状态是待到达
  54. if((this.sData.taskType.associationType.value === 'inspect' || this.sData.taskType.associationType.value === 'patientTransport') && this.sData.gdState.value == 4){
  55. const postData = {
  56. "idx":0,
  57. "sum":1,
  58. "taskTypeConfig":{
  59. "taskTypeDTO":{
  60. "hosId": {"id": this.hosId},
  61. "associationType": {
  62. "key": "association_types",
  63. "value":"inspect",
  64. },
  65. },
  66. },
  67. };
  68. uni.showLoading({
  69. mask: true,
  70. title: '加载中'
  71. })
  72. post("/simple/data/fetchDataList/taskTypeConfig", postData).then((res) => {
  73. console.log(res)
  74. if (res.status == 200) {
  75. res.list = res.list || [];
  76. if(res.list[0] && res.list[0].signTypeIds){
  77. // 如果开启
  78. const postData = {
  79. "idx":0,
  80. "sum":9999,
  81. "workOrderInspectScore":{
  82. "hosId": this.hosId,
  83. },
  84. };
  85. post("/simple/data/fetchDataList/workOrderInspectScore", postData).then((res) => {
  86. console.log(res)
  87. uni.hideLoading();
  88. if (res.status == 200) {
  89. res.list = res.list || [];
  90. let radioInspectionDistanceItem = res.list.map(v => ({id: v.id + "__" + v.inspectMode, inspectMode: v.inspectMode}));
  91. console.log(radioInspectionDistanceItem)
  92. this.models4 = {
  93. disjunctor: true,
  94. title: "请选择陪检方式",
  95. radioInspectionDistanceItem,
  96. icon: "",
  97. operate: {
  98. ok: "确定",
  99. cancel: "取消",
  100. },
  101. };
  102. } else {
  103. uni.showToast({
  104. icon: "none",
  105. title: res.msg || "接口获取数据失败!",
  106. });
  107. }
  108. })
  109. }else{
  110. uni.hideLoading();
  111. this.Scan_ss(sData,sType);
  112. }
  113. } else {
  114. uni.hideLoading();
  115. uni.showToast({
  116. icon: "none",
  117. title: res.msg || "接口获取数据失败!",
  118. });
  119. }
  120. })
  121. }else{
  122. this.Scan_ss(sData,sType);
  123. }
  124. },
  125. // 选中单选框
  126. radioChange4(item) {
  127. console.log(item);
  128. this.selectRadio = item.split("__");
  129. },
  130. // 确定
  131. ok4() {
  132. console.log(this.selectRadio);
  133. if (!this.selectRadio.length) {
  134. return;
  135. }
  136. this.models4.disjunctor = false;
  137. this.Scan_ss(this.sData,this.sType);
  138. },
  139. cancel4() {
  140. this.models4.disjunctor = false;
  141. },
  142. // 如果不是静配,药配,标本配送,标本轮巡
  143. // 科室签到(小扫描)
  144. nextDeptOrder_ss(data, accountObj) {
  145. console.log(this.currentCode);
  146. let isKs = 0;
  147. let ids = [];
  148. let id = data.id;
  149. ids.push(id);
  150. let list = {
  151. code: "",
  152. ids: ids,
  153. };
  154. let code = "";
  155. let type = "";
  156. if (this.currentCode) {
  157. let gdStateValue = data.gdState.value; //工单状态value
  158. let associationTypeValue = data.taskType.associationType.value; //关联类型value
  159. // 患者陪检,并且工单状态是待到达
  160. if (
  161. gdStateValue == "4" &&
  162. associationTypeValue == "inspect"
  163. ) {
  164. list.code = this.currentCode; //其他
  165. type = "handleIns";
  166. }
  167. // 其他临床服务,并且工单状态是待到达||工单状态待送达
  168. if (
  169. (associationTypeValue == "other" &&
  170. gdStateValue == "4") ||
  171. gdStateValue == "5"
  172. ) {
  173. code = this.currentCode;
  174. type = "orderSign/" + code;
  175. list = {
  176. ids
  177. };
  178. if (accountObj) {
  179. list.handover = [accountObj.accountId];
  180. }
  181. isKs = 1;
  182. }
  183. if (
  184. (gdStateValue == "5" &&
  185. associationTypeValue == "inspect") ||
  186. associationTypeValue == "patientTransport"
  187. ) {
  188. code = this.currentCode;
  189. type = "orderSign/" + code;
  190. list = {
  191. ids
  192. };
  193. if (accountObj) {
  194. list.handover = [accountObj.accountId];
  195. }
  196. isKs = 1;
  197. }
  198. if (gdStateValue == "8") {
  199. code = this.currentCode; //患者陪检--检查
  200. type = "orderSign/" + code;
  201. list = {
  202. ids
  203. };
  204. if (accountObj) {
  205. list.handover = [accountObj.accountId];
  206. }
  207. isKs = 1;
  208. }
  209. if (
  210. gdStateValue == "4" &&
  211. associationTypeValue == "patientTransport"
  212. ) {
  213. list = {
  214. code: this.currentCode, //患者转运--检查
  215. ids: ids,
  216. };
  217. type = "handleTrans";
  218. }
  219. if(gdStateValue == "4" && (associationTypeValue == "inspect" || associationTypeValue == "patientTransport")){
  220. console.log(this.selectRadio)
  221. list.inspectMode = this.selectRadio.length > 0 ? this.selectRadio[0] : undefined;
  222. }
  223. post("/workerOrder/" + type, list).then((res) => {
  224. uni.hideLoading();
  225. if (res) {
  226. if (res.status == 200) {
  227. if (gdStateValue == "4" && associationTypeValue == "other") {
  228. uni.navigateTo({
  229. url: `../../pages/scanning_code/scanning_code?type=${associationTypeValue}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
  230. });
  231. }
  232. if (gdStateValue == "4" && associationTypeValue != "other") {
  233. if(associationTypeValue == 'patientTransport'){
  234. // 门诊服务点,有orderList
  235. if(res.orderList){
  236. uni.navigateTo({
  237. url: `/pages/outpatient/outpatientStartSignIn/outpatientStartSignIn?model=${encodeURIComponent(JSON.stringify(res))}`,
  238. });
  239. }else{
  240. uni.navigateTo({
  241. url: `../../pages/scanning_Result/scanning_Result?type=${
  242. associationTypeValue
  243. }&type1=${res.type}&id=${data.id}&deptCode=${
  244. list.code
  245. }&patient=${res.patient}&patientCode=${
  246. res.patientCode
  247. }&deptName=${res.deptName}&bedNum=${
  248. res.bedNum
  249. }&status=${res.status}&msg=${
  250. res.msg
  251. }&taskTypeId=${data.taskType.id}&model=${
  252. encodeURIComponent(JSON.stringify(res))}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
  253. });
  254. }
  255. }else{
  256. uni.navigateTo({
  257. url: `../../pages/scanning_Result/scanning_Result?type=${
  258. associationTypeValue
  259. }&type1=${res.type}&id=${data.id}&deptCode=${
  260. list.code
  261. }&patient=${res.patient}&patientCode=${
  262. res.patientCode
  263. }&deptName=${res.deptName}&bedNum=${
  264. res.bedNum
  265. }&status=${res.status}&msg=${
  266. res.msg
  267. }&taskTypeId=${data.taskType.id}&model=${
  268. encodeURIComponent(JSON.stringify(res))}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
  269. });
  270. }
  271. }
  272. if (gdStateValue == "8") {
  273. uni.navigateTo({
  274. url: `../../pages/scanning_code/scanning_code?type=${associationTypeValue}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
  275. });
  276. }
  277. if (gdStateValue == "5") {
  278. uni.navigateTo({
  279. url: `../../pages/scanning_code/scanning_code?type=${associationTypeValue}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
  280. });
  281. }
  282. } else {
  283. console.log(res, "扫描失败");
  284. if (res.type == "trans-ddd-1") {
  285. //起点科室扫描腕带码失败
  286. uni.navigateTo({
  287. url: `../../pages/scanning_Result/scanning_Result?type=${associationTypeValue}&type1=${res.type}&id=${data.id}&status=600&msg=${res.msg}&qrcode=${this.currentCode}`,
  288. });
  289. } else {
  290. uni.navigateTo({
  291. url: `../../pages/scanning_Result/scanning_Result?type=${
  292. associationTypeValue
  293. }&type1=${res.type}&id=${data.id}&status=600&msg=${
  294. res.msg
  295. }&isKs=${isKs}&model=${encodeURIComponent(
  296. JSON.stringify(res)
  297. )}&qrcode=${this.currentCode}`,
  298. });
  299. }
  300. }
  301. } else {
  302. uni.navigateTo({
  303. url: `../../pages/scanning_Result/scanning_Result?id=${data.id}&status=600&msg=扫码失败!请扫描正确的二维码!&isKs=${isKs}&qrcode=${this.currentCode}`,
  304. });
  305. }
  306. });
  307. }
  308. },
  309. // 如果不是患者陪检或患者转运或其他
  310. // 科室签到
  311. nextDeptOrder_s(data, accountObj) {
  312. console.log(this.currentCode);
  313. let ids = [];
  314. let id = data.id;
  315. ids.push(id);
  316. let code = "";
  317. let postData = {
  318. ids
  319. };
  320. if (accountObj) {
  321. postData.handover = [accountObj.accountId];
  322. }
  323. if (this.currentCode) {
  324. code = this.currentCode;
  325. // 科室签到
  326. post("/workerOrder/orderSign/" + code, postData).then((res) => {
  327. uni.hideLoading();
  328. if (res.status == 200) {
  329. // 跳转到扫描科室
  330. // type1: res.type, //type类型
  331. // id: data.id, //工单ID
  332. // deptCode: code, //二维码
  333. // dept: res.dept //科室名称
  334. console.log(data,'工单')
  335. let endDepts = data.endDepts.map(v=>v.id).toString();
  336. console.log(endDepts,'smallScreen');
  337. uni.navigateTo({
  338. url: `../../pages/scanning_code/scanning_code?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}&deptId=${res.deptId}&endDepts=${endDepts}`,
  339. });
  340. } else {
  341. uni.navigateTo({
  342. url: `../../pages/scanning_Result/scanning_Result?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&status=600&msg=${res.msg}&isKs=1&qrcode=${this.currentCode}`,
  343. });
  344. }
  345. });
  346. }
  347. },
  348. // type==1 如果不是静配,药配,标本配送,标本轮巡
  349. // type==2 如果不是患者陪检,患者转运,其他
  350. // 扫码(小扫描)
  351. Scan_ss(data, type) {
  352. if (!this.SMFlag) {
  353. return;
  354. }
  355. this.SMFlag = false;
  356. this.currentData = data;
  357. console.log(data, 'data');
  358. SM().then((ress1) => {
  359. uni.showLoading({
  360. title: "加载中",
  361. mask: true,
  362. });
  363. //检验二维码的有效性
  364. post("/dept/scanning", {
  365. content: ress1,
  366. taskTypeId: data.taskType.id,
  367. gdState: data.gdState.id,
  368. }).then((result) => {
  369. this.SMFlag = true;
  370. this.currentCode = result.code;
  371. if (result.state == 200 || result.state == 201) {
  372. if (result.account) {
  373. if (type == 1) {
  374. this.isOpenTransportationProcessRemarks(this.currentData, {
  375. account: result.account,
  376. accountName: result.name,
  377. accountId: result.id,
  378. }, 'nextDeptOrder_ss');
  379. } else if (type == 2) {
  380. this.nextDeptOrder_s(this.currentData, {
  381. account: result.account,
  382. accountName: result.name,
  383. accountId: result.id,
  384. });
  385. }
  386. } else {
  387. if (type == 1) {
  388. this.isOpenTransportationProcessRemarks(this.currentData, undefined, 'nextDeptOrder_ss');
  389. } else if (type == 2) {
  390. this.nextDeptOrder_s(this.currentData);
  391. }
  392. }
  393. } else if (result.state == '0000') {
  394. uni.hideLoading();
  395. this.showSelectAccount(); //yeye
  396. } else {
  397. uni.hideLoading();
  398. uni.showToast({
  399. icon: "none",
  400. title: result.info || "接口获取数据失败!",
  401. });
  402. }
  403. });
  404. }).catch(err=>{
  405. this.SMFlag = true;
  406. });
  407. },
  408. // 填写交接人工号-确认
  409. hosOk(data) {
  410. console.log(data);
  411. const {
  412. accountName,
  413. account,
  414. accountId
  415. } = data;
  416. if (!accountName && !account) {
  417. //没有填写交接人
  418. uni.showModal({
  419. title: '提示',
  420. content: "请填写交接人工号!",
  421. showCancel: false,
  422. success: function(res) {
  423. if (res.confirm) {
  424. console.log('用户点击确定');
  425. } else if (res.cancel) {
  426. console.log('用户点击取消');
  427. }
  428. }
  429. });
  430. return;
  431. } else if (!accountName && account || accountName && !account) {
  432. //没有填写交接人
  433. uni.showModal({
  434. title: '提示',
  435. content: "请填写正确的交接人工号!",
  436. showCancel: false,
  437. success: function(res) {
  438. if (res.confirm) {
  439. console.log('用户点击确定');
  440. } else if (res.cancel) {
  441. console.log('用户点击取消');
  442. }
  443. }
  444. });
  445. return;
  446. }
  447. this.hosModels.disjunctor = false;
  448. let associationTypeValue = this.currentData.taskType.associationType.value;
  449. console.log(associationTypeValue)
  450. if (
  451. associationTypeValue !== "patientTransport" &&
  452. associationTypeValue !== "inspect" &&
  453. associationTypeValue !== "other"
  454. ) {
  455. this.nextDeptOrder_s(this.currentData, data);
  456. }
  457. if (
  458. associationTypeValue !== "jPBag" &&
  459. associationTypeValue !== "drugsBag" &&
  460. associationTypeValue !== "specimen" &&
  461. associationTypeValue !== "specimenPlan"
  462. ) {
  463. this.isOpenTransportationProcessRemarks(this.currentData, data, 'nextDeptOrder_ss');
  464. }
  465. },
  466. // 填写交接人工号-取消
  467. hosCancel() {
  468. this.hosModels.disjunctor = false;
  469. },
  470. // 填写交接人工号弹窗
  471. showSelectAccount() {
  472. this.hosModels = {
  473. disjunctor: true,
  474. }
  475. },
  476. // 其他临床服务-运输过程-终点科室是否开通备注填写
  477. isOpenTransportationProcessRemarks(data, accountObj, funName){
  478. const tasktype = data.taskType;
  479. console.log(tasktype, data);
  480. if(tasktype.associationType.value === 'other' && tasktype.carryingCourses[1].logSwitch && data.gdState.value == 5){
  481. uni.navigateTo({
  482. url: `../../pages/transportationProcessRemarks/transportationProcessRemarks?data=${data ? encodeURIComponent(JSON.stringify(data)) : ''}&accountObj=${accountObj ? encodeURIComponent(JSON.stringify(accountObj)) : ''}&currentCode=${this.currentCode}&funName=${funName}&actions=${this.actions ? encodeURIComponent(JSON.stringify(this.actions)) : ''}&imageValue=${this.imageValue ? encodeURIComponent(JSON.stringify(this.imageValue)) : ''}`
  483. })
  484. }else{
  485. this[funName](data, accountObj);
  486. }
  487. },
  488. },
  489. components: {
  490. selectAccount
  491. },
  492. onShow(){
  493. this.SMFlag = true;
  494. },
  495. };
  496. </script>
  497. <style lang="less">
  498. .smallScreen {
  499. width: 100%;
  500. height: 100%;
  501. .smallScreen_scan {
  502. width: 100%;
  503. height: 100%;
  504. }
  505. }
  506. </style>