chengxiangling
2025-05-14 db6e95062dfb57bcd1fb1cacdbb3cb4372c576b0
src/views/mainPlan/platePlan/index.vue
@@ -1,94 +1,121 @@
<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" :label-width="locale==='zh'?'90px':'180px'" label-position="left">
      <!-- <el-row :gutter="20">
        <el-col :span="6"> -->
          <el-form-item :label="$t('page.query.daterangePlanStartDay')">
          <el-date-picker
              style="width: 240px;"
    <!-- <el-row :gutter="10" class="mb8"> -->
    <el-form
      :model="queryParams"
      ref="queryRef"
      :inline="true"
      v-show="showSearch"
      label-position="left"
    >
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item
            :label-width="locale === 'zh' ? '90px' : '140px'"
            :label="$t('plan.query.daterangePlanStartDay')"
          >
            <el-date-picker
              :style="{ width: locale === 'zh' ? '220px' : '240px' }"
              v-model="daterangePlanStartDay"
              value-format="YYYY-MM-DD"
              type="daterange"
              range-separator="-"
              :start-placeholder="$t('page.placeholder.startDate')"
              :end-placeholder="$t('page.placeholder.endDate')"
          ></el-date-picker>
        </el-form-item>
        <!-- </el-col>
        <el-col :span="6"> -->
        <el-form-item :label="$t('page.query.daterangePlanEndDay')">
          <el-date-picker
              style="width: 240px;"
              :start-placeholder="$t('plan.placeholder.startDate')"
              :end-placeholder="$t('plan.placeholder.endDate')"
            ></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item
            :label-width="locale === 'zh' ? '90px' : '140px'"
            :label="$t('plan.query.daterangePlanEndDay')"
          >
            <el-date-picker
              :style="{ width: locale === 'zh' ? '220px' : '240px' }"
              v-model="daterangePlanEndDay"
              value-format="YYYY-MM-DD"
              type="daterange"
              range-separator="-"
              :start-placeholder="$t('page.placeholder.startDate')"
              :end-placeholder="$t('page.placeholder.endDate')"
          ></el-date-picker>
        </el-form-item>
        <!-- </el-col>
        <el-col :span="6"> -->
        <el-form-item :label="$t('page.query.documentNumber')" prop="documentNumber" >
          <el-input
              style="width: 240px;"
              :start-placeholder="$t('plan.placeholder.startDate')"
              :end-placeholder="$t('plan.placeholder.endDate')"
            ></el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item
            :label-width="locale === 'zh' ? '90px' : '140px'"
            :label="$t('plan.query.documentNumber')"
            prop="documentNumber"
          >
            <el-input
              :style="{ width: locale === 'zh' ? '220px' : '240px' }"
              v-model="queryParams.documentNumber"
              :placeholder="$t('page.placeholder.documentNumber')"
              :placeholder="$t('plan.placeholder.documentNumber')"
              clearable
              @keyup.enter="handleQuery"
          />
        </el-form-item>
        <!-- </el-col>
        <el-col :span="6"> -->
        <el-form-item :label="$t('page.query.customer')" prop="customer">
          <el-input
              style="width: 240px;"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item :label-width="locale === 'zh' ? '90px' : '140px'" :label="$t('plan.query.customer')" prop="customer">
            <el-input
              :style="{ width: locale === 'zh' ? '220px' : '240px' }"
              v-model="queryParams.customer"
              :placeholder="$t('page.placeholder.customer')"
              :placeholder="$t('plan.placeholder.customer')"
              clearable
              @keyup.enter="handleQuery"
          />
        </el-form-item>
        <!-- </el-col>
        <el-col  :span="24"  style="text-align: right;"> -->
        <el-form-item>
          <el-button type="primary" icon="Search" @click="handleQuery">{{$t("page.common.query")}}</el-button>
          <el-button icon="Refresh" @click="resetQuery">{{$t("page.common.reset")}}</el-button>
        </el-form-item>
        <!-- </el-col> -->
      <!-- </el-row> -->
      </el-form>
    </el-row>
            />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24" style="text-align: right">
          <el-form-item>
            <el-button type="primary" icon="Search" @click="handleQuery">{{
              $t("common.common.query")
            }}</el-button>
            <el-button icon="Refresh" @click="resetQuery">{{
              $t("common.common.reset")
            }}</el-button>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <!-- </el-row> -->
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
            type="primary"
            plain
            icon="Plus"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['apsPlatePlan:edit']"
        >{{$t("page.btns.batchPlanStartDay")}}</el-button>
          type="primary"
          plain
          icon="Plus"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['apsPlatePlan:edit']"
          >{{ $t("plan.btns.batchPlanStartDay") }}</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
            type="success"
            plain
            icon="Edit"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['apsPlatePlan:edit']"
        >{{$t("page.btns.batchPlanEndDay")}}</el-button>
          type="success"
          plain
          icon="Edit"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['apsPlatePlan:edit']"
          >{{ $t("plan.btns.batchPlanEndDay") }}</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
            type="info"
            plain
            icon="Upload"
            @click="handleImport"
            v-hasPermi="['apsPlatePlan:import']"
        >{{$t("page.common.import")}}</el-button>
          type="info"
          plain
          icon="Upload"
          @click="handleImport"
          v-hasPermi="['apsPlatePlan:import']"
          >{{ $t("common.common.import") }}</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
@@ -97,121 +124,161 @@
          icon="Download"
          @click="handleExport"
          v-hasPermi="['apsPlatePlan:export']"
        >{{$t("page.common.export")}}</el-button>
          >{{ $t("common.common.export") }}</el-button
        >
      </el-col>
      <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
      <right-toolbar
        v-model:showSearch="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>
    <HxlhTable
        style="width: 100%"
        :columns="columns"
        :data="planList"
        :loading="loading"
        :height="height"
        @on-checkbox="handleCheckboxChange"
        :expand-config="expandConfig"
        :subGridOptions="subGridOptions"
      style="width: 100%"
      :columns="columns"
      :data="planList"
      :loading="loading"
      :height="height"
      @on-checkbox="handleCheckboxChange"
      :expand-config="expandConfig"
      :subGridOptions="subGridOptions"
    >
    </HxlhTable>
    <!-- 添加或修改钣金计划管理对话框 -->
    <el-dialog :title="upload.title" v-model="upload.open" width="90%" append-to-body @close="dialogCancel" >
    <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;" >
            <p>上传Excel文件,包含钣金计划信息。系统将解析数据并保存到本地,用于关联到钣金计划中。</p>
          <div style="border-bottom: 1px solid #ccc">
            <p>{{ $t("plan.upload.info") }}</p>
          </div>
        </el-col>
        <el-col >
        <el-col>
          <div></div>
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <el-upload ref="uploadRef"
                     :limit="1"
                     accept=".xlsx, .xls"
                     :headers="upload.headers"
                     :action="upload.url + '?updateSupport=' + upload.updateSupport"
                     :disabled="upload.isUploading"
                     :on-progress="handleFileUploadProgress"
                     :on-success="handleFileSuccess"
                     :auto-upload="true" drag>
              <el-icon class="el-icon--upload"><upload-filled /></el-icon>
              <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
              <template #tip>
                <div class="el-upload__tip">
                  <span>仅允许导入xls、xlsx格式文件。</span>
                 </div>
              </template>
          <el-upload
            ref="uploadRef"
            :limit="1"
            accept=".xlsx, .xls"
            :headers="upload.headers"
            :action="upload.url + '?updateSupport=' + upload.updateSupport"
            :disabled="upload.isUploading"
            :on-progress="handleFileUploadProgress"
            :on-success="handleFileSuccess"
            :auto-upload="true"
            drag
          >
            <el-icon class="el-icon--upload"><upload-filled /></el-icon>
            <div class="el-upload__text">
              {{ $t("plan.upload.prevText")
              }}<em>{{ $t("plan.upload.uploadText") }}</em>
            </div>
            <template #tip>
              <div class="el-upload__tip">
                <span>{{ $t("plan.upload.fileTypeImport") }}</span>
              </div>
            </template>
          </el-upload>
        </el-col>
      </el-row>
      <el-row>
        <el-col style="margin-top: 20px;">
        <el-col style="margin-top: 20px">
          <div v-show="isVisible">
            <el-alert icon="Check" :show-icon="true" title="钣金计划数据已成功解析" type="success" :closable="false"/>
            <el-alert
              icon="Check"
              :show-icon="true"
              :title="$t('plan.message.metalplanDataSuccess')"
              type="success"
              :closable="false"
            />
          </div>
          <div v-show="isError">
            <el-alert icon="Close" :show-icon="true" title="钣金计划数据已解析失败" type="error" :closable="false"/>
            <el-alert
              icon="Close"
              :show-icon="true"
              :title="$t('plan.message.metalplanDataError')"
              type="error"
              :closable="false"
            />
          </div>
        </el-col>
      </el-row>
      <el-row v-show="isVisible">
        <el-col>
          <div>
            <h2>数据预览</h2>
            <h2>{{ $t("plan.upload.dataPreview") }}</h2>
          </div>
          <HxlhTable
              style="width: 100%"
              :columns="exampleColumns"
              :data="exampleList"
              :loading="loading"
              :maxHeight="exampleHeight"
              @on-checkbox="handleCheckboxChange"
            style="width: 100%"
            :columns="exampleColumns"
            :data="exampleList"
            :loading="loading"
            :maxHeight="exampleHeight"
            @on-checkbox="handleCheckboxChange"
          >
          </HxlhTable>
        </el-col>
        <el-col>
          <div style="text-align: right;">
            <h4>共上传<span style="color: blue;">{{ total }}</span>条零件工单数据</h4>
          <div style="text-align: right">
            <h4>
              {{ $t("plan.upload.totalUpload")
              }}<span style="color: blue">{{ total }}</span
              >{{ $t("plan.upload.itemUpload") }}
            </h4>
          </div>
        </el-col>
      </el-row>
      <template #footer>
        <div class="dialog-footer">
          <el-button
            type="success"
            plain
            icon="Check"
            :disabled="planned"
            @click="uploadParse"
            v-hasPermi="['apsPlatePlan:confirm']"
            >{{ $t("plan.upload.confirmUpload") }}</el-button
          >
            <el-button
                type="success"
                plain
                icon="Check"
                :disabled="planned"
                @click="uploadParse"
                v-hasPermi="['apsPlatePlan:confirm']"
            >确认上传</el-button>
          <el-button @click="dialogCancel">取 消</el-button>
          <el-button @click="dialogCancel">{{
            $t("plan.upload.cancel")
          }}</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup name="ApsPlatePlan">
import { listPlan, examplePlan, confirmPart} from "@/api/mainPlan/apsPlatePlan.js";
import {
  listPlan,
  examplePlan,
  confirmPart,
} from "@/api/mainPlan/apsPlatePlan.js";
import { listProcessRoute } from "@/api/basicData/processRoute.js";
import HxlhTable from '@/components/HxlhTable/index.vue'
import HxlhTable from "@/components/HxlhTable/index.vue";
import { ref } from "vue";
import { getToken } from "@/utils/auth.js";
import {ElMessage} from "element-plus";
// import { ElMessage } from "element-plus";
import { useI18n } from "vue-i18n"; //要在js中使用国际化
const { proxy } = getCurrentInstance();
const { t, locale } = useI18n();
const { aps_is_suspended, aps_document_status, aps_account, aps_business_type } = proxy.useDict('aps_is_suspended', 'aps_document_status', 'aps_account', 'aps_business_type');
const {
  aps_account,
} = proxy.useDict(
  "aps_account"
);
const exampleList = ref([]);
const planList = ref([]);
const loading = ref(true);
@@ -221,14 +288,13 @@
const daterangePlanStartDay = ref([]);
const daterangePlanEndDay = ref([]);
const height = ref(document.documentElement.clientHeight - 270 + "px;")
const height = ref(document.documentElement.clientHeight - 270 + "px;");
const isVisible = ref(false);
const isError = ref(false);
const planned = ref(true);
const batchNumber = ref(null);
const exampleHeight = ref("500px");
const uploadRef = ref();
/*** 用户导入参数 */
const upload = reactive({
@@ -241,9 +307,9 @@
  // 是否更新已经存在的用户数据
  updateSupport: 0,
  // 设置上传的请求头部
  headers: { Authorization: "Bearer " + getToken() ,local: 'zhl'},
  headers: { Authorization: "Bearer " + getToken(), local: "zhl" },
  // 上传的地址
  url: import.meta.env.VITE_APP_BASE_API + "/aps/apsPlatePlan/importData"
  url: import.meta.env.VITE_APP_BASE_API + "/aps/apsPlatePlan/importData",
});
const data = reactive({
  form: {},
@@ -251,13 +317,17 @@
    pageNum: 1,
    pageSize: 10,
    customer: null,
    documentNumber: null
    documentNumber: null,
  },
  rules: {
    id: [
      { required: true, message: "主键id不能为空", trigger: "blur" }
      {
        required: true,
        message: t("plan.message.idNotBeEmpty"),
        trigger: "blur",
      },
    ],
  }
  },
});
const { queryParams } = toRefs(data);
@@ -266,463 +336,483 @@
const subGridOptions = ref({
  border: true,
  showOverflow: true,
  columns: []
})
  columns: [],
});
watch(locale, (newLocale) => {
  // 重新获取翻译文本
  // 表格配置
  exampleColumns.value = [
    { type: 'seq', title: t('page.table.seq'), width: 60 },
    {
      title: t('page.table.masterPlanner'),
      field: 'masterPlanner',
      width: 100,
    },
    {
      title: t('page.table.weekDay'),
      field: 'weekDay',
      width: 100,
      formatter: (({ cellValue, row, column }) => {
        if (cellValue) {
          const weekDay = new Date(cellValue);
          const year = weekDay.getFullYear();
          const month = String(weekDay.getMonth() + 1).padStart(2, '0');
          const day = String(weekDay.getDate()).padStart(2, '0');
          return `${month}-${day}`;
        }
        return '';
      })
    },
    {
      title: t('page.table.weekCycle'),
      field: 'weekCycle',
      width: 80,
    },
    {
      title: t('page.table.mainPartNumber'),
      field: 'mainPartNumber',
      width: 150,
    },
    {
      title: t('page.table.mainPartDrawingNumber'),
      field: 'mainPartDrawingNumber',
      width: 150,
    },
    {
      title: t('page.table.customer'),
      field: 'customer',
      width: 200,
    },
    {
      title: t('page.table.businessType'),
      field: 'businessType',
      width: 150,
    },
    {
      title: t('page.table.documentNumber'),
      field: 'documentNumber',
      width: 150,
    },
    {
      title: t('page.table.requirementType'),
      field: 'requirementType',
      width: 150,
    },
    {
      title: t('page.table.documentStatus'),
      field: 'documentStatus',
      width: 100,
    },
    {
      title: t('page.table.itemNumber'),
      field: 'itemNumber',
      width: 150,
    },
    {
      title: t('page.table.drawingNo'),
      field: 'drawingNo',
      width: 150,
    },
    {
      title: t('page.table.versionNumber'),
      field: 'versionNumber',
      width: 100,
    },
    {
      title: t('page.table.productionQuantity'),
      field: 'productionQuantity',
      width: 100,
    },
    {
      title: t('page.table.goodProductsQuantity'),
      field: 'goodProductsQuantity',
      width: 100,
    },
    {
      title: t('page.table.processNumber'),
      field: 'processNumber',
      width: 150,
    },
    {
      title: t('page.table.factoryCenter'),
      field: 'workCenter',
      width: 150,
    },
    {
      title: t('page.table.dependencyDepartment'),
      field: 'department',
      width: 100,
    },
    {
      title: t('page.table.planStartDay'),
      field: 'planStartDay',
      width: 100,
    },
    {
      title: t('page.table.planEndDayDate'),
      field: 'planEndDay',
      width: 100,
    },
    {
      title:  t('page.table.standbyNumber'),
      field: 'standbyNumber',
      width: 100,
    },
    {
      title: t('page.table.standbyName'),
      field: 'standbyName',
      width: 200,
    },
    {
      title: t('page.table.standbyStock'),
      field: 'standbyStock',
      width: 100,
    },
    {
      title: t('page.table.departmentToNextProcessBelongs'),
      field: 'nextProcessDeparment',
      width: 180,
    },
    {
      title: t('page.table.isSuspended'),
      field: 'isSuspended',
      width: 100,
    },
    {
      title: t('page.table.isOutsourcing'),
      field: 'isOutsourcing',
      width: 100,
    },
    {
      title: t('page.table.account'),
      field: 'account',
      width: 100,
    },
    // {
    //   title: '上阶物料',
    //   field: 'advancedMaterials',
    //   width: 100,
    // },
    // {
    //   title: '上阶单据号',
    //   field: 'advancedDocumentNumber',
    //   width: 100,
    // },
    // {
    //   title: '上阶需求日期',
    //   field: 'advancedRequirementDay',
    //   width: 150,
    // },
    // {
    //   title: '计划齐套',
    //   field: 'isPlanComplete',
    //   width: 100,
    // },
    // {
    //   title: '库存齐套',
    //   field: 'isStockComplete',
    //   width: 100,
    // },
    // {
    //   title: '是否有折返工序',
    //   field: 'hasTurnback',
    //   width: 150,
    // },
    // {
    //   title: '风险标识',
    //   field: 'hasRisk',
    //   width: 100,
    // },
  ];
  // 表格配置
  columns.value = [
    { field: 'expand', type: 'expand', width: 60, align: 'center', slots: { content: 'expandContent' } },
    { type: 'checkbox', width: 60, align:"center"},
    { type: 'seq', title: t('page.table.seq'), width: 60 },
    // {
    //   title: '主计划员',
    //   field: 'masterPlanner',
    //   width: 100,
    // },
    // {
    //   title: '周日',
    //   field: 'weekDay',
    //   width: 100,
    //   formatter: (({ cellValue, row, column }) => {
    //     if (cellValue) {
    //       const weekDay = new Date(cellValue);
    //       const year = weekDay.getFullYear();
    //       const month = String(weekDay.getMonth() + 1).padStart(2, '0');
    //       const day = String(weekDay.getDate()).padStart(2, '0');
    //       return `${month}-${day}`;
    //     }
    //     return '';
    //   })
    // },
    // {
    //   title: '周度',
    //   field: 'weekCycle',
    //   width: 80,
    // },
    {
      title: t('page.table.mainPartNumber'),
      field: 'mainPartNumber',
      width: 150,
    },
    // {
    //   title: '主件图号',
    //   field: 'mainPartDrawingNumber',
    //   width: 150,
    // },
    // {
    //   title: '客户名称',
    //   field: 'customer',
    //   width: 200,
    // },
    {
      title: t('page.table.businessType'),
      field: 'businessType',
      width: 100,
    },
    {
      title: t('page.table.documentNumber'),
      field: 'documentNumber',
      width: 140,
    },
    {
      title: t('page.table.requirementType'),
      field: 'requirementType',
      width: 100,
    },
    {
      title: t('page.table.documentStatus'),
      field: 'documentStatus',
      width: 100,
    },
    {
      title: t('page.table.itemNumber'),
      field: 'itemNumber',
      width: 100,
    },
    {
      title: t('page.table.drawingNo'),
      field: 'drawingNo',
      width: 100,
    },
    // {
    //   title: '版本号',
    //   field: 'versionNumber',
    //   width: 100,
    // },
    {
      title: t('page.table.productionQuantity'),
      field: 'productionQuantity',
      width: 100,
    },
    // {
    //   title: '良品数量',
    //   field: 'goodProductsQuantity',
    //   width: 100,
    // },
    {
      title: t('page.table.processNumber'),
      field: 'processNumber',
      width: 100,
    },
    {
      title: t('page.table.factoryCenter'),
      field: 'workCenter',
      width: 180,
    },
    // {
    //   title: '所属部门',
    //   field: 'department',
    //   width: 100,
    // },
    // {
    //   title: '计划开工日',
    //   field: 'planStartDay',
    //   width: 100,
    // },
    {
      title: t('page.table.planEndDayDate'),
      field: 'planEndDay',
      width: 100,
    },
    // {
    //   title: '备料料号',
    //   field: 'standbyNumber',
    //   width: 100,
    // },
    // {
    //   title: '备料名称',
    //   field: 'standbyName',
    //   width: 100,
    // },
    // {
    //   title: '备料库存',
    //   field: 'standbyStock',
    //   width: 100,
    // },
    // {
    //   title: '下道工序所属部门',
    //   field: 'nextProcessDeparment',
    //   width: 160,
    // },
    // {
    //   title: '是否挂起',
    //   field: 'isSuspended',
    //   width: 100,
    // },
    // {
    //   title: '外协标识',
    //   field: 'isOutsourcing',
    //   width: 100,
    // },
    // {
    //   title: '账套',
    //   field: 'account',
    //   width: 100,
    // },
    // {
    //   title: '上阶物料',
    //   field: 'advancedMaterials',
    //   width: 100,
    // },
    // {
    //   title: '上阶单据号',
    //   field: 'advancedDocumentNumber',
    //   width: 100,
    // },
    // {
    //   title: '上阶需求日期',
    //   field: 'advancedRequirementDay',
    //   width: 100,
    // },
    // {
    //   title: '计划齐套',
    //   field: 'isPlanComplete',
    //   width: 100,
    // },
    // {
    //   title: '库存齐套',
    //   field: 'isStockComplete',
    //   width: 100,
    // },
    // {
    //   title: '是否有折返工序',
    //   field: 'hasTurnback',
    //   width: 120,
    // },
    // {
    //   title: '风险标识',
    //   field: 'hasRisk',
    //   width: 100,
    // },
  ];
  subGridOptions.value.columns = [
    {
      title: t('page.table.itemNumber'),
      field: 'itemNo',
      width: 150,
      align:"center",
    },
    {
      title: t('page.table.workOrderNo'),
      field: 'workOrderNo',
      width: 150,
      align:"center",
    },
    {
      title: t('page.table.processNumber'),
      field: 'processNumber',
      width: 150,
      align:"center",
    },
    {
      title: t('page.table.processName'),
      field: 'processName',
      width: 150,
      align:"center",
    },
    {
      title: t('page.table.startDateOfProcessPlan'),
      field: 'processPlanStartDay',
      width: 200,
      align:"center",
    },
    {
      title: t('page.table.endDateOfProcessPlan'),
      field: 'processPlanEndDay',
      width: 200,
      align:"center",
    },
    // {
    //   title: '未开工数量',
    //   field: 'notStartWorkCount',
    //   width: 90,
    //   align:"center",
    // },
    // {
    //   title: '已完成数量',
    //   field: 'completedCount',
    //   width: 90,
    //   align:"center",
    // },
    // {
    //   title: '废弃数量',
    //   field: 'discardCount',
    //   width: 90,
    //   align:"center",
    // },
    {
      title: t('page.table.standardTime'),
      field: 'standardTime',
      width: 90,
      align:"center",
    },
    {
      title: t('page.table.processOrder'),
      field: 'processOrder',
      width: 90,
      align:"center",
    },
    {
      title: t('page.table.integrationDay'),
      field: 'integrationDay',
      width: 160,
      align:"center",
    }
  ]
  getList();
},{immediate:true, deep:true})
watch(
  locale,
  (newLocale) => {
    // 重新获取翻译文本
    // 表格配置
    exampleColumns.value = [
      { type: "seq", title: t("plan.table.seq"), width: 60 },
      {
        title: t("plan.table.masterPlanner"),
        field: "masterPlanner",
        width: 100,
      },
      {
        title: t("plan.table.weekDay"),
        field: "weekDay",
        width: 100,
        formatter: ({ cellValue, row, column }) => {
          if (cellValue) {
            const weekDay = new Date(cellValue);
            const year = weekDay.getFullYear();
            const month = String(weekDay.getMonth() + 1).padStart(2, "0");
            const day = String(weekDay.getDate()).padStart(2, "0");
            return `${month}-${day}`;
          }
          return "";
        },
      },
      {
        title: t("plan.table.weekCycle"),
        field: "weekCycle",
        width: 80,
      },
      {
        title: t("plan.table.mainPartNumber"),
        field: "mainPartNumber",
        width: 150,
      },
      {
        title: t("plan.table.mainPartDrawingNumber"),
        field: "mainPartDrawingNumber",
        width: 150,
      },
      {
        title: t("plan.table.customer"),
        field: "customer",
        width: 200,
      },
      {
        title: t("plan.table.businessType"),
        field: "businessType",
        width: 150,
      },
      {
        title: t("plan.table.documentNumber"),
        field: "documentNumber",
        width: 150,
      },
      {
        title: t("plan.table.requirementType"),
        field: "requirementType",
        width: 150,
      },
      {
        title: t("plan.table.documentStatus"),
        field: "documentStatus",
        width: 100,
      },
      {
        title: t("plan.table.itemNumber"),
        field: "itemNumber",
        width: 150,
      },
      {
        title: t("plan.table.drawingNo"),
        field: "drawingNo",
        width: 150,
      },
      {
        title: t("plan.table.versionNumber"),
        field: "versionNumber",
        width: 100,
      },
      {
        title: t("plan.table.productionQuantity"),
        field: "productionQuantity",
        width: 100,
      },
      {
        title: t("plan.table.goodProductsQuantity"),
        field: "goodProductsQuantity",
        width: 100,
      },
      {
        title: t("plan.table.processNumber"),
        field: "processNumber",
        width: 150,
      },
      {
        title: t("plan.table.factoryCenter"),
        field: "workCenter",
        width: 150,
      },
      {
        title: t("plan.table.dependencyDepartment"),
        field: "department",
        width: 100,
      },
      {
        title: t("plan.table.planStartDay"),
        field: "planStartDay",
        width: 100,
      },
      {
        title: t("plan.table.planEndDayDate"),
        field: "planEndDay",
        width: 100,
      },
      {
        title: t("plan.table.standbyNumber"),
        field: "standbyNumber",
        width: 100,
      },
      {
        title: t("plan.table.standbyName"),
        field: "standbyName",
        width: 200,
      },
      {
        title: t("plan.table.standbyStock"),
        field: "standbyStock",
        width: 100,
      },
      {
        title: t("plan.table.departmentToNextProcessBelongs"),
        field: "nextProcessDeparment",
        width: 180,
      },
      {
        title: t("plan.table.isSuspended"),
        field: "isSuspended",
        width: 100,
      },
      {
        title: t("plan.table.isOutsourcing"),
        field: "isOutsourcing",
        width: 100,
      },
      {
        title: t("plan.table.account"),
        field: "account",
        width: 100,
      },
      // {
      //   title: '上阶物料',
      //   field: 'advancedMaterials',
      //   width: 100,
      // },
      // {
      //   title: '上阶单据号',
      //   field: 'advancedDocumentNumber',
      //   width: 100,
      // },
      // {
      //   title: '上阶需求日期',
      //   field: 'advancedRequirementDay',
      //   width: 150,
      // },
      // {
      //   title: '计划齐套',
      //   field: 'isPlanComplete',
      //   width: 100,
      // },
      // {
      //   title: '库存齐套',
      //   field: 'isStockComplete',
      //   width: 100,
      // },
      // {
      //   title: '是否有折返工序',
      //   field: 'hasTurnback',
      //   width: 150,
      // },
      // {
      //   title: '风险标识',
      //   field: 'hasRisk',
      //   width: 100,
      // },
    ];
    // 表格配置
    columns.value = [
      {
        field: "expand",
        type: "expand",
        width: 60,
        align: "center",
        slots: { content: "expandContent" },
        fixed:"left",
      },
      { type: "checkbox", width: 60, align: "center" },
      { type: "seq", title: t("plan.table.seq"), width: 60 },
      // {
      //   title: '主计划员',
      //   field: 'masterPlanner',
      //   width: 100,
      // },
      // {
      //   title: '周日',
      //   field: 'weekDay',
      //   width: 100,
      //   formatter: (({ cellValue, row, column }) => {
      //     if (cellValue) {
      //       const weekDay = new Date(cellValue);
      //       const year = weekDay.getFullYear();
      //       const month = String(weekDay.getMonth() + 1).padStart(2, '0');
      //       const day = String(weekDay.getDate()).padStart(2, '0');
      //       return `${month}-${day}`;
      //     }
      //     return '';
      //   })
      // },
      // {
      //   title: '周度',
      //   field: 'weekCycle',
      //   width: 80,
      // },
      {
        title: t("plan.table.mainPartNumber"),
        field: "mainPartNumber",
        width: 160
      },
      // {
      //   title: '主件图号',
      //   field: 'mainPartDrawingNumber',
      //   width: 150,
      // },
      {
        title: t('plan.table.customer'),
        field: 'customer',
        width: 160
      },
      {
        title: t("plan.table.businessType"),
        field: "businessType",
        width: "auto",
      },
      {
        title: t("plan.table.documentNumber"),
        field: "documentNumber",
        width: "auto",
      },
      {
        title: t("plan.table.requirementType"),
        field: "requirementType",
        width: "auto",
      },
      {
        title: t("plan.table.documentStatus"),
        field: "documentStatus",
        width: "auto",
      },
      {
        title: t("plan.table.itemNumber"),
        field: "itemNumber",
        width: "auto",
      },
      {
        title: t("plan.table.drawingNo"),
        field: "drawingNo",
        width: 200,
      },
      // {
      //   title: '版本号',
      //   field: 'versionNumber',
      //   width: 100,
      // },
      {
        title: t("plan.table.productionQuantity"),
        field: "productionQuantity",
        width: "auto",
      },
      // {
      //   title: '良品数量',
      //   field: 'goodProductsQuantity',
      //   width: 100,
      // },
      {
        title: t("plan.table.processNumber"),
        field: "processNumber",
        width: "auto",
      },
      {
        title: t("plan.table.factoryCenter"),
        field: "workCenter",
        width: "auto",
      },
      // {
      //   title: '所属部门',
      //   field: 'department',
      //   width: 100,
      // },
      // {
      //   title: '计划开工日',
      //   field: 'planStartDay',
      //   width: 100,
      // },
      {
        title: t("plan.table.planEndDayDate"),
        field: "planEndDay",
        width: 160,
      },
      // {
      //   title: '备料料号',
      //   field: 'standbyNumber',
      //   width: 100,
      // },
      // {
      //   title: '备料名称',
      //   field: 'standbyName',
      //   width: 100,
      // },
      // {
      //   title: '备料库存',
      //   field: 'standbyStock',
      //   width: 100,
      // },
      // {
      //   title: '下道工序所属部门',
      //   field: 'nextProcessDeparment',
      //   width: 160,
      // },
      // {
      //   title: '是否挂起',
      //   field: 'isSuspended',
      //   width: 100,
      // },
      // {
      //   title: '外协标识',
      //   field: 'isOutsourcing',
      //   width: 100,
      // },
      {
        title: t('plan.table.account'),
        field: 'account',
        width: "auto",
        // formatter: ({ cellValue, row, column }) => {
        //   if (cellValue) {
        //     console.log(cellValue,aps_account.value,"llll")
        //     for (let i = 0; i < aps_account.value.length; i++) {
        //       if (cellValue === aps_account.value[i].value) {
        //         return aps_account.value[i].label;
        //       }
        //     }
        //   }
        // },
      },
      // {
      //   title: '上阶物料',
      //   field: 'advancedMaterials',
      //   width: 100,
      // },
      // {
      //   title: '上阶单据号',
      //   field: 'advancedDocumentNumber',
      //   width: 100,
      // },
      // {
      //   title: '上阶需求日期',
      //   field: 'advancedRequirementDay',
      //   width: 100,
      // },
      // {
      //   title: '计划齐套',
      //   field: 'isPlanComplete',
      //   width: 100,
      // },
      // {
      //   title: '库存齐套',
      //   field: 'isStockComplete',
      //   width: 100,
      // },
      // {
      //   title: '是否有折返工序',
      //   field: 'hasTurnback',
      //   width: 120,
      // },
      // {
      //   title: '风险标识',
      //   field: 'hasRisk',
      //   width: 100,
      // },
    ];
    subGridOptions.value.columns = [
      // {
      //   title: t("plan.table.itemNumber"),
      //   field: "itemNo",
      //   width: 150,
      //   align: "center",
      // },
      {
        title: t("plan.table.workOrderNo"),
        field: "workOrderNo",
        width: 150,
        align: "center",
      },
      {
        title: t("plan.table.processNumber"),
        field: "processNumber",
        width: 150,
        align: "center",
      },
      {
        title: t("plan.table.processName"),
        field: "processName",
        width: 150,
        align: "center",
      },
      {
        title: t("plan.table.startDateOfProcessPlan"),
        field: "processPlanStartDay",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.endDateOfProcessPlan"),
        field: "processPlanEndDay",
        width: 200,
        align: "center",
      },
      // {
      //   title: '未开工数量',
      //   field: 'notStartWorkCount',
      //   width: 90,
      //   align:"center",
      // },
      // {
      //   title: '已完成数量',
      //   field: 'completedCount',
      //   width: 90,
      //   align:"center",
      // },
      // {
      //   title: '废弃数量',
      //   field: 'discardCount',
      //   width: 90,
      //   align:"center",
      // },
      // {
      //   title: t("plan.table.standardTime"),
      //   field: "standardTime",
      //   width: 90,
      //   align: "center",
      // },
      // {
      //   title: t("plan.table.processOrder"),
      //   field: "processOrder",
      //   width: 90,
      //   align: "center",
      // },
      {
        title: t("plan.table.integrationDay"),
        field: "integrationDay",
        width: 160,
        align: "center",
      },
    ];
  },
  { immediate: true, deep: true }
);
/** 查询钣金计划临时管理列表 */
function getExampleList() {
  loading.value = true;
  queryParams.value = {};
  queryParams.value.batchNumber = batchNumber.value;
  examplePlan(queryParams.value).then(response => {
  examplePlan(queryParams.value).then((response) => {
    exampleList.value = response.rows;
    total.value = response.total;
    loading.value = false;
@@ -733,15 +823,17 @@
function getList() {
  loading.value = true;
  queryParams.value.params = {};
  if (null != daterangePlanStartDay && '' !== daterangePlanStartDay) {
    queryParams.value.params["beginPlanStartDay"] = daterangePlanStartDay.value[0];
    queryParams.value.params["endPlanStartDay"] = daterangePlanStartDay.value[1];
  if (null != daterangePlanStartDay && "" !== daterangePlanStartDay) {
    queryParams.value.params["beginPlanStartDay"] =
      daterangePlanStartDay.value[0];
    queryParams.value.params["endPlanStartDay"] =
      daterangePlanStartDay.value[1];
  }
  if (null != daterangePlanEndDay && '' !== daterangePlanEndDay) {
  if (null != daterangePlanEndDay && "" !== daterangePlanEndDay) {
    queryParams.value.params["beginPlanEndDay"] = daterangePlanEndDay.value[0];
    queryParams.value.params["endPlanEndDay"] = daterangePlanEndDay.value[1];
  }
  listPlan(queryParams.value).then(response => {
  listPlan(queryParams.value).then((response) => {
    planList.value = response.rows;
    loading.value = false;
  });
@@ -767,38 +859,41 @@
};
/** 批量修改计划开工日按钮操作 */
function plannedStart() {
}
function plannedStart() {}
/** 批量修改计划完工日按钮操作 */
function plannedEnd() {
}
function plannedEnd() {}
/** 导入按钮操作 */
function handleImport() {
  upload.title = "钣金计划数据上传";
  upload.title = t("plan.upload.uploadSheetMetalPlanData");
  upload.open = true;
};
}
/** 导出按钮操作 */
function handleExport() {
  proxy.download('aps/apsPlatePlan/export', {
    ...queryParams.value
  }, `plan_${new Date().getTime()}.xlsx`)
  proxy.download(
    "aps/apsPlatePlan/export",
    {
      ...queryParams.value,
    },
    `plan_${new Date().getTime()}.xlsx`
  );
}
/** 下载模板操作 */
function importTemplate() {
  proxy.download("system/user/importTemplate", {
  }, `user_template_${new Date().getTime()}.xlsx`);
};
  proxy.download(
    "system/user/importTemplate",
    {},
    `user_template_${new Date().getTime()}.xlsx`
  );
}
/** buildEexample */
function buildEexample() {
  proxy.$refs["uploadRef"].submit();
};
}
/**文件上传中处理 */
const handleFileUploadProgress = (event, file, fileList) => {
@@ -807,15 +902,25 @@
/** 文件上传成功处理 */
const handleFileSuccess = (response, file, fileList) => {
  if(response.code == '200'){
  if (response.code == "200") {
    batchNumber.value = response.data;
    isVisible.value = true;
    planned.value = false;
    isError.value = false;
    getExampleList();
  }else{
  } else {
    isError.value = true;
    proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
    proxy.$alert(
      "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
        response.msg +
        "</div>",
      t("plan.upload.errorResult"),
      {
        dangerouslyUseHTMLString: true,
        confirmButtonText: t("plan.btns.confirm"),
        cancelButtonText: t("plan.btns.cancel"),
      }
    );
  }
  proxy.$refs["uploadRef"].handleRemove(file);
  upload.isUploading = false;
@@ -825,7 +930,7 @@
function uploadParse() {
  queryParams.value.params = {};
  queryParams.value.params["batchNumber"] = batchNumber.value;
  confirmPart(queryParams.value).then(response => {
  confirmPart(queryParams.value).then((response) => {
    exampleList.value = response.rows;
    loading.value = false;
    isVisible.value = false;
@@ -833,15 +938,15 @@
    planned.value = true;
    upload.open = false;
    ElMessage({
      message: '气体管路计划数据已成功上传和解析',
      type: 'success',
    })
      message: t("plan.message.metalplanDataSuccess"),
      type: "success",
    });
    getList();
  });
}
/** dialog取消 */
function dialogCancel(){
function dialogCancel() {
  if (uploadRef.value) {
    uploadRef.value.clearFiles();
  }
@@ -858,31 +963,31 @@
//   showOverflow: true,
//   columns: [
//     {
//       title: t('page.table.itemNumber'),
//       title: t('plan.table.itemNumber'),
//       field: 'itemNo',
//       width: 150,
//       align:"center",
//     },
//     {
//       title: t('page.table.workOrderNo'),
//       title: t('plan.table.workOrderNo'),
//       field: 'workOrderNo',
//       width: 150,
//       align:"center",
//     },
//     {
//       title: t('page.table.processNumber'),
//       title: t('plan.table.processNumber'),
//       field: 'processNumber',
//       width: 100,
//       align:"center",
//     },
//     {
//       title: t('page.table.processName'),
//       title: t('plan.table.processName'),
//       field: 'processName',
//       width: 150,
//       align:"center",
//     },
//     {
//       title: t('page.table.startDateOfProcessPlan'),
//       title: t('plan.table.startDateOfProcessPlan'),
//       field: 'processPlanStartDay',
//       width: 200,
//       align:"center",
@@ -934,13 +1039,15 @@
const expandConfig = ref({
  lazy: true,
  loadMethod ({ row }) {
  loadMethod({ row }) {
    // 调用接口
    return listProcessRoute({'workOrderNo':row.documentNumber}).then(data => {
      row.subList = data.rows;
    })
  }
})
    return listProcessRoute({ workOrderNo: row.documentNumber }).then(
      (data) => {
        row.subList = data.rows;
      }
    );
  },
});
getList();
</script>
@@ -948,4 +1055,9 @@
h4 {
  font-weight: bold;
}
</style>
</style>
<style>
.vxe-cell{
  padding:0 20px;
}
</style>