Browse Source

fix:修改原有逻辑

confidence
杜贤金 3 years ago
parent
commit
6426840457
  1. 2
      package.json
  2. 12
      src/api/communication/basiccard.js
  3. 20
      src/api/communication/outbound.js
  4. 2
      src/main.js
  5. 2
      src/router/axios.js
  6. 72
      src/views/communicationmanage/basiccard/basiccard.vue
  7. 7
      src/views/communicationmanage/channel/channel.vue
  8. 117
      src/views/communicationmanage/outbound/outbound.vue
  9. 88
      src/views/informationmanage/sim/index.vue
  10. 2
      src/views/original/targetpackagegroupmanage/index.vue
  11. 47
      src/views/original/targetpackagemanage/index.vue
  12. 2
      src/views/package/packagegroup/index.vue

2
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",

12
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
}
})
}

20
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
}
})
}

2
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拓展

2
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;

72
src/views/communicationmanage/basiccard/basiccard.vue

@ -58,6 +58,12 @@
>
</el-button>
</template>
<template slot-scope="scope" slot="menuBtn">
<el-dropdown-item v-if="scope.row.isDeliver != 2">
<i class="el-icon-sell"></i>
<span @click="handleAllocate(3,scope)">&nbsp;</span>
</el-dropdown-item>
</template>
</avue-crud>
<el-dialog
title="导入"
@ -71,11 +77,6 @@
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>
<!-- 分拨弹窗 -->
@ -95,7 +96,7 @@
<el-form-item
label="分拨租户"
prop="tenantId"
v-if="distitle == '分拨'"
v-if="distitle == '分拨' || distitle == '出库'"
>
<el-select
v-model="distribution.tenantId"
@ -107,7 +108,7 @@
v-for="(item, index) in tenantlist"
:label="item.tenantName"
:value="item.tenantId"
:key="item.tenantId"
:key="item.index"
></el-option>
</el-select>
</el-form-item>
@ -133,7 +134,7 @@
<el-form-item
label="基础套餐"
prop="dataPlanId"
v-if="distitle == '分拨'"
v-if="distitle == '分拨' || distitle == '出库'"
>
<el-select
v-model="distribution.dataPlanId"
@ -149,7 +150,11 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="开始/结束号码" prop="numbers">
<el-form-item
label="开始/结束号码"
prop="numbers"
v-if="this.distitle != '出库'"
>
<el-col :span="10">
<el-form-item prop="numStart">
<el-input
@ -197,6 +202,7 @@ import {
simdeliver,
dataplan,
simCallback,
deliver,
} from "@/api/communication/basiccard";
import { mapGetters } from "vuex";
import { getToken } from "@/util/auth";
@ -205,10 +211,7 @@ export default {
data() {
var reg = /[A-Za-z]/i;
var starts = (rule, value, callback) => {
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: {
@ -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;
}
});
}
}
});
},

7
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" },
],

117
src/views/communicationmanage/outbound/outbound.vue

@ -37,6 +37,47 @@
>
</el-button>
</template>
<template slot-scope="scope" slot="menuBtn">
<el-dropdown-item>
<el-popconfirm
confirm-button-text="确定"
cancel-button-text="取消"
@confirm="handleRealname(scope.row.id)"
icon-color="red"
title="您确认要同步实名吗?"
placement="top"
>
<div class="el-icon-refresh" slot="reference">
&nbsp;同步实名
</div>
</el-popconfirm>
</el-dropdown-item>
<el-dropdown-item>
<el-popconfirm
confirm-button-text="确定"
cancel-button-text="取消"
@confirm="handleSimStatus(scope.row.id, scope.row.lifecycleStatus)"
icon-color="red"
:title="scope.row.lifecycleStatus != 4?'您确认要停机吗?':'您确认要复机吗?'"
placement="top"
>
<div
v-if="scope.row.lifecycleStatus != 4"
class="el-icon-phone"
slot="reference"
>
&nbsp;申请停机
</div>
<div
v-if="scope.row.lifecycleStatus == 4"
class="el-icon-phone-outline"
slot="reference"
>
&nbsp;申请复机
</div>
</el-popconfirm>
</el-dropdown-item>
</template>
</avue-crud>
<!-- 导出弹窗 -->
@ -46,7 +87,6 @@
append-to-body
width="35%"
:before-close="handleClose"
>
<el-form
ref="distribution"
@ -129,7 +169,9 @@ import {
update,
tenant,
user,
exporttype
exporttype,
syncRealNameStatus,
updateSimStatus,
} from "@/api/communication/outbound";
import { mapGetters } from "vuex";
import { getToken } from "@/util/auth";
@ -137,10 +179,7 @@ export default {
data() {
var reg = /[A-Za-z]/i;
var starts = (rule, value, callback) => {
if (
this.distribution.numEnd == "" ||
this.distribution.numStart == ""
) {
if (this.distribution.numEnd == "" || this.distribution.numStart == "") {
callback(new Error("开始号码结束号码均不能为空"));
} else if (
this.distribution.numEnd < 0 ||
@ -152,7 +191,8 @@ 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 {
@ -167,6 +207,7 @@ export default {
tenantId: null, //
userId: null, //
},
status: "",
dialogVisible: false, //
selectionList: [],
tenantlist: [], //
@ -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,
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",
@ -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: "操作成功!",
@ -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(

88
src/views/informationmanage/sim/index.vue

@ -37,6 +37,47 @@
>
</el-button> -->
</template>
<template slot-scope="scope" slot="menuBtn">
<el-dropdown-item>
<el-popconfirm
confirm-button-text="确定"
cancel-button-text="取消"
@confirm="handleRealname(scope.row.id)"
icon-color="red"
title="您确认要同步实名吗?"
placement="top-start"
>
<div class="el-icon-refresh" slot="reference">
&nbsp;同步实名
</div>
</el-popconfirm>
</el-dropdown-item>
<el-dropdown-item>
<el-popconfirm
confirm-button-text="确定"
cancel-button-text="取消"
@confirm="handleSimStatus(scope.row.id, scope.row.lifecycleStatus)"
icon-color="red"
:title="scope.row.lifecycleStatus != 4?'您确认要停机吗?':'您确认要复机吗?'"
placement="top-start"
>
<div
v-if="scope.row.lifecycleStatus != 4"
class="el-icon-phone"
slot="reference"
>
&nbsp;申请停机
</div>
<div
v-if="scope.row.lifecycleStatus == 4"
class="el-icon-phone-outline"
slot="reference"
>
&nbsp;申请复机
</div>
</el-popconfirm>
</el-dropdown-item>
</template>
</avue-crud>
<!-- 导出弹窗 -->
@ -107,6 +148,7 @@
<script>
import { getList, getDetail, exporttype } from "@/api/informationmanage/sim.js";
import { syncRealNameStatus, updateSimStatus} from "@/api/communication/outbound";
import { mapGetters } from "vuex";
import { getToken } from "@/util/auth";
export default {
@ -124,13 +166,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();
}
};
@ -179,9 +220,10 @@ export default {
dialogDrag: true,
columnBtn: false,
selection: false,
menuWidth: 120,
dialogClickModal: false,
dialogWidth: "60%",
menuType: "menu",
menuWidth: "120",
column: [
{
label: "id",
@ -645,7 +687,39 @@ export default {
}
});
},
//
handleRealname(id) {
syncRealNameStatus(id).then((res) => {
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(

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

@ -163,7 +163,7 @@ export default {
},
//
rowUpdate(row, index, done, loading) {
update(Object.assign(row, this.isSources)).then(
update(row).then(
(res) => {
if (res.data.data == 1) {
this.onLoad(this.page);

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

@ -72,24 +72,24 @@ export default {
dialogClickModal: false,
dialogWidth: "60%",
column: [
{
label: "租户名称",
prop: "tenantId",
type: "select",
dicUrl: "/api/iot-system/tenant/fillData",
props: {
label: "tenantName",
value: "tenantId",
},
dataType: "String",
span: 12,
labelWidth: 130,
width: 140,
search: true,
rules: [
{ required: true, message: "请选择租户名称", trigger: "change" },
],
},
// {
// label: "",
// prop: "tenantId",
// type: "select",
// dicUrl: "/api/iot-system/tenant/fillData",
// props: {
// label: "tenantName",
// value: "tenantId",
// },
// dataType: "String",
// span: 12,
// labelWidth: 130,
// width: 140,
// search: true,
// rules: [
// { required: true, message: "", trigger: "change" },
// ],
// },
{
label: "套餐组名称",
prop: "dataPlanGroupId",
@ -414,19 +414,12 @@ export default {
},
//
handleExport() {
if (process.env.NODE_ENV === "production") {
window.open(
`http://223.99.228.240:18081/bd-core/tenant/dailybill/export-excel?${
`${this.baseUrl}/${this.apis}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;

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

@ -184,7 +184,7 @@ export default {
},
//
rowUpdate(row, index, done, loading) {
update(Object.assign(row, this.isSources)).then(
update(row).then(
(res) => {
if (res.data.data == 1) {
this.onLoad(this.page);

Loading…
Cancel
Save