CD配唱片
2025-05-08 e3e17a37d85f50bace525ed019ee0cd8d39143eb
src/views/mainPlan/sheetMetalOrderManage/index.vue
@@ -6,44 +6,58 @@
      ref="queryRef"
      :inline="true"
      v-show="showSearch"
      :label-width="locale=='zh'?'110px':'200px'"
      :label-width="locale == 'zh' ? '110px' : '200px'"
    >
      <el-form-item :label="$t('plan.query.workOrderNo')" prop="description">
      <el-form-item :label="$t('plan.query.workOrderNo')" prop="workOrderNo">
        <el-input
          :style="{width:locale=='zh'? '200px':'280px'}"
          v-model="queryParams.description"
          :placeholder="`${$t('common.common.placeholder')}${$t('plan.query.workOrderNo')}`"
          :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="description">
      <el-form-item
        :label="$t('plan.query.requireTraceID')"
        prop="requireTraceId"
      >
        <el-input
          :style="{width:locale=='zh'? '200px':'280px'}"
          v-model="queryParams.description"
          :placeholder="`${$t('common.common.placeholder')}${$t('plan.query.requireTraceID')}`"
          :style="{ width: locale == 'zh' ? '200px' : '280px' }"
          v-model="queryParams.requireTraceId"
          :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="description">
      <el-form-item :label="$t('plan.query.itemNumber')" prop="mainPartNumber">
        <el-input
          :style="{width:locale=='zh'? '200px':'280px'}"
          v-model="queryParams.description"
          :placeholder="`${$t('common.common.placeholder')}${$t('plan.query.itemNumber')}`"
          :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="description">
      <el-form-item
        :label="$t('plan.table.delayRiskIdentification')"
        prop="hasDelayRisk"
      >
        <el-input
          :style="{width:locale=='zh'? '200px':'280px'}"
          v-model="queryParams.description"
          :placeholder="`${$t('common.common.placeholder')}${$t('plan.table.delayRiskIdentification')}`"
          :style="{ width: locale == 'zh' ? '200px' : '280px' }"
          v-model="queryParams.hasDelayRisk"
          :placeholder="`${$t('common.common.placeholder')}${$t(
            'plan.table.delayRiskIdentification'
          )}`"
          clearable
          @keyup.enter="handleQuery"
        />
@@ -51,10 +65,12 @@
      <!-- </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-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> -->
@@ -69,7 +85,7 @@
          :disabled="multiple"
          @click="handleBatchUpdatePlanDate"
          v-hasPermi="['apsPlatePlan:edit']"
          >{{$t('plan.btns.batchUpdateOrderDate')}}</el-button
          >{{ $t("plan.btns.batchUpdateOrderDate") }}</el-button
        >
      </el-col>
      <el-col :span="1.5">
@@ -77,9 +93,9 @@
          type="success"
          plain
          icon="Edit"
          @click="handleUpdate"
          @click="handleGenerateList"
          v-hasPermi="['apsPlatePlan:edit']"
          >{{$t('plan.btns.generatePlanOrder')}}</el-button
          >{{ $t("plan.btns.generatePlanOrder") }}</el-button
        >
      </el-col>
      <right-toolbar
@@ -90,7 +106,7 @@
    <HxlhTable
      style="width: 100%"
      :columns="columns"
      :data="calendarList"
      :data="orderList"
      :loading="loading"
      :height="height"
      ref="tableRef"
@@ -105,7 +121,7 @@
          link
          @click="handleCheckView(row)"
          v-hasPermi="['aps:calendar:update']"
          >{{$t('plan.btns.viewRequirement')}}</el-button
          >{{ $t("plan.btns.viewRequirement") }}</el-button
        >
      </template>
    </HxlhTable>
@@ -119,10 +135,17 @@
        style="width: 100%"
        :columns="subGridOptions"
        :data="subList"
        :loading="loading"
        :loading="loadingSub"
        :height="heightSub"
      >
      </HxlhTable>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="openDialog = false">{{
            $t("common.common.cancel")
          }}</el-button>
        </span>
      </template>
    </el-dialog>
    <el-dialog
      :title="$t('plan.btns.batchUpdateOrderDate')"
@@ -131,15 +154,19 @@
      append-to-body
    >
      <div class="mode_box">
        <span>{{$t('plan.title.setMode')}}</span>
        <span>{{ $t("plan.title.setMode") }}</span>
        <el-radio-group v-model="radio">
          <el-radio :label="1">{{$t('plan.btns.batchUpdateOrderDate')}}</el-radio>
          <el-radio :label="2">{{$t('plan.title.CustomizePlannedCompletionDate')}}</el-radio>
          <el-radio :label="1">{{
            $t("plan.btns.batchUpdateOrderDate")
          }}</el-radio>
          <el-radio :label="2">{{
            $t("plan.title.CustomizePlannedCompletionDate")
          }}</el-radio>
        </el-radio-group>
      </div>
      <div class="red_color">{{$t('plan.title.tipsBugSheetMetal')}}</div>
      <div class="mode_box" v-if="radio===2">
        <span>{{$t('plan.title.CustomizePlannedCompletionDate')}}</span>
      <div class="red_color">{{ $t("plan.title.tipsBugSheetMetal") }}</div>
      <div class="mode_box" v-if="radio === 2">
        <span>{{ $t("plan.title.CustomizePlannedCompletionDate") }}</span>
        <el-date-picker
          v-model="value4"
          type="dates"
@@ -147,7 +174,7 @@
        />
      </div>
      <HxlhTable
        v-if="radio===1"
        v-if="radio === 1"
        style="width: 100%"
        :columns="subUpdateGridOptions"
        :data="subUpdateList"
@@ -156,7 +183,7 @@
      >
      </HxlhTable>
      <HxlhTable
        v-if="radio===2"
        v-if="radio === 2"
        style="width: 100%"
        :columns="subUpdateCustomGridOptions"
        :data="subUpdateList"
@@ -164,25 +191,25 @@
        :height="heightSub"
      >
      </HxlhTable>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="openBatchDialog = false">{{
            $t("common.common.cancel")
          }}</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>
<script setup name="Calendar">
import HxlhTable from "@/components/HxlhTable";
import {
  listCalendar,
  getCalendar,
  delCalendar,
  addCalendar,
  updateCalendar,
} from "@/api/basicData/calendar";
import axios from "axios";
import useBasicStore from "@/store/modules/request/basic/page";
import { listAll_plant } from "@/api/basicData/plant";
import { listAll_shop, listAps_shop } from "@/api/basicData/shop";
import { plateStandardRequireErrorList } from "@/api/basicData/sheetMetalConfig/sheetMetalConfig.js";
import { metalOrderManageList,metalOrderManageSubList,generatorPlanList } from "@/api/mainPlan/metalOrderManage.js";
import { useI18n } from "vue-i18n"; //要在js中使用国际化
const { t, locale } = useI18n();
const basicStore = useBasicStore();
const { proxy } = getCurrentInstance();
const radio = ref(1);
const openDialog = ref(false);
@@ -193,8 +220,9 @@
const subList = ref([]);
const subUpdateList = ref([]);
// const tableRef = ref();
const calendarList = ref([]);
const loading = ref(true);
const orderList = ref([]);
const loading = ref(false);
const loadingSub = ref(false)
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
@@ -208,18 +236,13 @@
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    description: null,
    type: null,
    effectiveDate: null,
    expiringDate: null,
    content: null,
    applicableFactory: null,
    applicableWorkshop: null,
    applicableProcess: null,
    workOrderNo: null,
    requireTraceId: null,
    mainPartNumber: null,
    hasDelayRisk: null,
  },
});
const { queryParams, form, rules } = toRefs(data);
const typeRadioNumber = ref(1);
const plantList = ref([]);
const shopList = ref([]);
const allShopList = ref([]);
@@ -240,61 +263,61 @@
      { type: "checkbox", width: 60, align: "center" },
      {
        title: t("basic.table.requirementID"),
        field: "description",
        field: "requireId",
        width: 150,
        align: "center",
      },
      {
        title: t("basic.table.requirementTraceabilityID"),
        field: "type",
        field: "requireTraceId",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.workOrderNo"),
        field: "effectiveDate",
        field: "workOrderNo",
        width: 200,
        align: "center",
      },
      {
        title: t("basic.table.matchQuantity"),
        field: "expiringDate",
        field: "deductionAmount",
        width: 200,
        align: "center",
      },
      {
        title: t("basic.table.workOrderType"),
        field: "expiringDate",
        field: "workOrderType",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.itemNumber"),
        field: "createTime",
        field: "mainPartNumber",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.mainPartDrawingNumber"),
        field: "createTime",
        field: "mainPartDrawingNumber",
        width: 200,
        align: "center",
      },
      {
        title: t("basic.table.mainCustomer"),
        field: "createTime",
        field: "customer",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.productionQuantity"),
        field: "updateTime",
        field: "productionQuantity",
        width: 100,
        align: "center",
      },
      {
        title: t("basic.table.applicableFactories"),
        field: "applicableFactory",
        field: "applicableFactories",
        width: 200,
        align: "center",
        formatter: ({ cellValue, row, column }) => {
@@ -309,37 +332,37 @@
      },
      {
        title: t("plan.table.productionBase"),
        field: "updateTime",
        field: "productionBase",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.planStartDay"),
        field: "updateTime",
        field: "planStartDay",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.planEndDayDate"),
        field: "updateTime",
        field: "planEndDay",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.workorderCreationTime"),
        field: "updateTime",
        field: "orderCreateTime",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.mismatchedProductionQuantity"),
        field: "updateTime",
        field: "unmatchedQuantity",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.delayRiskIdentification"),
        field: "updateTime",
        field: "hasDelayRisk",
        width: 100,
        align: "center",
      },
@@ -354,91 +377,115 @@
    subGridOptions.value = [
      {
        title: t("basic.table.requirementID"),
        field: "description",
        field: "id",
        width: 150,
        align: "center",
      },
      {
        title: t("basic.table.requirementTraceabilityID"),
        field: "type",
        field: "requireId",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.itemNumber"),
        field: "effectiveDate",
        field: "bomLineCode",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.bomLowCode"),
        field: "expiringDate",
        field: "bomLineLevel",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.bomUsage"),
        field: "expiringDate",
        field: "bomUseAmount",
        width: 200,
        align: "center",
      },
      {
        title: t("basic.table.processRouteID"),
        field: "createTime",
        field: "processRouteId",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.processRouteWorkingHours"),
        field: "updateTime",
        field: "processRouteHours",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.demandQuantity"),
        field: "updateTime",
        field: "requireAmount",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.netRequirement"),
        field: "updateTime",
        field: "netRequirement",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.planStartDay"),
        field: "updateTime",
        field: "startDate",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.planEndDayDate"),
        field: "updateTime",
        field: "completeDate",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.requirementDate"),
        field: "updateTime",
        field: "demandDate",
        width: 100,
        align: "center",
      },
      {
        title: t("basic.table.applicableFactories"),
        field: "updateTime",
        field: "orgCode",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.productionBase"),
        field: "updateTime",
        field: "productionBase",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.matchState"),
        field: "updateTime",
        field: "matchState",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.matchPattern"),
        field: "matchMode",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.unmatchedDemandQuantity"),
        field: "unmatchedDemandAmount",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.suggestedCompletionDate"),
        field: "suggestedCompletionDate",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.delayRiskIdentification"),
        field: "hasDelayRisk",
        width: 100,
        align: "center",
      },
@@ -446,61 +493,61 @@
    subUpdateGridOptions.value = [
      {
        title: t("basic.table.requirementID"),
        field: "description",
        field: "requireId",
        width: 150,
        align: "center",
      },
      {
        title: t("basic.table.requirementTraceabilityID"),
        field: "type",
        field: "requireTraceId",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.workOrderNo"),
        field: "effectiveDate",
        field: "workOrderNo",
        width: 200,
        align: "center",
      },
      {
        title: t("basic.table.matchQuantity"),
        field: "expiringDate",
        field: "deductionAmount",
        width: 200,
        align: "center",
      },
      {
        title: t("basic.table.workOrderType"),
        field: "expiringDate",
        field: "workOrderType",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.itemNumber"),
        field: "createTime",
        field: "mainPartNumber",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.planStartDay"),
        field: "updateTime",
        field: "planStartDay",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.planEndDayDate"),
        field: "updateTime",
        field: "planEndDay",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.startDateOfDemandPlan"),
        field: "updateTime",
        field: "startDay",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.requirementPlanCompletionDate"),
        field: "updateTime",
        field: "completeDay",
        width: 100,
        align: "center",
      },
@@ -508,49 +555,49 @@
    subUpdateCustomGridOptions.value = [
      {
        title: t("basic.table.requirementID"),
        field: "description",
        field: "requireId",
        width: 150,
        align: "center",
      },
      {
        title: t("basic.table.requirementTraceabilityID"),
        field: "type",
        field: "requireTraceId",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.workOrderNo"),
        field: "effectiveDate",
        field: "workOrderNo",
        width: 200,
        align: "center",
      },
      {
        title: t("basic.table.matchQuantity"),
        field: "expiringDate",
        field: "deductionAmount",
        width: 200,
        align: "center",
      },
      {
        title: t("basic.table.workOrderType"),
        field: "expiringDate",
        field: "workOrderType",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.itemNumber"),
        field: "createTime",
        field: "mainPartNumber",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.planStartDay"),
        field: "updateTime",
        field: "planStartDay",
        width: 100,
        align: "center",
      },
      {
        title: t("plan.table.planEndDayDate"),
        field: "updateTime",
        field: "planEndDay",
        width: 100,
        align: "center",
      },
@@ -560,7 +607,7 @@
        width: 100,
        align: "center",
      },
    ]
    ];
  },
  {
    immediate: true,
@@ -572,15 +619,38 @@
}
function handleCheckView(row) {
  openDialog.value = true;
  loadingSub.value = true;
  metalOrderManageSubList(row.workOrderNo).then((res)=>{
    subList.value = res;
    loadingSub.value = false;
    console.log(res,"metalOrderManageSubListmetalOrderManageSubList")
  }).catch(()=>{
    loadingSub.value = false;
  })
}
/** 查询日历管理列表 */
async function handleGenerateList(){
  await generatorPlanList()
}
/** 查询钣金工单计划管理列表 */
function getList() {
  loading.value = true;
  listCalendar(queryParams.value).then((response) => {
    calendarList.value = response.rows;
    page.value.total = response.total;
  if (basicStore.sheetMetalOrderManageList&&basicStore.sheetMetalOrderManageList.rows) {
    orderList.value = basicStore.sheetMetalOrderManageList.rows;
    loading.value = false;
  });
  } else {
    basicStore.getMetalOrderManagerList(queryParams.value).then((response) => {
      orderList.value = response.rows;
      page.value.total = response.total;
      loading.value = false;
    }).catch(()=>{
      loading.value = false;
    });
  }
  // metalOrderManageList(queryParams.value).then((response) => {
  //   orderList.value = response.rows;
  //   page.value.total = response.total;
  //   loading.value = false;
  // });
  // axios
  //   .all([
  //     /** 查询工厂列表 */
@@ -599,11 +669,6 @@
  //     console.error("请求出错:", error);
  //   });
}
// 表单重置
function reset() {
  proxy.resetForm("calendarRef");
}
/** 搜索按钮操作 */
function handleQuery() {
  queryParams.value.pageNum = 1;
@@ -642,16 +707,16 @@
.column-with-margin {
  margin-right: 0px;
}
.mode_box{
.mode_box {
  margin-left: 30px;
  margin-bottom: 10px;
  & span{
  & span {
    padding-right: 20px;
  }
}
.red_color{
  color:#f56c6c;
  margin-bottom:10px;
.red_color {
  color: #f56c6c;
  margin-bottom: 10px;
}
.mart5 {
  margin-top: 5px;