materialPopu.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view>
  3. <uni-popup ref="popup" type="bottom">
  4. <div class="popup">
  5. <div class="popup-top">
  6. <div class="top-left">选择物料</div>
  7. <div class="top-right">
  8. <button @click="close">关闭</button>
  9. <button @click="comfirm">确定</button>
  10. </div>
  11. </div>
  12. <view class="search-box">
  13. <uni-easyinput prefixIcon="search" v-model="searchValue" placeholder="请输入搜索内容" @iconClick="iconClick">
  14. </uni-easyinput>
  15. <view class="search-botton">搜索</view>
  16. </view>
  17. <view class="table">
  18. <radio-group @change="radioChange">
  19. <label class="table-item" v-for="(item, index) in tableData" :key="index">
  20. <view class="item-left">
  21. <radio :value="index + ''" :checked="index == current" />
  22. </view>
  23. <view class="item-right">
  24. <view class="title">编码:{{ item.categoryCode }}</view>
  25. <view class="other">
  26. 名称:{{ item.categoryName }}
  27. </view>
  28. <view class="other">
  29. 牌号:{{ item.brandNum }}
  30. </view>
  31. </view>
  32. </label>
  33. </radio-group>
  34. </view>
  35. </div>
  36. </uni-popup>
  37. </view>
  38. </template>
  39. <script>
  40. import { get, getJ, post, postJ } from '@/utils/api.js'
  41. import { bomSubListByVersionId } from '@/api/production/extrusion.js'
  42. export default {
  43. components: {
  44. },
  45. props: {
  46. taskId: {
  47. type: String,
  48. default: ''
  49. },
  50. versionId: {
  51. type: String,
  52. default: ''
  53. }
  54. },
  55. data () {
  56. return {
  57. searchValue:'',
  58. tableData:[],
  59. current:-1,
  60. currentData:{}
  61. }
  62. },
  63. onShow () {
  64. },
  65. methods: {
  66. open() {
  67. this.$refs.popup.open()
  68. this.getMaterialList()
  69. },
  70. close() {
  71. this.$refs.popup.close()
  72. },
  73. getMaterialList(){
  74. const params = {
  75. taskId : this.taskId,
  76. versionId : this.versionId
  77. }
  78. bomSubListByVersionId(params).then(res=>{
  79. this.tableData = res
  80. })
  81. },
  82. radioChange (e) {
  83. let value = Number(e.detail.value)
  84. let data = this.tableData[value]
  85. this.currentData = data
  86. },
  87. comfirm(){
  88. this.$refs.popup.close()
  89. this.$emit('chooseMaterial',this.currentData)
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. .popup{
  96. width: 100%;
  97. height: 900rpx;
  98. background: #fff;
  99. .popup-top{
  100. width: 100%;
  101. display: flex;
  102. align-items: center;
  103. justify-content: space-between;
  104. height: 80rpx;
  105. background: rgba(21, 122, 44, 1);
  106. color: #fff;
  107. .top-left{
  108. font-size: 32rpx;
  109. margin-left: 10rpx;
  110. }
  111. .top-right{
  112. display: flex;
  113. align-items: center;
  114. justify-content: flex-end;
  115. margin-right: 10rpx;
  116. uni-button{
  117. background: rgba(21, 122, 44, 1);
  118. color: #fff;
  119. width: 100rpx;
  120. height: 60rpx;
  121. line-height: 60rpx;
  122. font-size: 28rpx;
  123. padding: 0;
  124. border: 1rpx solid #fff;
  125. margin-left: 20rpx;
  126. }
  127. }
  128. }
  129. .search-box{
  130. display: flex;
  131. align-items: center;
  132. justify-content: space-around;
  133. width: 94%;
  134. margin: 20rpx auto;
  135. .search-botton{
  136. background: rgba(112, 182, 3, 1);
  137. color: #fff;
  138. padding: 10rpx 20rpx;
  139. border-radius: 8rpx;
  140. margin-left: 20rpx;
  141. }
  142. }
  143. .table{
  144. width: 100%;
  145. border-top: 1rpx solid #ccc;
  146. .table-item{
  147. padding: 10rpx 20rpx;
  148. display: flex;
  149. align-items: center;
  150. justify-content: flex-start;
  151. border-bottom: 1rpx solid #ccc;
  152. .item-left{
  153. margin-right: 30rpx;
  154. }
  155. .item-right{
  156. flex: 1;
  157. .title{
  158. font-weight: bold;
  159. color: #000;
  160. margin: 10rpx 0;
  161. }
  162. .other{
  163. display: flex;
  164. align-items: center;
  165. margin-bottom: 10rpx;
  166. }
  167. }
  168. }
  169. }
  170. }
  171. </style>