123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340 |
- <template>
- <a-card :bordered="false" >
- <!-- 查询 -->
- <div class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="searchQuery">
- <a-row :gutter="24">
- <a-col :md="6" :sm="12">
- <a-form-item label="证件名称">
- <!--<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>-->
- <a-input placeholder="输入证件名称查询" v-model="queryParam.name"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="12">
- <a-form-item label="证件编号">
- <a-input placeholder="输入证件编号查询" v-model="queryParam.code"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="12">
- <a-form-item label="创建人">
- <!--<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>-->
- <!-- <a-input placeholder="输入创建人" v-model="queryParam.createBy"></a-input> -->
- <j-search-select-tag v-model="queryParam.createBy" placeholder="请选择用户名称"
- dict="sys_user,realname,username" @search="searchName" />
- </a-form-item>
- </a-col>
- <!-- <a-col :md="6" :sm="12">
- <a-form-item label="起始日期">
- <a-date-picker
- style="width: 100%"
- placeholder="请选择购买日期"
- v-model="beDate"
- format="YYYY-MM-DD"
- @change="onDateChange"
- />
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="12">
- <a-form-item label="到期时间">
- <a-date-picker
- style="width: 100%"
- placeholder="请选择购买日期"
- v-model="enDate"
- format="YYYY-MM-DD"
- @change="onEndDateChange"
- />
- </a-form-item>
- </a-col> -->
- <template v-if="toggleSearchStatus">
-
-
-
- </template>
- <a-col :md="6" :sm="8">
- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
- <a @click="handleToggleSearch" style="margin-left: 8px">
- {{ toggleSearchStatus ? '收起' : '展开' }}
- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
- </a>
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
- <!-- 操作按钮区域 -->
- <div class="table-operator" style="border-top: 5px">
- <a-button type="primary" icon="download" @click="handleExportXls('证件管理')">导出</a-button>
- <a-button @click="handleAdd" type="primary" icon="plus">添加</a-button>
- <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete()">
- <a-button type="primary" icon="plus">删除</a-button>
- </a-popconfirm>
-
- </div>
- <!-- table区域-begin -->
- <div>
- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
- <i class="anticon anticon-info-circle ant-alert-icon"></i>已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
- <a style="margin-left: 24px" @click="onClearSelected">清空</a>
- </div>
- <a-table
- ref="table"
- bordered
- size="middle"
- rowKey="id"
- :columns="columns"
- :dataSource="dataSource"
- :pagination="pagination"
- :loading="loading"
- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
- @change="handleTableChange">
- <span slot="operation" slot-scope="text, record">
- <a @click="handleEdit(record)">编辑</a>
- </span>
- </a-table>
- </div>
- <!-- 新增框 -->
- <add-certificate-management ref='AddCertificateManagement' @close="close"></add-certificate-management>
- </a-card>
-
- </template>
- <script>
- import { downFile } from '@/api/manage'
- import {JeecgListMixin} from '@/mixins/JeecgListMixin'
- import JEllipsis from '@/components/jeecg/JEllipsis'
- import AddCertificateManagement from './modules/AddCertificateManagement'
- import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
- import moment from 'moment'
- import {
- managementList,
- enterpriseEDelete,
- managementListId
- } from '@api/oa/cd-certificate-management'
- export default {
- name: "CertificateManagement",
- mixins: [JeecgListMixin],
- components: {
- AddCertificateManagement,
- moment,
- JEllipsis,
- JSearchSelectTag
- },
- data() {
- let ellipsis = (v, l = 10) => <j-ellipsis value={v} length={l} />
- return {
- queryParam:{ //查询条件
- beginDate:'',
- endDate:''
- },
- // 表头
- columns:[
- {
- title: '证件名称',
- align: "center",
- dataIndex: 'name',
- width: 120
- },
- {
- title: '证件所有人',
- align: "center",
- dataIndex: 'userId',
- width: 120
- },
- {
- title: '证件编号',
- align: "center",
- dataIndex: 'code',
- width: 120
- },
- {
- title: '起始日期',
- align: "center",
- dataIndex: 'beginDate',
- width: 120
- },
- {
- title: '到期时间',
- align: "center",
- dataIndex: 'endDate',
- width: 120
- },
- {
- title: '管理人',
- align: "center",
- dataIndex: 'manageId',
- width: 120
- },
- {
- title: '提前通知时间/月',
- align: "center",
- dataIndex: 'noticeMonth',
- width: 120
- },
- {
- title: '备注',
- align: "center",
- dataIndex: 'remarks',
- customRender: (t) => ellipsis(t),
- width: 120
- },
- {
- title: '操作',
- align: "center",
- dataIndex: 'operation',
- scopedSlots: { customRender: 'operation' },
- width: 120
- },
- ],
- // url: {
- // exportXlsUrl: "/oa/syCertificates/exportXls",
- // },
- dataSource:[],
- selectedRowKeys:[],
- beDate:'',
- enDate:'',
- pagination:{ }
- }
- },
- computed: {
-
- },
- created(){
- this.getData()
- },
- methods: {
- /* 导出 */
- handleExportXls(fileName){
- if(!fileName || typeof fileName != "string"){
- fileName = "导出文件"
- }
- let param = {...this.queryParam};
- if(this.selectedRowKeys && this.selectedRowKeys.length>0){
- param['selections'] = this.selectedRowKeys.join(",")
- }
- console.log("导出参数",param)
- downFile('/oa/syCertificates/exportXls',param).then((data)=>{
- if (!data) {
- this.$message.warning("文件下载失败")
- return
- }
- if (typeof window.navigator.msSaveBlob !== 'undefined') {
- window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
- }else{
- let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
- let link = document.createElement('a')
- link.style.display = 'none'
- link.href = url
- link.setAttribute('download', fileName+'.xls')
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link); //下载完成移除元素
- window.URL.revokeObjectURL(url); //释放掉blob对象
- }
- })
- },
- // 查询
- searchQuery(){
- this.getData()
- },
- //重置
- searchReset(){
- this.queryParam={}
- this.beDate = ''
- this.enDate = ''
- this.getData()
- },
- // 获取数据
- getData(){
- this.$nextTick(() => {
- managementList(this.queryParam).then(res => {
- // console.log('>>>>', this.queryParam)
- if (res.success) {
- this.dataSource =res.result.records
- this.pagination = {
- total: res.result.total,
- current: res.result.current,
- pageSize: res.result.size
- }
- }else{
- this.$message.error(res.message);
- }
- })
- })
- },
- // 删除
- handleDelete(){
- var id = this.selectedRowKeys.toString()
- enterpriseEDelete({ids:id}).then(res => {
- // console.log('>>>>', this.queryParam)
- if (res.success) {
- this.$message.success('删除成功');
- this.getData()
- }else{
- this.$message.error(res.message);
- }
- })
- },
- // 添加
- handleAdd(){
- this.$refs.AddCertificateManagement.visible = true
- },
- //编辑
- handleEdit(record){
- managementListId({id:record.id}).then(res => {
- // console.log('>>>>', this.queryParam)
- if (res.success) {
- this.$refs.AddCertificateManagement.visible = true
- this.$refs.AddCertificateManagement.defult = 'edit'
- res.result.beginDate =moment (res.result.beginDate)
- res.result.endDate = moment (res.result.endDate)
- this.$refs.AddCertificateManagement.formState = res.result
- if(!res.result.enclosure || res.result.enclosure==''){
- this.$refs.AddCertificateManagement.fileList = []
- }else{
- this.$refs.AddCertificateManagement.fileList.push(res.result.enclosure)
- }
- }else{
- this.$message.error(res.message);
- }
- })
- },
- //选中行
- onSelectChange(keys,rows){
- this.selectedRowKeys = keys;
- this.selectedRows = rows;
- },
- onDateChange(value){
- this.queryParam.beginDate =moment(value).format('YYYY-MM-DD');
- },
- onEndDateChange(value){
- this.queryParam.endDate =moment(value).format('YYYY-MM-DD');
- },
- // 分页变化时触发
- handleTableChange(pagination, filters, sorter) {
- this.queryParam.pageNo = pagination.current
- this.getData()
- },
-
- close(){
- this.getData()
- }
- }
-
- }
- </script>
- <style scoped>
- @import '~@assets/less/common.less'
- </style>
|