modelBom.vue 4.6 KB

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