1
yyb
8 小时以前 e1b1a29203de502457d8ede2508ba1fa2c55db47
src/views/productionManagement/workOrderManagement/index.vue
@@ -31,7 +31,13 @@
                       :status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''" />
        </template>
        <template #todayReportState="{ row }">
          {{ formatTodayReportState(row?.todayReportState) }}
          <el-tag :type="todayReportStateTagType(row?.todayReportState)"
                  size="small">
            {{ formatTodayReportState(row?.todayReportState) }}
          </el-tag>
        </template>
        <template #totalReportDurationMinutes="{ row }">
          {{ formatDurationHours(row?.totalReportDurationMinutes) }}
        </template>
      </PIMTable>
    </div>
@@ -197,6 +203,13 @@
      width: "80",
    },
    {
      label: "报工状态",
      prop: "todayReportState",
      dataType: "slot",
      slot: "todayReportState",
      width: "110",
    },
    {
      label: "工单编号",
      prop: "workOrderNo",
      width: "140",
@@ -241,16 +254,16 @@
      width: "140",
    },
    {
      label: "今日报工状态",
      prop: "todayReportState",
      dataType: "slot",
      slot: "todayReportState",
      width: "140",
    },
    {
      label: "计划工时(小时)",
      prop: "salaryQuota",
      width: "140",
    },
    {
      label: "系统核算时间(小时)",
      prop: "totalReportDurationMinutes",
      dataType: "slot",
      slot: "totalReportDurationMinutes",
      width: "160",
    },
    {
      label: "计划开始时间",
@@ -449,6 +462,18 @@
    if (state === 2) return "已开始";
    if (state === 3) return "已结束";
    return "-";
  };
  const formatDurationHours = val => {
    const minutes = Number(val);
    if (!Number.isFinite(minutes) || minutes < 0) return "-";
    return (minutes / 60).toFixed(2);
  };
  const todayReportStateTagType = val => {
    const state = Number(val);
    if (state === 1) return "info";
    if (state === 2) return "success";
    if (state === 3) return "warning";
    return "info";
  };
  // 查询列表
@@ -666,14 +691,13 @@
      addProductMain(params)
        .then(res => {
          proxy.$modal.msgSuccess("报工成功");
          proxy.$modal.msgSuccess(
            currentReportState.value === 1 ? "开始报工成功" : "结束报工成功"
          );
          reportDialogVisible.value = false;
          getList();
        })
        .catch(() => {
          ElMessageBox.alert("报工失败", "提示", {
            confirmButtonText: "确定",
          });
        });
    });
  };
@@ -753,6 +777,7 @@
    text-align: center;
    margin-top: 20px;
  }
</style>
<style  lang="scss">