From 64268404578a5da3c8a7d59cd15c07ac3b48291f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E8=B4=A4=E9=87=91?= <1960116313@qq.com> Date: Thu, 23 Jun 2022 17:09:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=8E=9F=E6=9C=89?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 + src/api/communication/basiccard.js | 12 ++ src/api/communication/outbound.js | 20 +++ src/main.js | 2 + src/router/axios.js | 2 +- .../basiccard/basiccard.vue | 76 ++++++---- .../communicationmanage/channel/channel.vue | 7 + .../communicationmanage/outbound/outbound.vue | 133 +++++++++++++++--- src/views/informationmanage/sim/index.vue | 94 +++++++++++-- .../targetpackagegroupmanage/index.vue | 2 +- .../original/targetpackagemanage/index.vue | 55 ++++---- src/views/package/packagegroup/index.vue | 2 +- 12 files changed, 318 insertions(+), 89 deletions(-) diff --git a/package.json b/package.json index 0e606c0..c54ce1f 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ }, "dependencies": { "@antv/g2": "^4.1.30", + "@smallwei/avue": "^2.9.11", "avue-plugin-ueditor": "^0.1.4", "axios": "^0.18.0", "babel-polyfill": "^6.26.0", @@ -20,6 +21,7 @@ "clipboard": "^2.0.10", "crypto-js": "^4.0.0", "dayjs": "^1.10.7", + "echarts": "^5.3.3", "element-ui": "^2.15.6", "js-base64": "^2.5.1", "js-cookie": "^2.2.0", diff --git a/src/api/communication/basiccard.js b/src/api/communication/basiccard.js index edd3dd6..84c6dc7 100644 --- a/src/api/communication/basiccard.js +++ b/src/api/communication/basiccard.js @@ -108,3 +108,15 @@ export const dataplan = () => { }) } + +export const deliver = (tenantId,dataPlanId,id) => { + return request({ + url: '/api/iot-sim/simcard/deliver', + method: 'post', + params: { + tenantId, + dataPlanId, + id + } + }) +} diff --git a/src/api/communication/outbound.js b/src/api/communication/outbound.js index 7fca5ff..733e9d4 100644 --- a/src/api/communication/outbound.js +++ b/src/api/communication/outbound.js @@ -69,4 +69,24 @@ export const exporttype = () => { method: 'get', }) } +//同步实名 +export const syncRealNameStatus = (id) => { + return request({ + url: '/api/iot-sim/sim/syncRealNameStatus', + method: 'get', + params:{ + id + } + }) +} +//停机复机 +export const updateSimStatus = (row) => { + return request({ + url: '/api/iot-sim/sim/updateSimStatus', + method: 'post', + params:{ + ...row + } + }) +} diff --git a/src/main.js b/src/main.js index f75a90f..d220d68 100644 --- a/src/main.js +++ b/src/main.js @@ -23,6 +23,8 @@ import avueUeditor from 'avue-plugin-ueditor'; import website from '@/config/website'; import crudCommon from '@/mixins/crud'; import {baseUrl,apis} from '@/config/env'; +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) // 注册全局crud驱动 window.$crudCommon = crudCommon; // 加载Vue拓展 diff --git a/src/router/axios.js b/src/router/axios.js index 9bd4e37..b0a90e2 100644 --- a/src/router/axios.js +++ b/src/router/axios.js @@ -18,7 +18,7 @@ import 'nprogress/nprogress.css'; import {baseUrl} from '@/config/env'; //默认超时时间 -axios.defaults.timeout = 30000; +axios.defaults.timeout = 300000; //返回其他状态码 axios.defaults.validateStatus = function (status) { return status >= 200 && status <= 500; diff --git a/src/views/communicationmanage/basiccard/basiccard.vue b/src/views/communicationmanage/basiccard/basiccard.vue index 27a67cd..d593717 100644 --- a/src/views/communicationmanage/basiccard/basiccard.vue +++ b/src/views/communicationmanage/basiccard/basiccard.vue @@ -58,6 +58,12 @@ >删 除 + - @@ -95,7 +96,7 @@ @@ -133,7 +134,7 @@ - + { - if ( - this.distribution.numEnd == "" || - this.distribution.numStart == "" - ) { + if (this.distribution.numEnd == "" || this.distribution.numStart == "") { callback(new Error("开始号码结束号码均不能为空")); } else if ( this.distribution.numEnd < 0 || @@ -220,11 +223,11 @@ export default { ) { callback(new Error("开始号码必须小于结束号码")); } else if ( - reg.test(this.distribution.numStart) == true|| reg.test(this.distribution.numEnd) == true + reg.test(this.distribution.numStart) == true || + reg.test(this.distribution.numEnd) == true ) { callback(new Error("开始结束号码中包含字母,请选择其他导出类型")); - } - else { + } else { callback(); } }; @@ -405,6 +408,8 @@ export default { selection: true, dialogClickModal: false, dialogWidth: "60%", + menuType: "menu", + menuWidth: "120", column: [ { label: "id", @@ -625,6 +630,7 @@ export default { ], }, data: [], + deliverId:"",//出库id }; }, computed: { @@ -691,7 +697,7 @@ export default { } } }, - "excelForm.$tenantId"() { + "excelForm.$tenantId"() { const columns = this.findObject(this.excelOption.column, "flowPoolId"); if (this.excelForm.$tenantId != undefined) { if (this.excelForm.$tenantId.indexOf("电信") != -1) { @@ -729,7 +735,7 @@ export default { rowSave(row, done, loading) { add(row).then( (res) => { - if (res.data.data == true) { + if (res.data.data == 1) { this.onLoad(this.page); this.$message({ type: "success", @@ -755,7 +761,7 @@ export default { rowUpdate(row, index, done, loading) { update(row).then( (res) => { - if (res.data.data == true) { + if (res.data.data == 1) { this.onLoad(this.page); this.$message({ type: "success", @@ -896,11 +902,15 @@ export default { }); }, //分拨弹窗开启 - handleAllocate(e) { + handleAllocate(e,row) { if (e == 1) { this.distitle = "分拨"; - } else { + } else if (e == 2) { this.distitle = "回拨"; + } else if (e == 3) { + this.distitle = "出库"; + this.deliverId = row.row.id; + } this.dialogVisible = true; }, @@ -919,6 +929,7 @@ export default { this.$message.success("操作成功"); this.$refs.distribution.resetFields(); this.dialogVisible = false; + this.onLoad(this.page); } else { const h = this.$createElement; this.$notify.error({ @@ -934,12 +945,13 @@ export default { this.dialogVisible = false; } }); - } else { + } else if (this.distitle == "回拨") { simCallback(this.distribution).then((res) => { if (res.data.data == "") { this.$message.success("操作成功"); this.$refs.distribution.resetFields(); this.dialogVisible = false; + this.onLoad(this.page); } else { const h = this.$createElement; this.$notify.error({ @@ -955,8 +967,24 @@ export default { this.dialogVisible = false; } }); + } else if (this.distitle == "出库") { + + deliver( + this.distribution.tenantId, + this.distribution.dataPlanId, + this.deliverId + ).then((res) => { + if (res.data.data == 1) { + this.$message.success("操作成功"); + this.$refs.distribution.resetFields(); + this.dialogVisible = false; + this.onLoad(this.page); + } else { + this.$refs.distribution.resetFields(); + this.dialogVisible = false; + } + }); } - } else { } }); }, diff --git a/src/views/communicationmanage/channel/channel.vue b/src/views/communicationmanage/channel/channel.vue index 3f323e0..9bb0fc6 100644 --- a/src/views/communicationmanage/channel/channel.vue +++ b/src/views/communicationmanage/channel/channel.vue @@ -117,6 +117,13 @@ export default { prop: "apiUrl", span: 12, labelWidth: 130, + formatter: (val, value, label) => { + if (value == "") { + return "-"; + } else { + return `${value}`; + } + }, rules: [ { required: true, message: "请输入apiUrl", trigger: "blur" }, ], diff --git a/src/views/communicationmanage/outbound/outbound.vue b/src/views/communicationmanage/outbound/outbound.vue index 5f132ed..53e1916 100644 --- a/src/views/communicationmanage/outbound/outbound.vue +++ b/src/views/communicationmanage/outbound/outbound.vue @@ -37,6 +37,47 @@ >删 除 + @@ -46,7 +87,6 @@ append-to-body width="35%" :before-close="handleClose" - > - + { - if ( - this.distribution.numEnd == "" || - this.distribution.numStart == "" - ) { + if (this.distribution.numEnd == "" || this.distribution.numStart == "") { callback(new Error("开始号码结束号码均不能为空")); } else if ( this.distribution.numEnd < 0 || @@ -151,11 +190,12 @@ export default { Number(this.distribution.numStart) > Number(this.distribution.numEnd) ) { callback(new Error("开始号码必须小于结束号码")); - }else if ( - reg.test(this.distribution.numStart) == true|| reg.test(this.distribution.numEnd) == true + } else if ( + reg.test(this.distribution.numStart) == true || + reg.test(this.distribution.numEnd) == true ) { callback(new Error("开始结束号码中包含字母,请选择其他导出类型")); - }else { + } else { callback(); } }; @@ -167,6 +207,7 @@ export default { tenantId: null, //租户 userId: null, //客户 }, + status: "", dialogVisible: false, //分拨弹窗布尔 selectionList: [], tenantlist: [], //租户下拉 @@ -177,7 +218,7 @@ export default { tenantId: "", //租户id numStart: "", //开始号码 numEnd: "", //结束号码 - exportType:"",//导出类型 + exportType: "", //导出类型 }, loading: true, distrules: { @@ -185,7 +226,7 @@ export default { { required: true, message: "请选择客户", trigger: "change" }, ], numbers: [{ required: true, validator: starts, trigger: "blur" }], - exportType: [ + exportType: [ { required: true, message: "请选择导出类型", trigger: "change" }, ], }, @@ -209,14 +250,23 @@ export default { selection: true, dialogClickModal: false, dialogWidth: "60%", + menuType: "menu", + menuWidth: "120", column: [ { - label: "id", + label: "主键id", prop: "id", - search: true, - width:180, + width: 180, addDisplay: false, editDisplay: false, + search: true, + rules: [ + { + required: true, + message: "请输入id", + trigger: "blur", + }, + ], }, { label: "租户名称", @@ -241,6 +291,13 @@ export default { prop: "userId", type: "select", dicUrl: "/api/iot-system/user/fillData", + formatter: (val, value, label) => { + if (value == -1) { + return "-"; + } else { + return `${label}`; + } + }, props: { label: "account", value: "id", @@ -593,7 +650,7 @@ export default { created() { this.tenantlists(); //租户下拉 this.userlists(); //用户下拉 - this.exportTypelistlists(); //导出类型 + this.exportTypelistlists(); //导出类型 }, computed: { ...mapGetters(["permission"]), @@ -636,7 +693,7 @@ export default { console.log(this.form); add(row).then( () => { - this.onLoad(this.page); + this.onLoad(this.page, this.query); this.$message({ type: "success", message: "操作成功!", @@ -653,7 +710,7 @@ export default { rowUpdate(row, index, done, loading) { update(row).then( () => { - this.onLoad(this.page); + this.onLoad(this.page, this.query); this.$message({ type: "success", message: "操作成功!", @@ -677,7 +734,7 @@ export default { return remove(row.id); }) .then(() => { - this.onLoad(this.page); + this.onLoad(this.page, this.query); this.$message({ type: "success", message: "操作成功!", @@ -699,7 +756,7 @@ export default { return remove(this.ids); }) .then(() => { - this.onLoad(this.page); + this.onLoad(this.page, this.query); this.$message({ type: "success", message: "操作成功!", @@ -769,7 +826,7 @@ export default { } }); }, - //导出类型 + //导出类型 exportTypelistlists() { exporttype().then((res) => { if (res.data.code == 200) { @@ -787,6 +844,40 @@ export default { this.iform.tenantId = null; } }, + //同步实名 + handleRealname(id) { + syncRealNameStatus(id).then((res) => { + console.log(res, 978); + if (res.data.code == 200) { + this.$message.success("同步成功"); + this.onLoad(this.page, this.query); + } else { + this.$message.error("同步失败"); + } + }); + }, + //停机复机 + handleSimStatus(id,type) { + if (type == 4) { + updateSimStatus({id:id,operType:1}).then((res) => { + if (res.data.code == 200) { + this.$message.success("复机成功"); + this.onLoad(this.page, this.query); + }else{ + this.$message.error("复机失败"); + } + }) + }else{ + updateSimStatus({id:id,operType:0}).then((res) => { + if (res.data.code == 200) { + this.$message.success("停机成功"); + this.onLoad(this.page, this.query); + }else{ + this.$message.error("停机失败"); + } + }); + } + }, onLoad(page, params = {}) { this.loading = true; getList( diff --git a/src/views/informationmanage/sim/index.vue b/src/views/informationmanage/sim/index.vue index 5f32b6f..4070270 100644 --- a/src/views/informationmanage/sim/index.vue +++ b/src/views/informationmanage/sim/index.vue @@ -37,6 +37,47 @@ >删 除 --> + @@ -106,12 +147,13 @@