Compare commits

..

No commits in common. "94f0bfcf584cb09a779fbae1d515ade59d3b9ad5" and "7c86916a53b8c457530f8466672d905b602d4483" have entirely different histories.

3 changed files with 279 additions and 310 deletions

View File

@ -22,14 +22,6 @@
<el-form-item label="订单号" prop="orderNo">
<el-input v-model="queryParams.orderNo" placeholder="请输入订单号" clearable @keyup.enter.native="handleQuery" />
</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-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>

View File

@ -564,10 +564,6 @@ export default {
pageNum: 1,
pageSize: 20,
},
queryParams2: {
pageNum: 1,
pageSize: 999,
},
//
form: {
payChannel: 2,
@ -814,7 +810,7 @@ export default {
this.areaOptions = response.rows;
this.form.parentId = 100;
});
listChannel(this.queryParams2).then(response => {
listChannel(this.queryParams).then(response => {
this.channelOptions = response.rows;
});
});

View File

@ -357,27 +357,53 @@
<!-- 代理商运营区车辆型号一行 -->
<el-col :span="8" v-if="userName == 'admin'">
<el-form-item label="代理商" prop="deptId">
<el-select v-model="form.deptId" clearable filterable placeholder="请选择代理商" @change="handleDeptChange"
<el-select
v-model="form.deptId"
clearable
filterable
placeholder="请选择代理商"
@change="handleDeptChange"
style="width: 100%">
<el-option v-for="item in deptOptions" :key="item.deptId" :label="item.deptName" :value="item.deptId">
<el-option
v-for="item in deptOptions"
:key="item.deptId"
:label="item.deptName"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="运营区" prop="areaId">
<el-select v-model="form.areaId" clearable filterable placeholder="请选择运营区" @change="handleAreaChange"
<el-select
v-model="form.areaId"
clearable
filterable
placeholder="请选择运营区"
@change="handleAreaChange"
style="width: 100%">
<el-option v-for="item in areaOptions" :key="item.areaId" :label="item.areaName" :value="item.areaId">
<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"
<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
v-for="item in modelOptions"
:key="item.modelId"
:label="item.model"
:value="item.modelId">
</el-option>
</el-select>
</el-form-item>
@ -387,11 +413,19 @@
<el-row :gutter="20">
<!-- 硬件版本 -->
<el-col :span="8">
<el-form-item label="硬件版本" prop="hardwareVersionId"
v-if="hardwareVersionOptions.length > 0 && userName == 'admin'">
<el-select v-model="form.hardwareVersionId" clearable placeholder="请选择硬件版本"
:disabled="userName != 'admin'" @change="handleHardwareVersionChange" style="width: 100%">
<el-option v-for="item in hardwareVersionOptions" :key="item.id" :label="item.version" :value="item.id">
<el-form-item label="硬件版本" prop="hardwareVersionId" v-if="hardwareVersionOptions.length > 0 && userName == 'admin'">
<el-select
v-model="form.hardwareVersionId"
clearable
placeholder="请选择硬件版本"
:disabled="userName != 'admin'"
@change="handleHardwareVersionChange"
style="width: 100%">
<el-option
v-for="item in hardwareVersionOptions"
:key="item.id"
:label="item.version"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
@ -437,7 +471,7 @@
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</el-dialog>
<el-dialog style="font-weight: bold" title="设备详情" :close-on-click-modal="true" :visible.sync="open2" width="1300px"
append-to-body>
<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"
:status="form.status" :online-status="form.onlineStatus" :device-sn="form.sn" :areaId="form.areaId"
: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-row>
<el-row>
@ -806,7 +840,7 @@ export default {
}
},
/** 当选择代理商时调用 */
handleDeptChange(val) {
handleDeptChange(val) {
if (!this.isUpdating) {
if (val) {
this.isUpdating = true;
@ -850,10 +884,10 @@ export default {
});
}
}
},
},
/** 当选择运营区时调用 */
handleAreaChange(val) {
/** 当选择运营区时调用 */
handleAreaChange(val) {
if (!this.isUpdating) {
if (val) {
this.isUpdating = true;
@ -891,7 +925,7 @@ export default {
this.modelOptions = [];
}
}
},
},
/** 当选择车型时调用 */
handleModelChange(val) {
@ -1125,12 +1159,12 @@ export default {
this.total = response.total;
this.loading = false;
});
if (this.queryParams2.deptId) {
if(this.queryParams2.deptId){
selectAreaListByDeptId(this.queryParams2.deptId).then((deptResponse) => {
this.modelOptions = deptResponse.data.modelList || [];
});
} else {
}else{
listModel(this.queryParams2).then((response) => {
@ -1315,22 +1349,11 @@ export default {
// this.fetchData(response.data.deptId)
// this.open = true;
// this.title = "1";
// this.open = true;
// this.title = "";
let deptId = '100';
if (response.data.deptId == null) {
console.log('判断1');
deptId = '100'
} else {
console.log('判断2');
deptId = response.data.deptId;
}
console.log(deptId, 'deptIddeptIddeptIddeptId');
selectAreaListByDeptId(deptId).then((res) => {
selectAreaListByDeptId(response.data.deptId).then((res) => {
// 1: 使Vue.set
setTimeout(() => {
console.log('=调用了11');
this.$set(this, 'modelOptions', []);
this.$set(this, 'areaOptions', []);
@ -1350,7 +1373,6 @@ export default {
// setTimeout$forceUpdate
}).finally(() => {
this.isUpdating = false;
});
@ -1481,59 +1503,20 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(async (valid) => {
this.$refs["form"].validate((valid) => {
if (valid) {
try {
// 1.
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);
updateDevice(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
const response = await addDevice(this.form);
addDevice(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}
} catch (error) {
console.error("提交表单时发生错误:", error);
this.$modal.msgError("操作失败:" + (error.message || "未知错误"));
});
}
}
});
@ -1565,8 +1548,6 @@ export default {
},
};
</script>
<style lang="scss">
.el-dialog {
.el-form {