Browse Source

feat:新增目标套餐组管理

fix:修改套餐业务逻辑
confidence
杜贤金 3 years ago
parent
commit
a80ce50d3b
  1. 2
      src/views/communicationmanage/basiccard/basiccard.vue
  2. 251
      src/views/original/targetpackagegroupmanage/index.vue
  3. 19
      src/views/original/targetpackagemanage/index.vue
  4. 38
      src/views/package/basicpackage/index.vue
  5. 54
      src/views/package/packagegroup/index.vue

2
src/views/communicationmanage/basiccard/basiccard.vue

@ -829,7 +829,7 @@ export default {
} else { } else {
const h = this.$createElement; const h = this.$createElement;
this.$notify.error({ this.$notify.error({
title: "错误号码", title: "出库失败号码",
message: h( message: h(
"i", "i",
{ style: "color: teal; word-break: break-all;" }, { style: "color: teal; word-break: break-all;" },

251
src/views/original/targetpackagegroupmanage/index.vue

@ -0,0 +1,251 @@
<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 {
getDetail,
getList,
add,
remove,
update,
} from "@/api/packagemanage/packgegroup";
import { mapGetters } from "vuex";
import { getToken } from "@/util/auth";
import { number } from "mathjs";
export default {
data() {
return {
form: {},
query: {},
loading: false,
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
isSources: {
isSource: 2,
},
option: {
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
addBtn: true,
viewBtn: true,
dialogDrag: true, //
delBtn: true,
editBtn: true,
columnBtn: false,
selection: false,
dialogClickModal: false,
dialogWidth: "60%",
column: [
{
label: "目标套餐组名称",
prop: "name",
span: 12,
labelWidth: 130,
searchLabelWidth: 120,
search: true,
rules: [
{
required: true,
message: "请输入目标套餐组名称",
trigger: "blur",
},
],
},
{
label: "目标套餐组类型",
prop: "type",
span: 12,
type: "select",
searchLabelWidth: 120,
search: true,
labelWidth: 130,
dicUrl:
"/api/iot-system/dict/dictionary?code=dataPlanGroupType",
props: {
label: "dictValue",
value: "dictKey",
},
dataType: "number",
rules: [
{
required: true,
message: "请选择目标套餐组类型",
trigger: "change",
},
],
},
],
},
data: [],
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
// viewBtn: this.vaildData(this.permission.sourceApi_view, false),
// editBtn: this.vaildData(this.permission.sourceApi_edit, false),
// delBtn: this.vaildData(this.permission.sourceApi_delete, false),
};
},
},
methods: {
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();
},
//
rowSave(row, done, loading) {
add(Object.assign(row, this.isSources)).then(
(res) => {
if (res.data.data == 1) {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!",
});
done();
} else {
this.$message({
type: "error",
message: "操作失败!",
});
done(); //
loading(); //
}
},
(error) => {
window.console.log(error);
loading();
}
);
},
//
rowUpdate(row, index, done, loading) {
update(Object.assign(row, this.isSources)).then(
(res) => {
if (res.data.data == 1) {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!",
});
done();
} else {
this.$message({
type: "error",
message: "操作失败!",
});
done(); //
loading(); //
}
},
(error) => {
window.console.log(error);
loading();
}
);
},
//
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!",
});
});
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
//
handleExport() {
if (process.env.NODE_ENV === "production") {
window.open(
`http://223.99.228.240:18081/bd-core/tenant/dailybill/export-excel?${
this.website.tokenHeader
}=${getToken()}`
);
} else {
window.open(
`/api/iot-sim/simcard/export-simCard?${
this.website.tokenHeader
}=${getToken()}`
);
}
},
onLoad(page, params = {}) {
this.loading = true;
getList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query, this.isSources)
).then((res) => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
});
},
},
};
</script>
<style></style>

19
src/views/original/targetpackagemanage/index.vue

@ -98,7 +98,7 @@ export default {
searchLabelWidth: 120, searchLabelWidth: 120,
search: true, search: true,
labelWidth: 130, labelWidth: 130,
dicUrl: "/api/iot-sim/dataplangroup/fillData", dicUrl: "/api/iot-sim/dataplangroup/fillData?isSource="+2,
props: { props: {
label: "name", label: "name",
value: "id", value: "id",
@ -247,6 +247,23 @@ export default {
}, },
], ],
}, },
{
label: "订购数量",
prop: "orderCount",
span: 12,
type: "number",
labelWidth: 130,
searchLabelWidth: 100,
search: false,
rules: [
{ required: true, message: "请输入订购数量", trigger: "blur" },
{
pattern: /^\d+?$/,
message: "请输入正确的订购数量",
trigger: "blur",
},
],
},
{ {
label: "停机多少天后注销账户", label: "停机多少天后注销账户",
prop: "stopClose", prop: "stopClose",

38
src/views/package/basicpackage/index.vue

@ -72,24 +72,24 @@ export default {
dialogClickModal: false, dialogClickModal: false,
dialogWidth: "60%", dialogWidth: "60%",
column: [ column: [
{ // {
label: "租户名称", // label: "",
prop: "tenantId", // prop: "tenantId",
type: "select", // type: "select",
dicUrl: "/api/iot-system/tenant/fillData", // dicUrl: "/api/iot-system/tenant/fillData",
props: { // props: {
label: "tenantName", // label: "tenantName",
value: "tenantId", // value: "tenantId",
}, // },
dataType: "String", // dataType: "String",
span: 12, // span: 12,
labelWidth: 130, // labelWidth: 130,
width: 140, // width: 140,
search: true, // search: true,
rules: [ // rules: [
{ required: true, message: "请选择租户名称", trigger: "change" }, // { required: true, message: "", trigger: "change" },
], // ],
}, // },
{ {
label: "套餐组名称", label: "套餐组名称",
prop: "dataPlanGroupId", prop: "dataPlanGroupId",
@ -98,7 +98,7 @@ export default {
searchLabelWidth: 120, searchLabelWidth: 120,
search: true, search: true,
labelWidth: 130, labelWidth: 130,
dicUrl: "/api/iot-sim/dataplangroup/fillData", dicUrl: "/api/iot-sim/dataplangroup/fillData?isSource=" + 1,
props: { props: {
label: "name", label: "name",
value: "id", value: "id",

54
src/views/package/packagegroup/index.vue

@ -45,6 +45,9 @@ export default {
currentPage: 1, currentPage: 1,
total: 0, total: 0,
}, },
isSources: {
isSource: 1,
},
option: { option: {
tip: false, tip: false,
searchShow: true, searchShow: true,
@ -84,7 +87,8 @@ export default {
searchLabelWidth: 120, searchLabelWidth: 120,
search: true, search: true,
labelWidth: 130, labelWidth: 130,
dicUrl: "/api/iot-system/dict/dictionary?code=dataPlanGroupType", dicUrl:
"/api/iot-system/dict/dictionary?code=sourcedataPlanGroupType",
props: { props: {
label: "dictValue", label: "dictValue",
value: "dictKey", value: "dictKey",
@ -98,27 +102,27 @@ export default {
}, },
], ],
}, },
{ // {
label: "订购数量", // label: "",
prop: "orderCount", // prop: "orderCount",
span: 12, // span: 12,
labelWidth: 130, // labelWidth: 130,
searchLabelWidth: 100, // searchLabelWidth: 100,
search: false, // search: false,
type: "number", // type: "number",
rules: [ // rules: [
{ // {
required: true, // required: true,
message: "请输入订购数量", // message: "",
trigger: "blur", // trigger: "blur",
}, // },
{ // {
pattern: /^\d+?$/, // pattern: /^\d+?$/,
message: "请输入正确的订购数量", // message: "",
trigger: "blur", // trigger: "blur",
}, // },
], // ],
}, // },
], ],
}, },
data: [], data: [],
@ -155,7 +159,7 @@ export default {
}, },
// //
rowSave(row, done, loading) { rowSave(row, done, loading) {
add(row).then( add(Object.assign(row, this.isSources)).then(
(res) => { (res) => {
if (res.data.data == 1) { if (res.data.data == 1) {
this.onLoad(this.page); this.onLoad(this.page);
@ -181,7 +185,7 @@ export default {
}, },
// //
rowUpdate(row, index, done, loading) { rowUpdate(row, index, done, loading) {
update(row).then( update(Object.assign(row, this.isSources)).then(
(res) => { (res) => {
if (res.data.data == 1) { if (res.data.data == 1) {
this.onLoad(this.page); this.onLoad(this.page);
@ -253,7 +257,7 @@ export default {
getList( getList(
page.currentPage, page.currentPage,
page.pageSize, page.pageSize,
Object.assign(params, this.query) Object.assign(params, this.query, this.isSources)
).then((res) => { ).then((res) => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;

Loading…
Cancel
Save