assetPopu.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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.code }}</view>
  25. <view class="other">
  26. <view>设备名称:{{ item.name }}</view>
  27. <view>未完成工单数:{{ item.incompleteOrderNum }}</view>
  28. </view>
  29. <view class="other">
  30. <view>预计完成时间:{{ item.planCompleteDate }}</view>
  31. <view>末单牌号:{{ item.clastOrderGradeode }}</view>
  32. </view>
  33. </view>
  34. </label>
  35. </radio-group>
  36. </view>
  37. </div>
  38. </uni-popup>
  39. </view>
  40. </template>
  41. <script>
  42. import { get, getJ, post, postJ } from '@/utils/api.js'
  43. import { getDeviceByTaskId } from '@/api/production/extrusion.js'
  44. export default {
  45. components: {
  46. },
  47. props: {
  48. taskId: {
  49. type: String,
  50. default: ''
  51. }
  52. },
  53. data () {
  54. return {
  55. searchValue:'',
  56. tableData:[],
  57. current: -1,
  58. currentData:{}
  59. }
  60. },
  61. onShow () {
  62. },
  63. methods: {
  64. open(currentDivice) {
  65. if(currentDivice.code){
  66. this.tableData.map((item,index)=>{
  67. if(item.code == currentDivice.code ){
  68. this.current = index
  69. }
  70. })
  71. }
  72. this.$refs.popup.open()
  73. this.getDeviceList()
  74. },
  75. close() {
  76. this.$refs.popup.close()
  77. },
  78. radioChange (e) {
  79. let value = Number(e.detail.value)
  80. let data = this.tableData[value]
  81. this.currentData = data
  82. },
  83. getDeviceList(){
  84. getDeviceByTaskId(this.taskId).then(res=>{
  85. this.tableData = res
  86. })
  87. },
  88. comfirm(){
  89. this.$refs.popup.close()
  90. this.$emit('comfirmChoose',this.currentData)
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .popup{
  97. width: 100%;
  98. height: 900rpx;
  99. background: #fff;
  100. .popup-top{
  101. width: 100%;
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-between;
  105. height: 80rpx;
  106. background: rgba(21, 122, 44, 1);
  107. color: #fff;
  108. .top-left{
  109. font-size: 32rpx;
  110. margin-left: 10rpx;
  111. }
  112. .top-right{
  113. display: flex;
  114. align-items: center;
  115. justify-content: flex-end;
  116. margin-right: 10rpx;
  117. uni-button{
  118. background: rgba(21, 122, 44, 1);
  119. color: #fff;
  120. width: 100rpx;
  121. height: 60rpx;
  122. line-height: 60rpx;
  123. font-size: 28rpx;
  124. padding: 0;
  125. border: 1rpx solid #fff;
  126. margin-left: 20rpx;
  127. }
  128. }
  129. }
  130. .search-box{
  131. display: flex;
  132. align-items: center;
  133. justify-content: space-around;
  134. width: 94%;
  135. margin: 20rpx auto;
  136. .search-botton{
  137. background: rgba(112, 182, 3, 1);
  138. color: #fff;
  139. padding: 10rpx 20rpx;
  140. border-radius: 8rpx;
  141. margin-left: 20rpx;
  142. }
  143. }
  144. .table{
  145. width: 100%;
  146. border-top: 1rpx solid #ccc;
  147. .table-item{
  148. padding: 10rpx 20rpx;
  149. display: flex;
  150. align-items: center;
  151. justify-content: flex-start;
  152. border-bottom: 1rpx solid #ccc;
  153. .item-left{
  154. margin-right: 30rpx;
  155. }
  156. .item-right{
  157. flex: 1;
  158. .title{
  159. font-weight: bold;
  160. color: #000;
  161. margin: 10rpx 0;
  162. }
  163. .other{
  164. display: flex;
  165. align-items: center;
  166. margin-bottom: 10rpx;
  167. view{
  168. width: 50%;
  169. }
  170. }
  171. }
  172. }
  173. }
  174. }
  175. </style>