inspectionWorkDialog.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <u-popup :show="show" mode="center" :round="10" @close="close">
  3. <view class="popup-content">
  4. <view class="popup-header">
  5. <text class="popup-title">选择质检工单</text>
  6. <view class="close-btn" @click="close">×</view>
  7. </view>
  8. <view class="popup-body">
  9. <view class="search-wrap">
  10. <u-input v-model="keyword" placeholder="请输入工单编码或名称" border="surround" @confirm="search"></u-input>
  11. </view>
  12. <scroll-view scroll-y class="list-scroll">
  13. <view class="list-item" v-for="(item, index) in list" :key="index" @click="selectItem(item)">
  14. <view class="item-main">
  15. <text class="item-code">{{ item.code }}</text>
  16. <text class="item-name">{{ item.name }}</text>
  17. </view>
  18. <text class="arrow">›</text>
  19. </view>
  20. <view class="empty-text" v-if="list.length === 0">
  21. 暂无数据
  22. </view>
  23. </scroll-view>
  24. </view>
  25. <view class="popup-footer">
  26. <u-button type="default" @click="close">取消</u-button>
  27. </view>
  28. </view>
  29. </u-popup>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. show: false,
  36. keyword: '',
  37. list: []
  38. };
  39. },
  40. methods: {
  41. open() {
  42. this.show = true;
  43. this.keyword = '';
  44. this.search();
  45. },
  46. close() {
  47. this.show = false;
  48. },
  49. search() {
  50. // 这里调用后端接口获取质检工单列表
  51. // 示例代码,需要替换为实际接口
  52. // getQualityWorkOrderList({ keyword: this.keyword }).then(res => {
  53. // this.list = res.list;
  54. // });
  55. // 临时模拟数据
  56. this.list = [];
  57. },
  58. selectItem(item) {
  59. this.$emit('changeParent', item);
  60. this.close();
  61. }
  62. }
  63. };
  64. </script>
  65. <style lang="scss" scoped>
  66. .popup-content {
  67. width: 80vw;
  68. max-height: 80vh;
  69. background: #fff;
  70. border-radius: 20rpx;
  71. display: flex;
  72. flex-direction: column;
  73. }
  74. .popup-header {
  75. display: flex;
  76. justify-content: space-between;
  77. align-items: center;
  78. padding: 30rpx;
  79. border-bottom: 1rpx solid #e5e5e5;
  80. .popup-title {
  81. font-size: 36rpx;
  82. font-weight: bold;
  83. color: #333;
  84. }
  85. .close-btn {
  86. width: 60rpx;
  87. height: 60rpx;
  88. display: flex;
  89. align-items: center;
  90. justify-content: center;
  91. font-size: 60rpx;
  92. color: #999;
  93. line-height: 1;
  94. }
  95. }
  96. .popup-body {
  97. flex: 1;
  98. display: flex;
  99. flex-direction: column;
  100. padding: 20rpx 30rpx;
  101. }
  102. .search-wrap {
  103. margin-bottom: 20rpx;
  104. }
  105. .list-scroll {
  106. flex: 1;
  107. max-height: 60vh;
  108. }
  109. .list-item {
  110. display: flex;
  111. justify-content: space-between;
  112. align-items: center;
  113. padding: 25rpx 0;
  114. border-bottom: 1rpx solid #f5f5f5;
  115. &:last-child {
  116. border-bottom: none;
  117. }
  118. .item-main {
  119. flex: 1;
  120. display: flex;
  121. flex-direction: column;
  122. .item-code {
  123. font-size: 28rpx;
  124. color: #333;
  125. margin-bottom: 8rpx;
  126. }
  127. .item-name {
  128. font-size: 26rpx;
  129. color: #999;
  130. }
  131. }
  132. .arrow {
  133. color: #999;
  134. font-size: 40rpx;
  135. line-height: 1;
  136. margin-left: 20rpx;
  137. }
  138. }
  139. .empty-text {
  140. text-align: center;
  141. padding: 80rpx 0;
  142. color: #999;
  143. font-size: 28rpx;
  144. }
  145. .popup-footer {
  146. padding: 20rpx 30rpx;
  147. border-top: 1rpx solid #e5e5e5;
  148. /deep/ .u-button {
  149. width: 100%;
  150. }
  151. }
  152. </style>