|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
+ <div class="app-container">
|
|
|
<el-form
|
|
|
:model="queryParams"
|
|
|
class="main-search"
|
|
@@ -19,12 +19,7 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- icon="el-icon-search"
|
|
|
- size="mini"
|
|
|
- @click="handleQuery"
|
|
|
- >
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">
|
|
|
{{ $t('currency.search') }}
|
|
|
</el-button>
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">
|
|
@@ -50,7 +45,11 @@
|
|
|
:default-sort="defaultSort"
|
|
|
@sort-change="handleSortChange"
|
|
|
>
|
|
|
- <el-table-column :label="$t('currency.ID')" prop="id" width="55" />
|
|
|
+ <el-table-column :label="$t('currency.ID')" prop="id" width="55">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ showIdLastFour(scope.row.id) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column :label="$t('currency.currencyName')" align="center" prop="name" />
|
|
|
<el-table-column :label="$t('currency.currencySymbol')" align="center" prop="symbol" />
|
|
|
<el-table-column
|
|
@@ -72,12 +71,7 @@
|
|
|
class-name="small-padding fixed-width"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
- >
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">
|
|
|
{{ $t('currency.modify') }}
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -131,228 +125,221 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
- <script>
|
|
|
- import FuintQrCode from "@/components/Fuint/QrCode";
|
|
|
- import { getToken } from "@/utils/auth";
|
|
|
- import {
|
|
|
- getStoreList,
|
|
|
- updateStoreStatus,
|
|
|
- getStoreInfo,
|
|
|
- saveStore,
|
|
|
- } from "@/api/store";
|
|
|
- import {saveCurrency,getCurrencyList,updateCurrency} from '@/api/currency'
|
|
|
- export default {
|
|
|
- name: "StoreList",
|
|
|
- components: {
|
|
|
- FuintQrCode,
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- // 二维码
|
|
|
- qr: null,
|
|
|
- // 二维码对话框
|
|
|
- openQrCode: false,
|
|
|
- // 遮罩层
|
|
|
- loading: true,
|
|
|
- // 标题
|
|
|
- title: "",
|
|
|
- // 选中数组
|
|
|
- ids: [],
|
|
|
- // 非多个禁用
|
|
|
- multiple: true,
|
|
|
- // 显示搜索条件
|
|
|
- showSearch: true,
|
|
|
- // 总条数
|
|
|
- total: 0,
|
|
|
- // 表格数据
|
|
|
- list: [],
|
|
|
- // 是否显示弹出层
|
|
|
- open: false,
|
|
|
- // 日期范围
|
|
|
- dateRange: [],
|
|
|
- // 默认排序
|
|
|
- defaultSort: { prop: "operTime", order: "descending" },
|
|
|
- // 表单参数
|
|
|
- form: {
|
|
|
- name: "",
|
|
|
- symbol:''
|
|
|
- },
|
|
|
- // 微信支付证书
|
|
|
- wxCertPath: "",
|
|
|
- // 上传地址
|
|
|
- uploadAction: process.env.VUE_APP_SERVER_URL + "/backendApi/file/upload",
|
|
|
- // 隐藏上传
|
|
|
- hideUpload: false,
|
|
|
- // 上传文件列表
|
|
|
- uploadFiles: [],
|
|
|
- uploadHeader: { "Access-Token": getToken() },
|
|
|
- merchantOptions: [],
|
|
|
- // 图片根目录
|
|
|
- imagePath: "",
|
|
|
- // 查询参数
|
|
|
- queryParams: {
|
|
|
- page: 1,
|
|
|
- pageSize: 10,
|
|
|
- name: "",
|
|
|
- },
|
|
|
- // 表单校验
|
|
|
- rules: {
|
|
|
- name: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: this.$t('currency.currencyNameRequired'),
|
|
|
- trigger: "blur"
|
|
|
- }
|
|
|
- ],
|
|
|
- symbol: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: this.$t('currency.currencySymbolRequired'),
|
|
|
- trigger: "blur"
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- };
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 查询列表
|
|
|
- getList() {
|
|
|
- this.loading = true;
|
|
|
- getCurrencyList(this.queryParams).then(
|
|
|
- (response) => {
|
|
|
- console.log('res;', response);
|
|
|
- this.list = response.data;
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- }
|
|
|
- );
|
|
|
- },
|
|
|
- // 搜索按钮操作
|
|
|
- handleQuery() {
|
|
|
- this.queryParams.page = 1;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- // 重置按钮操作
|
|
|
- resetQuery() {
|
|
|
- this.dateRange = [];
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
|
|
|
- this.handleQuery();
|
|
|
- },
|
|
|
- // 状态修改
|
|
|
- handleStatusChange(row) {
|
|
|
- let text = row.status === "A" ? this.$t('currency.enable') : this.$t('currency.disable');
|
|
|
- const confirmMsg = this.$t('currency.confirmChangeStatus', { action: text, name: row.name });
|
|
|
- this.$modal
|
|
|
- .confirm(confirmMsg)
|
|
|
- .then(() => {
|
|
|
- return updateStoreStatus(row.id, row.status);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- const successMsg = this.$t('currency.statusChangeSuccess', { action: text });
|
|
|
- this.$modal.msgSuccess(successMsg);
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- row.status = row.status === "N" ? "A" : "N";
|
|
|
- });
|
|
|
- },
|
|
|
- // 多选框选中数据
|
|
|
- handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map((item) => item.operId);
|
|
|
- this.multiple = !selection.length;
|
|
|
- },
|
|
|
- // 排序触发事件
|
|
|
- handleSortChange(column, prop, order) {
|
|
|
- this.queryParams.orderByColumn = column.prop;
|
|
|
- this.queryParams.isAsc = column.order;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- // 新增按钮操作
|
|
|
- handleAdd() {
|
|
|
- this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = this.$t('currency.addNewCurrency');
|
|
|
- },
|
|
|
- // 表单重置
|
|
|
- reset() {
|
|
|
- this.form = {
|
|
|
- id: "",
|
|
|
- name: "",
|
|
|
- symbol: ''
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
- },
|
|
|
- // 取消按钮
|
|
|
- cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
- },
|
|
|
- // 提交按钮
|
|
|
- submitForm: function () {
|
|
|
- this.$refs["form"].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- if (this.form.id) {
|
|
|
- updateCurrency(this.form).then((response) => {
|
|
|
- this.$modal.msgSuccess(this.$t('currency.modifySuccess'));
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- } else {
|
|
|
- saveCurrency(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess(this.$t('currency.addSuccess'));
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
+<script>
|
|
|
+import FuintQrCode from '@/components/Fuint/QrCode'
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
+import { updateStoreStatus } from '@/api/store'
|
|
|
+import { saveCurrency, getCurrencyList, updateCurrency } from '@/api/currency'
|
|
|
+export default {
|
|
|
+ name: 'StoreList',
|
|
|
+ components: {
|
|
|
+ FuintQrCode
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
// 二维码
|
|
|
- handleQrCode(row) {
|
|
|
- this.qr = { type: "store", id: row.id };
|
|
|
- this.openQrCode = true;
|
|
|
- },
|
|
|
- // 关闭二维码
|
|
|
- closeDialog() {
|
|
|
- this.openQrCode = false;
|
|
|
+ qr: null,
|
|
|
+ // 二维码对话框
|
|
|
+ openQrCode: false,
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 标题
|
|
|
+ title: '',
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 表格数据
|
|
|
+ list: [],
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 日期范围
|
|
|
+ dateRange: [],
|
|
|
+ // 默认排序
|
|
|
+ defaultSort: { prop: 'operTime', order: 'descending' },
|
|
|
+ // 表单参数
|
|
|
+ form: {
|
|
|
+ name: '',
|
|
|
+ symbol: ''
|
|
|
},
|
|
|
- // 修改按钮操作
|
|
|
- handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
- this.title = this.$t('currency.editCurrency');
|
|
|
- this.open = true;
|
|
|
- const { id, name, symbol } = row;
|
|
|
- this.form = { id, name, symbol };
|
|
|
+ // 微信支付证书
|
|
|
+ wxCertPath: '',
|
|
|
+ // 上传地址
|
|
|
+ uploadAction: process.env.VUE_APP_SERVER_URL + '/backendApi/file/upload',
|
|
|
+ // 隐藏上传
|
|
|
+ hideUpload: false,
|
|
|
+ // 上传文件列表
|
|
|
+ uploadFiles: [],
|
|
|
+ uploadHeader: { 'Access-Token': getToken() },
|
|
|
+ merchantOptions: [],
|
|
|
+ // 图片根目录
|
|
|
+ imagePath: '',
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ page: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ name: ''
|
|
|
},
|
|
|
- handleUploadSuccess(file) {
|
|
|
- this.form.logo = file.data.fileName;
|
|
|
- },
|
|
|
- handleUploadLicenseSuccess(file) {
|
|
|
- this.form.license = file.data.fileName;
|
|
|
- },
|
|
|
- handleUploadCertSuccess(file) {
|
|
|
- this.form.wxCertPath = file.data.fileName;
|
|
|
- this.wxCertPath = file.data.fileName;
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ name: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: this.$t('currency.currencyNameRequired'),
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ symbol: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: this.$t('currency.currencySymbolRequired'),
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
}
|
|
|
- };
|
|
|
- </script>
|
|
|
- <style scoped>
|
|
|
- .common-dialog >>> .el-upload--picture-card {
|
|
|
- width: 60px;
|
|
|
- height: 50px;
|
|
|
- line-height: 60px;
|
|
|
- }
|
|
|
- .upload-cert >>> .el-upload {
|
|
|
- width: 20px;
|
|
|
- height: 20px;
|
|
|
- line-height: 20px;
|
|
|
- }
|
|
|
- .upload-cert .file-name {
|
|
|
- width: 700px;
|
|
|
- text-align: left;
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 查询列表
|
|
|
+ getList() {
|
|
|
+ this.loading = true
|
|
|
+ getCurrencyList(this.queryParams).then((response) => {
|
|
|
+ console.log('res;', response)
|
|
|
+ this.list = response.data
|
|
|
+ this.total = response.total
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 搜索按钮操作
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.page = 1
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ // 重置按钮操作
|
|
|
+ resetQuery() {
|
|
|
+ this.dateRange = []
|
|
|
+ this.resetForm('queryForm')
|
|
|
+ this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
|
|
|
+ this.handleQuery()
|
|
|
+ },
|
|
|
+ // 状态修改
|
|
|
+ handleStatusChange(row) {
|
|
|
+ let text = row.status === 'A' ? this.$t('currency.enable') : this.$t('currency.disable')
|
|
|
+ const confirmMsg = this.$t('currency.confirmChangeStatus', { action: text, name: row.name })
|
|
|
+ this.$modal
|
|
|
+ .confirm(confirmMsg)
|
|
|
+ .then(() => {
|
|
|
+ return updateStoreStatus(row.id, row.status)
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ const successMsg = this.$t('currency.statusChangeSuccess', { action: text })
|
|
|
+ this.$modal.msgSuccess(successMsg)
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ row.status = row.status === 'N' ? 'A' : 'N'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map((item) => item.operId)
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ // 排序触发事件
|
|
|
+ handleSortChange(column, prop, order) {
|
|
|
+ this.queryParams.orderByColumn = column.prop
|
|
|
+ this.queryParams.isAsc = column.order
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ // 新增按钮操作
|
|
|
+ handleAdd() {
|
|
|
+ this.reset()
|
|
|
+ this.open = true
|
|
|
+ this.title = this.$t('currency.addNewCurrency')
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: '',
|
|
|
+ name: '',
|
|
|
+ symbol: ''
|
|
|
+ }
|
|
|
+ this.resetForm('form')
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false
|
|
|
+ this.reset()
|
|
|
+ },
|
|
|
+ // 提交按钮
|
|
|
+ submitForm: function () {
|
|
|
+ this.$refs['form'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id) {
|
|
|
+ updateCurrency(this.form).then((response) => {
|
|
|
+ this.$modal.msgSuccess(this.$t('currency.modifySuccess'))
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ saveCurrency(this.form).then((response) => {
|
|
|
+ this.$modal.msgSuccess(this.$t('currency.addSuccess'))
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 二维码
|
|
|
+ handleQrCode(row) {
|
|
|
+ this.qr = { type: 'store', id: row.id }
|
|
|
+ this.openQrCode = true
|
|
|
+ },
|
|
|
+ // 关闭二维码
|
|
|
+ closeDialog() {
|
|
|
+ this.openQrCode = false
|
|
|
+ },
|
|
|
+ // 修改按钮操作
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset()
|
|
|
+ this.title = this.$t('currency.editCurrency')
|
|
|
+ this.open = true
|
|
|
+ const { id, name, symbol } = row
|
|
|
+ this.form = { id, name, symbol }
|
|
|
+ },
|
|
|
+ handleUploadSuccess(file) {
|
|
|
+ this.form.logo = file.data.fileName
|
|
|
+ },
|
|
|
+ handleUploadLicenseSuccess(file) {
|
|
|
+ this.form.license = file.data.fileName
|
|
|
+ },
|
|
|
+ handleUploadCertSuccess(file) {
|
|
|
+ this.form.wxCertPath = file.data.fileName
|
|
|
+ this.wxCertPath = file.data.fileName
|
|
|
+ }
|
|
|
}
|
|
|
- </style>
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+.common-dialog >>> .el-upload--picture-card {
|
|
|
+ width: 60px;
|
|
|
+ height: 50px;
|
|
|
+ line-height: 60px;
|
|
|
+}
|
|
|
+.upload-cert >>> .el-upload {
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ line-height: 20px;
|
|
|
+}
|
|
|
+.upload-cert .file-name {
|
|
|
+ width: 700px;
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+</style>
|