packingBom.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <view>
  3. <view class="col userInp " style="display: flex; align-items: center;border: 1px solid #E3E5E5">
  4. <text class="label lable150 rx-cc" style="border-right: 1px solid #E3E5E5;">规格名称:</text>
  5. <!-- multiple -->
  6. <view style="padding-left: 5rpx;">{{ specText }}</view>
  7. </view>
  8. <view v-for="(item, i) in list" :key="i">
  9. <view class="title_box rx-bc">
  10. <view class="name">{{ item.title }}
  11. </view>
  12. </view>
  13. <view class="material">
  14. <view class="content_table">
  15. <view class="item">
  16. <view class="lable rx-cc">包装总数 </view>
  17. <view class="content content_num">
  18. <input class="uni-input" v-model="item.formedNumLast" type="number" disabled></input>
  19. <view class="unit">{{ item.packageUnit }}</view>
  20. </view>
  21. </view>
  22. <view class="item rx-sc">
  23. <view class="rx ww55 ">
  24. <view class="lable lable150 rx-cc ">{{ item.title }}单元</view>
  25. <view class="content content_num">
  26. <input class="uni-input" v-model="item.packageCell" disabled></input>
  27. <view style="max-width: 100rpx; font-size: 24rpx;">{{ item.packageUnit }}</view>
  28. </view>
  29. </view>
  30. <view class="rx ww45">
  31. <view class="rx-cc ww80">
  32. /<view style="max-width: 100rpx; font-size: 24rpx;">{{ item.conversionUnit }}</view>
  33. </view>
  34. <view class="content rx-sc">
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="content_table2" v-if='item.splitList.length > 0'>
  40. <view class="head row rx-sc">
  41. <view class="item ww10">序号</view>
  42. <view class="item ww30">数量</view>
  43. <view class="item ww50">条码</view>
  44. <view class="item ww10"></view>
  45. </view>
  46. <view class="table">
  47. <u-list @scrolltolower="scrolltolower" class="z_list" style="height: 100% !important;">
  48. <view class="tr row rx-sc" v-for="(it, idx) in item.splitList" :key='idx'>
  49. <view class="item ww10 rx-cc ">{{ it.computeSize }}</view>
  50. <view class="item ww30 content_num rx-sc">
  51. {{ it.quantity }}/ {{ it.unit }}
  52. </view>
  53. <view class="item ww50">
  54. {{ it.code }}
  55. </view>
  56. <view class="item ww10 rx-cc" v-if="!it.parentId" @click="handleCheck(idx, it)">
  57. </view>
  58. </view>
  59. </u-list>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. export default {
  68. props: {
  69. objData: {
  70. type: Object,
  71. default: () => { }
  72. },
  73. measuringUnit: {
  74. type: String,
  75. default: ''
  76. }
  77. },
  78. watch: {
  79. objData: {
  80. handler(val) {
  81. console.log(val, '5555555555555');
  82. this.specText = val.specText || '';
  83. let minimumObj = {
  84. title: '最小包装',
  85. splitList: val.minimumPackage,
  86. packageCell: val.minimumPackageCell,
  87. packageUnit: val.minimumPackageUnit,
  88. conversionUnit: val.minimumConversionUnit,
  89. formedNumLast: val.minimumFormedNumLast
  90. }
  91. let withinObj = {
  92. title: '内包装',
  93. splitList: val.withinPackage,
  94. packageCell: val.withinPackageCell,
  95. packageUnit: val.withinPackageUnit,
  96. conversionUnit: val.withinConversionUnit,
  97. formedNumLast: val.withinFormedNumLast
  98. }
  99. let outsideObj = {
  100. title: '外包装',
  101. splitList: val.outsidePackage,
  102. packageCell: val.outsidePackageCell,
  103. packageUnit: val.outsidePackageUnit,
  104. conversionUnit: val.outsideConversionUnit,
  105. formedNumLast: val.outsideFormedNumLast
  106. }
  107. let arr = [minimumObj, withinObj, outsideObj];
  108. this.list = arr;
  109. console.log(this.list);
  110. },
  111. deep: true,
  112. immediate: true,
  113. },
  114. },
  115. data() {
  116. return {
  117. oneCheck: false,
  118. twoCheck: false,
  119. list: [],
  120. clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo").clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
  121. }
  122. },
  123. created() {
  124. },
  125. methods: {
  126. handOneCheck() {
  127. if (this.oneCheck) {
  128. this.oneCheck = false
  129. this.objData.packingReportList.forEach(e => {
  130. e.isChecked = false
  131. })
  132. } else {
  133. this.oneCheck = true
  134. this.objData.packingReportList.forEach(e => {
  135. e.isChecked = true
  136. })
  137. }
  138. this.$forceUpdate()
  139. },
  140. handleCheck(idx, it) {
  141. this.$set(this.objData.packingReportList[idx], 'isChecked', !it.isChecked)
  142. this.$forceUpdate()
  143. },
  144. handTwoCheck() {
  145. if (this.twoCheck) {
  146. this.twoCheck = false
  147. this.objData.packingReportMarginList.forEach(e => {
  148. e.isChecked = false
  149. })
  150. } else {
  151. this.twoCheck = true
  152. this.objData.packingReportMarginList.forEach(e => {
  153. e.isChecked = true
  154. })
  155. }
  156. this.$forceUpdate()
  157. },
  158. handleCheckTwo(idx, it) {
  159. this.$set(this.objData.packingReportMarginList[idx], 'isChecked', !it.isChecked)
  160. this.$forceUpdate()
  161. },
  162. scrolltolower() {
  163. },
  164. },
  165. }
  166. </script>
  167. <style lang="scss" scoped>
  168. .title_box {
  169. margin-top: 20rpx;
  170. .name {
  171. font-size: 28rpx;
  172. font-style: normal;
  173. font-weight: 400;
  174. color: $theme-color;
  175. padding-left: 20rpx;
  176. position: relative;
  177. &:before {
  178. position: absolute;
  179. content: '';
  180. left: 0rpx;
  181. top: 0rpx;
  182. bottom: 0rpx;
  183. width: 4rpx;
  184. height: 28rpx;
  185. background: $theme-color;
  186. margin: auto;
  187. }
  188. }
  189. }
  190. .content_table {
  191. width: 100%;
  192. border: 2rpx solid $border-color;
  193. .item {
  194. display: flex;
  195. border-bottom: 2rpx solid $border-color;
  196. .lable {
  197. width: 132rpx;
  198. text-align: center;
  199. background-color: #F7F9FA;
  200. font-size: 26rpx;
  201. border-right: 2rpx solid $border-color;
  202. flex-shrink: 0;
  203. }
  204. .lable220 {
  205. width: 220rpx !important;
  206. font-size: 24rpx;
  207. }
  208. .lable150 {
  209. width: 156rpx !important;
  210. font-size: 24rpx;
  211. }
  212. .ww80 {
  213. width: 80rpx;
  214. }
  215. .content {
  216. width: 518rpx;
  217. min-height: 64rpx;
  218. font-size: 28rpx;
  219. line-height: 28rpx;
  220. font-style: normal;
  221. font-weight: 400;
  222. // padding: 18rpx 8rpx;
  223. box-sizing: border-box;
  224. word-wrap: break-word;
  225. flex-grow: 1 !important;
  226. .unit {
  227. padding: 0 4rpx;
  228. font-size: 24rpx;
  229. color: #404446;
  230. }
  231. }
  232. &:last-child {
  233. border-bottom: none;
  234. }
  235. }
  236. .ww55 {
  237. width: 55%;
  238. }
  239. .ww45 {
  240. width: 45%;
  241. }
  242. }
  243. .material {
  244. margin-top: 10rpx;
  245. }
  246. .label {
  247. display: flex;
  248. height: 70rpx;
  249. width: 86px !important;
  250. font-size: 13px;
  251. align-items: center;
  252. justify-content: center;
  253. background-color: #F7F9FA;
  254. }
  255. .content_table2 {
  256. width: 100%;
  257. margin-top: 16rpx;
  258. .row {
  259. width: 100%;
  260. .item {
  261. color: #404446;
  262. font-size: 28rpx;
  263. padding-left: 12rpx;
  264. }
  265. .color157 {
  266. color: $theme-color;
  267. }
  268. .ww30 {
  269. width: 30%;
  270. }
  271. .ww50 {
  272. width: 50%;
  273. }
  274. .ww90 {
  275. width: 90%;
  276. }
  277. .ww15 {
  278. width: 15%;
  279. }
  280. .ww10 {
  281. width: 10%;
  282. }
  283. .ww30 {
  284. width: 30%;
  285. }
  286. }
  287. .head {
  288. height: 64rpx;
  289. background: #F7F9FA;
  290. border-top: 2rpx solid #E3E5E5;
  291. border-left: 2rpx solid #E3E5E5;
  292. .item {
  293. height: 64rpx;
  294. line-height: 64rpx;
  295. border-right: 2rpx solid #E3E5E5;
  296. box-sizing: border-box;
  297. }
  298. }
  299. .tr {
  300. border-top: 2rpx solid #E3E5E5;
  301. border-left: 2rpx solid #E3E5E5;
  302. .item {
  303. font-size: 24rpx;
  304. min-height: 64rpx;
  305. display: flex;
  306. align-items: center;
  307. border-right: 2rpx solid #E3E5E5;
  308. box-sizing: border-box;
  309. white-space: normal;
  310. word-break: break-all;
  311. }
  312. &:last-child {
  313. border-bottom: 2rpx solid #E3E5E5;
  314. }
  315. }
  316. }
  317. .content_num {
  318. display: flex;
  319. align-items: center;
  320. padding: 0 4rpx;
  321. /deep/ .uni-input-input {
  322. border: 2rpx solid #F0F8F2;
  323. background: #F0F8F2;
  324. color: $theme-color;
  325. }
  326. }
  327. .penalize {
  328. width: 86rpx;
  329. line-height: 60rpx;
  330. background: $theme-color;
  331. font-size: 24rpx;
  332. text-align: center;
  333. color: #fff;
  334. }
  335. .check {
  336. width: 30rpx;
  337. height: 30rpx;
  338. }
  339. .z_list {
  340. max-height: 500rpx;
  341. }
  342. </style>