|
@@ -140,7 +140,7 @@
|
|
|
getStoreInfo,
|
|
|
saveStore,
|
|
|
} from "@/api/store";
|
|
|
- import {saveCurrency,getCurrencyList} from '@/api/currency'
|
|
|
+ import {saveCurrency,getCurrencyList,updateCurrency} from '@/api/currency'
|
|
|
export default {
|
|
|
name: "StoreList",
|
|
|
components: {
|
|
@@ -198,11 +198,18 @@
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
name: [
|
|
|
- { required: true, message: "货币名称不能为空", trigger: "blur" },
|
|
|
-
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: this.$t('currency.currencyNameRequired'),
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
],
|
|
|
- symbol:[
|
|
|
- { required: true, message: "货币符号不能为空", trigger: "blur" },
|
|
|
+ symbol: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: this.$t('currency.currencySymbolRequired'),
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
]
|
|
|
},
|
|
|
};
|
|
@@ -213,139 +220,125 @@
|
|
|
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;
|
|
|
- }
|
|
|
- );
|
|
|
+ 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();
|
|
|
+ this.queryParams.page = 1;
|
|
|
+ this.getList();
|
|
|
},
|
|
|
// 重置按钮操作
|
|
|
resetQuery() {
|
|
|
- this.dateRange = [];
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
|
|
|
- this.handleQuery();
|
|
|
+ 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.$modal
|
|
|
- .confirm("确认要" + text + '"' + row.name + '"店铺吗?')
|
|
|
- .then(function () {
|
|
|
- return updateStoreStatus(row.id, row.status);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.$modal.msgSuccess(text + "成功");
|
|
|
- })
|
|
|
- .catch(function () {
|
|
|
- row.status = row.status === "N" ? "A" : "N";
|
|
|
- });
|
|
|
+ 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;
|
|
|
+ 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();
|
|
|
+ this.queryParams.orderByColumn = column.prop;
|
|
|
+ this.queryParams.isAsc = column.order;
|
|
|
+ this.getList();
|
|
|
},
|
|
|
// 新增按钮操作
|
|
|
handleAdd() {
|
|
|
- this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = "新增货币";
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.title = this.$t('currency.addNewCurrency');
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
- this.form = {
|
|
|
- id: "",
|
|
|
- name: "",
|
|
|
- symbol:'',
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
+ this.form = {
|
|
|
+ id: "",
|
|
|
+ name: "",
|
|
|
+ symbol: ''
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
},
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
+ 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.open = false
|
|
|
- this.getList()
|
|
|
- })
|
|
|
- }else{
|
|
|
- saveCurrency(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- }
|
|
|
- // if (this.form.id) {
|
|
|
- // saveStore(this.form).then((response) => {
|
|
|
- // this.$modal.msgSuccess("修改成功");
|
|
|
- // this.open = false;
|
|
|
- // this.getList();
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // saveStore(this.form).then((response) => {
|
|
|
- // this.$modal.msgSuccess("新增成功");
|
|
|
- // this.open = false;
|
|
|
- // this.getList();
|
|
|
- // });
|
|
|
- // }
|
|
|
- }
|
|
|
- });
|
|
|
+ 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;
|
|
|
+ this.qr = { type: "store", id: row.id };
|
|
|
+ this.openQrCode = true;
|
|
|
},
|
|
|
// 关闭二维码
|
|
|
closeDialog() {
|
|
|
- this.openQrCode = false;
|
|
|
+ this.openQrCode = false;
|
|
|
},
|
|
|
// 修改按钮操作
|
|
|
handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
-
|
|
|
- this.title = "编辑货币";
|
|
|
- this.open = true;
|
|
|
- const {id,name,symbol} = row
|
|
|
- this.form={id,name,symbol}
|
|
|
-
|
|
|
+ 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;
|
|
|
+ this.form.logo = file.data.fileName;
|
|
|
},
|
|
|
handleUploadLicenseSuccess(file) {
|
|
|
- this.form.license = file.data.fileName;
|
|
|
+ this.form.license = file.data.fileName;
|
|
|
},
|
|
|
handleUploadCertSuccess(file) {
|
|
|
- this.form.wxCertPath = file.data.fileName;
|
|
|
- this.wxCertPath = file.data.fileName;
|
|
|
- },
|
|
|
- },
|
|
|
- };
|
|
|
+ this.form.wxCertPath = file.data.fileName;
|
|
|
+ this.wxCertPath = file.data.fileName;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
.common-dialog >>> .el-upload--picture-card {
|