specimenHandoverNew.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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 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 === 'checkType'">
  24. 项目名称<text class="red">({{typeList.patient.titleCount}})</text>
  25. </view>
  26. <view class="value" v-if="type === 'patient'">
  27. <view>
  28. 标本数量<text class="red">({{typeList.patient.count}})</text>
  29. </view>
  30. </view>
  31. <view class="value" v-if="type === 'checkType'">
  32. <view>
  33. 标本数量<text class="red">({{typeList.patient.count}})</text>
  34. </view>
  35. </view>
  36. </view>
  37. <scroll-view scroll-y="true" class="Scanning_cont_list_scroll">
  38. <view class="Scanning_cont_list_item" @click="clickRow(item)" v-for="(item, j) in dataList" :key="item.id">
  39. <view class="name">
  40. {{item.patientname}}
  41. </view>
  42. <view class="value">
  43. <view>
  44. {{item.count}}
  45. </view>
  46. </view>
  47. </view>
  48. </scroll-view>
  49. </view>
  50. </view>
  51. <view class="foot_btn">
  52. <view class="btn" @click="goBack()"> 取消 </view>
  53. <view class="btn" @click="onClick()"> 汇总交接 </view>
  54. </view>
  55. <!-- 填写数字弹窗 -->
  56. <selectNum v-if="numModels.disjunctor" :disjunctor="numModels.disjunctor" @ok="numOk" @cancel="numCancel" :content="numModels.content" :dataName="numModels.dataName">
  57. </selectNum>
  58. <!-- 弹窗 -->
  59. <showModel :title="models1.title" :icon="models1.icon" :disjunctor="models1.disjunctor" :content="models1.content"
  60. @ok="ok1" @cancel="cancel1" :operate="models1.operate"></showModel>
  61. </view>
  62. </template>
  63. <script>
  64. import {
  65. get,
  66. post,
  67. SM,
  68. webHandle
  69. } from "@/http/http.js";
  70. export default {
  71. data() {
  72. return {
  73. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  74. type: 'patient',//patient|checkType
  75. queryObj: {}, //路由传递过来的数据
  76. // 填写数字弹窗model
  77. numModels: {
  78. disjunctor: false,
  79. },
  80. typeList: {
  81. "patient": {
  82. id: -1,
  83. name: '患者标本',
  84. count: 0,
  85. titleCount: 0,
  86. },
  87. "checkType": {
  88. id: -2,
  89. name: '检验项目',
  90. count: 0,
  91. titleCount: 0,
  92. }
  93. },
  94. dataList: [],
  95. coopData: {},
  96. // 弹窗model
  97. models1: {
  98. disjunctor: false,
  99. },
  100. };
  101. },
  102. methods: {
  103. goBack(){
  104. uni.navigateBack();
  105. },
  106. clickTab(key){
  107. this.type = key;
  108. this.initData();
  109. },
  110. //确定
  111. ok1() {
  112. this.models1.disjunctor = false;
  113. let bussList = this.dataList.map(v => v.children).flat().map(v => v.clothesWashingDTO).map(v => ({...v, exception: 0}));
  114. uni.showLoading({
  115. title: "加载中",
  116. mask: true,
  117. });
  118. post("/transflow/createOrTakeOrder", {
  119. type: 'clothingGet',
  120. id: 0,
  121. startDeptId: this.queryObj.startDeptId,
  122. hosId: this.hosId,
  123. bussList,
  124. orderId: this.queryObj.orderId,
  125. }).then((res) => {
  126. uni.hideLoading();
  127. if (res.state == 200) {
  128. uni.showModal({
  129. title: "提示",
  130. content: "交接成功",
  131. showCancel: false,
  132. success: (result) => {
  133. if (result.confirm) {
  134. console.log("用户点击确定");
  135. uni.navigateTo({
  136. url: `/pages/receiptpage/receiptpage`,
  137. });
  138. }
  139. },
  140. });
  141. }else{
  142. uni.showToast({
  143. icon: "none",
  144. title: res.msg || "接口获取数据失败!",
  145. });
  146. }
  147. });
  148. },
  149. //取消
  150. cancel1() {
  151. this.models1.disjunctor = false;
  152. },
  153. // 被服回收弹窗
  154. showModel1() {
  155. let bussList = this.dataList.map(v => v.children).flat();
  156. let num = bussList.reduce((prev, current) => prev + current.clothesWashingDTO.recyclingNum, 0);
  157. this.models1 = {
  158. disjunctor: true,
  159. title: "提示",
  160. content: `<strong class="red">${this.queryObj.startDeptName}</strong>已与<strong class="red">${this.queryObj.name}</strong>交接<strong class="red">${num}件</strong>被服,交接人为<strong class="red">${this.queryObj.name}</strong>,您确认交接吗?`,
  161. icon: "warn",
  162. operate: {
  163. ok: "确定",
  164. cancel: "取消",
  165. },
  166. };
  167. },
  168. // 填写数量-确认
  169. numOk(data) {
  170. console.log(data);
  171. this.numModels.disjunctor = false;
  172. this.updateNum(data);
  173. },
  174. // 填写数量-取消
  175. numCancel() {
  176. this.numModels.disjunctor = false;
  177. },
  178. onClick(){
  179. this.showModel1();
  180. },
  181. clickRow(data){
  182. this.coopData = data;
  183. this.numModels = {
  184. disjunctor: true,
  185. content: `请输入被服数量`,
  186. dataName: data.name,
  187. };
  188. },
  189. updateNum(data){
  190. this.dataList.children.forEach(v => {
  191. if(v.id == this.coopData.id){
  192. v.clothesWashingDTO && (v.clothesWashingDTO.recyclingNum = data.num);
  193. }
  194. })
  195. },
  196. getInfo(type){
  197. uni.showLoading({
  198. title: "加载中",
  199. mask: true,
  200. });
  201. post("/workerOrder/ordersSpeInfo", {
  202. type,
  203. deptId: this.queryObj.deptId,
  204. orderIds: JSON.parse(this.queryObj.ids).toString(),
  205. }).then((result) => {
  206. uni.hideLoading();
  207. if (result.state == 200) {
  208. this.typeList[type].count = result.count;
  209. this.typeList[type].titleCount = result.title;
  210. if(this.type === type){
  211. this.dataList = result.data || [];
  212. }
  213. } else {
  214. uni.showToast({
  215. icon: "none",
  216. title: result.msg || "接口获取数据失败!",
  217. });
  218. }
  219. });
  220. },
  221. initData(){
  222. this.getInfo('patient');
  223. this.getInfo('checkType');
  224. },
  225. },
  226. onLoad(options) {
  227. console.log(options, "result");
  228. this.queryObj = options;
  229. this.initData();
  230. // #ifdef APP-PLUS
  231. webHandle("no", "app");
  232. // #endif
  233. // #ifdef H5
  234. webHandle("no", "wx");
  235. // #endif
  236. },
  237. };
  238. </script>
  239. <style lang="less" scoped>
  240. .Scanning_Result {
  241. height: 100vh;
  242. display: flex;
  243. flex-direction: column;
  244. background-color: #fafbfd;
  245. .Scanning_top {
  246. flex-shrink: 0;
  247. .Scanning_top_icon {
  248. padding-top: 26rpx;
  249. display: flex;
  250. justify-content: center;
  251. align-items: center;
  252. .cubeic-ok {
  253. font-size: 58rpx;
  254. color: #35b34a;
  255. }
  256. .text1 {
  257. font-size: 48rpx;
  258. font-weight: bold;
  259. }
  260. }
  261. .Scanning_top_text{
  262. text-align: center;
  263. font-size: 28rpx;
  264. font-weight: bold;
  265. padding: 8rpx 0 23rpx 0;
  266. }
  267. }
  268. .Scanning_cont {
  269. flex: 1;
  270. min-height: 0;
  271. display: flex;
  272. flex-direction: column;
  273. width: 710rpx;
  274. margin: 0 20rpx;
  275. background-color: #fff;
  276. .Scanning_cont_head{
  277. flex-shrink: 0;
  278. height: 78rpx;
  279. display: flex;
  280. border-top: 1rpx solid #EEEEEE;
  281. border-bottom: 1rpx solid #EEEEEE;
  282. .Scanning_cont_head_item{
  283. flex: 1;
  284. font-size: 28rpx;
  285. font-weight: bold;
  286. display: flex;
  287. justify-content: center;
  288. align-items: center;
  289. position: relative;
  290. &.active{
  291. color: #49B856;
  292. &::before{
  293. content: '';
  294. width: 70rpx;
  295. height: 10rpx;
  296. background-color: #49B856;
  297. position: absolute;
  298. left: 50%;
  299. bottom: 0;
  300. transform: translateX(-50%);
  301. border-radius: 6rpx;
  302. }
  303. }
  304. &::after{
  305. content: '';
  306. width: 2rpx;
  307. height: 44rpx;
  308. background-color: #D1D1D1;
  309. position: absolute;
  310. right: 0;
  311. top: 50%;
  312. transform: translateY(-50%);
  313. }
  314. &:last-of-type::after{
  315. opacity: 0;
  316. }
  317. }
  318. }
  319. .Scanning_cont_list{
  320. flex: 1;
  321. min-height: 0;
  322. display: flex;
  323. flex-direction: column;
  324. .Scanning_cont_list_scroll{
  325. flex: 1;
  326. min-height: 0;
  327. }
  328. .Scanning_cont_list_item{
  329. height: 70rpx;
  330. display: flex;
  331. align-items: center;
  332. font-size: 28rpx;
  333. border-bottom: 1rpx solid #CCCCCC;
  334. &.Scanning_cont_list_head{
  335. font-weight: bold;
  336. font-size: 28rpx;
  337. border-bottom: none;
  338. flex-shrink: 0;
  339. }
  340. .name,
  341. .value{
  342. padding: 0 40rpx;
  343. flex: 1;
  344. }
  345. .value {
  346. view{
  347. width: 7em;
  348. text-align: center;
  349. }
  350. }
  351. }
  352. }
  353. }
  354. .foot_btn {
  355. flex-shrink: 0;
  356. line-height: 66rpx;
  357. display: flex;
  358. justify-content: center;
  359. .btn {
  360. height: 66rpx;
  361. flex: 1;
  362. margin-right: 1%;
  363. background-image: linear-gradient(to right, #72c172, #3bb197);
  364. color: #fff;
  365. border-radius: 8rpx;
  366. font-size: 28rpx;
  367. text-align: center;
  368. &:last-of-type{
  369. margin-right: 0;
  370. }
  371. }
  372. }
  373. }
  374. </style>