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

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

@ -2,26 +2,30 @@
export const searchFormList = [ export const searchFormList = [
{ {
label: "机构类型:", label: "车辆类型:",
key: "organizationType", key: "vehicleType",
type: "select",
options: {
clearable: true,
options: [],
},
},
{
label: "车辆状态:",
key: "vehicleStatus",
type: "select", type: "select",
options: { options: {
clearable: true, clearable: true,
options: [ options: [
{ {
key: 1, key: 1,
label: "运营中心", label: "可用",
}, },
{ {
key: 2, 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", key: "vehicleType",
label: "车辆类型", label: "车辆类型",
value: (item) => { 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 }) => { .then(({ data, code }) => {
if (code != 200) return; //Message.error(""); if (code != 200) return; //Message.error("");
this.vehicleTypeList = data; this.vehicleTypeList = data;
searchFormList.filter((item) => item.key == "vehicleType")[0].options.options = this.vehicleTypeList.map((item) => ({
key: item.dictValue,
label: item.dictLabel,
}));
}) })
.catch((err) => {}); .catch((err) => {});
}, },
@ -154,7 +158,7 @@ export default {
await confirm({ message: "是否要删除该车辆?" }); await confirm({ message: "是否要删除该车辆?" });
request({ request({
url: `/business/vehicles/${data.dcvehicless.id}`, url: `/business/vehicles/${data.id}`,
method: "DELETE", method: "DELETE",
data: {}, data: {},
}) })
@ -171,7 +175,6 @@ export default {
handleOpenDialogAddEdit(data) { handleOpenDialogAddEdit(data) {
this.addNEditDialogVisible = true; this.addNEditDialogVisible = true;
this.dialogData = data; this.dialogData = data;
console.log("Dialog", data);
}, },
handleSearch(data) { handleSearch(data) {

Loading…
Cancel
Save