src/views/collaborativeApproval/vehicleManagement/index.vue
@@ -43,7 +43,7 @@
        :is-selection="true"
        :border="true"
        :table-loading="tableLoading"
        :table-style="{ width: '100%', height: 'calc(100vh - 21.5em)' }"
        :table-style="{ width: '100%', height: 'calc(100vh - 18.5em)' }"
        :page="{
          current: page.current,
          size: page.size,
@@ -248,7 +248,6 @@
<script setup>
import { onMounted, ref, reactive, toRefs, getCurrentInstance } from "vue";
import PIMTable from "@/components/PIMTable/PIMTable.vue";
import pagination from "@/components/PIMTable/Pagination.vue";
import { ElMessageBox } from "element-plus";
import useUserStore from "@/store/modules/user";
import { userListNoPage } from "@/api/system/user.js";
@@ -352,6 +351,16 @@
  size: 100,
});
const usageRecordsTotal = ref(0);
const usageRecordsColumns = ref([
  { label: "车牌号", prop: "plateNumber", width: "120" },
  { label: "使用人", prop: "userName", width: "120" },
  { label: "目的地", prop: "destination", width: "150" },
  { label: "使用时间", prop: "useTime", width: "180" },
  { label: "还车时间", prop: "returnTime", width: "180" },
  { label: "使用前里程(km)", prop: "odometerBefore", width: "130" },
  { label: "还车时里程(km)", prop: "odometerAfter", width: "130" },
  { label: "本次行驶里程(km)", prop: "travelDistance", width: "140" },
]);
const currentVehicleId = ref(null);
// 用户信息表单弹框数据
@@ -395,18 +404,6 @@
  },
]);
// 使用记录表格列配置
const usageRecordsColumns = ref([
  { label: "车牌号", prop: "plateNumber", width: "120" },
  { label: "使用人", prop: "userName", width: "120" },
  { label: "目的地", prop: "destination", width: "150" },
  { label: "使用时间", prop: "useTime", width: "180" },
  { label: "还车时间", prop: "returnTime", width: "180" },
  { label: "使用前里程(km)", prop: "odometerBefore", width: "130" },
  { label: "还车时里程(km)", prop: "odometerAfter", width: "130" },
  { label: "本次行驶里程(km)", prop: "travelDistance", width: "140" },
]);
// 查询列表
const handleQuery = () => {
  page.current = 1;
@@ -448,14 +445,14 @@
    odometer: 0,
    remark: "",
  };
  let userLists = await userListNoPage();
  const userLists = await userListNoPage();
  userList.value = userLists.data || [];
  if (type !== "add") {
    currentId.value = row.id;
    getVehicleById(row.id).then((res) => {
      form.value = { ...res.data || res };
      form.value = { ...(res.data || res) };
    });
  }
  dialogFormVisible.value = true;
@@ -466,14 +463,14 @@
  proxy.$refs["formRef"].validate((valid) => {
    if (valid) {
      if (operationType.value === "add") {
        addVehicle(form.value).then((res) => {
        addVehicle(form.value).then(() => {
          proxy.$modal.msgSuccess("新增成功");
          closeDia();
          getList();
        });
      } else {
        form.value.id = currentId.value;
        updateVehicle(form.value).then((res) => {
        updateVehicle(form.value).then(() => {
          proxy.$modal.msgSuccess("修改成功");
          closeDia();
          getList();
@@ -489,7 +486,7 @@
  dialogFormVisible.value = false;
};
// 打开发货弹框
// 打开使用车辆弹框
const openUseForm = async (row) => {
  currentUseRow.value = row;
  useForm.value = {
@@ -500,10 +497,10 @@
    userId: "",
    remark: "",
  };
  let userLists = await userListNoPage();
  const userLists = await userListNoPage();
  userList.value = userLists.data || [];
  useFormVisible.value = true;
};
@@ -511,7 +508,7 @@
const submitUseForm = () => {
  proxy.$refs["useFormRef"].validate((valid) => {
    if (valid) {
      useVehicle(useForm.value).then((res) => {
      useVehicle(useForm.value).then(() => {
        proxy.$modal.msgSuccess("使用车辆成功");
        closeUseDia();
        getList();
@@ -537,10 +534,10 @@
    userId: "",
    remark: "",
  };
  let userLists = await userListNoPage();
  const userLists = await userListNoPage();
  userList.value = userLists.data || [];
  returnFormVisible.value = true;
};
@@ -548,7 +545,7 @@
const submitReturnForm = () => {
  proxy.$refs["returnFormRef"].validate((valid) => {
    if (valid) {
      returnVehicle(returnForm.value).then((res) => {
      returnVehicle(returnForm.value).then(() => {
        proxy.$modal.msgSuccess("还车成功");
        closeReturnDia();
        getList();
@@ -630,7 +627,7 @@
    type: "warning",
  })
    .then(() => {
      delVehicle(ids).then((res) => {
      delVehicle(ids).then(() => {
        proxy.$modal.msgSuccess("删除成功");
        getList();
      });