master
bai 2024-10-07 22:28:31 +08:00
parent af87bfaae7
commit b73cb23886
2 changed files with 123 additions and 38 deletions

View File

@ -12,7 +12,7 @@ export function findInformationList(data) {
// 新增 // 新增
export function insertInformation(data) { export function insertInformation(data) {
return request({ return request({
url: '/enterprise/information/insertInformation', url: '/manage/carmsg/addCarMsg',
method: 'post', method: 'post',
data data
}) })
@ -21,7 +21,7 @@ export function insertInformation(data) {
// 修改 // 修改
export function updateInformationById(data) { export function updateInformationById(data) {
return request({ return request({
url: '/enterprise/information/updateInformationById', url: '/manage/carmsg/updateInformationById',
method: 'post', method: 'post',
data data
}) })
@ -38,7 +38,7 @@ export function deleteInformationById(id) {
// 根据ID查询信息 // 根据ID查询信息
export function findInformationByid(id) { export function findInformationByid(id) {
return request({ return request({
url: '/enterprise/information/findInformationByid?id='+id, url: '/manage/carmsg/findInformationByid?id='+id,
method: 'post' method: 'post'
}) })
} }

View File

@ -34,6 +34,94 @@
<div style="height: 40px;width: 700px"> <div style="height: 40px;width: 700px">
<el-button type="danger" plain @click="handleAdd"></el-button> <el-button type="danger" plain @click="handleAdd"></el-button>
</div> </div>
<el-dialog
title="添加"
:visible.sync="dialogVisibleAdd"
width="30%"
:before-close="handleClose">
<div style="margin: 20px;"></div>
<el-form : label-width="80px" :model="insertForm">
<el-form-item label="车辆VIn马">
<el-input v-model="insertForm.carVin"></el-input>
</el-form-item>
<el-form-item label="车辆品牌">
<el-input v-model="insertForm.carBrand"></el-input>
</el-form-item>
<el-form-item label="车辆类型外键">
<el-input v-model="insertForm.typeId"></el-input>
</el-form-item>
<el-form-item label="String">
<el-input v-model="insertForm.typeName"></el-input>
</el-form-item>
<el-form-item label="电子围栏外键">
<el-input v-model="insertForm.groupId"></el-input>
</el-form-item>
<el-form-item label="车辆电机厂商">
<el-input v-model="insertForm.carMotorManufacturer"></el-input>
</el-form-item>
<el-form-item label="电机型号">
<el-input v-model="insertForm.carMotorModel"></el-input>
</el-form-item>
<el-form-item label="车辆电池厂商">
<el-input v-model="insertForm.carBatteryManufacturer"></el-input>
</el-form-item>
<el-form-item label="电池型号">
<el-input v-model="insertForm.carBatteryModel"></el-input>
</el-form-item>
<el-form-item label="围栏组编码">
<el-input v-model="insertForm.groupCode"></el-input>
</el-form-item>
<el-form-item label="启用状态">
<el-input v-model="insertForm.state"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click=doAdd()> </el-button>
</span>
</el-dialog>
<!-- 修改-->
<el-dialog
title="修改"
:visible.sync="dialogVisibleUpd"
width="30%"
:before-close="handleClose">
<div style="margin: 20px;"></div>
<el-form : label-width="80px" :model="updateForm">
<el-form-item label="车辆VIn马">
<el-input v-model="updateForm.carVin"></el-input>
</el-form-item>
<el-form-item label="车辆品牌">
<el-input v-model="updateForm.carBrand"></el-input>
</el-form-item>
<el-form-item label="车辆类型外键">
<el-input v-model="updateForm.typeId"></el-input>
</el-form-item>
<el-form-item label="电子围栏外键">
<el-input v-model="updateForm.groupId"></el-input>
</el-form-item>
<el-form-item label="车辆电机厂商">
<el-input v-model="updateForm.carMotorManufacturer"></el-input>
</el-form-item>
<el-form-item label="电机型号">
<el-input v-model="updateForm.carMotorModel"></el-input>
</el-form-item>
<el-form-item label="车辆电池厂商">
<el-input v-model="updateForm.carBatteryManufacturer"></el-input>
</el-form-item>
<el-form-item label="电池型号">
<el-input v-model="updateForm.carBatteryModel"></el-input>
</el-form-item>
<el-form-item label="围栏组编码">
<el-input v-model="updateForm.groupCode"></el-input>
</el-form-item>
<el-form-item label="启用状态">
<el-input v-model="updateForm.state"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click=doUpd()> </el-button>
</span>
</el-dialog>
<!--列表--> <!--列表-->
<template> <template>
<el-table <el-table
@ -56,10 +144,8 @@
prop="typeName"> prop="typeName">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="是否绑定围栏"> label="电子围栏外键"
<template slot-scope="scope"> prop="groupId">
<dict-tag :options="dict.type.sys_car_group" :value="scope.row.groupId"/>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="车辆电机厂商" label="车辆电机厂商"
@ -96,8 +182,7 @@
<el-button type="text" @click="handleEdit(scope.row)"></el-button> <el-button type="text" @click="handleEdit(scope.row)"></el-button>
<el-button type="text" @click="handleDelete(scope.row)"></el-button> <el-button type="text" @click="handleDelete(scope.row)"></el-button>
<el-button type="text" @click="configurationStrategy(scope.row)"></el-button> <el-button type="text" @click="configurationStrategy(scope.row)"></el-button>
<el-button type="primary" class="el-icon-connection" @click="boundFenceGroup(scope.row)" v-show="scope.row.groupId==0"></el-button> <el-button type="text" class="el-icon-connection" @click="boundFenceGroup(scope.row)"></el-button>
<el-button type="success" class="el-icon-link" @click="lookboundGroup(scope.row)" v-show="scope.row.groupId==1"></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -174,16 +259,15 @@
//jsjsjson, //jsjsjson,
//import from ', //import from ',
import { import {
deleteInformationById, deleteInformationById, findInformationByid,
findInformationList, findInformationList,
insertInformation, insertInformation, updateInformationById,
updCarStrategyId updCarStrategyId
} from '@/api/system/manage/carInformation' } from '@/api/system/manage/carInformation'
import { findStrategyListByCarTypeId, updateStrategy } from '@/api/warning/strategy' import { findStrategyListByCarTypeId, updateStrategy } from '@/api/warning/strategy'
import { boundGroupAndCar, getGroupListResp, selectAllGroup } from '@/api/fence/group' import { boundGroupAndCar, selectAllGroup } from '@/api/fence/group'
export default { export default {
dicts: ['sys_car_group'],
//import使" //import使"
components: {}, components: {},
props: {}, props: {},
@ -195,14 +279,16 @@ export default {
// //
groupListResp: [], groupListResp: [],
}, },
insertForm: {},
updateForm: {},
// //
groupList:[], groupList:[],
// //
drawer:false, drawer:false,
// //
direction:'rtl', direction:'rtl',
dialogVisibleAdd: false,
dialogVisibleUpd: false,
strategyId:null, strategyId:null,
carId:null, carId:null,
dialogVisible: false, dialogVisible: false,
@ -233,27 +319,6 @@ export default {
//", //",
methods: { methods: {
lookboundGroup(row){
selectAllGroup().then(res=>{
this.groupList = res.data;
})
this.drawer=true;
getGroupListResp(row).then(res=>{
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]);
});
}
})
},
dobound(){ dobound(){
boundGroupAndCar(this.GroupAndCarBound).then(res=>{ boundGroupAndCar(this.GroupAndCarBound).then(res=>{
@ -348,7 +413,11 @@ export default {
}, },
// //
handleEdit(row){ handleEdit(row){
this.$router.push({path:'/carInformation/edit',query:{id:row.id}}) this.dialogVisibleUpd = true
//
findInformationByid(row.id).then(res=>{
this.updateForm = res.data;
})
}, },
/** 删除 */ /** 删除 */
handleDelete(row){ handleDelete(row){
@ -368,6 +437,9 @@ export default {
}, },
// //
handleAdd(){ handleAdd(){
this.dialogVisibleAdd = true
},
doAdd(){
insertInformation(this.insertForm).then(res=>{ insertInformation(this.insertForm).then(res=>{
alert(res.msg) alert(res.msg)
if(res.code == 200){ if(res.code == 200){
@ -376,8 +448,21 @@ export default {
} }
}) })
} },
doUpd(){
updateInformationById(this.updateForm).then(res=>{
alert(res.msg)
if(res.code == 200){
alert("修改成功")
this.getList();
}
})
},
}, },
// - 访this", // - 访this",
created() { created() {
this.getList(); this.getList();