Browse Source

feat:基础卡 设备管理 卡出库 新增批量删除 设备管理加导入功能

confidence
杜贤金 3 years ago
parent
commit
d63dbd4dee
  1. 67
      src/views/communicationmanage/basiccard/basiccard.vue
  2. 161
      src/views/communicationmanage/device/device.vue
  3. 63
      src/views/communicationmanage/outbound/outbound.vue

67
src/views/communicationmanage/basiccard/basiccard.vue

@ -42,12 +42,14 @@
@click="handleAllocate"
>分拨</el-button
>
<!-- <el-button
<el-button
type="danger"
size="small"
type="primary"
icon="el-icon-sell"
@click="delivery"
>&nbsp库</el-button> -->
icon="el-icon-delete"
plain
@click="handleDelete"
>
</el-button>
</template>
</avue-crud>
<el-dialog
@ -178,7 +180,7 @@ import {
} from "@/api/communication/basiccard";
import { mapGetters } from "vuex";
import { getToken } from "@/util/auth";
import { log } from "mathjs";
export default {
data() {
var starts = (rule, value, callback) => {
@ -344,18 +346,18 @@ export default {
delBtn: true,
excelBtn: false,
columnBtn: false,
selection: false,
selection: true,
dialogClickModal: false,
dialogWidth: "60%",
column: [
{
{
label: "id",
prop: "id",
type: "input",
search: false,
addDisplay:false,
editDisplay:false,
width:170,
addDisplay: false,
editDisplay: false,
width: 170,
},
{
label: "通道名称",
@ -364,7 +366,7 @@ export default {
dataType: "String",
span: 12,
labelWidth: 130,
width:100,
width: 100,
search: true,
dicUrl: "/api/iot-sim/channel/fillData",
props: {
@ -438,7 +440,7 @@ export default {
span: 12,
labelWidth: 130,
search: true,
width:115,
width: 115,
addDisplay: false,
rules: [
{
@ -483,7 +485,7 @@ export default {
prop: "msisdn",
span: 12,
labelWidth: 130,
width:110,
width: 110,
search: true,
rules: [
{
@ -522,8 +524,8 @@ export default {
dataType: "number",
span: 12,
labelWidth: 130,
addDisplay:false,
editDisplay:false,
addDisplay: false,
editDisplay: false,
width: 70,
search: true,
rules: [
@ -721,6 +723,29 @@ export default {
});
});
},
//
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: "操作成功!",
});
this.$refs.crud.toggleSelection();
});
},
//
selectionChange(list) {
this.selectionList = list;
@ -743,16 +768,6 @@ export default {
refreshChange() {
this.onLoad(this.page, this.query);
},
//
delivery() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
} else {
this.$message.error(this.ids);
console.log(this.ids, typeof this.ids);
}
},
//
handleExport() {
window.open(

161
src/views/communicationmanage/device/device.vue

@ -12,6 +12,7 @@
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@selection-change="selectionChange"
@search-change="searchChange"
@search-reset="searchReset"
@current-change="currentChange"
@ -27,8 +28,41 @@
@click="handleExport"
>导出
</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-upload2"
@click="handleImport"
>导入</el-button
>
<el-button
type="danger"
size="small"
icon="el-icon-delete"
plain
@click="handleDelete"
>
</el-button>
</template>
</avue-crud>
<el-dialog
title="设备数据导入"
append-to-body
:visible.sync="excelBox"
width="555px"
>
<avue-form
:option="excelOption"
v-model="excelForm"
:upload-after="uploadAfter"
>
<template slot="excelTemplate">
<el-button type="primary" @click="handleTemplate">
点击下载<i class="el-icon-download el-icon--right"></i>
</el-button>
</template>
</avue-form>
</el-dialog>
</basic-container>
</template>
@ -48,6 +82,8 @@ export default {
form: {},
query: {},
loading: false,
excelBox: false,
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
@ -64,7 +100,7 @@ export default {
dialogDrag: true, //
delBtn: true,
columnBtn: false,
selection: false,
selection: true,
dialogClickModal: false,
dialogWidth: "60%",
column: [
@ -216,8 +252,68 @@ export default {
],
},
data: [],
excelForm: {},
excelOption: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: "导入设备",
prop: "excelFile",
type: "upload",
drag: true,
loadText: "设备上传中,请稍等",
span: 24,
propsHttp: {
res: "data",
},
tip: "请上传 .xls,.xlsx 标准格式文件",
action: "/api/iot-system/user/import-user",
},
{
label: "数据覆盖",
prop: "isCovered",
type: "switch",
align: "center",
width: 80,
dicData: [
{
label: "否",
value: 0,
},
{
label: "是",
value: 1,
},
],
value: 0,
slot: true,
rules: [
{
required: true,
message: "请选择是否覆盖",
trigger: "blur",
},
],
},
{
label: "模板下载",
prop: "excelTemplate",
formslot: true,
span: 24,
},
],
},
};
},
watch: {
"excelForm.isCovered"() {
if (this.excelForm.isCovered !== "") {
const column = this.findObject(this.excelOption.column, "excelFile");
column.action = `${this.baseUrl}/${this.apis}/iot-sim/device/import-device?isCovered=${this.excelForm.isCovered}`;
}
},
},
computed: {
...mapGetters(["permission"]),
permissionList() {
@ -227,6 +323,13 @@ export default {
// delBtn: this.vaildData(this.permission.sourceApi_delete, false),
};
},
ids() {
let ids = [];
this.selectionList.forEach((ele) => {
ids.push(ele.id);
});
return ids.join(",");
},
},
methods: {
beforeOpen(done, type) {
@ -299,6 +402,62 @@ export default {
});
});
},
//
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: "操作成功!",
});
this.$refs.crud.toggleSelection();
});
},
//
selectionChange(list) {
this.selectionList = list;
},
//
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
handleImport() {
this.excelBox = true;
},
uploadAfter(res, done, loading, column) {
window.console.log(column);
this.excelBox = false;
this.refreshChange();
done();
},
handleExport() {
this.$confirm("是否导出用户数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
window.open(
`/api/iot-system/user/export-user?${
this.website.tokenHeader
}=${getToken()}&account=${this.search.account}&realName=${
this.search.realName
}`
);
});
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},

63
src/views/communicationmanage/outbound/outbound.vue

@ -13,6 +13,7 @@
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@selection-change="selectionChange"
@search-reset="searchReset"
@current-change="currentChange"
@size-change="sizeChange"
@ -27,6 +28,14 @@
@click="handleExport"
>导出
</el-button>
<el-button
type="danger"
size="small"
icon="el-icon-delete"
plain
@click="handleDelete"
>
</el-button>
</template>
</avue-crud>
</basic-container>
@ -47,6 +56,7 @@ export default {
return {
form: {},
query: {},
selectionList: [],
loading: true,
page: {
pageSize: 10,
@ -64,7 +74,7 @@ export default {
delBtn: true,
dialogDrag: true,
columnBtn: false,
selection: false,
selection: true,
dialogClickModal: false,
dialogWidth: "60%",
column: [
@ -153,11 +163,11 @@ export default {
},
],
},
{
{
label: "基础套餐",
prop: "dataPlanId",
type: "select",
dicUrl: "/api/iot-sim/dataplan/fillData?isSource="+2,
dicUrl: "/api/iot-sim/dataplan/fillData?isSource=" + 2,
props: {
label: "name",
value: "id",
@ -166,7 +176,7 @@ export default {
span: 12,
labelWidth: 130,
searchLabelWidth: 110,
width:110,
width: 110,
search: true,
rules: [
{
@ -286,7 +296,7 @@ export default {
labelWidth: 130,
searchLabelWidth: 124,
search: false,
width:120,
width: 120,
rules: [
{
required: true,
@ -452,6 +462,13 @@ export default {
// delBtn: this.vaildData(this.permission.sourceApi_delete, false),
};
},
ids() {
let ids = [];
this.selectionList.forEach((ele) => {
ids.push(ele.id);
});
return ids.join(",");
},
},
methods: {
beforeOpen(done, type) {
@ -525,6 +542,38 @@ export default {
});
});
},
//
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: "操作成功!",
});
this.$refs.crud.toggleSelection();
});
},
//
selectionChange(list) {
this.selectionList = list;
},
//
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
@ -537,7 +586,9 @@ export default {
//
handleExport() {
window.open(
`${this.baseUrl}/${this.apis}iot-sim/simcarddeliver/export-simCardDeliver?${
`${this.baseUrl}/${
this.apis
}iot-sim/simcarddeliver/export-simCardDeliver?${
this.website.tokenHeader
}=${getToken()}`
);

Loading…
Cancel
Save