dialog-turnoverTask.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <dialog-base class="dialog-body" ref="baseDialog" title="周转任务">
  3. <view class="list-item">
  4. <view v-for="(item, index) in confirmTurnoverList" :key="index">
  5. <view class="list-title uni-row"><text class="label">{{ item['preDeptName'] }}</text>
  6. <text class="label">→</text>
  7. <text class="label">{{ item['deptName'] }}</text>
  8. </view>
  9. <view class="list-container">
  10. <view class="list-container-item uni-row">
  11. <text class="label">批次</text>
  12. <text class="label value">{{item['lotCode']}}</text>
  13. </view>
  14. <view class="list-container-item uni-row">
  15. <text class="label">箱数</text>
  16. <text class="label value">{{item['carriers']}}</text>
  17. </view>
  18. <view class="list-container-item uni-row">
  19. <text class="label">数量</text>
  20. <text class="label value">{{item['daywork'].temporaryProcessQualifiedNum}}</text>
  21. </view>
  22. <view class="list-container-item uni-row">
  23. <text class="label">箱号</text>
  24. <text class="label value">{{item['carrierName']}}</text>
  25. </view>
  26. <view class="list-container-item uni-row">
  27. <text class="label">申请时间</text>
  28. <text class="label value">{{item['startTime']}}</text>
  29. </view>
  30. <view class="list-container-item uni-row">
  31. <text class="label">申请人</text>
  32. <text class="label value">{{item['nickName']}}</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="add-btn-container uni-row">
  38. <button type="primary" class="btn" @click="handleConfirmDelivery">确认周转</button>
  39. </view>
  40. </dialog-base>
  41. </template>
  42. <script setup>
  43. import {
  44. ref,
  45. getCurrentInstance
  46. } from 'vue'
  47. import {
  48. onLoad
  49. } from '@dcloudio/uni-app'
  50. import { updateDayWorkItemBatch } from '@/api/business/dayWorkItem.js'
  51. const baseDialog = ref(null)
  52. const confirmTurnoverList = ref([])
  53. function open(data) {
  54. confirmTurnoverList.value = data
  55. baseDialog.value.open()
  56. }
  57. function close(data) {
  58. baseDialog.value.close()
  59. }
  60. defineExpose({
  61. open
  62. })
  63. function handleConfirmDelivery() {
  64. close();
  65. // 设置周转状态
  66. for (let i = 0; i < confirmTurnoverList.value.length; i++) {
  67. confirmTurnoverList.value[i].status = confirmTurnoverList.value[i].status ='5';
  68. }
  69. console.log(confirmTurnoverList.value)
  70. updateDayWorkItemBatch(confirmTurnoverList.value).then(res => {
  71. if (res.code === 200) {
  72. uni.showToast({
  73. icon: 'success',
  74. title: '操作成功',
  75. duration: 2000
  76. });
  77. uni.navigateBack({delta: 1});
  78. } else {
  79. uni.showToast({
  80. icon: 'none',
  81. title: '操作失败',
  82. duration: 2000
  83. });
  84. }
  85. })
  86. uni.$emit('clearListData')
  87. }
  88. </script>
  89. <style lang="scss">
  90. .dialog-body {
  91. .list-title {
  92. margin: 40rpx 0 20rpx 0;
  93. .label {
  94. padding-right: 40rpx;
  95. font-size: 32rpx;
  96. font-weight: bold;
  97. }
  98. }
  99. .list-item {
  100. overflow: auto;
  101. height: 700rpx;
  102. }
  103. .list-container {
  104. width: 100%;
  105. display: flex;
  106. align-items: flex-start;
  107. padding: 0 4rpx;
  108. .list-container-item {
  109. width: 100%;
  110. padding: 12rpx 8rpx;
  111. align-items: center;
  112. .label {
  113. font-size: 28rpx;
  114. color: gray;
  115. width: 144rpx;
  116. &.value {
  117. flex: 1;
  118. color: #000000;
  119. }
  120. }
  121. }
  122. }
  123. .add-btn-container {
  124. margin-top: 32rpx;
  125. .btn {
  126. flex: 1;
  127. }
  128. }
  129. }
  130. </style>