diff --git a/src/api/system/manage/carInformation.js b/src/api/system/manage/carInformation.js index bfdaf27..4bc6e09 100644 --- a/src/api/system/manage/carInformation.js +++ b/src/api/system/manage/carInformation.js @@ -12,7 +12,7 @@ export function findInformationList(data) { // 新增 export function insertInformation(data) { return request({ - url: '/manage/carmsg/addCarMsg', + url: '/enterprise/information/insertInformation', method: 'post', data }) @@ -21,7 +21,7 @@ export function insertInformation(data) { // 修改 export function updateInformationById(data) { return request({ - url: '/manage/carmsg/updateInformationById', + url: '/enterprise/carmsg/updateInformationById', method: 'post', data }) @@ -38,7 +38,7 @@ export function deleteInformationById(id) { // 根据ID查询信息 export function findInformationByid(id) { return request({ - url: '/manage/carmsg/findInformationByid?id='+id, + url: '/enterprise/carmsg/findInformationByid?id='+id, method: 'post' }) } diff --git a/src/views/fence/list.vue b/src/views/fence/list.vue index 8b1b08b..a5147c5 100644 --- a/src/views/fence/list.vue +++ b/src/views/fence/list.vue @@ -128,7 +128,7 @@ - + diff --git a/src/views/system/manage/carInformation/index.vue b/src/views/system/manage/carInformation/index.vue index 4d3eb09..ee35d8a 100644 --- a/src/views/system/manage/carInformation/index.vue +++ b/src/views/system/manage/carInformation/index.vue @@ -34,94 +34,6 @@
添加
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 确 定 - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 修 改 - -
- + - + 取 消 确 定 - + - + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 确 定 + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 修 改 + +
@@ -265,226 +258,249 @@ import { updCarStrategyId } from '@/api/system/manage/carInformation' import { findStrategyListByCarTypeId, updateStrategy } from '@/api/warning/strategy' -import { boundGroupAndCar, selectAllGroup } from '@/api/fence/group' +import { boundGroupAndCar, getGroupListResp, selectAllGroup } from '@/api/fence/group' export default { - //import引入的组件需要注入到对象中才能使用" - components: {}, - props: {}, - data() { - //这里存放数据" - return { - GroupAndCarBound:{ - vin:null, - //多选框选中内容 - groupListResp: [], - }, - insertForm: {}, - updateForm: {}, - //围栏组列表 - groupList:[], - //抽屉属性 - drawer:false, - //抽屉呼出方向 从右到左 - direction:'rtl', - dialogVisibleAdd: false, - dialogVisibleUpd: false, - strategyId:null, - carId:null, - dialogVisible: false, - tableData: [], - - // 查询参数 - selectInformation: { - pageNum: 1, - pageSize: 10, - carVin:'', - carType:'', - groupCode:'', - state:'1', - carMotorManufacturer:'', - carBatteryManufacturer:'' - }, - zt:{ - status: "" - }, - strategyList:[], - queryParams:{}, - }; - }, - //计算属性 类似于data概念", - computed: {}, - //监控data中的数据变化", - watch: {}, - //方法集合", - methods: { - - dobound(){ - - boundGroupAndCar(this.GroupAndCarBound).then(res=>{ - - this.$modal.msgSuccess("绑定成功"); - this.drawer=false; - }) - - - }, - handleSelectionChange(val) { - this.GroupAndCarBound.groupListResp = val; + dicts: ['sys_car_group'], + //import引入的组件需要注入到对象中才能使用" + components: {}, + props: {}, + data() { + //这里存放数据" + return { + GroupAndCarBound:{ + vin:null, + //多选框选中内容 + groupListResp: [], }, + //围栏组列表 + groupList:[], + //抽屉属性 + drawer:false, + //抽屉呼出方向 从右到左 + direction:'rtl', - handleClose(done) { - this.$confirm('确认关闭?') - .then(_ => { - done(); - }) - .catch(_ => {}); - }, + strategyId:null, + carId:null, + dialogVisible: false, + tableData: [], - boundFenceGroup(row){ - this.GroupAndCarBound.vin=row.carVin; - selectAllGroup().then(res=>{ + // 查询参数 + selectInformation: { + pageNum: 1, + pageSize: 10, + carVin:'', + carType:'', + groupCode:'', + state:'1', + carMotorManufacturer:'', + carBatteryManufacturer:'' + }, + zt:{ + status: "" + }, + strategyList:[], + queryParams:{}, - this.groupList = res.data; + insertForm: {}, + updateForm: {}, + dialogVisibleAdd: false, + dialogVisibleUpd: false, + }; + }, + //计算属性 类似于data概念", + computed: {}, + //监控data中的数据变化", + watch: {}, + //方法集合", + methods: { - console.log(this.groupList); - this.drawer =true; - }) + lookboundGroup(row){ + selectAllGroup().then(res=>{ + this.groupList = res.data; + }) + this.drawer=true; - }, - updCarStrategyId(){ - updCarStrategyId(this.carId,this.strategyId).then((res)=>{ - this.$modal.msgSuccess("修改成功"); - this.dialogVisible = false; - this.getList(); - }) - }, - /** 给车辆配置策略*/ - configurationStrategy(row){ - this.dialogVisible = true - this.carId=row.id - this.getStrategyList(row.typeId); - }, + getGroupListResp(row).then(res=>{ - getStrategyList(typeId) { - this.loading = true; - findStrategyListByCarTypeId(typeId).then(response => { - this.strategyList = response.data.rows; - this.total = response.data.total; - this.loading = false; - console.log(response) - }); - }, - - /** 列表 */ - getList() { - findInformationList(this.selectInformation).then(res => { - this.tableData = res.data; - } - ); - }, - // 状态修改 - handleStatusChange(row) { - let text = row.state === "0" ? "上线" : "下线"; - this.$modal.confirm('确认要"' + text + '""' + row.carBrand + '"车辆吗?').then(function () { - return gaiZhuangTai(row.id, row.state); - }).then(() => { - this.$modal.msgSuccess(text + "成功"); - }).catch(function () { - row.state = row.state === "0" ? "1" : "0"; - }); - }, - // 提交 - onSubmit(){ - this.getList(this.selectInformation); - }, - // 重置 - chongzhi(){ - this.selectInformation={ - carVin:'', - carType:'', - groupCode:'', - state:'', - carMotorManufacturer:'', - carBatteryManufacturer:'' + let rows = res.data; + console.log(rows) + if (rows!=null&&rows!=undefined&&rows!=''){ + rows.forEach(row => { + console.log(this.groupList[row.id-1]); + console.log(row); + this.$refs.multipleTable.toggleRowSelection(this.groupList[row.id-1]); + }); } - this.getList(); - }, - // 修改 - handleEdit(row){ - this.dialogVisibleUpd = true - // 回显 - findInformationByid(row.id).then(res=>{ - this.updateForm = res.data; - }) - }, - /** 删除 */ - handleDelete(row){ - this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - deleteInformationById(row.id).then(res=>{ - this.$message({ - type: 'success', - message: '删除成功!' - }); - this.getList(); - }) - }) - }, - //添加 - handleAdd(){ - this.dialogVisibleAdd = true - }, - doAdd(){ - insertInformation(this.insertForm).then(res=>{ - alert(res.msg) - if(res.code == 200){ - alert("添加成功") - this.getList(); - } - }) - }, - doUpd(){ - updateInformationById(this.updateForm).then(res=>{ - alert(res.msg) - if(res.code == 200){ - alert("修改成功") - this.getList(); - } - }) - }, + }) + }, + dobound(){ + + boundGroupAndCar(this.GroupAndCarBound).then(res=>{ + + this.$modal.msgSuccess("绑定成功"); + this.drawer=false; + }) + + + }, + handleSelectionChange(val) { + this.GroupAndCarBound.groupListResp = val; }, + handleClose(done) { + this.$confirm('确认关闭?') + .then(_ => { + done(); + }) + .catch(_ => {}); + }, - //生命周期 - 创建完成(可以访问当前this实例)", - created() { + boundFenceGroup(row){ + this.GroupAndCarBound.vin=row.carVin; + selectAllGroup().then(res=>{ + + this.groupList = res.data; + + console.log(this.groupList); + this.drawer =true; + }) + + }, + updCarStrategyId(){ + updCarStrategyId(this.carId,this.strategyId).then((res)=>{ + this.$modal.msgSuccess("修改成功"); + this.dialogVisible = false; + this.getList(); + }) + }, + /** 给车辆配置策略*/ + configurationStrategy(row){ + this.dialogVisible = true + this.carId=row.id + this.getStrategyList(row.typeId); + }, + + getStrategyList(typeId) { + this.loading = true; + findStrategyListByCarTypeId(typeId).then(response => { + this.strategyList = response.data.rows; + this.total = response.data.total; + this.loading = false; + console.log(response) + }); + }, + + /** 列表 */ + getList() { + findInformationList(this.selectInformation).then(res => { + this.tableData = res.data; + } + ); + }, + // 状态修改 + handleStatusChange(row) { + let text = row.state === "0" ? "上线" : "下线"; + this.$modal.confirm('确认要"' + text + '""' + row.carBrand + '"车辆吗?').then(function () { + return gaiZhuangTai(row.id, row.state); + }).then(() => { + this.$modal.msgSuccess(text + "成功"); + }).catch(function () { + row.state = row.state === "0" ? "1" : "0"; + }); + }, + // 提交 + onSubmit(){ + this.getList(this.selectInformation); + }, + // 重置 + chongzhi(){ + this.selectInformation={ + carVin:'', + carType:'', + groupCode:'', + state:'', + carMotorManufacturer:'', + carBatteryManufacturer:'' + } this.getList(); }, - //生命周期 - 挂载完成(可以访问DOM元素)", - mounted() { + // 修改 + handleEdit(row){ + this.dialogVisibleUpd = true + // 回显 + findInformationByid(row.id).then(res=>{ + this.updateForm = res.data; + }) }, - beforeCreate() { - }, //生命周期 - 创建之前", - beforeMount() { - }, //生命周期 - 挂载之前", - beforeUpdate() { - }, //生命周期 - 更新之前", - updated() { - }, //生命周期 - 更新之后", - beforeDestroy() { - }, //生命周期 - 销毁之前", - destroyed() { - }, //生命周期 - 销毁完成", - activated() { - } //如果页面有keep-alive缓存功能,这个函数会触发", - }; + /** 删除 */ + handleDelete(row){ + this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + deleteInformationById(row.id).then(res=>{ + this.$message({ + type: 'success', + message: '删除成功!' + }); + this.getList(); + }) + }) + }, + + //添加 + handleAdd(){ + this.dialogVisibleAdd = true + }, + doAdd(){ + insertInformation(this.insertForm).then(res=>{ + alert(res.msg) + if(res.code == 200){ + alert("添加成功") + this.getList(); + } + + }) + }, + doUpd(){ + updateInformationById(this.updateForm).then(res=>{ + alert(res.msg) + if(res.code == 200){ + alert("修改成功") + this.getList(); + } + + }) + }, + }, + //生命周期 - 创建完成(可以访问当前this实例)", + created() { + this.getList(); + }, + //生命周期 - 挂载完成(可以访问DOM元素)", + mounted() { + }, + beforeCreate() { + }, //生命周期 - 创建之前", + beforeMount() { + }, //生命周期 - 挂载之前", + beforeUpdate() { + }, //生命周期 - 更新之前", + updated() { + }, //生命周期 - 更新之后", + beforeDestroy() { + }, //生命周期 - 销毁之前", + destroyed() { + }, //生命周期 - 销毁完成", + activated() { + } //如果页面有keep-alive缓存功能,这个函数会触发", +};