searchPopup.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <u-popup
  3. :show="show"
  4. mode="top"
  5. :round="10"
  6. closeable
  7. @close="close"
  8. bgColor="#fff"
  9. >
  10. <view class="search_wrap">
  11. <view class="title">筛选</view>
  12. <view class="form_item">
  13. <view class="label">关键字</view>
  14. <u-input
  15. v-model="form.keyWord"
  16. placeholder="请输入型号、规格、批次号"
  17. ></u-input>
  18. </view>
  19. <view class="form_item">
  20. <view class="label">工单编码</view>
  21. <u-input v-model="form.workOrderCode" placeholder="请输入"></u-input>
  22. </view>
  23. <view class="form_item">
  24. <view class="label">委外名称</view>
  25. <u-input v-model="form.name" placeholder="请输入"></u-input>
  26. </view>
  27. <view class="form_item">
  28. <view class="label">委外编码</view>
  29. <u-input v-model="form.code" placeholder="请输入"></u-input>
  30. </view>
  31. <view class="btns">
  32. <button class="btn reset" @click="reset">重置</button>
  33. <button class="btn confirm" @click="confirm">确定</button>
  34. </view>
  35. </view>
  36. </u-popup>
  37. </template>
  38. <script>
  39. const defaultForm = () => ({
  40. keyWord: "",
  41. workOrderCode: "",
  42. name: "",
  43. code: "",
  44. });
  45. export default {
  46. props: {
  47. show: { type: Boolean, default: false },
  48. },
  49. data() {
  50. return {
  51. form: defaultForm(),
  52. };
  53. },
  54. methods: {
  55. close() {
  56. this.$emit("close");
  57. },
  58. reset() {
  59. this.form = defaultForm();
  60. this.$emit("search", { ...this.form });
  61. this.close();
  62. },
  63. confirm() {
  64. this.$emit("search", { ...this.form });
  65. this.close();
  66. },
  67. },
  68. };
  69. </script>
  70. <style lang="scss" scoped>
  71. .search_wrap {
  72. padding: 30rpx 30rpx 40rpx;
  73. .title {
  74. font-size: 32rpx;
  75. font-weight: 600;
  76. text-align: center;
  77. margin-bottom: 20rpx;
  78. }
  79. .form_item {
  80. margin-bottom: 24rpx;
  81. .label {
  82. font-size: 26rpx;
  83. color: #333;
  84. margin-bottom: 10rpx;
  85. }
  86. }
  87. .btns {
  88. display: flex;
  89. gap: 20rpx;
  90. margin-top: 30rpx;
  91. .btn {
  92. flex: 1;
  93. height: 72rpx;
  94. line-height: 72rpx;
  95. border-radius: 8rpx;
  96. font-size: 28rpx;
  97. }
  98. .reset {
  99. background: #f5f5f5;
  100. color: #333;
  101. }
  102. .confirm {
  103. background: $theme-color;
  104. color: #fff;
  105. }
  106. }
  107. }
  108. </style>