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": { "dependencies": {
"@antv/g2": "^4.1.30", "@antv/g2": "^4.1.30",
"@smallwei/avue": "^2.9.11",
"avue-plugin-ueditor": "^0.1.4", "avue-plugin-ueditor": "^0.1.4",
"axios": "^0.18.0", "axios": "^0.18.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
@ -20,6 +21,7 @@
"clipboard": "^2.0.10", "clipboard": "^2.0.10",
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
"echarts": "^5.3.3",
"element-ui": "^2.15.6", "element-ui": "^2.15.6",
"js-base64": "^2.5.1", "js-base64": "^2.5.1",
"js-cookie": "^2.2.0", "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', 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 website from '@/config/website';
import crudCommon from '@/mixins/crud'; import crudCommon from '@/mixins/crud';
import {baseUrl,apis} from '@/config/env'; import {baseUrl,apis} from '@/config/env';
import dataV from '@jiaminghi/data-view'
Vue.use(dataV)
// 注册全局crud驱动 // 注册全局crud驱动
window.$crudCommon = crudCommon; window.$crudCommon = crudCommon;
// 加载Vue拓展 // 加载Vue拓展

2
src/router/axios.js

@ -18,7 +18,7 @@ import 'nprogress/nprogress.css';
import {baseUrl} from '@/config/env'; import {baseUrl} from '@/config/env';
//默认超时时间 //默认超时时间
axios.defaults.timeout = 30000; axios.defaults.timeout = 300000;
//返回其他状态码 //返回其他状态码
axios.defaults.validateStatus = function (status) { axios.defaults.validateStatus = function (status) {
return status >= 200 && status <= 500; return status >= 200 && status <= 500;

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

@ -58,6 +58,12 @@
> >
</el-button> </el-button>
</template> </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> </avue-crud>
<el-dialog <el-dialog
title="导入" title="导入"
@ -71,11 +77,6 @@
v-model="excelForm" v-model="excelForm"
:upload-after="uploadAfter" :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> </avue-form>
</el-dialog> </el-dialog>
<!-- 分拨弹窗 --> <!-- 分拨弹窗 -->
@ -95,7 +96,7 @@
<el-form-item <el-form-item
label="分拨租户" label="分拨租户"
prop="tenantId" prop="tenantId"
v-if="distitle == '分拨'" v-if="distitle == '分拨' || distitle == '出库'"
> >
<el-select <el-select
v-model="distribution.tenantId" v-model="distribution.tenantId"
@ -107,7 +108,7 @@
v-for="(item, index) in tenantlist" v-for="(item, index) in tenantlist"
:label="item.tenantName" :label="item.tenantName"
:value="item.tenantId" :value="item.tenantId"
:key="item.tenantId" :key="item.index"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -133,7 +134,7 @@
<el-form-item <el-form-item
label="基础套餐" label="基础套餐"
prop="dataPlanId" prop="dataPlanId"
v-if="distitle == '分拨'" v-if="distitle == '分拨' || distitle == '出库'"
> >
<el-select <el-select
v-model="distribution.dataPlanId" v-model="distribution.dataPlanId"
@ -149,7 +150,11 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="开始/结束号码" prop="numbers"> <el-form-item
label="开始/结束号码"
prop="numbers"
v-if="this.distitle != '出库'"
>
<el-col :span="10"> <el-col :span="10">
<el-form-item prop="numStart"> <el-form-item prop="numStart">
<el-input <el-input
@ -197,6 +202,7 @@ import {
simdeliver, simdeliver,
dataplan, dataplan,
simCallback, simCallback,
deliver,
} from "@/api/communication/basiccard"; } from "@/api/communication/basiccard";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { getToken } from "@/util/auth"; import { getToken } from "@/util/auth";
@ -205,10 +211,7 @@ export default {
data() { data() {
var reg = /[A-Za-z]/i; var reg = /[A-Za-z]/i;
var starts = (rule, value, callback) => { var starts = (rule, value, callback) => {
if ( if (this.distribution.numEnd == "" || this.distribution.numStart == "") {
this.distribution.numEnd == "" ||
this.distribution.numStart == ""
) {
callback(new Error("开始号码结束号码均不能为空")); callback(new Error("开始号码结束号码均不能为空"));
} else if ( } else if (
this.distribution.numEnd < 0 || this.distribution.numEnd < 0 ||
@ -220,11 +223,11 @@ export default {
) { ) {
callback(new Error("开始号码必须小于结束号码")); callback(new Error("开始号码必须小于结束号码"));
} else if ( } 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("开始结束号码中包含字母,请选择其他导出类型")); callback(new Error("开始结束号码中包含字母,请选择其他导出类型"));
} } else {
else {
callback(); callback();
} }
}; };
@ -405,6 +408,8 @@ export default {
selection: true, selection: true,
dialogClickModal: false, dialogClickModal: false,
dialogWidth: "60%", dialogWidth: "60%",
menuType: "menu",
menuWidth: "120",
column: [ column: [
{ {
label: "id", label: "id",
@ -625,6 +630,7 @@ export default {
], ],
}, },
data: [], data: [],
deliverId:"",//id
}; };
}, },
computed: { computed: {
@ -729,7 +735,7 @@ export default {
rowSave(row, done, loading) { rowSave(row, done, loading) {
add(row).then( add(row).then(
(res) => { (res) => {
if (res.data.data == true) { if (res.data.data == 1) {
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
@ -755,7 +761,7 @@ export default {
rowUpdate(row, index, done, loading) { rowUpdate(row, index, done, loading) {
update(row).then( update(row).then(
(res) => { (res) => {
if (res.data.data == true) { if (res.data.data == 1) {
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
@ -896,11 +902,15 @@ export default {
}); });
}, },
// //
handleAllocate(e) { handleAllocate(e,row) {
if (e == 1) { if (e == 1) {
this.distitle = "分拨"; this.distitle = "分拨";
} else { } else if (e == 2) {
this.distitle = "回拨"; this.distitle = "回拨";
} else if (e == 3) {
this.distitle = "出库";
this.deliverId = row.row.id;
} }
this.dialogVisible = true; this.dialogVisible = true;
}, },
@ -919,6 +929,7 @@ export default {
this.$message.success("操作成功"); this.$message.success("操作成功");
this.$refs.distribution.resetFields(); this.$refs.distribution.resetFields();
this.dialogVisible = false; this.dialogVisible = false;
this.onLoad(this.page);
} else { } else {
const h = this.$createElement; const h = this.$createElement;
this.$notify.error({ this.$notify.error({
@ -934,12 +945,13 @@ export default {
this.dialogVisible = false; this.dialogVisible = false;
} }
}); });
} else { } else if (this.distitle == "回拨") {
simCallback(this.distribution).then((res) => { simCallback(this.distribution).then((res) => {
if (res.data.data == "") { if (res.data.data == "") {
this.$message.success("操作成功"); this.$message.success("操作成功");
this.$refs.distribution.resetFields(); this.$refs.distribution.resetFields();
this.dialogVisible = false; this.dialogVisible = false;
this.onLoad(this.page);
} else { } else {
const h = this.$createElement; const h = this.$createElement;
this.$notify.error({ this.$notify.error({
@ -955,8 +967,24 @@ export default {
this.dialogVisible = false; 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 { } else {
this.$refs.distribution.resetFields();
this.dialogVisible = false;
}
});
}
} }
}); });
}, },

7
src/views/communicationmanage/channel/channel.vue

@ -117,6 +117,13 @@ export default {
prop: "apiUrl", prop: "apiUrl",
span: 12, span: 12,
labelWidth: 130, labelWidth: 130,
formatter: (val, value, label) => {
if (value == "") {
return "-";
} else {
return `${value}`;
}
},
rules: [ rules: [
{ required: true, message: "请输入apiUrl", trigger: "blur" }, { required: true, message: "请输入apiUrl", trigger: "blur" },
], ],

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

@ -37,6 +37,47 @@
> >
</el-button> </el-button>
</template> </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> </avue-crud>
<!-- 导出弹窗 --> <!-- 导出弹窗 -->
@ -46,7 +87,6 @@
append-to-body append-to-body
width="35%" width="35%"
:before-close="handleClose" :before-close="handleClose"
> >
<el-form <el-form
ref="distribution" ref="distribution"
@ -129,7 +169,9 @@ import {
update, update,
tenant, tenant,
user, user,
exporttype exporttype,
syncRealNameStatus,
updateSimStatus,
} from "@/api/communication/outbound"; } from "@/api/communication/outbound";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { getToken } from "@/util/auth"; import { getToken } from "@/util/auth";
@ -137,10 +179,7 @@ export default {
data() { data() {
var reg = /[A-Za-z]/i; var reg = /[A-Za-z]/i;
var starts = (rule, value, callback) => { var starts = (rule, value, callback) => {
if ( if (this.distribution.numEnd == "" || this.distribution.numStart == "") {
this.distribution.numEnd == "" ||
this.distribution.numStart == ""
) {
callback(new Error("开始号码结束号码均不能为空")); callback(new Error("开始号码结束号码均不能为空"));
} else if ( } else if (
this.distribution.numEnd < 0 || this.distribution.numEnd < 0 ||
@ -152,7 +191,8 @@ export default {
) { ) {
callback(new Error("开始号码必须小于结束号码")); callback(new Error("开始号码必须小于结束号码"));
} else if ( } 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("开始结束号码中包含字母,请选择其他导出类型")); callback(new Error("开始结束号码中包含字母,请选择其他导出类型"));
} else { } else {
@ -167,6 +207,7 @@ export default {
tenantId: null, // tenantId: null, //
userId: null, // userId: null, //
}, },
status: "",
dialogVisible: false, // dialogVisible: false, //
selectionList: [], selectionList: [],
tenantlist: [], // tenantlist: [], //
@ -209,14 +250,23 @@ export default {
selection: true, selection: true,
dialogClickModal: false, dialogClickModal: false,
dialogWidth: "60%", dialogWidth: "60%",
menuType: "menu",
menuWidth: "120",
column: [ column: [
{ {
label: "id", label: "主键id",
prop: "id", prop: "id",
search: true,
width: 180, width: 180,
addDisplay: false, addDisplay: false,
editDisplay: false, editDisplay: false,
search: true,
rules: [
{
required: true,
message: "请输入id",
trigger: "blur",
},
],
}, },
{ {
label: "租户名称", label: "租户名称",
@ -241,6 +291,13 @@ export default {
prop: "userId", prop: "userId",
type: "select", type: "select",
dicUrl: "/api/iot-system/user/fillData", dicUrl: "/api/iot-system/user/fillData",
formatter: (val, value, label) => {
if (value == -1) {
return "-";
} else {
return `${label}`;
}
},
props: { props: {
label: "account", label: "account",
value: "id", value: "id",
@ -636,7 +693,7 @@ export default {
console.log(this.form); console.log(this.form);
add(row).then( add(row).then(
() => { () => {
this.onLoad(this.page); this.onLoad(this.page, this.query);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!", message: "操作成功!",
@ -653,7 +710,7 @@ export default {
rowUpdate(row, index, done, loading) { rowUpdate(row, index, done, loading) {
update(row).then( update(row).then(
() => { () => {
this.onLoad(this.page); this.onLoad(this.page, this.query);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!", message: "操作成功!",
@ -677,7 +734,7 @@ export default {
return remove(row.id); return remove(row.id);
}) })
.then(() => { .then(() => {
this.onLoad(this.page); this.onLoad(this.page, this.query);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!", message: "操作成功!",
@ -699,7 +756,7 @@ export default {
return remove(this.ids); return remove(this.ids);
}) })
.then(() => { .then(() => {
this.onLoad(this.page); this.onLoad(this.page, this.query);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!", message: "操作成功!",
@ -787,6 +844,40 @@ export default {
this.iform.tenantId = null; 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 = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
getList( getList(

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

@ -37,6 +37,47 @@
> >
</el-button> --> </el-button> -->
</template> </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> </avue-crud>
<!-- 导出弹窗 --> <!-- 导出弹窗 -->
@ -107,6 +148,7 @@
<script> <script>
import { getList, getDetail, exporttype } from "@/api/informationmanage/sim.js"; import { getList, getDetail, exporttype } from "@/api/informationmanage/sim.js";
import { syncRealNameStatus, updateSimStatus} from "@/api/communication/outbound";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { getToken } from "@/util/auth"; import { getToken } from "@/util/auth";
export default { export default {
@ -124,13 +166,12 @@ export default {
Number(this.distribution.numStart) > Number(this.distribution.numEnd) Number(this.distribution.numStart) > Number(this.distribution.numEnd)
) { ) {
callback(new Error("开始号码必须小于结束号码")); callback(new Error("开始号码必须小于结束号码"));
} } else if (
else if ( reg.test(this.distribution.numStart) == true ||
reg.test(this.distribution.numStart) == true|| reg.test(this.distribution.numEnd) == true reg.test(this.distribution.numEnd) == true
) { ) {
callback(new Error("开始结束号码中包含字母,请选择其他导出类型")); callback(new Error("开始结束号码中包含字母,请选择其他导出类型"));
} } else {
else {
callback(); callback();
} }
}; };
@ -179,9 +220,10 @@ export default {
dialogDrag: true, dialogDrag: true,
columnBtn: false, columnBtn: false,
selection: false, selection: false,
menuWidth: 120,
dialogClickModal: false, dialogClickModal: false,
dialogWidth: "60%", dialogWidth: "60%",
menuType: "menu",
menuWidth: "120",
column: [ column: [
{ {
label: "id", 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 = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
getList( getList(

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

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

47
src/views/original/targetpackagemanage/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",
@ -414,19 +414,12 @@ export default {
}, },
// //
handleExport() { handleExport() {
if (process.env.NODE_ENV === "production") {
window.open( 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 this.website.tokenHeader
}=${getToken()}` }=${getToken()}`
); );
} else {
window.open(
`/api/iot-sim/simcard/export-simCard?${
this.website.tokenHeader
}=${getToken()}`
);
}
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;

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

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

Loading…
Cancel
Save