3 changed files with 206 additions and 26 deletions
@ -0,0 +1,13 @@ |
|||||||
|
import request from '@/router/axios'; |
||||||
|
//列表
|
||||||
|
export const getList = (current, size, params) => { |
||||||
|
return request({ |
||||||
|
url: '/api/iot-sim/simcarddeliver/getFlowHisMonth', |
||||||
|
method: 'get', |
||||||
|
params: { |
||||||
|
...params, |
||||||
|
current, |
||||||
|
size, |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
@ -0,0 +1,189 @@ |
|||||||
|
<template> |
||||||
|
<basic-container> |
||||||
|
<avue-crud |
||||||
|
:option="option" |
||||||
|
:table-loading="loading" |
||||||
|
:data="data" |
||||||
|
:page.sync="page" |
||||||
|
:permission="permissionList" |
||||||
|
:before-open="beforeOpen" |
||||||
|
v-model="form" |
||||||
|
ref="crud" |
||||||
|
@row-update="rowUpdate" |
||||||
|
@row-save="rowSave" |
||||||
|
@row-del="rowDel" |
||||||
|
@search-change="searchChange" |
||||||
|
@search-reset="searchReset" |
||||||
|
@current-change="currentChange" |
||||||
|
@size-change="sizeChange" |
||||||
|
@refresh-change="refreshChange" |
||||||
|
@on-load="onLoad" |
||||||
|
> |
||||||
|
</avue-crud> |
||||||
|
</basic-container> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import { getList } from "@/api/informationmanage/cardusemonth"; |
||||||
|
import { mapGetters } from "vuex"; |
||||||
|
|
||||||
|
export default { |
||||||
|
data() { |
||||||
|
return { |
||||||
|
form: {}, |
||||||
|
query: { |
||||||
|
type: 2, |
||||||
|
}, |
||||||
|
loading: true, |
||||||
|
page: { |
||||||
|
pageSize: 10, |
||||||
|
currentPage: 1, |
||||||
|
total: 0, |
||||||
|
}, |
||||||
|
option: { |
||||||
|
tip: false, |
||||||
|
searchShow: true, |
||||||
|
searchMenuSpan: 6, |
||||||
|
border: true, |
||||||
|
index: true, |
||||||
|
viewBtn: false, |
||||||
|
addBtn: false, |
||||||
|
menu: false, |
||||||
|
selection: false, |
||||||
|
dialogClickModal: false, |
||||||
|
dialogWidth: "45%", |
||||||
|
column: [ |
||||||
|
{ |
||||||
|
label: "用量(M)", |
||||||
|
prop: "usage", |
||||||
|
width: 200, |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: "ICCID", |
||||||
|
prop: "iccid", |
||||||
|
search: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: "MSISDN", |
||||||
|
prop: "msisdn", |
||||||
|
search: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: "时间", |
||||||
|
type: "month", |
||||||
|
format: "yyyy-MM", |
||||||
|
valueFormat: "yyyyMM", |
||||||
|
prop: "time", |
||||||
|
search: true, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
data: [], |
||||||
|
}; |
||||||
|
}, |
||||||
|
computed: { |
||||||
|
...mapGetters(["permission"]), |
||||||
|
permissionList() { |
||||||
|
return { |
||||||
|
// addBtn: this.vaildData(this.permission.product_topic_add, false), |
||||||
|
// viewBtn: this.vaildData(this.permission.product_topic_view, false), |
||||||
|
// delBtn: this.vaildData(this.permission.product_topic_delete, false), |
||||||
|
// editBtn: this.vaildData(this.permission.product_topic_edit, false), |
||||||
|
}; |
||||||
|
}, |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
rowSave(row, done, loading) { |
||||||
|
add(row).then( |
||||||
|
() => { |
||||||
|
this.onLoad(this.page); |
||||||
|
this.$message({ |
||||||
|
type: "success", |
||||||
|
message: "操作成功!", |
||||||
|
}); |
||||||
|
done(); |
||||||
|
}, |
||||||
|
(error) => { |
||||||
|
loading(); |
||||||
|
window.console.log(error); |
||||||
|
} |
||||||
|
); |
||||||
|
}, |
||||||
|
rowUpdate(row, index, done, loading) { |
||||||
|
update(row).then( |
||||||
|
() => { |
||||||
|
this.onLoad(this.page); |
||||||
|
this.$message({ |
||||||
|
type: "success", |
||||||
|
message: "操作成功!", |
||||||
|
}); |
||||||
|
done(); |
||||||
|
}, |
||||||
|
(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: "操作成功!", |
||||||
|
}); |
||||||
|
}); |
||||||
|
}, |
||||||
|
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(); |
||||||
|
}, |
||||||
|
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; |
||||||
|
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; |
||||||
|
}); |
||||||
|
}, |
||||||
|
}, |
||||||
|
}; |
||||||
|
</script> |
||||||
|
|
||||||
|
<style></style> |
Loading…
Reference in new issue