| | |
| | | @selection-change="handleSelectionChange" |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination" |
| | | :total="total" |
| | | ></PIMTable> |
| | | </div> |
| | | <el-dialog |
| | |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | total: 0, |
| | | }); |
| | | const total = ref(0); |
| | | |
| | |
| | | listCustomer({ ...searchForm.value, ...page }).then((res) => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.records; |
| | | total.value = res.total; |
| | | page.total = res.total; |
| | | }); |
| | | }; |
| | | // 表格选择数据 |
| | |
| | | @selection-change="handleSelectionChange" |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination" |
| | | :total="total" |
| | | ></PIMTable> |
| | | </div> |
| | | <el-dialog v-model="productDia" title="产品" width="400px"> |
| | |
| | | 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: { |
| | |
| | | }).then((res) => { |
| | | console.log("res", res); |
| | | tableData.value = res.records; |
| | | total.value = res.total; |
| | | page.total = res.total; |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | |
| | | :isSelection="true" |
| | | @selection-change="handleSelectionChange" |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination" |
| | | :total="total" |
| | | ></PIMTable> |
| | | </div> |
| | | <el-dialog |
| | |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | total: 0, |
| | | }); |
| | | const total = ref(0); |
| | | |
| | | // 用户信息表单弹框数据 |
| | | const operationType = ref(""); |
| | |
| | | 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({ |
| | |
| | | v-model="form.taxIncludingPriceUnit" |
| | | placeholder="请输入含税单价" |
| | | type="number" |
| | | maxlength="10" |
| | | @change="mathNum" |
| | | @input="handleNumberInput" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | } |
| | | }; |
| | | |
| | | 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> |
| | |
| | | <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> |
| | |
| | | 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(); |
| | |
| | | <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="{ |
| | |
| | | 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"> |
| | |
| | | |
| | | <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"; |
| | |
| | | name: "设备台账", |
| | | }); |
| | | |
| | | // 表格多选框选中项 |
| | | const multipleList = ref([]); |
| | | const { proxy } = getCurrentInstance(); |
| | | const modalRef = ref(); |
| | | const { filters, columns, dataList, pagination, getTableData, resetFilters } = |
| | | usePaginationApi( |
| | | getLedgerPage, |
| | | const { |
| | | filters, |
| | | columns, |
| | | dataList, |
| | | pagination, |
| | | getTableData, |
| | | resetFilters, |
| | | onCurrentChange, |
| | | } = usePaginationApi( |
| | | getLedgerPage, |
| | | { |
| | | searchText: undefined, |
| | | }, |
| | | [ |
| | | { |
| | | searchText: undefined, |
| | | label: "设备名称", |
| | | align: "center", |
| | | prop: "deviceName", |
| | | }, |
| | | [ |
| | | { |
| | | label: "设备名称", |
| | | align: "center", |
| | | prop: "deviceName", |
| | | }, |
| | | { |
| | | label: "规格型号", |
| | | align: "center", |
| | | prop: "deviceModel", |
| | | }, |
| | | { |
| | | label: "供应商", |
| | | align: "center", |
| | | prop: "supplierName", |
| | | }, |
| | | { |
| | | label: "单位", |
| | | align: "center", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "数量", |
| | | align: "center", |
| | | prop: "number", |
| | | }, |
| | | { |
| | | label: "含税单价", |
| | | align: "center", |
| | | prop: "taxIncludingPriceUnit", |
| | | }, |
| | | { |
| | | label: "含税总价", |
| | | align: "center", |
| | | prop: "taxIncludingPriceTotal", |
| | | }, |
| | | { |
| | | label: "税率", |
| | | align: "center", |
| | | prop: "taxRate", |
| | | }, |
| | | { |
| | | label: "不含税总价", |
| | | align: "center", |
| | | prop: "unTaxIncludingPriceTotal", |
| | | }, |
| | | { |
| | | label: "录入人", |
| | | align: "center", |
| | | prop: "createUser", |
| | | }, |
| | | { |
| | | label: "录入日期", |
| | | align: "center", |
| | | prop: "createTime", |
| | | }, |
| | | { |
| | | fixed: "right", |
| | | label: "操作", |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "200px", |
| | | }, |
| | | ] |
| | | ); |
| | | { |
| | | label: "规格型号", |
| | | align: "center", |
| | | prop: "deviceModel", |
| | | }, |
| | | { |
| | | label: "供应商", |
| | | align: "center", |
| | | prop: "supplierName", |
| | | }, |
| | | { |
| | | label: "单位", |
| | | align: "center", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "数量", |
| | | align: "center", |
| | | prop: "number", |
| | | }, |
| | | { |
| | | label: "含税单价", |
| | | align: "center", |
| | | prop: "taxIncludingPriceUnit", |
| | | }, |
| | | { |
| | | label: "含税总价", |
| | | align: "center", |
| | | prop: "taxIncludingPriceTotal", |
| | | }, |
| | | { |
| | | label: "税率", |
| | | align: "center", |
| | | prop: "taxRate", |
| | | }, |
| | | { |
| | | label: "不含税总价", |
| | | align: "center", |
| | | prop: "unTaxIncludingPriceTotal", |
| | | }, |
| | | { |
| | | label: "录入人", |
| | | align: "center", |
| | | prop: "createUser", |
| | | }, |
| | | { |
| | | label: "录入日期", |
| | | align: "center", |
| | | prop: "createTime", |
| | | }, |
| | | { |
| | | fixed: "right", |
| | | label: "操作", |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "200px", |
| | | }, |
| | | ] |
| | | ); |
| | | |
| | | // 多选后做什么 |
| | | 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: "确定", |
| | |
| | | form.remark = data.remark; |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | loadDeviceName(); |
| | | }); |
| | | // onMounted(() => { |
| | | // loadDeviceName(); |
| | | // }); |
| | | |
| | | defineExpose({ |
| | | loadDeviceName, |
| | |
| | | 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); |
| | | }; |
| | | |
| | |
| | | }; |
| | | |
| | | defineExpose({ |
| | | openModal, |
| | | openAdd, |
| | | openEdit, |
| | | }); |
| | | </script> |
| | |
| | | total: pagination.total, |
| | | }" |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="changePage" |
| | | > |
| | | <template #statusRef="{ row }"> |
| | | <el-tag v-if="row.status === 1" type="success">完结</el-tag> |
| | |
| | | const multipleList = ref([]); |
| | | |
| | | // 表格钩子 |
| | | const { filters, columns, dataList, pagination, getTableData, resetFilters } = |
| | | usePaginationApi( |
| | | getRepairPage, |
| | | const { |
| | | filters, |
| | | columns, |
| | | dataList, |
| | | pagination, |
| | | getTableData, |
| | | resetFilters, |
| | | onCurrentChange, |
| | | } = usePaginationApi( |
| | | getRepairPage, |
| | | { |
| | | searchText: undefined, |
| | | }, |
| | | [ |
| | | { |
| | | searchText: undefined, |
| | | label: "设备名称", |
| | | align: "center", |
| | | prop: "deviceName", |
| | | }, |
| | | [ |
| | | { |
| | | label: "设备名称", |
| | | align: "center", |
| | | prop: "deviceName", |
| | | }, |
| | | { |
| | | label: "规格型号", |
| | | align: "center", |
| | | prop: "deviceModel", |
| | | }, |
| | | { |
| | | label: "报修日期", |
| | | align: "center", |
| | | prop: "repairTime", |
| | | formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"), |
| | | }, |
| | | { |
| | | label: "报修人", |
| | | align: "center", |
| | | prop: "repairName", |
| | | }, |
| | | { |
| | | label: "故障现象", |
| | | align: "center", |
| | | prop: "remark", |
| | | }, |
| | | { |
| | | label: "维修人", |
| | | align: "center", |
| | | prop: "maintenanceName", |
| | | }, |
| | | { |
| | | label: "维修结果", |
| | | align: "center", |
| | | prop: "maintenanceResult", |
| | | }, |
| | | { |
| | | label: "维修日期", |
| | | align: "center", |
| | | prop: "maintenanceTime", |
| | | formatData: (cell) => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""), |
| | | }, |
| | | { |
| | | label: "状态", |
| | | align: "center", |
| | | prop: "status", |
| | | dataType: "slot", |
| | | slot: "statusRef", |
| | | }, |
| | | { |
| | | fixed: "right", |
| | | label: "操作", |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "200px", |
| | | }, |
| | | ] |
| | | ); |
| | | { |
| | | label: "规格型号", |
| | | align: "center", |
| | | prop: "deviceModel", |
| | | }, |
| | | { |
| | | label: "报修日期", |
| | | align: "center", |
| | | prop: "repairTime", |
| | | formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"), |
| | | }, |
| | | { |
| | | label: "报修人", |
| | | align: "center", |
| | | prop: "repairName", |
| | | }, |
| | | { |
| | | label: "故障现象", |
| | | align: "center", |
| | | prop: "remark", |
| | | }, |
| | | { |
| | | label: "维修人", |
| | | align: "center", |
| | | prop: "maintenanceName", |
| | | }, |
| | | { |
| | | label: "维修结果", |
| | | align: "center", |
| | | prop: "maintenanceResult", |
| | | }, |
| | | { |
| | | label: "维修日期", |
| | | align: "center", |
| | | prop: "maintenanceTime", |
| | | formatData: (cell) => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""), |
| | | }, |
| | | { |
| | | label: "状态", |
| | | align: "center", |
| | | prop: "status", |
| | | dataType: "slot", |
| | | slot: "statusRef", |
| | | }, |
| | | { |
| | | fixed: "right", |
| | | label: "操作", |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "200px", |
| | | }, |
| | | ] |
| | | ); |
| | | |
| | | // 多选后做什么 |
| | | const handleSelectionChange = (selectionList) => { |
| | |
| | | |
| | | // 新增报修 |
| | | const addRepair = () => { |
| | | repairModalRef.value.openModal(); |
| | | repairModalRef.value.openAdd(); |
| | | }; |
| | | |
| | | // 编辑报修 |
| | |
| | | maintainModalRef.value.open(row.id, row); |
| | | }; |
| | | |
| | | const changePage = ({ page }) => { |
| | | pagination.currentPage = page; |
| | | onCurrentChange(page); |
| | | }; |
| | | |
| | | // 单行删除 |
| | | const delRepairByIds = async (ids) => { |
| | | ElMessageBox.confirm("确认删除报修数据, 此操作不可逆?", "警告", { |
| | |
| | | import useFormData from "@/hooks/useFormData"; |
| | | import { getDeviceLedger } from "@/api/equipmentManagement/ledger"; |
| | | import { onMounted } from "vue"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | defineOptions({ |
| | | name: "计划表单", |
| | |
| | | total: pagination.total, |
| | | }" |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="changePage" |
| | | > |
| | | <template #maintenanceResultRef="{ row }"> |
| | | <el-tag v-if="row.maintenanceResult === 1" type="success"> |
| | |
| | | }; |
| | | |
| | | // 表格钩子 |
| | | const { filters, columns, dataList, pagination, getTableData, resetFilters } = |
| | | usePaginationApi(getUpkeepPage, {}, [ |
| | | { |
| | | label: "设备名称", |
| | | align: "center", |
| | | prop: "deviceName", |
| | | }, |
| | | { |
| | | label: "规格型号", |
| | | align: "center", |
| | | prop: "deviceModel", |
| | | }, |
| | | { |
| | | label: "计划保养日期", |
| | | align: "center", |
| | | prop: "maintenancePlanTime", |
| | | formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"), |
| | | }, |
| | | { |
| | | label: "录入人", |
| | | align: "center", |
| | | prop: "createUserName", |
| | | }, |
| | | { |
| | | label: "录入日期", |
| | | align: "center", |
| | | prop: "createTime", |
| | | formatData: (cell) => dayjs(cell).format("YYYY-MM-DD HH:mm:ss"), |
| | | width: 200, |
| | | }, |
| | | { |
| | | label: "实际保养人", |
| | | align: "center", |
| | | prop: "maintenanceActuallyName", |
| | | }, |
| | | { |
| | | label: "实际保养日期", |
| | | align: "center", |
| | | prop: "maintenanceActuallyTime", |
| | | formatData: (cell) => dayjs(cell).format("YYYY-MM-DD HH:mm:ss"), |
| | | }, |
| | | { |
| | | label: "保养结果", |
| | | align: "center", |
| | | prop: "maintenanceResult", |
| | | dataType: "slot", |
| | | slot: "maintenanceResultRef", |
| | | }, |
| | | { |
| | | label: "状态", |
| | | align: "center", |
| | | prop: "status", |
| | | dataType: "slot", |
| | | slot: "statusRef", |
| | | }, |
| | | { |
| | | fixed: "right", |
| | | label: "操作", |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "200px", |
| | | }, |
| | | ]); |
| | | const { |
| | | filters, |
| | | columns, |
| | | dataList, |
| | | pagination, |
| | | getTableData, |
| | | resetFilters, |
| | | onCurrentChange, |
| | | } = usePaginationApi(getUpkeepPage, {}, [ |
| | | { |
| | | label: "设备名称", |
| | | align: "center", |
| | | prop: "deviceName", |
| | | }, |
| | | { |
| | | label: "规格型号", |
| | | align: "center", |
| | | prop: "deviceModel", |
| | | }, |
| | | { |
| | | label: "计划保养日期", |
| | | align: "center", |
| | | prop: "maintenancePlanTime", |
| | | formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"), |
| | | }, |
| | | { |
| | | label: "录入人", |
| | | align: "center", |
| | | prop: "createUserName", |
| | | }, |
| | | { |
| | | label: "录入日期", |
| | | align: "center", |
| | | prop: "createTime", |
| | | formatData: (cell) => dayjs(cell).format("YYYY-MM-DD HH:mm:ss"), |
| | | width: 200, |
| | | }, |
| | | { |
| | | label: "实际保养人", |
| | | align: "center", |
| | | prop: "maintenanceActuallyName", |
| | | }, |
| | | { |
| | | label: "实际保养日期", |
| | | align: "center", |
| | | prop: "maintenanceActuallyTime", |
| | | formatData: (cell) => |
| | | cell ? dayjs(cell).format("YYYY-MM-DD HH:mm:ss") : "-", |
| | | }, |
| | | { |
| | | label: "保养结果", |
| | | align: "center", |
| | | prop: "maintenanceResult", |
| | | dataType: "slot", |
| | | slot: "maintenanceResultRef", |
| | | }, |
| | | { |
| | | label: "状态", |
| | | align: "center", |
| | | prop: "status", |
| | | dataType: "slot", |
| | | slot: "statusRef", |
| | | }, |
| | | { |
| | | fixed: "right", |
| | | label: "操作", |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "200px", |
| | | }, |
| | | ]); |
| | | |
| | | // 新增保养 |
| | | const addMaintain = () => { |
| | |
| | | planModalRef.value.openEdit(id); |
| | | }; |
| | | |
| | | const changePage = ({ page }) => { |
| | | pagination.currentPage = page; |
| | | onCurrentChange(page); |
| | | }; |
| | | |
| | | // 单行删除 |
| | | const delRepairByIds = async (ids) => { |
| | | ElMessageBox.confirm("确认删除报修数据, 此操作不可逆?", "警告", { |