You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
233 lines
5.8 KiB
233 lines
5.8 KiB
<template> |
|
<div> |
|
<basic-container> |
|
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page" |
|
:permission="permissionList" @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 slot-scope="scope" slot="menu"> |
|
|
|
</template> |
|
</avue-crud> |
|
</basic-container> |
|
</div> |
|
</template> |
|
<script> |
|
import { getList } from "@/api/demandOrder/demandOrder.js"; |
|
import { mapGetters } from "vuex"; |
|
|
|
export default { |
|
data() { |
|
return { |
|
form: {}, |
|
selectionList: [], |
|
query: {}, |
|
loading: true, |
|
page: { |
|
pageSize: 10, |
|
currentPage: 1, |
|
total: 0 |
|
}, |
|
option: { |
|
height: 'auto', |
|
calcHeight: 30, |
|
tip: false, |
|
searchShow: true, |
|
searchMenuSpan: 18, |
|
border: true, |
|
index: true, |
|
selection: true, |
|
viewBtn: true, |
|
dialogClickModal: false, |
|
menu: false, |
|
selection: false, |
|
printBtn: false, |
|
refreshBtn: false, |
|
gridBtn: false, |
|
gridBackgroundImage: false, |
|
gridSpan: false, |
|
filterBtn: false, |
|
columnBtn: false, |
|
searchMenuPosition: "right", |
|
column: [ |
|
{ |
|
label: "需求单号", |
|
prop: "demandNo", |
|
search: true, |
|
headerAlign: "center", |
|
align: "center", |
|
}, |
|
{ |
|
label: "提交时间", |
|
prop: "optTime", |
|
type: "date", |
|
format: "yyyy-MM-dd", |
|
valueFormat: "yyyy-MM-dd", |
|
headerAlign: "center", |
|
align: "center", |
|
}, |
|
{ |
|
label: "物品名称", |
|
prop: "materialName", |
|
headerAlign: "center", |
|
align: "center", |
|
}, |
|
{ |
|
label: "型号", |
|
prop: "model", |
|
headerAlign: "center", |
|
align: "center", |
|
}, |
|
{ |
|
label: "数量", |
|
prop: "num", |
|
headerAlign: "center", |
|
align: "center", |
|
}, |
|
{ |
|
label: "申请年份", |
|
prop: "year", |
|
headerAlign: "center", |
|
align: "center", |
|
}, |
|
{ |
|
label: "申请季度", |
|
prop: "quarter", |
|
headerAlign: "center", |
|
align: "center", |
|
}, |
|
{ |
|
label: "申请部门", |
|
prop: "department", |
|
headerAlign: "center", |
|
align: "center", |
|
} |
|
] |
|
}, |
|
data: [], |
|
dialogLogVisible: false, |
|
activeName: 'first', |
|
tableData: [], |
|
|
|
ckTable: [ |
|
{ str1: '3', str2: '2025-04-09', str3: '部门一' }, |
|
{ str1: '37', str2: '2025-04-03', str3: '部门一' } |
|
], |
|
rkTable: [ |
|
{ str1: '5', str2: '2025-03-19', str3: '部门二' }, |
|
{ str1: '12', str2: '2025-03-19', str3: '部门二' }, |
|
], |
|
bfTable: [ |
|
{ str1: '9', str2: '2025-03-19', str3: '部门三' }, |
|
{ str1: '19', str2: '2025-03-19', str3: '部门三' }, |
|
], |
|
}; |
|
}, |
|
computed: { |
|
...mapGetters(["userInfo", "permission"]), |
|
permissionList() { |
|
return { |
|
addBtn: false, |
|
viewBtn: false, |
|
delBtn: false, |
|
editBtn: false |
|
}; |
|
}, |
|
ids() { |
|
let ids = []; |
|
this.selectionList.forEach(ele => { |
|
ids.push(ele.id); |
|
}); |
|
return ids.join(","); |
|
} |
|
}, |
|
mounted() { |
|
this.tableData = this.ckTable |
|
}, |
|
methods: { |
|
handleLog() { |
|
this.dialogLogVisible = true |
|
}, |
|
handleTabClick(tab, event) { |
|
console.log(tab, event); |
|
if (this.activeName == 'first') { |
|
this.tableData = this.ckTable |
|
} |
|
if (this.activeName == 'second') { |
|
this.tableData = this.rkTable |
|
} |
|
if (this.activeName == 'third') { |
|
this.tableData = this.bfTable |
|
} |
|
}, |
|
|
|
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.data.push({ |
|
no: '00100001', |
|
name: '物品1', |
|
xh: '1', |
|
lb: '易耗品', |
|
unit: '11', |
|
number: '1', |
|
dj: '11', |
|
pice: '11' |
|
}, { |
|
no: '00100002', |
|
name: '物品2', |
|
xh: '2', |
|
lb: '耐用品', |
|
unit: '22', |
|
number: '2', |
|
dj: '11', |
|
pice: '22' |
|
}) |
|
this.loading = false |
|
// getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).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, Object.assign(params, this.query)).then(res => { |
|
console.log(123, res.data.result) |
|
// const data = res.data.data; |
|
this.data = res.data.result.list; |
|
this.loading = false; |
|
this.page.total = res.data.result.total; |
|
// this.selectionClear(); |
|
}); |
|
} |
|
} |
|
}; |
|
</script> |
|
|
|
<style></style>
|
|
|