modelBom.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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 class="item">
  35. <view class="lable rx-cc">领料仓库</view>
  36. <view class="content pd4">
  37. <zxz-uni-data-select :localdata="warehouseList" v-model="item.warehouseId" dataValue='id' format='{name}'
  38. dataKey="name" filterable :clear='false'></zxz-uni-data-select>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import {
  48. tableHeader
  49. } from './pickBom.js'
  50. export default {
  51. props: {
  52. code: {
  53. type: String,
  54. default: ''
  55. },
  56. modelList: {
  57. type: Array,
  58. default: () => []
  59. },
  60. modelList2: {
  61. type: Array,
  62. default: () => []
  63. },
  64. warehouseList:{
  65. type: Array,
  66. default: () => []
  67. },
  68. },
  69. watch: {
  70. modelList2: {
  71. immediate: true,
  72. deep: true,
  73. handler(newVal) {
  74. this.newList = [...this.modelList, ...newVal]
  75. }
  76. }
  77. },
  78. data() {
  79. return {
  80. newList: []
  81. }
  82. },
  83. methods: {
  84. tableH(type) {
  85. return tableHeader(type)
  86. },
  87. getDelete(idx) {
  88. this.newList.splice(idx, 1)
  89. this.$emit('hendDel', 'modelBom', this.code, this.newList)
  90. },
  91. }
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. .title_box {
  96. margin-top: 20rpx;
  97. margin-bottom: 10rpx;
  98. .name {
  99. font-size: 28rpx;
  100. font-style: normal;
  101. font-weight: 400;
  102. color: $theme-color;
  103. padding-left: 20rpx;
  104. position: relative;
  105. &:before {
  106. position: absolute;
  107. content: '';
  108. left: 0rpx;
  109. top: 0rpx;
  110. bottom: 0rpx;
  111. width: 4rpx;
  112. height: 28rpx;
  113. background: $theme-color;
  114. margin: auto;
  115. }
  116. }
  117. .btn_box {
  118. padding: 0 18rpx;
  119. height: 60rpx;
  120. background: $theme-color;
  121. font-size: 26rpx;
  122. font-style: normal;
  123. font-weight: 400;
  124. font-size: 24rpx;
  125. color: #fff;
  126. border-radius: 4rpx;
  127. .scan {
  128. width: 34rpx;
  129. height: 34rpx;
  130. margin-right: 12rpx;
  131. }
  132. }
  133. }
  134. .material {
  135. .left {
  136. width: 40rpx;
  137. }
  138. .content_table {
  139. width: 652rpx;
  140. border: 2rpx solid $border-color;
  141. .item {
  142. display: flex;
  143. border-bottom: 1rpx dotted $border-color;
  144. .lable {
  145. width: 132rpx;
  146. text-align: center;
  147. background-color: #F7F9FA;
  148. font-size: 26rpx;
  149. border-right: 2rpx solid $border-color;
  150. flex-shrink: 0;
  151. }
  152. .lable150 {
  153. width: 156rpx !important;
  154. font-size: 24rpx;
  155. }
  156. .lable300 {
  157. width: 300rpx !important;
  158. padding-left: 14rpx;
  159. font-size: 24rpx;
  160. }
  161. .ww80 {
  162. width: 80rpx;
  163. }
  164. .content {
  165. width: 518rpx;
  166. min-height: 64rpx;
  167. font-size: 28rpx;
  168. line-height: 28rpx;
  169. font-style: normal;
  170. font-weight: 400;
  171. padding: 18rpx 8rpx;
  172. box-sizing: border-box;
  173. word-wrap: break-word;
  174. flex-grow: 1 !important;
  175. .unit {
  176. padding: 0 4rpx;
  177. font-size: 24rpx;
  178. color: #404446;
  179. }
  180. }
  181. .content_num {
  182. display: flex;
  183. align-items: center;
  184. padding: 0 4rpx;
  185. /deep/ .uni-input-input {
  186. border: 2rpx solid #F0F8F2;
  187. background: #F0F8F2;
  188. color: $theme-color;
  189. }
  190. }
  191. .pd4 {
  192. padding: 4rpx 8rpx;
  193. }
  194. &:last-child {
  195. border-bottom: none;
  196. }
  197. }
  198. .bot_border {
  199. border-bottom: 2rpx solid $theme-color;
  200. }
  201. .ww55 {
  202. width: 55%;
  203. }
  204. .ww45 {
  205. width: 45%;
  206. }
  207. }
  208. }
  209. </style>