CD配唱片
2025-05-06 5e4dc3af68c2bb0a5a33fcb395e7704207125ce8
src/views/mainPlan/sheetMetalRedundantReport/index.vue
@@ -6,44 +6,50 @@
      ref="queryRef"
      :inline="true"
      v-show="showSearch"
      label-width="90px"
      :label-width="locale === 'zh' ? '90px' : '200px'"
    >
      <el-row type="flex" justify="left">
        <el-col :span="5">
          <el-form-item label="需求追溯ID" prop="description">
        <el-col :span="locale === 'zh' ? 5 : 10">
          <el-form-item
            :label="$t('plan.query.requireTraceID')"
            prop="description"
          >
            <el-input
              style="width: 140px"
              :style="{ width: locale === 'zh' ? '140px' : '300px' }"
              v-model="queryParams.description"
              placeholder="请输入需求追溯ID"
              :placeholder="`${$t('plan.placeholder.requireTraceID')}`"
              clearable
              @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="料号" prop="description">
        <el-col :span="locale === 'zh' ? 8 : 9">
          <el-form-item :label="$t('plan.query.itemNumber')" prop="description">
            <el-input
              style="width: 140px"
              :style="{ width: locale === 'zh' ? '140px' : '210px' }"
              v-model="queryParams.description"
              placeholder="请输入料号"
              :placeholder="`${$t('common.common.placeholder')}${$t(
                'plan.query.itemNumber'
              )}`"
              clearable
              @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="14" style="text-align: right">
        <el-col :span="locale === 'zh' ? 11 : 5" style="text-align: right">
          <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-col>
      </el-row>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="warning"
@@ -51,7 +57,7 @@
          icon="Download"
          @click="handleExport"
          v-hasPermi="['core:calendar:export']"
          >导出</el-button
          >{{ $t("common.common.export") }}</el-button
        >
      </el-col>
      <right-toolbar
@@ -89,6 +95,8 @@
import { listAll_plant } from "@/api/basicData/plant";
import { listAll_shop, listAps_shop } from "@/api/basicData/shop";
import { selectProcessNameList } from "@/api/basicData/processRoute.js";
import { useI18n } from "vue-i18n"; //要在js中使用国际化
const { t, locale } = useI18n();
const { proxy } = getCurrentInstance();
const tableRef = ref();
const calendarList = ref([]);
@@ -124,78 +132,84 @@
const processList = ref([]);
const height = ref(document.documentElement.clientHeight - 220 + "px;");
// 表格配置-列表
const columns = ref([
  {
    title: "工单号",
    field: "description",
    width: 150,
    align: "center"
  },
  {
    title: "子件料号",
    field: "type",
    width: 200,
    align: "center"
  },
  {
    title: "生产数量",
    field: "effectiveDate",
    width: 200,
    align: "center",
  },
  {
    title: "未匹配生产数量",
    field: "expiringDate",
    width: 200,
    align: "center"
  },
  {
    title: "适用工厂",
    field: "applicableFactory",
    width: 200,
    align: "center",
    formatter: ({ cellValue, row, column }) => {
      if (cellValue) {
        for (let i = 0; i < plantList.value.length; i++) {
          if (cellValue === plantList.value[i].plantCode) {
            return plantList.value[i].plantName;
          }
        }
      }
    },
  },
  {
    title: "生产基地",
    field: "expiringDate",
    width: 200,
    align: "center"
  },
  {
    title: "计划开工日",
    field: "createTime",
    width: 200,
    align: "center",
  },
  {
    title: "计划完工日",
    field: "updateTime",
    width: 100,
    align: "center",
  },
  {
    title: "工单创建时间",
    field: "updateTime",
    width: 100,
    align: "center",
  },
]);
const columns = ref([]);
// 分页属性
const page = ref({
  total: 0,
  current: 1,
  size: 10,
});
watch(
  locale,
  (newLocale) => {
    columns.value = [
      {
        title: t("plan.table.workOrderNo"),
        field: "description",
        width: 150,
        align: "center",
      },
      {
        title: t("plan.table.subItemPartNumber"),
        field: "type",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.productionQuantity"),
        field: "effectiveDate",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.mismatchedProductionQuantity"),
        field: "expiringDate",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.applicableFactories"),
        field: "applicableFactory",
        width: 200,
        align: "center",
        formatter: ({ cellValue, row, column }) => {
          if (cellValue) {
            for (let i = 0; i < plantList.value.length; i++) {
              if (cellValue === plantList.value[i].plantCode) {
                return plantList.value[i].plantName;
              }
            }
          }
        },
      },
      {
        title: t("plan.table.productionBase"),
        field: "expiringDate",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.planStartDay"),
        field: "createTime",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.planEndDayDate"),
        field: "updateTime",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.workorderCreationTime"),
        field: "updateTime",
        width: 100,
        align: "center",
      },
    ];
  },
  { immediate: true, deep: true }
);
/** 查询日历管理列表 */
function getList() {
  loading.value = true;