Files
income_payments_enterprise_…/src/views/standardsAssociation/memberInfo/CertificateInfo.vue
T

239 lines
6.4 KiB
Vue

<!--会员管理-证书的相关信息-->
<template>
<div class="table-page-search-wrapper certificate-info-container">
<a-form layout="inline">
<a-row :span="24" class="create-date-row" :gutter="24">
<a-col :span="8">
<a-form-item label="证书代码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :maxLength="50" v-model="queryParam.code" placeholder="请输入证书代码"></a-input>
</a-form-item>
</a-col>
<a-col :span="8" class="ope-col">
<a-button class="btn btn-primary" type="primary" @click="vinQuery" icon="search">
查询
</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 5px">
重置
</a-button>
</a-col>
</a-row>
</a-form>
<div class="row clearfix">
<div class="col-md-12 column">
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
@change="handleTableChange"
class="j-table-force-nowrap">
</a-table>
</div>
</div>
</div>
</template>
<script>
import { getAction } from '../../../api/memberManage'
import { JeroListMixin } from '../../../mixins/JeroListMixin'
import { RangeDateMixin } from '../../../mixins/RangeDateMixin'
export default {
name: 'CertificateInfo',
mixins: [
JeroListMixin,
RangeDateMixin
],
components: {},
props: {
memberInfo: {
type: Object,
required: false,
default: () => {
return {}
}
}
},
watch: {
memberInfo() {
this.filters.memberId = this.memberInfo.id
}
},
data() {
return {
// VIN证书信息头
columns: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: function(t, r, index) {
return parseInt(index) + 1
}
},
{
title: '证书代码',
align: 'center',
dataIndex: 'code'
},
{
title: '证书类型',
align: 'center',
dataIndex: 'certificateType',
customRender: function(text) {
if (text === 1) {
return '世界制造厂识别代号(WMI)证书'
} else if (text === 2) {
return '企业名称代号证书'
}
}
},
{
title: '生效日期',
align: 'center',
dataIndex: 'effectDate'
},
{
title: '到期日期',
align: 'center',
dataIndex: 'invalidDate'
},
{
title: '会员绑定证书',
align: 'center',
dataIndex: 'certificateStatusTemp',
customRender: function(text, record) {
if (record.isBind === 2) {
return '是'
} else {
return '否'
}
}
},
{
title: '换证',
align: 'center',
dataIndex: 'certificateModality',
customRender: function(text) {
if (text === 1) {
return '是'
} else {
return '否'
}
}
},
// 证书状态(1:已绑定,2:已提交,3:已处理,4:正常使用,5:已失效)
{
title: '状态',
align: 'center',
dataIndex: 'certificateStatus',
customRender: function(text) {
if (text === 1) {
return '已绑定'
} else if (text === 2) {
return '已支付'
} else if (text === 3) {
return '已缴费'
} else if (text === 4) {
return '正常使用'
} else if (text === 5) {
return '已失效'
} else if (text === 6) {
return '已驳回'
} else if (text === 0) {
return '待支付'
} else if (text === 7) {
return '绑定已失效'
}
}
}],
dataSource: [],
// 会员单位下面的信息
labelCol: {
xxl: { span: 8 }, // ≥1600px
xl: { span: 11 }, // ≥1200px
md: { span: 12 }, // ≥768px
sm: { span: 24 }, // ≥576px
xs: { span: 24 } // <576px
},
wrapperCol: {
xxl: { span: 16 }, // ≥1600px
xl: { span: 13 }, // ≥1200px
md: { span: 12 }, // ≥768px
sm: { span: 24 }, // ≥576px
xs: { span: 24 } // <576px
},
// 日期组件查询的key值
dateKeyObj: {
beginKey: 'submissionTime_begin',
endKey: 'submissionTime_end'
},
url: {
list: '/vinCertificate/vinCertificate/getVinCertificateModelByMemberId'
}
}
},
methods: {
loadData(arg) {
if (!this.url.list) {
this.$message.error('请设置url.list属性!')
return
}
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1
}
var params = this.getQueryParams()//查询条件
this.loading = true
getAction(this.url.list, params).then((res) => {
if (res.success) {
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
this.dataSource = res.result.records || res.result
if (res.result.total) {
this.ipagination.total = res.result.total
//清空列表选中
// this.onClearSelected()
} else {
this.ipagination.total = 0
}
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
}
if (res.code === 510) {
this.$message.warning(res.message)
}
this.loading = false
})
},
// 证书查询
vinQuery() {
if (this.queryParam.code) {
this.searchQuery()
} else {
this.$message.warning('请输入证书代码')
}
},
// 初始化数据
initData() {
this.searchReset()
}
},
created() {
console.log('&&*****证书记录****')
this.filters.memberId = this.memberInfo.id
this.searchReset()
}
}
</script>
<style scoped>
</style>