diff --git a/src/api/communication/outbound.js b/src/api/communication/outbound.js index af8760b..c5c9fed 100644 --- a/src/api/communication/outbound.js +++ b/src/api/communication/outbound.js @@ -46,3 +46,20 @@ export const update = (row) => { data: row }) } + +//租户下拉 +export const tenant = () => { + return request({ + url: '/api/iot-system/tenant/fillData', + method: 'get', + }) +} + +//用户下拉 +export const user = () => { + return request({ + url: '/api/iot-system/user/fillData', + method: 'get', + }) +} + diff --git a/src/views/communicationmanage/basiccard/basiccard.vue b/src/views/communicationmanage/basiccard/basiccard.vue index c125c03..a4a52af 100644 --- a/src/views/communicationmanage/basiccard/basiccard.vue +++ b/src/views/communicationmanage/basiccard/basiccard.vue @@ -232,7 +232,7 @@ export default { }, excelOption: { submitBtn: false, - emptyBtn: false, + emptyBtn: true, column: [ { label: "通道名称", @@ -889,7 +889,26 @@ export default { } }); } else { - // 写回播 + simCallback(this.distribution).then((res) => { + if (res.data.data == "") { + this.$message.success("操作成功"); + this.$refs.distribution.resetFields(); + this.dialogVisible = false; + } else { + const h = this.$createElement; + this.$notify.error({ + title: "出库失败号码", + message: h( + "i", + { style: "color: teal; word-break: break-all;" }, + res.data.data + ), + duration: 0, + }); + this.$refs.distribution.resetFields(); + this.dialogVisible = false; + } + }); } } else { } diff --git a/src/views/communicationmanage/outbound/outbound.vue b/src/views/communicationmanage/outbound/outbound.vue index 74d88ae..c554ace 100644 --- a/src/views/communicationmanage/outbound/outbound.vue +++ b/src/views/communicationmanage/outbound/outbound.vue @@ -38,6 +38,71 @@ + + + + + + + + + + + + + + + + + + + + 导出 + 取消 + + @@ -48,6 +113,8 @@ import { getDetail, remove, update, + tenant, + user, } from "@/api/communication/outbound"; import { mapGetters } from "vuex"; import { getToken } from "@/util/auth"; @@ -56,8 +123,35 @@ export default { return { form: {}, query: {}, + iform: { + type: null, //租户/客户 + tenantId: null, //租户 + userId: null, //客户 + }, selectionList: [], + tenantlist: [], //租户下拉 + userlist: [], //用户下拉 + typelist: [ + { + label: "租户", + id: 1, + }, + { + label: "客户", + id: 2, + }, + ], + importBox: false, //导出布尔 loading: true, + importrules: { + type: [ + { required: true, message: "请选择租户/客户", trigger: "change" }, + ], + tenantId: [ + { required: true, message: "请选择租户", trigger: "change" }, + ], + userId: [{ required: true, message: "请选择客户", trigger: "change" }], + }, page: { pageSize: 10, currentPage: 1, @@ -78,6 +172,13 @@ export default { dialogClickModal: false, dialogWidth: "60%", column: [ + { + label: "id", + prop: "id", + search: true, + addDisplay: false, + editDisplay: false, + }, { label: "租户名称", prop: "tenantId", @@ -451,7 +552,8 @@ export default { }, }, created() { - console.log(this.baseUrl, "baseUrl"); + this.tenantlists(); //租户下拉 + this.userlists(); //用户下拉 }, computed: { ...mapGetters(["permission"]), @@ -583,15 +685,65 @@ export default { refreshChange() { this.onLoad(this.page, this.query); }, - //导出 + //导出弹窗开启 handleExport() { - window.open( - `${this.baseUrl}/${ - this.apis - }iot-sim/simcarddeliver/export-simCardDeliver?${ - this.website.tokenHeader - }=${getToken()}` - ); + this.importBox = true; + }, + //确认导出 + onSubmit() { + this.$refs.iform.validate((valid) => { + if (valid) { + console.log( + `${this.baseUrl}/${ + this.apis + }iot-sim/simcarddeliver/export-simCardDeliver?${ + this.website.tokenHeader + }=${getToken()}&tenantId=${this.iform.tenantId}&userId=${ + this.iform.userId + }` + ); + window.open( + `${this.baseUrl}/${ + this.apis + }iot-sim/simcarddeliver/export-simCardDeliver?${ + this.website.tokenHeader + }=${getToken()}&tenantId=${this.iform.tenantId}&userId=${ + this.iform.userId + }` + ); + } + }); + }, + //导出弹窗关闭 + handleimportCloses() { + this.importBox = false; + this.$refs.iform.resetFields(); + }, + //租户下拉框 + tenantlists() { + tenant().then((res) => { + if (res.data.code == 200) { + this.tenantlist = res.data.data; + } + }); + }, + //用户下拉框 + userlists() { + user().then((res) => { + if (res.data.code == 200) { + this.userlist = res.data.data; + } + }); + }, + //选租户还是客户 + handleChange(e) { + if (e == 1) { + this.iform.type = 1; + this.iform.userId = null; + } else { + this.iform.type = 2; + this.iform.tenantId = null; + } }, onLoad(page, params = {}) { this.loading = true; diff --git a/src/views/package/basicpackage/index.vue b/src/views/package/basicpackage/index.vue index 2c38b76..f3959e5 100644 --- a/src/views/package/basicpackage/index.vue +++ b/src/views/package/basicpackage/index.vue @@ -19,15 +19,6 @@ @refresh-change="refreshChange" @on-load="onLoad" > - @@ -72,24 +63,27 @@ 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: "channelId", + type: "select", + dataType: "String", + span: 12, + dicUrl: "/api/iot-sim/channel/fillData", + search: true, + labelWidth: 130, + props: { + label: "name", + value: "id", + }, + rules: [ + { + required: true, + message: "请选择通道名称", + trigger: "change", + }, + ], + }, { label: "套餐组名称", prop: "dataPlanGroupId",