16 changed files with 4906 additions and 4565 deletions
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 64 KiB |
@ -1,278 +1,286 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud v-if="edit" |
||||
<avue-crud |
||||
v-if="edit" |
||||
: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"> |
||||
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" |
||||
> |
||||
<template #menu-left> |
||||
<el-button type="danger" |
||||
icon="el-icon-delete" |
||||
plain |
||||
v-if="permission.basicDeline_delete" |
||||
@click="handleDelete">删 除 |
||||
<el-button |
||||
type="danger" |
||||
icon="el-icon-delete" |
||||
plain |
||||
v-if="permission.basicDeline_delete" |
||||
@click="handleDelete" |
||||
>删 除 |
||||
</el-button> |
||||
<el-button type="primary" icon="el-icon-plus" @click="addEditDeline()">新 增</el-button> |
||||
<el-button type="primary" @click="nodeManagement()">节 点 管 理</el-button> |
||||
<!-- <el-button type="warning"--> |
||||
<!-- plain--> |
||||
<!-- icon="el-icon-download"--> |
||||
<!-- @click="handleExport">导 出--> |
||||
<!-- </el-button>--> |
||||
<el-button type="primary" icon="el-icon-plus" @click="addEditDeline()">新 增</el-button> |
||||
<el-button type="primary" @click="nodeManagement()">节 点 管 理</el-button> |
||||
<!-- <el-button type="warning"--> |
||||
<!-- plain--> |
||||
<!-- icon="el-icon-download"--> |
||||
<!-- @click="handleExport">导 出--> |
||||
<!-- </el-button>--> |
||||
</template> |
||||
<template #menu="{size,row,index}"> |
||||
<el-button type="primary" text icon="el-icon-view" @click="addEditDeline(row)">编 辑</el-button> |
||||
<el-button type="primary" text icon="el-icon-view" @click="viewDeline(row)">查 看</el-button> |
||||
<template #menu="{ size, row, index }"> |
||||
<el-button type="primary" text icon="el-icon-view" @click="addEditDeline(row)" |
||||
>编 辑</el-button |
||||
> |
||||
<el-button type="primary" text icon="el-icon-view" @click="viewDeline(row)" |
||||
>查 看</el-button |
||||
> |
||||
</template> |
||||
</avue-crud> |
||||
<basicDeLineform v-if="!edit" @returnDeline ="returnDeline" :delineformdata="delineformdata" /> |
||||
<basicDeLineform v-if="!edit" @returnDeline="returnDeline" :delineformdata="delineformdata" /> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import {getList, getDetail, add, update, remove} from "@/api/basic/basicDeline"; |
||||
import option from "@/option/basic/basicDeline"; |
||||
import {mapGetters} from "vuex"; |
||||
import {exportBlob} from "@/api/common"; |
||||
import {getToken} from '@/utils/auth'; |
||||
import {downloadXls} from "@/utils/util"; |
||||
import {dateNow} from "@/utils/date"; |
||||
import NProgress from 'nprogress'; |
||||
import 'nprogress/nprogress.css'; |
||||
import basicDeLineform from '/src/views/basic/deline/basicdeLineform.vue' |
||||
export default { |
||||
components: { basicDeLineform }, |
||||
data() { |
||||
import { getList, getDetail, add, update, remove } from '@/api/basic/basicDeline'; |
||||
import option from '@/option/basic/basicDeline'; |
||||
import { mapGetters } from 'vuex'; |
||||
import { exportBlob } from '@/api/common'; |
||||
import { getToken } from '@/utils/auth'; |
||||
import { downloadXls } from '@/utils/util'; |
||||
import { dateNow } from '@/utils/date'; |
||||
import NProgress from 'nprogress'; |
||||
import 'nprogress/nprogress.css'; |
||||
import basicDeLineform from '/src/views/basic/deline/basicdeLineform.vue'; |
||||
export default { |
||||
components: { basicDeLineform }, |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
search: {}, |
||||
loading: true, |
||||
edit: true, |
||||
delineformdata: {}, |
||||
page: { |
||||
pageSize: 30, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
selectionList: [], |
||||
option: option, |
||||
data: [], |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(['permission']), |
||||
permissionList() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
search: {}, |
||||
loading: true, |
||||
edit:true, |
||||
delineformdata:{}, |
||||
page: { |
||||
pageSize: 30, |
||||
currentPage: 1, |
||||
total: 0 |
||||
}, |
||||
selectionList: [], |
||||
option: option, |
||||
data: [] |
||||
addBtn: this.validData(this.permission.basicDeline_add, false), |
||||
viewBtn: this.validData(this.permission.basicDeline_view, false), |
||||
delBtn: this.validData(this.permission.basicDeline_delete, false), |
||||
editBtn: this.validData(this.permission.basicDeline_edit, false), |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
addBtn: this.validData(this.permission.basicDeline_add, false), |
||||
viewBtn: this.validData(this.permission.basicDeline_view, false), |
||||
delBtn: this.validData(this.permission.basicDeline_delete, false), |
||||
editBtn: this.validData(this.permission.basicDeline_edit, false) |
||||
}; |
||||
}, |
||||
ids() { |
||||
let ids = []; |
||||
this.selectionList.forEach(ele => { |
||||
ids.push(ele.id); |
||||
}); |
||||
return ids.join(","); |
||||
ids() { |
||||
let ids = []; |
||||
this.selectionList.forEach(ele => { |
||||
ids.push(ele.id); |
||||
}); |
||||
return ids.join(','); |
||||
}, |
||||
}, |
||||
methods: { |
||||
//节点管理 |
||||
nodeManagement() { |
||||
this.$router.push({ |
||||
path: '/basic/delinenode/basicDelineNode', |
||||
query: {}, |
||||
}); |
||||
}, |
||||
returnDeline(val) { |
||||
console.log('取消>>>>>', val); |
||||
this.edit = true; |
||||
}, |
||||
addEditDeline(row) { |
||||
console.log('row>>>>>>>>>>>>>>>>>>>>', row); |
||||
this.delineformdata = {}; |
||||
this.delineformdata.view = false; |
||||
if (!!row) { |
||||
this.delineformdata = row; |
||||
this.delineformdata.view = false; |
||||
this.delineformdata.delinenode = [{}]; |
||||
this.delineformdata.end = [{}]; |
||||
} |
||||
this.edit = false; |
||||
}, |
||||
methods: { |
||||
//节点管理 |
||||
nodeManagement(){ |
||||
this.$router.push({ |
||||
path: '/basic/delinenode/basicDelineNode', |
||||
query: { |
||||
} |
||||
}); |
||||
}, |
||||
returnDeline(val){ |
||||
console.log("取消>>>>>",val); |
||||
this.edit = true; |
||||
}, |
||||
addEditDeline(row){ |
||||
console.log("row>>>>>>>>>>>>>>>>>>>>",row); |
||||
this.delineformdata={} |
||||
this.delineformdata.view =false; |
||||
if (!!row){ |
||||
this.delineformdata = row |
||||
this.delineformdata.view =false; |
||||
this.delineformdata.delinenode = [{}] |
||||
this.delineformdata.end = [{}] |
||||
} |
||||
this.edit =false |
||||
|
||||
}, |
||||
|
||||
viewDeline(row){ |
||||
console.log("row>>>>>>>>>>>>>>>>>>>>",row); |
||||
this.delineformdata={} |
||||
viewDeline(row) { |
||||
console.log('row>>>>>>>>>>>>>>>>>>>>', row); |
||||
this.delineformdata = {}; |
||||
// if (!!row){ |
||||
this.delineformdata = row |
||||
this.delineformdata.view =true; |
||||
this.delineformdata.delinenode = [{}] |
||||
this.delineformdata.end = [{}] |
||||
// } |
||||
this.edit =false |
||||
|
||||
}, |
||||
rowSave(row, done, loading) { |
||||
add(row).then(() => { |
||||
this.delineformdata = row; |
||||
this.delineformdata.view = true; |
||||
this.delineformdata.delinenode = [{}]; |
||||
this.delineformdata.end = [{}]; |
||||
// } |
||||
this.edit = false; |
||||
}, |
||||
rowSave(row, done, loading) { |
||||
add(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
type: 'success', |
||||
message: '操作成功!', |
||||
}); |
||||
done(); |
||||
}, error => { |
||||
}, |
||||
error => { |
||||
loading(); |
||||
window.console.log(error); |
||||
}); |
||||
}, |
||||
rowUpdate(row, index, done, loading) { |
||||
update(row).then(() => { |
||||
} |
||||
); |
||||
}, |
||||
rowUpdate(row, index, done, loading) { |
||||
update(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
type: 'success', |
||||
message: '操作成功!', |
||||
}); |
||||
done(); |
||||
}, error => { |
||||
}, |
||||
error => { |
||||
loading(); |
||||
console.log(error); |
||||
}); |
||||
}, |
||||
rowDel(row) { |
||||
this.$confirm("确定将选择数据删除?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}) |
||||
.then(() => { |
||||
return remove(row.id); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
}); |
||||
}, |
||||
handleDelete() { |
||||
if (this.selectionList.length === 0) { |
||||
this.$message.warning("请选择至少一条数据"); |
||||
return; |
||||
} |
||||
this.$confirm("确定将选择数据删除?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
); |
||||
}, |
||||
rowDel(row) { |
||||
this.$confirm('确定将选择数据删除?', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
}) |
||||
.then(() => { |
||||
return remove(row.id); |
||||
}) |
||||
.then(() => { |
||||
return remove(this.ids); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!" |
||||
}); |
||||
this.$refs.crud.toggleSelection(); |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: 'success', |
||||
message: '操作成功!', |
||||
}); |
||||
}, |
||||
handleExport() { |
||||
let downloadUrl = `/basic/basicDeline/export-basicDeline?${this.website.tokenHeader}=${getToken()}`; |
||||
const { |
||||
warehouseId, |
||||
} = this.query; |
||||
let values = { |
||||
warehouseId_equal: warehouseId, |
||||
}; |
||||
this.$confirm("是否导出数据?", "提示", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}).then(() => { |
||||
NProgress.start(); |
||||
exportBlob(downloadUrl, values).then(res => { |
||||
downloadXls(res.data, `提货路线${dateNow()}.xlsx`); |
||||
NProgress.done(); |
||||
}) |
||||
}); |
||||
}, |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then(res => { |
||||
this.form = res.data.data; |
||||
}, |
||||
handleDelete() { |
||||
if (this.selectionList.length === 0) { |
||||
this.$message.warning('请选择至少一条数据'); |
||||
return; |
||||
} |
||||
this.$confirm('确定将选择数据删除?', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
}) |
||||
.then(() => { |
||||
return remove(this.ids); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: 'success', |
||||
message: '操作成功!', |
||||
}); |
||||
} |
||||
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; |
||||
this.$refs.crud.toggleSelection(); |
||||
}); |
||||
}, |
||||
handleExport() { |
||||
let downloadUrl = `/basic/basicDeline/export-basicDeline?${ |
||||
this.website.tokenHeader |
||||
}=${getToken()}`; |
||||
const { warehouseId } = this.query; |
||||
let values = { |
||||
warehouseId_equal: warehouseId, |
||||
}; |
||||
this.$confirm('是否导出数据?', '提示', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
}).then(() => { |
||||
NProgress.start(); |
||||
exportBlob(downloadUrl, values).then(res => { |
||||
downloadXls(res.data, `提货路线${dateNow()}.xlsx`); |
||||
NProgress.done(); |
||||
}); |
||||
}); |
||||
}, |
||||
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 { |
||||
warehouseId, |
||||
} = this.query; |
||||
const { warehouseId } = this.query; |
||||
|
||||
let values = { |
||||
warehouseId_equal: warehouseId, |
||||
}; |
||||
let values = { |
||||
warehouseId_equal: warehouseId, |
||||
}; |
||||
|
||||
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(); |
||||
}); |
||||
} |
||||
} |
||||
}; |
||||
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> |
||||
<style></style> |
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue