Browse Source

车辆管理

wangqin
刘朋 8 months ago
parent
commit
cc8f0bb4e4
  1. 47
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/vehicles/components/AddNEditDialog.vue
  2. 22
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/vehicles/data.js
  3. 9
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/vehicles/index.vue

47
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/vehicles/components/AddNEditDialog.vue

@ -116,6 +116,7 @@ export default {
label: "车辆状态:",
key: "vehicleStatus",
type: "select",
required: true,
options: {
options: [
{
@ -160,19 +161,19 @@ export default {
handler(bool) {
if (!bool) return;
console.log("vehicleTypeList:",this.vehicleTypeList);
let abc = this.vehicleTypeList.map((item) => ({
this.formList.filter((item) => item.key == "vehicleType")[0].options.options = this.vehicleTypeList.map((item) => ({
key: item.dictValue,
label: item.dictLabel,
}))
console.log("-----1:",abc);
}));
if(this.data){
this.formData = this.data;
this.formData.vehicleType = this.data.vehicleType.toString();
}else{
this.formData = null;
}
this.formData = !this.data ? null : {
organizationId: this.data.organizationId,
vehiclePlate: this.data.vehiclePlate,
vehicleType: this.data.vehicleType,
};
this.$forceUpdate();
},
},
},
@ -180,40 +181,20 @@ export default {
async getOptions() {
// this.vehicleTypeList.map((item) => ({
// key: item.dictValue,
// label: item.dictLabel,
// }))
// console.log("-----1:",this.vehicleTypeList);
console.log("this.vehicleTypeList:",this.vehicleTypeList);
const result = await getSelectOptionsStation(1);
const result = await getSelectOptionsStation();
this.formList[0].options.options = result;
this.formList[0].default = result[0].key;
// this.formList[0].options.options.push({
// disabled: false,
// key: 0,
// label: "",
// });
// console.log(this.formList[0].options.options);
},
handleSubmit() {
this.$refs.FormConfigRef.validate().then((data) => {
this.submitting = true;
if (this.data) data.id = this.data.dcOrganizations.id;
if (this.data) data.id = this.data.id;
if (typeof data.parentId != "number") data.parentId = 0;
if (data.stakeMark[0]) {
data.stakeMark = `K${data.stakeMark[0]}+${data.stakeMark[1]}`;
} else {
data.stakeMark = "";
}
request({
url: `/business/organization`,
url: `/business/vehicles`,
method: this.data ? "PUT" : "POST",
data,
})

22
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/vehicles/data.js

@ -2,26 +2,30 @@
export const searchFormList = [
{
label: "机构类型:",
key: "organizationType",
label: "车辆类型:",
key: "vehicleType",
type: "select",
options: {
clearable: true,
options: [],
},
},
{
label: "车辆状态:",
key: "vehicleStatus",
type: "select",
options: {
clearable: true,
options: [
{
key: 1,
label: "运营中心",
label: "可用",
},
{
key: 2,
label: "驻点",
label: "使用中",
},
],
},
},
{
label: "机构名称:",
key: "organizationName",
type: "input",
},
];

9
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/vehicles/index.vue

@ -112,7 +112,7 @@ export default {
key: "vehicleType",
label: "车辆类型",
value: (item) => {
return this.vehicleTypeList.find((dicts) => dicts.dictValue == item.vehicleStatus).dictLabel;
return this.vehicleTypeList.find((dicts) => dicts.dictValue == item.vehicleType).dictLabel;
},
},
{
@ -147,6 +147,10 @@ export default {
.then(({ data, code }) => {
if (code != 200) return; //Message.error("");
this.vehicleTypeList = data;
searchFormList.filter((item) => item.key == "vehicleType")[0].options.options = this.vehicleTypeList.map((item) => ({
key: item.dictValue,
label: item.dictLabel,
}));
})
.catch((err) => {});
},
@ -154,7 +158,7 @@ export default {
await confirm({ message: "是否要删除该车辆?" });
request({
url: `/business/vehicles/${data.dcvehicless.id}`,
url: `/business/vehicles/${data.id}`,
method: "DELETE",
data: {},
})
@ -171,7 +175,6 @@ export default {
handleOpenDialogAddEdit(data) {
this.addNEditDialogVisible = true;
this.dialogData = data;
console.log("Dialog", data);
},
handleSearch(data) {

Loading…
Cancel
Save