gaoluyang
10 天以前 febd15c55dd6f81702f123b5ef5d2932c4a6760c
Merge remote-tracking branch 'origin/dev' into dev
已修改13个文件
147 ■■■■ 文件已修改
src/views/basicData/customerFile/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/product/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/supplierManage/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/ledger/Form.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/ledger/Modal.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/ledger/index.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/repair/Form/MaintainForm.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/repair/Form/RepairForm.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/repair/Modal/RepairModal.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/repair/index.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/upkeep/Form/MaintenanceForm.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/upkeep/Form/PlanForm.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/upkeep/index.vue 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/customerFile/index.vue
@@ -34,7 +34,6 @@
        @selection-change="handleSelectionChange"
        :tableLoading="tableLoading"
        @pagination="pagination"
        :total="total"
      ></PIMTable>
    </div>
    <el-dialog
@@ -312,6 +311,7 @@
const page = reactive({
  current: 1,
  size: 10,
  total: 0,
});
const total = ref(0);
@@ -383,7 +383,7 @@
  listCustomer({ ...searchForm.value, ...page }).then((res) => {
    tableLoading.value = false;
    tableData.value = res.records;
    total.value = res.total;
    page.total = res.total;
  });
};
// 表格选择数据
src/views/basicData/product/index.vue
@@ -97,7 +97,6 @@
        @selection-change="handleSelectionChange"
        :tableLoading="tableLoading"
        @pagination="pagination"
        :total="total"
      ></PIMTable>
    </div>
    <el-dialog v-model="productDia" title="产品" width="400px">
@@ -227,11 +226,11 @@
const tableData = ref([]);
const tableLoading = ref(false);
const isShowButton = ref(false);
const total = ref(0);
const selectedRows = ref([]);
const page = reactive({
  current: 1,
  size: 10,
  total: 0,
});
const data = reactive({
  form: {
@@ -388,7 +387,7 @@
  }).then((res) => {
    console.log("res", res);
    tableData.value = res.records;
    total.value = res.total;
    page.total = res.total;
    tableLoading.value = false;
  });
};
src/views/basicData/supplierManage/index.vue
@@ -35,8 +35,6 @@
        :isSelection="true"
        @selection-change="handleSelectionChange"
        :tableLoading="tableLoading"
        @pagination="pagination"
        :total="total"
      ></PIMTable>
    </div>
    <el-dialog
@@ -300,8 +298,8 @@
const page = reactive({
  current: 1,
  size: 10,
  total: 0,
});
const total = ref(0);
// 用户信息表单弹框数据
const operationType = ref("");
@@ -359,7 +357,7 @@
  listSupplier({ ...searchForm.value, ...page }).then((res) => {
    tableLoading.value = false;
    tableData.value = res.data.records;
    total.value = res.data.total;
    page.total = res.data.total;
  });
};
const upload = reactive({
src/views/equipmentManagement/ledger/Form.vue
@@ -37,7 +37,9 @@
            v-model="form.taxIncludingPriceUnit"
            placeholder="请输入含税单价"
            type="number"
            maxlength="10"
            @change="mathNum"
            @input="handleNumberInput"
          />
        </el-form-item>
      </el-col>
@@ -170,8 +172,22 @@
  }
};
const handleNumberInput = (value) => {
  // 移除所有非数字字符
  let num = value.replace(/[^\d]/g, "");
  // 限制长度为10
  if (num.length > 10) {
    num = num.slice(0, 10);
  }
  // 更新值
  form.taxIncludingPriceUnit = num;
};
defineExpose({
  form,
  loadForm,
  resetForm,
});
</script>
src/views/equipmentManagement/ledger/Modal.vue
@@ -1,5 +1,5 @@
<template>
  <el-dialog :title="modalOptions.title" v-model="visible">
  <el-dialog :title="modalOptions.title" v-model="visible" @close="close">
    <Form ref="formRef"></Form>
    <template #footer>
      <el-button @click="closeModal">{{ modalOptions.cancelText }}</el-button>
@@ -41,12 +41,17 @@
  if (code == 200) {
    emits("success");
    ElMessage({ message: "操作成功", type: "success" });
    closeModal();
    close();
  } else {
    loading.value = false;
  }
};
const close = () => {
  closeModal();
  formRef.value.resetForm();
};
const loadForm = async (id) => {
  openModal(id);
  await nextTick();
src/views/equipmentManagement/ledger/index.vue
@@ -22,10 +22,19 @@
        <div>
          <el-button type="primary" @click="add" icon="Plus"> 新增 </el-button>
          <el-button @click="handleOut" icon="download">导出</el-button>
          <el-button
            type="danger"
            icon="Delete"
            :disabled="multipleList.length <= 0"
            @click="deleteRow(multipleList.map((item) => item.id))"
          >
            批量删除
          </el-button>
        </div>
      </div>
      <PIMTable
        rowKey="id"
        isSelection
        :column="columns"
        :tableData="dataList"
        :page="{
@@ -33,6 +42,8 @@
          size: pagination.pageSize,
          total: pagination.total,
        }"
        @selection-change="handleSelectionChange"
        @pagination="changePage"
      >
        <template #operation="{ row }">
          <el-button type="primary" text @click="edit(row.id)" icon="editPen">
@@ -55,7 +66,7 @@
<script setup>
import { usePaginationApi } from "@/hooks/usePaginationApi";
import { Search } from "@element-plus/icons-vue";
// import { Search } from "@element-plus/icons-vue";
import { getLedgerPage, delLedger } from "@/api/equipmentManagement/ledger";
import { onMounted, getCurrentInstance } from "vue";
import Modal from "./Modal.vue";
@@ -65,10 +76,19 @@
  name: "设备台账",
});
// 表格多选框选中项
const multipleList = ref([]);
const { proxy } = getCurrentInstance();
const modalRef = ref();
const { filters, columns, dataList, pagination, getTableData, resetFilters } =
  usePaginationApi(
const {
  filters,
  columns,
  dataList,
  pagination,
  getTableData,
  resetFilters,
  onCurrentChange,
} = usePaginationApi(
    getLedgerPage,
    {
      searchText: undefined,
@@ -140,13 +160,21 @@
    ]
  );
// 多选后做什么
const handleSelectionChange = (selectionList) => {
  multipleList.value = selectionList;
};
const add = () => {
  modalRef.value.openModal();
};
const edit = (id) => {
  modalRef.value.loadForm(id);
};
const changePage = ({ page }) => {
  pagination.currentPage = page;
  onCurrentChange(page);
};
const deleteRow = (id) => {
  ElMessageBox.confirm("此操作将永久删除该文件, 是否继续?", "提示", {
    confirmButtonText: "确定",
src/views/equipmentManagement/repair/Form/MaintainForm.vue
@@ -40,7 +40,8 @@
  form.maintenanceName = data.maintenanceName ?? userStore.nickName;
  form.maintenanceResult = data.maintenanceResult;
  form.maintenanceTime =
    data.maintenanceTime ?? dayjs().format("YYYY-MM-DD HH:mm:ss");
    dayjs(data.maintenanceTime).format("YYYY-MM-DD HH:mm:ss") ??
    dayjs().format("YYYY-MM-DD HH:mm:ss");
};
const getForm = () => {
src/views/equipmentManagement/repair/Form/RepairForm.vue
@@ -57,12 +57,13 @@
<script setup>
import useFormData from "@/hooks/useFormData";
import { getDeviceLedger } from "@/api/equipmentManagement/ledger";
import { onMounted } from "vue";
import useUserStore from "@/store/modules/user";
defineOptions({
  name: "设备报修表单",
});
const userStore = useUserStore();
const deviceOptions = ref([]);
const loadDeviceName = async () => {
@@ -75,7 +76,7 @@
  deviceName: undefined, // 设备名称
  deviceModel: undefined, // 规格型号
  repairTime: undefined, // 报修日期
  repairName: undefined, // 报修人
  repairName: userStore.nickName, // 报修人
  remark: undefined, // 故障现象
});
@@ -97,9 +98,9 @@
  form.remark = data.remark;
};
onMounted(() => {
  loadDeviceName();
});
// onMounted(() => {
//   loadDeviceName();
// });
defineExpose({
  loadDeviceName,
src/views/equipmentManagement/repair/Modal/RepairModal.vue
@@ -51,10 +51,17 @@
  loading.value = false;
};
const openAdd = async () => {
  openModal();
  await nextTick();
  await repairFormRef.value.loadDeviceName();
};
const openEdit = async (id) => {
  const { data } = await getRepairById(id);
  openModal(id);
  await nextTick();
  await repairFormRef.value.loadDeviceName();
  await repairFormRef.value.setForm(data);
};
@@ -64,7 +71,7 @@
};
defineExpose({
  openModal,
  openAdd,
  openEdit,
});
</script>
src/views/equipmentManagement/repair/index.vue
@@ -15,14 +15,14 @@
          <el-button type="success" icon="Van" @click="addRepair">
            新增报修
          </el-button>
          <!-- <el-button
          <el-button
            type="danger"
            icon="Delete"
            :disabled="multipleList.length <= 0"
            @click="delRepairByIds(multipleList.map((item) => item.id))"
          >
            批量删除
          </el-button> -->
          </el-button>
        </div>
      </div>
      <PIMTable
@@ -36,6 +36,7 @@
          total: pagination.total,
        }"
        @selection-change="handleSelectionChange"
        @pagination="changePage"
      >
        <template #statusRef="{ row }">
          <el-tag v-if="row.status === 1" type="success">完结</el-tag>
@@ -87,8 +88,15 @@
const multipleList = ref([]);
// 表格钩子
const { filters, columns, dataList, pagination, getTableData, resetFilters } =
  usePaginationApi(
const {
  filters,
  columns,
  dataList,
  pagination,
  getTableData,
  resetFilters,
  onCurrentChange,
} = usePaginationApi(
    getRepairPage,
    {
      searchText: undefined,
@@ -161,7 +169,7 @@
// 新增报修
const addRepair = () => {
  repairModalRef.value.openModal();
  repairModalRef.value.openAdd();
};
// 编辑报修
@@ -175,6 +183,11 @@
  maintainModalRef.value.open(row.id, row);
};
const changePage = ({ page }) => {
  pagination.currentPage = page;
  onCurrentChange(page);
};
// 单行删除
const delRepairByIds = async (ids) => {
  ElMessageBox.confirm("确认删除报修数据, 此操作不可逆?", "警告", {
src/views/equipmentManagement/upkeep/Form/MaintenanceForm.vue
@@ -46,7 +46,8 @@
  form.maintenanceActuallyName =
    data.maintenanceActuallyName ?? userStore.nickName;
  form.maintenanceActuallyTime =
    data.maintenanceActuallyTime ?? dayjs().format("YYYY-MM-DD HH:mm:ss");
    dayjs(data.maintenanceActuallyTime).format("YYYY-MM-DD HH:mm:ss") ??
    dayjs().format("YYYY-MM-DD HH:mm:ss");
  form.maintenanceResult = data.maintenanceResult;
};
src/views/equipmentManagement/upkeep/Form/PlanForm.vue
@@ -39,6 +39,7 @@
import useFormData from "@/hooks/useFormData";
import { getDeviceLedger } from "@/api/equipmentManagement/ledger";
import { onMounted } from "vue";
import dayjs from "dayjs";
defineOptions({
  name: "计划表单",
src/views/equipmentManagement/upkeep/index.vue
@@ -19,6 +19,7 @@
            type="danger"
            icon="Delete"
            :disabled="multipleList.length <= 0"
            @click="delRepairByIds(multipleList.map((item) => item.id))"
          >
            批量删除
          </el-button>
@@ -35,6 +36,7 @@
          total: pagination.total,
        }"
        @selection-change="handleSelectionChange"
        @pagination="changePage"
      >
        <template #maintenanceResultRef="{ row }">
          <el-tag v-if="row.maintenanceResult === 1" type="success">
@@ -100,8 +102,15 @@
};
// 表格钩子
const { filters, columns, dataList, pagination, getTableData, resetFilters } =
  usePaginationApi(getUpkeepPage, {}, [
const {
  filters,
  columns,
  dataList,
  pagination,
  getTableData,
  resetFilters,
  onCurrentChange,
} = usePaginationApi(getUpkeepPage, {}, [
    {
      label: "设备名称",
      align: "center",
@@ -139,7 +148,8 @@
      label: "实际保养日期",
      align: "center",
      prop: "maintenanceActuallyTime",
      formatData: (cell) => dayjs(cell).format("YYYY-MM-DD HH:mm:ss"),
    formatData: (cell) =>
      cell ? dayjs(cell).format("YYYY-MM-DD HH:mm:ss") : "-",
    },
    {
      label: "保养结果",
@@ -181,6 +191,11 @@
  planModalRef.value.openEdit(id);
};
const changePage = ({ page }) => {
  pagination.currentPage = page;
  onCurrentChange(page);
};
// 单行删除
const delRepairByIds = async (ids) => {
  ElMessageBox.confirm("确认删除报修数据, 此操作不可逆?", "警告", {