Compare commits
No commits in common. "94f0bfcf584cb09a779fbae1d515ade59d3b9ad5" and "7c86916a53b8c457530f8466672d905b602d4483" have entirely different histories.
94f0bfcf58
...
7c86916a53
|
@ -22,14 +22,6 @@
|
||||||
<el-form-item label="订单号" prop="orderNo">
|
<el-form-item label="订单号" prop="orderNo">
|
||||||
<el-input v-model="queryParams.orderNo" placeholder="请输入订单号" clearable @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.orderNo" placeholder="请输入订单号" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="操作人" prop="createBy">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.createBy"
|
|
||||||
placeholder="请输入操作人手机"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
|
|
@ -564,10 +564,6 @@ export default {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
},
|
},
|
||||||
queryParams2: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 999,
|
|
||||||
},
|
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {
|
||||||
payChannel: 2,
|
payChannel: 2,
|
||||||
|
@ -665,7 +661,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
todetal(row){
|
todetal(row){
|
||||||
const deptId = row.deptId
|
const deptId = row.deptId
|
||||||
this.$router.push(`/system/deptDetail/index/${deptId}`);
|
this.$router.push(`/system/deptDetail/index/${deptId}`);
|
||||||
},
|
},
|
||||||
withdrawSubmit(){
|
withdrawSubmit(){
|
||||||
|
@ -814,7 +810,7 @@ export default {
|
||||||
this.areaOptions = response.rows;
|
this.areaOptions = response.rows;
|
||||||
this.form.parentId = 100;
|
this.form.parentId = 100;
|
||||||
});
|
});
|
||||||
listChannel(this.queryParams2).then(response => {
|
listChannel(this.queryParams).then(response => {
|
||||||
this.channelOptions = response.rows;
|
this.channelOptions = response.rows;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
<el-table-column label="MAC" align="center" prop="mac" v-if="columns[2].visible" />
|
<el-table-column label="MAC" align="center" prop="mac" v-if="columns[2].visible" />
|
||||||
<!-- <el-table-column label="SN" align="center" prop="sn" sortable="custom" :sort-orders="['descending', 'ascending']"
|
<!-- <el-table-column label="SN" align="center" prop="sn" sortable="custom" :sort-orders="['descending', 'ascending']"
|
||||||
v-if="columns[3].visible" /> -->
|
v-if="columns[3].visible" /> -->
|
||||||
<el-table-column label="SN" align="center" :show-overflow-tooltip="true">
|
<el-table-column label="SN" align="center" :show-overflow-tooltip="true">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<router-link :to="'/system/deviceDetail/index/' + scope.row.deviceId" class="link-type">
|
<router-link :to="'/system/deviceDetail/index/' + scope.row.deviceId" class="link-type">
|
||||||
<span>{{ scope.row.sn }}</span>
|
<span>{{ scope.row.sn }}</span>
|
||||||
|
@ -333,111 +333,145 @@
|
||||||
|
|
||||||
<!-- 设备详情对话框 -->
|
<!-- 设备详情对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px" size="small">
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px" size="small">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<!-- MAC、SN、车牌号一行 -->
|
<!-- MAC、SN、车牌号一行 -->
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="MAC" prop="mac" required>
|
<el-form-item label="MAC" prop="mac" required>
|
||||||
<el-input v-model="form.mac" placeholder="请输入设备MAC" :disabled="title == '修改设备'" />
|
<el-input v-model="form.mac" placeholder="请输入设备MAC" :disabled="title == '修改设备'" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="SN" prop="sn" required>
|
<el-form-item label="SN" prop="sn" required>
|
||||||
<el-input v-model="form.sn" placeholder="请输入SN" :disabled="title == '修改设备' && userName != 'admin'" />
|
<el-input v-model="form.sn" placeholder="请输入SN" :disabled="title == '修改设备' && userName != 'admin'" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="车牌号" prop="vehicleNum">
|
<el-form-item label="车牌号" prop="vehicleNum">
|
||||||
<el-input v-model="form.vehicleNum" placeholder="请输入车牌号" />
|
<el-input v-model="form.vehicleNum" placeholder="请输入车牌号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<!-- 代理商、运营区、车辆型号一行 -->
|
<!-- 代理商、运营区、车辆型号一行 -->
|
||||||
<el-col :span="8" v-if="userName == 'admin'">
|
<el-col :span="8" v-if="userName == 'admin'">
|
||||||
<el-form-item label="代理商" prop="deptId">
|
<el-form-item label="代理商" prop="deptId">
|
||||||
<el-select v-model="form.deptId" clearable filterable placeholder="请选择代理商" @change="handleDeptChange"
|
<el-select
|
||||||
style="width: 100%">
|
v-model="form.deptId"
|
||||||
<el-option v-for="item in deptOptions" :key="item.deptId" :label="item.deptName" :value="item.deptId">
|
clearable
|
||||||
</el-option>
|
filterable
|
||||||
</el-select>
|
placeholder="请选择代理商"
|
||||||
</el-form-item>
|
@change="handleDeptChange"
|
||||||
</el-col>
|
style="width: 100%">
|
||||||
<el-col :span="8">
|
<el-option
|
||||||
<el-form-item label="运营区" prop="areaId">
|
v-for="item in deptOptions"
|
||||||
<el-select v-model="form.areaId" clearable filterable placeholder="请选择运营区" @change="handleAreaChange"
|
:key="item.deptId"
|
||||||
style="width: 100%">
|
:label="item.deptName"
|
||||||
<el-option v-for="item in areaOptions" :key="item.areaId" :label="item.areaName" :value="item.areaId">
|
:value="item.deptId">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="车辆型号" prop="modelId">
|
<el-form-item label="运营区" prop="areaId">
|
||||||
<el-select v-model="form.modelId" clearable placeholder="请选择车辆型号" @change="handleModelChange"
|
<el-select
|
||||||
style="width: 100%">
|
v-model="form.areaId"
|
||||||
<el-option v-for="item in modelOptions" :key="item.modelId" :label="item.model" :value="item.modelId">
|
clearable
|
||||||
</el-option>
|
filterable
|
||||||
</el-select>
|
placeholder="请选择运营区"
|
||||||
</el-form-item>
|
@change="handleAreaChange"
|
||||||
</el-col>
|
style="width: 100%">
|
||||||
</el-row>
|
<el-option
|
||||||
|
v-for="item in areaOptions"
|
||||||
|
:key="item.areaId"
|
||||||
|
:label="item.areaName"
|
||||||
|
:value="item.areaId">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="车辆型号" prop="modelId">
|
||||||
|
<el-select
|
||||||
|
v-model="form.modelId"
|
||||||
|
clearable
|
||||||
|
placeholder="请选择车辆型号"
|
||||||
|
@change="handleModelChange"
|
||||||
|
style="width: 100%">
|
||||||
|
<el-option
|
||||||
|
v-for="item in modelOptions"
|
||||||
|
:key="item.modelId"
|
||||||
|
:label="item.model"
|
||||||
|
:value="item.modelId">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<!-- 硬件版本 -->
|
<!-- 硬件版本 -->
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="硬件版本" prop="hardwareVersionId"
|
<el-form-item label="硬件版本" prop="hardwareVersionId" v-if="hardwareVersionOptions.length > 0 && userName == 'admin'">
|
||||||
v-if="hardwareVersionOptions.length > 0 && userName == 'admin'">
|
<el-select
|
||||||
<el-select v-model="form.hardwareVersionId" clearable placeholder="请选择硬件版本"
|
v-model="form.hardwareVersionId"
|
||||||
:disabled="userName != 'admin'" @change="handleHardwareVersionChange" style="width: 100%">
|
clearable
|
||||||
<el-option v-for="item in hardwareVersionOptions" :key="item.id" :label="item.version" :value="item.id">
|
placeholder="请选择硬件版本"
|
||||||
</el-option>
|
:disabled="userName != 'admin'"
|
||||||
</el-select>
|
@change="handleHardwareVersionChange"
|
||||||
</el-form-item>
|
style="width: 100%">
|
||||||
</el-col>
|
<el-option
|
||||||
</el-row>
|
v-for="item in hardwareVersionOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.version"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="20" v-if="title == '修改设备'">
|
<el-row :gutter="20" v-if="title == '修改设备'">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="剩余电量">
|
<el-form-item label="剩余电量">
|
||||||
<el-input v-model="form.remainingPower" placeholder="请输入剩余电量" disabled />
|
<el-input v-model="form.remainingPower" placeholder="请输入剩余电量" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="电压">
|
<el-form-item label="电压">
|
||||||
<el-input v-model="form.voltage" placeholder="请输入电压" disabled />
|
<el-input v-model="form.voltage" placeholder="请输入电压" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="经度">
|
<el-form-item label="经度">
|
||||||
<el-input v-model="form.longitude" placeholder="请输入经度" disabled />
|
<el-input v-model="form.longitude" placeholder="请输入经度" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="纬度">
|
<el-form-item label="纬度">
|
||||||
<el-input v-model="form.latitude" placeholder="请输入纬度" disabled />
|
<el-input v-model="form.latitude" placeholder="请输入纬度" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!-- 硬件版本说明 -->
|
<!-- 硬件版本说明 -->
|
||||||
<el-row v-if="userName == 'admin'">
|
<el-row v-if="userName == 'admin'">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="硬件版本说明" label-width="120px">
|
<el-form-item label="硬件版本说明" label-width="120px">
|
||||||
<div class="version-desc">
|
<div class="version-desc">
|
||||||
{{ versionDescription || '暂无说明' }}
|
{{ versionDescription || '暂无说明' }}
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog style="font-weight: bold" title="设备详情" :close-on-click-modal="true" :visible.sync="open2" width="1300px"
|
<el-dialog style="font-weight: bold" title="设备详情" :close-on-click-modal="true" :visible.sync="open2" width="1300px"
|
||||||
append-to-body>
|
append-to-body>
|
||||||
<el-form ref="form" :model="form" label-width="100px" size="mini">
|
<el-form ref="form" :model="form" label-width="100px" size="mini">
|
||||||
|
@ -507,7 +541,7 @@
|
||||||
@select-changed="onSelectChange" @map-geo="onMapGeo" :init-lat="form.latitude" :init-lng="form.longitude"
|
@select-changed="onSelectChange" @map-geo="onMapGeo" :init-lat="form.latitude" :init-lng="form.longitude"
|
||||||
:status="form.status" :online-status="form.onlineStatus" :device-sn="form.sn" :areaId="form.areaId"
|
:status="form.status" :online-status="form.onlineStatus" :device-sn="form.sn" :areaId="form.areaId"
|
||||||
:trip-route-str="tripRouteStr" /> -->
|
:trip-route-str="tripRouteStr" /> -->
|
||||||
<location-map :deviceSn="form.sn" :areaId="form.areaId" height="500px" />
|
<location-map :deviceSn="form.sn" :areaId="form.areaId" height="500px"/>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
|
@ -806,100 +840,100 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 当选择代理商时调用 */
|
/** 当选择代理商时调用 */
|
||||||
handleDeptChange(val) {
|
handleDeptChange(val) {
|
||||||
if (!this.isUpdating) {
|
if (!this.isUpdating) {
|
||||||
if (val) {
|
if (val) {
|
||||||
this.isUpdating = true;
|
this.isUpdating = true;
|
||||||
selectAreaListByDeptId(val).then((response) => {
|
selectAreaListByDeptId(val).then((response) => {
|
||||||
// 更新运营区选项
|
// 更新运营区选项
|
||||||
this.areaOptions = response.data.areaList || [];
|
this.areaOptions = response.data.areaList || [];
|
||||||
this.modelOptions = response.data.modelList || [];
|
this.modelOptions = response.data.modelList || [];
|
||||||
|
|
||||||
|
// 清空现有值
|
||||||
|
this.form.areaId = null;
|
||||||
|
this.form.modelId = null;
|
||||||
|
|
||||||
|
// 只有在有选项时才设置默认值
|
||||||
|
if (this.areaOptions.length > 0) {
|
||||||
|
this.form.areaId = this.areaOptions[0].areaId;
|
||||||
|
}
|
||||||
|
if (this.modelOptions.length > 0) {
|
||||||
|
this.form.modelId = this.modelOptions[0].modelId;
|
||||||
|
}
|
||||||
|
|
||||||
// 清空现有值
|
// 如果没有选项,显示提示信息
|
||||||
this.form.areaId = null;
|
if (this.areaOptions.length === 0) {
|
||||||
this.form.modelId = null;
|
this.$message.warning('该代理商暂无运营区');
|
||||||
|
}
|
||||||
|
if (this.modelOptions.length === 0) {
|
||||||
|
this.$message.warning('该代理商暂无可用车型');
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.isUpdating = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 当代理商为空时,加载所有运营区
|
||||||
|
this.isUpdating = true;
|
||||||
|
listArea(this.queryParams2).then((response) => {
|
||||||
|
this.areaOptions = response.rows || [];
|
||||||
|
this.form.areaId = null;
|
||||||
|
this.form.modelId = null;
|
||||||
|
this.modelOptions = [];
|
||||||
|
}).finally(() => {
|
||||||
|
this.isUpdating = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 只有在有选项时才设置默认值
|
/** 当选择运营区时调用 */
|
||||||
if (this.areaOptions.length > 0) {
|
handleAreaChange(val) {
|
||||||
this.form.areaId = this.areaOptions[0].areaId;
|
if (!this.isUpdating) {
|
||||||
}
|
if (val) {
|
||||||
|
this.isUpdating = true;
|
||||||
|
selectDeptByAreaId(val).then((response) => {
|
||||||
|
// 只有在代理商为空时,才设置代理商
|
||||||
|
if (!this.form.deptId && response.data.sysDept) {
|
||||||
|
this.form.deptId = response.data.sysDept.deptId;
|
||||||
|
|
||||||
|
// 获取该代理商下的车型列表
|
||||||
|
selectAreaListByDeptId(this.form.deptId).then((deptResponse) => {
|
||||||
|
this.modelOptions = deptResponse.data.modelList || [];
|
||||||
if (this.modelOptions.length > 0) {
|
if (this.modelOptions.length > 0) {
|
||||||
this.form.modelId = this.modelOptions[0].modelId;
|
this.form.modelId = this.modelOptions[0].modelId;
|
||||||
}
|
} else {
|
||||||
|
this.form.modelId = null;
|
||||||
// 如果没有选项,显示提示信息
|
|
||||||
if (this.areaOptions.length === 0) {
|
|
||||||
this.$message.warning('该代理商暂无运营区');
|
|
||||||
}
|
|
||||||
if (this.modelOptions.length === 0) {
|
|
||||||
this.$message.warning('该代理商暂无可用车型');
|
this.$message.warning('该代理商暂无可用车型');
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
|
||||||
this.isUpdating = false;
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 当代理商为空时,加载所有运营区
|
// 如果已有代理商,则使用现有的车型列表
|
||||||
this.isUpdating = true;
|
this.modelOptions = response.data.modelList || [];
|
||||||
listArea(this.queryParams2).then((response) => {
|
if (!this.form.modelId && this.modelOptions.length > 0) {
|
||||||
this.areaOptions = response.rows || [];
|
this.form.modelId = this.modelOptions[0].modelId;
|
||||||
this.form.areaId = null;
|
} else if (this.modelOptions.length === 0) {
|
||||||
this.form.modelId = null;
|
this.form.modelId = null;
|
||||||
this.modelOptions = [];
|
this.$message.warning('该运营区暂无可用车型');
|
||||||
}).finally(() => {
|
}
|
||||||
this.isUpdating = false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}).finally(() => {
|
||||||
},
|
this.isUpdating = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 清空车型,但保留代理商
|
||||||
|
this.form.modelId = null;
|
||||||
|
this.modelOptions = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/** 当选择运营区时调用 */
|
/** 当选择车型时调用 */
|
||||||
handleAreaChange(val) {
|
handleModelChange(val) {
|
||||||
if (!this.isUpdating) {
|
// 移除车型变化时对其他字段的影响
|
||||||
if (val) {
|
if (!val) {
|
||||||
this.isUpdating = true;
|
this.form.modelId = null;
|
||||||
selectDeptByAreaId(val).then((response) => {
|
}
|
||||||
// 只有在代理商为空时,才设置代理商
|
},
|
||||||
if (!this.form.deptId && response.data.sysDept) {
|
|
||||||
this.form.deptId = response.data.sysDept.deptId;
|
|
||||||
|
|
||||||
// 获取该代理商下的车型列表
|
|
||||||
selectAreaListByDeptId(this.form.deptId).then((deptResponse) => {
|
|
||||||
this.modelOptions = deptResponse.data.modelList || [];
|
|
||||||
if (this.modelOptions.length > 0) {
|
|
||||||
this.form.modelId = this.modelOptions[0].modelId;
|
|
||||||
} else {
|
|
||||||
this.form.modelId = null;
|
|
||||||
this.$message.warning('该代理商暂无可用车型');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// 如果已有代理商,则使用现有的车型列表
|
|
||||||
this.modelOptions = response.data.modelList || [];
|
|
||||||
if (!this.form.modelId && this.modelOptions.length > 0) {
|
|
||||||
this.form.modelId = this.modelOptions[0].modelId;
|
|
||||||
} else if (this.modelOptions.length === 0) {
|
|
||||||
this.form.modelId = null;
|
|
||||||
this.$message.warning('该运营区暂无可用车型');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).finally(() => {
|
|
||||||
this.isUpdating = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// 清空车型,但保留代理商
|
|
||||||
this.form.modelId = null;
|
|
||||||
this.modelOptions = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 当选择车型时调用 */
|
|
||||||
handleModelChange(val) {
|
|
||||||
// 移除车型变化时对其他字段的影响
|
|
||||||
if (!val) {
|
|
||||||
this.form.modelId = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 处理硬件版本变化
|
// 处理硬件版本变化
|
||||||
handleHardwareVersionChange(val) {
|
handleHardwareVersionChange(val) {
|
||||||
|
@ -978,8 +1012,8 @@ export default {
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 排序触发事件 */
|
/** 排序触发事件 */
|
||||||
handleSortChange(column, prop, order) {
|
handleSortChange(column, prop, order) {
|
||||||
this.queryParams.orderByColumn = column.prop;
|
this.queryParams.orderByColumn = column.prop;
|
||||||
|
@ -1125,19 +1159,19 @@ export default {
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
if (this.queryParams2.deptId) {
|
if(this.queryParams2.deptId){
|
||||||
selectAreaListByDeptId(this.queryParams2.deptId).then((deptResponse) => {
|
selectAreaListByDeptId(this.queryParams2.deptId).then((deptResponse) => {
|
||||||
this.modelOptions = deptResponse.data.modelList || [];
|
this.modelOptions = deptResponse.data.modelList || [];
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
}else{
|
||||||
listModel(this.queryParams2).then((response) => {
|
listModel(this.queryParams2).then((response) => {
|
||||||
|
|
||||||
|
|
||||||
this.modelOptions = response.rows;
|
this.modelOptions = response.rows;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -1181,7 +1215,7 @@ export default {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
listModel(this.queryParams2).then((response) => {
|
listModel(this.queryParams2).then((response) => {
|
||||||
this.modelOptions = response.rows;
|
this.modelOptions = response.rows;
|
||||||
});
|
});
|
||||||
|
@ -1190,24 +1224,24 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
reset2() {
|
reset2() {
|
||||||
this.form.areaId = null;
|
this.form.areaId = null;
|
||||||
this.form.deptId = null;
|
this.form.deptId = null;
|
||||||
this.form.modelId = null;
|
this.form.modelId = null;
|
||||||
this.areaOptions = [];
|
this.areaOptions = [];
|
||||||
this.modelOptions = [];
|
this.modelOptions = [];
|
||||||
|
|
||||||
// 重新加载代理商列表
|
// 重新加载代理商列表
|
||||||
if (this.userName === "admin") {
|
if (this.userName === "admin") {
|
||||||
listDept2({ status: "0", pageNum: 1, pageSize: 999 }).then((response) => {
|
listDept2({ status: "0", pageNum: 1, pageSize: 999 }).then((response) => {
|
||||||
this.deptOptions = response.rows;
|
this.deptOptions = response.rows;
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 重新加载运营区列表
|
|
||||||
listArea(this.queryParams2).then((response) => {
|
|
||||||
this.areaOptions = response.rows;
|
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
|
|
||||||
|
// 重新加载运营区列表
|
||||||
|
listArea(this.queryParams2).then((response) => {
|
||||||
|
this.areaOptions = response.rows;
|
||||||
|
});
|
||||||
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
|
@ -1237,7 +1271,7 @@ export default {
|
||||||
},
|
},
|
||||||
/** 详情按钮 */
|
/** 详情按钮 */
|
||||||
handleView(row) {
|
handleView(row) {
|
||||||
const deviceId = row.deviceId
|
const deviceId = row.deviceId
|
||||||
this.$router.push(`/system/deviceDetail/index/${deviceId}`)
|
this.$router.push(`/system/deviceDetail/index/${deviceId}`)
|
||||||
// this.$router.push({
|
// this.$router.push({
|
||||||
// path: '/system/deviceDetail/index',
|
// path: '/system/deviceDetail/index',
|
||||||
|
@ -1315,45 +1349,33 @@ export default {
|
||||||
// this.fetchData(response.data.deptId)
|
// this.fetchData(response.data.deptId)
|
||||||
// this.open = true;
|
// this.open = true;
|
||||||
// this.title = "修改设备1";
|
// this.title = "修改设备1";
|
||||||
// this.open = true;
|
|
||||||
// this.title = "修改设备";
|
selectAreaListByDeptId(response.data.deptId).then((res) => {
|
||||||
let deptId = '100';
|
// 方案1: 使用Vue.set确保响应式更新
|
||||||
if (response.data.deptId == null) {
|
setTimeout(() => {
|
||||||
console.log('判断1');
|
console.log('=调用了11');
|
||||||
|
|
||||||
deptId = '100'
|
this.$set(this, 'modelOptions', []);
|
||||||
} else {
|
|
||||||
console.log('判断2');
|
|
||||||
deptId = response.data.deptId;
|
|
||||||
}
|
|
||||||
console.log(deptId, 'deptIddeptIddeptIddeptId');
|
|
||||||
selectAreaListByDeptId(deptId).then((res) => {
|
|
||||||
// 方案1: 使用Vue.set确保响应式更新
|
|
||||||
setTimeout(() => {
|
|
||||||
|
|
||||||
|
|
||||||
this.$set(this, 'modelOptions', []);
|
|
||||||
this.$set(this, 'areaOptions', []);
|
this.$set(this, 'areaOptions', []);
|
||||||
this.$set(this, 'modelOptions', res.data.modelList);
|
this.$set(this, 'modelOptions', res.data.modelList);
|
||||||
this.$set(this, 'areaOptions', res.data.areaList);
|
this.$set(this, 'areaOptions', res.data.areaList);
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改设备";
|
this.title = "修改设备";
|
||||||
}, 800);
|
}, 800);
|
||||||
|
|
||||||
|
|
||||||
// 方案2: 使用nextTick确保DOM更新
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.modelOptions = res.data.modelList;
|
|
||||||
// this.areaOptions = res.data.areaList;
|
|
||||||
// },600);
|
|
||||||
|
|
||||||
// 不再需要setTimeout和$forceUpdate
|
|
||||||
}).finally(() => {
|
|
||||||
|
|
||||||
this.isUpdating = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
// 方案2: 使用nextTick确保DOM更新
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.modelOptions = res.data.modelList;
|
||||||
|
// this.areaOptions = res.data.areaList;
|
||||||
|
// },600);
|
||||||
|
|
||||||
|
// 不再需要setTimeout和$forceUpdate
|
||||||
|
}).finally(() => {
|
||||||
|
this.isUpdating = false;
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleListing(row) {
|
handleListing(row) {
|
||||||
|
@ -1481,59 +1503,20 @@ export default {
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(async (valid) => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
try {
|
if (this.form.deviceId != null) {
|
||||||
// 1. 如果选择了运营区,验证运营区与代理商的关系
|
updateDevice(this.form).then((response) => {
|
||||||
if (this.form.areaId) {
|
|
||||||
const areaResponse = await selectDeptByAreaId(this.form.areaId);
|
|
||||||
const areaDeptId = areaResponse.data.sysDept?.deptId;
|
|
||||||
|
|
||||||
if (this.form.deptId && areaDeptId && this.form.deptId !== areaDeptId) {
|
|
||||||
this.$modal.msgError("所选运营区不属于当前代理商,请重新选择!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. 如果选择了代理商,验证车型是否属于该代理商
|
|
||||||
if (this.form.deptId && this.form.modelId) {
|
|
||||||
const deptResponse = await selectAreaListByDeptId(this.form.deptId);
|
|
||||||
const validModels = deptResponse.data.modelList || [];
|
|
||||||
const isValidModel = validModels.some(model => model.modelId === this.form.modelId);
|
|
||||||
|
|
||||||
if (!isValidModel) {
|
|
||||||
this.$modal.msgError("所选车型不属于当前代理商,请重新选择!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. 如果选择了运营区和车型,验证车型是否属于该运营区
|
|
||||||
if (this.form.areaId && this.form.modelId) {
|
|
||||||
const areaResponse = await selectDeptByAreaId(this.form.areaId);
|
|
||||||
const validModels = areaResponse.data.modelList || [];
|
|
||||||
const isValidModel = validModels.some(model => model.modelId === this.form.modelId);
|
|
||||||
|
|
||||||
if (!isValidModel) {
|
|
||||||
this.$modal.msgError("所选车型不属于当前运营区,请重新选择!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 所有验证通过后,执行提交操作
|
|
||||||
if (this.form.deviceId != null) {
|
|
||||||
const response = await updateDevice(this.form);
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
} else {
|
});
|
||||||
const response = await addDevice(this.form);
|
} else {
|
||||||
|
addDevice(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
}
|
});
|
||||||
} catch (error) {
|
|
||||||
console.error("提交表单时发生错误:", error);
|
|
||||||
this.$modal.msgError("操作失败:" + (error.message || "未知错误"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1565,8 +1548,6 @@ export default {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.el-dialog {
|
.el-dialog {
|
||||||
.el-form {
|
.el-form {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user