CD配唱片
2025-05-06 a07f90d6106971923e8f761f253a9b4d30a60752
Merge branch 'feature-i18n' into dev
已修改15个文件
已添加4个文件
5471 ■■■■■ 文件已修改
.env.development 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/RightToolbar/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Navbar.vue 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/language.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/i18n/index.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/i18n/locales/common/index.js 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/i18n/locales/plan/index.js 272 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/apsPartRoutStat/index.vue 175 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/gasPiping/index.vue 1112 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/gasPlanning/index.vue 183 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/gasProduceStatics/index.vue 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/pipeProduceStatics/index.vue 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/platePlan/index.vue 1414 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/platePlanList/index.vue 240 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/plateProcessStat/index.vue 477 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/weldSeam/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/partPlan/index.vue 1099 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -10,4 +10,4 @@
# é…åˆåŽç«¯æœåŠ¡
# VITE_APP_LOCAL = 'int'
# VITE_APP_LOCAL = 'zhl'
VITE_APP_LOCAL = 'hjy'
VITE_APP_LOCAL = 'cxl'
package.json
@@ -34,12 +34,13 @@
    "splitpanes": "3.1.5",
    "vue": "3.4.31",
    "vue-cropper": "1.1.1",
    "vue-i18n": "^12.0.0-alpha.2",
    "vue-router": "4.4.0",
    "vuedraggable": "4.1.0",
    "vxe-pc-ui": "4.5.15",
    "xlsx": "^0.18.5",
    "vxe-table": "^4.13.8",
    "xe-utils": "^3.7.4"
    "xe-utils": "^3.7.4",
    "xlsx": "^0.18.5"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "5.0.5",
src/components/RightToolbar/index.vue
@@ -1,13 +1,13 @@
<template>
  <div class="top-right-btn" :style="style">
    <el-row>
      <el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top" v-if="search">
      <el-tooltip class="item" effect="dark" :content="showSearch ? $t('common.common.hideSearch') : $t('common.common.showSearch')" placement="top" v-if="search">
        <el-button circle icon="Search" @click="toggleSearch()" />
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="刷新" placement="top">
      <el-tooltip class="item" effect="dark" :content="$t('common.common.refresh')" placement="top">
        <el-button circle icon="Refresh" @click="refresh()" />
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="显隐列" placement="top" v-if="columns">
      <el-tooltip class="item" effect="dark" :content="$t('common.common.column')" placement="top" v-if="columns">
        <el-button circle icon="Menu" @click="showColumn()" v-if="showColumnsType == 'transfer'"/>
        <el-dropdown trigger="click" :hide-on-click="false" style="padding-left: 12px" v-if="showColumnsType == 'checkbox'">
          <el-button circle icon="Menu" />
src/layout/components/Navbar.vue
@@ -1,15 +1,34 @@
<template>
  <div class="navbar">
    <hamburger id="hamburger-container" :is-active="appStore.sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
    <breadcrumb v-if="!settingsStore.topNav" id="breadcrumb-container" class="breadcrumb-container" />
    <top-nav v-if="settingsStore.topNav" id="topmenu-container" class="topmenu-container" />
    <hamburger
      id="hamburger-container"
      :is-active="appStore.sidebar.opened"
      class="hamburger-container"
      @toggleClick="toggleSideBar"
    />
    <breadcrumb
      v-if="!settingsStore.topNav"
      id="breadcrumb-container"
      class="breadcrumb-container"
    />
    <top-nav
      v-if="settingsStore.topNav"
      id="topmenu-container"
      class="topmenu-container"
    />
    <div class="right-menu">
      <template v-if="appStore.device !== 'mobile'">
      </template>
      <template v-if="appStore.device !== 'mobile'"> </template>
      <div class="mt5">
          <el-button @click="changeLanguage('zh')">中文</el-button>
          <el-button @click="changeLanguage('en')">English</el-button>
      </div>
      <div class="avatar-container">
        <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
        <el-dropdown
          @command="handleCommand"
          class="right-menu-item hover-effect"
          trigger="click"
        >
          <div class="avatar-wrapper">
            <img :src="userStore.avatar" class="user-avatar" />
            <el-icon><caret-bottom /></el-icon>
@@ -17,13 +36,13 @@
          <template #dropdown>
            <el-dropdown-menu>
              <router-link to="/user/profile">
                <el-dropdown-item>个人中心</el-dropdown-item>
                <el-dropdown-item>{{ $t(`topNav.center`) }}</el-dropdown-item>
              </router-link>
              <!-- <el-dropdown-item command="setLayout" v-if="settingsStore.showSettings">
                <span>布局设置</span>
              </el-dropdown-item> -->
              <el-dropdown-item divided command="logout">
                <span>退出登录</span>
                <span>{{ $t(`topNav.logout`) }}</span>
              </el-dropdown-item>
            </el-dropdown-menu>
          </template>
@@ -34,25 +53,32 @@
</template>
<script setup>
import { ElMessageBox } from 'element-plus'
import Breadcrumb from '@/components/Breadcrumb'
import TopNav from '@/components/TopNav'
import Hamburger from '@/components/Hamburger'
import Screenfull from '@/components/Screenfull'
import SizeSelect from '@/components/SizeSelect'
import HeaderSearch from '@/components/HeaderSearch'
import RuoYiGit from '@/components/RuoYi/Git'
import RuoYiDoc from '@/components/RuoYi/Doc'
import useAppStore from '@/store/modules/app'
import useUserStore from '@/store/modules/user'
import useSettingsStore from '@/store/modules/settings'
const appStore = useAppStore()
const userStore = useUserStore()
const settingsStore = useSettingsStore()
import { ElMessageBox } from "element-plus";
import Breadcrumb from "@/components/Breadcrumb";
import TopNav from "@/components/TopNav";
import Hamburger from "@/components/Hamburger";
import Screenfull from "@/components/Screenfull";
import SizeSelect from "@/components/SizeSelect";
import HeaderSearch from "@/components/HeaderSearch";
import RuoYiGit from "@/components/RuoYi/Git";
import RuoYiDoc from "@/components/RuoYi/Doc";
import useAppStore from "@/store/modules/app";
import useUserStore from "@/store/modules/user";
import useSettingsStore from "@/store/modules/settings";
import useLanguageStore from "@/store/modules/language"
import { useI18n } from 'vue-i18n'//要在js中使用国际化
const appStore = useAppStore();
const userStore = useUserStore();
const settingsStore = useSettingsStore();
const languageStore = useLanguageStore();
const { proxy } = getCurrentInstance();
function changeLanguage(type) {
  proxy.$i18n.locale = type;
  languageStore.setLocale(type)
}
function toggleSideBar() {
  appStore.toggleSideBar()
  appStore.toggleSideBar();
}
function handleCommand(command) {
@@ -69,28 +95,30 @@
}
function logout() {
  ElMessageBox.confirm('确定注销并退出系统吗?', '提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning'
  }).then(() => {
    userStore.logOut().then(() => {
      location.href = '/index';
  ElMessageBox.confirm("确定注销并退出系统吗?", "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(() => {
      userStore.logOut().then(() => {
        location.href = "/index";
      });
    })
  }).catch(() => { });
    .catch(() => {});
}
const emits = defineEmits(['setLayout'])
const emits = defineEmits(["setLayout"]);
function setLayout() {
  emits('setLayout');
  emits("setLayout");
}
function toggleTheme() {
  settingsStore.toggleTheme()
  settingsStore.toggleTheme();
}
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.navbar {
  height: 50px;
  overflow: hidden;
@@ -130,7 +158,9 @@
    height: 100%;
    line-height: 50px;
    display: flex;
    .mt5{
      margin-top:5px;
    }
    &:focus {
      outline: none;
    }
@@ -158,7 +188,7 @@
        svg {
          transition: transform 0.3s;
          &:hover {
            transform: scale(1.15);
          }
src/main.js
@@ -47,8 +47,7 @@
import 'vxe-pc-ui/lib/style.css'
import VxeUITable from 'vxe-table'
import 'vxe-table/lib/style.css'
import i18n from '@/utils/i18n' // å¼•å…¥ i18n é…ç½®æ–‡ä»¶
const app = createApp(App)
// å…¨å±€æ–¹æ³•挂载
@@ -86,4 +85,5 @@
})
app.use(VxeUIAll)
app.use(VxeUITable)
app.use(i18n)
app.mount('#app')
src/store/modules/language.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
const useLanguageStore = defineStore("language", {
  state: () => ({
    locale: "zh",
  }),
  actions: {
    setLocale(locale) {
        this.locale = locale; // è®¾ç½®è¯­è¨€å¹¶æ›´æ–°çŠ¶æ€
        console.log(this.locale,"this.localethis.locale")
    }
  },
});
export default useLanguageStore;
src/utils/i18n/index.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
// i18n.js æˆ–类似的配置文件
import { createI18n } from 'vue-i18n'
import {zh as planZh, en as planEn} from './locales/plan'
import {zh as commonZh, en as commonEn} from './locales/common'
// import {zh as testZh, en as testEn} from './test'
let EN = {
  plan: planEn,
  common: commonEn
}
let ZH = {
  plan: planZh,
  common: commonZh
}
const i18n = createI18n({
  locale: 'zh', // è®¾ç½®é»˜è®¤è¯­è¨€ä¸ºä¸­æ–‡
  fallbackLocale: 'zh',
  globalInjection:true,
  legacy: false, // you must specify 'legacy: false' option
  messages: {
    en: EN,
    zh: ZH
  },
})
export default i18n
src/utils/i18n/locales/common/index.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,40 @@
export const zh = {
  topNav: {
    center: "个人中心",
    logout: "退出登录",
  },
  common: {
    import: "导入",
    export: "导出",
    update: "更新",
    query: "查询",
    reset: "重置",
    hideSearch: "隐藏搜索",
    showSearch: "显示搜索",
    refresh: "刷新",
    column: "显隐列",
    edit:"编辑",
    save:"保存",
    cancel:"取消"
  }
};
export const en = {
  topNav: {
    center: "Personal Center",
    logout: "Logout",
  },
  common: {
    import: "Import",
    export: "Export",
    update: "Update",
    query: "Query",
    reset: "Reset",
    hideSearch: "Hide Search",
    showSearch: "Display search",
    refresh: "Refresh",
    column: "Explicit implicit column",
    edit:"Edit",
    save:"Save",
    cancel:"Cancel"
  },
};
src/utils/i18n/locales/plan/index.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,272 @@
export const zh = {
  title: {
    pipePlanCapacity: "管路产能规划",
    gasPlanCapacity:"气柜规划产能"
  },
  options:{
    monthlyStatic:"按月统计",
    dailyStatic:"按日统计"
  },
  message: {
    update: "数据更新成功",
    dataWorkorderSuccess: "零件工单数据已成功解析",
    dataWorkorderError: "零件工单数据已解析失败",
    metalplanDataSuccess: "钣金计划数据已成功解析",
    metalplanDataError: "钣金计划数据已解析失败",
    idNotBeEmpty: "主键id不能为空",
    errorMonthEmpty:"请选择年月"
  },
  placeholder: {
    startDate: "开始日期",
    endDate: "结束日期",
    startMonth:"开始月份",
    endMonth:"结束月份",
    to:"至",
    documentNumber: "请输入单据号",
    customer: "请输入客户名称",
    planWorkOderNO: "请输入钣金计划工单号",
    selectMonth:"选择月份"
  },
  btns: {
    batchPlanStartDay: "批量修改计划开工日",
    batchPlanEndDay: "批量修改计划完工日",
    confirm: "确定",
    cancel: "取消",
  },
  query: {
    daterangePlanStartDay: "计划开工日",
    daterangePlanEndDay: "计划完工日",
    documentNumber: "单据号",
    customer: "客户名称",
    workOrderNo: "工单号",
    selectMonth: "选择月份",
    statistical:"统计方式",
    selectDateRange: "选择区间"
  },
  upload: {
    prevText: "将文件拖到此处,或",
    uploadPartWorkOrderData: "零件工单数据上传",
    uploadSheetMetalPlanData: "钣金计划数据上传",
    uploadGasPipelineData: "气体管路计划数据上传",
    info: "上传Excel文件,包含零件工单信息。系统将解析数据并保存到本地,用于关联到零件计划中。",
    weldSeamInfo:"上传Excel文件,包含焊缝工单信息。系统将解析数据并保存到本地,用于关联到焊缝计划中。",
    uploadText: "点击上传",
    fileTypeImport: "仅允许导入xls、xlsx格式文件。",
    dataPreview: "数据预览",
    totalUpload: "共上传",
    itemUpload: "条零件工单数据",
    confirmUpload: "确认上传",
    cancel: "取 æ¶ˆ",
    errorResult: "导入结果",
    uploadParsePartWorkOrderData: "零件工单数据已成功上传和解析",
    uploadParseGasPipelineData: "气体管路计划数据已成功上传和解析",
  },
  table: {
    mainPartNumber: "主件料号",
    businessType: "业务类型",
    documentNumber: "单据号",
    requirementType: "需求分类",
    documentStatus: "单据状态",
    updateBy: "审核时间",
    workCenter: "当前工序",
    department: "当前工序负责人",
    opStatus: "当前工序状态",
    nextOpName: "下一工序",
    nextProcessDeparment: "下一工序负责人",
    itemNumber: "料号",
    drawingNo: "图号",
    versionNumber: "版本号",
    cheaperCode: "低阶码",
    productionQuantity: "生产数量",
    planworkOrderTime: "工单计划下发时间",
    planEndDay: "系统完工时间",
    seq: "序号",
    masterPlanner: "主计划员",
    weekDay: "周日",
    weekCycle: "周度",
    mainPartDrawingNumber: "主件图号",
    customer: "客户名称",
    goodProductsQuantity: "良品数量",
    processNumber: "工序号",
    factoryCenter: "工作中心",
    dependencyDepartment: "所属部门",
    planStartDay: "计划开工日",
    planEndDayDate: "计划完工日",
    standbyNumber: "备料料号",
    standbyName: "备料名称",
    standbyStock: "备料库存",
    departmentToNextProcessBelongs: "下道工序所属部门",
    isSuspended: "是否挂起",
    isOutsourcing: "外协标识",
    account: "账套",
    workOrderNo: "工单号",
    processName: "工序名称",
    startDateOfProcessPlan: "工序计划开始日期",
    endDateOfProcessPlan: "工序计划结束日期",
    standardTime: "标准工时",
    processOrder: "工序排序",
    integrationDay: "集成日期",
    currentProcessNumber: "当前工序号",
    totalWorkingHoursOfProcess: "工序总工时",
    OrderCompletionDate: "订单完工日",
    dateYearMonth: "日期",
    resourceName: "资源组",
    designWorkingHours: "设计工时",
    requiredWorkingHours: "需求工时",
    capacityLoad: "产能负荷",
    advancedMaterials: "上阶物料",
    advancedDocumentNumber: "上阶单据号",
    advancedRequirementDay: "上阶需求日期",
    isPlanComplete: "计划齐套",
    isStockComplete: "库存齐套",
    hasTurnback: "是否有折返工序",
    hasRisk: "风险标识",
    // äº§èƒ½è§„划
    satndardProcessName: "标准工序名称",
    dayProduceType: "日产出类型",
    dayProduceNum: "日产出数量",
    dayProduceUnit: "日产出单位",
    personnelNumber: "人员数量",
    dayProduceAllNum: "日产出总数量",
    days: "天数",
    monthProduceAllNum: "月产出数量",
    remark: "备注",
  },
};
export const en = {
  title: {
    pipePlanCapacity: "Pipeline planning capacity",
    gasPlanCapacity: "Gas holder planning production capacity"
  },
  options:{
    monthlyStatic:"Monthly statistics",
    dailyStatic:"Daily statistics"
  },
  message: {
    update: "Data update successful",
    dataWorkorderSuccess:
      "The part work order data has been successfully parsed",
    dataWorkorderError: "Failed to parse part work order data",
    metalplanDataSuccess: "Sheet metal plan data successfully parsed",
    metalplanDataError: "Sheet metal plan data parsing failed",
    idNotBeEmpty: "The primary key ID cannot be empty",
    errorMonthEmpty:"Please select year and month"
  },
  placeholder: {
    startDate: "Start date",
    endDate: "End date",
    startMonth:"Start Month",
    endMonth:"End Month",
    to:"To",
    documentNumber: "Please enter the document number",
    customer: "Please enter the customer name",
    planWorkOderNO: "Please enter the sheet metal plan work order number",
    selectMonth:"Select Month"
  },
  btns: {
    batchPlanStartDay: "Batch modification of planned start date",
    batchPlanEndDay: "Batch modification plan completion date",
    confirm: "Confirm",
    cancel: "Cancel",
  },
  query: {
    daterangePlanStartDay: "Planned start date",
    daterangePlanEndDay: "Planned completion date",
    documentNumber: "Document number",
    customer: "Customer Name",
    workOrderNo: "Work order number",
    selectMonth: "Select Month",
    statistical:"Statistical method",
    selectDateRange: "Select interval"
  },
  upload: {
    prevText: "Drag the file here, or",
    uploadPartWorkOrderData: "Upload part work order data",
    uploadSheetMetalPlanData: "Upload sheet metal plan data",
    info: "Upload an Excel file containing part work order information. The system will parse the data and save it locally for association with the part plan.",
    uploadText: " Click to upload",
    fileTypeImport:
      "Only xls and xlsx format files are allowed to be imported.",
    dataPreview: "Data Preview",
    totalUpload: "Upload",
    itemUpload: "part work order data in total",
    confirmUpload: "Confirm upload",
    cancel: "Cancel",
    errorResult: "Import results",
    uploadParsePartWorkOrderData:
      "The part work order data has been successfully uploaded and parsed",
    uploadParseGasPipelineData:
      "The gas pipeline plan data has been successfully uploaded and parsed",
  },
  table: {
    mainPartNumber: "Main part number",
    businessType: "Business type",
    documentNumber: "Document number",
    requirementType: "Requirements classification",
    documentStatus: "Document Status",
    updateBy: "Audit time",
    workCenter: "Current process",
    department: "Current process leader",
    opStatus: "Current process status",
    nextOpName: "Next process",
    nextProcessDeparment: "Next Process Manager",
    itemNumber: "Item number",
    drawingNo: "Drawing No",
    versionNumber: "Version number",
    cheaperCode: "Low order code",
    productionQuantity: "Production quantity",
    planworkOrderTime: "Work order plan issuance time",
    planEndDay: "System completion time",
    seq: "Serial Number",
    masterPlanner: "Master scheduler",
    weekDay: "Sunday",
    weekCycle: "Week cycle",
    mainPartDrawingNumber: "Main component drawing number",
    customer: "Customer Name",
    goodProductsQuantity: "Quantity of good products",
    processNumber: "Process number",
    factoryCenter: "Work center",
    dependencyDepartment: "Department",
    planStartDay: "Planned commencement date",
    planEndDayDate: "Planned completion date",
    standbyNumber: "Material preparation part number",
    standbyName: "Material name",
    standbyStock: "Material preparation inventory",
    departmentToNextProcessBelongs: "Material preparation inventory",
    isSuspended: "Is it suspended",
    isOutsourcing: "Outsourcing identification",
    account: "Account set",
    workOrderNo: "Work order number",
    processName: "Process name",
    startDateOfProcessPlan: "Start date of process plan",
    endDateOfProcessPlan: "End date of process plan",
    standardTime: "Standard working hours",
    processOrder: "Process sorting",
    integrationDay: "Integration date",
    currentProcessNumber: "Current process number",
    totalWorkingHoursOfProcess: "Total working hours of the process",
    OrderCompletionDate: "Order completion date",
    dateYearMonth: "Date",
    resourceName: "Resource Group",
    designWorkingHours: "Design working hours",
    requiredWorkingHours: "Required working hours",
    capacityLoad: "capacity load",
    advancedMaterials: "advanced materials",
    advancedDocumentNumber: "advanced document number",
    advancedRequirementDay: "advanced requirement day",
    isPlanComplete: "Complete plan",
    isStockComplete: "Complete inventory set",
    hasTurnback: "Is there a turnaround process",
    hasRisk: "Risk identification",
    // äº§èƒ½è§„划
    satndardProcessName: "Standard process name",
    dayProduceType: "Type of daily production",
    dayProduceNum: "Daily output quantity",
    dayProduceUnit: "Daily production unit",
    personnelNumber: "Number of personnel",
    dayProduceAllNum: "Total daily output quantity",
    days: "Days",
    monthProduceAllNum: "Monthly output quantity",
    remark: "notes",
  },
};
src/views/mainPlan/apsPartRoutStat/index.vue
@@ -8,16 +8,19 @@
          icon="Download"
          @click="handleExport"
          v-hasPermi="['apsPartRouteStat:export']"
        >导出</el-button>
          >{{ $t(`common.common.export`) }}</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="info"
          type="success"
          plain
          icon="Refresh"
          @click="handleRefresh"
          :disabled="loading"
          v-hasPermi="['apsPartRouteStat:edit']"
        >更新</el-button>
          >{{ $t(`common.common.update`) }}</el-button
        >
      </el-col>
      <right-toolbar @queryTable="getList" :search="false"></right-toolbar>
    </el-row>
@@ -26,15 +29,16 @@
</template>
<script setup name="apsPartRouteStat">
import { query,updateStat } from "@/api/mainPlan/partRouteStat.js";
import { query, updateStat } from "@/api/mainPlan/partRouteStat.js";
import { ref } from "vue";
import * as XLSX from 'xlsx';
import * as XLSX from "xlsx";
const { proxy } = getCurrentInstance();
const loading = ref(true);
import { useI18n } from "vue-i18n"; //要在js中使用国际化
const { t, locale } = useI18n();
const loading = ref(false);
const gridRef = ref();
const height = ref(document.documentElement.clientHeight - 130 + "px;")
const height = ref(document.documentElement.clientHeight - 130 + "px;");
const headers = ref([]);
const exportData = ref([]);
@@ -47,122 +51,133 @@
  showFooterOverflow: true,
  height: height,
  columnConfig: {
    resizable: true
    resizable: true,
  },
  scrollX: {
    enabled: true,
    gt: 0,
    threshold: 50
    threshold: 50,
  },
  scrollY: {
    enabled: true,
    gt: 0,
    threshold: 50
  }
    threshold: 50,
  },
});
let tableColumn = []
let tableData = []
let tableColumn = [];
let tableData = [];
let merges = [];
watch(locale, (newLocale) => {
  getList()
},{immediate:true, deep:true})
/** æŸ¥è¯¢é›¶ä»¶ç»Ÿè®¡è¡¨åˆ—表 */
function getList() {
  let rowKey = 0
  let colKey = 0
  headers.value = []
  exportData.value = []
  tableColumn = []
  tableData = []
  let rowKey = 0;
  let colKey = 0;
  headers.value = [];
  exportData.value = [];
  tableColumn = [];
  tableData = [];
  loading.value = true;
  query().then(response => {
    const colList = []
    let headersOne = []
    let headersTwo = []
    if(response.code == '200'){
  query().then((response) => {
    const colList = [];
    let headersOne = [];
    let headersTwo = [];
    if (response.code == "200") {
      if (!response.planTitle) {
        loading.value = false;
        return;
      }
      headersOne.push('日期');
      headersTwo.push('资源组');
      headersOne.push(t('plan.table.dateYearMonth'));
      headersTwo.push(t('plan.table.resourceName'));
      colList.push({
          field: 'dateCol',
          title: '日期',
          fixed: 'left',
          children: [
            { field: `resourceName`, title: '资源组', width: 250, type: 'html'},
          ],
          width: 160
        })
      response.planTitle.forEach(item => {
        field: "dateCol",
        title: t('plan.table.dateYearMonth'),
        fixed: "left",
        children: [
          { field: `resourceName`, title: t('plan.table.resourceName'), width: 250, type: "html" },
        ],
        width: 160,
      });
      response.planTitle.forEach((item) => {
        headersOne.push(item);
        headersOne.push('');
        headersOne.push('');
        headersTwo.push('设计工时');
        headersTwo.push('需求工时');
        headersTwo.push('产能负荷');
        colKey++
        headersOne.push("");
        headersOne.push("");
        headersTwo.push(t("plan.table.designWorkingHours"));
        headersTwo.push(t("plan.table.requiredWorkingHours"));
        headersTwo.push(t("plan.table.capacityLoad"));
        colKey++;
        colList.push({
          field: `dateColTime${colKey}`,
          title: item,
          children: [
          { field: `designTimes${colKey}`, title: '设计工时', width: 80},
          { field: `requireTimes${colKey}`, title: '需求工时', width: 80},
          { field: `capacityLoad${colKey}`, title: '产能负荷', width: 80, type: 'html'},
            { field: `designTimes${colKey}`, title: t("plan.table.designWorkingHours"), width: 80 },
            { field: `requireTimes${colKey}`, title: t("plan.table.requiredWorkingHours"), width: 80 },
            {
              field: `capacityLoad${colKey}`,
              title: t("plan.table.capacityLoad"),
              width: 80,
              type: "html",
            },
          ],
          width: 160
        })
          width: 160,
        });
      });
      headers.value.push(headersOne);
      headers.value.push(headersTwo);
      const columnList = [...tableColumn, ...colList]
      const dataList = []
      const columnList = [...tableColumn, ...colList];
      const dataList = [];
      let startCol = 1;
      //获取map
      response.planTable.forEach(mapItem => {
        rowKey++
      response.planTable.forEach((mapItem) => {
        rowKey++;
        let lastCol = startCol + 2;
        merges.push({ s: { r: 0, c: startCol }, e: { r: 0, c:  lastCol} });
        merges.push({ s: { r: 0, c: startCol }, e: { r: 0, c: lastCol } });
        startCol = lastCol + 1;
        let data = [];
        const item = {
          id: `${rowKey}`
        }
          id: `${rowKey}`,
        };
        for (const [key, listValue] of Object.entries(mapItem)) {
          data.push(key);
          let tableKey = 0;
          let flag = false;
          listValue.forEach(listItem => {
            tableKey++
          listValue.forEach((listItem) => {
            tableKey++;
            item[`designTimes${tableKey}`] = listItem.designTimes;
            item[`requireTimes${tableKey}`] = listItem.requireTimes;
            item[`capacityLoad${tableKey}`] = listItem.capacityLoad > 100 ? `<font color="red">${listItem.capacityLoad}%</font>` :listItem.capacityLoad+'%';
            item[`capacityLoad${tableKey}`] =
              listItem.capacityLoad > 100
                ? `<font color="red">${listItem.capacityLoad}%</font>`
                : listItem.capacityLoad + "%";
            data.push(listItem.designTimes);
            data.push(listItem.requireTimes);
            data.push(listItem.capacityLoad+'%');
            data.push(listItem.capacityLoad + "%");
            if (listItem.capacityLoad > 100) {
              flag = true;
            }
          });
          item[`resourceName`] = flag ? `<div class='el-badge'><sup class="el-badge__content is-fixed is-dot"></sup>${key}</div>` : key;
          item[`resourceName`] = flag
            ? `<div class='el-badge'><sup class="el-badge__content is-fixed is-dot"></sup>${key}</div>`
            : key;
        }
        exportData.value.push(data);
        dataList.push(item);
      });
      const $grid = gridRef.value
      const $grid = gridRef.value;
      if ($grid) {
        tableColumn = columnList
        tableData = [...tableData, ...dataList]
        $grid.loadColumn(tableColumn)
        $grid.loadData(tableData)
        gridOptions.loading = false
        tableColumn = columnList;
        tableData = [...tableData, ...dataList];
        $grid.loadColumn(tableColumn);
        $grid.loadData(tableData);
        gridOptions.loading = false;
      }
      loading.value = false;
@@ -172,7 +187,6 @@
/** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
function handleExport() {
  // åˆå¹¶è¡¨å¤´å’Œæ•°æ®
  const finalData = [...headers.value, ...exportData.value];
@@ -185,25 +199,30 @@
    { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } }
  ]; */
  ws['!merges'] = merges;
  ws["!merges"] = merges;
  // åˆ›å»º workbook
  const wb = XLSX.utils.book_new();
  // å°† worksheet æ·»åŠ åˆ° workbook ä¸­
  XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
  XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
  // å¯¼å‡ºæ–‡ä»¶
  XLSX.writeFile(wb, `apsPartRouteStat_${new Date().getTime()}.xlsx`);
}
/** åˆ·æ–°æŒ‰é’®æ“ä½œ */
function handleRefresh(){
  updateStat().then(response => {
    if(response.code == '200'){
function handleRefresh() {
  loading.value = true;
  updateStat().then((response) => {
    if (response.code == "200") {
      ElMessage({
        message: t("plan.message.update"),
        type: "success",
      });
      getList();
      loading.value = false;
    }
  });
}
getList();
// getList();
</script>
src/views/mainPlan/gasPiping/index.vue
@@ -1,90 +1,111 @@
<template>
  <div class="app-container">
    <el-row :gutter="20"> <el-col>
    <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="计划开工日" style="width: 100%;">
    <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('plan.query.daterangePlanStartDay')">
          <el-date-picker
              v-model="daterangePlanStartDay"
              value-format="YYYY-MM-DD"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            style="width: 240px"
            v-model="daterangePlanStartDay"
            value-format="YYYY-MM-DD"
            type="daterange"
            range-separator="-"
            :start-placeholder="$t('plan.placeholder.startDate')"
            :end-placeholder="$t('plan.placeholder.endDate')"
          ></el-date-picker>
        </el-form-item>
        </el-col>
        <el-col :span="6">
        <el-form-item label="计划完工日" style="width: 100%;">
        <!-- </el-col>
        <el-col :span="6"> -->
        <el-form-item :label="$t('plan.query.daterangePlanEndDay')">
          <el-date-picker
              v-model="daterangePlanEndDay"
              value-format="YYYY-MM-DD"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            style="width: 240px"
            v-model="daterangePlanEndDay"
            value-format="YYYY-MM-DD"
            type="daterange"
            range-separator="-"
            :start-placeholder="$t('plan.placeholder.startDate')"
            :end-placeholder="$t('plan.placeholder.endDate')"
          ></el-date-picker>
        </el-form-item>
        </el-col>
        <el-col :span="6">
        <el-form-item label="单据号" prop="documentNumber" style="width: 100%;">
        <!-- </el-col>
        <el-col :span="6"> -->
        <el-form-item
          :label="$t('plan.query.documentNumber')"
          prop="documentNumber"
        >
          <el-input
              v-model="queryParams.documentNumber"
              placeholder="请输入单据号"
              clearable
              @keyup.enter="handleQuery"
            style="width: 240px"
            v-model="queryParams.documentNumber"
            :placeholder="$t('plan.placeholder.documentNumber')"
            clearable
            @keyup.enter="handleQuery"
          />
        </el-form-item>
        </el-col>
        <el-col :span="6">
        <el-form-item label="客户名称" prop="customer" style="width: 100%;">
        <!-- </el-col>
        <el-col :span="6"> -->
        <el-form-item :label="$t('plan.query.customer')" prop="customer">
          <el-input
              v-model="queryParams.customer"
              placeholder="请输入客户名称"
              clearable
              @keyup.enter="handleQuery"
            style="width: 240px"
            v-model="queryParams.customer"
            :placeholder="$t('plan.placeholder.customer')"
            clearable
            @keyup.enter="handleQuery"
          />
        </el-form-item>
        </el-col>
        <el-col  :span="24"  style="text-align: right;">
        <!-- </el-col>
        <el-col  :span="24"  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-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-col> -->
        <!-- </el-row> -->
      </el-form>
    </el-col> </el-row>
    </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']"
        >批量修改计划开工日</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']"
        >批量修改计划完工日</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']"
        >导入</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
@@ -93,45 +114,69 @@
          icon="Download"
          @click="handleExport"
          v-hasPermi="['apsPlatePlan: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"
      style="width: 100%"
      :columns="columns"
      :data="planList"
      :loading="loading"
      :height="height"
      @on-checkbox="handleCheckboxChange"
    >
    </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 :gutter="10" style="margin-top: 20px;"> </el-row>
      <el-row :gutter="10" style="margin-top: 20px"> </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-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>
            <div class="el-upload__text">
              {{ $t("plan.upload.prevText")
              }}<em>{{ $t("plan.upload.uploadText") }}</em>
            </div>
            <template #tip>
              <div class="el-upload__tip">
                <!-- <div class="el-upload__tip">
                  <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
                </div> -->
                <span>仅允许导入xls、xlsx格式文件。</span>
                <span>{{ $t("plan.upload.fileTypeImport") }}</span>
                <!-- <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link> -->
              </div>
            </template>
@@ -139,65 +184,95 @@
        </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="['gasPiping:confirm']"
          >确认上传</el-button>
            type="success"
            plain
            icon="Check"
            :disabled="planned"
            @click="uploadParse"
            v-hasPermi="['gasPiping:confirm']"
            >{{$t('plan.upload.confirmUpload')}}</el-button
          >
          <!-- <el-button type="primary" @click="submitFileForm">ç¡® å®š</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/gasPiping.js";
import HxlhTable from '@/components/HxlhTable/index.vue'
import {
  listPlan,
  examplePlan,
  confirmPart,
} from "@/api/mainPlan/gasPiping.js";
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 { t, locale } = useI18n();
const { proxy } = getCurrentInstance();
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_is_suspended,
  aps_document_status,
  aps_account,
  aps_business_type,
} = proxy.useDict(
  "aps_is_suspended",
  "aps_document_status",
  "aps_account",
  "aps_business_type"
);
const exampleList = ref([]);
const planList = ref([]);
@@ -207,14 +282,13 @@
const total = ref(0);
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({
@@ -227,382 +301,16 @@
  // æ˜¯å¦æ›´æ–°å·²ç»å­˜åœ¨çš„用户数据
  updateSupport: 0,
  // è®¾ç½®ä¸Šä¼ çš„请求头部
  headers: { Authorization: "Bearer " + getToken() ,local: 'zhl'},
  headers: { Authorization: "Bearer " + getToken(), local: "zhl" },
  // ä¸Šä¼ çš„地址
  url: import.meta.env.VITE_APP_BASE_API + "/aps/gasPiping/importData"
  url: import.meta.env.VITE_APP_BASE_API + "/aps/gasPiping/importData",
});
// è¡¨æ ¼é…ç½®
const exampleColumns = ref([
  { type: 'seq', title: '序号', 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: '主件料号',
    field: 'mainPartNumber',
    width: 150,
  },
  {
    title: '主件图号',
    field: 'mainPartDrawingNumber',
    width: 150,
  },
  {
    title: '客户名称',
    field: 'customer',
    width: 200,
  },
  {
    title: '业务类型',
    field: 'businessType',
    width: 150,
  },
  {
    title: '单据号',
    field: 'documentNumber',
    width: 150,
  },
  {
    title: '需求分类',
    field: 'requirementType',
    width: 150,
  },
  {
    title: '单据状态',
    field: 'documentStatus',
    width: 100,
  },
  {
    title: '料号',
    field: 'itemNumber',
    width: 150,
  },
  {
    title: '图号',
    field: 'drawingNo',
    width: 150,
  },
  {
    title: '版本号',
    field: 'versionNumber',
    width: 100,
  },
  {
    title: '生产数量',
    field: 'productionQuantity',
    width: 100,
  },
  {
    title: '良品数量',
    field: 'goodProductsQuantity',
    width: 100,
  },
  {
    title: '工序号',
    field: 'processNumber',
    width: 150,
  },
  {
    title: '工作中心',
    field: 'workCenter',
    width: 150,
  },
  {
    title: '所属部门',
    field: 'department',
    width: 100,
  },
  {
    title: '计划开工日',
    field: 'planStartDay',
    width: 100,
  },
  {
    title: '计划完工日',
    field: 'planEndDay',
    width: 100,
  },
  {
    title: '备料料号',
    field: 'standbyNumber',
    width: 100,
  },
  {
    title: '备料名称',
    field: 'standbyName',
    width: 200,
  },
  {
    title: '备料库存',
    field: 'standbyStock',
    width: 100,
  },
  {
    title: '下道工序所属部门',
    field: 'nextProcessDeparment',
    width: 150,
  },
  {
    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: 150,
  // },
  // {
  //   title: '计划齐套',
  //   field: 'isPlanComplete',
  //   width: 100,
  // },
  // {
  //   title: '库存齐套',
  //   field: 'isStockComplete',
  //   width: 100,
  // },
  // {
  //   title: '是否有折返工序',
  //   field: 'hasTurnback',
  //   width: 150,
  // },
  // {
  //   title: '风险标识',
  //   field: 'hasRisk',
  //   width: 100,
  // },
]);
const exampleColumns = ref([]);
// è¡¨æ ¼é…ç½®
const columns = ref([
  { type: 'checkbox', width: 60, align:"center"},
  { type: 'seq', title: '序号', 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: '主件料号',
    field: 'mainPartNumber',
    width: 150,
  },
  {
    title: '主件图号',
    field: 'mainPartDrawingNumber',
    width: 150,
  },
  {
    title: '客户名称',
    field: 'customer',
    width: 200,
  },
  {
    title: '业务类型',
    field: 'businessType',
    width: 100,
  },
  {
    title: '单据号',
    field: 'documentNumber',
    width: 100,
  },
  {
    title: '需求分类',
    field: 'requirementType',
    width: 100,
  },
  {
    title: '单据状态',
    field: 'documentStatus',
    width: 100,
  },
  {
    title: '料号',
    field: 'itemNumber',
    width: 100,
  },
  {
    title: '图号',
    field: 'drawingNo',
    width: 100,
  },
  {
    title: '版本号',
    field: 'versionNumber',
    width: 100,
  },
  {
    title: '生产数量',
    field: 'productionQuantity',
    width: 100,
  },
  {
    title: '良品数量',
    field: 'goodProductsQuantity',
    width: 100,
  },
  {
    title: '工序号',
    field: 'processNumber',
    width: 100,
  },
  {
    title: '工作中心',
    field: 'workCenter',
    width: 100,
  },
  {
    title: '所属部门',
    field: 'department',
    width: 100,
  },
  {
    title: '计划开工日',
    field: 'planStartDay',
    width: 100,
  },
  {
    title: '计划完工日',
    field: 'planEndDay',
    width: 100,
  },
  {
    title: '备料料号',
    field: 'standbyNumber',
    width: 100,
  },
  {
    title: '备料名称',
    field: 'standbyName',
    width: 100,
  },
  {
    title: '备料库存',
    field: 'standbyStock',
    width: 100,
  },
  {
    title: '下道工序所属部门',
    field: 'nextProcessDeparment',
    width: 100,
  },
  {
    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: 100,
  },
  {
    title: '风险标识',
    field: 'hasRisk',
    width: 100,
  },
]);
const columns = ref([]);
const data = reactive({
  form: {},
@@ -610,22 +318,390 @@
    pageNum: 1,
    pageSize: 10,
    customer: null,
    documentNumber: null
    documentNumber: null,
  },
  rules: {
    id: [
      { required: true, message: "主键id不能为空", trigger: "blur" }
    ],
  }
    id: [{ required: true, message:t("plan.message.idNotBeEmpty"), trigger: "blur" }],
  },
});
const { queryParams } = toRefs(data);
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: 150,
    },
    {
      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 = [
    { type: "checkbox", width: 60, align: "center" },
    { 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: 100,
    },
    {
      title: t("plan.table.documentNumber"),
      field: "documentNumber",
      width: 100,
    },
    {
      title: t("plan.table.requirementType"),
      field: "requirementType",
      width: 100,
    },
    {
      title: t("plan.table.documentStatus"),
      field: "documentStatus",
      width: 100,
    },
    {
      title: t("plan.table.itemNumber"),
      field: "itemNumber",
      width: 100,
    },
    {
      title: t("plan.table.drawingNo"),
      field: "drawingNo",
      width: 100,
    },
    {
      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: 100,
    },
    {
      title: t("plan.table.factoryCenter"),
      field: "workCenter",
      width: 100,
    },
    {
      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: 100,
    },
    {
      title: t("plan.table.standbyStock"),
      field: "standbyStock",
      width: 100,
    },
    {
      title: t("plan.table.departmentToNextProcessBelongs"),
      field: "nextProcessDeparment",
      width: 100,
    },
    {
      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: t("plan.table.advancedMaterials"),
      field: "advancedMaterials",
      width: 100,
    },
    {
      title: t("plan.table.advancedDocumentNumber"),
      field: "advancedDocumentNumber",
      width: 100,
    },
    {
      title: t("plan.table.advancedRequirementDay"),
      field: "advancedRequirementDay",
      width: 100,
    },
    {
      title: t("plan.table.isPlanComplete"),
      field: "isPlanComplete",
      width: 100,
    },
    {
      title: t("plan.table.isStockComplete"),
      field: "isStockComplete",
      width: 100,
    },
    {
      title: t("plan.table.hasTurnback"),
      field: "hasTurnback",
      width: 100,
    },
    {
      title: t("plan.table.hasRisk"),
      field: "hasRisk",
      width: 100,
    },
  ];
  getList()
},{ 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;
@@ -636,15 +712,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;
  });
@@ -670,38 +748,41 @@
};
/** æ‰¹é‡ä¿®æ”¹è®¡åˆ’开工日按钮操作 */
function plannedStart() {
}
function plannedStart() {}
/** æ‰¹é‡ä¿®æ”¹è®¡åˆ’完工日按钮操作 */
function plannedEnd() {
}
function plannedEnd() {}
/** å¯¼å…¥æŒ‰é’®æ“ä½œ */
function handleImport() {
  upload.title = "气体管路计划数据上传";
  upload.title = t("plan.upload.uploadGasPipelineData");
  upload.open = true;
};
}
/** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
function handleExport() {
  proxy.download('aps/gasPiping/export', {
    ...queryParams.value
  }, `plan_${new Date().getTime()}.xlsx`)
  proxy.download(
    "aps/gasPiping/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) => {
@@ -710,15 +791,24 @@
/** æ–‡ä»¶ä¸Šä¼ æˆåŠŸå¤„ç† */
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;
@@ -728,7 +818,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;
@@ -736,15 +826,15 @@
    planned.value = true;
    upload.open = false;
    ElMessage({
      message: '气体管路计划数据已成功上传和解析',
      type: 'success',
    })
      message: t("plan.upload.uploadParseGasPipelineData"),
      type: "success",
    });
    getList();
  });
}
/** dialog取消 */
function dialogCancel(){
function dialogCancel() {
  if (uploadRef.value) {
    uploadRef.value.clearFiles();
  }
@@ -755,10 +845,10 @@
  upload.isUploading = false;
}
getList();
// getList();
</script>
<style lang="css" scoped>
h4 {
  font-weight: bold;
}
</style>
</style>
src/views/mainPlan/gasPlanning/index.vue
@@ -5,17 +5,18 @@
      :model="queryParams"
      ref="queryRef"
      :inline="true"
      label-width="68px"
      label-width="100px"
      label-position="left"
    >
      <el-row type="flex" justify="left">
        <el-col :span="6">
          <el-form-item label="选择月份" prop="description">
          <el-form-item :label="$t('plan.query.selectMonth')" prop="description">
            <el-date-picker
              clearable
              v-model="queryParams.date"
              type="month"
              value-format="YYYY-MM"
              placeholder="选择月份"
              :placeholder="$t('plan.query.selectMonth')"
            >
            </el-date-picker>
          </el-form-item>
@@ -23,9 +24,9 @@
        <el-col :span="18" style="text-align: right">
          <el-form-item class="column-with-margin">
            <el-button type="primary" icon="Search" @click="handleQuery"
              >查询</el-button
              >{{$t("common.common.query")}}</el-button
            >
            <el-button icon="Refresh" @click="resetQuery">重置</el-button>
            <el-button icon="Refresh" @click="resetQuery">{{$t("common.common.reset")}}</el-button>
          </el-form-item>
        </el-col>
      </el-row>
@@ -33,13 +34,13 @@
    <div class="box_container">
      <el-row>
        <el-col :span="!clickedTableRef?22:20">
          <div class="title_text">管路规划产能</div>
          <div class="title_text">{{$t('plan.title.pipePlanCapacity')}}</div>
        </el-col>
        <el-col :span="1" v-if="!clickedTableRef">
          <el-button 
            class="title_btn"
            type="default"
            @click="editRowEvent" >编辑</el-button>
            @click="editRowEvent" >{{$t("common.common.edit")}}</el-button>
        </el-col>
        <el-col :span="1.8" v-if="clickedTableRef">
          <el-button
@@ -48,14 +49,14 @@
            @click="saveRowEvent"
            v-hasPermi="['aps:gasPipelineCapacityPlan:add']"
          >
            ä¿å­˜
            {{$t("common.common.save")}}
          </el-button>
        </el-col>
        <el-col :span="1" v-if="clickedTableRef"> 
          <el-button 
            class="title_btn ml20"
            type="default"
            @click="handleCancleStaus">取消</el-button>
            @click="handleCancleStaus">{{$t("common.common.cancel")}}</el-button>
        </el-col>
      </el-row>
@@ -82,16 +83,16 @@
          show-overflow
          :loading="loading"
          :height="height"
          :edit-config="{ trigger: 'click', mode: 'row', showStatus: true }"
          :column-config="{ resizable: true, useKey: true }"
          :data="routePlanList"
          size="small"
        >
          <vxe-column field="processName" title="标准工序名称" min-width="150" fixed="left">
          <vxe-column field="processName" :width="locale === 'zh' ? '150px' : '200px'" :title="$t('plan.table.satndardProcessName')" fixed="left">
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '150px' : '200px'"
            field="dayProduceType"
            title="日产出类型"
            min-width="160"
            :title="$t('plan.table.dayProduceType')"
          >
            <!-- <template #edit="{ row }">
              <el-select
@@ -131,9 +132,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '180px' : '200px'"
            field="dayProduceNum"
            title="日产出数量"
            min-width="200"
           :title="$t('plan.table.dayProduceNum')"
          >
            <!-- <template #edit="{ row }">
              <el-input-number v-model="row.dayProduceNum" size="mini" />
@@ -148,9 +149,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '150px' : '200px'"
            field="dayProduceUnit"
            title="日产出单位"
            min-width="200"
            :title="$t('plan.table.dayProduceUnit')"
          >
            <!-- <template #edit="{ row }">
              <el-input v-model="row.dayProduceUnit" />
@@ -165,9 +166,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '180px' : '200px'"
            field="personnelNumber"
            title="人员数量"
            min-width="200"
            :title="$t('plan.table.personnelNumber')"
          >
            <!-- <template #edit="{ row }">
              <el-input-number v-model="row.personnelNumber" />
@@ -182,9 +183,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '180px' : '200px'"
            field="dayProduceAllNum"
            title="日产出总数量"
            min-width="200"
            :title="$t('plan.table.dayProduceAllNum')"
          >
            <!-- <template #edit="{ row }">
              <el-input-number v-model="row.dayProduceAllNum" disabled />
@@ -199,9 +200,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '180px' : '200px'"
            field="days"
            title="天数"
            min-width="200"
           :title="$t('plan.table.days')"
          >
            <!-- <template #edit="{ row }">
              <el-input-number v-model="row.days" />
@@ -216,9 +217,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '180px' : '200px'"
            field="monthProduceAllNum"
            title="月产出数量"
            min-width="200"
            :title="$t('plan.table.monthProduceAllNum')"
          >
            <!-- <template #edit="{ row }">
              <el-input-number v-model="row.monthProduceAllNum" disabled />
@@ -233,9 +234,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '150px' : '200px'"
            field="remark"
            title="备注"
            min-width="200"
            :title="$t('plan.table.remark')"
          >
          <!-- :edit-render="{ autoFocus: 'input' }" -->
            <!-- <template #edit="{ row }">
@@ -277,13 +278,13 @@
    <div class="box_container">
      <el-row>
        <el-col :span="!clickedTableRefGas?22:20">
          <div class="title_text">气柜规划产能</div>
          <div class="title_text">{{$t("plan.title.gasPlanCapacity")}}</div>
        </el-col>
        <el-col :span="1" v-if="!clickedTableRefGas">
          <el-button 
            class="title_btn"
            type="default"
            @click="editRowEventGas" >编辑</el-button>
            @click="editRowEventGas" >{{$t("common.common.edit")}}</el-button>
        </el-col>
        <el-col :span="1.8" v-if="clickedTableRefGas">
          <el-button
@@ -292,14 +293,14 @@
            @click="saveRowEvent1"
            v-hasPermi="['aps:gasPipelineCapacityPlan:add']"
          >
            ä¿å­˜
            {{$t("common.common.save")}}
          </el-button>
        </el-col>
        <el-col :span="1" v-if="clickedTableRefGas"> 
          <el-button 
            class="title_btn ml20"
            type="default"
            @click="handleCancleStausGas">取消</el-button>
            @click="handleCancleStausGas">{{$t("common.common.cancel")}}</el-button>
        </el-col>
      </el-row>
      <div class="tabel_container">
@@ -318,15 +319,15 @@
          size="small"
          :loading="loading2"
          :height="height"
          :edit-config="{ mode: 'row', trigger: 'click', showStatus: true }"
          :column-config="{ resizable: true, useKey: true }"
          :data="gasPlanList"
        >
          <vxe-column field="processName" title="标准工序名称" min-width="150" fixed="left">
          <vxe-column :width="locale === 'zh' ? '150px' : '200px'" field="processName" :title="$t('plan.table.satndardProcessName')" fixed="left">
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '150px' : '200px'"
            field="dayProduceType"
            title="日产出类型"
            min-width="160"
            :title="$t('plan.table.dayProduceType')"
          >
            <!-- <template #edit="{ row }">
              <el-select
@@ -366,9 +367,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '180px' : '200px'"
            field="dayProduceNum"
            title="日产出数量"
            min-width="200"
           :title="$t('plan.table.dayProduceNum')"
          >
            <!-- <template #edit="{ row }">
              <el-input-number v-model="row.dayProduceNum" size="mini" />
@@ -383,9 +384,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '150px' : '200px'"
            field="dayProduceUnit"
            title="日产出单位"
            min-width="200"
            :title="$t('plan.table.dayProduceUnit')"
          >
            <!-- <template #edit="{ row }">
              <el-input v-model="row.dayProduceUnit" />
@@ -400,9 +401,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '180px' : '200px'"
            field="personnelNumber"
            title="人员数量"
            min-width="200"
            :title="$t('plan.table.personnelNumber')"
          >
            <!-- <template #edit="{ row }">
              <el-input-number v-model="row.personnelNumber" />
@@ -417,9 +418,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '180px' : '200px'"
            field="dayProduceAllNum"
            title="日产出总数量"
            min-width="200"
            :title="$t('plan.table.dayProduceAllNum')"
          >
            <!-- <template #edit="{ row }">
              <el-input-number v-model="row.dayProduceAllNum" disabled />
@@ -434,9 +435,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '180px' : '200px'"
            field="days"
            title="天数"
            min-width="200"
            :title="$t('plan.table.days')"
          >
            <!-- <template #edit="{ row }">
              <el-input-number v-model="row.days" />
@@ -451,9 +452,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '180px' : '200px'"
            field="monthProduceAllNum"
            title="月产出数量"
            min-width="200"
            :title="$t('plan.table.monthProduceAllNum')"
          >
            <!-- <template #edit="{ row }">
              <el-input-number v-model="row.monthProduceAllNum" disabled />
@@ -468,9 +469,9 @@
            </template>
          </vxe-column>
          <vxe-column
            :width="locale === 'zh' ? '150px' : '200px'"
            field="remark"
            title="备注"
            min-width="200"
            :title="$t('plan.table.remark')"
          >
            <!-- <template #edit="{ row }">
              <el-input
@@ -517,6 +518,8 @@
import { ElMessage } from "element-plus";
import { listGasPlan, getGasPlanSave } from "@/api/mainPlan/gasPlanning";
const height = ref(document.documentElement.clientHeight - 400 + "px;");
import { useI18n } from "vue-i18n"; //要在js中使用国际化
const { t, locale } = useI18n();
const loading = ref(false);
const loading2 = ref(false);
const clickedQuery = ref(false);
@@ -644,7 +647,7 @@
  const $table = tableRef.value;
  if ($table) {
    $table.clearEdit().then(() => {
      // loading.value = true
      loading.value = true
      // setTimeout(() => {
      //   loading.value = false
      //   VxeUI.modal.message({ content: `保存成功!name=${row.name}`, status: 'success' })
@@ -722,12 +725,12 @@
//   }
// };
async function getRouteList(year, month) {
  loading.value = true;
  const res = await listGasPlan({
    major: "管路",
    year,
    month,
  });
  console.log(res.rows, "getList");
  routePlanList.value = res.rows;
  routePlanList.value = routePlanList.value.map((item, index) => {
    return {
@@ -753,6 +756,7 @@
  loading.value = false;
}
async function getGasList(year, month) {
  loading2.value = true;
  const res = await listGasPlan({
    major: "气柜",
    year,
@@ -793,7 +797,6 @@
//   row.monthProduceAllNum = row.dayProduceAllNum * row.days;
// }
function cellClickEvent(e, row) {
  console.log(row,"cellClickEvent")
  if(row.dayProduceType==="1"){
    row.dayProduceAllNum = row.dayProduceNum * row.personnelNumber;
  }else{
@@ -863,47 +866,45 @@
    message: "数据保存成功",
    type: "success",
  });
  loading.value = false;
  loading2.value = false;
  handleQuery();
}
async function handleSave2(row) {
  const year = queryParams.value.date.split("-")[0];
  const month = parseInt(queryParams.value.date.split("-")[1]);
  console.log(row, "baocun");
  // gasPlanList.value = gasPlanList.value.map((item) => {
  //   return {
  //     ...item,
  //     major: "气体",
  //     year,
  //     month,
  //   };
  // });
  // routePlanList.value = routePlanList.value.map((item) => {
  //   return {
  //     ...item,
  //     major: "管路",
  //     year,
  //     month,
  //   };
  // });
  const res = await getGasPlanSave([
    {
      ...row,
      major: "气柜",
      year,
      month,
    },
  ]);
  ElMessage({
    message: "数据保存成功",
    type: "success",
  });
  handleQuery();
  console.log(res, "akiwjciwj");
}
onMounted(() => {
  // getRouteList();
  // getGasList();
});
// async function handleSave2(row) {
//   const year = queryParams.value.date.split("-")[0];
//   const month = parseInt(queryParams.value.date.split("-")[1]);
//   console.log(row, "baocun");
//   // gasPlanList.value = gasPlanList.value.map((item) => {
//   //   return {
//   //     ...item,
//   //     major: "气体",
//   //     year,
//   //     month,
//   //   };
//   // });
//   // routePlanList.value = routePlanList.value.map((item) => {
//   //   return {
//   //     ...item,
//   //     major: "管路",
//   //     year,
//   //     month,
//   //   };
//   // });
//   const res = await getGasPlanSave([
//     {
//       ...row,
//       major: "气柜",
//       year,
//       month,
//     },
//   ]);
//   ElMessage({
//     message: "数据保存成功",
//     type: "success",
//   });
//   handleQuery();
//   console.log(res, "akiwjciwj");
// }
</script>
<style lang="scss" scoped>
.box_container {
src/views/mainPlan/gasProduceStatics/index.vue
@@ -6,10 +6,10 @@
      ref="queryRef"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
      :label-width="locale === 'zh' ? '68px' : '134px'"
    >
      <el-row type="flex" justify="left">
        <el-form-item label="统计方式">
        <el-form-item :label="$t('plan.query.statistical')">
          <el-select
            v-model="queryParams.searchType"
            style="width: 200px"
@@ -24,30 +24,32 @@
            />
          </el-select>
        </el-form-item>
        <el-form-item label="选择区间">
        <el-form-item :label="$t('plan.query.selectDateRange')">
          <div v-if="!dayCom">
            <el-date-picker
              v-model="queryParams.monthRange"
              type="monthrange"
              range-separator="至"
              start-placeholder="选择开始月份"
              end-placeholder="选择结束月份"
              :range-separator="$t('plan.placeholder.to')"
              :start-placeholder="$t('plan.placeholder.startMonth')"
              :end-placeholder="$t('plan.placeholder.endMonth')"
            />
          </div>
          <div v-else>
            <el-date-picker
              v-model="queryParams.monthDays"
              type="month"
              placeholder="选择月份"
              :placeholder="$t('plan.placeholder.selectMonth')"
            />
          </div>
        </el-form-item>
        <el-form-item class="column-with-margin">
          <el-button type="primary" icon="Search" @click="handleQuery"
            >查询</el-button
          >
          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
          <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-row>
    </el-form>
@@ -59,18 +61,19 @@
          icon="Download"
          @click="handleExport"
          v-hasPermi="['aps:apsGasPipingRouteStat:exportExcel']"
          >导出</el-button
          :disabled="loading"
          >{{ $t("common.common.export") }}</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="info"
          type="success"
          plain
          icon="Refresh"
          @click="handleRefresh"
          v-hasPermi="['aps:apsGasPipingRouteStat:computeCapacity']"
          :disabled="loading"
          >更新</el-button
          >{{ $t("common.common.update") }}</el-button
        >
      </el-col>
      <right-toolbar @queryTable="handleQuery" :search="false"></right-toolbar>
@@ -87,6 +90,8 @@
import { ref } from "vue";
import * as XLSX from "xlsx";
import { ElMessage } from "element-plus";
import { useI18n } from "vue-i18n"; //要在js中使用国际化
const { t, locale } = useI18n();
const { proxy } = getCurrentInstance();
const loading = ref(false);
@@ -99,20 +104,11 @@
  queryParams: {
    monthRange: "",
    monthDays: "",
    searchType: "按月统计",
    searchType: t("plan.options.monthlyStatic"),
  },
});
let searchTypeValue = ref("month");
const options = [
  {
    value: "month",
    label: "按月统计",
  },
  {
    value: "day",
    label: "按日统计",
  },
];
let options = ref([]);
const { queryParams } = toRefs(data);
const gridOptions = reactive({
  border: true,
@@ -140,6 +136,26 @@
let tableColumn = [];
let tableData = [];
let merges = [];
watch(locale, (newLocale) => {
  options.value = [
    {
      value: "month",
      label: t("plan.options.monthlyStatic"),
    },
    {
      value: "day",
      label: t("plan.options.dailyStatic"),
    },
  ];
  queryParams.value.searchType = t("plan.options.monthlyStatic");
  if (
    (!queryParams.value.monthRange && dayCom.value == false) ||
    (!queryParams.value.monthDays && dayCom.value == true)
  ) {
    return;
  }
  getGasList();
},{ immediate: true, deep: true });
function handleChangeSelectType(e) {
  searchTypeValue.value = e;
  if (e === "day") {
@@ -197,16 +213,16 @@
        loading.value = false;
        return;
      }
      headersOne.push("日期");
      headersTwo.push("工序名称");
      headersOne.push(t("plan.table.dateYearMonth"));
      headersTwo.push(t("plan.table.processName"));
      colList.push({
        field: "dateCol",
        title: "日期",
        title: t("plan.table.dateYearMonth"),
        fixed: "left",
        children: [
          {
            field: `resourceName`,
            title: "工序名称",
            title: t("plan.table.processName"),
            width: 250,
            type: "html",
          },
@@ -217,19 +233,27 @@
        headersOne.push(item);
        headersOne.push("");
        headersOne.push("");
        headersTwo.push("设计产能");
        headersTwo.push("需求产能");
        headersTwo.push("产能负载");
        headersTwo.push(t("plan.table.designWorkingHours"));
        headersTwo.push(t("plan.table.requiredWorkingHours"));
        headersTwo.push(t("plan.table.capacityLoad"));
        colKey++;
        colList.push({
          field: `dateColTime${colKey}`,
          title: item,
          children: [
            { field: `designTimes${colKey}`, title: "设计产能", width: 80 },
            { field: `requireTimes${colKey}`, title: "需求产能", width: 80 },
            {
              field: `designTimes${colKey}`,
              title: t("plan.table.designWorkingHours"),
              width: 80,
            },
            {
              field: `requireTimes${colKey}`,
              title: t("plan.table.requiredWorkingHours"),
              width: 80,
            },
            {
              field: `capacityLoad${colKey}`,
              title: "产能负载",
              title: t("plan.table.capacityLoad"),
              width: 80,
              type: "html",
            },
@@ -264,7 +288,11 @@
            tableKey++;
            item[`designTimes${tableKey}`] = listItem.designTimes;
            item[`requireTimes${tableKey}`] = listItem.requireTimes;
            item[`capacityLoad${tableKey}`] = formatCapacityLoad(listItem.designTimes,listItem.requireTimes,listItem.capacityLoad)
            item[`capacityLoad${tableKey}`] = formatCapacityLoad(
              listItem.designTimes,
              listItem.requireTimes,
              listItem.capacityLoad
            );
            data.push(listItem.designTimes);
            data.push(listItem.requireTimes);
            data.push(listItem.capacityLoad + "%");
@@ -295,23 +323,23 @@
    }
  });
}
function formatCapacityLoad(designTimes,requireTimes,capacityLoad){
function formatCapacityLoad(designTimes, requireTimes, capacityLoad) {
  /**
   * // 0-100 ç»¿è‰²ï¼Œ101-120黄色,大于120红色
    listItem.capacityLoad <= 100
      ? `<font color="red">${listItem.capacityLoad}%</font>`
      : listItem.capacityLoad + "%";
   */
  if(designTimes>0&&capacityLoad>0&&capacityLoad<=100){
    return `<font color="#85cf60">${capacityLoad}%</font>`
  }else if(designTimes>0&&capacityLoad>101&&capacityLoad<=120){
    return `<font color="#ecb869">${capacityLoad}%</font>`
  }else if(designTimes>0&&capacityLoad>120){
    return `<font color="#f89c9c">${capacityLoad}%</font>`
  }else if(designTimes==0&&requireTimes>0){
    return `<font color="#f56c6c">error</font>`
  }else{
    return `${capacityLoad}%`
  if (designTimes > 0 && capacityLoad > 0 && capacityLoad <= 100) {
    return `<font color="#85cf60">${capacityLoad}%</font>`;
  } else if (designTimes > 0 && capacityLoad > 101 && capacityLoad <= 120) {
    return `<font color="#ecb869">${capacityLoad}%</font>`;
  } else if (designTimes > 0 && capacityLoad > 120) {
    return `<font color="#f89c9c">${capacityLoad}%</font>`;
  } else if (designTimes == 0 && requireTimes > 0) {
    return `<font color="#f56c6c">error</font>`;
  } else {
    return `${capacityLoad}%`;
  }
}
/** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
@@ -321,7 +349,7 @@
    (!queryParams.value.monthDays && dayCom.value == true)
  ) {
    ElMessage({
      message: "请选择年月",
      message: t("plan.message.errorMonthEmpty"),
      type: "error",
    });
    return;
@@ -348,7 +376,7 @@
    (!queryParams.value.monthDays && dayCom.value == true)
  ) {
    ElMessage({
      message: "请选择年月",
      message: t("plan.message.errorMonthEmpty"),
      type: "error",
    });
    return;
@@ -362,7 +390,7 @@
  queryParams.value.monthRange = "";
  queryParams.value.monthDays = "";
  dayCom.value = false;
  (queryParams.value.searchType = "按月统计"),
  (queryParams.value.searchType = t("plan.options.monthlyStatic")),
    (searchTypeValue.value = "month");
  tableData = [];
  const $grid = gridRef.value;
@@ -379,7 +407,7 @@
    (!queryParams.value.monthDays && dayCom.value == true)
  ) {
    ElMessage({
      message: "请选择年月",
      message: t("plan.message.errorMonthEmpty"),
      type: "error",
    });
    return;
@@ -389,7 +417,7 @@
    major: "gas",
  }).then((response) => {
    ElMessage({
      message: "数据更新成功",
      message: t("plan.message.update"),
      type: "success",
    });
    loading.value = false;
src/views/mainPlan/pipeProduceStatics/index.vue
@@ -6,10 +6,10 @@
      ref="queryRef"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
      :label-width="locale === 'zh' ? '68px' : '134px'"
    >
      <el-row type="flex" justify="left">
        <el-form-item label="统计方式">
        <el-form-item :label="$t('plan.query.statistical')">
          <el-select
            v-model="queryParams.searchType"
            style="width: 200px"
@@ -24,30 +24,32 @@
            />
          </el-select>
        </el-form-item>
        <el-form-item label="选择区间">
        <el-form-item :label="$t('plan.query.selectDateRange')">
          <div v-if="!dayCom">
            <el-date-picker
              v-model="queryParams.monthRange"
              type="monthrange"
              range-separator="至"
              start-placeholder="选择开始月份"
              end-placeholder="选择结束月份"
              :range-separator="$t('plan.placeholder.to')"
              :start-placeholder="$t('plan.placeholder.startMonth')"
              :end-placeholder="$t('plan.placeholder.endMonth')"
            />
          </div>
          <div v-else>
            <el-date-picker
              v-model="queryParams.monthDays"
              type="month"
              placeholder="选择月份"
              :placeholder="$t('plan.placeholder.selectMonth')"
            />
          </div>
        </el-form-item>
        <el-form-item class="column-with-margin">
          <el-button type="primary" icon="Search" @click="handleQuery"
            >查询</el-button
          >
          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
          <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-row>
    </el-form>
@@ -59,31 +61,27 @@
          icon="Download"
          @click="handleExport"
          v-hasPermi="['aps:apsGasPipingRouteStat:exportExcel']"
          >导出</el-button
          >{{ $t("common.common.export") }}</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="info"
          type="success"
          plain
          icon="Refresh"
          @click="handleRefresh"
          v-hasPermi="['aps:apsGasPipingRouteStat:computeCapacity']"
          :disabled="loading"
          >更新</el-button
          >{{ $t("common.common.update") }}</el-button
        >
      </el-col>
      <right-toolbar @queryTable="handleQuery" :search="false"></right-toolbar>
    </el-row>
    <!-- <div class="box_container"> -->
      <!-- <div class="title_text">管路规划产能负载统计</div> -->
      <!-- <div class="tabel_container"> -->
        <vxe-grid
          ref="gridRef"
          v-bind="gridOptions"
          :loading="loading"
        ></vxe-grid>
      <!-- </div> -->
    <!-- <div class="title_text">管路规划产能负载统计</div> -->
    <!-- <div class="tabel_container"> -->
    <vxe-grid ref="gridRef" v-bind="gridOptions" :loading="loading"></vxe-grid>
    <!-- </div> -->
    <!-- </div> -->
  </div>
</template>
@@ -96,6 +94,8 @@
import { ref } from "vue";
import * as XLSX from "xlsx";
import { ElMessage } from "element-plus";
import { useI18n } from "vue-i18n"; //要在js中使用国际化
const { t, locale } = useI18n();
const { proxy } = getCurrentInstance();
const loading = ref(false);
@@ -108,20 +108,11 @@
  queryParams: {
    monthRange: "",
    monthDays: "",
    searchType: "按月统计",
    searchType: t("plan.options.monthlyStatic"),
  },
});
let searchTypeValue = ref("month");
const options = [
  {
    value: "month",
    label: "按月统计",
  },
  {
    value: "day",
    label: "按日统计",
  },
];
let options = ref([]);
const { queryParams } = toRefs(data);
const gridOptions = reactive({
  border: true,
@@ -149,6 +140,31 @@
let tableColumn = [];
let tableData = [];
let merges = [];
watch(
  locale,
  (newLocale) => {
    options.value = [
      {
        value: "month",
        label: t("plan.options.monthlyStatic"),
      },
      {
        value: "day",
        label: t("plan.options.dailyStatic"),
      },
    ];
    queryParams.value.searchType = t("plan.options.monthlyStatic");
    if (
      (!queryParams.value.monthRange && dayCom.value == false) ||
      (!queryParams.value.monthDays && dayCom.value == true)
    ) {
      return;
    }
    // queryParams.value.pageNum = 1;
    getPipeList();
  },
  { immediate: true, deep: true }
);
function handleChangeSelectType(e) {
  searchTypeValue.value = e;
  if (e === "day") {
@@ -199,7 +215,6 @@
    searchType: searchTypeValue.value,
    major: "piping",
  }).then((response) => {
    console.log(response.data.planTable, "responseresponseresponse");
    const colList = [];
    let headersOne = [];
    let headersTwo = [];
@@ -208,16 +223,16 @@
        loading.value = false;
        return;
      }
      headersOne.push("日期");
      headersTwo.push("工序名称");
      headersOne.push(t("plan.table.dateYearMonth"));
      headersTwo.push(t("plan.table.processName"));
      colList.push({
        field: "dateCol",
        title: "日期",
        title: t("plan.table.dateYearMonth"),
        fixed: "left",
        children: [
          {
            field: `resourceName`,
            title: "工序名称",
            title: t("plan.table.processName"),
            width: 250,
            type: "html",
          },
@@ -228,19 +243,27 @@
        headersOne.push(item);
        headersOne.push("");
        headersOne.push("");
        headersTwo.push("设计产能");
        headersTwo.push("需求产能");
        headersTwo.push("产能负载");
        headersTwo.push(t("plan.table.designWorkingHours"));
        headersTwo.push(t("plan.table.requiredWorkingHours"));
        headersTwo.push(t("plan.table.capacityLoad"));
        colKey++;
        colList.push({
          field: `dateColTime${colKey}`,
          title: item,
          children: [
            { field: `designTimes${colKey}`, title: "设计产能", width: 80 },
            { field: `requireTimes${colKey}`, title: "需求产能", width: 80 },
            {
              field: `designTimes${colKey}`,
              title: t("plan.table.designWorkingHours"),
              width: 80,
            },
            {
              field: `requireTimes${colKey}`,
              title: t("plan.table.requiredWorkingHours"),
              width: 80,
            },
            {
              field: `capacityLoad${colKey}`,
              title: "产能负载",
              title: t("plan.table.capacityLoad"),
              width: 80,
              type: "html",
            },
@@ -275,11 +298,15 @@
            tableKey++;
            item[`designTimes${tableKey}`] = listItem.designTimes;
            item[`requireTimes${tableKey}`] = listItem.requireTimes;
            item[`capacityLoad${tableKey}`] = formatCapacityLoad(listItem.designTimes,listItem.requireTimes,listItem.capacityLoad)
            item[`capacityLoad${tableKey}`] = formatCapacityLoad(
              listItem.designTimes,
              listItem.requireTimes,
              listItem.capacityLoad
            );
            // 0-100 ç»¿è‰²ï¼Œ101-120黄色,大于120红色
              // listItem.capacityLoad <= 100
              //   ? `<font color="red">${listItem.capacityLoad}%</font>`
              //   : listItem.capacityLoad + "%";
            // listItem.capacityLoad <= 100
            //   ? `<font color="red">${listItem.capacityLoad}%</font>`
            //   : listItem.capacityLoad + "%";
            data.push(listItem.designTimes);
            data.push(listItem.requireTimes);
            data.push(listItem.capacityLoad + "%");
@@ -291,7 +318,7 @@
          // item[`resourceName`] = flag
          //   ? `<div class='el-badge'><sup class="el-badge__content is-fixed is-dot"></sup>${key}</div>`
          //   : key;
          item[`resourceName`] =  key;
          item[`resourceName`] = key;
        }
        exportData.value.push(data);
        dataList.push(item);
@@ -310,23 +337,23 @@
    }
  });
}
function formatCapacityLoad(designTimes,requireTimes,capacityLoad){
function formatCapacityLoad(designTimes, requireTimes, capacityLoad) {
  /**
   * // 0-100 ç»¿è‰²ï¼Œ101-120黄色,大于120红色
    listItem.capacityLoad <= 100
      ? `<font color="red">${listItem.capacityLoad}%</font>`
      : listItem.capacityLoad + "%";
   */
  if(designTimes>0&&capacityLoad>0&&capacityLoad<=100){
    return `<font color="#85cf60">${capacityLoad}%</font>`
  }else if(designTimes>0&&capacityLoad>101&&capacityLoad<=120){
    return `<font color="#ecb869">${capacityLoad}%</font>`
  }else if(designTimes>0&&capacityLoad>120){
    return `<font color="#f89c9c">${capacityLoad}%</font>`
  }else if(designTimes==0&&requireTimes>0){
    return `<font color="#f56c6c">error</font>`
  }else{
    return `${capacityLoad}%`
  if (designTimes > 0 && capacityLoad > 0 && capacityLoad <= 100) {
    return `<font color="#85cf60">${capacityLoad}%</font>`;
  } else if (designTimes > 0 && capacityLoad > 101 && capacityLoad <= 120) {
    return `<font color="#ecb869">${capacityLoad}%</font>`;
  } else if (designTimes > 0 && capacityLoad > 120) {
    return `<font color="#f89c9c">${capacityLoad}%</font>`;
  } else if (designTimes == 0 && requireTimes > 0) {
    return `<font color="#f56c6c">error</font>`;
  } else {
    return `${capacityLoad}%`;
  }
}
/** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
@@ -336,7 +363,7 @@
    (!queryParams.value.monthDays && dayCom.value == true)
  ) {
    ElMessage({
      message: "请选择年月",
      message: t("plan.message.errorMonthEmpty"),
      type: "error",
    });
    return;
@@ -363,7 +390,7 @@
    (!queryParams.value.monthDays && dayCom.value == true)
  ) {
    ElMessage({
      message: "请选择年月",
      message: t("plan.message.errorMonthEmpty"),
      type: "error",
    });
    return;
@@ -377,7 +404,7 @@
  queryParams.value.monthRange = "";
  queryParams.value.monthDays = "";
  dayCom.value = false;
  (queryParams.value.searchType = "按月统计"),
  (queryParams.value.searchType = t("plan.options.monthlyStatic")),
    (searchTypeValue.value = "month");
  tableData = [];
  const $grid = gridRef.value;
@@ -394,7 +421,7 @@
    (!queryParams.value.monthDays && dayCom.value == true)
  ) {
    ElMessage({
      message: "请选择年月",
      message: t("plan.message.errorMonthEmpty"),
      type: "error",
    });
    return;
@@ -404,7 +431,7 @@
    major: "piping",
  }).then((response) => {
    ElMessage({
      message: "数据更新成功",
      message: t("plan.message.update"),
      type: "success",
    });
    loading.value = false;
src/views/mainPlan/platePlan/index.vue
@@ -1,90 +1,111 @@
<template>
  <div class="app-container">
    <el-row :gutter="20"> <el-col>
    <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="计划开工日" style="width: 100%;">
    <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('plan.query.daterangePlanStartDay')">
          <el-date-picker
              v-model="daterangePlanStartDay"
              value-format="YYYY-MM-DD"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            style="width: 240px"
            v-model="daterangePlanStartDay"
            value-format="YYYY-MM-DD"
            type="daterange"
            range-separator="-"
            :start-placeholder="$t('plan.placeholder.startDate')"
            :end-placeholder="$t('plan.placeholder.endDate')"
          ></el-date-picker>
        </el-form-item>
        </el-col>
        <el-col :span="6">
        <el-form-item label="计划完工日" style="width: 100%;">
        <!-- </el-col>
        <el-col :span="6"> -->
        <el-form-item :label="$t('plan.query.daterangePlanEndDay')">
          <el-date-picker
              v-model="daterangePlanEndDay"
              value-format="YYYY-MM-DD"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            style="width: 240px"
            v-model="daterangePlanEndDay"
            value-format="YYYY-MM-DD"
            type="daterange"
            range-separator="-"
            :start-placeholder="$t('plan.placeholder.startDate')"
            :end-placeholder="$t('plan.placeholder.endDate')"
          ></el-date-picker>
        </el-form-item>
        </el-col>
        <el-col :span="6">
        <el-form-item label="单据号" prop="documentNumber" style="width: 100%;">
        <!-- </el-col>
        <el-col :span="6"> -->
        <el-form-item
          :label="$t('plan.query.documentNumber')"
          prop="documentNumber"
        >
          <el-input
              v-model="queryParams.documentNumber"
              placeholder="请输入单据号"
              clearable
              @keyup.enter="handleQuery"
            style="width: 240px"
            v-model="queryParams.documentNumber"
            :placeholder="$t('plan.placeholder.documentNumber')"
            clearable
            @keyup.enter="handleQuery"
          />
        </el-form-item>
        </el-col>
        <el-col :span="6">
        <el-form-item label="客户名称" prop="customer" style="width: 100%;">
        <!-- </el-col>
        <el-col :span="6"> -->
        <el-form-item :label="$t('plan.query.customer')" prop="customer">
          <el-input
              v-model="queryParams.customer"
              placeholder="请输入客户名称"
              clearable
              @keyup.enter="handleQuery"
            style="width: 240px"
            v-model="queryParams.customer"
            :placeholder="$t('plan.placeholder.customer')"
            clearable
            @keyup.enter="handleQuery"
          />
        </el-form-item>
        </el-col>
        <el-col  :span="24"  style="text-align: right;">
        <!-- </el-col>
        <el-col  :span="24"  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-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-col> -->
        <!-- </el-row> -->
      </el-form>
    </el-col> </el-row>
    </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']"
        >批量修改计划开工日</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']"
        >批量修改计划完工日</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']"
        >导入</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
@@ -93,122 +114,167 @@
          icon="Download"
          @click="handleExport"
          v-hasPermi="['apsPlatePlan: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 { 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 { 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 exampleList = ref([]);
const planList = ref([]);
const loading = ref(true);
@@ -218,14 +284,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({
@@ -238,406 +303,502 @@
  // æ˜¯å¦æ›´æ–°å·²ç»å­˜åœ¨çš„用户数据
  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 exampleColumns = ref([
  { type: 'seq', title: '序号', 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: '主件料号',
    field: 'mainPartNumber',
    width: 150,
  },
  {
    title: '主件图号',
    field: 'mainPartDrawingNumber',
    width: 150,
  },
  {
    title: '客户名称',
    field: 'customer',
    width: 200,
  },
  {
    title: '业务类型',
    field: 'businessType',
    width: 150,
  },
  {
    title: '单据号',
    field: 'documentNumber',
    width: 150,
  },
  {
    title: '需求分类',
    field: 'requirementType',
    width: 150,
  },
  {
    title: '单据状态',
    field: 'documentStatus',
    width: 100,
  },
  {
    title: '料号',
    field: 'itemNumber',
    width: 150,
  },
  {
    title: '图号',
    field: 'drawingNo',
    width: 150,
  },
  {
    title: '版本号',
    field: 'versionNumber',
    width: 100,
  },
  {
    title: '生产数量',
    field: 'productionQuantity',
    width: 100,
  },
  {
    title: '良品数量',
    field: 'goodProductsQuantity',
    width: 100,
  },
  {
    title: '工序号',
    field: 'processNumber',
    width: 150,
  },
  {
    title: '工作中心',
    field: 'workCenter',
    width: 150,
  },
  {
    title: '所属部门',
    field: 'department',
    width: 100,
  },
  {
    title: '计划开工日',
    field: 'planStartDay',
    width: 100,
  },
  {
    title: '计划完工日',
    field: 'planEndDay',
    width: 100,
  },
  {
    title: '备料料号',
    field: 'standbyNumber',
    width: 100,
  },
  {
    title: '备料名称',
    field: 'standbyName',
    width: 200,
  },
  {
    title: '备料库存',
    field: 'standbyStock',
    width: 100,
  },
  {
    title: '下道工序所属部门',
    field: 'nextProcessDeparment',
    width: 180,
  },
  {
    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: 150,
  // },
  // {
  //   title: '计划齐套',
  //   field: 'isPlanComplete',
  //   width: 100,
  // },
  // {
  //   title: '库存齐套',
  //   field: 'isStockComplete',
  //   width: 100,
  // },
  // {
  //   title: '是否有折返工序',
  //   field: 'hasTurnback',
  //   width: 150,
  // },
  // {
  //   title: '风险标识',
  //   field: 'hasRisk',
  //   width: 100,
  // },
]);
// è¡¨æ ¼é…ç½®
const columns = ref([
  { field: 'expand', type: 'expand', width: 60, align: 'center', slots: { content: 'expandContent' } },
  { type: 'checkbox', width: 60, align:"center"},
  { type: 'seq', title: '序号', 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: '主件料号',
    field: 'mainPartNumber',
    width: 150,
  },
  // {
  //   title: '主件图号',
  //   field: 'mainPartDrawingNumber',
  //   width: 150,
  // },
  // {
  //   title: '客户名称',
  //   field: 'customer',
  //   width: 200,
  // },
  {
    title: '业务类型',
    field: 'businessType',
    width: 100,
  },
  {
    title: '单据号',
    field: 'documentNumber',
    width: 140,
  },
  {
    title: '需求分类',
    field: 'requirementType',
    width: 100,
  },
  {
    title: '单据状态',
    field: 'documentStatus',
    width: 100,
  },
  {
    title: '料号',
    field: 'itemNumber',
    width: 100,
  },
  {
    title: '图号',
    field: 'drawingNo',
    width: 100,
  },
  // {
  //   title: '版本号',
  //   field: 'versionNumber',
  //   width: 100,
  // },
  {
    title: '生产数量',
    field: 'productionQuantity',
    width: 100,
  },
  // {
  //   title: '良品数量',
  //   field: 'goodProductsQuantity',
  //   width: 100,
  // },
  {
    title: '工序号',
    field: 'processNumber',
    width: 100,
  },
  {
    title: '工作中心',
    field: 'workCenter',
    width: 180,
  },
  // {
  //   title: '所属部门',
  //   field: 'department',
  //   width: 100,
  // },
  // {
  //   title: '计划开工日',
  //   field: 'planStartDay',
  //   width: 100,
  // },
  {
    title: '计划完工日',
    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,
  // },
]);
const data = reactive({
  form: {},
  queryParams: {
    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);
const exampleColumns = ref([]);
const columns = ref([]);
const subGridOptions = ref({
  border: true,
  showOverflow: true,
  columns: [],
});
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" },
      },
      { 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: 150,
      },
      // {
      //   title: '主件图号',
      //   field: 'mainPartDrawingNumber',
      //   width: 150,
      // },
      // {
      //   title: '客户名称',
      //   field: 'customer',
      //   width: 200,
      // },
      {
        title: t("plan.table.businessType"),
        field: "businessType",
        width: 100,
      },
      {
        title: t("plan.table.documentNumber"),
        field: "documentNumber",
        width: 140,
      },
      {
        title: t("plan.table.requirementType"),
        field: "requirementType",
        width: 100,
      },
      {
        title: t("plan.table.documentStatus"),
        field: "documentStatus",
        width: 100,
      },
      {
        title: t("plan.table.itemNumber"),
        field: "itemNumber",
        width: 100,
      },
      {
        title: t("plan.table.drawingNo"),
        field: "drawingNo",
        width: 100,
      },
      // {
      //   title: '版本号',
      //   field: 'versionNumber',
      //   width: 100,
      // },
      {
        title: t("plan.table.productionQuantity"),
        field: "productionQuantity",
        width: 100,
      },
      // {
      //   title: '良品数量',
      //   field: 'goodProductsQuantity',
      //   width: 100,
      // },
      {
        title: t("plan.table.processNumber"),
        field: "processNumber",
        width: 100,
      },
      {
        title: t("plan.table.factoryCenter"),
        field: "workCenter",
        width: 180,
      },
      // {
      //   title: '所属部门',
      //   field: 'department',
      //   width: 100,
      // },
      // {
      //   title: '计划开工日',
      //   field: 'planStartDay',
      //   width: 100,
      // },
      {
        title: t("plan.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("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",
      },
    ];
    getList();
  },
  { 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;
@@ -648,15 +809,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;
  });
@@ -682,38 +845,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) => {
@@ -722,15 +888,24 @@
/** æ–‡ä»¶ä¸Šä¼ æˆåŠŸå¤„ç† */
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;
@@ -740,7 +915,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;
@@ -748,15 +923,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();
  }
@@ -768,98 +943,101 @@
}
/*定义下拉二级表*/
const subGridOptions = reactive({
  border: true,
  showOverflow: true,
  columns: [
    {
      title: '料号',
      field: 'itemNo',
      width: 150,
      align:"center",
    },
    {
      title: '工单号',
      field: 'workOrderNo',
      width: 150,
      align:"center",
    },
    {
      title: '工序序号',
      field: 'processNumber',
      width: 100,
      align:"center",
    },
    {
      title: '工序名称',
      field: 'processName',
      width: 150,
      align:"center",
    },
    {
      title: '工序计划开始日期',
      field: 'processPlanStartDay',
      width: 200,
      align:"center",
    },
    {
      title: '工序计划结束日期',
      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: '标准工时',
      field: 'standardTime',
      width: 90,
      align:"center",
    },
    {
      title: '工序排序',
      field: 'processOrder',
      width: 90,
      align:"center",
    },
    {
      title: '集成日期',
      field: 'integrationDay',
      width: 160,
      align:"center",
    }
  ]
})
// const subGridOptions = ref({
//   border: true,
//   showOverflow: true,
//   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: 100,
//       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: '工序计划结束日期',
//       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: '标准工时',
//       field: 'standardTime',
//       width: 90,
//       align:"center",
//     },
//     {
//       title: '工序排序',
//       field: 'processOrder',
//       width: 90,
//       align:"center",
//     },
//     {
//       title: '集成日期',
//       field: 'integrationDay',
//       width: 160,
//       align:"center",
//     }
//   ]
// })
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();
// getList();
</script>
<style lang="css" scoped>
h4 {
  font-weight: bold;
}
</style>
</style>
src/views/mainPlan/platePlanList/index.vue
@@ -40,17 +40,18 @@
          icon="Download"
          @click="handleExport"
          v-hasPermi="['plateProcessShopStat:export']"
          >导出</el-button
          >{{ $t(`common.common.export`) }}</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="Edit"
          icon="Refresh"
          @click="handleUpdate"
          :disabled="loading"
          v-hasPermi="['plateProcessShopStat:update']"
          >更新</el-button
          >{{ $t(`common.common.update`) }}</el-button
        >
      </el-col>
@@ -68,7 +69,7 @@
    >
    </HxlhTable>
    <!-- æ·»åŠ æˆ–ä¿®æ”¹é’£é‡‘ç»Ÿè®¡å¯¹è¯æ¡† -->
    <el-dialog :title="title" v-model="open" width="500px" append-to-body>
    <!-- <el-dialog :title="title" v-model="open" width="500px" append-to-body>
      <el-form
        ref="aps_plate_process_statRef"
        :model="form"
@@ -103,7 +104,7 @@
          <el-button @click="cancel">取 æ¶ˆ</el-button>
        </div>
      </template>
    </el-dialog>
    </el-dialog> -->
  </div>
</template>
@@ -116,8 +117,12 @@
import { getToken } from "@/utils/auth";
import { nextTick, onMounted, ref } from "vue";
import { ElMessage } from "element-plus";
import { useI18n } from "vue-i18n"; //要在js中使用国际化
// import i18n from "@/utils/i18n";
// const t = i18n.global.t
const { t, locale } = useI18n();
const { proxy } = getCurrentInstance();
// console.log(proxy.$i18n.locale, "indexPlanList");
const aps_plate_process_statList = ref([]);
const dynamicList = ref([]);
const generateColumnList = ref([]);
@@ -150,114 +155,117 @@
  // },
  // rules: {},
});
const columns = ref([]);
const xGrid = ref();
const { queryParams, form, rules } = toRefs(data);
// è¡¨æ ¼é…ç½®
const columns = ref([
  /*  { type: 'seq', title: '序号', width: 60 },*/
  {
    title: "主件料号",
    field: "mainPartNumber",
    width: 150,
    fixed: "left",
  },
  {
    title: "业务类型",
    field: "businessType",
    width: 120,
    fixed: "left",
  },
  {
    title: "单据号",
    field: "documentNumber",
    width: 160,
    fixed: "left",
  },
  {
    title: "需求分类",
    field: "requirementType",
    width: 100,
    fixed: "left",
  },
  {
    title: "单据状态",
    field: "documentStatus",
    width: 100,
    fixed: "left",
  },
  {
    title: "审核时间",
    field: "updateBy",
    width: 100,
  },
  {
    title: "当前工序",
    field: "workCenter",
    width: 200,
  },
  {
    title: "当前工序负责人",
    field: "department",
    width: 200,
  },
  {
    title: "当前工序状态",
    field: "opStatus",
    width: 200,
  },
  {
    title: "下一工序",
    field: "nextOpName",
    width: 100,
  },
  {
    title: "下一工序负责人",
    field: "nextProcessDeparment",
    width: 200,
  },
  {
    title: "料号",
    field: "itemNumber",
    width: 150,
    type: "html",
  },
  {
    title: "图号",
    field: "drawingNo",
    width: 150,
    // format: 'YYYY-MM-DD'
  },
  {
    title: "版本号",
    field: "versionNumber",
    width: 100,
    type: "html",
  },
  {
    title: "低阶码",
    field: "updateBy",
    width: 100,
  },
  {
    title: "生产数量",
    field: "productionQuantity",
    width: 100,
    type: "html",
  },
  {
    title: "工单计划下发时间",
    field: "updateBy",
    width: 200,
  },
  {
    title: "系统完工时间",
    field: "planEndDay",
    width: 150,
    format: "YYYY-MM-DD hh:mm:ss",
  },
]);
watch(locale, (newLocale) => {
  // é‡æ–°èŽ·å–ç¿»è¯‘æ–‡æœ¬
  // è¡¨æ ¼é…ç½®
  columns.value = [
    /*  { type: 'seq', title: '序号', width: 60 },*/
    {
      title: t("plan.table.mainPartNumber"),
      field: "mainPartNumber",
      width: 150,
      fixed: "left",
    },
    {
      title: t("plan.table.businessType"),
      field: "businessType",
      width: 120,
      fixed: "left",
    },
    {
      title: t("plan.table.documentNumber"),
      field: "documentNumber",
      width: 160,
      fixed: "left",
    },
    {
      title: t("plan.table.requirementType"),
      field: "requirementType",
      width: 100,
      fixed: "left",
    },
    {
      title: t("plan.table.documentStatus"),
      field: "documentStatus",
      width: 100,
      fixed: "left",
    },
    {
      title: t("plan.table.updateBy"),
      field: "updateBy",
      width: 100,
    },
    {
      title: t("plan.table.workCenter"),
      field: "workCenter",
      width: 200,
    },
    {
      title: t("plan.table.department"),
      field: "department",
      width: 200,
    },
    {
      title: t("plan.table.opStatus"),
      field: "opStatus",
      width: 200,
    },
    {
      title: t("plan.table.nextOpName"),
      field: "nextOpName",
      width: 100,
    },
    {
      title: t("plan.table.nextProcessDeparment"),
      field: "nextProcessDeparment",
      width: 200,
    },
    {
      title: t("plan.table.itemNumber"),
      field: "itemNumber",
      width: 150,
      type: "html",
    },
    {
      title: t("plan.table.drawingNo"),
      field: "drawingNo",
      width: 150,
      // format: 'YYYY-MM-DD'
    },
    {
      title: t("plan.table.versionNumber"),
      field: "versionNumber",
      width: 100,
      type: "html",
    },
    {
      title: t("plan.table.cheaperCode"),
      field: "cheaperCode",
      width: 100,
    },
    {
      title: t("plan.table.productionQuantity"),
      field: "productionQuantity",
      width: 100,
      type: "html",
    },
    {
      title: t("plan.table.planworkOrderTime"),
      field: "planworkOrderTime",
      width: 200,
    },
    {
      title: t("plan.table.planEndDay"),
      field: "planEndDay",
      width: 150,
      format: "YYYY-MM-DD hh:mm:ss",
    },
  ]
  getList();
},{immediate:true, deep:true});
/** æŸ¥è¯¢é’£é‡‘统计列表 */
async function getList() {
  loading.value = true;
@@ -279,7 +287,6 @@
      };
    }
  );
  console.log(aps_plate_process_statList.value, "resDataresDataresData");
  let newArray = [];
  newArray = dynamicList.value.flatMap((item, index) => [
    {
@@ -404,7 +411,7 @@
  listApsPlateProcessShopStatUpdate().then((response) => {
    // form.value = response.data;
    ElMessage({
      message: "数据更新成功",
      message: t("plan.message.update"),
      type: "success",
    });
    loading.value = false;
@@ -419,9 +426,10 @@
    `aps_plate_plan_list_${new Date().getTime()}.xlsx`
  );
}
getList();
// getList();
// onMounted(async () => {
//
//   await nextTick();
// });
</script>
<style lang="scss" scoped>
src/views/mainPlan/plateProcessStat/index.vue
@@ -1,75 +1,103 @@
<template>
  <div class="app-container">
    <el-row :gutter="20">
      <el-col>
        <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px">
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="工单号" prop="num">
                <el-input
                    v-model="queryParams.workOrderNo"
                    placeholder="请输入钣金计划工单号"
                    clearable
                    @keyup.enter="handleQuery"
                />
              </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-col>
    <el-row :gutter="10" class="mb8">
      <!-- <el-col> -->
      <el-form
        :model="queryParams"
        ref="queryRef"
        :inline="true"
        v-show="showSearch"
        :label-width="locale === 'zh' ? '60px' : '150px'"
        label-position="left"
      >
        <!-- <el-row :gutter="20">
            <el-col :span="12"> -->
        <el-form-item :label="$t('plan.query.workOrderNo')" prop="num">
          <el-input
            style="width: 370px"
            v-model="queryParams.workOrderNo"
            :placeholder="$t('plan.placeholder.planWorkOderNO')"
            clearable
            @keyup.enter="handleQuery"
          />
        </el-form-item>
        <!-- </el-col>
            <el-col  :span="12"  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-col> -->
    </el-row>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
            type="warning"
            plain
            icon="Download"
            @click="handleExport"
            v-hasPermi="['apsPlateProcessStat:export']"
        >导出</el-button>
          type="warning"
          plain
          icon="Download"
          @click="handleExport"
          v-hasPermi="['apsPlateProcessStat:export']"
          >{{ $t("common.common.export") }}</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
            type="success"
            plain
            icon="Edit"
            @click="handleUpdate"
            v-hasPermi="['apsPlateProcessStat:edit']"
        >更新</el-button>
          type="success"
          plain
          icon="Refresh"
          @click="handleUpdate"
          :disabled="loading"
          v-hasPermi="['apsPlateProcessStat:edit']"
          >{{ $t("common.common.update") }}</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="aps_plate_process_statList"
        :loading="loading"
        :height="height"
      style="width: 100%"
      :columns="columns"
      :data="aps_plate_process_statList"
      :loading="loading"
      :height="height"
    >
    </HxlhTable>
    <!-- æ·»åŠ æˆ–ä¿®æ”¹é’£é‡‘ç»Ÿè®¡å¯¹è¯æ¡† -->
    <el-dialog :title="title" v-model="open" width="500px" append-to-body>
      <el-form ref="aps_plate_process_statRef" :model="form" :rules="rules" label-width="80px">
    <!-- <el-dialog :title="title" v-model="open" width="500px" append-to-body>
      <el-form
        ref="aps_plate_process_statRef"
        :model="form"
        :rules="rules"
        label-width="80px"
      >
        <el-form-item label="排序" prop="num">
          <el-input v-model="form.num" placeholder="请输入排序" />
        </el-form-item>
        <el-form-item label="生产数量" prop="productionQuantity">
          <el-input v-model="form.productionQuantity" placeholder="请输入生产数量" />
          <el-input
            v-model="form.productionQuantity"
            placeholder="请输入生产数量"
          />
        </el-form-item>
        <el-form-item label="标准工时" prop="standardTime">
          <el-input v-model="form.standardTime" placeholder="请输入标准工时" />
        </el-form-item>
        <el-form-item label="工序总工时" prop="processTotalTime">
          <el-input v-model="form.processTotalTime" placeholder="请输入工序总工时" />
          <el-input
            v-model="form.processTotalTime"
            placeholder="请输入工序总工时"
          />
        </el-form-item>
        <el-form-item label="设计工时" prop="designTimes">
          <el-input v-model="form.designTimes" placeholder="请输入设计工时" />
@@ -81,31 +109,31 @@
          <el-button @click="cancel">取 æ¶ˆ</el-button>
        </div>
      </template>
    </el-dialog>
    </el-dialog> -->
  </div>
</template>
<script setup name="Aps_plate_process_stat">
import { listPlateStat,updateStat } from "@/api/mainPlan/plateProcessStat";
import { listPlateStat, updateStat } from "@/api/mainPlan/plateProcessStat";
import HxlhTable from "@/components/HxlhTable/index.vue";
import { getToken } from "@/utils/auth";
import { ref } from "vue";
import {ElMessage} from "element-plus";
import { ElMessage } from "element-plus";
const { proxy } = getCurrentInstance();
import { useI18n } from "vue-i18n"; //要在js中使用国际化
const { t, locale } = useI18n();
const aps_plate_process_statList = ref([]);
const open = ref(false);
// const open = ref(false);
const loading = ref(false);
const showSearch = ref(true);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const height = ref(document.documentElement.clientHeight - 220 + "px;")
const height = ref(document.documentElement.clientHeight - 220 + "px;");
const data = reactive({
  form: {},
  // form: {},
  queryParams: {
    pageNum: 1,
    pageSize: 10,
@@ -122,119 +150,129 @@
    designTimes: null,
    batchNumber: null,
  },
  rules: {
  }
  rules: {},
});
const { queryParams, form, rules } = toRefs(data);
const { queryParams, rules } = toRefs(data); // form
// è¡¨æ ¼é…ç½®
const columns = ref([
/*  { type: 'seq', title: '序号', width: 60 },*/
  {
    title: '工单号',
    field: 'workOrderNo',
    width: 150,
  } ,
  {
    title: '工序名称',
    field: 'processName',
  },
  {
    title: '工序号',
    field: 'routeProcessNumberTxt',
    width: 100,
  },
  {
    title: '当前工序号',
    field: 'currentProcessNumberTxt',
    width: 100,
  },
  {
    title: '生产数量',
    field: 'productionQuantity',
    width: 80,
  },
  {
    title: '标准工时',
    field: 'standardTime',
    width: 80,
  },
  {
    title: '工序总工时',
    field: 'processTotalTime',
    width: 80,
const columns = ref([]);
watch(
  locale,
  (newLocale) => {
    columns.value = [
      /*  { type: 'seq', title: '序号', width: 60 },*/
      {
        title: t("plan.table.workOrderNo"),
        field: "workOrderNo",
        width: 150,
      },
      {
        title: t("plan.table.processName"),
        field: "processName",
      },
      {
        title: t("plan.table.processNumber"),
        field: "routeProcessNumberTxt",
        width: 100,
      },
      {
        title: t("plan.table.currentProcessNumber"),
        field: "currentProcessNumberTxt",
        width: 100,
      },
      {
        title: t("plan.table.productionQuantity"),
        field: "productionQuantity",
        width: 80,
      },
      {
        title: t("plan.table.standardTime"),
        field: "standardTime",
        width: 80,
      },
      {
        title: t("plan.table.totalWorkingHoursOfProcess"),
        field: "processTotalTime",
        width: 80,
      },
      {
        title: t("plan.table.planStartDay"),
        field: "processPlanStartDaytxt",
        width: 200,
        type: "html",
      },
      {
        title: t("plan.table.planEndDayDate"),
        field: "processPlanEndDaytxt",
        width: 200,
        type: "html",
      },
      {
        title:  t("plan.table.OrderCompletionDate"),
        field: "orderPlanEndDay",
        width: 200,
        format: "YYYY-MM-DD HH:mm:ss",
      },
    ];
    getList();
  },
  {
    title: '计划开工日',
    field: 'processPlanStartDaytxt',
    width: 200,
    type:'html'
  },
  {
    title: '计划完工日',
    field: 'processPlanEndDaytxt',
    width: 200,
    type: 'html'
  },
  {
    title: '订单完工日',
    field: 'orderPlanEndDay',
    width: 200,
    format: 'YYYY-MM-DD HH:mm:ss'
  }
]);
  { immediate: true, deep: true }
);
/** æŸ¥è¯¢é’£é‡‘统计列表 */
function getList() {
  loading.value = true;
  listPlateStat(queryParams.value).then(response => {
  listPlateStat(queryParams.value).then((response) => {
    const listValue = response.rows;
    listValue.forEach(listItem => {
      listItem[`processPlanStartDaytxt`]= listItem.warning? `<font color="red">${listItem.processPlanStartDay}</font>`  :listItem.processPlanStartDay;
      listItem[`processPlanEndDaytxt`]= listItem.warning? `<font color="red">${listItem.processPlanEndDay}</font>`  :listItem.processPlanEndDay;
      listItem[`routeProcessNumberTxt`]= listItem.routeProcessNumber.toString().padStart(3, '0');
      listItem[`currentProcessNumberTxt`]= listItem.currentProcessNumber.toString().padStart(3, '0');
    listValue.forEach((listItem) => {
      listItem[`processPlanStartDaytxt`] = listItem.warning
        ? `<font color="red">${listItem.processPlanStartDay}</font>`
        : listItem.processPlanStartDay;
      listItem[`processPlanEndDaytxt`] = listItem.warning
        ? `<font color="red">${listItem.processPlanEndDay}</font>`
        : listItem.processPlanEndDay;
      listItem[`routeProcessNumberTxt`] = listItem.routeProcessNumber
        .toString()
        .padStart(3, "0");
      listItem[`currentProcessNumberTxt`] = listItem.currentProcessNumber
        .toString()
        .padStart(3, "0");
    });
    aps_plate_process_statList.value =listValue
    aps_plate_process_statList.value = listValue;
    total.value = response.total;
    loading.value = false;
  });
}
// å–消按钮
function cancel() {
  open.value = false;
  reset();
}
// // å–消按钮
// function cancel() {
//   open.value = false;
//   reset();
// }
// è¡¨å•重置
function reset() {
  form.value = {
    id: null,
    workOrderNo: null,
    processName: null,
    num: null,
    routeProcessNumber: null,
    currentProcessNumber: null,
    productionQuantity: null,
    standardTime: null,
    processTotalTime: null,
    processPlanEndDay: null,
    computePlanEndDay: null,
    designTimes: null,
    batchNumber: null,
    createBy: null,
    delFlag: null
  };
  proxy.resetForm("aps_plate_process_statRef");
}
// function reset() {
//   form.value = {
//     id: null,
//     workOrderNo: null,
//     processName: null,
//     num: null,
//     routeProcessNumber: null,
//     currentProcessNumber: null,
//     productionQuantity: null,
//     standardTime: null,
//     processTotalTime: null,
//     processPlanEndDay: null,
//     computePlanEndDay: null,
//     designTimes: null,
//     batchNumber: null,
//     createBy: null,
//     delFlag: null,
//   };
//   proxy.resetForm("aps_plate_process_statRef");
// }
/** æœç´¢æŒ‰é’®æ“ä½œ */
function handleQuery() {
@@ -244,99 +282,110 @@
/** é‡ç½®æŒ‰é’®æ“ä½œ */
function resetQuery() {
  queryParams.value.workOrderNo ='';
  queryParams.value.workOrderNo = "";
  proxy.resetForm("queryRef");
  handleQuery();
}
// å¤šé€‰æ¡†é€‰ä¸­æ•°æ®
function handleSelectionChange(selection) {
  ids.value = selection.map(item => item.id);
  ids.value = selection.map((item) => item.id);
  single.value = selection.length != 1;
  multiple.value = !selection.length;
}
/** æ–°å¢žæŒ‰é’®æ“ä½œ */
function handleAdd() {
  reset();
  open.value = true;
  title.value = "添加钣金统计";
}
// function handleAdd() {
//   reset();
//   open.value = true;
//   title.value = "添加钣金统计";
// }
/** ä¿®æ”¹æŒ‰é’®æ“ä½œ */
function handleUpdate(row) {
  reset();
  // reset();
  loading.value = true;
  updateStat().then(response => {
    form.value = response.data;
  updateStat().then((response) => {
    // form.value = response.data;
    loading.value = false;
    ElMessage({
      message: '数据更新成功',
      type: 'success',
    })
      message: t("plan.message.update"),
      type: "success",
    });
    getList();
  });
}
/** æäº¤æŒ‰é’® */
function submitForm() {
  proxy.$refs["aps_plate_process_statRef"].validate(valid => {
    if (valid) {
      if (form.value.id != null) {
        updateAps_plate_process_stat(form.value).then(response => {
          proxy.$modal.msgSuccess("修改成功");
          open.value = false;
          getList();
        });
      } else {
        addAps_plate_process_stat(form.value).then(response => {
          proxy.$modal.msgSuccess("新增成功");
          open.value = false;
          getList();
        });
      }
    }
  });
}
// function submitForm() {
//   proxy.$refs["aps_plate_process_statRef"].validate((valid) => {
//     if (valid) {
//       if (form.value.id != null) {
//         updateAps_plate_process_stat(form.value).then((response) => {
//           proxy.$modal.msgSuccess("修改成功");
//           open.value = false;
//           getList();
//         });
//       } else {
//         addAps_plate_process_stat(form.value).then((response) => {
//           proxy.$modal.msgSuccess("新增成功");
//           open.value = false;
//           getList();
//         });
//       }
//     }
//   });
// }
/** åˆ é™¤æŒ‰é’®æ“ä½œ */
function handleDelete(row) {
  const _ids = row.id || ids.value;
  proxy.$modal.confirm('是否确认删除钣金统计编号为"' + _ids + '"的数据项?').then(function() {
    return delAps_plate_process_stat(_ids);
  }).then(() => {
    getList();
    proxy.$modal.msgSuccess("删除成功");
  }).catch(() => {});
}
// function handleDelete(row) {
//   const _ids = row.id || ids.value;
//   proxy.$modal
//     .confirm('是否确认删除钣金统计编号为"' + _ids + '"的数据项?')
//     .then(function () {
//       return delAps_plate_process_stat(_ids);
//     })
//     .then(() => {
//       getList();
//       proxy.$modal.msgSuccess("删除成功");
//     })
//     .catch(() => {});
// }
/** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
function handleExport() {
  proxy.download('/aps/plateProcessStat/export', {
    ...queryParams.value
  }, `aps_plate_process_stat_${new Date().getTime()}.xlsx`)
  proxy.download(
    "/aps/plateProcessStat/export",
    {
      ...queryParams.value,
    },
    `aps_plate_process_stat_${new Date().getTime()}.xlsx`
  );
}
const headerCellClassName = ({ column }) => {
  if (column.field === 'name') {
    return 'col-blue'
  }
  return null
}
const rowClassName = ({ rowIndex }) => {
  if ([2, 3, 5].includes(rowIndex)) {
    return 'row-green'
  }
  return null
}
const cellClassName = ({ row, column }) => {
  if (column.field === 'processPlanStartDay'||column.field === 'processPlanEndDay') {
    if (row.warning) {
      return 'col-orange'
    }
  }
  return null
}
getList();
// const headerCellClassName = ({ column }) => {
//   if (column.field === "name") {
//     return "col-blue";
//   }
//   return null;
// };
// const rowClassName = ({ rowIndex }) => {
//   if ([2, 3, 5].includes(rowIndex)) {
//     return "row-green";
//   }
//   return null;
// };
// const cellClassName = ({ row, column }) => {
//   if (
//     column.field === "processPlanStartDay" ||
//     column.field === "processPlanEndDay"
//   ) {
//     if (row.warning) {
//       return "col-orange";
//     }
//   }
//   return null;
// };
// getList();
</script>
<style lang="scss" scoped>
::v-deep(.mytable-style.vxe-table .vxe-body--row.row-green) {
@@ -351,4 +400,4 @@
  background-color: red;
  color: #fff;
}
</style>
</style>
src/views/mainPlan/weldSeam/index.vue
@@ -9,7 +9,7 @@
          icon="Upload" 
          @click="handleImport" 
          v-hasPermi="['weldSeam:weldSeam:importData']"
          >导入</el-button>
          >{{ $t("common.common.import") }}</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
@@ -18,7 +18,7 @@
          icon="Download"
          @click="handleExport"
          v-hasPermi="['weldSeam:weldSeam:export']"
        >导出</el-button>
        >{{ $t("common.common.export") }}</el-button>
      </el-col>
      <right-toolbar :search="false" @queryTable="getList"></right-toolbar>
    </el-row>
@@ -32,7 +32,7 @@
        @on-checkbox="handleCheckboxChange"
    >
      <template #buttons="{row}">
        <vxe-button mode="text" @click="viewEvent(row)">编辑</vxe-button>
        <vxe-button mode="text" @click="viewEvent(row)">{{ $t("common.common.edit") }}</vxe-button>
        <!-- <vxe-button mode="text" @row-click="viewEvent(row.year)">编辑</vxe-button> -->
      </template>
    </HxlhTable>
src/views/partPlan/index.vue
@@ -1,67 +1,84 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px">
      <el-row :gutter="20">
    <el-form
      :model="queryParams"
      ref="queryRef"
      :inline="true"
      v-show="showSearch"
      :label-width="locale === 'zh' ? '90px' : '180px'"
      label-position="left"
    >
      <el-row :gutter="10" class="mb8">
        <!-- <el-col
          :span="6"> -->
        <el-form-item :label="$t('plan.query.daterangePlanStartDay')">
          <el-date-picker
            style="width: 240px"
            v-model="daterangePlanStartDay"
            value-format="YYYY-MM-DD"
            type="daterange"
            range-separator="-"
            :start-placeholder="$t('plan.placeholder.startDate')"
            :end-placeholder="$t('plan.placeholder.endDate')"
          ></el-date-picker>
        </el-form-item>
        <!-- </el-col>
        <el-col :span="6"> -->
        <el-form-item :label="$t('plan.query.daterangePlanEndDay')">
          <el-date-picker
            style="width: 240px"
            v-model="daterangePlanEndDay"
            value-format="YYYY-MM-DD"
            type="daterange"
            range-separator="-"
            :start-placeholder="$t('plan.placeholder.startDate')"
            :end-placeholder="$t('plan.placeholder.endDate')"
          ></el-date-picker>
        </el-form-item>
        <!-- </el-col>
        <el-col
          :span="6">
          <el-form-item label="计划开工日" style="width: 100%;">
            <el-date-picker
              v-model="daterangePlanStartDay"
              value-format="YYYY-MM-DD"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col   :span="6">
          <el-form-item label="计划完工日" style="width: 100%;">
            <el-date-picker
              v-model="daterangePlanEndDay"
              value-format="YYYY-MM-DD"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col
          :span="6">
          <el-form-item label="单据号" prop="documentNumber" style="width: 100%;">
            <el-input
              v-model="queryParams.documentNumber"
              placeholder="请输入单据号"
              clearable
              @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col
          :span="6">
          <el-form-item label="客户名称" prop="customer" style="width: 100%;">
            <el-input
              v-model="queryParams.customer"
              placeholder="请输入客户名称"
              clearable
              @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
          :span="6"> -->
        <el-form-item
          :label="$t('plan.query.documentNumber')"
          prop="documentNumber"
        >
          <el-input
            v-model="queryParams.documentNumber"
            :placeholder="$t('plan.placeholder.documentNumber')"
            clearable
            style="width: 240px"
            @keyup.enter="handleQuery"
          />
        </el-form-item>
        <!-- </el-col>
       <el-col
          :span="6"> -->
        <el-form-item :label="$t('plan.query.customer')" prop="customer">
          <el-input
            style="width: 240px"
            v-model="queryParams.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">搜索</el-button>
              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
            </el-form-item>
        </el-col>
          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 :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
@@ -71,7 +88,8 @@
          :disabled="single"
          @click="plannedStart"
          v-hasPermi="['partPlan:add']"
        >批量修改计划开工日</el-button>
          >{{ $t("plan.btns.batchPlanStartDay") }}</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
@@ -81,16 +99,18 @@
          :disabled="single"
          @click="plannedEnd"
          v-hasPermi="['partPlan:edit']"
        >批量修改计划完工日</el-button>
          >{{ $t("plan.btns.batchPlanEndDay") }}</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="info"
          plain
          icon="Upload"
          @click="handleImport"
        <el-button
          type="info"
          plain
          icon="Upload"
          @click="handleImport"
          v-hasPermi="['partPlan:import']"
          >导入</el-button>
          >{{ $t("common.common.import") }}</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
@@ -99,30 +119,42 @@
          icon="Download"
          @click="handleExport"
          v-hasPermi="['partPlan: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"
      style="width: 100%"
      :columns="columns"
      :data="planList"
      :loading="loading"
      :height="height"
      @on-checkbox="handleCheckboxChange"
    >
    </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-col>
@@ -133,7 +165,7 @@
        </el-col> -->
      </el-row>
      <el-row :gutter="10" style="margin-top: 20px;">
      <el-row :gutter="10" style="margin-top: 20px">
        <!-- <el-col :span="1.5">
          <el-button
            type="primary"
@@ -162,15 +194,29 @@
      </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-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>
            <div class="el-upload__text">
              {{ $t("plan.upload.prevText")
              }}<em>{{ $t("plan.upload.uploadText") }}</em>
            </div>
            <template #tip>
              <div class="el-upload__tip">
                <!-- <div class="el-upload__tip">
                  <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
                </div> -->
                <span>仅允许导入xls、xlsx格式文件。</span>
                <span>{{ $t("plan.upload.fileTypeImport") }}</span>
                <!-- <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link> -->
              </div>
            </template>
@@ -178,19 +224,31 @@
        </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.dataWorkorderSuccess')"
              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.dataWorkorderSuccess')"
              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%"
@@ -203,8 +261,11 @@
          </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>
@@ -212,14 +273,15 @@
        <div class="dialog-footer">
          <!-- <el-button type="primary" @click="submitFileForm">ç¡® å®š</el-button> -->
          <el-button
              type="success"
              plain
              icon="Check"
              :disabled="planned"
              @click="uploadParse"
              v-hasPermi="['partPlan:confirmPart']"
            >确认上传</el-button>
          <el-button @click="dialogCancel">取 æ¶ˆ</el-button>
            type="success"
            plain
            icon="Check"
            :disabled="planned"
            @click="uploadParse"
            v-hasPermi="['partPlan:confirmPart']"
            >{{$t("plan.upload.confirmUpload")}}</el-button
          >
          <el-button @click="dialogCancel">{{$t("plan.upload.cancel")}}</el-button>
        </div>
      </template>
    </el-dialog>
@@ -227,14 +289,21 @@
</template>
<script setup name="Plan">
import { listPlan, examplePlan, confirmPart, addPlan, updatePlan } from "@/api/partPlan/plan";
import HxlhTable from '@/components/HxlhTable'
import {
  listPlan,
  examplePlan,
  confirmPart,
  addPlan,
  updatePlan,
} from "@/api/partPlan/plan";
import HxlhTable from "@/components/HxlhTable";
import { getToken } from "@/utils/auth";
import { ref } from "vue";
import { ElMessage } from 'element-plus'
import { ElMessage } from "element-plus";
const { proxy } = getCurrentInstance();
import { useI18n } from "vue-i18n"; //要在js中使用国际化
const { t, locale } = useI18n();
const exampleList = ref([]);
const planList = ref([]);
const loading = ref(true);
@@ -243,7 +312,7 @@
const total = ref(0);
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);
@@ -264,396 +333,404 @@
  // è®¾ç½®ä¸Šä¼ çš„请求头部
  headers: { Authorization: "Bearer " + getToken() },
  // ä¸Šä¼ çš„地址
  url: import.meta.env.VITE_APP_BASE_API + "/aps/partPlan/importData"
  url: import.meta.env.VITE_APP_BASE_API + "/aps/partPlan/importData",
});
// è¡¨æ ¼é…ç½®
const exampleColumns = ref([
  { type: 'seq', title: '序号', 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: '主件料号',
    field: 'mainPartNumber',
    width: 150,
  },
  {
    title: '主件图号',
    field: 'mainPartDrawingNumber',
    width: 150,
  },
  {
    title: '客户名称',
    field: 'customer',
    width: 200,
  },
  {
    title: '业务类型',
    field: 'businessType',
    width: 150,
  },
  {
    title: '单据号',
    field: 'documentNumber',
    width: 150,
  },
  {
    title: '需求分类',
    field: 'requirementType',
    width: 150,
  },
  {
    title: '单据状态',
    field: 'documentStatus',
    width: 100,
  },
  {
    title: '料号',
    field: 'itemNumber',
    width: 150,
  },
  {
    title: '图号',
    field: 'drawingNo',
    width: 150,
  },
  {
    title: '版本号',
    field: 'versionNumber',
    width: 100,
  },
  {
    title: '生产数量',
    field: 'productionQuantity',
    width: 100,
  },
  {
    title: '良品数量',
    field: 'goodProductsQuantity',
    width: 100,
  },
  {
    title: '工序号',
    field: 'processNumber',
    width: 150,
  },
  {
    title: '工作中心',
    field: 'workCenter',
    width: 150,
  },
  {
    title: '所属部门',
    field: 'department',
    width: 100,
  },
  {
    title: '计划开工日',
    field: 'planStartDay',
    width: 100,
  },
  {
    title: '计划完工日',
    field: 'planEndDay',
    width: 100,
  },
  {
    title: '备料料号',
    field: 'standbyNumber',
    width: 100,
  },
  {
    title: '备料名称',
    field: 'standbyName',
    width: 200,
  },
  {
    title: '备料库存',
    field: 'standbyStock',
    width: 100,
  },
  {
    title: '下道工序所属部门',
    field: 'nextProcessDeparment',
    width: 150,
  },
  {
    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: 150,
  // },
  // {
  //   title: '计划齐套',
  //   field: 'isPlanComplete',
  //   width: 100,
  // },
  // {
  //   title: '库存齐套',
  //   field: 'isStockComplete',
  //   width: 100,
  // },
  // {
  //   title: '是否有折返工序',
  //   field: 'hasTurnback',
  //   width: 150,
  // },
  // {
  //   title: '风险标识',
  //   field: 'hasRisk',
  //   width: 100,
  // },
]);
// è¡¨æ ¼é…ç½®
const exampleColumns = ref([]);
// è¡¨æ ¼é…ç½®
const columns = ref([
  { type: 'checkbox', width: 60, align:"center"},
  { type: 'seq', title: '序号', 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: '主件料号',
    field: 'mainPartNumber',
    width: 150,
  },
  {
    title: '主件图号',
    field: 'mainPartDrawingNumber',
    width: 150,
  },
  {
    title: '客户名称',
    field: 'customer',
    width: 200,
  },
  {
    title: '业务类型',
    field: 'businessType',
    width: 150,
  },
  {
    title: '单据号',
    field: 'documentNumber',
    width: 150,
  },
  {
    title: '需求分类',
    field: 'requirementType',
    width: 150,
  },
  {
    title: '单据状态',
    field: 'documentStatus',
    width: 100,
  },
  {
    title: '料号',
    field: 'itemNumber',
    width: 150,
  },
  {
    title: '图号',
    field: 'drawingNo',
    width: 150,
  },
  {
    title: '版本号',
    field: 'versionNumber',
    width: 100,
  },
  {
    title: '生产数量',
    field: 'productionQuantity',
    width: 100,
  },
  {
    title: '良品数量',
    field: 'goodProductsQuantity',
    width: 100,
  },
  {
    title: '工序号',
    field: 'processNumber',
    width: 150,
  },
  {
    title: '工作中心',
    field: 'workCenter',
    width: 150,
  },
  {
    title: '所属部门',
    field: 'department',
    width: 100,
  },
  {
    title: '计划开工日',
    field: 'planStartDay',
    width: 100,
  },
  {
    title: '计划完工日',
    field: 'planEndDay',
    width: 100,
  },
  {
    title: '备料料号',
    field: 'standbyNumber',
    width: 100,
  },
  {
    title: '备料名称',
    field: 'standbyName',
    width: 200,
  },
  {
    title: '备料库存',
    field: 'standbyStock',
    width: 100,
  },
  {
    title: '下道工序所属部门',
    field: 'nextProcessDeparment',
    width: 150,
  },
  {
    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: 150,
  // },
  // {
  //   title: '计划齐套',
  //   field: 'isPlanComplete',
  //   width: 100,
  // },
  // {
  //   title: '库存齐套',
  //   field: 'isStockComplete',
  //   width: 100,
  // },
  // {
  //   title: '是否有折返工序',
  //   field: 'hasTurnback',
  //   width: 150,
  // },
  // {
  //   title: '风险标识',
  //   field: 'hasRisk',
  //   width: 100,
  // },
]);
// è¡¨æ ¼é…ç½®
const columns = ref([]);
const data = reactive({
  queryParams: {
    documentNumber: null,
    customer: null,
    batchNumber: null,
  }
  },
});
const { queryParams } = toRefs(data);
watch(
  locale,
  (newLocale) => {
    columns.value = [
      { type: "checkbox", width: 60, align: "center" },
      { 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: 150,
      },
      {
        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,
      // },
    ];
    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: 150,
      },
      {
        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,
      // },
    ];
    getList();
  },
  { 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;
@@ -664,15 +741,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;
  });
@@ -680,7 +759,7 @@
/** æœç´¢æŒ‰é’®æ“ä½œ */
function handleQuery() {
  queryParams.value.pageNum = 1;
  queryParams.value.planNum = 1;
  getList();
}
@@ -698,38 +777,41 @@
};
/** æ‰¹é‡ä¿®æ”¹è®¡åˆ’开工日按钮操作 */
function plannedStart() {
}
function plannedStart() {}
/** æ‰¹é‡ä¿®æ”¹è®¡åˆ’完工日按钮操作 */
function plannedEnd() {
}
function plannedEnd() {}
/** å¯¼å…¥æŒ‰é’®æ“ä½œ */
function handleImport() {
  upload.title = "零件工单数据上传";
  upload.title = t("plan.upload.uploadPartWorkOrderData");
  upload.open = true;
};
}
/** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
function handleExport() {
  proxy.download('aps/partPlan/export', {
    ...queryParams.value
  }, `plan_${new Date().getTime()}.xlsx`)
  proxy.download(
    "aps/partPlan/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) => {
@@ -738,15 +820,24 @@
/** æ–‡ä»¶ä¸Šä¼ æˆåŠŸå¤„ç† */
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;
@@ -756,7 +847,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;
@@ -764,15 +855,15 @@
    planned.value = true;
    upload.open = false;
    ElMessage({
      message: '零件工单数据已成功上传和解析',
      type: 'success',
    })
      message: t("plan.upload.uploadParsePartWorkOrderData"),
      type: "success",
    });
    getList();
  });
}
/** dialog取消 */
function dialogCancel(){
function dialogCancel() {
  if (uploadRef.value) {
    uploadRef.value.clearFiles();
  }
@@ -783,10 +874,10 @@
  upload.isUploading = false;
}
getList();
// getList();
</script>
<style lang="css" scoped>
h4 {
  font-weight: bold;
}
</style>
</style>