scanning_djEnd.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164
  1. <template>
  2. <view class="Scanning_djEnd">
  3. <view class="Scanning_top" v-if="infoDATA.status == 200">
  4. <view class="Scanning_top_icon">
  5. <text class="cubeic-ok icon_transport transport-duigou"></text>
  6. </view>
  7. <view class="Scanning_top_text">
  8. <view class="text1">操作成功</view>
  9. </view>
  10. </view>
  11. <view class="Scanning_top" v-if="
  12. infoDATA.status == 10005 ||
  13. infoDATA.status == 100018 ||
  14. infoDATA.status == 10004 ||
  15. infoDATA.status == 100021 ||
  16. infoDATA.status == 500 ||
  17. infoDATA.status == 100031
  18. ">
  19. <view class="Scanning_top_icon">
  20. <text class="cubeic-close icon_transport transport-shibai"></text>
  21. </view>
  22. <view class="Scanning_top_text">
  23. <view class="text1">操作失败</view>
  24. <view class="text1 f30" v-if="queryObj.qrcode !== undefined">扫描内容:{{queryObj.qrcode}}</view>
  25. </view>
  26. </view>
  27. <view class="Scanning_cont" v-if="
  28. (infoDATA.status == 200 && type == 'specimenPlan') ||
  29. (infoDATA.status == 200 && type == 'specimen')
  30. "></view>
  31. <view class="Scanning_cont" v-if="
  32. (infoDATA.status == 200 && type == 'patientTransport') ||
  33. (infoDATA.status == 200 && type == 'inspect')
  34. ">扫描患者腕带并将患者送往目标科室.</view>
  35. <view class="Scanning_cont" v-if="
  36. (infoDATA.status == 200 &&
  37. type == 'drugsBag' &&
  38. (type1 == 'drug-ddd-2' || type1 == 'drug-dsd-2')) ||
  39. (infoDATA.status == 200 &&
  40. type == 'jPBag' &&
  41. (type1 == 'jp-ddd-2' || type1 == 'jp-dsd-2'))
  42. ">已到达目标科室,请扫描药包或静配包.</view>
  43. <view class="Scanning_cont" v-if="
  44. (infoDATA.status == 200 &&
  45. type == 'drugsBag' &&
  46. (type1 == 'drug-ddd-1' || type1 == 'drug-dsd-1')) ||
  47. (infoDATA.status == 200 &&
  48. type == 'jPBag' &&
  49. (type1 == 'jp-ddd-1' || type1 == 'jp-dsd-1'))
  50. ">
  51. <view v-if="accountObj"> 交接人工号 : {{ accountObj.account }} </view>
  52. <view v-if="accountObj"> 交接人姓名 : {{ accountObj.accountName }} </view>
  53. <view>已到达目标科室,请取药包或静配包后送达目标科室.</view>
  54. </view>
  55. <view class="Scanning_cont" v-if="
  56. infoDATA.status == 200 && type == 'other' && infoDATA.type == 'qt-ddd-1'
  57. ">已到达目标科室,请执行该工单.</view>
  58. <view class="Scanning_cont" v-if="
  59. (infoDATA.state == 'finish' &&
  60. infoDATA.status == 200 &&
  61. type == 'specimenPlan' &&
  62. infoDATA.type == 'plan-spe-dsd-1') ||
  63. (infoDATA.status == 200 &&
  64. type == 'other' &&
  65. infoDATA.type == 'qt-dsd-1')
  66. ">已到达目标科室,工单已完成.</view>
  67. <view class="Scanning_cont" v-if="
  68. (infoDATA.status == 200 &&
  69. type == 'specimenPlan' &&
  70. infoDATA.type != 'plan-spe-ddd-1' &&
  71. infoDATA.type != 'plan-spe-dsd-1') ||
  72. (infoDATA.status == 200 &&
  73. type == 'specimen' &&
  74. infoDATA.type != 'spe-ddd-1' &&
  75. infoDATA.type != 'spe-dsd-1')
  76. ">已到达目标科室,请扫描标本.</view>
  77. <view class="Scanning_cont" v-if="
  78. (infoDATA.status == 200 &&
  79. type == 'specimenPlan' &&
  80. infoDATA.type == 'plan-spe-ddd-1') ||
  81. (infoDATA.status == 200 &&
  82. type == 'specimen' &&
  83. infoDATA.type == 'spe-ddd-1')
  84. ">
  85. <view v-if="accountObj"> 交接人工号 : {{ accountObj.account }} </view>
  86. <view v-if="accountObj"> 交接人姓名 : {{ accountObj.accountName }} </view>
  87. <view>已到达目标科室,请取标本后送达目标科室.</view>
  88. </view>
  89. <view class="Scanning_cont" v-if="
  90. (infoDATA.state != 'finish' &&
  91. infoDATA.status == 200 &&
  92. type == 'specimenPlan' &&
  93. infoDATA.type == 'plan-spe-dsd-1') ||
  94. (infoDATA.status == 200 &&
  95. type == 'specimen' &&
  96. infoDATA.type == 'spe-dsd-1')
  97. ">
  98. <view v-if="accountObj"> 交接人工号 : {{ accountObj.account }} </view>
  99. <view v-if="accountObj"> 交接人姓名 : {{ accountObj.accountName }} </view>
  100. <view>已到达目标科室,请放置标本完成该工单.</view>
  101. </view>
  102. <view class="Scanning_cont" v-if="infoDATA.status != 200">
  103. <view>{{ infoDATA.msg }}</view>
  104. </view>
  105. <view class="foot_btn" v-if="type == 'inspect' || type == 'patientTransport'">
  106. <view class="btn3" @click="Scanning_again()">继续扫描</view>
  107. </view>
  108. <view class="foot_btn" v-if="type == 'drugsBag' || type == 'jPBag'">
  109. <view class="btn3" @click="Scanning_again()" v-if="
  110. type1 === 'drug-ddd-2' ||
  111. type1 === 'drug-dsd-2' ||
  112. type1 === 'jp-ddd-2' ||
  113. type1 === 'jp-dsd-2'
  114. ">继续扫描</view>
  115. <view class="btn3" @click="showHandViewDrugsbag()" v-if="
  116. type1 === 'drug-ddd-2' ||
  117. type1 === 'drug-dsd-2' ||
  118. type1 === 'jp-ddd-2' ||
  119. type1 === 'jp-dsd-2'
  120. ">手动录入</view>
  121. <view class="btn3" @click="showAlert()" v-if="
  122. type1 === 'drug-ddd-1' ||
  123. type1 === 'drug-dsd-1' ||
  124. type1 === 'jp-ddd-1' ||
  125. type1 === 'jp-dsd-1'
  126. ">知道了</view>
  127. </view>
  128. <view class="foot_btn_spe" v-if="
  129. (type == 'specimenPlan' &&
  130. type1 != 'plan-spe-dsd-1' &&
  131. (type1 != 'plan-spe-ddd-1') & (type1 != 'plan-spe-ddd-2')) ||
  132. (type == 'specimen' &&
  133. type1 != 'spe-dsd-1' &&
  134. type1 != 'spe-dsd-4' &&
  135. (type1 != 'spe-ddd-1') & (type1 != 'spe-ddd-2'))
  136. ">
  137. <view class="btn1" @click="Scanning_again()">扫描标本</view>
  138. <view class="btn3" @click="showHandViewSpecimen()">手动录入</view>
  139. <view class="btn3" @click="getNoScanSpecimen(false)">未扫描标本</view>
  140. <view class="btn3" @click="getNoScanSpecimen(true)">已扫描标本</view>
  141. <view class="btn2" @click="Scanning_complete(ids)">完成扫描</view>
  142. <view class="btn2" @click="checkNumber()" v-if="queryObj.isDigitalHandover==1">数量核对</view>
  143. </view>
  144. <view class="foot_btn_spe" v-if="
  145. (type == 'specimenPlan' && type1 == 'plan-spe-ddd-2') ||
  146. (type == 'specimen' && type1 == 'spe-ddd-2')
  147. ">
  148. <view class="btn1" @click="Scanning_again()">扫描标本</view>
  149. <view class="btn3" @click="showHandViewSpecimen()">手动录入</view>
  150. <view class="btn3" @click="getNoScanSpecimen(false)">未扫描标本</view>
  151. <view class="btn3" @click="getNoScanSpecimen(true)">已扫描标本</view>
  152. <view class="btn2" @click="Scanning_complete(ids)">完成扫描</view>
  153. <view class="btn2" @click="checkNumber()" v-if="queryObj.isDigitalHandover==1">数量核对</view>
  154. </view>
  155. <view class="foot_btn" v-if="
  156. (infoDATA.state != 'finish' &&
  157. type == 'specimenPlan' &&
  158. type1 == 'plan-spe-dsd-1') ||
  159. (type == 'specimen' && type1 == 'spe-dsd-1')
  160. ">
  161. <view class="btn1" @click="Scanning_complete1(ids)">完成工单</view>
  162. <view class="btn2" @click="showAlert()">继续配送</view>
  163. </view>
  164. <view class="foot_btn" v-if="
  165. infoDATA.status != 200 &&
  166. type != 'specimenPlan' &&
  167. type != 'specimen' &&
  168. type !== 'jPBag' &&
  169. type !== 'inspect' &&
  170. type !== 'drugsBag' &&
  171. type !== 'patientTransport'
  172. ">
  173. <view class="btn3" @click="showAlert()">知道了</view>
  174. </view>
  175. <view class="foot_btn" v-if="
  176. (infoDATA.status == 200 && type1 == 'spe-ddd-1') ||
  177. (infoDATA.status == 200 && type1 == 'plan-spe-ddd-1')
  178. ">
  179. <view class="btn3" @click="showAlert()">知道了</view>
  180. </view>
  181. <view class="foot_btn" v-if="
  182. (infoDATA.state == 'finish' &&
  183. infoDATA.status == 200 &&
  184. type == 'specimenPlan' &&
  185. type1 == 'plan-spe-dsd-1') ||
  186. (infoDATA.status == 200 && type == 'other')
  187. ">
  188. <view class="btn3" @click="showAlert()">知道了</view>
  189. </view>
  190. <view class="foot_btn" v-if="infoDATA.status != 200 && type1 == 'spe-dsd-4'">
  191. <view class="btn3" @click="showAlert()">知道了</view>
  192. </view>
  193. <!-- 弹窗 -->
  194. <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content"
  195. @ok="ok" @cancel="cancel" :operate="models.operate"></showModel>
  196. <!-- 弹窗 -->
  197. <showModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor" :content="models2.content"
  198. @ok="ok2" @know="know2" @cancel="cancel2" :operate="models2.operate">
  199. </showModel>
  200. <!-- 手动查询标本弹窗 -->
  201. <handViewSpecimen v-if="speModels.disjunctor" :title="speModels.title" :disjunctor="speModels.disjunctor"
  202. @ok="speOk" @cancel="speCancel">
  203. </handViewSpecimen>
  204. <!-- 手动查询药品弹窗 -->
  205. <handViewDrugsBag v-if="drugbagModels.disjunctor" :title="drugbagModels.title"
  206. :disjunctor="drugbagModels.disjunctor" @ok="drugbagOk" @cancel="drugbagCancel">
  207. </handViewDrugsBag>
  208. <!-- 修改标本数量弹窗 -->
  209. <changeSpeNum v-if="changeSpeModels.disjunctor" :operate="{ok:'确认数量',check:'详细核对',cancel:'取消'}"
  210. :title="changeSpeModels.title" :content="changeSpeModels.content" :disjunctor="changeSpeModels.disjunctor"
  211. @ok="changeSpeOk" @check="changeSpeCheck" @cancel="changeSpeCancel" :num="speNumChange" :modifyReason="modifyReason" :isFirstShowReason="false">
  212. </changeSpeNum>
  213. </view>
  214. </template>
  215. <script>
  216. import showModel from "../../components/showModel/showModel.vue";
  217. import {
  218. get,
  219. post,
  220. SM,
  221. webHandle
  222. } from "../../http/http.js";
  223. export default {
  224. data() {
  225. return {
  226. speNumChange: 0,
  227. modifyReason:'',
  228. changeSpeObj: {},
  229. // 修改标本数量弹窗model
  230. changeSpeModels: {
  231. disjunctor: false,
  232. },
  233. currentCode: '', //当前小扫描的科室二维码
  234. // 手动查询标本弹窗model
  235. speModels: {
  236. disjunctor: false,
  237. },
  238. // 手动查询药品弹窗model
  239. drugbagModels: {
  240. disjunctor: false,
  241. },
  242. // 交接人信息
  243. accountObj: undefined,
  244. //传给后端查询是否继续扫描
  245. deptId: undefined,
  246. SMFlag: true,
  247. // 弹窗model
  248. models: {
  249. disjunctor: false,
  250. },
  251. // 完成扫描弹窗model1
  252. models2: {
  253. disjunctor: false,
  254. },
  255. wcId: "", //工单完成ID
  256. wcFlag: false,
  257. modelFlag: "", //工单完成类型
  258. infoDATA: [],
  259. ids: [],
  260. type: "",
  261. type1: "",
  262. queryObj: {}, //路由传递过来的参数
  263. gotoFlag: true,
  264. speNum: 0,
  265. content: "",
  266. };
  267. },
  268. methods: {
  269. // 修改标本数量-核对
  270. changeSpeCheck() {
  271. console.log(this.infoDATA);
  272. this.changeSpeModels.disjunctor = false;
  273. uni.navigateTo({
  274. url: `/pages/specimenCheckingDetail/specimenCheckingDetail?infoDATA=${encodeURIComponent(JSON.stringify({startDept:this.queryObj.startDeptId,uuid:this.queryObj.gdId}))}&id=${this.queryObj.signDeptId}&t=big&gdState=${this.queryObj.gdState}`
  275. })
  276. },
  277. // 修改标本数量-确认
  278. changeSpeOk(data) {
  279. console.log(data);
  280. const pathUrl = uni.getStorageSync("path");
  281. const {
  282. speNum,
  283. reason,
  284. imageValue
  285. } = data;
  286. this.changeSpeModels.disjunctor = false;
  287. uni.showLoading({
  288. mask: true,
  289. title: "加载中",
  290. });
  291. let postData = {
  292. checkDept: this.queryObj.endDepts, //终点科室
  293. transDeptId: this.changeSpeObj.infoDATA.startDept,
  294. gdId: this.changeSpeObj.infoDATA.uuid,
  295. deptId: this.changeSpeObj.id == "undefined" ?
  296. this.changeSpeObj.infoDATA.startDept : this.changeSpeObj.id,
  297. specimensNum: speNum,
  298. modifyReason: reason,
  299. };
  300. post("/api/updateCheckDeptSpecimensNum", postData).then((res) => {
  301. if (res.status == 200) {
  302. console.log(imageValue);
  303. if (!imageValue.length) {
  304. uni.hideLoading();
  305. if (this.changeSpeObj.t == "big") {
  306. if (this.changeSpeObj.gdState == 4) {
  307. // 待到达
  308. uni.navigateTo({
  309. url: `../../pages/receiptpage/receiptpage`,
  310. });
  311. } else if (this.changeSpeObj.gdState == 5) {
  312. // 待送达
  313. if (res.type1 === "plan-spe-ddd-2") {} else {
  314. let content = `本工单已签到<strong class="red">${
  315. res.scanSet ? res.scanSet.join("、") : ""
  316. }</strong>,剩余需签到科室<strong class="red">${
  317. res.notScanSet ? res.notScanSet.join("、") : ""
  318. }</strong>,您确定完成工单吗?`;
  319. uni.navigateTo({
  320. url: `../scanning/scanning?type=${res.type}&type1=${
  321. res.type1
  322. }&id=${encodeURIComponent(
  323. JSON.stringify([res.gdid])
  324. )}&content=${content}`,
  325. });
  326. }
  327. }
  328. } else if (this.changeSpeObj.t == "small") {
  329. if (this.changeSpeObj.id == "undefined") {
  330. //快捷建单建单进入
  331. uni.navigateTo({
  332. url: `../../pages/receiptpage/receiptpage`,
  333. });
  334. } else {
  335. if (this.changeSpeObj.gdState == 4) {
  336. // 待到达
  337. uni.navigateTo({
  338. url: `../../pages/receiptpage/receiptpage`,
  339. });
  340. } else if (this.changeSpeObj.gdState == 5) {
  341. // 待送达
  342. if (res.type1 === "plan-spe-ddd-2") {} else {
  343. let content = `本工单已签到<strong class="red">${
  344. res.scanSet ? res.scanSet.join("、") : ""
  345. }</strong>,剩余需签到科室<strong class="red">${
  346. res.notScanSet ? res.notScanSet.join("、") : ""
  347. }</strong>,您确定完成工单吗?`;
  348. uni.navigateTo({
  349. url: `../scanning/scanning?type=${res.type}&type1=${
  350. res.type1
  351. }&id=${encodeURIComponent(
  352. JSON.stringify([res.gdid])
  353. )}&content=${content}`,
  354. });
  355. }
  356. }
  357. }
  358. } else {
  359. uni.navigateTo({
  360. url: `../../pages/specimenChecking/specimenChecking?infoDATA=${encodeURIComponent(
  361. JSON.stringify(this.changeSpeObj.infoDATA)
  362. )}`,
  363. });
  364. }
  365. return;
  366. }
  367. let n = 0;
  368. imageValue.forEach((v) => {
  369. // 图片上传 start
  370. console.log("压缩前");
  371. let canvasWidth = v.image.width; //图片原始长宽
  372. let canvasHeight = v.image.height;
  373. let img = new Image();
  374. img.src = v.path;
  375. let canvas = document.createElement("canvas");
  376. let ctx = canvas.getContext("2d");
  377. canvas.width = canvasWidth;
  378. canvas.height = canvasHeight;
  379. ctx.drawImage(img, 0, 0, canvasWidth, canvasHeight);
  380. canvas.toBlob(
  381. (fileSrc) => {
  382. let tp = window.URL.createObjectURL(fileSrc);
  383. console.log("压缩后");
  384. n++;
  385. uni.uploadFile({
  386. url: pathUrl +
  387. "/common/common/uploadAttachment/specimenPhotos/" +
  388. res.deptSpecimensNumId +
  389. "/666",
  390. filePath: tp,
  391. name: "file",
  392. formData: {
  393. filename: v.name,
  394. },
  395. success: (uploadFileRes) => {
  396. console.log(uploadFileRes);
  397. if (--n === 0) {
  398. uni.hideLoading();
  399. uni.showModal({
  400. title: "提示",
  401. content: "修改成功!",
  402. showCancel: false,
  403. success: (result) => {
  404. if (result.confirm) {
  405. console.log("用户点击确定", this.changeSpeObj.t);
  406. if (this.changeSpeObj.t == "big") {
  407. if (this.changeSpeObj.gdState == 4) {
  408. // 待到达
  409. uni.navigateTo({
  410. url: `../../pages/receiptpage/receiptpage`,
  411. });
  412. } else if (this.changeSpeObj.gdState == 5) {
  413. // 待送达
  414. if (res.type1 === "plan-spe-ddd-2") {} else {
  415. let content = `本工单已签到<strong class="red">${
  416. res.scanSet ? res.scanSet.join("、") : ""
  417. }</strong>,剩余需签到科室<strong class="red">${
  418. res.notScanSet ? res.notScanSet.join("、") : ""
  419. }</strong>,您确定完成工单吗?`;
  420. uni.navigateTo({
  421. url: `../scanning/scanning?type=${res.type}&type1=${
  422. res.type1
  423. }&id=${encodeURIComponent(
  424. JSON.stringify([res.gdid])
  425. )}&content=${content}`,
  426. });
  427. }
  428. }
  429. } else if (this.changeSpeObj.t == "small") {
  430. if (this.changeSpeObj.id == "undefined") {
  431. //快捷建单建单进入
  432. uni.navigateTo({
  433. url: `../../pages/receiptpage/receiptpage`,
  434. });
  435. } else {
  436. if (this.changeSpeObj.gdState == 4) {
  437. // 待到达
  438. uni.navigateTo({
  439. url: `../../pages/receiptpage/receiptpage`,
  440. });
  441. } else if (this.changeSpeObj.gdState == 5) {
  442. // 待送达
  443. if (res.type1 === "plan-spe-ddd-2") {} else {
  444. let content = `本工单已签到<strong class="red">${
  445. res.scanSet ? res.scanSet.join("、") : ""
  446. }</strong>,剩余需签到科室<strong class="red">${
  447. res.notScanSet ? res.notScanSet.join("、") : ""
  448. }</strong>,您确定完成工单吗?`;
  449. uni.navigateTo({
  450. url: `../scanning/scanning?type=${res.type}&type1=${
  451. res.type1
  452. }&id=${encodeURIComponent(
  453. JSON.stringify([res.gdid])
  454. )}&content=${content}`,
  455. });
  456. }
  457. }
  458. }
  459. } else {
  460. uni.navigateTo({
  461. url: `../../pages/specimenChecking/specimenChecking?infoDATA=${encodeURIComponent(
  462. JSON.stringify(this.changeSpeObj.infoDATA)
  463. )}`,
  464. });
  465. }
  466. } else if (result.cancel) {
  467. console.log("用户点击取消");
  468. }
  469. },
  470. });
  471. }
  472. },
  473. fail: (err) => {
  474. n--;
  475. console.error(err);
  476. uni.hideLoading();
  477. uni.showToast({
  478. icon: "none",
  479. title: "上传失败",
  480. duration: 2000,
  481. });
  482. },
  483. });
  484. },
  485. "image/jpeg",
  486. 0.3
  487. );
  488. // 图片上传 end
  489. });
  490. } else {
  491. uni.hideLoading();
  492. uni.showToast({
  493. icon: "none",
  494. title: res.msg || "接口获取数据失败!",
  495. });
  496. }
  497. });
  498. },
  499. // 修改标本数量-取消
  500. changeSpeCancel() {
  501. this.changeSpeModels.disjunctor = false;
  502. },
  503. // 修改标本数量弹窗
  504. showChangeSpe() {
  505. uni.showLoading({
  506. mask: true,
  507. title: "加载中",
  508. });
  509. let postData = {
  510. deptId: this.deptId,
  511. gdId: this.queryObj.gdId,
  512. };
  513. post(`/api/getStartDeptSpecimensNum`, postData).then((res) => {
  514. uni.hideLoading();
  515. if (res.status == 200) {
  516. this.speNumChange = res.data[0].deptSpecimensNum;
  517. this.modifyReason = res.data[0].modifyReason;
  518. this.changeSpeModels = {
  519. title: "修改标本数量",
  520. content: `您已到达<span class="red">${this.queryObj.dept}</span>本科室标本数量为<span class="red">${this.speNumChange}</span>,请确认标本数量`,
  521. disjunctor: true,
  522. };
  523. } else {
  524. this.speNumChange = "";
  525. this.modifyReason = "";
  526. uni.showToast({
  527. icon: "none",
  528. title: res.msg || "接口获取数据失败!",
  529. });
  530. }
  531. });
  532. },
  533. // 数量核对 queryObj
  534. checkNumber() {
  535. this.changeSpeObj = {
  536. infoDATA: {
  537. startDept: this.queryObj.startDeptId,
  538. uuid: this.queryObj.gdId
  539. },
  540. id: this.queryObj.signDeptId,
  541. t: 'big',
  542. gdState: this.queryObj.gdState,
  543. }
  544. this.showChangeSpe();
  545. },
  546. // 手动查询药品-确认
  547. drugbagOk(data) {
  548. console.log(data);
  549. if (!data.id) {
  550. //没有查询到药品
  551. uni.showModal({
  552. title: '提示',
  553. content: "没有查询到发药单号!",
  554. showCancel: false,
  555. success: function(res) {
  556. if (res.confirm) {
  557. console.log('用户点击确定');
  558. } else if (res.cancel) {
  559. console.log('用户点击取消');
  560. }
  561. }
  562. });
  563. return;
  564. }
  565. this.drugbagModels.disjunctor = false;
  566. this.hand_scanning_common(data.packid, 'hand');
  567. },
  568. // 手动查询药品-取消
  569. drugbagCancel() {
  570. this.drugbagModels.disjunctor = false;
  571. },
  572. // 手动查询药品弹窗
  573. showHandViewDrugsbag() {
  574. this.drugbagModels = {
  575. title: '填写发药单号',
  576. disjunctor: true,
  577. }
  578. },
  579. // 手动查询标本-确认
  580. speOk(data) {
  581. console.log(data);
  582. if (!data.id) {
  583. //没有查询到标本
  584. uni.showModal({
  585. title: '提示',
  586. content: "没有查询到标本!",
  587. showCancel: false,
  588. success: function(res) {
  589. if (res.confirm) {
  590. console.log('用户点击确定');
  591. } else if (res.cancel) {
  592. console.log('用户点击取消');
  593. }
  594. }
  595. });
  596. return;
  597. }
  598. this.speModels.disjunctor = false;
  599. this.hand_scanning_common(data.scode, 'hand');
  600. },
  601. // 手动查询标本-取消
  602. speCancel() {
  603. this.speModels.disjunctor = false;
  604. },
  605. // 手动查询标本弹窗
  606. showHandViewSpecimen() {
  607. this.speModels = {
  608. title: '填写标本编码',
  609. disjunctor: true,
  610. }
  611. },
  612. // 手动输入标本和扫码公共方法
  613. hand_scanning_common(ress1, type) {
  614. uni.showLoading({
  615. title: "加载中",
  616. mask: true,
  617. });
  618. // ----------------
  619. //检验二维码的有效性
  620. post("/dept/scanning", {
  621. content: ress1,
  622. }).then((result) => {
  623. this.SMFlag = true;
  624. if (result.state == 200 || result.state == 201) {
  625. this.currentCode = result.code;
  626. let ress = result.code;
  627. let speCode = ress;
  628. let data = {
  629. code: speCode,
  630. type: this.queryObj.type1,
  631. deptCode: this.code,
  632. ids: this.ids,
  633. };
  634. let postType = "";
  635. if (this.type == "jPBag" || this.type == "drugsBag") {
  636. postType = "handleDrugsAndJp";
  637. delete data.ids;
  638. if (this.accountObj) {
  639. data.handover = this.accountObj.accountId;
  640. }
  641. data.deptId = this.deptId;
  642. }
  643. if (this.type == "specimen") {
  644. postType = "handleSpes";
  645. data["speCode"] = data.code;
  646. delete data.code;
  647. if (this.accountObj) {
  648. data.handover = this.accountObj.accountId;
  649. }
  650. }
  651. if (this.type == "specimenPlan") {
  652. postType = "handlePlanSpes";
  653. data["speCode"] = data.code;
  654. delete data.code;
  655. if (this.accountObj) {
  656. data.handover = this.accountObj.accountId;
  657. }
  658. }
  659. if (this.type == "inspect") {
  660. postType = "handleIns";
  661. }
  662. if (this.type == "patientTransport") {
  663. postType = "handleTrans";
  664. }
  665. post("/workerOrder/" + postType, data).then((ress) => {
  666. uni.hideLoading();
  667. if (ress.status == 200 || ress.status == 11111) {
  668. //标本和标本轮巡工单,扫描标本后会自动调用摄像头,继续扫描,直到status不是200
  669. if ((this.type == "specimenPlan" || this.type == "specimen") && ress.status != 11111) {
  670. if (type === 'scan') {
  671. setTimeout(() => {
  672. this.Scanning_again();
  673. }, 500)
  674. }
  675. }
  676. this.speNum = ress.specimenCount;
  677. uni.navigateTo({
  678. url: `../scanning_djInfo/scanning_djInfo?type=${
  679. this.queryObj.type
  680. }&type1=${
  681. this.queryObj.type1
  682. }&infoData=${encodeURIComponent(
  683. JSON.stringify(ress.data)
  684. )}&status=${ress.status}&msg=${ress.msg}&deptCode=${
  685. this.queryObj.code
  686. }&dept=${this.queryObj.dept}&ids=${encodeURIComponent(
  687. JSON.stringify(this.ids)
  688. )}&model=${encodeURIComponent(
  689. JSON.stringify(ress)
  690. )}&speNum=${this.speNum}&accountObj=${encodeURIComponent(
  691. JSON.stringify(this.accountObj)
  692. )}&deptId=${this.deptId}&scanOrHand=${type}`,
  693. });
  694. } else {
  695. uni.navigateTo({
  696. url: `../scanning_djInfo/scanning_djInfo?type=${
  697. this.queryObj.type
  698. }&type1=${this.queryObj.type1}&status=${ress.status}&msg=${
  699. ress.msg
  700. }&deptCode=${this.queryObj.code}&dept=${
  701. this.queryObj.dept
  702. }&ids=${encodeURIComponent(
  703. JSON.stringify(this.ids)
  704. )}&infoData=${encodeURIComponent(
  705. JSON.stringify(ress.data)
  706. )}&model=${encodeURIComponent(
  707. JSON.stringify(ress)
  708. )}&accountObj=${encodeURIComponent(
  709. JSON.stringify(this.accountObj)
  710. )}&deptId=${this.deptId}&scanOrHand=${type}&qrcode=${this.currentCode}`,
  711. });
  712. }
  713. });
  714. } else {
  715. uni.hideLoading();
  716. uni.showToast({
  717. icon: "none",
  718. title: result.info || "接口获取数据失败!",
  719. });
  720. }
  721. });
  722. // ------------------------------
  723. },
  724. // 查看未扫描标本
  725. // isScan true已扫描标本,false未扫描标本
  726. getNoScanSpecimen(isScan) {
  727. if (!this.gotoFlag) {
  728. return;
  729. }
  730. this.gotoFlag = false;
  731. let ids = JSON.parse(this.queryObj.ids);
  732. if (isScan) {
  733. uni.navigateTo({
  734. url: `../noScanSpecimen/noScanSpecimen?deptName=${this.queryObj.dept}&workOrderId=${encodeURIComponent(
  735. JSON.stringify(ids)
  736. )}&deptCode=${this.queryObj.code}&isScan=1`,
  737. });
  738. } else {
  739. uni.navigateTo({
  740. url: `../noScanSpecimen/noScanSpecimen?deptName=${this.queryObj.dept}&workOrderId=${encodeURIComponent(
  741. JSON.stringify(ids)
  742. )}&deptCode=${this.queryObj.code}`,
  743. });
  744. }
  745. },
  746. // 正常完成扫描
  747. overFinish() {
  748. //完成扫描
  749. let postType = "";
  750. if (
  751. this.queryObj.type1 === "plan-spe-ddd-2" ||
  752. this.queryObj.type1 === "plan-spe-dsd-2" ||
  753. this.queryObj.type1 === "plan-spe-dsd-3"
  754. ) {
  755. postType = "finishPlanSpes";
  756. } else if (this.queryObj.type1 == "spe-ddd-2") {
  757. postType = "finishSpes";
  758. }
  759. let data = {
  760. type: this.queryObj.type1,
  761. ids: this.wcId,
  762. };
  763. uni.showLoading({
  764. title: "加载中",
  765. mask: true,
  766. });
  767. post("/workerOrder/" + postType, data).then((res) => {
  768. if (res.status == 200) {
  769. this.models2 = {
  770. disjunctor: true,
  771. title: "提示",
  772. content: `完成扫描成功`,
  773. icon: "success",
  774. operate: {
  775. know: "知道了",
  776. },
  777. };
  778. } else {
  779. uni.hideLoading();
  780. uni.showToast({
  781. icon: "none",
  782. title: res.msg || "接口获取数据失败!",
  783. });
  784. }
  785. });
  786. },
  787. // 确定
  788. ok() {
  789. this.models.disjunctor = false;
  790. if (this.modelFlag === "complete") {
  791. uni.showLoading({
  792. title: "加载中",
  793. mask: true,
  794. });
  795. let ids = JSON.parse(this.queryObj.ids);
  796. let postData = {
  797. ids,
  798. sign: true,
  799. deptQrCode: this.queryObj.code,
  800. };
  801. post("/workerOrder/expectedAndActual", postData).then((ress) => {
  802. uni.hideLoading();
  803. if (ress.status == 200) {
  804. if (this.wcFlag) {
  805. //正常完成扫描
  806. this.overFinish();
  807. } else {
  808. this.gotoOver();
  809. }
  810. } else if (ress.status == 1000035) {
  811. let content = "";
  812. if (
  813. this.queryObj.type1 === "spe-ddd-2" ||
  814. this.queryObj.type1 === "plan-spe-ddd-2"
  815. ) {
  816. //待到达
  817. content =
  818. `系统内预计标本<strong class="red">${ress.expectReceiveNum}</strong>只,您扫描收取标本<strong class="red">${ress.actualReceiveNum}</strong>只,其中<strong class="red">${ress.notReceiveNum}</strong>只未扫描;`;
  819. } else {
  820. //待送达
  821. this.content = `本工单已签到<strong class="red">${
  822. ress.scanSet ? ress.scanSet.join("、") : ""
  823. }</strong>,剩余需签到科室<strong class="red">${
  824. ress.notScanSet ? ress.notScanSet.join("、") : ""
  825. }</strong>,总签收<strong class="red">${
  826. ress.totalAcceptance
  827. }</strong>只,剩余<strong class="red">${
  828. ress.notAcceptance
  829. }</strong>只未签收,您确定完成工单吗?`;
  830. content =
  831. `您在<strong class="red">${ress.deptName}</strong>检验科扫描了<strong class="red">${ress.deptScanNum}</strong>个标本,还需扫描<strong class="red">${ress.deptNotScanNum}</strong>标本。`;
  832. }
  833. // 取消弹窗 2022年10月10日
  834. this.ok2();
  835. // this.models2 = {
  836. // disjunctor: true,
  837. // title: "提示",
  838. // content,
  839. // icon: "warn",
  840. // operate: {
  841. // ok: "确定",
  842. // cancel: "取消",
  843. // },
  844. // };
  845. } else {
  846. uni.showToast({
  847. icon: "none",
  848. title: ress.msg || "接口获取数据失败!",
  849. });
  850. }
  851. });
  852. } else if (this.modelFlag === "complete1") {
  853. //1对1标本完成工单
  854. let ids = this.wcId;
  855. uni.showLoading({
  856. title: "加载中",
  857. mask: true,
  858. });
  859. post("/workerOrder/finishSpeOrder", ids).then((res) => {
  860. if (res.status == 200) {
  861. uni.reLaunch({
  862. url: "../receiptpage/receiptpage",
  863. });
  864. } else {
  865. uni.hideLoading();
  866. uni.showToast({
  867. icon: "none",
  868. title: res.msg || "接口获取数据失败!",
  869. });
  870. }
  871. });
  872. }
  873. },
  874. // 取消
  875. cancel() {
  876. this.models.disjunctor = false;
  877. },
  878. // 确定
  879. ok2() {
  880. this.models2.disjunctor = false;
  881. let ids = JSON.parse(this.queryObj.ids);
  882. let postData = {
  883. ids,
  884. deptQrCode: this.queryObj.code,
  885. };
  886. uni.showLoading({
  887. title: "加载中",
  888. mask: true,
  889. });
  890. post("/workerOrder/expectedAndActual", postData).then((ress) => {
  891. uni.hideLoading();
  892. if (ress.status == 200) {
  893. if (this.wcFlag) {
  894. this.overFinish();
  895. } else {
  896. this.gotoOver();
  897. }
  898. } else {
  899. uni.showToast({
  900. icon: "none",
  901. title: ress.msg || "接口获取数据失败!",
  902. });
  903. }
  904. });
  905. },
  906. // 取消
  907. cancel2() {
  908. this.models2.disjunctor = false;
  909. },
  910. know2() {
  911. this.models2.disjunctor = false;
  912. uni.reLaunch({
  913. url: "../receiptpage/receiptpage",
  914. });
  915. },
  916. //完成扫描
  917. Scanning_complete(id) {
  918. // 如果是标本配送和标本轮巡,则进入标本核对页面
  919. if((this.type === 'specimen' || this.type === 'specimenPlan') && this.queryObj.type1.includes('ddd')){
  920. uni.navigateTo({
  921. url: `../checkAfterScanning/checkAfterScanning?id=${id}&type=${this.queryObj.type}&type1=${this.queryObj.type1}&dept=${this.queryObj.dept}&deptId=${this.queryObj.deptId}&deptCode=${this.queryObj.deptCode}&speNum=${this.speNum}&content=${this.content}`,
  922. });
  923. return;
  924. }
  925. this.modelFlag = "complete";
  926. this.wcId = id;
  927. if (
  928. this.queryObj.type1 == "plan-spe-ddd-2" ||
  929. this.queryObj.type1 == "spe-ddd-2"
  930. ) {
  931. this.wcFlag = true;
  932. this.models = {
  933. disjunctor: true,
  934. title: "提示",
  935. content: "是否确定标本已扫描完成?",
  936. icon: "warn",
  937. operate: {
  938. ok: "确定",
  939. cancel: "取消",
  940. },
  941. };
  942. } else if (
  943. this.queryObj.type1 == "plan-spe-dsd-2" ||
  944. this.queryObj.type1 == "plan-spe-dsd-3" ||
  945. this.queryObj.type1 == "spe-dsd-2" ||
  946. this.queryObj.type1 == "spe-dsd-3"
  947. ) {
  948. this.wcFlag = false;
  949. this.models = {
  950. disjunctor: true,
  951. title: "提示",
  952. content: "是否确定标本已扫描完成?",
  953. icon: "warn",
  954. operate: {
  955. ok: "确定",
  956. cancel: "取消",
  957. },
  958. };
  959. } else {
  960. this.gotoOver();
  961. }
  962. },
  963. // 跳转完成工单页面
  964. gotoOver() {
  965. if(this.queryObj.type === 'specimenPlan'){
  966. uni.navigateTo({
  967. url: `../specimenCheckingEnd/specimenCheckingEnd?type=${this.queryObj.type}&type1=${
  968. this.queryObj.type1
  969. }&deptCode=${this.queryObj.code}&dept=${
  970. this.queryObj.dept
  971. }&id=${encodeURIComponent(JSON.stringify(this.wcId))}&content=${
  972. this.content
  973. }`,
  974. });
  975. }else{
  976. uni.navigateTo({
  977. url: `../scanning/scanning?type=${this.queryObj.type}&type1=${
  978. this.queryObj.type1
  979. }&deptCode=${this.queryObj.code}&dept=${
  980. this.queryObj.dept
  981. }&id=${encodeURIComponent(JSON.stringify(this.wcId))}&content=${
  982. this.content
  983. }`,
  984. });
  985. }
  986. },
  987. //一对一完成工单
  988. Scanning_complete1(id) {
  989. this.modelFlag = "complete1";
  990. this.wcId = id;
  991. this.models = {
  992. disjunctor: true,
  993. title: "提示",
  994. content: "是否确定标本配送完成?",
  995. icon: "warn",
  996. operate: {
  997. ok: "确定",
  998. cancel: "取消",
  999. },
  1000. };
  1001. },
  1002. //继续扫描
  1003. Scanning_again() {
  1004. if (!this.SMFlag) {
  1005. return;
  1006. }
  1007. this.SMFlag = false;
  1008. SM()
  1009. .then((ress1) => {
  1010. this.hand_scanning_common(ress1, 'scan');
  1011. })
  1012. .catch((err) => {
  1013. this.SMFlag = true;
  1014. });
  1015. },
  1016. // 知道了
  1017. showAlert() {
  1018. uni.navigateTo({
  1019. url: "../receiptpage/receiptpage",
  1020. });
  1021. },
  1022. },
  1023. onShow() {
  1024. this.SMFlag = true;
  1025. this.gotoFlag = true;
  1026. },
  1027. onLoad(options) {
  1028. console.log(options, "djEnd");
  1029. if (options.speNum) {
  1030. this.speNum = options.speNum;
  1031. }
  1032. if (options.accountObj && options.accountObj != "undefined") {
  1033. this.accountObj = JSON.parse(options.accountObj);
  1034. }
  1035. if (options.deptId && options.deptId != "undefined") {
  1036. this.deptId = options.deptId;
  1037. }
  1038. this.queryObj = options;
  1039. let list = JSON.parse(options.model); //签到返回的信息
  1040. this.code = options.code; //二维码code
  1041. this.ids = options.ids && JSON.parse(options.ids); //科室ID数组
  1042. this.infoDATA = list;
  1043. if (options.type) {
  1044. //关联类型
  1045. this.type = options.type;
  1046. } else {
  1047. this.type = list.type;
  1048. }
  1049. this.type1 = options.type1;
  1050. if(this.queryObj.isDigitalHandover==1){
  1051. this.checkNumber();//自动弹出数量核对
  1052. }
  1053. // #ifdef APP-PLUS
  1054. webHandle("no", "app");
  1055. // #endif
  1056. // #ifdef H5
  1057. webHandle("no", "wx");
  1058. // #endif
  1059. },
  1060. };
  1061. </script>
  1062. <style lang="less">
  1063. .Scanning_djEnd {
  1064. padding: 0px 20rpx;
  1065. .Scanning_top {
  1066. min-height: 270rpx;
  1067. .Scanning_top_icon {
  1068. width: 140rpx;
  1069. height: 140rpx;
  1070. margin: 0 auto;
  1071. // margin-top: 116rpx;
  1072. border-radius: 50%;
  1073. line-height: 140rpx;
  1074. .cubeic-ok {
  1075. font-size: 140rpx;
  1076. color: #35b34a;
  1077. }
  1078. .cubeic-close {
  1079. font-size: 140rpx;
  1080. color: #ff3b53;
  1081. }
  1082. }
  1083. .Scanning_top_text {
  1084. .text1 {
  1085. margin-top: 40rpx;
  1086. font-size: 48rpx;
  1087. text-align: center;
  1088. }
  1089. }
  1090. }
  1091. .Scanning_cont {
  1092. font-size: 32rpx;
  1093. text-align: center;
  1094. view {
  1095. margin-bottom: 16rpx;
  1096. }
  1097. .text {
  1098. margin-top: 24rpx;
  1099. color: #35b34a;
  1100. }
  1101. .text1 {
  1102. margin-top: 24rpx;
  1103. color: #ff3b53;
  1104. }
  1105. }
  1106. .foot_btn {
  1107. line-height: 88rpx;
  1108. height: 100rpx;
  1109. margin-top: 40rpx;
  1110. text-align: center;
  1111. display: flex;
  1112. view {
  1113. height: 88rpx;
  1114. flex: 1;
  1115. margin: 0 1%;
  1116. background-image: linear-gradient(to right, #72c172, #3bb197);
  1117. color: #fff;
  1118. border-radius: 8rpx;
  1119. font-size: 32rpx;
  1120. margin-top: 16rpx;
  1121. }
  1122. }
  1123. .foot_btn_spe {
  1124. line-height: 88rpx;
  1125. height: 100rpx;
  1126. margin-top: 40rpx;
  1127. text-align: center;
  1128. display: flex;
  1129. justify-content: space-between;
  1130. flex-wrap: wrap;
  1131. &::after {
  1132. content: '';
  1133. flex: 1;
  1134. }
  1135. view {
  1136. height: 88rpx;
  1137. width: 48%;
  1138. margin: 0 1%;
  1139. background-image: linear-gradient(to right, #72c172, #3bb197);
  1140. color: #fff;
  1141. border-radius: 8rpx;
  1142. font-size: 32rpx;
  1143. margin-top: 16rpx;
  1144. }
  1145. }
  1146. }
  1147. </style>