feat():优化业务功能 10.9

master
zhang chengzhi 2024-10-09 16:38:47 +08:00
parent b73cb23886
commit f347e98eec
3 changed files with 318 additions and 302 deletions

View File

@ -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'
})
}

View File

@ -128,7 +128,7 @@
</el-table-column>
</el-table>
<!-- 添加或修改部门对话框 -->
<!-- 添加或修改电子围栏对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="600px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>

View File

@ -34,94 +34,6 @@
<div style="height: 40px;width: 700px">
<el-button type="danger" plain @click="handleAdd"></el-button>
</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>
<el-table
@ -144,8 +56,10 @@
prop="typeName">
</el-table-column>
<el-table-column
label="电子围栏外键"
prop="groupId">
label="是否绑定围栏">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_car_group" :value="scope.row.groupId"/>
</template>
</el-table-column>
<el-table-column
label="车辆电机厂商"
@ -182,15 +96,16 @@
<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="configurationStrategy(scope.row)"></el-button>
<el-button type="text" class="el-icon-connection" @click="boundFenceGroup(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="success" class="el-icon-link" @click="lookboundGroup(scope.row)" v-show="scope.row.groupId==1"></el-button>
</template>
</el-table-column>
</el-table>
</template>
<el-dialog
title="请为你的汽车配置预警策略"
:visible.sync="dialogVisible"
width="30%">
<el-dialog
title="请为你的汽车配置预警策略"
:visible.sync="dialogVisible"
width="30%">
<span>
<el-select v-model="strategyId" placeholder="请选择策略">
<el-option
@ -202,11 +117,11 @@
</el-select>
</span>
<span slot="footer" class="dialog-footer">
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="updCarStrategyId"> </el-button>
</span>
</el-dialog>
</el-dialog>
<el-drawer
title="绑定围栏组"
@ -247,7 +162,85 @@
</el-drawer>
<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="车辆电机厂商">
<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.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>
</div>
@ -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",
};
</script>
<style scoped>