| | |
| | | {{ formatters(scope.row[item.prop], item.formatData) }} |
| | | </el-tag> |
| | | </div> |
| | | <!-- 时间类型 --> |
| | | <div v-else-if="item.dataType === 'date'"> |
| | | {{ scope.row[item.prop] ? dayjs(scope.row[item.prop]).format('YYYY-MM-DD') : '' }} |
| | | </div> |
| | | <!-- 按钮 --> |
| | | <div v-else-if="item.dataType == 'action'" |
| | | @click.stop> |
| | |
| | | import pagination from "./Pagination.vue"; |
| | | import { computed, ref, inject, getCurrentInstance } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | // 获取全局的 uploadHeader |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | { |
| | | label: "创建时间", |
| | | prop: "createTime", |
| | | dataType:"date" |
| | | }, |
| | | { |
| | | label: "操作", |
| | |
| | | const formCreateTimeDate = computed({ |
| | | get: () => (formData.createTime ? String(formData.createTime).split(" ")[0] : ""), |
| | | set: (value) => { |
| | | formData.createTime = value ? `${value} ${dayjs().format("HH:mm:ss")}` : ""; |
| | | formData.createTime = value ? dayjs(value).format("YYYY-MM-DD") : ""; |
| | | }, |
| | | }); |
| | | // const productTypes = ref([]); |
| | |
| | | label: "创建时间", |
| | | prop: "createTime", |
| | | width: 180, |
| | | dataType:"date" |
| | | }, |
| | | { |
| | | dataType: "action", |
| | |
| | | }, |
| | | { label: "版本", prop: "version", width: 120 }, |
| | | { label: "发布人", prop: "createUserName", width: 120 }, |
| | | { label: "发布时间", prop: "createTime", width: 180 }, |
| | | { label: "发布时间", prop: "createTime", width: 180,dataType: "date" }, |
| | | { |
| | | label: "状态", |
| | | prop: "status", |
| | |
| | | formatData: (v) => getSealTypeText(v), |
| | | formatType: () => 'info' |
| | | }, |
| | | { label: '申请时间', prop: 'createTime', width: 180 }, |
| | | { label: '申请时间', prop: 'createTime', width: 180,dataType: "date" }, |
| | | { |
| | | label: '状态', |
| | | prop: 'status', |
| | |
| | | <el-select v-model="usageQuery.sourceType" placeholder="请选择" clearable style="width: 200px"> |
| | | <el-option label="维修" :value="0" /> |
| | | <el-option label="保养" :value="1" /> |
| | | <el-option label="直接出库" :value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | <el-button @click="resetUsageQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div> |
| | | <el-button type="primary" @click="openRequisitionDialog">直接出库</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <PIMTable |
| | |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | |
| | | <!-- 直接出库弹窗 --> |
| | | <el-dialog title="直接出库" v-model="requisitionDialogVisible" width="500px"> |
| | | <el-form :model="requisitionForm" :rules="requisitionRules" ref="requisitionFormRef" label-width="100px"> |
| | | <el-form-item label="设备选择" prop="deviceLedgerId"> |
| | | <el-select |
| | | v-model="requisitionForm.deviceLedgerId" |
| | | placeholder="请选择设备" |
| | | filterable |
| | | clearable |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in requisitionDeviceOptions" |
| | | :key="item.id" |
| | | :label="item.deviceName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备件选择" prop="sparePartsId"> |
| | | <el-select |
| | | v-model="requisitionForm.sparePartsId" |
| | | placeholder="请选择备件" |
| | | filterable |
| | | clearable |
| | | style="width: 100%" |
| | | @change="onRequisitionSparePartChange" |
| | | > |
| | | <el-option |
| | | v-for="item in requisitionSparePartsOptions" |
| | | :key="item.id" |
| | | :label="`${item.name}(库存: ${item.quantity})`" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="领用数量" prop="quantity"> |
| | | <el-input-number |
| | | v-model="requisitionForm.quantity" |
| | | :min="1" |
| | | :max="selectedSparePartMaxQty" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="requisitionForm.remark" placeholder="请输入备注" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button type="primary" @click="submitRequisition" :loading="requisitionLoading">确定</el-button> |
| | | <el-button @click="requisitionDialogVisible = false">取消</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { getSparePartsList, addSparePart, editSparePart, delSparePart } from "@/api/equipmentManagement/spareParts"; |
| | | import { getDeviceLedger } from "@/api/equipmentManagement/ledger"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import { getSparePartsUsagePage, outboundSpareParts } from "@/api/equipmentManagement/sparePartsUsage"; |
| | | import { getSparePartsUsagePage } from "@/api/equipmentManagement/sparePartsUsage"; |
| | | |
| | | // 加载状态 |
| | | const loading = ref(false); |
| | |
| | | { label: "备件名称", prop: "sparePartsName" }, |
| | | { label: "领用数量", prop: "quantity" }, |
| | | { label: "操作人", prop: "operator" }, |
| | | { label: "时间", prop: "createTime" }, |
| | | { label: "时间", prop: "createTime",dataType: "date"}, |
| | | ]); |
| | | |
| | | const handleTabChange = async (name) => { |
| | |
| | | const resetQuery = () => { |
| | | queryParams.name = ''; |
| | | pagination.current = 1; |
| | | pagination.size = 10; |
| | | fetchListData(); |
| | | } |
| | | |
| | | // 分页变化 |
| | | // 分页大小改变 |
| | | const handleSizeChange = ({ page, limit }) => { |
| | | pagination.current = page; |
| | | pagination.size = limit; |
| | | fetchListData(); |
| | | } |
| | | |
| | | // 当前页改变 |
| | | const handleCurrentChange = (current) => { |
| | | pagination.current = current; |
| | | fetchListData(); |
| | | } |
| | | |
| | |
| | | ElMessage.error('请填写完整表单信息'); |
| | | } finally { |
| | | formLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | | // 直接出库 |
| | | const requisitionDialogVisible = ref(false); |
| | | const requisitionLoading = ref(false); |
| | | const requisitionFormRef = ref(null); |
| | | const requisitionDeviceOptions = ref([]); |
| | | const requisitionSparePartsOptions = ref([]); |
| | | const selectedSparePartMaxQty = ref(1); |
| | | const requisitionForm = reactive({ |
| | | deviceLedgerId: null, |
| | | sparePartsId: null, |
| | | quantity: 1, |
| | | remark: '', |
| | | }); |
| | | const requisitionRules = { |
| | | sparePartsId: [{ required: true, message: '请选择备件', trigger: 'change' }], |
| | | quantity: [{ required: true, message: '请输入领用数量', trigger: 'blur' }], |
| | | }; |
| | | |
| | | const loadRequisitionOptions = async () => { |
| | | try { |
| | | const [deviceRes, spareRes] = await Promise.all([ |
| | | getDeviceLedger(), |
| | | getSparePartsList({ current: 1, size: 9999 }), |
| | | ]); |
| | | requisitionDeviceOptions.value = deviceRes.data || []; |
| | | requisitionSparePartsOptions.value = spareRes.data?.records || []; |
| | | } catch (e) { |
| | | ElMessage.error('加载选项失败'); |
| | | } |
| | | }; |
| | | |
| | | const openRequisitionDialog = async () => { |
| | | requisitionForm.deviceLedgerId = null; |
| | | requisitionForm.sparePartsId = null; |
| | | requisitionForm.quantity = 1; |
| | | requisitionForm.remark = ''; |
| | | selectedSparePartMaxQty.value = 1; |
| | | await loadRequisitionOptions(); |
| | | requisitionDialogVisible.value = true; |
| | | }; |
| | | |
| | | const onRequisitionSparePartChange = (val) => { |
| | | const selected = requisitionSparePartsOptions.value.find(item => item.id === val); |
| | | selectedSparePartMaxQty.value = selected ? selected.quantity : 1; |
| | | if (requisitionForm.quantity > selectedSparePartMaxQty.value) { |
| | | requisitionForm.quantity = selectedSparePartMaxQty.value; |
| | | } |
| | | }; |
| | | |
| | | const submitRequisition = async () => { |
| | | if (!requisitionFormRef.value) return; |
| | | try { |
| | | await requisitionFormRef.value.validate(); |
| | | } catch { |
| | | return; |
| | | } |
| | | if (requisitionForm.quantity <= 0) { |
| | | ElMessage.warning('领用数量必须大于0'); |
| | | return; |
| | | } |
| | | const selected = requisitionSparePartsOptions.value.find(item => item.id === requisitionForm.sparePartsId); |
| | | if (selected && requisitionForm.quantity > selected.quantity) { |
| | | ElMessage.warning(`库存不足,当前库存为 ${selected.quantity}`); |
| | | return; |
| | | } |
| | | requisitionLoading.value = true; |
| | | try { |
| | | const res = await outboundSpareParts({ |
| | | deviceLedgerId: requisitionForm.deviceLedgerId || undefined, |
| | | sparePartsId: requisitionForm.sparePartsId, |
| | | quantity: requisitionForm.quantity, |
| | | remark: requisitionForm.remark || undefined, |
| | | }); |
| | | if (res.code === 200) { |
| | | ElMessage.success('领用成功'); |
| | | requisitionDialogVisible.value = false; |
| | | fetchUsageData(); |
| | | } else { |
| | | ElMessage.error(res.msg || '领用失败'); |
| | | } |
| | | } catch { |
| | | ElMessage.error('领用失败'); |
| | | } finally { |
| | | requisitionLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | |
| | | </el-button> |
| | | <el-button type="danger" |
| | | icon="Delete" |
| | | :disabled="multipleList.length <= 0" |
| | | :disabled="multipleList.length <= 0 || hasFinishedStatus" |
| | | @click="delRepairByIds(multipleList.map((item) => item.id))"> |
| | | 批量删除 |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <el-table |
| | | :data="groupedDataList" |
| | | border |
| | | v-loading="tableLoading" |
| | | <PIMTable rowKey="id" |
| | | isSelection |
| | | :column="columns" |
| | | :tableData="dataList" |
| | | :page="{ |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | | total: pagination.total, |
| | | }" |
| | | @selection-change="handleSelectionChange" |
| | | :expand-row-keys="expandedRowKeys" |
| | | :row-key="(row) => row.date" |
| | | @expand-change="onExpandChange" |
| | | > |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column type="expand"> |
| | | <template #default="props"> |
| | | <el-table :data="props.row.children" border row-key="id"> |
| | | <el-table-column label="设备名称" prop="deviceName" align="center" /> |
| | | <el-table-column label="规格型号" prop="deviceModel" align="center" /> |
| | | <el-table-column label="录入人" prop="createUserName" align="center" /> |
| | | <el-table-column label="保养项目" prop="machineryCategory" align="center"> |
| | | <template #default="{ row }"> |
| | | {{ row.machineryCategory || '--' }} |
| | | @pagination="changePage"> |
| | | <template #maintenanceResultRef="{ row }"> |
| | | <div>{{ row.maintenanceResult || '-' }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="实际保养人" prop="maintenanceActuallyName" align="center" /> |
| | | <el-table-column label="实际保养日期" align="center"> |
| | | <template #default="{ row }"> |
| | | {{ row.maintenanceActuallyTime ? dayjs(row.maintenanceActuallyTime).format('YYYY-MM-DD HH:mm:ss') : '-' }} |
| | | <template #statusRef="{ row }"> |
| | | <el-tag v-if="row.status === 2" |
| | | type="danger">失败</el-tag> |
| | | <el-tag v-if="row.status === 1" |
| | | type="success">完结</el-tag> |
| | | <el-tag v-if="row.status === 0" |
| | | type="warning">待保养</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="保养结果" align="center"> |
| | | <template #default="{ row }"> |
| | | {{ row.maintenanceResult || '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" align="center"> |
| | | <template #default="{ row }"> |
| | | <el-tag v-if="row.status === 2" type="danger">失败</el-tag> |
| | | <el-tag v-if="row.status === 1" type="success">完结</el-tag> |
| | | <el-tag v-if="row.status === 0" type="warning">待保养</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="300"> |
| | | <template #default="{ row }"> |
| | | <el-button type="primary" link :disabled="row.status === 1" @click="editPlan(row.id)">编辑</el-button> |
| | | <el-button type="success" link :disabled="row.status !== 0" @click="handleSingleComplete(row.id)">保养完成</el-button> |
| | | <el-button type="success" link :disabled="row.status === 1" @click="addMaintain(row)">保养</el-button> |
| | | <el-button type="danger" link :disabled="row.status === 1" @click="delRepairByIds(row.id)">删除</el-button> |
| | | <el-button type="primary" link @click="openFileDialog(row)">附件</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="计划保养日期" prop="date" align="center" /> |
| | | <el-table-column label="保养记录数" prop="count" align="center" /> |
| | | <el-table-column label="待保养数" align="center" width="120"> |
| | | <template #default="{ row }"> |
| | | {{ row.children.filter(c => c.status === 0).length }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="200"> |
| | | <template #default="{ row }"> |
| | | <el-button |
| | | <template #operation="{ row }"> |
| | | <!-- 这个功能跟新增保养功能一模一样,有啥意义? --> |
| | | <!-- <el-button |
| | | type="primary" |
| | | size="small" |
| | | :disabled="!row.children.some(c => c.status === 0)" |
| | | @click="handleBatchComplete(row.date)" |
| | | text |
| | | @click="addMaintain(row)" |
| | | > |
| | | 一键保养完成 |
| | | 新增保养 |
| | | </el-button> --> |
| | | <el-button type="primary" |
| | | link |
| | | :disabled="row.status === 1" |
| | | @click="editPlan(row.id)"> |
| | | 编辑 |
| | | </el-button> |
| | | <el-button type="success" |
| | | link |
| | | :disabled="row.status === 1" |
| | | @click="addMaintain(row)"> |
| | | 保养 |
| | | </el-button> |
| | | <el-button type="danger" |
| | | link |
| | | :disabled="row.status === 1" |
| | | @click="delRepairByIds(row.id)"> |
| | | 删除 |
| | | </el-button> |
| | | <el-button type="primary" |
| | | link |
| | | @click="openFileDialog(row)"> |
| | | 附件 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <Pagination |
| | | v-show="pagination.total > 0" |
| | | :total="pagination.total" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :page="pagination.currentPage" |
| | | :limit="pagination.pageSize" |
| | | @pagination="changePage" |
| | | /> |
| | | </PIMTable> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | |
| | | v-model:visible="fileDialogVisible" |
| | | :record-type="'device_maintenance'" |
| | | :record-id="currentMaintenanceTaskId" /> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | delUpkeep, |
| | | deviceMaintenanceTaskList, |
| | | deviceMaintenanceTaskDel, |
| | | batchCompleteMaintenance, |
| | | completeMaintenance, |
| | | } from "@/api/equipmentManagement/upkeep"; |
| | | import dayjs from "dayjs"; |
| | | import Pagination from "@/components/PIMTable/Pagination.vue"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const FileList = defineAsyncComponent(() => |
| | |
| | | const dataList = ref([]); |
| | | const pagination = ref({ |
| | | currentPage: 1, |
| | | pageSize: 100, |
| | | pageSize: 10, |
| | | total: 0, |
| | | }); |
| | | const multipleList = ref([]); |
| | | const tableLoading = ref(false); |
| | | const expandedRowKeys = ref([]); |
| | | |
| | | const groupByDate = (list) => { |
| | | const map = {}; |
| | | list.forEach(item => { |
| | | const date = item.dateStr || (item.maintenancePlanTime ? dayjs(item.maintenancePlanTime).format('YYYY-MM-DD') : (item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD') : '未知日期')); |
| | | if (!map[date]) map[date] = []; |
| | | map[date].push(item); |
| | | }); |
| | | return Object.entries(map).map(([date, children]) => ({ date, children, count: children.length })); |
| | | }; |
| | | |
| | | const groupedDataList = computed(() => groupByDate(dataList.value)); |
| | | |
| | | // 单条保养完成 |
| | | const handleSingleComplete = async (id) => { |
| | | try { |
| | | await ElMessageBox.confirm('确认将该保养记录标记为完成?', '提示', { type: 'warning' }); |
| | | const res = await completeMaintenance(id); |
| | | if (res.code === 200) { |
| | | ElMessage.success('保养完成'); |
| | | getTableData(); |
| | | } else { |
| | | ElMessage.error(res.msg || '操作失败'); |
| | | } |
| | | } catch { /* 取消 */ } |
| | | }; |
| | | |
| | | // 一键保养完成 |
| | | const handleBatchComplete = async (dateStr) => { |
| | | try { |
| | | await ElMessageBox.confirm(`确认将 ${dateStr} 的所有待保养记录标记为完成?`, '提示', { type: 'warning' }); |
| | | const res = await batchCompleteMaintenance(dateStr); |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.msg || '批量保养完成成功'); |
| | | getTableData(); |
| | | } else { |
| | | ElMessage.error(res.msg || '批量保养完成失败'); |
| | | } |
| | | } catch { /* 取消 */ } |
| | | }; |
| | | |
| | | const onExpandChange = (row, expandedRows) => { |
| | | expandedRowKeys.value = expandedRows.map(r => r.date); |
| | | }; |
| | | |
| | | // 保养任务tab相关变量 |
| | | const scheduledFilters = reactive({ |
| | |
| | | label: "登记日期", |
| | | minWidth: 100, |
| | | formatData: cell => |
| | | cell ? dayjs(cell).format("YYYY-MM-DD HH:mm:ss") : "-", |
| | | // cell ? dayjs(cell).format("YYYY-MM-DD HH:mm:ss") : "-", |
| | | cell ? dayjs(cell).format("YYYY-MM-DD") : "-", |
| | | }, |
| | | { |
| | | fixed: "right", |
| | |
| | | |
| | | // 保养记录相关方法(原设备保养页面方法) |
| | | const getTableData = async () => { |
| | | tableLoading.value = true; |
| | | try { |
| | | const params = { |
| | | current: pagination.value.currentPage, |
| | |
| | | } |
| | | } catch (error) { |
| | | console.log(error); |
| | | } finally { |
| | | tableLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | |
| | | }; |
| | | |
| | | const handleSelectionChange = selection => { |
| | | // 从选中的分组行中收集所有子记录ID |
| | | const ids = []; |
| | | selection.forEach(group => { |
| | | if (group.children) { |
| | | group.children.forEach(child => ids.push(child.id)); |
| | | } |
| | | }); |
| | | multipleList.value = ids; |
| | | multipleList.value = selection; |
| | | }; |
| | | |
| | | // 检查选中的记录中是否有完结状态的 |
| | | const hasFinishedStatus = computed(() => { |
| | | return multipleList.value.some(item => item.status === 1); |
| | | }); |
| | | |
| | | const changePage = page => { |
| | | pagination.value.currentPage = page.page; |
| | |
| | | }; |
| | | |
| | | const delRepairByIds = async ids => { |
| | | const idList = Array.isArray(ids) ? ids : [ids]; |
| | | if (idList.length === 0) return; |
| | | // 检查是否有完结状态的记录 |
| | | const hasFinished = multipleList.value.some(item => item.status === 1); |
| | | if (hasFinished) { |
| | | ElMessage.warning("不能删除状态为完结的记录"); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | await ElMessageBox.confirm("确认删除保养数据, 此操作不可逆?", "警告", { |
| | |
| | | type: "warning", |
| | | }); |
| | | |
| | | const { code } = await delUpkeep(idList); |
| | | const { code } = await delUpkeep(ids); |
| | | if (code === 200) { |
| | | ElMessage.success("删除成功"); |
| | | getTableData(); |
| | |
| | | { label: "退货单号", prop: "returnNo", minWidth: "150" }, |
| | | { label: "供应商", prop: "supplierName", minWidth: "180" }, |
| | | { label: "关联入库单号", prop: "inboundBatches", minWidth: "150" }, |
| | | { label: "退货日期", prop: "preparedAt", minWidth: "170" }, |
| | | { label: "退货日期", prop: "preparedAt", minWidth: "170",dataType: "date"}, |
| | | { |
| | | label: "退款总额", |
| | | prop: "totalAmount", |
| | |
| | | { label: "退货单号", prop: "returnNo", minWidth: "150" }, |
| | | { label: "客户名称", prop: "customerName", minWidth: "180" }, |
| | | { label: "关联发货单号", prop: "shippingNo", minWidth: "150" }, |
| | | { label: "退货日期", prop: "makeTime", minWidth: "170" }, |
| | | { label: "退货日期", prop: "makeTime", minWidth: "170",dataType: "date" }, |
| | | { |
| | | label: "退款总额", |
| | | prop: "refundAmount", |
| | |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="出库日期" |
| | | prop="createTime" |
| | | show-overflow-tooltip /> |
| | | show-overflow-tooltip > |
| | | <template #default="scope"> |
| | | {{ scope.row.createTime ? scope.row.createTime.split(' ')[0] : '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="产品大类" |
| | | prop="productName" |
| | | show-overflow-tooltip /> |
| | |
| | | prop="inboundBatches" |
| | | width="200" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="入库时间" |
| | | prop="createTime" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="入库时间" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{ scope.row.createTime ? scope.row.createTime.split(' ')[0] : '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="产品大类" |
| | | prop="productName" |
| | | show-overflow-tooltip /> |
| | |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="备注" prop="remark" show-overflow-tooltip /> |
| | | <el-table-column |
| | | label="最近更新时间" |
| | | <el-table-column label="最近更新时间" |
| | | prop="updateTime" |
| | | show-overflow-tooltip |
| | | /> |
| | | show-overflow-tooltip > |
| | | <template #default="scope"> |
| | | {{ scope.row.updateTime ? scope.row.updateTime.split(' ')[0] : '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" min-width="180" align="center"> |
| | | <template #default="scope"> |
| | | <el-button |
| | |
| | | <el-table-column label="冻结数量" prop="lockedQuantity" show-overflow-tooltip /> |
| | | <el-table-column label="库存预警数量" prop="warnNum" show-overflow-tooltip /> |
| | | <el-table-column label="备注" prop="remark" show-overflow-tooltip /> |
| | | <el-table-column label="最近更新时间" prop="updateTime" show-overflow-tooltip /> |
| | | <el-table-column label="最近更新时间" |
| | | prop="updateTime" |
| | | show-overflow-tooltip > |
| | | <template #default="scope"> |
| | | {{ scope.row.updateTime ? scope.row.updateTime.split(' ')[0] : '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" min-width="90" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="showSubtractModal(scope.row)" :disabled="scope.row.unLockedQuantity === 0">领用</el-button> |
| | |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="最近更新时间" |
| | | prop="updateTime" |
| | | show-overflow-tooltip /> |
| | | show-overflow-tooltip > |
| | | <template #default="scope"> |
| | | {{ scope.row.updateTime ? scope.row.updateTime.split(' ')[0] : '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" |
| | | label="操作" |
| | | min-width="80" |
| | |
| | | <el-table-column label="库存数量" prop="qualitity" show-overflow-tooltip /> |
| | | <el-table-column label="冻结数量" prop="lockedQuantity" show-overflow-tooltip /> |
| | | <el-table-column label="备注" prop="remark" show-overflow-tooltip /> |
| | | <el-table-column label="最近更新时间" prop="updateTime" show-overflow-tooltip /> |
| | | <el-table-column label="最近更新时间" |
| | | prop="updateTime" |
| | | show-overflow-tooltip > |
| | | <template #default="scope"> |
| | | {{ scope.row.updateTime ? scope.row.updateTime.split(' ')[0] : '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" min-width="90" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="showSubtractModal(scope.row)" :disabled="scope.row.unLockedQuantity === 0">领用</el-button> |
| | |
| | | return { createdTime, updatedTime, createTime: createdTime, updateTime: updatedTime }; |
| | | } |
| | | |
| | | function normalizeTimeValue(val) { |
| | | |
| | | /** |
| | | * @param {any} val 时间值 |
| | | * @param {boolean} [onlyDate=true] true:只年月日,false:年月日时分秒 |
| | | */ |
| | | function normalizeTimeValue(val, onlyDate = true) { |
| | | if (val == null || val === "") return ""; |
| | | const fmt = onlyDate ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm:ss"; |
| | | |
| | | if (Array.isArray(val) && val.length >= 3) { |
| | | const [y, m, d, h = 0, min = 0, s = 0] = val; |
| | | return dayjs(new Date(y, m - 1, d, h, min, s)).format("YYYY-MM-DD HH:mm:ss"); |
| | | return dayjs(new Date(y, m - 1, d, h, min, s)).format(fmt); |
| | | } |
| | | if (typeof val === "number") { |
| | | const d = val > 1e12 ? dayjs(val) : dayjs.unix(val); |
| | | return d.isValid() ? d.format("YYYY-MM-DD HH:mm:ss") : ""; |
| | | return d.isValid() ? d.format(fmt) : ""; |
| | | } |
| | | const s = String(val).trim(); |
| | | if (!s) return ""; |
| | | const parsed = dayjs(s.includes("T") ? s : s.replace(/-/g, "/")); |
| | | return parsed.isValid() ? parsed.format("YYYY-MM-DD HH:mm:ss") : s; |
| | | return parsed.isValid() ? parsed.format(fmt) : s; |
| | | } |
| | | |
| | | export function formatDisplayTime(val) { |
| | | const t = normalizeTimeValue(val); |
| | | export function formatDisplayTime(val,onlyDate) { |
| | | const t = normalizeTimeValue(val,onlyDate); |
| | | return t || "—"; |
| | | } |
| | | |
| | |
| | | { label: "保险类型", prop: "insuranceTypes", width: 120 }, |
| | | { label: "使用范围", prop: "deptNames", width: 120 }, |
| | | { label: "备注", prop: "remark", minWidth: 120 }, |
| | | { label: "创建时间", prop: "createTime", width: 160 }, |
| | | { label: "创建时间", prop: "createTime", width: 160,dataType: "date" }, |
| | | { label: "创建人", prop: "createUserName", width: 100 }, |
| | | { |
| | | dataType: "action", |
| | |
| | | label: "创建时间", |
| | | prop: "createTime", |
| | | width: 120, |
| | | dataType: "date" |
| | | }, |
| | | { |
| | | dataType: "action", |
| | |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="上报时间" |
| | | prop="createTime" |
| | | show-overflow-tooltip /> |
| | | show-overflow-tooltip > |
| | | <template #default="scope"> |
| | | {{ scope.row.createTime ? scope.row.createTime.split(' ')[0] : '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="整改完成期限" |
| | | prop="rectifyTime" |
| | | width="120" |