packingBom.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <template>
  2. <view>
  3. <view class="material ">
  4. <view class="title_box rx-bc">
  5. <view class="name">外包装</view>
  6. </view>
  7. <!-- 外包装 列表-->
  8. <view class="content_table2" v-if="objData.packingReportList.length> 0">
  9. <view class="head row rx-sc">
  10. <view class="item ww10">序号</view>
  11. <view class="item ww30">数量</view>
  12. <view class="item ww50">条码</view>
  13. <view class="item ww10 selectAll" @click="handOneCheck">{{ oneCheck ? '取消' : '全选'}}</view>
  14. </view>
  15. <view class="table">
  16. <view class="tr row rx-sc " v-for="(it, idx) in objData.packingReportList" :key='idx' @click="handleCheck(idx, it)">
  17. <view class="item ww10 rx-cc ">{{ idx + 1 }}</view>
  18. <view class="item ww30 content_num rx-sc">
  19. {{it.packingNum}} / {{ it.unit }} {{it.quantity}}/ {{ it.childList[0].unit }}
  20. </view>
  21. <view class="item ww50">
  22. {{ it.code }}
  23. </view>
  24. <view class="item ww10 rx-cc" >
  25. <image class="check" v-if='it.check' src='@/static/check.png'>
  26. </image>
  27. <image class="check" v-if=' !it.check' src='@/static/check_no.png'>
  28. </image>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="material ">
  35. <view class="title_box rx-bc">
  36. <view class="name">内包装</view>
  37. </view>
  38. <view class="content_table2" v-if='objData.packingReportMarginList.length'>
  39. <view class="head row rx-sc">
  40. <view class="item ww10">序号</view>
  41. <view class="item ww30">数量</view>
  42. <view class="item ww50">条码</view>
  43. <view class="item ww10 selectAll" @click="handTwoCheck">{{ twoCheck ? '取消' : '全选'}}</view>
  44. </view>
  45. <view class="table">
  46. <u-list @scrolltolower="scrolltolower" class="z_list">
  47. <view class="tr row rx-sc" v-for="(it, idx) in objData.packingReportMarginList" :key='idx' @click="handleCheckTwo(idx, it)">
  48. <view class="item ww10 rx-cc ">{{ it.computeSize }}</view>
  49. <view class="item ww30 content_num rx-sc">
  50. <view>{{ it.quantity }}/ {{it.unit}} </view>
  51. </view>
  52. <view class="item ww50">
  53. {{ it.code }}
  54. </view>
  55. <view class="item ww10 rx-cc" >
  56. <image class="check" v-if='it.check' src='@/static/check.png'>
  57. </image>
  58. <image class="check" v-if=' !it.check' src='@/static/check_no.png'>
  59. </image>
  60. </view>
  61. </view>
  62. </u-list>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. props: {
  71. objData: {
  72. type: Object,
  73. default: () => {}
  74. },
  75. },
  76. data() {
  77. return {
  78. oneCheck: false,
  79. twoCheck: false,
  80. }
  81. },
  82. created() {
  83. },
  84. methods: {
  85. handOneCheck() {
  86. if (this.oneCheck) {
  87. this.oneCheck = false
  88. this.objData.packingReportList.forEach(e => {
  89. e.check = false
  90. })
  91. } else {
  92. this.oneCheck = true
  93. this.objData.packingReportList.forEach(e => {
  94. e.check = true
  95. })
  96. }
  97. this.$forceUpdate()
  98. },
  99. handleCheck(idx, it) {
  100. this.$set(this.objData.packingReportList[idx], 'check', !it.check)
  101. this.$forceUpdate()
  102. },
  103. handTwoCheck() {
  104. if (this.twoCheck) {
  105. this.twoCheck = false
  106. this.objData.packingReportMarginList.forEach(e => {
  107. e.check = false
  108. })
  109. } else {
  110. this.twoCheck = true
  111. this.objData.packingReportMarginList.forEach(e => {
  112. e.check = true
  113. })
  114. }
  115. this.$forceUpdate()
  116. },
  117. handleCheckTwo(idx, it) {
  118. this.$set(this.objData.packingReportMarginList[idx], 'check', !it.check)
  119. this.$forceUpdate()
  120. },
  121. scrolltolower() {
  122. },
  123. },
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. .title_box {
  128. margin-top: 20rpx;
  129. .name {
  130. font-size: 28rpx;
  131. font-style: normal;
  132. font-weight: 400;
  133. color: $theme-color;
  134. padding-left: 20rpx;
  135. position: relative;
  136. &:before {
  137. position: absolute;
  138. content: '';
  139. left: 0rpx;
  140. top: 0rpx;
  141. bottom: 0rpx;
  142. width: 4rpx;
  143. height: 28rpx;
  144. background: $theme-color;
  145. margin: auto;
  146. }
  147. }
  148. }
  149. .material {
  150. margin-top: 10rpx;
  151. }
  152. .content_table2 {
  153. width: 100%;
  154. margin-top: 16rpx;
  155. .row {
  156. width: 100%;
  157. .item {
  158. color: #404446;
  159. font-size: 28rpx;
  160. padding-left: 12rpx;
  161. }
  162. .color157 {
  163. color: $theme-color;
  164. }
  165. .ww30 {
  166. width: 30%;
  167. }
  168. .ww50 {
  169. width: 50%;
  170. }
  171. .ww90 {
  172. width: 90%;
  173. }
  174. .ww15 {
  175. width: 15%;
  176. }
  177. .ww10 {
  178. width: 10%;
  179. }
  180. .ww30 {
  181. width: 30%;
  182. }
  183. }
  184. .head {
  185. height: 64rpx;
  186. background: #F7F9FA;
  187. border-top: 2rpx solid #E3E5E5;
  188. border-left: 2rpx solid #E3E5E5;
  189. .item {
  190. height: 64rpx;
  191. line-height: 64rpx;
  192. border-right: 2rpx solid #E3E5E5;
  193. box-sizing: border-box;
  194. }
  195. .selectAll {
  196. color: $theme-color;
  197. font-size: 24rpx;
  198. }
  199. }
  200. .tr {
  201. border-top: 2rpx solid #E3E5E5;
  202. border-left: 2rpx solid #E3E5E5;
  203. .item {
  204. font-size: 24rpx;
  205. min-height: 64rpx;
  206. display: flex;
  207. align-items: center;
  208. border-right: 2rpx solid #E3E5E5;
  209. box-sizing: border-box;
  210. white-space: normal;
  211. word-break: break-all;
  212. }
  213. &:last-child {
  214. border-bottom: 2rpx solid #E3E5E5;
  215. }
  216. }
  217. }
  218. .content_num {
  219. display: flex;
  220. align-items: center;
  221. padding: 0 4rpx;
  222. /deep/ .uni-input-input {
  223. border: 2rpx solid #F0F8F2;
  224. background: #F0F8F2;
  225. color: $theme-color;
  226. }
  227. }
  228. .penalize {
  229. width: 86rpx;
  230. line-height: 60rpx;
  231. background: $theme-color;
  232. font-size: 24rpx;
  233. text-align: center;
  234. color: #fff;
  235. }
  236. .check {
  237. width: 30rpx;
  238. height: 30rpx;
  239. }
  240. .z_list {
  241. max-height: 300rpx;
  242. }
  243. </style>