startOrderSignBlood.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <template>
  2. <view class="Scanning_Result">
  3. <view class="Scanning_top">
  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_cont">
  12. <view>您已到达{{queryObj.deptName}},请核对以下数量</view>
  13. <view class="table_head">
  14. <view>科室<text class="red ml16">{{deptTotalCount}}</text></view>
  15. <view>患者<text class="red ml16">{{patientTotalCount}}</text></view>
  16. <view>血制品<text class="red ml16">{{bloodTotalCount}}</text></view>
  17. </view>
  18. <view class="table_bodys">
  19. <view class="table_body" v-for="(item, index) in dataList" :key="index" @click="toDetail(item)">
  20. <view>{{item.dept}}</view>
  21. <view>{{item.patientCount}}</view>
  22. <view>{{item.bloodCount}}</view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="foot_btn_spe">
  27. <view class="btn1" @click="complete()" v-if="orderIds">核对完成</view>
  28. <view class="btn3" @click="goBack()">取消</view>
  29. </view>
  30. <!-- 填写交接人工号弹窗 -->
  31. <selectAccount @click.stop.native v-if="hosModels.disjunctor" :content="hosModels.content" :disjunctor="hosModels.disjunctor" @ok="hosOk"
  32. @cancel="hosCancel">
  33. </selectAccount>
  34. </view>
  35. </template>
  36. <script>
  37. import {
  38. get,
  39. post,
  40. SM,
  41. webHandle
  42. } from "../../http/http.js";
  43. export default {
  44. data() {
  45. return {
  46. orderIds: '',
  47. bloodIds: '',
  48. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  49. // 填写交接人工号弹窗model
  50. hosModels: {
  51. disjunctor: false,
  52. },
  53. deptTotalCount: 0,
  54. patientTotalCount: 0,
  55. bloodTotalCount: 0,
  56. dataList: [],
  57. queryObj: {}, //路由传递过来的数据
  58. };
  59. },
  60. methods: {
  61. // 核对完成
  62. complete(){
  63. uni.showLoading({
  64. title: "加载中",
  65. mask: true,
  66. });
  67. post('/simple/data/fetchDataList/taskTypeConfig', {
  68. idx: 0,
  69. sum: 1,
  70. taskTypeConfig: {
  71. "taskTypeDTO": {
  72. "hosId": {
  73. "id": this.hosId
  74. },
  75. "ordinaryField": {
  76. "key": "ordinary_field",
  77. "value": "blood"
  78. }
  79. }
  80. },
  81. }).then(res => {
  82. uni.hideLoading();
  83. if(res.status == 200){
  84. let list = res.list || [];
  85. if(list.length > 0){
  86. let signTypeList = list[0].signTypeList || [];
  87. let signType = signTypeList.find( v => v.value == 5 );
  88. if(signType){
  89. this.showSelectAccount();
  90. }else{
  91. this.checkComplete();
  92. }
  93. }else{
  94. uni.showToast({
  95. icon: "none",
  96. title: "请配置血制品任务类型!",
  97. });
  98. }
  99. }else{
  100. uni.showToast({
  101. icon: "none",
  102. title: res.msg || "接口获取数据失败!",
  103. });
  104. }
  105. })
  106. },
  107. // 填写交接人工号-确认
  108. hosOk(data) {
  109. console.log(data);
  110. const {
  111. accountName,
  112. account,
  113. accountId
  114. } = data;
  115. if (!accountName && !account) {
  116. //没有填写交接人
  117. uni.showModal({
  118. title: "提示",
  119. content: "请填写交接人工号!",
  120. showCancel: false,
  121. success: function(res) {
  122. if (res.confirm) {
  123. console.log("用户点击确定");
  124. } else if (res.cancel) {
  125. console.log("用户点击取消");
  126. }
  127. },
  128. });
  129. return;
  130. } else if ((!accountName && account) || (accountName && !account)) {
  131. //没有填写交接人
  132. uni.showModal({
  133. title: "提示",
  134. content: "请填写正确的交接人工号!",
  135. showCancel: false,
  136. success: function(res) {
  137. if (res.confirm) {
  138. console.log("用户点击确定");
  139. } else if (res.cancel) {
  140. console.log("用户点击取消");
  141. }
  142. },
  143. });
  144. return;
  145. }
  146. this.hosModels.disjunctor = false;
  147. this.checkComplete(data);
  148. },
  149. // 填写交接人工号-取消
  150. hosCancel() {
  151. this.hosModels.disjunctor = false;
  152. this.flag = true;
  153. },
  154. // 填写交接人工号弹窗
  155. showSelectAccount() {
  156. this.hosModels = {
  157. content: "确定核对完成,请输入交接人员工号",
  158. disjunctor: true,
  159. };
  160. },
  161. checkComplete(accountObj){
  162. uni.showLoading({
  163. title: "加载中",
  164. mask: true,
  165. });
  166. let postData = {
  167. "type": "bloodTake",
  168. "orderId": 0,
  169. "bloodIds": this.bloodIds || undefined,
  170. };
  171. if (accountObj) {
  172. postData.handoverUser = accountObj.accountId;
  173. }
  174. post('/transflow/checkComplete', postData).then(res => {
  175. uni.hideLoading();
  176. if(res.state == 200){
  177. uni.navigateTo({
  178. url: `../receiptpage/receiptpage`,
  179. });
  180. }else{
  181. uni.showToast({
  182. icon: "none",
  183. title: res.msg || "接口获取数据失败!",
  184. });
  185. }
  186. })
  187. },
  188. // 返回
  189. goBack() {
  190. uni.navigateBack();
  191. },
  192. // 跳转血制品列表
  193. toDetail(data){
  194. uni.navigateTo({
  195. url: `../startOrderSignBloodDetail/startOrderSignBloodDetail?bloodIds=${data.bloodIds}&deptName=${data.dept}`,
  196. });
  197. },
  198. //获取页面信息
  199. getInfo(){
  200. uni.showLoading({
  201. title: "加载中",
  202. mask: true,
  203. });
  204. post('/transflow/scanInfo', {
  205. "code": "nb",
  206. "id": 0,
  207. "type": "bloodTake",
  208. "deptOrder": true,
  209. "deptId": this.queryObj.deptId,
  210. "taskTypeId": this.queryObj.taskTypeId,
  211. }).then(res => {
  212. uni.hideLoading();
  213. if(res.state == 200){
  214. this.orderIds = res.data.orderIds;
  215. this.dataList = res.data.data || [];
  216. this.deptTotalCount = this.dataList.length;
  217. this.bloodIds = this.dataList.reduce((pre, current) => pre + current.bloodIds + ',', '').slice(0, -1);
  218. this.patientTotalCount = this.dataList.reduce((pre, current) => pre + current.patientCount, 0);
  219. this.bloodTotalCount = this.dataList.reduce((pre, current) => pre + current.bloodCount, 0);
  220. }else{
  221. uni.showToast({
  222. icon: "none",
  223. title: res.msg || "接口获取数据失败!",
  224. });
  225. }
  226. })
  227. },
  228. },
  229. onLoad(options) {
  230. console.log(options, "result");
  231. this.queryObj = options;
  232. this.getInfo();
  233. // #ifdef APP-PLUS
  234. webHandle("no", "app");
  235. // #endif
  236. // #ifdef H5
  237. webHandle("no", "wx");
  238. // #endif
  239. },
  240. };
  241. </script>
  242. <style lang="less" scoped>
  243. .Scanning_Result {
  244. padding: 0 20rpx;
  245. display: flex;
  246. flex-direction: column;
  247. height: 100vh;
  248. .Scanning_top {
  249. .Scanning_top_icon {
  250. width: 140rpx;
  251. height: 140rpx;
  252. margin: 50rpx auto 40rpx;
  253. border-radius: 50%;
  254. .speNum{
  255. text-align: center;
  256. font-size: 140rpx;
  257. }
  258. .cubeic-ok {
  259. font-size: 140rpx;
  260. color: #35b34a;
  261. }
  262. .cubeic-close {
  263. font-size: 140rpx;
  264. color: #ff3b53;
  265. }
  266. }
  267. .Scanning_top_text {
  268. .text1 {
  269. font-size: 48rpx;
  270. text-align: center;
  271. }
  272. .success_tips {
  273. color: red;
  274. font-size: 30rpx;
  275. }
  276. }
  277. }
  278. .Scanning_cont {
  279. flex: 1;
  280. text-align: center;
  281. display: flex;
  282. flex-direction: column;
  283. .table_bodys{
  284. overflow-y: auto;
  285. flex: 1;
  286. }
  287. .table_head{
  288. display: flex;
  289. margin-top: 50rpx;
  290. .ml16{
  291. margin-left: 16rpx;
  292. }
  293. view {
  294. height: 110rpx;
  295. line-height: 1;
  296. flex: 1;
  297. font-weight: bold;
  298. color: #000;
  299. font-size: 38rpx;
  300. display: flex;
  301. justify-content: center;
  302. align-items: center;
  303. }
  304. }
  305. .table_body{
  306. background: #F3FAF7;
  307. border-radius: 8px;
  308. border: 1px solid #E9E9E9;
  309. display: flex;
  310. margin-bottom: 20rpx;
  311. padding: 30rpx 20rpx;
  312. view {
  313. line-height: 1;
  314. flex: 1;
  315. color: #555;
  316. font-size: 38rpx;
  317. display: flex;
  318. justify-content: center;
  319. align-items: center;
  320. word-break: break-all;
  321. }
  322. }
  323. }
  324. .foot_btn_spe {
  325. line-height: 64rpx;
  326. height: 64rpx;
  327. margin-bottom: 40rpx;
  328. text-align: center;
  329. display: flex;
  330. justify-content: space-between;
  331. view {
  332. height: 64rpx;
  333. flex: 1;
  334. margin: 0 1%;
  335. background-image: linear-gradient(to right, #72c172, #3bb197);
  336. color: #fff;
  337. border-radius: 8rpx;
  338. font-size: 26rpx;
  339. }
  340. }
  341. }
  342. </style>