update: fix bugs
This commit is contained in:
50
src/api/kiosk/priceList.js
Normal file
50
src/api/kiosk/priceList.js
Normal 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
|
||||
})
|
||||
}
|
||||
|
||||
158
src/option/kiosk/priceList.js
Normal file
158
src/option/kiosk/priceList.js
Normal 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
|
||||
}
|
||||
]
|
||||
};
|
||||
167
src/views/kiosk/priceList.vue
Normal file
167
src/views/kiosk/priceList.vue
Normal 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>
|
||||
@@ -83,7 +83,7 @@
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
message: "Success!"
|
||||
});
|
||||
done();
|
||||
}, error => {
|
||||
@@ -96,7 +96,7 @@
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
message: "Success!"
|
||||
});
|
||||
done();
|
||||
}, error => {
|
||||
@@ -105,9 +105,9 @@
|
||||
});
|
||||
},
|
||||
rowDel(row) {
|
||||
this.$confirm("确定将选择数据删除?", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
this.$confirm("Confirmation for delete?", {
|
||||
confirmButtonText: "Confirm",
|
||||
cancelButtonText: "Cancel",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
@@ -117,18 +117,18 @@
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
message: "Success!"
|
||||
});
|
||||
});
|
||||
},
|
||||
handleDelete() {
|
||||
if (this.selectionList.length === 0) {
|
||||
this.$message.warning("请选择至少一条数据");
|
||||
this.$message.warning("Please select one or more");
|
||||
return;
|
||||
}
|
||||
this.$confirm("确定将选择数据删除?", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
this.$confirm("Confirmation for delete?", {
|
||||
confirmButtonText: "Confirm",
|
||||
cancelButtonText: "Cancel",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
@@ -138,7 +138,7 @@
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
message: "Success!"
|
||||
});
|
||||
this.$refs.crud.toggleSelection();
|
||||
});
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
icon="el-icon-circle-plus"
|
||||
@click.stop="handleAdd(scope.row, scope.index)"
|
||||
v-if="userInfo.authority.includes('admin')"
|
||||
>ADD SUB
|
||||
>Add Sub
|
||||
</el-button>
|
||||
</template>
|
||||
<template #deptCategory="{ row }">
|
||||
|
||||
@@ -194,8 +194,8 @@
|
||||
</el-tree>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="roleBox = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitRole">确 定</el-button>
|
||||
<el-button @click="roleBox = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="submitRole">Confirm</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -518,7 +518,7 @@ export default {
|
||||
this.$message.warning('Please select one or more');
|
||||
return;
|
||||
}
|
||||
this.$confirm('Confirmation for DEL?', {
|
||||
this.$confirm('Confirmation for Delete?', {
|
||||
confirmButtonText: 'Confirm',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning'
|
||||
@@ -544,7 +544,7 @@ export default {
|
||||
this.$message.warning('please select one or more');
|
||||
return;
|
||||
}
|
||||
this.$confirm('确定将选择数据通过审核?', {
|
||||
this.$confirm('Confirmation for pass audit?', {
|
||||
confirmButtonText: 'Confirm',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning'
|
||||
@@ -566,9 +566,9 @@ export default {
|
||||
this.$message.warning('Please select at least one record');
|
||||
return;
|
||||
}
|
||||
this.$confirm('确定将选择数据拒绝审核?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
this.$confirm('Confirmation for reject audit?', {
|
||||
confirmButtonText: 'Confirm',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
@@ -592,9 +592,9 @@ export default {
|
||||
this.$message.warning('Please select at least one record');
|
||||
return;
|
||||
}
|
||||
this.$confirm('确定将选择账号密码重置为初始密码?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
this.$confirm('Confirmation for rest password?', {
|
||||
confirmButtonText: 'Confirm',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
@@ -603,7 +603,7 @@ export default {
|
||||
.then(() => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!'
|
||||
message: 'Success!'
|
||||
});
|
||||
this.$refs.crud.toggleSelection();
|
||||
});
|
||||
@@ -630,9 +630,9 @@ export default {
|
||||
this.$message.warning('Please select at least one record');
|
||||
return;
|
||||
}
|
||||
this.$confirm('确定将选择账号解封?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
this.$confirm('Confirmation for unlock account?', {
|
||||
confirmButtonText: 'Confirm',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
@@ -641,7 +641,7 @@ export default {
|
||||
.then(() => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!'
|
||||
message: 'Success!'
|
||||
});
|
||||
});
|
||||
},
|
||||
@@ -657,9 +657,9 @@ export default {
|
||||
handleExport() {
|
||||
const account = func.toStr(this.search.account);
|
||||
const realName = func.toStr(this.search.realName);
|
||||
this.$confirm('是否导出用户数据?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
this.$confirm('Export user data?', 'Tips', {
|
||||
confirmButtonText: 'Confirm',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
NProgress.start();
|
||||
@@ -668,7 +668,7 @@ export default {
|
||||
this.website.tokenHeader
|
||||
}=${getToken()}&account=${account}&realName=${realName}`
|
||||
).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();
|
||||
});
|
||||
});
|
||||
@@ -677,7 +677,7 @@ export default {
|
||||
exportBlob(
|
||||
`/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`
|
||||
).then(res => {
|
||||
downloadXls(res.data, '用户数据模板.xlsx');
|
||||
downloadXls(res.data, 'UserDataTemplate.xlsx');
|
||||
});
|
||||
},
|
||||
beforeOpen(done, type) {
|
||||
@@ -736,7 +736,7 @@ export default {
|
||||
this.platformOnLoad(this.platformPage);
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!'
|
||||
message: 'Success!'
|
||||
});
|
||||
done();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user