quiltWashingGetSignIn.vue 13 KB

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