Price.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <base-form slot="content" ref="ruleForm" :data="searchData">
  3. <div slot="footer">
  4. <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询:{{name}}</el-button>
  5. <!-- <el-button :loading="listLoading" icon="el-icon-document" class="xl-form-btn bgc2" @click="toExportExcel">导出{{ this.$route.meta.title }}信息</el-button> -->
  6. </div>
  7. </base-form>
  8. </template>
  9. <script>
  10. export default {
  11. props: {
  12. listLoading: Boolean
  13. },
  14. inject: ['parentData'],
  15. mixins,
  16. data() {
  17. return {
  18. searchData: []
  19. }
  20. },
  21. computed: {
  22. name () {
  23. return this.parentData.$route.query.name || ''
  24. }
  25. },
  26. mounted () {
  27. this.getDef()
  28. },
  29. methods: {
  30. getDef (str) {
  31. let params = { ...this.$refs.ruleForm.baseForm }
  32. this.searchData = [
  33. { label: '签约中介', key: 'company' },
  34. { label: '签约日期', label2: '开始时间', label3: '结束时间', key: 'startEndTime', type: 'datePicker', rules: 1},
  35. ]
  36. this.setDefaultValue(params, 'searchData')
  37. },
  38. searchHandle() {
  39. const oldform = this.$refs.ruleForm.baseForm
  40. const newForm = { ...oldform }
  41. if (newForm.startEndTime) {
  42. newForm.start_at = newForm.startEndTime[0]
  43. newForm.end_at = newForm.startEndTime[1]
  44. delete newForm.startEndTime
  45. }
  46. this.$emit('change', newForm)
  47. }
  48. }
  49. }
  50. </script>