MBS-FormItems组件常用类型

简介: MBS-FormItems组件常用类型
<template>
  <ta-border-layout style="height: 100%" :centerCfg="{showBorder:true}" :headerCfg="{showBorder:false}" :footerCfg="{showBorder:false}" :showBorder=true :showPadding=true layout-type="fixTop">
    <ta-card title="查询条件" :bordered="false" :showExpand="false" class='no-bd-bottom'>
      <Form :formItem="formItems" :autoFormCreate="(form)=>{this.queryForm=form}" :form-layout="true">
        <template slot="operation">
          <div style="text-align:right;margin-bottom:20px">
            <ta-button @click="reset">重置</ta-button>
            <ta-button type="primary" @click="queryAll">查询</ta-button>
          </div>
        </template>
      </Form>
    </ta-card>
    <ta-card title="医疗就诊信息列表" :bordered="false" :showExpand="false" class='no-bd-bottom'>
      <tables :scroll="{ x: 1850,y:480}" :columns="columns" :dataSource.sync="tableData" :total="pageParams.total" v-model="pageParams.pageNum" :pageSize.sync="pageParams.pageSize" @change="onPagePage" @showSizeChange="onPageSizeChange" ref="gridPager" />
    </ta-card>
  </ta-border-layout>
</template>
<script>
import Form from '@project/component/Form'
import tables from '@project/component/tables'
import moment from 'moment'
import dicMixin from '@common/js/mixins/dicMixin'
import mixins from './columns'
export default {
  name: 'N142307',
  provide: {
    limitAdmdvs: 54
  },
  mixins: [dicMixin, mixins],
  components: { Form, tables },
  data () {
    return {
      formItems: [
        {
          label: '开始时间',
          type: 'date',
          fieldDecoratorId: 'crteTimeBeginStr',
          require: true,
          params: {
            disabledDate: v => this.disabledStartDate(v)
          }
        },
        {
          label: '结束时间',
          type: 'date',
          fieldDecoratorId: 'crteTimeEndStr',
          require: true,
          params: {
            disabledDate: v => this.disabledEndDate(v)
          }
        },
        {
          label: '业务类型',
          fieldDecoratorId: 'type',
          type: 'select',
          align: 'center',
          options: [
            { label: '个人返还', value: '1' },
            { label: '个人清退', value: '2' }
          ]
        },
        {
          label: '人员编号',
          fieldDecoratorId: 'psnNo',
          type: 'component',
          currentView: 'personnel',
          required: true,
          params: { showPsnCertType: false },
          span: 8,
          func: (val) => {
            this.queryForm.setFieldsValue({
              psnNo: val.psnNo,
              ptcpNo: val.psnNo,
              psnName: val.psnName
            })
          }
        },
        {
          label: '单位编号',
          type: 'component',
          fieldDecoratorId: 'empNo',
          currentView: 'company',
          span: 8,
          func: (v) => {
            if (v) {
            }
          }
        }
      ],
      tableData: [],
      pageParams: {
        pageNum: 1,
        pageSize: 10,
        total: 0
      }
    }
  },
  async mounted () {
    const res = await this.$store.dispatch('getCanOptAdmdvs', this)
    this.$set(
      this.formItems.find((v) => v.fieldDecoratorId === 'insuAdmdvs'),
      'options',
      res.data.data
    )
  },
  methods: {
    //  开始时间校验
    disabledStartDate (startValue) {
      const endValue = this.queryForm.getFieldValue('crteTimeEndStr')
      return moment(startValue).isAfter(new Date()) || moment(startValue).isAfter(endValue)
    },
    //  结束时间校验
    disabledEndDate (endValue) {
      const startValue = this.queryForm.getFieldValue('crteTimeBeginStr')
      return moment(endValue).isAfter(new Date()) || moment(endValue).isBefore(startValue)
    },
    moment,
    onPagePage (cur) {
      this.pageParams.pageNum = cur
      this.queryAll()
    },
    onPageSizeChange (cur, pageSize) {
      this.pageParams.pageNum = 1
      this.pageParams.pageSize = pageSize
      this.queryAll()
    },
    queryAll () {
      const formData = this.queryForm.getFieldsValue()
      if (formData.insuAdmdvs) {
        formData.insuAdmdvs = formData.insuAdmdvs[formData.insuAdmdvs.length - 1]
      }
      this.queryForm.validateFields((err, val) => {
        if (err) return
        this.Base.pageMask({ show: true, isTop: false, text: '加载中' })
        Base.submit(null, {
          url: '/web/account/accountInfoManage/queryAcctUnifiedPage',
          data: { ...formData, ...this.pageParams },
          autoValid: true,
          autoQs: false
        }).then((res) => {
          if (res.code === 0) {
            this.pageParams.total = res.data.recordCounts
            this.tableData = res.data.data
            console.log(this.tableData)
          }
        }).finally(() => {
          this.Base.pageMask({ show: false, isTop: false, text: '加载中' })
        })
      })
    },
    reset () {
      this.queryForm.resetFields()
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
相关文章
|
7月前
|
传感器 数据处理
Δ型A/D转换器的介绍
Δ型A/D转换器:原理与应用 一、引言 Δ型A/D转换器是一种常见的模拟-数字转换器,广泛应用于各种电子设备和系统中。它通过将模拟信号转换为数字信号,实现了模拟和数字领域之间的数据传输和处理。本文将介绍Δ型A/D转换器的原理和应用,并探讨其设计要点和优化方法。 二、原理 Δ型A/D转换器基于Δ调制原理,通过比较输入模拟信号与参考电压的差异,产生一个Δ量,并将其转换为数字信号。其基本结构包括一个比较器、一个积分器和一个数字逻辑电路。 1. 比较器:比较器用于比较输入模拟信号与参考电压的大小差异,并产生一个Δ量。当输入模拟信号大于参考电压时,比较器输出高电平;当输入模拟信号小于参考电压时,比
31 0
|
3月前
|
存储 自然语言处理 编译器
C++新特性详细介绍 -----新基础类型
C++新特性详细介绍 -----新基础类型
|
3月前
|
C语言
循环类型
循环类型。
13 0
|
5月前
转成String类型的几种方式
转成String类型的几种方式
45 0
|
8月前
5.3.2.2 操作字符串类型数据
5.3.2.2 操作字符串类型数据
31 0
|
10月前
|
Java 容器
Java容器类型以及使用方法(1)
Java容器类型以及使用方法(1)
|
12月前
【SOGAF】SOGAF架构类型/模式
【SOGAF】SOGAF架构类型/模式
|
JavaScript 前端开发
学习TypeScrip1(基础类型)
void 类型的用法,主要是用在我们不希望调用者关心函数返回值的情况下,比如通常的异步回调函数
60 0
学习TypeScrip1(基础类型)
|
移动开发 PHP 开发者
字符串类型| 学习笔记
快速学习字符串类型。
120 0
|
Go 开发者
字符串类型基本使用|学习笔记
快速学习字符串类型基本使用。
48 0