chengxiangling
2025-05-14 9587438965a876c23b9e9efcff014f1cc565cb4d
src/views/mainPlan/sheetMetalOrderManage/index.vue
@@ -6,53 +6,69 @@
      ref="queryRef"
      :inline="true"
      v-show="showSearch"
      :label-width="locale == 'zh' ? '110px' : '200px'"
      label-position="left"
    >
      <el-form-item :label="$t('plan.query.workOrderNo')" prop="workOrderNo">
        <el-input
          :style="{ width: locale == 'zh' ? '200px' : '280px' }"
          v-model="queryParams.workOrderNo"
          :placeholder="`${$t('common.common.placeholder')}${$t(
            'plan.query.workOrderNo'
          )}`"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <!-- <el-row type="flex" justify="left">
        <el-col :span="5"> -->
      <el-form-item
        :label="$t('plan.query.requireTraceID')"
        prop="requireTrackId"
      >
        <el-input
          :style="{ width: locale == 'zh' ? '200px' : '280px' }"
          v-model="queryParams.requireTrackId"
          :placeholder="`${$t('common.common.placeholder')}${$t(
            'plan.query.requireTraceID'
          )}`"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <!-- </el-col>
        <el-col :span="5"> -->
      <el-form-item :label="$t('plan.query.itemNumber')" prop="mainPartNumber">
        <el-input
          :style="{ width: locale == 'zh' ? '200px' : '280px' }"
          v-model="queryParams.mainPartNumber"
          :placeholder="`${$t('common.common.placeholder')}${$t(
            'plan.query.itemNumber'
          )}`"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item
        :label="$t('plan.table.delayRiskIdentification')"
        prop="hasDelayRisk"
      >
        <!-- <el-input
      <el-row type="flex" justify="left">
        <el-col :span="12">
          <el-form-item
            :label-width="locale == 'zh' ? '80px' : '160px'"
            :label="$t('plan.query.workOrderNo')"
            prop="workOrderNo"
          >
            <el-input
              :style="{ width: '280px' }"
              v-model="queryParams.workOrderNo"
              :placeholder="`${$t('common.common.placeholder')}${$t(
                'plan.query.workOrderNo'
              )}`"
              clearable
              @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item
            :label-width="locale == 'zh' ? '100px' : '200px'"
            :label="$t('plan.query.requireTraceID')"
            prop="requireTrackId"
          >
            <el-input
              :style="{ width: '280px' }"
              v-model="queryParams.requireTrackId"
              :placeholder="`${$t('common.common.placeholder')}${$t(
                'plan.query.requireTraceID'
              )}`"
              clearable
              @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex" justify="left">
        <el-col :span="12">
          <el-form-item
            :label-width="locale == 'zh' ? '80px' : '160px'"
            :label="$t('plan.query.itemNumber')"
            prop="mainPartNumber"
          >
            <el-input
              :style="{ width: '280px' }"
              v-model="queryParams.mainPartNumber"
              :placeholder="`${$t('common.common.placeholder')}${$t(
                'plan.query.itemNumber'
              )}`"
              clearable
              @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item
            :label-width="locale == 'zh' ? '100px' : '200px'"
            :label="$t('plan.table.delayRiskIdentification')"
            prop="hasDelayRisk"
          >
            <!-- <el-input
          :style="{ width: locale == 'zh' ? '200px' : '280px' }"
          v-model="queryParams.hasDelayRisk"
          :placeholder="`${$t('common.common.placeholder')}${$t(
@@ -61,31 +77,41 @@
          clearable
          @keyup.enter="handleQuery"
        /> -->
        <el-select
          clearable
          v-model="queryParams.hasDelayRisk"
          style="width: 140px"
            <el-select
              clearable
              v-model="queryParams.hasDelayRisk"
              style="width: 280px"
            >
              <el-option
                v-for="item in delayRiskOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col
          :span="24"
          style="
            display: flex;
            justify-content: flex-end;
            align-item: center;
            text-align: right;
          "
        >
          <el-option
            v-for="item in delayRiskOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <!-- </el-col>
        <el-col :span="14" style="text-align: right"> -->
      <el-form-item class="column-with-margin">
        <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-item class="column-with-margin">
            <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">
@@ -93,7 +119,7 @@
        <el-button
          type="primary"
          plain
          icon="Plus"
          icon="Refresh"
          :disabled="multiple"
          @click="handleBatchUpdatePlanDate"
          v-hasPermi="['ApsPlatOrderPlanManager:requirement:list']"
@@ -134,15 +160,15 @@
          link
          @click="handleCheckView(row)"
          v-hasPermi="['ApsPlatOrderPlanManager:requirement:list']"
          >{{ $t("plan.btns.viewRequirement") }}</el-button
          >{{ $t("plan.btns.viewRequirement") }}({{row.requireNum}})</el-button
        >
      </template>
    </HxlhTable>
    <el-dialog
      :title="$t('plan.title.viewAssociatedRequirements')"
      v-model="openDialog"
      width="900px"
      style="height: 400px; overflow: hidden"
      width="85%"
      style="height:90vh; overflow: hidden"
      append-to-body
    >
      <HxlhTable
@@ -150,7 +176,7 @@
        :columns="subGridOptions"
        :data="subList"
        :loading="loadingSub"
        :height="'280px'"
        :height="heightSub"
      >
      </HxlhTable>
      <template #footer>
@@ -164,8 +190,8 @@
    <el-dialog
      :title="$t('plan.btns.batchUpdateOrderDate')"
      v-model="openBatchDialog"
      width="900px"
      style="height: 400px; overflow: hidden"
      width="85%"
      style="min-height:90vh; overflow: hidden"
      append-to-body
    >
      <div class="mode_box">
@@ -174,12 +200,13 @@
          <el-radio :label="1">{{
            $t("plan.btns.batchUpdateOrderDate")
          }}</el-radio>
          <el-radio :label="2">{{
          <!-- <el-radio :label="2">{{
            $t("plan.title.CustomizePlannedCompletionDate")
          }}</el-radio>
          }}</el-radio> -->
        </el-radio-group>
      </div>
      <div class="red_color">{{ $t("plan.title.tipsBugSheetMetal") }}</div>
      <div class="red_color" v-if="radio === 1">{{ $t("plan.title.tipsBugSheetMetal") }}</div>
      <div class="red_color" v-if="radio === 2">{{ $t("plan.title.tipsBugSheetMetal2") }}</div>
      <div class="mode_box" v-if="radio === 2">
        <span>{{ $t("plan.title.CustomizePlannedCompletionDate") }}</span>
        <!-- <el-date-picker
@@ -201,7 +228,7 @@
        :columns="subUpdateGridOptions"
        :data="subUpdateList"
        :loading="loading"
        :height="'200px'"
        :height="heightSubUpdate"
      >
      </HxlhTable>
      <HxlhTable
@@ -210,7 +237,7 @@
        :columns="subUpdateCustomGridOptions"
        :data="subUpdateList"
        :loading="loading"
        :height="'200px'"
        :height="heightSubUpdate"
      >
      </HxlhTable>
      <template #footer>
@@ -231,7 +258,7 @@
  </div>
</template>
<script setup name="Calendar">
<script setup name="SheetMetalOrderManage">
import HxlhTable from "@/components/HxlhTable";
import { parseTime } from "@/utils/ruoyi.js";
import useBasicStore from "@/store/modules/request/basic/page";
@@ -247,16 +274,10 @@
const { t, locale } = useI18n();
const basicStore = useBasicStore();
const { proxy } = getCurrentInstance();
const delayRiskOptions = ref([
  {
    label: "有风险",
    value: "1",
  },
  {
    label: "无风险",
    value: "0",
  },
]);
const { aps_work_order_type } = proxy.useDict("aps_work_order_type");
const { aps_factory   } = proxy.useDict("aps_factory");
const { aps_has_risk   } = proxy.useDict("aps_has_risk");
const delayRiskOptions = ref([]);
const radio = ref(1);
const customicDate = ref("");
const openDialog = ref(false);
@@ -296,7 +317,9 @@
const shopList = ref([]);
const allShopList = ref([]);
const processList = ref([]);
const height = ref(document.documentElement.clientHeight - 270 + "px;");
const height = ref(document.documentElement.clientHeight - 320 + "px;");
const heightSub = ref(document.documentElement.clientHeight - 200 + "px;");
const heightSubUpdate = ref(document.documentElement.clientHeight - 270 + "px;");
// 表格配置-列表
const columns = ref([]);
// 分页属性
@@ -308,14 +331,24 @@
watch(
  locale,
  (newLocale) => {
    delayRiskOptions.value = [
      {
        label: t("plan.options.hasRisk"),
        value: "1",
      },
      {
        label: t("plan.options.noRisk"),
        value: "0",
      },
    ];
    columns.value = [
      { type: "checkbox", width: 60, align: "center", fixed: "left" },
      {
        title: t("basic.table.requirementID"),
        field: "requireId",
        width: 150,
        align: "center",
      },
      // {
      //   title: t("basic.table.requirementID"),
      //   field: "requireId",
      //   width: 150,
      //   align: "center",
      // },
      {
        title: t("basic.table.requirementTraceabilityID"),
        field: "requireTrackId",
@@ -339,6 +372,15 @@
        field: "workOrderType",
        width: 200,
        align: "center",
        formatter: ({ cellValue, row, column }) => {
          if (cellValue) {
            for (let i = 0; i < aps_work_order_type.value.length; i++) {
              if (cellValue === aps_work_order_type.value[i].value) {
                return aps_work_order_type.value[i].label;
              }
            }
          }
        },
      },
      {
        title: t("plan.table.itemNumber"),
@@ -371,9 +413,9 @@
        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;
            for (let i = 0; i < aps_factory.value.length; i++) {
              if (cellValue === aps_factory.value[i].value) {
                return aps_factory.value[i].label;
              }
            }
          }
@@ -416,17 +458,17 @@
        align: "center",
        formatter: ({ cellValue, row, column }) => {
          if (cellValue) {
            for (let i = 0; i < delayRiskOptions.value.length; i++) {
              if (cellValue === delayRiskOptions.value[i].value) {
                return delayRiskOptions.value[i].label;
            for (let i = 0; i < aps_has_risk.value.length; i++) {
              if (cellValue === aps_has_risk.value[i].value) {
                return aps_has_risk.value[i].label;
              }
            }
          }
        },
      },
      {
        title: t("common.common.operate"),
        width: 100,
        title: t("common.common.require"),
        width: 150,
        fixed: "right",
        slots: { default: "buttons" },
        align: "center",
@@ -439,12 +481,12 @@
        width: 150,
        align: "center",
      },
      {
        title: t("basic.table.requirementTraceabilityID"),
        field: "requireId",
        width: 200,
        align: "center",
      },
      // {
      //   title: t("basic.table.requirementTraceabilityID"),
      //   field: "requireId",
      //   width: 200,
      //   align: "center",
      // },
      {
        title: t("plan.table.itemNumber"),
        field: "bomLineCode",
@@ -463,18 +505,18 @@
        width: 200,
        align: "center",
      },
      {
        title: t("basic.table.processRouteID"),
        field: "processRouteId",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.processRouteWorkingHours"),
        field: "processRouteHours",
        width: 100,
        align: "center",
      },
      // {
      //   title: t("basic.table.processRouteID"),
      //   field: "processRouteId",
      //   width: 200,
      //   align: "center",
      // },
      // {
      //   title: t("plan.table.processRouteWorkingHours"),
      //   field: "processRouteHours",
      //   width: 100,
      //   align: "center",
      // },
      {
        title: t("plan.table.demandQuantity"),
        field: "requireAmount",
@@ -510,6 +552,15 @@
        field: "orgCode",
        width: 100,
        align: "center",
        formatter: ({ cellValue, row, column }) => {
          if (cellValue) {
            for (let i = 0; i < aps_factory.value.length; i++) {
              if (cellValue === aps_factory.value[i].value) {
                return aps_factory.value[i].label;
              }
            }
          }
        },
      },
      {
        title: t("plan.table.productionBase"),
@@ -548,9 +599,9 @@
        align: "center",
        formatter: ({ cellValue, row, column }) => {
          if (cellValue) {
            for (let i = 0; i < delayRiskOptions.value.length; i++) {
              if (cellValue === delayRiskOptions.value[i].value) {
                return delayRiskOptions.value[i].label;
            for (let i = 0; i < aps_has_risk.value.length; i++) {
              if (cellValue === aps_has_risk.value[i].value) {
                return aps_has_risk.value[i].label;
              }
            }
          }
@@ -558,12 +609,12 @@
      },
    ];
    subUpdateGridOptions.value = [
      {
        title: t("basic.table.requirementID"),
        field: "requireId",
        width: 150,
        align: "center",
      },
      // {
      //   title: t("basic.table.requirementID"),
      //   field: "requireId",
      //   width: 150,
      //   align: "center",
      // },
      {
        title: t("basic.table.requirementTraceabilityID"),
        field: "requireTrackId",
@@ -587,6 +638,15 @@
        field: "workOrderType",
        width: 200,
        align: "center",
        formatter: ({ cellValue, row, column }) => {
          if (cellValue) {
            for (let i = 0; i < aps_work_order_type.value.length; i++) {
              if (cellValue === aps_work_order_type.value[i].value) {
                return aps_work_order_type.value[i].label;
              }
            }
          }
        },
      },
      {
        title: t("plan.table.itemNumber"),
@@ -620,12 +680,12 @@
      },
    ];
    subUpdateCustomGridOptions.value = [
      {
        title: t("basic.table.requirementID"),
        field: "requireId",
        width: 150,
        align: "center",
      },
      // {
      //   title: t("basic.table.requirementID"),
      //   field: "requireId",
      //   width: 150,
      //   align: "center",
      // },
      {
        title: t("basic.table.requirementTraceabilityID"),
        field: "requireTrackId",
@@ -649,6 +709,15 @@
        field: "workOrderType",
        width: 200,
        align: "center",
        formatter: ({ cellValue, row, column }) => {
          if (cellValue) {
            for (let i = 0; i < aps_work_order_type.value.length; i++) {
              if (cellValue === aps_work_order_type.value[i].value) {
                return aps_work_order_type.value[i].label;
              }
            }
          }
        },
      },
      {
        title: t("plan.table.itemNumber"),
@@ -753,7 +822,7 @@
    });
    loadingGenerateList.value = false;
    getList();
  }else {
  } else {
    loadingGenerateList.value = false;
  }
}