| | |
| | | ref="queryRef" |
| | | :inline="true" |
| | | v-show="showSearch" |
| | | label-width="110px" |
| | | label-position="left" |
| | | > |
| | | <el-form-item label="工单号" prop="description"> |
| | | <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: 140px" |
| | | v-model="queryParams.description" |
| | | placeholder="请输入需求追溯ID" |
| | | :style="{ width: '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="需求追溯ID" prop="description"> |
| | | </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: 140px" |
| | | v-model="queryParams.description" |
| | | placeholder="请输入需求追溯ID" |
| | | :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-col :span="5"> --> |
| | | <el-form-item label="料号" prop="description"> |
| | | </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: 140px" |
| | | v-model="queryParams.description" |
| | | placeholder="请输入料号" |
| | | :style="{ width: '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="延迟风险标识" prop="description"> |
| | | <el-input |
| | | style="width: 140px" |
| | | v-model="queryParams.description" |
| | | placeholder="请输入料号" |
| | | </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( |
| | | 'plan.table.delayRiskIdentification' |
| | | )}`" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> --> |
| | | <el-select |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </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" |
| | | >查询</el-button |
| | | v-model="queryParams.hasDelayRisk" |
| | | style="width: 280px" |
| | | > |
| | | <el-button icon="Refresh" @click="resetQuery">重置</el-button> |
| | | <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-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col |
| | | :span="24" |
| | | style=" |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | align-item: center; |
| | | 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> |
| | | |
| | | <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="Refresh" |
| | | :disabled="multiple" |
| | | @click="handleBatchUpdatePlanDate" |
| | | v-hasPermi="['ApsPlatOrderPlanManager:requirement:list']" |
| | | >{{ $t("plan.btns.batchUpdateOrderDate") }}</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="loadingGenerateList" |
| | | @click="handleGenerateList" |
| | | v-hasPermi="['apsPlatePlan:edit']" |
| | | >{{ $t("plan.btns.generatePlanOrder") }}</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="calendarList" |
| | | :data="orderList" |
| | | :loading="loading" |
| | | :height="height" |
| | | ref="tableRef" |
| | |
| | | @changePageNo="changePageNo" |
| | | @changePageSize="changePageSize" |
| | | @on-checkbox="handleCheckboxChange" |
| | | class="auto-height-grid" |
| | | > |
| | | <template #buttons="{ row }"> |
| | | <el-button |
| | | type="primary" |
| | | link |
| | | @click="handleCheckView(row)" |
| | | v-hasPermi="['ApsPlatOrderPlanManager:requirement:list']" |
| | | >{{ $t("plan.btns.viewRequirement") }}({{row.requireNum}})</el-button |
| | | > |
| | | </template> |
| | | </HxlhTable> |
| | | <el-dialog |
| | | :title="$t('plan.title.viewAssociatedRequirements')" |
| | | v-model="openDialog" |
| | | width="85%" |
| | | style="height:90vh; overflow: hidden" |
| | | append-to-body |
| | | > |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="subGridOptions" |
| | | :data="subList" |
| | | :loading="loadingSub" |
| | | :height="heightSub" |
| | | > |
| | | </HxlhTable> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="openDialog = false">{{ |
| | | $t("common.common.close") |
| | | }}</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog |
| | | :title="$t('plan.btns.batchUpdateOrderDate')" |
| | | v-model="openBatchDialog" |
| | | width="85%" |
| | | style="min-height:90vh; overflow: hidden" |
| | | append-to-body |
| | | > |
| | | <div class="mode_box"> |
| | | <span>{{ $t("plan.title.setMode") }}</span> |
| | | <el-radio-group v-model="radio" @change="changeRadioCustom"> |
| | | <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" 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 |
| | | v-model="customicDate" |
| | | type="dates" |
| | | :placeholder="$t('plan.title.CustomizePlannedCompletionDate')" |
| | | @change="handleChangeCustomDate($event)" |
| | | /> --> |
| | | <el-date-picker |
| | | v-model="customicDate" |
| | | type="datetime" |
| | | :placeholder="$t('plan.title.CustomizePlannedCompletionDate')" |
| | | @change="handleChangeCustomDate($event)" |
| | | /> |
| | | </div> |
| | | <HxlhTable |
| | | v-if="radio === 1" |
| | | style="width: 100%" |
| | | :columns="subUpdateGridOptions" |
| | | :data="subUpdateList" |
| | | :loading="loading" |
| | | :height="heightSubUpdate" |
| | | > |
| | | </HxlhTable> |
| | | <HxlhTable |
| | | v-if="radio === 2" |
| | | style="width: 100%" |
| | | :columns="subUpdateCustomGridOptions" |
| | | :data="subUpdateList" |
| | | :loading="loading" |
| | | :height="heightSubUpdate" |
| | | > |
| | | </HxlhTable> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="openBatchDialog = false">{{ |
| | | $t("common.common.cancel") |
| | | }}</el-button> |
| | | <el-button |
| | | type="primary" |
| | | @click="hanleBatchUpdateDate" |
| | | :disabled="loadingUpdateDate" |
| | | v-hasPermi="['ApsPlatOrderPlanManager:requirement:list']" |
| | | >{{ $t("common.common.batchUpdate") }}</el-button |
| | | > |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="Calendar"> |
| | | <script setup name="SheetMetalOrderManage"> |
| | | import HxlhTable from "@/components/HxlhTable"; |
| | | import { |
| | | listCalendar, |
| | | getCalendar, |
| | | delCalendar, |
| | | addCalendar, |
| | | updateCalendar, |
| | | } from "@/api/basicData/calendar"; |
| | | import axios from "axios"; |
| | | import { parseTime } from "@/utils/ruoyi.js"; |
| | | 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 { selectProcessNameList } from "@/api/basicData/processRoute.js"; |
| | | import { |
| | | metalOrderManageList, |
| | | metalOrderManageSubList, |
| | | generatorPlanList, |
| | | planDateList, |
| | | } from "@/api/mainPlan/metalOrderManage.js"; |
| | | import { useI18n } from "vue-i18n"; //要在js中使用国际化 |
| | | import { ElMessage } from "element-plus"; |
| | | const { t, locale } = useI18n(); |
| | | const basicStore = useBasicStore(); |
| | | const { proxy } = getCurrentInstance(); |
| | | const tableRef = ref(); |
| | | const calendarList = ref([]); |
| | | const loading = ref(true); |
| | | 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); |
| | | const openBatchDialog = ref(false); |
| | | const subGridOptions = ref([]); |
| | | const subUpdateGridOptions = ref([]); |
| | | const subUpdateCustomGridOptions = ref([]); |
| | | const subList = ref([]); |
| | | const subUpdateList = ref([]); |
| | | // const tableRef = ref(); |
| | | const orderList = ref([]); |
| | | const loading = ref(false); |
| | | const loadingUpdateDate = ref(false); |
| | | const loadingGenerateList = ref(false); |
| | | const loadingSub = ref(false); |
| | | const showSearch = ref(true); |
| | | const ids = ref([]); |
| | | const single = ref(true); |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | description: null, |
| | | type: null, |
| | | effectiveDate: null, |
| | | expiringDate: null, |
| | | content: null, |
| | | applicableFactory: null, |
| | | applicableWorkshop: null, |
| | | applicableProcess: null, |
| | | workOrderNo: null, |
| | | requireTrackId: null, |
| | | mainPartNumber: null, |
| | | hasDelayRisk: null, |
| | | }, |
| | | }); |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | const typeRadioNumber = ref(1); |
| | | const plantList = ref([]); |
| | | const shopList = ref([]); |
| | | const allShopList = ref([]); |
| | | const processList = ref([]); |
| | | const height = ref(document.documentElement.clientHeight - 220 + "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([ |
| | | { type: "checkbox", width: 60, align: "center" }, |
| | | { |
| | | title: "需求ID", |
| | | field: "description", |
| | | width: 150, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "需求追溯ID", |
| | | field: "type", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "工单号", |
| | | field: "effectiveDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "匹配数量", |
| | | field: "expiringDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "工单类型", |
| | | field: "expiringDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "料号", |
| | | field: "createTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "主件图号", |
| | | field: "createTime", |
| | | 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", |
| | | }, |
| | | { |
| | | 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: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | ]); |
| | | const columns = ref([]); |
| | | // 分页属性 |
| | | const page = ref({ |
| | | total: 0, |
| | | current: 1, |
| | | size: 10, |
| | | }); |
| | | |
| | | /** 查询日历管理列表 */ |
| | | 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.requirementTraceabilityID"), |
| | | field: "requireTrackId", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.workOrderNo"), |
| | | field: "workOrderNo", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("basic.table.matchQuantity"), |
| | | field: "deductionAmount", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("basic.table.workOrderType"), |
| | | 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"), |
| | | field: "mainPartNumber", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.mainPartDrawingNumber"), |
| | | field: "mainPartDrawingNumber", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("basic.table.mainCustomer"), |
| | | field: "customer", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.productionQuantity"), |
| | | field: "productionQuantity", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("basic.table.applicableFactories"), |
| | | field: "applicableFactories", |
| | | width: 200, |
| | | 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"), |
| | | field: "productionBase", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planStartDay"), |
| | | field: "planStartDay", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planEndDayDate"), |
| | | field: "planEndDay", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.workorderCreationTime"), |
| | | field: "orderCreateTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.mismatchedProductionQuantity"), |
| | | field: "unmatchedQuantity", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.delayRiskIdentification"), |
| | | field: "hasDelayRisk", |
| | | width: 100, |
| | | align: "center", |
| | | formatter: ({ cellValue, row, column }) => { |
| | | if (cellValue) { |
| | | 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.require"), |
| | | width: 150, |
| | | fixed: "right", |
| | | slots: { default: "buttons" }, |
| | | align: "center", |
| | | }, |
| | | ]; |
| | | subGridOptions.value = [ |
| | | { |
| | | title: t("basic.table.requirementID"), |
| | | field: "id", |
| | | width: 150, |
| | | align: "center", |
| | | }, |
| | | // { |
| | | // title: t("basic.table.requirementTraceabilityID"), |
| | | // field: "requireId", |
| | | // width: 200, |
| | | // align: "center", |
| | | // }, |
| | | { |
| | | title: t("plan.table.itemNumber"), |
| | | field: "bomLineCode", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.bomLowCode"), |
| | | field: "bomLineLevel", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.bomUsage"), |
| | | field: "bomUseAmount", |
| | | 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("plan.table.demandQuantity"), |
| | | field: "requireAmount", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.netRequirement"), |
| | | field: "netRequirement", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planStartDay"), |
| | | field: "startDate", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planEndDayDate"), |
| | | field: "completeDate", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.requirementDate"), |
| | | field: "demandDate", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("basic.table.applicableFactories"), |
| | | 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"), |
| | | field: "productionBase", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.matchState"), |
| | | 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", |
| | | formatter: ({ cellValue, row, column }) => { |
| | | if (cellValue) { |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | ]; |
| | | subUpdateGridOptions.value = [ |
| | | // { |
| | | // title: t("basic.table.requirementID"), |
| | | // field: "requireId", |
| | | // width: 150, |
| | | // align: "center", |
| | | // }, |
| | | { |
| | | title: t("basic.table.requirementTraceabilityID"), |
| | | field: "requireTrackId", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.workOrderNo"), |
| | | field: "workOrderNo", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("basic.table.matchQuantity"), |
| | | field: "deductionAmount", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("basic.table.workOrderType"), |
| | | 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"), |
| | | field: "mainPartNumber", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planStartDay"), |
| | | field: "planStartDay", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planEndDayDate"), |
| | | field: "planEndDay", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.startDateOfDemandPlan"), |
| | | field: "startDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.requirementPlanCompletionDate"), |
| | | field: "completeDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | ]; |
| | | subUpdateCustomGridOptions.value = [ |
| | | // { |
| | | // title: t("basic.table.requirementID"), |
| | | // field: "requireId", |
| | | // width: 150, |
| | | // align: "center", |
| | | // }, |
| | | { |
| | | title: t("basic.table.requirementTraceabilityID"), |
| | | field: "requireTrackId", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.workOrderNo"), |
| | | field: "workOrderNo", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("basic.table.matchQuantity"), |
| | | field: "deductionAmount", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("basic.table.workOrderType"), |
| | | 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"), |
| | | field: "mainPartNumber", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planStartDay"), |
| | | field: "planStartDay", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planEndDayDate"), |
| | | field: "planEndDay", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.customizePlannedCompletionDate"), |
| | | field: "customTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | ]; |
| | | }, |
| | | { |
| | | immediate: true, |
| | | deep: true, |
| | | } |
| | | ); |
| | | function changeRadioCustom() {} |
| | | function handleBatchUpdatePlanDate() { |
| | | openBatchDialog.value = true; |
| | | } |
| | | function handleChangeCustomDate(e) { |
| | | customicDate.value = parseTime(e); //new Date(e).getFullYear()+ '-' + parseInt(new Date(e).getMonth()*1+1) + '-' + new Date(e).getDate() |
| | | console.log(customicDate.value, "chang date"); |
| | | if (radio.value == 2) { |
| | | subUpdateList.value = subUpdateList.value.map((item) => { |
| | | return { |
| | | ...item, |
| | | customTime: customicDate.value, |
| | | }; |
| | | }); |
| | | console.log(subUpdateList.value, "changeRadioCustom"); |
| | | } |
| | | } |
| | | function handleCheckView(row) { |
| | | openDialog.value = true; |
| | | loadingSub.value = true; |
| | | metalOrderManageSubList(row.workOrderNo) |
| | | .then((res) => { |
| | | subList.value = res; |
| | | loadingSub.value = false; |
| | | }) |
| | | .catch(() => { |
| | | loadingSub.value = false; |
| | | }); |
| | | } |
| | | async function hanleBatchUpdateDate() { |
| | | loadingUpdateDate.value = true; |
| | | let planIds = subUpdateList.value.map((item) => { |
| | | return item.id; |
| | | }); |
| | | let res = null; |
| | | console.log(planIds, "planIds"); |
| | | if (radio.value == 1) { |
| | | res = await planDateList({ |
| | | isCustom: false, |
| | | planIds, |
| | | }); |
| | | } else { |
| | | res = await planDateList({ |
| | | isCustom: true, |
| | | planIds, |
| | | customDate: customicDate.value, |
| | | }); |
| | | console.log(res, "res planDateList"); |
| | | } |
| | | if (res.code === 200) { |
| | | ElMessage({ |
| | | message: t("plan.message.update"), |
| | | type: "success", |
| | | }); |
| | | openBatchDialog.value = false; |
| | | loadingUpdateDate.value = false; |
| | | getList(); |
| | | } else { |
| | | openBatchDialog.value = true; |
| | | loadingUpdateDate.value = false; |
| | | } |
| | | } |
| | | async function handleGenerateList() { |
| | | loadingGenerateList.value = true; |
| | | const res = await generatorPlanList(); |
| | | if (res.code == 200) { |
| | | ElMessage({ |
| | | message: t("plan.message.update"), |
| | | type: "success", |
| | | }); |
| | | loadingGenerateList.value = false; |
| | | getList(); |
| | | } else { |
| | | loadingGenerateList.value = false; |
| | | } |
| | | } |
| | | /** 查询钣金工单计划管理列表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | listCalendar(queryParams.value).then((response) => { |
| | | calendarList.value = response.rows; |
| | | page.value.total = response.total; |
| | | loading.value = false; |
| | | }); |
| | | axios |
| | | .all([ |
| | | /** 查询工厂列表 */ |
| | | listAll_plant({}), |
| | | /** 查询车间列表 */ |
| | | listAll_shop({}), |
| | | ]) |
| | | .then( |
| | | axios.spread((response1, response2) => { |
| | | plantList.value = response1.data; |
| | | shopList.value = response2.data; |
| | | loading.value = false; |
| | | }) |
| | | ) |
| | | .catch((error) => { |
| | | console.error("请求出错:", error); |
| | | metalOrderManageList(queryParams.value) |
| | | .then((response) => { |
| | | orderList.value = response.rows; |
| | | page.value.total = response.total; |
| | | loading.value = false; |
| | | }) |
| | | .catch((res) => { |
| | | loading.value = false; |
| | | }); |
| | | } |
| | | |
| | | // 取消按钮 |
| | | function cancel() { |
| | | open.value = false; |
| | | reset(); |
| | | } |
| | | |
| | | // 表单重置 |
| | | function reset() { |
| | | form.value = { |
| | | id: null, |
| | | description: null, |
| | | type: "1", |
| | | effectiveDate: null, |
| | | expiringDate: null, |
| | | content: null, |
| | | applicableFactory: null, |
| | | applicableWorkshop: null, |
| | | applicableProcess: null, |
| | | createBy: null, |
| | | createTime: null, |
| | | updateBy: null, |
| | | updateTime: null, |
| | | }; |
| | | proxy.resetForm("calendarRef"); |
| | | } |
| | | |
| | | // axios |
| | | // .all([ |
| | | // /** 查询工厂列表 */ |
| | | // listAll_plant({}), |
| | | // /** 查询车间列表 */ |
| | | // listAll_shop({}), |
| | | // ]) |
| | | // .then( |
| | | // axios.spread((response1, response2) => { |
| | | // plantList.value = response1.data; |
| | | // shopList.value = response2.data; |
| | | // loading.value = false; |
| | | // }) |
| | | // ) |
| | | // .catch((error) => { |
| | | // console.error("请求出错:", error); |
| | | // }); |
| | | /** 搜索按钮操作 */ |
| | | function handleQuery() { |
| | | console.log("111111"); |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | |
| | | function resetQuery() { |
| | | proxy.resetForm("queryRef"); |
| | | handleQuery(); |
| | | } |
| | | |
| | | // 多选框选中数据 |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map((item) => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** 新增按钮操作 */ |
| | | async function handleAdd() { |
| | | reset(); |
| | | open.value = true; |
| | | title.value = "添加日历管理"; |
| | | } |
| | | /** 选择工厂后事件 加载车间 和 工序 **/ |
| | | function changePlant(plant) { |
| | | listAps_shop({ plantCode: plant }).then((response) => { |
| | | shopList.value = response.rows; |
| | | }); |
| | | selectProcessNameList({ orgCode: plant }).then((response) => { |
| | | processList.value = response.rows; |
| | | }); |
| | | } |
| | | /** 修改按钮操作 */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | const _id = row.id || ids.value; |
| | | getCalendar(_id).then((response) => { |
| | | form.value = response.data; |
| | | // form.value.content = JSON.parse(response.data.content.value); |
| | | if (form.value.type === "1") { |
| | | weekDaysSettingList.value = JSON.parse( |
| | | response.data.content.value |
| | | ).weekdays; |
| | | } else if (form.value.type === "2") { |
| | | holidays.value = JSON.parse(response.data.content.value).holidays; |
| | | } |
| | | |
| | | open.value = true; |
| | | title.value = "修改日历管理"; |
| | | }); |
| | | } |
| | | |
| | | /** 提交按钮 */ |
| | | function submitForm() { |
| | | proxy.$refs["calendarRef"].validate((valid) => { |
| | | if (valid) { |
| | | if (form.value.id != null) { |
| | | if (form.value.type === "1") { |
| | | updateCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | weekdays: weekDaysSettingList.value, |
| | | }, |
| | | applicableWorkshop: form.value.applicableWorkshop, |
| | | applicableProcess: form.value.applicableProcess, |
| | | }).then((response) => { |
| | | proxy.$modal.msgSuccess("修改成功"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else if (form.value.type === "2") { |
| | | updateCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | holidays: holidays.value, |
| | | }, |
| | | applicableWorkshop: form.value.applicableWorkshop, |
| | | applicableProcess: form.value.applicableProcess, |
| | | }).then((response) => { |
| | | proxy.$modal.msgSuccess("修改成功"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } |
| | | } else { |
| | | if (form.value.type === "1") { |
| | | addCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | weekdays: weekDaysSettingList.value, |
| | | }, |
| | | }).then((response) => { |
| | | proxy.$modal.msgSuccess("新增成功"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else if (form.value.type === "2") { |
| | | addCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | holidays: holidays.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 delCalendar(_ids); |
| | | }) |
| | | .then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | }) |
| | | .catch(() => {}); |
| | | } |
| | | |
| | | /** 导出按钮操作 */ |
| | | function handleExport() { |
| | | proxy.download( |
| | | "core/calendar/export", |
| | | { |
| | | ...queryParams.value, |
| | | }, |
| | | `calendar_${new Date().getTime()}.xlsx` |
| | | ); |
| | | } |
| | | function handleSwitchType(e) { |
| | | typeRadioNumber.value = e; |
| | | form.value.type = e; |
| | | form.value.effectiveDate = null; |
| | | form.value.expiringDate = null; |
| | | form.value.content = null; |
| | | form.value.applicableFactory = null; |
| | | form.value.applicableWorkshop = null; |
| | | form.value.applicableProcess = null; |
| | | } |
| | | function changePageNo(currentPage) { |
| | | queryParams.value.pageNum = currentPage; |
| | |
| | | } |
| | | // 多选框选中数据 |
| | | const handleCheckboxChange = (data) => { |
| | | console.log(data, "handleCheckboxChange"); |
| | | ids.value = data.records.map((item) => item.id); |
| | | single.value = data.records.length !== 1; |
| | | multiple.value = !data.records.length; |
| | | subUpdateList.value = data.records; |
| | | }; |
| | | onMounted(() => { |
| | | getList(); |
| | |
| | | .column-with-margin { |
| | | margin-right: 0px; |
| | | } |
| | | .title_bar_line { |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-items: center; |
| | | color: #333; |
| | | .mode_box { |
| | | margin-left: 30px; |
| | | margin-bottom: 10px; |
| | | .line_short { |
| | | width: 5%; |
| | | height: 1px; |
| | | margin-right: 20px; |
| | | border-top: 1px solid #ddd; |
| | | } |
| | | .line_long { |
| | | width: 60%; |
| | | height: 1px; |
| | | margin-left: 20px; |
| | | border-top: 1px solid #ddd; |
| | | & span { |
| | | padding-right: 20px; |
| | | } |
| | | } |
| | | .week_flex { |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-content: center; |
| | | color: #606266; |
| | | font-weight: 700; |
| | | margin-left: 20px; |
| | | &.mt20 { |
| | | margin-top: 20px; |
| | | margin-left: 0 !important; |
| | | } |
| | | .week_flex_item { |
| | | &:nth-child(1) { |
| | | margin-top: 5px; |
| | | } |
| | | &:nth-child(2) { |
| | | margin-left: 20px; |
| | | } |
| | | } |
| | | } |
| | | .factory_use_item { |
| | | margin-top: 10px; |
| | | .red_color { |
| | | color: #f56c6c; |
| | | margin-bottom: 10px; |
| | | } |
| | | .mart5 { |
| | | margin-top: 5px; |
| | | } |
| | | .custom-height { |
| | | height: 200px; /* 或者使用 min-height */ |
| | | } |
| | | .auto-height-grid .xe-body .xe-body--row { |
| | | height: auto; /* 或者使用 min-height */ |
| | | } |
| | | </style> |