quiltWashingGetSignIn.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. <template>
  2. <view class="Scanning_Result">
  3. <view class="Scanning_top">
  4. <view class="Scanning_top_icon">
  5. <text class="cubeic-ok newicon newicon-duigou"></text>
  6. <view class="text1"> 签到成功 </view>
  7. </view>
  8. <view class="Scanning_top_text">
  9. 您已到达{{queryObj.startDeptName}},请核对填写以下物品数量
  10. </view>
  11. </view>
  12. <view class="Scanning_cont">
  13. <view class="Scanning_cont_head">
  14. <view class="Scanning_cont_head_item" :class="{active: parentIndex == i}" v-for="(item, i) in dataList" :key="item.id" @click="parentIndex = i">
  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">
  21. 被服类型
  22. </view>
  23. <view class="value">
  24. <view>
  25. 被服数量
  26. </view>
  27. </view>
  28. </view>
  29. <scroll-view scroll-y="true" class="Scanning_cont_list_scroll" v-if="dataList[parentIndex]">
  30. <view class="Scanning_cont_list_item" @click="clickRow(item)" v-for="(item, j) in dataList[parentIndex].children" :key="item.id">
  31. <view class="name">
  32. {{item.name}}
  33. </view>
  34. <view class="value">
  35. <view>
  36. {{item.clothesWashingDTO ? item.clothesWashingDTO.recyclingNum : ''}}
  37. </view>
  38. </view>
  39. </view>
  40. </scroll-view>
  41. </view>
  42. </view>
  43. <view class="foot_btn">
  44. <view class="btn" @click="onClick()"> 汇总交接 </view>
  45. </view>
  46. <!-- 填写数字弹窗 -->
  47. <selectNum v-if="numModels.disjunctor" :disjunctor="numModels.disjunctor" @ok="numOk" @cancel="numCancel" :content="numModels.content" :dataName="numModels.dataName">
  48. </selectNum>
  49. <!-- 弹窗 -->
  50. <showModel :title="models1.title" :icon="models1.icon" :disjunctor="models1.disjunctor" :content="models1.content"
  51. @ok="ok1" @cancel="cancel1" :operate="models1.operate"></showModel>
  52. <!-- 弹窗 -->
  53. <showModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor" :content="models2.content"
  54. @ok="ok2" @cancel="cancel2" :operate="models2.operate"></showModel>
  55. </view>
  56. </template>
  57. <script>
  58. import {
  59. get,
  60. post,
  61. SM,
  62. webHandle
  63. } from "../../../http/http.js";
  64. export default {
  65. data() {
  66. return {
  67. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  68. queryObj: {}, //路由传递过来的数据
  69. // 填写数字弹窗model
  70. numModels: {
  71. disjunctor: false,
  72. },
  73. dataList: [],
  74. parentIndex: 0,
  75. coopData: {},
  76. // 弹窗model
  77. models1: {
  78. disjunctor: false,
  79. },
  80. // 弹窗model
  81. models2: {
  82. disjunctor: false,
  83. },
  84. };
  85. },
  86. methods: {
  87. //确定
  88. ok2() {
  89. this.models2.disjunctor = false;
  90. let bussList = this.dataList.map(v => v.children).flat().map(v => v.clothesWashingDTO).map(v => ({...v, exception: 0, recyclingNum: 0,}));
  91. uni.showLoading({
  92. title: "加载中",
  93. mask: true,
  94. });
  95. post("/transflow/createOrTakeOrder", {
  96. type: 'clothingGet',
  97. id: 0,
  98. startDeptId: this.queryObj.startDeptId,
  99. hosId: this.hosId,
  100. bussList,
  101. orderId: this.queryObj.orderId,
  102. handoverId: this.queryObj.nameId || undefined,
  103. }).then((res) => {
  104. uni.hideLoading();
  105. if (res.state == 200) {
  106. uni.showModal({
  107. title: "提示",
  108. content: "交接成功",
  109. showCancel: false,
  110. success: (result) => {
  111. if (result.confirm) {
  112. console.log("用户点击确定");
  113. uni.navigateTo({
  114. url: `../../receiptpage/receiptpage`,
  115. });
  116. }
  117. },
  118. });
  119. }else{
  120. uni.showToast({
  121. icon: "none",
  122. title: res.msg || "接口获取数据失败!",
  123. });
  124. }
  125. });
  126. },
  127. //取消
  128. cancel2() {
  129. this.models2.disjunctor = false;
  130. },
  131. // 弹窗
  132. showModel2() {
  133. this.models2 = {
  134. disjunctor: true,
  135. title: "提示",
  136. content: `<strong class="red">${this.queryObj.startDeptName}</strong>无需填写回收数量,您确认吗?`,
  137. icon: "warn",
  138. operate: {
  139. ok: "确定",
  140. cancel: "取消",
  141. },
  142. };
  143. },
  144. //确定
  145. ok1() {
  146. this.models1.disjunctor = false;
  147. let bussList = this.dataList.map(v => v.children).flat().map(v => v.clothesWashingDTO).map(v => ({...v, exception: 0}));
  148. uni.showLoading({
  149. title: "加载中",
  150. mask: true,
  151. });
  152. post("/transflow/createOrTakeOrder", {
  153. type: 'clothingGet',
  154. id: 0,
  155. startDeptId: this.queryObj.startDeptId,
  156. hosId: this.hosId,
  157. bussList,
  158. orderId: this.queryObj.orderId,
  159. handoverId: this.queryObj.nameId || undefined,
  160. }).then((res) => {
  161. uni.hideLoading();
  162. if (res.state == 200) {
  163. uni.showModal({
  164. title: "提示",
  165. content: "交接成功",
  166. showCancel: false,
  167. success: (result) => {
  168. if (result.confirm) {
  169. console.log("用户点击确定");
  170. uni.navigateTo({
  171. url: `../../receiptpage/receiptpage`,
  172. });
  173. }
  174. },
  175. });
  176. }else{
  177. uni.showToast({
  178. icon: "none",
  179. title: res.msg || "接口获取数据失败!",
  180. });
  181. }
  182. });
  183. },
  184. //取消
  185. cancel1() {
  186. this.models1.disjunctor = false;
  187. },
  188. // 被服回收弹窗
  189. showModel1() {
  190. let bussList = this.dataList.map(v => v.children).flat();
  191. let num = bussList.reduce((prev, current) => prev + current.clothesWashingDTO.recyclingNum, 0);
  192. let content = '';
  193. if(this.queryObj.name){
  194. 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>,您确认交接吗?`;
  195. }else{
  196. content = `<strong class="red">${this.queryObj.startDeptName}</strong>已交接<strong class="red">${num}件</strong>被服,您确认交接吗?`;
  197. }
  198. this.models1 = {
  199. disjunctor: true,
  200. title: "提示",
  201. content,
  202. icon: "warn",
  203. operate: {
  204. ok: "确定",
  205. cancel: "取消",
  206. },
  207. };
  208. },
  209. // 填写数量-确认
  210. numOk(data) {
  211. console.log(data);
  212. this.numModels.disjunctor = false;
  213. this.updateNum(data);
  214. },
  215. // 填写数量-取消
  216. numCancel() {
  217. this.numModels.disjunctor = false;
  218. },
  219. onClick(){
  220. this.showModel1();
  221. },
  222. clickRow(data){
  223. this.coopData = data;
  224. this.numModels = {
  225. disjunctor: true,
  226. content: `请输入被服数量`,
  227. dataName: data.name,
  228. };
  229. },
  230. updateNum(data){
  231. this.dataList[this.parentIndex].children.forEach(v => {
  232. if(v.id == this.coopData.id){
  233. v.clothesWashingDTO && (v.clothesWashingDTO.recyclingNum = data.num);
  234. }
  235. })
  236. },
  237. getInfo(){
  238. uni.showLoading({
  239. title: "加载中",
  240. mask: true,
  241. });
  242. post("/transflow/scanInfo", {
  243. type: 'clothingGet',
  244. hosId: this.hosId,
  245. startDeptId: this.queryObj.startDeptId,
  246. code: this.queryObj.quiltCode,
  247. orderId: this.queryObj.orderId,
  248. }).then((result) => {
  249. uni.hideLoading();
  250. if (result.state == 200) {
  251. let dataList = result.data.treeList || [];
  252. this.dataList = dataList.slice(0, 3);
  253. } else {
  254. uni.showToast({
  255. icon: "none",
  256. title: result.msg || "接口获取数据失败!",
  257. });
  258. }
  259. });
  260. },
  261. getNoFillInQuantityIds(){
  262. uni.showLoading({
  263. title: "加载中",
  264. mask: true,
  265. });
  266. post("/simple/data/fetchDataList/taskTypeConfig", {
  267. "idx": 0,
  268. "sum": 10,
  269. "taskTypeConfig": {
  270. "taskTypeDTO": {
  271. "hosId": {
  272. "id": this.hosId
  273. },
  274. "ordinaryField": {
  275. "key": "ordinary_field",
  276. "value": "clothingGet"
  277. }
  278. }
  279. }
  280. }).then((result) => {
  281. uni.hideLoading();
  282. if (result.status == 200) {
  283. let dataList = result.list || [];
  284. if(dataList.length){
  285. let flag = dataList[0].noFillInQuantityIds.split(',').includes(this.queryObj.startDeptId);
  286. if(flag){
  287. this.showModel2();
  288. }
  289. }
  290. } else {
  291. uni.showToast({
  292. icon: "none",
  293. title: result.msg || "接口获取数据失败!",
  294. });
  295. }
  296. });
  297. },
  298. },
  299. onLoad(options) {
  300. console.log(options, "result");
  301. this.queryObj = options;
  302. this.getInfo();
  303. this.getNoFillInQuantityIds();
  304. // #ifdef APP-PLUS
  305. webHandle("no", "app");
  306. // #endif
  307. // #ifdef H5
  308. webHandle("no", "wx");
  309. // #endif
  310. },
  311. };
  312. </script>
  313. <style lang="less" scoped>
  314. .Scanning_Result {
  315. height: 100vh;
  316. display: flex;
  317. flex-direction: column;
  318. background-color: #fafbfd;
  319. .Scanning_top {
  320. flex-shrink: 0;
  321. .Scanning_top_icon {
  322. padding-top: 26rpx;
  323. display: flex;
  324. justify-content: center;
  325. align-items: center;
  326. .cubeic-ok {
  327. font-size: 58rpx;
  328. color: #35b34a;
  329. }
  330. .text1 {
  331. font-size: 48rpx;
  332. font-weight: bold;
  333. }
  334. }
  335. .Scanning_top_text{
  336. text-align: center;
  337. font-size: 28rpx;
  338. font-weight: bold;
  339. padding: 8rpx 0 23rpx 0;
  340. }
  341. }
  342. .Scanning_cont {
  343. flex: 1;
  344. min-height: 0;
  345. display: flex;
  346. flex-direction: column;
  347. width: 710rpx;
  348. margin: 0 20rpx;
  349. background-color: #fff;
  350. .Scanning_cont_head{
  351. flex-shrink: 0;
  352. height: 78rpx;
  353. display: flex;
  354. border-top: 1rpx solid #EEEEEE;
  355. border-bottom: 1rpx solid #EEEEEE;
  356. .Scanning_cont_head_item{
  357. flex: 1;
  358. font-size: 32rpx;
  359. font-weight: bold;
  360. display: flex;
  361. justify-content: center;
  362. align-items: center;
  363. position: relative;
  364. &.active{
  365. color: #49B856;
  366. &::before{
  367. content: '';
  368. width: 70rpx;
  369. height: 10rpx;
  370. background-color: #49B856;
  371. position: absolute;
  372. left: 50%;
  373. bottom: 0;
  374. transform: translateX(-50%);
  375. border-radius: 6rpx;
  376. }
  377. }
  378. &::after{
  379. content: '';
  380. width: 2rpx;
  381. height: 44rpx;
  382. background-color: #D1D1D1;
  383. position: absolute;
  384. right: 0;
  385. top: 50%;
  386. transform: translateY(-50%);
  387. }
  388. &:last-of-type::after{
  389. opacity: 0;
  390. }
  391. }
  392. }
  393. .Scanning_cont_list{
  394. flex: 1;
  395. min-height: 0;
  396. display: flex;
  397. flex-direction: column;
  398. .Scanning_cont_list_scroll{
  399. flex: 1;
  400. min-height: 0;
  401. }
  402. .Scanning_cont_list_item{
  403. height: 70rpx;
  404. display: flex;
  405. align-items: center;
  406. font-size: 28rpx;
  407. border: 1rpx solid #272727;
  408. border-top: none;
  409. &.Scanning_cont_list_head{
  410. font-weight: bold;
  411. font-size: 28rpx;
  412. border-top: 1rpx solid #272727;
  413. flex-shrink: 0;
  414. }
  415. .name,
  416. .value{
  417. padding: 0 40rpx;
  418. flex: 1;
  419. display: flex;
  420. align-items: center;
  421. height: 100%;
  422. border-right: 1rpx solid #272727;
  423. }
  424. .value {
  425. view{
  426. width: 4em;
  427. text-align: center;
  428. }
  429. }
  430. }
  431. }
  432. }
  433. .foot_btn {
  434. flex-shrink: 0;
  435. line-height: 88rpx;
  436. display: flex;
  437. justify-content: center;
  438. .btn {
  439. height: 88rpx;
  440. flex: 1;
  441. margin-right: 1%;
  442. background-image: linear-gradient(to right, #72c172, #3bb197);
  443. color: #fff;
  444. border-radius: 8rpx;
  445. font-size: 28rpx;
  446. text-align: center;
  447. &:last-of-type{
  448. margin-right: 0;
  449. }
  450. }
  451. }
  452. }
  453. </style>