dy
2025-04-14 9f5539e53c94e74b52e4b8fe7029cf5fd39d890d
src/views/basicData/ApsResourceGroup/index.vue
@@ -1,6 +1,9 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px">
      <el-row :gutter="20">
        <el-col
        :span="6">
      <el-form-item label="资源组" prop="resourceGroupName">
        <el-input
          v-model="queryParams.resourceGroupName"
@@ -9,6 +12,9 @@
          @keyup.enter="handleQuery"
        />
      </el-form-item>
        </el-col>
        <el-col
        :span="6">
      <el-form-item label="截止机加需求日期" style="width: 400px" label-width="150px">
        <el-date-picker
          v-model="daterangeRequestDate"
@@ -19,10 +25,16 @@
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
        </el-col>
        <el-col
          :span="12"
          style="text-align: right;">
      <el-form-item>
        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
        <el-button icon="Refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-row :gutter="10" class="mb8">
@@ -85,6 +97,16 @@
        </el-col>
      </el-row>
      <el-row style="margin-top: 20px;">
        <el-form-item label="截止机加需求日期" prop="requestDate" >
          <el-date-picker clearable
            v-model="requestDate"
            type="date"
            value-format="YYYY-MM-DD HH:mm:ss"
            placeholder="请选择机加需求日期"
            :disabled-date="disabledDate"
            >
          </el-date-picker>
        </el-form-item>
        <el-col>
          <div>
            <el-button
@@ -165,6 +187,16 @@
const exampleHeight = ref("500px");
const uploadRef = ref();
const exampleList = ref([]);
const requestDate = ref(null);
// 计算当前时间往后推 15 天的日期
const disabledDate = (time) => {
  // return time.getTime() > Date.now()
   // 计算 15 天的毫秒数
   const fifteenDaysInMillis = 15 * 24 * 60 * 60 * 1000;
    // 计算当前时间加上 15 天后的毫秒数
    const maxTime = Date.now() + fifteenDaysInMillis;
    return time.getTime() > maxTime;
}
/*** 用户导入参数 */
const upload = reactive({
  // 是否显示弹出层(用户导入)
@@ -185,63 +217,39 @@
  { type: 'checkbox', width: 60, align:"center"},
  { type: 'seq', title: '序号', width: 60 },
  {
    title: '料号',
    field: 'itemNo',
    title: '资源组名称',
    field: 'resourceGroupName',
    width: 300,
    align:"center",
  },
  {
    title: '设备数量',
    field: 'devicesQuantity',
    width: 150,
    align:"center",
  },
  {
    title: '工单号',
    field: 'workOrderNo',
    width: 150,
    title: '每日理论时间',
    field: 'theoryHours',
    width: 300,
    align:"center",
  },
  {
    title: '工序序号',
    field: 'processNumber',
    width: 100,
    title: '截止需求日剩余天数',
    field: 'restDays',
    width: 210,
    align:"center",
  },
  {
    title: '工序名称',
    field: 'processName',
    width: 150,
    title: '理论产能',
    field: 'theoryCapacity',
    width: 300,
    align:"center",
  },
  {
    title: '工序计划开始日期',
    field: 'processPlanStartDay',
    width: 200,
    align:"center",
  },
  {
    title: '工序计划结束日期',
    field: 'processPlanEndDay',
    width: 200,
    align:"center",
  },
  {
    title: '未开工数量',
    field: 'notStartWorkCount',
    width: 150,
    align:"center",
  },
  {
    title: '已完成数量',
    field: 'completedCount',
    width: 150,
    align:"center",
  },
  {
    title: '废弃数量',
    field: 'discardCount',
    width: 150,
    align:"center",
  },
  {
    title: '集成日期',
    field: 'integrationDay',
    width: 160,
    title: '截止机加需求日期',
    field: 'requestDate',
    width: 300,
    align:"center",
  }
]);
@@ -249,63 +257,39 @@
const exampleColumns = ref([
  { type: 'seq', title: '序号', width: 60 },
  {
    title: '料号',
    field: 'itemNo',
    title: '资源组名称',
    field: 'resourceGroupName',
    width: 300,
    align:"center",
  },
  {
    title: '设备数量',
    field: 'devicesQuantity',
    width: 150,
    align:"center",
  },
  {
    title: '工单号',
    field: 'workOrderNo',
    width: 150,
    title: '每日理论时间',
    field: 'theoryHours',
    width: 300,
    align:"center",
  },
  {
    title: '工序序号',
    field: 'processNumber',
    width: 100,
    title: '截止需求日剩余天数',
    field: 'restDays',
    width: 210,
    align:"center",
  },
  {
    title: '工序名称',
    field: 'processName',
    width: 150,
    title: '理论产能',
    field: 'theoryCapacity',
    width: 300,
    align:"center",
  },
  {
    title: '工序计划开始日期',
    field: 'processPlanStartDay',
    width: 200,
    align:"center",
  },
  {
    title: '工序计划结束日期',
    field: 'processPlanEndDay',
    width: 200,
    align:"center",
  },
  {
    title: '未开工数量',
    field: 'notStartWorkCount',
    width: 150,
    align:"center",
  },
  {
    title: '已完成数量',
    field: 'completedCount',
    width: 150,
    align:"center",
  },
  {
    title: '废弃数量',
    field: 'discardCount',
    width: 150,
    align:"center",
  },
  {
    title: '集成日期',
    field: 'integrationDay',
    width: 160,
    title: '截止机加需求日期',
    field: 'requestDate',
    width: 370,
    align:"center",
  }
]);
@@ -323,6 +307,7 @@
    plant: null
  },
  rules: {
  }
});
@@ -342,7 +327,7 @@
    loading.value = false;
  });
}
function handleCheckboxChange(){}
// 取消按钮
function cancel() {
  open.value = false;
@@ -485,8 +470,15 @@
}
/** 上传并解析按钮操作 */
function uploadParse() {
  if (requestDate.value === null || typeof requestDate.value === 'undefined' || requestDate.value === '') {
    ElMessage({
      message: '请选择截止机加需求日期',
      type: 'warning',
    })
    return
  }
  queryParams.value.params = {};
  queryParams.value.params["batchNumber"] = batchNumber.value;
  queryParams.value.params["requestDate"] = requestDate.value;
  confirmApsResourceGroup(queryParams.value).then(response => {
    exampleList.value = response.rows;
    loading.value = false;
@@ -494,6 +486,7 @@
    isError.value = false;
    planned.value = true;
    upload.open = false;
    requestDate.value = null;
    ElMessage({
      message: '资源池数据已成功上传和解析',
      type: 'success',
@@ -507,10 +500,12 @@
  if (uploadRef.value) {
    uploadRef.value.clearFiles();
  }
  requestDate.value = null;
  isVisible.value = false;
  isError.value = false;
  planned.value = true;
  upload.open = false;
}
getList();