dy
2025-04-14 587c89a718c83997a8323fa243cbd59c04e3dbc2
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">
@@ -32,7 +44,7 @@
          plain 
          icon="Upload" 
          @click="handleImport" 
          v-hasPermi="['partPlan:import']"
          v-hasPermi="['ApsResourceGroup:ApsResourceGroup:importData']"
          >导入</el-button>
      </el-col>
      <el-col :span="1.5">
@@ -57,7 +69,7 @@
    >
    </HxlhTable>
  <!-- 用户导入对话框 -->
  <el-dialog :title="upload.title" v-model="upload.open" width="90%" append-to-body>
  <el-dialog :title="upload.title" v-model="upload.open" width="90%" append-to-body @close="dialogCancel">
      <el-row :gutter="10">
        <el-col>
          <div style="border-bottom: 1px solid #ccc;" >
@@ -82,20 +94,6 @@
              </div>
            </template>
          </el-upload>
        </el-col>
      </el-row>
      <el-row style="margin-top: 20px;">
        <el-col>
          <div>
            <el-button
              type="success"
              plain
              icon="Check"
              :disabled="planned"
              @click="uploadParse"
              v-hasPermi="['partPlan:edit']"
            >上传并解析</el-button>
          </div>
        </el-col>
      </el-row>
      <el-row>
@@ -128,9 +126,29 @@
            <h4>共上传<span style="color: blue;">{{ total }}</span>条资源池数据</h4>
          </div>
        </el-col>
        <el-col>
          <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>
      </el-row>
      <template #footer>
        <div class="dialog-footer">
          <el-button
            type="success"
            plain
            icon="Check"
            :disabled="planned"
            @click="uploadParse"
            v-hasPermi="['partPlan:edit']"
          >确认上传</el-button>
          <el-button @click="dialogCancel">取 消</el-button>
        </div>
      </template>
@@ -165,6 +183,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 +213,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 +253,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 +303,7 @@
    plant: null
  },
  rules: {
  }
});
@@ -342,7 +323,7 @@
    loading.value = false;
  });
}
function handleCheckboxChange(){}
// 取消按钮
function cancel() {
  open.value = false;
@@ -485,8 +466,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 +482,7 @@
    isError.value = false;
    planned.value = true;
    upload.open = false;
    requestDate.value = null;
    ElMessage({
      message: '资源池数据已成功上传和解析',
      type: 'success',
@@ -507,10 +496,12 @@
  if (uploadRef.value) {
    uploadRef.value.clearFiles();
  }
  requestDate.value = null;
  isVisible.value = false;
  isError.value = false;
  planned.value = true;
  upload.open = false;
  upload.isUploading = false;
}
getList();