packingBom.vue 9.5 KB

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