packingBom.vue 8.2 KB

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