12 changed files with 1427 additions and 27 deletions
@ -0,0 +1,53 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
// 查询币种配置列表
|
||||
|
export function listCoin(query) { |
||||
|
return request({ |
||||
|
url: '/user/coin/list', |
||||
|
method: 'get', |
||||
|
params: query |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询币种配置详细
|
||||
|
export function getCoin(id) { |
||||
|
return request({ |
||||
|
url: '/user/coin/' + id, |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 新增币种配置
|
||||
|
export function addCoin(data) { |
||||
|
return request({ |
||||
|
url: '/user/coin', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 修改币种配置
|
||||
|
export function updateCoin(data) { |
||||
|
return request({ |
||||
|
url: '/user/coin', |
||||
|
method: 'put', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 删除币种配置
|
||||
|
export function delCoin(id) { |
||||
|
return request({ |
||||
|
url: '/user/coin/' + id, |
||||
|
method: 'delete' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 导出币种配置
|
||||
|
export function exportCoin(query) { |
||||
|
return request({ |
||||
|
url: '/user/coin/export', |
||||
|
method: 'get', |
||||
|
params: query |
||||
|
}) |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
// 查询站内信列表
|
||||
|
export function listMail(query) { |
||||
|
return request({ |
||||
|
url: '/user/mail/list', |
||||
|
method: 'get', |
||||
|
params: query |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询站内信详细
|
||||
|
export function getMail(mailId) { |
||||
|
return request({ |
||||
|
url: '/user/mail/' + mailId, |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 新增站内信
|
||||
|
export function addMail(data) { |
||||
|
return request({ |
||||
|
url: '/user/mail', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 修改站内信
|
||||
|
export function updateMail(data) { |
||||
|
return request({ |
||||
|
url: '/user/mail', |
||||
|
method: 'put', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 删除站内信
|
||||
|
export function delMail(mailId) { |
||||
|
return request({ |
||||
|
url: '/user/mail/' + mailId, |
||||
|
method: 'delete' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 导出站内信
|
||||
|
export function exportMail(query) { |
||||
|
return request({ |
||||
|
url: '/user/mail/export', |
||||
|
method: 'get', |
||||
|
params: query |
||||
|
}) |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
// 查询证件类型列表
|
||||
|
export function listType(query) { |
||||
|
return request({ |
||||
|
url: '/user/type/list', |
||||
|
method: 'get', |
||||
|
params: query |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询证件类型详细
|
||||
|
export function getType(id) { |
||||
|
return request({ |
||||
|
url: '/user/type/' + id, |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 新增证件类型
|
||||
|
export function addType(data) { |
||||
|
return request({ |
||||
|
url: '/user/type', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 修改证件类型
|
||||
|
export function updateType(data) { |
||||
|
return request({ |
||||
|
url: '/user/type', |
||||
|
method: 'put', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 删除证件类型
|
||||
|
export function delType(id) { |
||||
|
return request({ |
||||
|
url: '/user/type/' + id, |
||||
|
method: 'delete' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 导出证件类型
|
||||
|
export function exportType(query) { |
||||
|
return request({ |
||||
|
url: '/user/type/export', |
||||
|
method: 'get', |
||||
|
params: query |
||||
|
}) |
||||
|
} |
@ -0,0 +1,406 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
||||
|
<el-form-item label="币种名称" prop="name"> |
||||
|
<el-input |
||||
|
v-model="queryParams.name" |
||||
|
placeholder="请输入币种名称" |
||||
|
clearable |
||||
|
size="small" |
||||
|
@keyup.enter.native="handleQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
<el-form-item label="类型" prop="feeType"> |
||||
|
<el-select v-model="queryParams.feeType" placeholder="请选择状态" clearable size="small"> |
||||
|
<el-option v-for="dict in feeTypeOptions" :key="dict.dictValue" :label="dict.dictLabel" |
||||
|
:value="dict.dictValue" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
<el-form-item label="状态" prop="status"> |
||||
|
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small"> |
||||
|
<el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" |
||||
|
:value="dict.dictValue" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
<el-form-item> |
||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<el-row :gutter="10" class="mb8"> |
||||
|
<!-- <el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
plain |
||||
|
icon="el-icon-plus" |
||||
|
size="mini" |
||||
|
@click="handleAdd" |
||||
|
v-hasPermi="['user:coin:add']" |
||||
|
>新增</el-button> |
||||
|
</el-col> --> |
||||
|
<!-- <el-col :span="1.5">--> |
||||
|
<!-- <el-button--> |
||||
|
<!-- type="success"--> |
||||
|
<!-- plain--> |
||||
|
<!-- icon="el-icon-edit"--> |
||||
|
<!-- size="mini"--> |
||||
|
<!-- :disabled="single"--> |
||||
|
<!-- @click="handleUpdate"--> |
||||
|
<!-- v-hasPermi="['user:coin:edit']"--> |
||||
|
<!-- >修改</el-button>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="1.5">--> |
||||
|
<!-- <el-button--> |
||||
|
<!-- type="danger"--> |
||||
|
<!-- plain--> |
||||
|
<!-- icon="el-icon-delete"--> |
||||
|
<!-- size="mini"--> |
||||
|
<!-- :disabled="multiple"--> |
||||
|
<!-- @click="handleDelete"--> |
||||
|
<!-- v-hasPermi="['user:coin:remove']"--> |
||||
|
<!-- >删除</el-button>--> |
||||
|
<!-- </el-col>--> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="warning" |
||||
|
plain |
||||
|
icon="el-icon-download" |
||||
|
size="mini" |
||||
|
@click="handleExport" |
||||
|
v-hasPermi="['user:coin:export']" |
||||
|
>导出</el-button> |
||||
|
</el-col> |
||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-table v-loading="loading" :data="coinList" @selection-change="handleSelectionChange"> |
||||
|
<el-table-column type="selection" width="55" align="center" /> |
||||
|
<el-table-column label="ID" align="center" prop="id" /> |
||||
|
<el-table-column label="币种名称" align="center" prop="name" /> |
||||
|
<el-table-column label="中文名称" align="center" prop="nameCn" /> |
||||
|
<el-table-column label="详细名称" align="center" prop="nameEn" /> |
||||
|
<el-table-column label="链名称" align="center" prop="chainName" /> |
||||
|
<!-- <el-table-column label="是否可以充值" align="center" prop="canRecharge" /> |
||||
|
<el-table-column label="是否可以转让" align="center" prop="canTransfer" /> |
||||
|
<el-table-column label="是否可以提现" align="center" prop="canWithdraw" /> |
||||
|
<el-table-column label="是否为平台币" align="center" prop="isPlatformCoin" /> |
||||
|
<el-table-column label="单日最大提币量" align="center" prop="maxDailyWithdrawRate" /> --> |
||||
|
<el-table-column label="类型" align="center" prop="feeType" :formatter="feeTypeFormat" /> |
||||
|
<el-table-column label="手续费" align="center" prop="maxTxFee" /> |
||||
|
<el-table-column label="最大提币数量" align="center" prop="maxWithdrawAmount" /> |
||||
|
<el-table-column label="最小提现费用" align="center" prop="minTxFee" /> |
||||
|
<el-table-column label="最小提币手续费" align="center" prop="minWithdrawAmount" /> |
||||
|
<!-- <el-table-column label="最小充币数量" align="center" prop="minRechargeAmount" /> --> |
||||
|
<!-- <el-table-column label="排序" align="center" prop="sort" /> --> |
||||
|
<!-- <el-table-column label="人民币汇率" align="center" prop="cnyRate" /> |
||||
|
<el-table-column label="美元汇率" align="center" prop="usdRate" /> --> |
||||
|
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" /> |
||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-edit" |
||||
|
@click="handleUpdate(scope.row)" |
||||
|
v-hasPermi="['user:coin:edit']" |
||||
|
>修改</el-button> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-delete" |
||||
|
@click="handleDelete(scope.row)" |
||||
|
v-hasPermi="['user:coin:remove']" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<pagination |
||||
|
v-show="total>0" |
||||
|
:total="total" |
||||
|
:page.sync="queryParams.pageNum" |
||||
|
:limit.sync="queryParams.pageSize" |
||||
|
@pagination="getList" |
||||
|
/> |
||||
|
|
||||
|
<!-- 添加或修改币种配置对话框 --> |
||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
||||
|
<!-- <el-form-item label="类型" prop="feeType"> |
||||
|
<el-select v-model="form.feeType" placeholder="请选择类型"> |
||||
|
<el-option label="按笔" value="pen"></el-option> |
||||
|
<el-option label="百分比" value="percentage"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item label="类型" prop="feeType"> |
||||
|
<el-select v-model="form.feeType" placeholder="请选择类型" clearable size="small"> |
||||
|
<el-option v-for="dict in feeTypeOptions" :key="dict.dictValue" :label="dict.dictLabel" |
||||
|
:value="dict.dictValue" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="手续费" prop="maxTxFee"> |
||||
|
<el-input v-model="form.maxTxFee" placeholder="手续费" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="最大提币数量" prop="maxWithdrawAmount"> |
||||
|
<el-input v-model="form.maxWithdrawAmount" placeholder="请输入最大提币数量" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="最小提币手续费" prop="minWithdrawAmount"> |
||||
|
<el-input v-model="form.minWithdrawAmount" placeholder="请输入最小提币手续费" /> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
<el-form-item label="状态" prop="status"> |
||||
|
<el-select v-model="form.status" placeholder="请选择状态" clearable size="small"> |
||||
|
<el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" |
||||
|
:value="dict.dictValue" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
|
<el-button @click="cancel">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { listCoin, getCoin, delCoin, addCoin, updateCoin, exportCoin } from "@/api/user/coin"; |
||||
|
|
||||
|
export default { |
||||
|
name: "Coin", |
||||
|
components: { |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
// 遮罩层 |
||||
|
loading: true, |
||||
|
// 选中数组 |
||||
|
ids: [], |
||||
|
// 非单个禁用 |
||||
|
single: true, |
||||
|
// 非多个禁用 |
||||
|
multiple: true, |
||||
|
// 显示搜索条件 |
||||
|
showSearch: true, |
||||
|
// 总条数 |
||||
|
total: 0, |
||||
|
// 币种配置表格数据 |
||||
|
coinList: [], |
||||
|
statusOptions: [], |
||||
|
feeTypeOptions: [], |
||||
|
// 弹出层标题 |
||||
|
title: "", |
||||
|
// 是否显示弹出层 |
||||
|
open: false, |
||||
|
// 查询参数 |
||||
|
queryParams: { |
||||
|
pageNum: 1, |
||||
|
pageSize: 10, |
||||
|
name: null, |
||||
|
nameCn: null, |
||||
|
nameEn: null, |
||||
|
chainName: null, |
||||
|
canRecharge: null, |
||||
|
canTransfer: null, |
||||
|
canWithdraw: null, |
||||
|
coldWalletAddress: null, |
||||
|
isPlatformCoin: null, |
||||
|
maxDailyWithdrawRate: null, |
||||
|
feeType: null, |
||||
|
maxTxFee: null, |
||||
|
maxWithdrawAmount: null, |
||||
|
minTxFee: null, |
||||
|
minWithdrawAmount: null, |
||||
|
minRechargeAmount: null, |
||||
|
minerFee: null, |
||||
|
sgdRate: null, |
||||
|
sort: null, |
||||
|
cnyRate: null, |
||||
|
usdRate: null, |
||||
|
status: null, |
||||
|
withdrawScale: null, |
||||
|
withdrawThreshold: null |
||||
|
}, |
||||
|
// 表单参数 |
||||
|
form: {}, |
||||
|
// 表单校验 |
||||
|
rules: { |
||||
|
nameCn: [ |
||||
|
{ required: true, message: "中文名称不能为空", trigger: "blur" } |
||||
|
], |
||||
|
nameEn: [ |
||||
|
{ required: true, message: "详细名称不能为空", trigger: "blur" } |
||||
|
], |
||||
|
maxTxFee: [ |
||||
|
{ required: true, message: "最大提现手续费不能为空", trigger: "blur" } |
||||
|
], |
||||
|
minTxFee: [ |
||||
|
{ required: true, message: "最小提现费用不能为空", trigger: "blur" } |
||||
|
], |
||||
|
sort: [ |
||||
|
{ required: true, message: "排序不能为空", trigger: "blur" } |
||||
|
], |
||||
|
} |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.getList(); |
||||
|
|
||||
|
this.getDicts("sys_normal_disable").then(response => { |
||||
|
this.statusOptions = response.data; |
||||
|
}); |
||||
|
|
||||
|
this.getDicts("fee_type").then(response => { |
||||
|
this.feeTypeOptions = response.data; |
||||
|
}); |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
/** 查询币种配置列表 */ |
||||
|
getList() { |
||||
|
this.loading = true; |
||||
|
listCoin(this.queryParams).then(response => { |
||||
|
this.coinList = response.rows; |
||||
|
this.total = response.total; |
||||
|
this.loading = false; |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
// 状态字典 |
||||
|
statusFormat(row, column) { |
||||
|
return this.selectDictLabel(this.statusOptions, row.status); |
||||
|
}, |
||||
|
|
||||
|
// 状态字典 |
||||
|
feeTypeFormat(row, column) { |
||||
|
return this.selectDictLabel(this.feeTypeOptions, row.feeType); |
||||
|
}, |
||||
|
// 取消按钮 |
||||
|
cancel() { |
||||
|
this.open = false; |
||||
|
this.reset(); |
||||
|
}, |
||||
|
// 表单重置 |
||||
|
reset() { |
||||
|
this.form = { |
||||
|
id: null, |
||||
|
name: null, |
||||
|
nameCn: null, |
||||
|
nameEn: null, |
||||
|
chainName: null, |
||||
|
canRecharge: null, |
||||
|
canTransfer: null, |
||||
|
canWithdraw: null, |
||||
|
coldWalletAddress: null, |
||||
|
isPlatformCoin: null, |
||||
|
maxDailyWithdrawRate: null, |
||||
|
feeType: null, |
||||
|
maxTxFee: null, |
||||
|
maxWithdrawAmount: null, |
||||
|
minTxFee: null, |
||||
|
minWithdrawAmount: null, |
||||
|
minRechargeAmount: null, |
||||
|
minerFee: null, |
||||
|
sgdRate: null, |
||||
|
sort: null, |
||||
|
cnyRate: null, |
||||
|
usdRate: null, |
||||
|
status:'1', |
||||
|
withdrawScale: null, |
||||
|
withdrawThreshold: null |
||||
|
}; |
||||
|
this.resetForm("form"); |
||||
|
}, |
||||
|
/** 搜索按钮操作 */ |
||||
|
handleQuery() { |
||||
|
this.queryParams.pageNum = 1; |
||||
|
this.getList(); |
||||
|
}, |
||||
|
/** 重置按钮操作 */ |
||||
|
resetQuery() { |
||||
|
this.resetForm("queryForm"); |
||||
|
this.handleQuery(); |
||||
|
}, |
||||
|
// 多选框选中数据 |
||||
|
handleSelectionChange(selection) { |
||||
|
this.ids = selection.map(item => item.id) |
||||
|
this.single = selection.length!==1 |
||||
|
this.multiple = !selection.length |
||||
|
}, |
||||
|
/** 新增按钮操作 */ |
||||
|
handleAdd() { |
||||
|
this.reset(); |
||||
|
this.open = true; |
||||
|
this.title = "添加币种配置"; |
||||
|
}, |
||||
|
/** 修改按钮操作 */ |
||||
|
handleUpdate(row) { |
||||
|
this.reset(); |
||||
|
const id = row.id || this.ids |
||||
|
getCoin(id).then(response => { |
||||
|
this.form = response.data; |
||||
|
this.open = true; |
||||
|
this.title = "修改币种配置"; |
||||
|
this.form.status=response.data.status+""; |
||||
|
}); |
||||
|
}, |
||||
|
/** 提交按钮 */ |
||||
|
submitForm() { |
||||
|
this.$refs["form"].validate(valid => { |
||||
|
if (valid) { |
||||
|
if (this.form.id != null) { |
||||
|
updateCoin(this.form).then(response => { |
||||
|
this.msgSuccess("修改成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
} else { |
||||
|
addCoin(this.form).then(response => { |
||||
|
this.msgSuccess("新增成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
/** 删除按钮操作 */ |
||||
|
handleDelete(row) { |
||||
|
const ids = row.id || this.ids; |
||||
|
this.$confirm('是否确认删除币种配置编号为"' + ids + '"的数据项?', "警告", { |
||||
|
confirmButtonText: "确定", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning" |
||||
|
}).then(function() { |
||||
|
return delCoin(ids); |
||||
|
}).then(() => { |
||||
|
this.getList(); |
||||
|
this.msgSuccess("删除成功"); |
||||
|
}) |
||||
|
}, |
||||
|
/** 导出按钮操作 */ |
||||
|
handleExport() { |
||||
|
const queryParams = this.queryParams; |
||||
|
this.$confirm('是否确认导出所有币种配置数据项?', "警告", { |
||||
|
confirmButtonText: "确定", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning" |
||||
|
}).then(function() { |
||||
|
return exportCoin(queryParams); |
||||
|
}).then(response => { |
||||
|
this.download(response.msg); |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
@ -0,0 +1,501 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
||||
|
|
||||
|
<el-form-item label="订单号" prop="orderNo"> |
||||
|
<el-input |
||||
|
v-model="queryParams.orderNo" |
||||
|
placeholder="请输入订单号" |
||||
|
clearable |
||||
|
size="small" |
||||
|
@keyup.enter.native="handleQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="消息标题 中文" prop="mailTitleZh"> |
||||
|
<el-input |
||||
|
v-model="queryParams.mailTitleZh" |
||||
|
placeholder="请输入消息标题 中文" |
||||
|
clearable |
||||
|
size="small" |
||||
|
@keyup.enter.native="handleQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="消息状态" prop="mailState"> |
||||
|
<el-select v-model="queryParams.mailState" placeholder="请选择消息状态" clearable size="small"> |
||||
|
<el-option |
||||
|
v-for="dict in mailStateOptions" |
||||
|
:key="dict.dictValue" |
||||
|
:label="dict.dictLabel" |
||||
|
:value="dict.dictValue" |
||||
|
/> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
<el-form-item label="状态" prop="mailState"> |
||||
|
<el-select v-model="queryParams.dataStatus" placeholder="请选择状态" clearable size="small"> |
||||
|
<el-option |
||||
|
v-for="dict in dataStatusOptions" |
||||
|
:key="dict.dictValue" |
||||
|
:label="dict.dictLabel" |
||||
|
:value="dict.dictValue" |
||||
|
/> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="模板类型" prop="mailState"> |
||||
|
<el-select v-model="queryParams.mailType" placeholder="请选择模板类型" clearable size="small"> |
||||
|
<el-option |
||||
|
v-for="dict in mailTypeOptions" |
||||
|
:key="dict.dictValue" |
||||
|
:label="dict.dictLabel" |
||||
|
:value="dict.dictValue" |
||||
|
/> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
<el-form-item> |
||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<el-row :gutter="10" class="mb8"> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
plain |
||||
|
icon="el-icon-plus" |
||||
|
size="mini" |
||||
|
@click="handleAdd" |
||||
|
v-hasPermi="['user:mail:add']" |
||||
|
>新增</el-button> |
||||
|
</el-col> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="success" |
||||
|
plain |
||||
|
icon="el-icon-edit" |
||||
|
size="mini" |
||||
|
:disabled="single" |
||||
|
@click="handleUpdate" |
||||
|
v-hasPermi="['user:mail:edit']" |
||||
|
>修改</el-button> |
||||
|
</el-col> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="danger" |
||||
|
plain |
||||
|
icon="el-icon-delete" |
||||
|
size="mini" |
||||
|
:disabled="multiple" |
||||
|
@click="handleDelete" |
||||
|
v-hasPermi="['user:mail:remove']" |
||||
|
>删除</el-button> |
||||
|
</el-col> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="warning" |
||||
|
plain |
||||
|
icon="el-icon-download" |
||||
|
size="mini" |
||||
|
@click="handleExport" |
||||
|
v-hasPermi="['user:mail:export']" |
||||
|
>导出</el-button> |
||||
|
</el-col> |
||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-table v-loading="loading" :data="mailList" @selection-change="handleSelectionChange"> |
||||
|
<el-table-column type="selection" width="55" align="center" /> |
||||
|
<el-table-column label="站内信id" align="center" prop="mailId" /> |
||||
|
<el-table-column label="发送者" align="center" prop="sender" /> |
||||
|
<el-table-column label="接收者" align="center" prop="recipient" /> |
||||
|
<el-table-column label="图片" align="center" prop="mailImg" > |
||||
|
<template width="90" slot-scope="scope"> |
||||
|
<el-image |
||||
|
style="width: 80px; height: 80px" |
||||
|
:src="scope.row.mailImg" |
||||
|
@click="previewImage(scope.row.mailImg)" |
||||
|
:preview-src-list="srcList" |
||||
|
></el-image> |
||||
|
|
||||
|
<!-- <img style="width:80px;height:80px;border:none;" :src="scope.row.chainIconUrl"> --> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="订单号" align="center" prop="orderNo" /> |
||||
|
<el-table-column label="消息标题 中文" align="center" prop="mailTitleZh" /> |
||||
|
<el-table-column label="消息标题 英文" align="center" prop="mailTitleEn" /> |
||||
|
<el-table-column label="消息标题 繁体" align="center" prop="mailTitleFt" /> |
||||
|
<el-table-column label="消息详情 中文" align="center" prop="mailDetailsZh" /> |
||||
|
<el-table-column label="消息详情 英文" align="center" prop="mailDetailsEn" /> |
||||
|
<el-table-column label="消息详情 繁体" align="center" prop="mailDetailsFt" /> |
||||
|
<el-table-column label="消息状态" align="center" prop="mailState" :formatter="mailStateFormat" /> |
||||
|
<el-table-column label="状态" align="center" prop="dataStatus" :formatter="dataStatusFormat" /> |
||||
|
<el-table-column label="消息模板类型" align="center" prop="mailType" :formatter="mailTypeFormat" /> |
||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-edit" |
||||
|
@click="handleUpdate(scope.row)" |
||||
|
v-hasPermi="['user:mail:edit']" |
||||
|
>修改</el-button> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-delete" |
||||
|
@click="handleDelete(scope.row)" |
||||
|
v-hasPermi="['user:mail:remove']" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<pagination |
||||
|
v-show="total>0" |
||||
|
:total="total" |
||||
|
:page.sync="queryParams.pageNum" |
||||
|
:limit.sync="queryParams.pageSize" |
||||
|
@pagination="getList" |
||||
|
/> |
||||
|
|
||||
|
<!-- 添加或修改站内信对话框 --> |
||||
|
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body> |
||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="82px"> |
||||
|
<!-- <el-form-item label="发送者" prop="sender"> |
||||
|
<el-input v-model="form.sender" placeholder="请输入发送者" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="接收者" prop="recipient"> |
||||
|
<el-input v-model="form.recipient" placeholder="请输入接收者" /> |
||||
|
</el-form-item> --> |
||||
|
|
||||
|
<el-form-item label="图片" prop="mailImg"> |
||||
|
<!-- <el-input v-model="form.icon" placeholder="请输入图标" />--> |
||||
|
<el-upload |
||||
|
class="avatar-uploader" |
||||
|
:show-file-list="false" |
||||
|
:action="uploadUrl()" |
||||
|
:on-success="handleAvatarSuccess" |
||||
|
:before-upload="beforeAvatarUpload" |
||||
|
:data="{path:'otc'}" |
||||
|
> |
||||
|
<img v-if="form.mailImg" :src="form.mailImg" class="avatar" style="width: 150px" height="150px"> |
||||
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i> |
||||
|
</el-upload> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<!-- |
||||
|
<el-form-item label="订单号" prop="orderNo"> |
||||
|
<el-input v-model="form.orderNo" placeholder="请输入订单号" /> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item label="消息标题 中文" prop="mailTitleZh"> |
||||
|
<el-input v-model="form.mailTitleZh" placeholder="请输入消息标题 中文" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="消息标题 英文" prop="mailTitleEn"> |
||||
|
<el-input v-model="form.mailTitleEn" placeholder="请输入消息标题 英文" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="消息标题 繁体" prop="mailTitleFt"> |
||||
|
<el-input v-model="form.mailTitleFt" placeholder="请输入消息标题 繁体" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="消息详情 中文"> |
||||
|
<editor v-model="form.mailDetailsZh" :min-height="192"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="消息详情 英文"> |
||||
|
<editor v-model="form.mailDetailsEn" :min-height="192"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="消息详情 繁体"> |
||||
|
<editor v-model="form.mailDetailsFt" :min-height="192"/> |
||||
|
</el-form-item> |
||||
|
<!-- <el-form-item label="消息状态" prop="mailState"> |
||||
|
<el-select v-model="form.mailState" placeholder="请选择消息状态 read已读 未读unread"> |
||||
|
<el-option |
||||
|
v-for="dict in mailStateOptions" |
||||
|
:key="dict.dictValue" |
||||
|
:label="dict.dictLabel" |
||||
|
:value="dict.dictValue" |
||||
|
></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> --> |
||||
|
|
||||
|
<el-form-item label="状态" prop="mailState"> |
||||
|
<el-select v-model="form.dataStatus" placeholder="请选择状态"> |
||||
|
<el-option |
||||
|
v-for="dict in dataStatusOptions" |
||||
|
:key="dict.dictValue" |
||||
|
:label="dict.dictLabel" |
||||
|
:value="dict.dictValue" |
||||
|
></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<el-form-item label="消息模板类型" prop="mailState"> |
||||
|
<el-select v-model="form.mailType" placeholder="请选择消息模板类型"> |
||||
|
<el-option |
||||
|
v-for="dict in mailTypeOptions" |
||||
|
:key="dict.dictValue" |
||||
|
:label="dict.dictLabel" |
||||
|
:value="dict.dictValue" |
||||
|
></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
|
<el-button @click="cancel">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { listMail, getMail, delMail, addMail, updateMail, exportMail } from "@/api/user/mail"; |
||||
|
import ImageUpload from '@/components/ImageUpload'; |
||||
|
import Editor from '@/components/Editor'; |
||||
|
|
||||
|
export default { |
||||
|
name: "Mail", |
||||
|
components: { |
||||
|
ImageUpload, |
||||
|
Editor, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
// 遮罩层 |
||||
|
loading: true, |
||||
|
// 选中数组 |
||||
|
ids: [], |
||||
|
// 非单个禁用 |
||||
|
single: true, |
||||
|
// 非多个禁用 |
||||
|
multiple: true, |
||||
|
// 显示搜索条件 |
||||
|
showSearch: true, |
||||
|
// 总条数 |
||||
|
total: 0, |
||||
|
// 站内信表格数据 |
||||
|
mailList: [], |
||||
|
// 弹出层标题 |
||||
|
title: "", |
||||
|
// 是否显示弹出层 |
||||
|
open: false, |
||||
|
// 消息状态 read已读 未读unread字典 |
||||
|
mailStateOptions: [], |
||||
|
|
||||
|
// mail_type 消息模板类型 system系统 order订单 |
||||
|
mailTypeOptions: [], |
||||
|
|
||||
|
// 消息状态 read已读 未读unread字典 |
||||
|
dataStatusOptions: [], |
||||
|
// 查询参数 |
||||
|
queryParams: { |
||||
|
pageNum: 1, |
||||
|
pageSize: 10, |
||||
|
sender: null, |
||||
|
recipient: null, |
||||
|
mailImg: null, |
||||
|
orderNo: null, |
||||
|
mailTitleZh: null, |
||||
|
mailTitleEn: null, |
||||
|
mailTitleFt: null, |
||||
|
mailDetailsZh: null, |
||||
|
mailDetailsEn: null, |
||||
|
mailDetailsFt: null, |
||||
|
mailState: null, |
||||
|
dataStatus: null, |
||||
|
mailType: null, |
||||
|
}, |
||||
|
// 表单参数 |
||||
|
form: {}, |
||||
|
// 表单校验 |
||||
|
rules: { |
||||
|
}, |
||||
|
// 预览 |
||||
|
srcList: ["http://118.25.187.239:9099/img/adImg/557097620301025280.jpg"], |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
created() { |
||||
|
this.getList(); |
||||
|
this.getDicts("mail_type").then(response => { |
||||
|
this.mailTypeOptions = response.data; |
||||
|
}); |
||||
|
this.getDicts("mail_state").then(response => { |
||||
|
this.mailStateOptions = response.data; |
||||
|
}); |
||||
|
|
||||
|
this.getDicts("sys_yes_no").then(response => { |
||||
|
this.dataStatusOptions = response.data; |
||||
|
}); |
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
uploadUrl:function(){ |
||||
|
// 地址 |
||||
|
return process.env.VUE_APP_BASE_API+"/system/ftpfile/uploadFile" |
||||
|
}, |
||||
|
// 预览图片 |
||||
|
previewImage(abUrl) { |
||||
|
this.srcList[0] = abUrl; |
||||
|
}, |
||||
|
/** 查询站内信列表 */ |
||||
|
getList() { |
||||
|
this.loading = true; |
||||
|
listMail(this.queryParams).then(response => { |
||||
|
this.mailList = response.rows; |
||||
|
this.total = response.total; |
||||
|
this.loading = false; |
||||
|
}); |
||||
|
}, |
||||
|
// 消息状态 read已读 未读unread字典翻译 |
||||
|
mailStateFormat(row, column) { |
||||
|
return this.selectDictLabel(this.mailStateOptions, row.mailState); |
||||
|
}, |
||||
|
|
||||
|
// 消息状态 |
||||
|
mailTypeFormat(row, column) { |
||||
|
return this.selectDictLabel(this.mailTypeOptions, row.mailType); |
||||
|
}, |
||||
|
|
||||
|
// 消息状态 read已读 未读unread字典翻译 |
||||
|
dataStatusFormat(row, column) { |
||||
|
return this.selectDictLabel(this.dataStatusOptions, row.dataStatus); |
||||
|
}, |
||||
|
// 取消按钮 |
||||
|
cancel() { |
||||
|
this.open = false; |
||||
|
this.reset(); |
||||
|
}, |
||||
|
|
||||
|
// 预览图片 |
||||
|
previewImage(abUrl) { |
||||
|
this.srcList[0] = abUrl; |
||||
|
}, |
||||
|
// 表单重置 |
||||
|
reset() { |
||||
|
this.form = { |
||||
|
mailId: null, |
||||
|
sender: null, |
||||
|
recipient: null, |
||||
|
mailImg: null, |
||||
|
orderNo: null, |
||||
|
mailTitleZh: null, |
||||
|
mailTitleEn: null, |
||||
|
mailTitleFt: null, |
||||
|
mailDetailsZh: null, |
||||
|
mailDetailsEn: null, |
||||
|
mailDetailsFt: null, |
||||
|
mailState: null, |
||||
|
dataStatus: "0", |
||||
|
mailType: null, |
||||
|
createTime: null, |
||||
|
updateTime: null |
||||
|
}; |
||||
|
this.resetForm("form"); |
||||
|
}, |
||||
|
/** 搜索按钮操作 */ |
||||
|
handleQuery() { |
||||
|
this.queryParams.pageNum = 1; |
||||
|
this.getList(); |
||||
|
}, |
||||
|
/** 重置按钮操作 */ |
||||
|
resetQuery() { |
||||
|
this.resetForm("queryForm"); |
||||
|
this.handleQuery(); |
||||
|
}, |
||||
|
// 多选框选中数据 |
||||
|
handleSelectionChange(selection) { |
||||
|
this.ids = selection.map(item => item.mailId) |
||||
|
this.single = selection.length!==1 |
||||
|
this.multiple = !selection.length |
||||
|
}, |
||||
|
/** 新增按钮操作 */ |
||||
|
handleAdd() { |
||||
|
this.reset(); |
||||
|
this.open = true; |
||||
|
this.title = "添加站内信"; |
||||
|
}, |
||||
|
/** 修改按钮操作 */ |
||||
|
handleUpdate(row) { |
||||
|
this.reset(); |
||||
|
const mailId = row.mailId || this.ids |
||||
|
getMail(mailId).then(response => { |
||||
|
this.form = response.data; |
||||
|
this.open = true; |
||||
|
this.title = "修改站内信"; |
||||
|
}); |
||||
|
}, |
||||
|
/** 提交按钮 */ |
||||
|
submitForm() { |
||||
|
this.$refs["form"].validate(valid => { |
||||
|
if (valid) { |
||||
|
if (this.form.mailId != null) { |
||||
|
updateMail(this.form).then(response => { |
||||
|
this.msgSuccess("修改成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
} else { |
||||
|
addMail(this.form).then(response => { |
||||
|
this.msgSuccess("新增成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
/** 删除按钮操作 */ |
||||
|
handleDelete(row) { |
||||
|
const mailIds = row.mailId || this.ids; |
||||
|
this.$confirm('是否确认删除站内信编号为"' + mailIds + '"的数据项?', "警告", { |
||||
|
confirmButtonText: "确定", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning" |
||||
|
}).then(function() { |
||||
|
return delMail(mailIds); |
||||
|
}).then(() => { |
||||
|
this.getList(); |
||||
|
this.msgSuccess("删除成功"); |
||||
|
}) |
||||
|
}, |
||||
|
/** 导出按钮操作 */ |
||||
|
handleExport() { |
||||
|
const queryParams = this.queryParams; |
||||
|
this.$confirm('是否确认导出所有站内信数据项?', "警告", { |
||||
|
confirmButtonText: "确定", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning" |
||||
|
}).then(function() { |
||||
|
return exportMail(queryParams); |
||||
|
}).then(response => { |
||||
|
this.download(response.msg); |
||||
|
}) |
||||
|
}, |
||||
|
// 图片上传组件自带的成功回调函数 |
||||
|
handleAvatarSuccess(res) { |
||||
|
console.log(res); |
||||
|
this.form.icon = res.data.url; |
||||
|
}, |
||||
|
beforeAvatarUpload(file) { |
||||
|
const isJPG = file.type === 'image/jpeg' || file.type === 'image/png'; |
||||
|
const isLt2M = file.size / 1024 / 1024 < 20; |
||||
|
|
||||
|
if (!isJPG) { |
||||
|
this.$modal.$message.error('上传头像图片只能是 JPG或png 格式!'); |
||||
|
} |
||||
|
if (!isLt2M) { |
||||
|
this.$modal.$message.error('上传头像图片大小不能超过 20MB!'); |
||||
|
} |
||||
|
return isJPG && isLt2M; |
||||
|
}, |
||||
|
} |
||||
|
}; |
||||
|
</script> |
@ -0,0 +1,286 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
||||
|
<el-form-item label="证件名称" prop="name"> |
||||
|
<el-input |
||||
|
v-model="queryParams.name" |
||||
|
placeholder="请输入证件名称" |
||||
|
clearable |
||||
|
size="small" |
||||
|
@keyup.enter.native="handleQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="状态" prop="status"> |
||||
|
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small"> |
||||
|
<el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" |
||||
|
:value="dict.dictValue" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
<el-form-item> |
||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<el-row :gutter="10" class="mb8"> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
plain |
||||
|
icon="el-icon-plus" |
||||
|
size="mini" |
||||
|
@click="handleAdd" |
||||
|
v-hasPermi="['user:type:add']" |
||||
|
>新增</el-button> |
||||
|
</el-col> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="success" |
||||
|
plain |
||||
|
icon="el-icon-edit" |
||||
|
size="mini" |
||||
|
:disabled="single" |
||||
|
@click="handleUpdate" |
||||
|
v-hasPermi="['user:type:edit']" |
||||
|
>修改</el-button> |
||||
|
</el-col> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="danger" |
||||
|
plain |
||||
|
icon="el-icon-delete" |
||||
|
size="mini" |
||||
|
:disabled="multiple" |
||||
|
@click="handleDelete" |
||||
|
v-hasPermi="['user:type:remove']" |
||||
|
>删除</el-button> |
||||
|
</el-col> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="warning" |
||||
|
plain |
||||
|
icon="el-icon-download" |
||||
|
size="mini" |
||||
|
@click="handleExport" |
||||
|
v-hasPermi="['user:type:export']" |
||||
|
>导出</el-button> |
||||
|
</el-col> |
||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange"> |
||||
|
<el-table-column type="selection" width="55" align="center" /> |
||||
|
<el-table-column label="" align="center" prop="id" /> |
||||
|
<el-table-column label="证件名称" align="center" prop="name" /> |
||||
|
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat"/> |
||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-edit" |
||||
|
@click="handleUpdate(scope.row)" |
||||
|
v-hasPermi="['user:type:edit']" |
||||
|
>修改</el-button> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-delete" |
||||
|
@click="handleDelete(scope.row)" |
||||
|
v-hasPermi="['user:type:remove']" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<pagination |
||||
|
v-show="total>0" |
||||
|
:total="total" |
||||
|
:page.sync="queryParams.pageNum" |
||||
|
:limit.sync="queryParams.pageSize" |
||||
|
@pagination="getList" |
||||
|
/> |
||||
|
|
||||
|
<!-- 添加或修改证件类型对话框 --> |
||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
||||
|
<el-form-item label="证件名称" prop="name"> |
||||
|
<el-input v-model="form.name" placeholder="请输入证件名称" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="状态" prop="status"> |
||||
|
<el-select v-model="form.status" placeholder="请选择状态" clearable size="small"> |
||||
|
<el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" |
||||
|
:value="dict.dictValue" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
|
<el-button @click="cancel">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { listType, getType, delType, addType, updateType, exportType } from "@/api/user/type"; |
||||
|
|
||||
|
export default { |
||||
|
name: "Type", |
||||
|
components: { |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
// 遮罩层 |
||||
|
loading: true, |
||||
|
// 选中数组 |
||||
|
ids: [], |
||||
|
// 非单个禁用 |
||||
|
single: true, |
||||
|
// 非多个禁用 |
||||
|
multiple: true, |
||||
|
// 显示搜索条件 |
||||
|
showSearch: true, |
||||
|
// 总条数 |
||||
|
total: 0, |
||||
|
// 证件类型表格数据 |
||||
|
typeList: [], |
||||
|
statusOptions: [], |
||||
|
// 弹出层标题 |
||||
|
title: "", |
||||
|
// 是否显示弹出层 |
||||
|
open: false, |
||||
|
// 查询参数 |
||||
|
queryParams: { |
||||
|
pageNum: 1, |
||||
|
pageSize: 10, |
||||
|
name: null, |
||||
|
status: null |
||||
|
}, |
||||
|
// 表单参数 |
||||
|
form: {}, |
||||
|
// 表单校验 |
||||
|
rules: { |
||||
|
} |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.getList(); |
||||
|
this.getDicts("sys_yes_no").then(response => { |
||||
|
this.statusOptions = response.data; |
||||
|
}); |
||||
|
}, |
||||
|
methods: { |
||||
|
/** 查询证件类型列表 */ |
||||
|
getList() { |
||||
|
this.loading = true; |
||||
|
listType(this.queryParams).then(response => { |
||||
|
this.typeList = response.rows; |
||||
|
this.total = response.total; |
||||
|
this.loading = false; |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
// 状态字典 |
||||
|
statusFormat(row, column) { |
||||
|
return this.selectDictLabel(this.statusOptions, row.status); |
||||
|
}, |
||||
|
// 取消按钮 |
||||
|
cancel() { |
||||
|
this.open = false; |
||||
|
this.reset(); |
||||
|
}, |
||||
|
// 表单重置 |
||||
|
reset() { |
||||
|
this.form = { |
||||
|
id: null, |
||||
|
name: null, |
||||
|
status: "" |
||||
|
}; |
||||
|
this.resetForm("form"); |
||||
|
}, |
||||
|
/** 搜索按钮操作 */ |
||||
|
handleQuery() { |
||||
|
this.queryParams.pageNum = 1; |
||||
|
this.getList(); |
||||
|
}, |
||||
|
/** 重置按钮操作 */ |
||||
|
resetQuery() { |
||||
|
this.resetForm("queryForm"); |
||||
|
this.handleQuery(); |
||||
|
}, |
||||
|
// 多选框选中数据 |
||||
|
handleSelectionChange(selection) { |
||||
|
this.ids = selection.map(item => item.id) |
||||
|
this.single = selection.length!==1 |
||||
|
this.multiple = !selection.length |
||||
|
}, |
||||
|
/** 新增按钮操作 */ |
||||
|
handleAdd() { |
||||
|
this.reset(); |
||||
|
this.open = true; |
||||
|
this.title = "添加证件类型"; |
||||
|
}, |
||||
|
/** 修改按钮操作 */ |
||||
|
handleUpdate(row) { |
||||
|
this.reset(); |
||||
|
const id = row.id || this.ids |
||||
|
getType(id).then(response => { |
||||
|
this.form = response.data; |
||||
|
this.open = true; |
||||
|
this.title = "修改证件类型"; |
||||
|
}); |
||||
|
}, |
||||
|
/** 提交按钮 */ |
||||
|
submitForm() { |
||||
|
this.$refs["form"].validate(valid => { |
||||
|
if (valid) { |
||||
|
if (this.form.id != null) { |
||||
|
updateType(this.form).then(response => { |
||||
|
this.msgSuccess("修改成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
} else { |
||||
|
addType(this.form).then(response => { |
||||
|
this.msgSuccess("新增成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
/** 删除按钮操作 */ |
||||
|
handleDelete(row) { |
||||
|
const ids = row.id || this.ids; |
||||
|
this.$confirm('是否确认删除证件类型编号为"' + ids + '"的数据项?', "警告", { |
||||
|
confirmButtonText: "确定", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning" |
||||
|
}).then(function() { |
||||
|
return delType(ids); |
||||
|
}).then(() => { |
||||
|
this.getList(); |
||||
|
this.msgSuccess("删除成功"); |
||||
|
}) |
||||
|
}, |
||||
|
/** 导出按钮操作 */ |
||||
|
handleExport() { |
||||
|
const queryParams = this.queryParams; |
||||
|
this.$confirm('是否确认导出所有证件类型数据项?', "警告", { |
||||
|
confirmButtonText: "确定", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning" |
||||
|
}).then(function() { |
||||
|
return exportType(queryParams); |
||||
|
}).then(response => { |
||||
|
this.download(response.msg); |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
Loading…
Reference in new issue