Index.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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">查询</el-button>
  5. <el-button :loading="listLoading" icon="el-icon-plus" class="xl-form-btn bgc2" @click="addHandle">添加</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. mounted () {
  22. this.getDef()
  23. },
  24. methods: {
  25. addHandle () {
  26. this.parentData.isDtlShow = true
  27. this.parentData.curObj = {}
  28. },
  29. getDef (str) {
  30. this.searchData = [
  31. { label: '所属区域', key: 'area_type', type: 'select', options: this.$dictData.area_type},
  32. { label: '门店名称', key: 'store_name' },
  33. { label: '店长', key: 'store_manager' },
  34. { label: '店长电话', key: 'manager_phone' },
  35. ]
  36. this.setDefaultValue(params, 'searchData')
  37. },
  38. searchHandle() {
  39. const oldform = this.$refs.ruleForm.baseForm
  40. const newForm = { ...oldform }
  41. this.$emit('change', newForm)
  42. }
  43. }
  44. }
  45. </script>