jiangping
2024-02-02 f8b1073fbb28d37e08016eed32c682f8c5eae391
company/src/components/enterprise/insuranceRecords.vue
@@ -56,67 +56,61 @@
</template>
<script>
    import BaseOpera from '@/components/base/BaseOpera'
    import GlobalWindow from '@/components/common/GlobalWindow'
    import { findList, exportExcel } from '@/api/business/member'
    export default {
        name: 'insuranceRecords',
        extends: BaseOpera,
        components: { GlobalWindow },
        data () {
            return {
                form: {
                    id: null,
                    name: '',
                    idcardNo: '',
                    solutionsStatus: ''
                },
                list: []
            }
        },
        methods: {
            open (title, target) {
                this.title = title
                this.list = []
                this.visible = true
                // 新建
                if (target == null) {
                    this.$nextTick(() => {
                        this.$refs.form.resetFields()
                        this.form[this.configData['field.id']] = null
                    })
                    return
                }
                // 编辑
                this.$nextTick(() => {
                    for (const key in this.form) {
                        this.form[key] = target[key]
                    }
                })
                this.getList()
            },
            expr() {
                exportExcel({
                    capacity: 1000,
                    page: 1,
                    model: {
                        memberId: this.form.id
                    }
                }).then(res => {
                    console.log(res)
                    this.download(res)
                })
            },
            getList() {
                findList({
                    memberId: this.form.id
                }).then(res => {
                    console.log(res)
                    this.list = res
                })
            }
        }
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { findList, exportExcel } from '@/api/business/member'
export default {
  name: 'insuranceRecords',
  extends: BaseOpera,
  components: { GlobalWindow },
  data () {
    return {
      form: {
        id: null,
        name: '',
        idcardNo: '',
        solutionsStatus: ''
      },
      list: []
    }
  },
  methods: {
    open (title, target) {
      this.title = title
      this.list = []
      this.visible = true
      this.form = {
        id: null,
        name: '',
        idcardNo: '',
        solutionsStatus: ''
      }
      this.form = target
      // 新建
      this.getList()
    },
    expr () {
      exportExcel({
        capacity: 1000,
        page: 1,
        model: {
          memberId: this.form.id
        }
      }).then(res => {
        console.log(res)
        this.download(res)
      })
    },
    getList () {
      findList({
        memberId: this.form.id || -1
      }).then(res => {
        console.log(res)
        this.list = res
      })
    }
  }
}
</script>
<style lang="scss" scoped>