diff --git a/sgzb-ui/src/api/dataPush/index.js b/sgzb-ui/src/api/dataPush/index.js new file mode 100644 index 00000000..3eda1ef0 --- /dev/null +++ b/sgzb-ui/src/api/dataPush/index.js @@ -0,0 +1,6 @@ +import request from '@/utils/request' + +// 推送设备 +export const pushNotificationsApi = (data) => { + return request.post('/base/machine/pushNotifications', data) +} \ No newline at end of file diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue index 003cd344..59372a2b 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue @@ -542,6 +542,7 @@ import { supplierInfoList, getListByMaType, } from '@/api/store/tools' +import { pushNotificationsApi } from '@/api/dataPush' // 推送至租赁平台 import { getProLists } from '@/api/base/base' import { imgUpLoad } from '@/api/system/upload' import { getTypeList } from '@/api/store/warehousing' @@ -755,7 +756,8 @@ export default { }, // 多选框选中数据 handleSelectionChange(selection) { - this.ids = selection.map((item) => item.maId) + // this.ids = selection.map((item) => item.maId) + this.ids = selection // this.single = selection.length != 1 // this.multiple = !selection.length }, @@ -839,9 +841,26 @@ export default { handlePush() { this.$modal .confirm('是否确认推送所选择的数据项?') - .then(() => { + .then(async () => { console.log('推送', this.ids) // this.$message.success('推送成功') + const deviceInfoList = this.ids.map((e) => { + const deviceInfo = { + itemType: e.itemType, // 设备种类 + deviceType: e.deviceType, // 设备类型 + specificationType: e.specificationType, // 规格型号 + maCode: e.maCode, // 设备编码 + maId: e.maId, // 编码Id + typeId: e.typeId, // typeId + } + + return deviceInfo + }) + const res = await pushNotificationsApi(deviceInfoList) + if (res.code == 200) { + this.$message.success('推送成功!') + this.getList() + } }) .catch(() => { this.$message.info('已取消推送') diff --git a/sgzb-ui/vue.config.js b/sgzb-ui/vue.config.js index ef31311a..bdd0fff0 100644 --- a/sgzb-ui/vue.config.js +++ b/sgzb-ui/vue.config.js @@ -42,11 +42,11 @@ module.exports = { // target: `https://test-cc.zhgkxt.com`,//线上环境-南网 // target: `https://z.csgmall.com.cn`, - target: `http://192.168.2.134:48080`, //超 + // target: `http://192.168.2.134:48080`, //超 // target: `http://10.40.92.81:8080`, //韩/ // target: `http://192.168.2.81:28080`,//旭/ // target: `http://192.168.2.248:28080`, //帅 - // target: `http://10.40.92.253:28080`, //福 + target: `http://192.168.2.240:28080`, //福 //******** 注意事项 ********* */ //1.全局替换qrUrl二维码扫码提供的网址-发布服务器的地址target;