speError.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <template>
  2. <view class="showModel">
  3. <view class="showModel__wrap">
  4. <view class="content" v-if="speDATA && speDATA.data">
  5. <view class="content-box">
  6. <view class="icon">
  7. <text class="red newicon newicon-guanbi1"></text>
  8. <!-- <text class="error-text">提示</text> -->
  9. </view>
  10. <view class="list weight red">{{speDATA.msg}}</view>
  11. <view class="list flex">
  12. <view>条码:<text class="mar-rig" :class="speDATA.data.urgent==0?'green':'red'">{{speDATA.data.urgent==0?'普':'急'}}</text> {{speDATA.data.scode}}</view>
  13. <view>{{speDATA.data.speState ? speDATA.data.speState.name : ''}}</view>
  14. </view>
  15. <view class="list">检查项目:{{ speDATA.data.specimenDesc || "-" }}</view>
  16. <view class="list">类型:{{speDATA.data.stype ? speDATA.data.stype.name : ''}} <text v-if="speDATA.data.tubeType">、</text> {{speDATA.data.tubeType && speDATA.data.tubeType.name || ''}}</view>
  17. <view class="list">患者:{{ speDATA.data.patientName}} <text v-if="speDATA.data.bedNum">({{speDATA.data.bedNum}})</text></view>
  18. <view class="list">{{speDATA.data.sickRoom.dept}}
  19. <text style="width: 4em;text-align: center;margin-left: 1em;margin-right: 1em;" class="newicon newicon-arrow-right-full"></text>
  20. {{speDATA.data.checkDept.dept}}</view>
  21. <view class="list" v-if="speDATA.speVerifyType=='collectDept'
  22. || speDATA.speVerifyType=='testDept' || speDATA.speVerifyType=='tubeType'
  23. || speDATA.speVerifyType=='urgent'">
  24. <checkbox-group @change="forceDeptInputBlur">
  25. <checkbox value="addConfig" :checked="addConfig" color="#49b856" />{{msg}}
  26. </checkbox-group>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="foot_btn_spe">
  31. <view class="btn green" @click="confirm()">是</view>
  32. <view class="btn gray" @click="cancel()">否</view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import {
  39. get,
  40. post,
  41. SM
  42. } from "../../http/http.js";
  43. export default {
  44. data() {
  45. return {
  46. addConfig:false,
  47. msg:null,
  48. // 终点科室标红
  49. isEndDeptRed: false,
  50. currentCode: '', //当前小扫描的科室二维码
  51. deptId: undefined,
  52. handover: undefined,
  53. SMFlag: true,
  54. // 交接人信息
  55. accountObj: undefined,
  56. // 完成扫描的id
  57. wcId: "",
  58. wcFlag: false,
  59. // 弹窗model
  60. models: {
  61. disjunctor: false,
  62. },
  63. // 单选框弹窗model1
  64. models1: {
  65. disjunctor: false,
  66. },
  67. // 完成扫描弹窗model1
  68. models2: {
  69. disjunctor: false,
  70. },
  71. infoDATA: {},
  72. res: {},
  73. infoType: "",
  74. DEPTCode: "",
  75. RESData: {},
  76. DEPT: "",
  77. dataId: "",
  78. type: "",
  79. model: {},
  80. speNum: 0,
  81. queryObj: {}, //路由传递过来的数据
  82. selectRadio: [], //单选框选中的数据,第一项是qrcode,第二项是名称
  83. gotoFlag: true,
  84. content: "",
  85. taskTypeId:"",
  86. errorModal:null,
  87. speDATA:null,
  88. interceptData:null,
  89. intercept:null,
  90. };
  91. },
  92. onLoad(options){
  93. console.log(77776666,options)
  94. this.intercept = options.intercept
  95. this.queryObj = options;
  96. if (options.model) {
  97. this.infoDATA = JSON.parse(options.model);
  98. this.speDATA = JSON.parse(options.model);
  99. }
  100. if (options.accountObj && options.accountObj != "undefined") {
  101. this.accountObj = JSON.parse(options.accountObj);
  102. }
  103. if (options.deptId && options.deptId != "undefined") {
  104. this.deptId = options.deptId;
  105. }
  106. if (options.handover && options.handover != "undefined") {
  107. this.handover = options.handover;
  108. }
  109. this.dataId = options.id;
  110. if(options.taskTypeId){
  111. this.taskTypeId = options.taskTypeId
  112. }else if(this.infoDATA.workOrderList && this.infoDATA.workOrderList.length>0){
  113. this.taskTypeId = this.infoDATA.workOrderList[0].taskType.id
  114. }
  115. this.RESData = options.resData;
  116. this.res["status"] = options.status;
  117. this.res["msg"] = options.msg;
  118. this.res["patient"] = options.patient;
  119. this.res["patientCode"] = options.patientCode;
  120. this.res["deptName"] = options.deptName;
  121. this.res["bedNum"] = options.bedNum;
  122. this.infoType = options.type1;
  123. if (options.dept) {
  124. this.DEPT = options.dept;
  125. }
  126. if (options.speNum) {
  127. this.speNum = options.speNum;
  128. }
  129. this.DEPTCode = options.deptCode;
  130. this.type = options.type;
  131. this.setMsg()
  132. },
  133. methods: {
  134. setMsg(){
  135. if(this.speDATA.speVerifyType=='collectDept'){
  136. this.msg = '增加收取科室'
  137. }else if(this.speDATA.speVerifyType=='testDept'){
  138. this.msg = '收取本科室不在提示'
  139. }else if(this.speDATA.speVerifyType=='tubeType'){
  140. this.msg = '收取此试管类型不在提示'
  141. }else if(this.speDATA.speVerifyType=='urgent'){
  142. this.msg = '记录本次操作,不在提示'
  143. }
  144. },
  145. forceDeptInputBlur(e){
  146. this.addConfig = e.detail.value.length > 0
  147. },
  148. confirm(){
  149. if(this.speDATA.speVerifyType!='collectDept'
  150. && this.speDATA.speVerifyType!='testDept' && this.speDATA.speVerifyType!='tubeType'
  151. && this.speDATA.speVerifyType!='urgent'){
  152. this.addConfig = true
  153. }
  154. let data = {
  155. code: this.speDATA.data.scode,
  156. addConfig: this.addConfig
  157. }
  158. this.interceptData = data
  159. this.hand_scanning_common(this.interceptData.code, 'scan')
  160. },
  161. // 手动输入标本和扫码公共方法
  162. hand_scanning_common(ress1, type) {
  163. // ----------------
  164. uni.showLoading({
  165. title: "加载中",
  166. mask: true,
  167. });
  168. //检验二维码的有效性
  169. post("/dept/scanning", {
  170. content: ress1,
  171. }).then((result) => {
  172. this.SMFlag = true;
  173. this.currentCode = result.code;
  174. if (result.state == 200 || result.state == 201) {
  175. let codes = result.code;
  176. if (codes) {
  177. let speCode = codes;
  178. let data = {
  179. code: speCode,
  180. type: this.queryObj.type1,
  181. deptCode: this.DEPTCode,
  182. ids: [],
  183. speVerifyType:null,
  184. addConfig:null
  185. };
  186. if(this.speDATA){
  187. data.speVerifyType = this.speDATA.speVerifyType
  188. }else{
  189. delete data.speVerifyType
  190. }
  191. if(this.interceptData && this.interceptData.addConfig){
  192. data.addConfig = 1
  193. }else{
  194. delete data.addConfig
  195. }
  196. data.ids.push(this.dataId);
  197. let postType = "";
  198. if (this.type == "jPBag" || this.type == "drugsBag") {
  199. postType = "handleDrugsAndJp";
  200. if(this.type == "drugsBag"){
  201. delete data.ids;
  202. }
  203. data.deptId = this.deptId;
  204. data.handover = this.handover;
  205. }
  206. if (this.type == "specimen") {
  207. data["speCode"] = data.code;
  208. delete data.code;
  209. postType = "handleSpes";
  210. }
  211. if (this.type == "specimenPlan") {
  212. data["speCode"] = data.code;
  213. delete data.code;
  214. postType = "handlePlanSpes";
  215. }
  216. if (this.type == "inspect") {
  217. postType = "handleIns";
  218. }
  219. if (this.type == "patientTransport") {
  220. postType = "handleTrans";
  221. }
  222. post("/workerOrder/" + postType, data).then((ress) => {
  223. uni.hideLoading();
  224. this.speDATA = null
  225. this.interceptData = null
  226. if (ress.status == 200 || ress.status == 11111) {
  227. //标本和标本轮巡工单,扫描标本后会自动调用摄像头,继续扫描,直到status不是200
  228. if ((this.type == "specimenPlan" || this.type == "specimen") && ress.status != 11111) {
  229. if(ress){
  230. this.infoDATA = ress.data;
  231. this.speNum = ress.specimenCount;
  232. uni.redirectTo({
  233. url: `../scanning_Result/scanning_Result?type=${
  234. this.queryObj.type
  235. }&type1=${
  236. this.queryObj.type1
  237. }&infoData=${encodeURIComponent(
  238. JSON.stringify(ress.data)
  239. )}&status=${ress.status}&msg=${ress.msg}&deptCode=${
  240. this.queryObj.deptCode
  241. }&dept=${this.queryObj.dept}&id=${this.dataId}&model=${encodeURIComponent(JSON.stringify(ress))}&speNum=${this.speNum}&scanOrHand=scan&isEndDeptRed=${this.isEndDeptRed}`,
  242. });
  243. }
  244. }
  245. } else if (ress.status==513){
  246. this.speDATA = ress
  247. this.setMsg()
  248. } else if(ress.status==10004){
  249. uni.showToast({
  250. icon: "none",
  251. title: ress.msg,
  252. });
  253. }else{
  254. uni.redirectTo({
  255. url: `../scanning_Result/scanning_Result?type=${
  256. this.queryObj.type
  257. }&type1=${this.queryObj.type1}&status=${ress.status}&msg=${
  258. ress.msg
  259. }&deptCode=${this.queryObj.deptCode}&dept=${
  260. this.queryObj.dept
  261. }&id=${this.dataId}&model=${encodeURIComponent(
  262. JSON.stringify(this.infoDATA)
  263. )}&accountObj=${encodeURIComponent(JSON.stringify(this.accountObj))}&deptId=${this.deptId}&handover=${this.handover}&scanOrHand=scan&qrcode=${this.currentCode}`,
  264. });
  265. }
  266. });
  267. } else {
  268. uni.hideLoading();
  269. }
  270. } else {
  271. uni.hideLoading();
  272. uni.showToast({
  273. icon: "none",
  274. title: result.info || "接口获取数据失败!",
  275. });
  276. }
  277. });
  278. },
  279. cancel(){
  280. uni.navigateBack();
  281. },
  282. },
  283. };
  284. </script>
  285. <style lang="less" scoped>
  286. .showModel {
  287. // position: fixed;
  288. // left: 0;
  289. // right: 0;
  290. // top: 0;
  291. // bottom: 0;
  292. // background-color: rgba(0, 0, 0, 0.2);
  293. // z-index: 99;
  294. .showModel__wrap {
  295. // width: 90%;
  296. // position: absolute;
  297. // left: 50%;
  298. // top: 50%;
  299. // transform: translate(-50%, -50%);
  300. background-color: #fff;
  301. // border-radius: 12rpx;
  302. height: 100vh;
  303. .showModel__header {
  304. font-size: 36rpx;
  305. color: #000;
  306. font-weight: bold;
  307. height: 84rpx;
  308. display: flex;
  309. justify-content: center;
  310. align-items: center;
  311. }
  312. .content{
  313. background: #fff;
  314. border-top: 1px solid #E6E6E6;
  315. .content-tip{
  316. text-align: center;
  317. padding: 50rpx 0 30rpx 0;
  318. font-size: 28rpx;
  319. }
  320. .content-box{
  321. padding: 24rpx;
  322. height: 83vh;
  323. .icon{
  324. display: flex;
  325. justify-content: center;
  326. align-items: center;
  327. .red{
  328. font-size: 80rpx;
  329. }
  330. .error-text{
  331. margin-left: 30rpx;
  332. font-size: 40rpx;
  333. }
  334. }
  335. .flex{
  336. display: flex;
  337. justify-content: space-between;
  338. }
  339. .weight{
  340. font-weight: bold;
  341. text-align: center;
  342. font-size: 38rpx;
  343. }
  344. .list{
  345. padding: 20rpx 0;
  346. }
  347. .content-item{
  348. width: 80rpx;
  349. height: 80rpx;
  350. border-radius: 10rpx;
  351. border: 1px solid #CCCCCC;
  352. color: #000;
  353. font-size: 32rpx;
  354. // margin: 0 20rpx;
  355. text-align: center;
  356. }
  357. }
  358. }
  359. .foot_btn_spe {
  360. padding: 24rpx;
  361. line-height: 88rpx;
  362. height: 100rpx;
  363. text-align: center;
  364. display: flex;
  365. justify-content: space-between;
  366. flex-wrap: wrap;
  367. view {
  368. height: 88rpx;
  369. width: 48%;
  370. color: #fff;
  371. border-radius: 8rpx;
  372. font-size: 32rpx;
  373. margin-top: 16rpx;
  374. }
  375. .green{
  376. background-image: linear-gradient(to right, #72c172, #3bb197);
  377. color: #fff !important;
  378. }
  379. .gray{
  380. background: #afafaf;
  381. color: #fff;
  382. }
  383. }
  384. }
  385. .green{
  386. color: #49B856;
  387. }
  388. .mar-rig{
  389. margin-right: 8rpx;
  390. }
  391. }
  392. </style>