update: fix bugs

This commit is contained in:
2025-10-13 15:52:52 +08:00
parent a1fee0a3e9
commit e285ee2d24
6 changed files with 408 additions and 33 deletions

View File

@@ -0,0 +1,50 @@
import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/kiosk/price-list/list',
method: 'get',
params: {
...params,
current,
size,
}
})
}
export const getDetail = (id) => {
return request({
url: '/kiosk/price-list/detail',
method: 'get',
params: {
id
}
})
}
export const remove = (ids) => {
return request({
url: '/kiosk/price-list/remove',
method: 'post',
params: {
ids,
}
})
}
export const add = (row) => {
return request({
url: '/kiosk/price-list/submit',
method: 'post',
data: row
})
}
export const update = (row) => {
return request({
url: '/kiosk/price-list/submit',
method: 'post',
data: row
})
}

View File

@@ -0,0 +1,158 @@
export default {
height: 'auto',
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
viewBtn: false,
addBtn: false,
editBtn: false,
delBtn: false,
menu: false,
searchBtn: false,
emptyBtn:false,
selection: false,
columnBtn: false,
searchShowBtn: false,
refreshBtn: false,
gridBtn: false,
dialogClickModal: false,
column: [
{
label: '主键',
prop: 'id',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true
},
{
label: '租户ID',
prop: 'tenantId',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true
},
{
label: 'cid',
prop: 'categoryId',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true
},
{
label: 'Category',
prop: 'name',
type: 'input'
},
{
label: 'Type',
prop: 'categoryType',
type: 'input'
},
{
label: 'Shape',
prop: 'shape',
type: 'input'
},
{
label: 'Material',
prop: 'material',
type: 'input'
},
{
label: 'Size',
prop: 'size',
type: 'input'
},
{
label: 'Currency',
prop: 'currency',
type: 'input'
},
{
label: 'Price',
prop: 'price',
type: 'input'
},
{
label: 'DeptId',
prop: 'deptId',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true
},
{
label: '创建人',
prop: 'createUser',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true
},
{
label: '创建部门',
prop: 'createDept',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true
},
{
label: '创建时间',
prop: 'createTime',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true
},
{
label: '修改人',
prop: 'updateUser',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true
},
{
label: '修改时间',
prop: 'updateTime',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true
},
{
label: '状态',
prop: 'status',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true
},
{
label: '是否已删除',
prop: 'isDeleted',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true
}
]
};

View File

@@ -0,0 +1,167 @@
<template>
<basic-container>
<avue-crud :option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
:table-loading="loading"
:data="data"
:permission="permissionList"
:before-open="beforeOpen"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
</avue-crud>
</basic-container>
</template>
<script>
import { getList, getDetail, add, update, remove } from '@/api/kiosk/priceList';
import option from '@/option/kiosk/priceList';
import { mapGetters } from 'vuex';
import 'nprogress/nprogress.css';
export default {
data() {
return {
form: {},
depts: '',
query: {},
search: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
selectionList: [],
option: option,
data: [],
deptOptions: [],
};
},
computed: {
...mapGetters(['permission']),
permissionList() {
return {
addBtn: this.validData(this.permission.priceList_add, false),
viewBtn: this.validData(this.permission.priceList_view, false),
delBtn: this.validData(this.permission.priceList_delete, false),
editBtn: this.validData(this.permission.priceList_edit, false)
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(',');
}
},
methods: {
rowSave(row, done, loading) {
add(row).then(() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: 'Success!'
});
done();
}, error => {
loading();
window.console.log(error);
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: 'Success!'
});
done();
}, error => {
loading();
console.log(error);
});
},
rowDel(row) {
this.$confirm('Confirmation for Delete?', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning'
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: 'Success!'
});
});
},
beforeOpen(done, type) {
if (['edit', 'view'].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
const {} = this.query;
let values = {};
getList(page.currentPage, page.pageSize, values).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
}
}
};
</script>
<style>
</style>

View File

@@ -83,7 +83,7 @@
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!" message: "Success!"
}); });
done(); done();
}, error => { }, error => {
@@ -96,7 +96,7 @@
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!" message: "Success!"
}); });
done(); done();
}, error => { }, error => {
@@ -105,9 +105,9 @@
}); });
}, },
rowDel(row) { rowDel(row) {
this.$confirm("确定将选择数据删除?", { this.$confirm("Confirmation for delete?", {
confirmButtonText: "确定", confirmButtonText: "Confirm",
cancelButtonText: "取消", cancelButtonText: "Cancel",
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
@@ -117,18 +117,18 @@
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!" message: "Success!"
}); });
}); });
}, },
handleDelete() { handleDelete() {
if (this.selectionList.length === 0) { if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据"); this.$message.warning("Please select one or more");
return; return;
} }
this.$confirm("确定将选择数据删除?", { this.$confirm("Confirmation for delete?", {
confirmButtonText: "确定", confirmButtonText: "Confirm",
cancelButtonText: "取消", cancelButtonText: "Cancel",
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
@@ -138,7 +138,7 @@
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!" message: "Success!"
}); });
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
}); });

View File

@@ -38,7 +38,7 @@
icon="el-icon-circle-plus" icon="el-icon-circle-plus"
@click.stop="handleAdd(scope.row, scope.index)" @click.stop="handleAdd(scope.row, scope.index)"
v-if="userInfo.authority.includes('admin')" v-if="userInfo.authority.includes('admin')"
>ADD SUB >Add Sub
</el-button> </el-button>
</template> </template>
<template #deptCategory="{ row }"> <template #deptCategory="{ row }">

View File

@@ -194,8 +194,8 @@
</el-tree> </el-tree>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="roleBox = false">取 消</el-button> <el-button @click="roleBox = false">Cancel</el-button>
<el-button type="primary" @click="submitRole">确 定</el-button> <el-button type="primary" @click="submitRole">Confirm</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@@ -518,7 +518,7 @@ export default {
this.$message.warning('Please select one or more'); this.$message.warning('Please select one or more');
return; return;
} }
this.$confirm('Confirmation for DEL?', { this.$confirm('Confirmation for Delete?', {
confirmButtonText: 'Confirm', confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel', cancelButtonText: 'Cancel',
type: 'warning' type: 'warning'
@@ -544,7 +544,7 @@ export default {
this.$message.warning('please select one or more'); this.$message.warning('please select one or more');
return; return;
} }
this.$confirm('确定将选择数据通过审核?', { this.$confirm('Confirmation for pass audit?', {
confirmButtonText: 'Confirm', confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel', cancelButtonText: 'Cancel',
type: 'warning' type: 'warning'
@@ -566,9 +566,9 @@ export default {
this.$message.warning('Please select at least one record'); this.$message.warning('Please select at least one record');
return; return;
} }
this.$confirm('确定将选择数据拒绝审核?', { this.$confirm('Confirmation for reject audit?', {
confirmButtonText: '确定', confirmButtonText: 'Confirm',
cancelButtonText: '取消', cancelButtonText: 'Cancel',
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
@@ -592,9 +592,9 @@ export default {
this.$message.warning('Please select at least one record'); this.$message.warning('Please select at least one record');
return; return;
} }
this.$confirm('确定将选择账号密码重置为初始密码?', { this.$confirm('Confirmation for rest password?', {
confirmButtonText: '确定', confirmButtonText: 'Confirm',
cancelButtonText: '取消', cancelButtonText: 'Cancel',
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
@@ -603,7 +603,7 @@ export default {
.then(() => { .then(() => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '操作成功!' message: 'Success!'
}); });
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
}); });
@@ -630,9 +630,9 @@ export default {
this.$message.warning('Please select at least one record'); this.$message.warning('Please select at least one record');
return; return;
} }
this.$confirm('确定将选择账号解封?', { this.$confirm('Confirmation for unlock account?', {
confirmButtonText: '确定', confirmButtonText: 'Confirm',
cancelButtonText: '取消', cancelButtonText: 'Cancel',
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
@@ -641,7 +641,7 @@ export default {
.then(() => { .then(() => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '操作成功!' message: 'Success!'
}); });
}); });
}, },
@@ -657,9 +657,9 @@ export default {
handleExport() { handleExport() {
const account = func.toStr(this.search.account); const account = func.toStr(this.search.account);
const realName = func.toStr(this.search.realName); const realName = func.toStr(this.search.realName);
this.$confirm('是否导出用户数据?', '提示', { this.$confirm('Export user data?', 'Tips', {
confirmButtonText: '确定', confirmButtonText: 'Confirm',
cancelButtonText: '取消', cancelButtonText: 'Cancel',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
NProgress.start(); NProgress.start();
@@ -668,7 +668,7 @@ export default {
this.website.tokenHeader this.website.tokenHeader
}=${getToken()}&account=${account}&realName=${realName}` }=${getToken()}&account=${account}&realName=${realName}`
).then(res => { ).then(res => {
downloadXls(res.data, `用户数据表${this.$dayjs().format('YYYY-MM-DD')}.xlsx`); downloadXls(res.data, `UserData${this.$dayjs().format('YYYY-MM-DD')}.xlsx`);
NProgress.done(); NProgress.done();
}); });
}); });
@@ -677,7 +677,7 @@ export default {
exportBlob( exportBlob(
`/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}` `/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`
).then(res => { ).then(res => {
downloadXls(res.data, '用户数据模板.xlsx'); downloadXls(res.data, 'UserDataTemplate.xlsx');
}); });
}, },
beforeOpen(done, type) { beforeOpen(done, type) {
@@ -736,7 +736,7 @@ export default {
this.platformOnLoad(this.platformPage); this.platformOnLoad(this.platformPage);
this.$message({ this.$message({
type: 'success', type: 'success',
message: '操作成功!' message: 'Success!'
}); });
done(); done();
}, },