modelBom.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <view>
  3. <view class="title_box rx-bc" v-if='newList.length'>
  4. <view class="name">模具信息</view>
  5. </view>
  6. <view class="material rx-ss" v-for="(item,index) in newList" :key='index'>
  7. <view class="left rx-ss" @click="getDelete(index)">
  8. <uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
  9. </view>
  10. <view class="content_table">
  11. <view class="item " v-for="(tab, tIdx) in tableH(5)" :key="tIdx">
  12. <view class="item " v-if="Array.isArray(tab.prop) && item.automatic == 2">
  13. <view class="lable lable300 rx-sc"> {{ item[tab.prop[0]] }}</view>
  14. <view class="content">
  15. {{ item[tab.prop[1]] }}
  16. </view>
  17. </view>
  18. <view class="item " v-if="Array.isArray(tab.prop) && item.automatic == 1">
  19. <view class="lable lable300 rx-sc"> {{ item['name'] }}</view>
  20. <view class="content">
  21. {{ item['code'] }}
  22. </view>
  23. </view>
  24. <view class="item" v-if="!Array.isArray(tab.prop)">
  25. <view class="lable lable300 rx-sc"> {{ tab.label }}</view>
  26. <view class="content content_num" v-if='tab.write'>
  27. <input class="uni-input" v-model="tab.extInfo ? item.extInfo[tab.prop]: item[tab.prop]"
  28. type="digit"></input>
  29. </view>
  30. <view class="content" v-if='!tab.write'>
  31. {{tab.extInfo ? item.extInfo[tab.prop] : item[tab.prop]}}
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. tableHeader
  42. } from './pickBom.js'
  43. export default {
  44. props: {
  45. code: {
  46. type: String,
  47. default: ''
  48. },
  49. modelList: {
  50. type: Array,
  51. default: () => []
  52. },
  53. modelList2: {
  54. type: Array,
  55. default: () => []
  56. },
  57. },
  58. watch: {
  59. modelList2: {
  60. immediate: true,
  61. deep: true,
  62. handler(newVal) {
  63. this.newList = [...this.modelList, ...newVal]
  64. }
  65. }
  66. },
  67. data() {
  68. return {
  69. newList: []
  70. }
  71. },
  72. methods: {
  73. tableH(type) {
  74. return tableHeader(type)
  75. },
  76. getDelete(idx) {
  77. this.newList.splice(idx, 1)
  78. this.$emit('hendDel', 'modelBom', this.code, this.newList)
  79. },
  80. }
  81. }
  82. </script>
  83. <style lang="scss" scoped>
  84. .title_box {
  85. margin-top: 20rpx;
  86. margin-bottom: 10rpx;
  87. .name {
  88. font-size: 28rpx;
  89. font-style: normal;
  90. font-weight: 400;
  91. color: $theme-color;
  92. padding-left: 20rpx;
  93. position: relative;
  94. &:before {
  95. position: absolute;
  96. content: '';
  97. left: 0rpx;
  98. top: 0rpx;
  99. bottom: 0rpx;
  100. width: 4rpx;
  101. height: 28rpx;
  102. background: $theme-color;
  103. margin: auto;
  104. }
  105. }
  106. .btn_box {
  107. padding: 0 18rpx;
  108. height: 60rpx;
  109. background: $theme-color;
  110. font-size: 26rpx;
  111. font-style: normal;
  112. font-weight: 400;
  113. font-size: 24rpx;
  114. color: #fff;
  115. border-radius: 4rpx;
  116. .scan {
  117. width: 34rpx;
  118. height: 34rpx;
  119. margin-right: 12rpx;
  120. }
  121. }
  122. }
  123. .material {
  124. .left {
  125. width: 40rpx;
  126. }
  127. .content_table {
  128. width: 652rpx;
  129. border: 2rpx solid $border-color;
  130. .item {
  131. display: flex;
  132. border-bottom: 1rpx dotted $border-color;
  133. .lable {
  134. width: 132rpx;
  135. text-align: center;
  136. background-color: #F7F9FA;
  137. font-size: 26rpx;
  138. border-right: 2rpx solid $border-color;
  139. flex-shrink: 0;
  140. }
  141. .lable150 {
  142. width: 156rpx !important;
  143. font-size: 24rpx;
  144. }
  145. .lable300 {
  146. width: 300rpx !important;
  147. padding-left: 14rpx;
  148. font-size: 24rpx;
  149. }
  150. .ww80 {
  151. width: 80rpx;
  152. }
  153. .content {
  154. width: 518rpx;
  155. min-height: 64rpx;
  156. font-size: 28rpx;
  157. line-height: 28rpx;
  158. font-style: normal;
  159. font-weight: 400;
  160. padding: 18rpx 8rpx;
  161. box-sizing: border-box;
  162. word-wrap: break-word;
  163. flex-grow: 1 !important;
  164. .unit {
  165. padding: 0 4rpx;
  166. font-size: 24rpx;
  167. color: #404446;
  168. }
  169. }
  170. .content_num {
  171. display: flex;
  172. align-items: center;
  173. padding: 0 4rpx;
  174. /deep/ .uni-input-input {
  175. border: 2rpx solid #F0F8F2;
  176. background: #F0F8F2;
  177. color: $theme-color;
  178. }
  179. }
  180. .pd4 {
  181. padding: 4rpx 8rpx;
  182. }
  183. &:last-child {
  184. border-bottom: none;
  185. }
  186. }
  187. .bot_border {
  188. border-bottom: 2rpx solid $theme-color;
  189. }
  190. .ww55 {
  191. width: 55%;
  192. }
  193. .ww45 {
  194. width: 45%;
  195. }
  196. }
  197. }
  198. </style>