dialog-lotReporting.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <dialog-base class="dialog-body" ref="baseDialog" title="添加批次报工">
  3. <view style="overflow: auto;height: 800rpx;">
  4. <view v-for="(item, index) in lotData" :key="index" class="list-item">
  5. <view class="item-info uni-row">
  6. <text class="label">批次号</text>
  7. <text class="label right">{{ item['lotCode'] }}</text>
  8. </view>
  9. <view class="item-info uni-row">
  10. <text class="label">生产计划单号</text>
  11. <text class="label right">{{ item['productionPlanNo'] }}</text>
  12. </view>
  13. <view class="item-info uni-row">
  14. <text class="label">产品描述</text>
  15. <text class="label right">{{ item['productDescription'] }}</text>
  16. </view>
  17. <view class="item-info uni-row">
  18. <text class="label">箱号</text>
  19. <text class="label right">{{ item['carrierName'] }}</text>
  20. </view>
  21. <view class="item-info uni-row">
  22. <text class="label">下道工序</text>
  23. <view class="label right uni-row">{{ item['nextProcess'] ? item['nextProcess'].processAlias : '-' }}
  24. (<view style="color: #1684fc;" @click.stop="handleClickProcessList(item)">&nbsp;工艺列表&nbsp;
  25. </view>)
  26. </view>
  27. </view>
  28. <view class='middle'>
  29. <view class='segment'></view>
  30. <uni-icons type="paperclip" size="30" style="margin: 10rpx;"></uni-icons>
  31. <view class='segment'></view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="list-item">
  36. <view class="item-info uni-row">
  37. <text class="label">下序车间</text>
  38. <uni-data-select v-model="curDaywork.workshopId" :localdata="workshopList"
  39. @change="handleChangeWorkshop" :clear="false"
  40. style="outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
  41. </view>
  42. <view class="item-info uni-row">
  43. <text class="label">下序工段</text>
  44. <uni-data-select v-model="curDaywork.deptId" :localdata="deptList" :clear="false"
  45. style="outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
  46. </view>
  47. </view>
  48. <!-- 抽屉 -->
  49. <view>
  50. </view>
  51. <view style="z-index: 99999;">
  52. <uni-drawer ref="showRight" mode="right" :mask-click="true">
  53. <view class="scroll-view">
  54. <scroll-view class="scroll-view-box" style="height:100%;">
  55. <view style="width: 100%;text-align: center;;font-size: 48rpx;margin: 48rpx 0 24rpx 0;">工艺列表
  56. </view>
  57. <view style="font-size: 24rpx;width: 100%;text-align: center;color: red;margin-bottom: 48rpx;">
  58. 仅显示当前工序后面工艺</view>
  59. <view class="info-content" v-for="(item,index) in curProcessAfte" :key="index"
  60. style="width: 100%;margin: 8rpx 0 8rpx 14%;">
  61. <text>{{ index + 1 }}.{{item.processAlias}}</text>
  62. </view>
  63. </scroll-view>
  64. </view>
  65. </uni-drawer>
  66. </view>
  67. <view class="add-btn-container uni-row">
  68. <button type="default" class="leftBtn" @click="handleFinishScan">结束扫码</button>
  69. <button type="default" class="rightBtn" @click="handleContinueScan">继续扫码</button>
  70. </view>
  71. </dialog-base>
  72. </template>
  73. <script setup>
  74. import {
  75. ref,
  76. getCurrentInstance
  77. } from 'vue'
  78. import {
  79. getDictInfoByType
  80. } from '@/api/dict/dict.js'
  81. const baseDialog = ref(null)
  82. const lotData = ref(null)
  83. const curDaywork = ref({})
  84. const workshopList = ref([])
  85. const curProcessAfte = ref([])
  86. const deptList = ref([])
  87. const showRight = ref(null) // 抽屉
  88. function open(data) {
  89. lotData.value = data
  90. baseDialog.value.open()
  91. workshopList.value = [{
  92. value: '1762872520725155842',
  93. text: '一号车间'
  94. },
  95. {
  96. value: '1762874510792380417',
  97. text: '二三车间'
  98. }
  99. ];
  100. deptList.value = [{
  101. value: 11,
  102. text: '热处理'
  103. }];
  104. init()
  105. }
  106. function init() {
  107. //查询车间
  108. }
  109. function handleClickProcessList(item) {
  110. let curProcessAfterList = [{
  111. processAlias: '下料'
  112. }, {
  113. processAlias: '大切断'
  114. }, {
  115. processAlias: '分选'
  116. }, {
  117. processAlias: '下料'
  118. }, {
  119. processAlias: '大切断'
  120. }, {
  121. processAlias: '分选'
  122. }];
  123. // let nextIndex = 0;
  124. // for (let i = 0; i < item.processSequence.length; i++) {
  125. // if (item.nextProcess.id == item.processSequence[i].id) {
  126. // nextIndex = i;
  127. // }
  128. // }
  129. // for (let i = 0; i < item.processSequence.length; i++) {
  130. // if (i >= nextIndex) {
  131. // curProcessAfterList.push(item.processSequence[i]);
  132. // }
  133. // }
  134. // console.log(curProcessAfterList)
  135. curProcessAfte.value = curProcessAfterList;
  136. showRight.value.open();
  137. }
  138. //切换车间
  139. function handleChangeWorkshop() {}
  140. //结束扫码
  141. function handleFinishScan() {
  142. }
  143. //继续扫码
  144. function handleContinueScan() {
  145. }
  146. function close() {
  147. baseDialog.value.close()
  148. }
  149. defineExpose({
  150. open
  151. })
  152. </script>
  153. <style lang="scss">
  154. .dialog-body {
  155. // height: 60%;
  156. // margin: auto auto;
  157. overflow: auto;
  158. }
  159. .item-info {
  160. margin: 8rpx;
  161. .label {
  162. font-size: 28rpx;
  163. width: 220rpx;
  164. color: #808080;
  165. &.right {
  166. flex: 1;
  167. color: #000000;
  168. }
  169. }
  170. }
  171. .middle {
  172. display: flex;
  173. flex-direction: row;
  174. align-items: center;
  175. justify-content: center
  176. }
  177. .segment {
  178. width: 280rpx;
  179. background-color: rgba(213, 213, 213, 1);
  180. border: 1rpx solid rgba(213, 213, 213, 1);
  181. }
  182. .middle {
  183. display: flex;
  184. flex-direction: row;
  185. align-items: center;
  186. justify-content: center
  187. }
  188. .segment {
  189. width: 80rpx;
  190. background-color: rgba(213, 213, 213, 1);
  191. border: 1rpx solid rgba(213, 213, 213, 1);
  192. }
  193. .add-btn-container {
  194. margin-top: 32rpx;
  195. .leftBtn {
  196. flex: 1;
  197. background-color: rgb(164, 173, 179);
  198. color: #FFFFFF;
  199. }
  200. .rightBtn {
  201. flex: 1;
  202. margin-left: 24rpx;
  203. background-color: rgb(91, 214, 165);
  204. color: #FFFFFF;
  205. }
  206. }
  207. </style>