| | |
| | | import request from '@/utils/request' |
| | | import request from "@/utils/request"; |
| | | |
| | | // 查询字典 |
| | | export function queryConfigParams(dictType) { |
| | | return request({ |
| | | url: `/system/dict/data/type/${dictType}`, |
| | | method: 'get' |
| | | }) |
| | | method: "get", |
| | | }); |
| | | } |
| | | |
| | | export function queryConfigParamsSave(data) { |
| | | return request({ |
| | | url: `/system/dict/data`, |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | method: "put", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | export function supplyGapList(query) { |
| | | return request({ |
| | | url: `/aps/ApsPlateStandardRequire/supplyGapList`, |
| | | method: "get", |
| | | params: query |
| | | }); |
| | | } |
| | |
| | | operationSequence: "工序序号", |
| | | applicableWorkshop:"适用车间", |
| | | productivityModel: "产能模型", |
| | | designCapacity:"设计产能" |
| | | designCapacity:"设计产能", |
| | | requirementID:"需求ID", |
| | | requirementTraceabilityID:"需求追溯ID", |
| | | matchQuantity:"匹配数量", |
| | | workOrderType:"工单类型", |
| | | mainCustomer:"主件客户" |
| | | } |
| | | }; |
| | | |
| | |
| | | operationSequence: "Operation sequence ", |
| | | applicableWorkshop:"Applicable workshop", |
| | | productivityModel:"Productivity model", |
| | | designCapacity:"Design capacity" |
| | | designCapacity:"Design capacity", |
| | | requirementID:"Requirement ID", |
| | | requirementTraceabilityID:"Requirement traceability ID", |
| | | matchQuantity:"Match Quantity", |
| | | workOrderType:"Work order type", |
| | | mainCustomer:"Main customer" |
| | | } |
| | | }; |
| | |
| | | requireID: "需求ID", |
| | | requireTraceID: "需求追溯ID", |
| | | bomLowCode:"BOM低阶码", |
| | | bomUsage:"BOM用量", |
| | | matchState:"匹配状态", |
| | | matchPattern:"匹配模式", |
| | | unmatchedDemandQuantity:"未匹配需求数量", |
| | |
| | | // 钣金冗余工单报表 |
| | | subItemPartNumber:"子件料号", |
| | | mismatchedProductionQuantity:"未匹配生产数量", |
| | | workorderCreationTime:"工单创建时间" |
| | | workorderCreationTime:"工单创建时间", |
| | | delayRiskIdentification:"延迟风险标识", |
| | | startDateOfDemandPlan:"需求计划开工日", |
| | | requirementPlanCompletionDate:"需求计划完工日", |
| | | processRouteWorkingHours:"工艺路线工时", |
| | | demandQuantity:"需求数量", |
| | | netRequirement:"净需求量" |
| | | }, |
| | | }; |
| | | export const en = { |
| | |
| | | requireID: "Requirement ID", |
| | | requireTraceID: "Requirement traceability ID", |
| | | bomLowCode:"BOM low-level code", |
| | | bomUsage:"BOM usage", |
| | | matchState:"Match State", |
| | | matchPattern:"Match Pattern", |
| | | unmatchedDemandQuantity:"Unmatched Demand Quantity", |
| | |
| | | // 钣金冗余工单报表 |
| | | subItemPartNumber:"Sub Item Part Number", |
| | | mismatchedProductionQuantity:"Mismatched Production Quantity", |
| | | workorderCreationTime:"Work order creation time" |
| | | workorderCreationTime:"Work order creation time", |
| | | delayRiskIdentification:"Delay risk identification", |
| | | startDateOfDemandPlan:"Start date of demand plan", |
| | | requirementPlanCompletionDate:"Requirement plan completion date", |
| | | processRouteWorkingHours:"Process route working hours", |
| | | demandQuantity:"Demand Quantity", |
| | | netRequirement:"Net Requirement" |
| | | }, |
| | | }; |
| | |
| | | :data="subList" |
| | | :loading="loading" |
| | | :height="heightSub" |
| | | @on-checkbox="handleCheckboxChange" |
| | | :page="page" |
| | | @changePageNo="changePageNo" |
| | | @changePageSize="changePageSize" |
| | | > |
| | | </HxlhTable> |
| | | </el-dialog> |
| | |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | :disabled="multiple" |
| | | @click="handleBatchUpdatePlanDate" |
| | | v-hasPermi="['apsPlatePlan:edit']" |
| | | >批量更新工单计划日期</el-button |
| | | > |
| | |
| | | type="success" |
| | | plain |
| | | icon="Edit" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['apsPlatePlan:edit']" |
| | | >生成钣金计划工单</el-button |
| | |
| | | > |
| | | </template> |
| | | </HxlhTable> |
| | | <el-dialog :title="title" v-model="openDialog" width="900px" append-to-body> |
| | | <el-dialog |
| | | :title="'查看关联需求'" |
| | | v-model="openDialog" |
| | | width="900px" |
| | | append-to-body |
| | | > |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="subGridOptions" |
| | | :data="subList" |
| | | :loading="loading" |
| | | :height="heightSub" |
| | | @on-checkbox="handleCheckboxChange" |
| | | :page="page" |
| | | @changePageNo="changePageNo" |
| | | @changePageSize="changePageSize" |
| | | > |
| | | </HxlhTable> |
| | | </el-dialog> |
| | |
| | | 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 openDialog = ref(false); |
| | | const subGridOptions = ref([]); |
| | | const tableRef = ref(); |
| | | // const tableRef = ref(); |
| | | const calendarList = ref([]); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | |
| | | const processList = ref([]); |
| | | const height = ref(document.documentElement.clientHeight - 220 + "px;"); |
| | | // 表格配置-列表 |
| | | const columns = ref([ |
| | | const columns = ref([]); |
| | | // 分页属性 |
| | | const page = ref({ |
| | | total: 0, |
| | | current: 1, |
| | | size: 10, |
| | | }); |
| | | watch( |
| | | locale, |
| | | (newLocale) => { |
| | | columns.value = [ |
| | | { type: "checkbox", width: 60, align: "center" }, |
| | | { |
| | | title: "需求ID", |
| | | title: t("basic.table.requirementID"), |
| | | field: "description", |
| | | width: 150, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "需求追溯ID", |
| | | title: t("basic.table.requirementTraceabilityID"), |
| | | field: "type", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "工单号", |
| | | title: t("plan.table.workOrderNo"), |
| | | field: "effectiveDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "匹配数量", |
| | | title: t("basic.table.matchQuantity"), |
| | | field: "expiringDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "工单类型", |
| | | title: t("basic.table.workOrderType"), |
| | | field: "expiringDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "料号", |
| | | title: t("plan.table.itemNumber"), |
| | | field: "createTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "主件图号", |
| | | title: t("plan.table.mainPartDrawingNumber"), |
| | | field: "createTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "主件客户", |
| | | title: t("basic.table.mainCustomer"), |
| | | field: "createTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "生产数量", |
| | | title: t("plan.table.productionQuantity"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "需求日期", |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "适用工厂", |
| | | title: t("basic.table.applicableFactories"), |
| | | field: "applicableFactory", |
| | | width: 200, |
| | | align: "center", |
| | |
| | | }, |
| | | }, |
| | | { |
| | | title: "生产基地", |
| | | title: t("plan.table.productionBase"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planStartDay"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planEndDayDate"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.workorderCreationTime"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.mismatchedProductionQuantity"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.delayRiskIdentification"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | |
| | | slots: { default: "buttons" }, |
| | | align: "center", |
| | | }, |
| | | ]); |
| | | // 分页属性 |
| | | const page = ref({ |
| | | total: 0, |
| | | current: 1, |
| | | size: 10, |
| | | }); |
| | | ]; |
| | | subGridOptions.value = [ |
| | | { |
| | | title: t("basic.table.requirementID"), |
| | | field: "description", |
| | | width: 150, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("basic.table.requirementTraceabilityID"), |
| | | field: "type", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.itemNumber"), |
| | | field: "effectiveDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.bomLowCode"), |
| | | field: "expiringDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.bomUsage"), |
| | | field: "expiringDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("basic.table.processRouteID"), |
| | | field: "createTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.processRouteWorkingHours"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.demandQuantity"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.netRequirement"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.requirementPlanCompletionDate"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planStartDay"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planEndDayDate"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.requirementDate"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("basic.table.applicableFactories"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.productionBase"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.matchState"), |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | ]; |
| | | }, |
| | | { |
| | | immediate: true, |
| | | deep: true, |
| | | } |
| | | ); |
| | | function handleBatchUpdatePlanDate(){ |
| | | |
| | | } |
| | | function handleCheckView(row) { |
| | | openDialog.value = true; |
| | | // listProcessRoute({ workOrderNo: row.documentNumber }).then((data) => { |
| | |
| | | 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; |
| | |
| | | <el-col :span="locale === 'zh' ? 5 : 10"> |
| | | <el-form-item |
| | | :label="$t('plan.query.requireTraceID')" |
| | | prop="description" |
| | | prop="requireId" |
| | | > |
| | | <el-input |
| | | :style="{ width: locale === 'zh' ? '140px' : '300px' }" |
| | | v-model="queryParams.description" |
| | | v-model="queryParams.requireId" |
| | | :placeholder="`${$t('plan.placeholder.requireTraceID')}`" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="locale === 'zh' ? 8 : 9"> |
| | | <el-form-item :label="$t('plan.query.itemNumber')" prop="description"> |
| | | <el-form-item :label="$t('plan.query.itemNumber')" prop="bomLineCode"> |
| | | <el-input |
| | | :style="{ width: locale === 'zh' ? '140px' : '210px' }" |
| | | v-model="queryParams.description" |
| | | v-model="queryParams.bomLineCode" |
| | | :placeholder="`${$t('common.common.placeholder')}${$t( |
| | | 'plan.query.itemNumber' |
| | | )}`" |
| | |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="calendarList" |
| | | :data="gapList" |
| | | :loading="loading" |
| | | :height="height" |
| | | ref="tableRef" |
| | |
| | | <script setup name="Calendar"> |
| | | import HxlhTable from "@/components/HxlhTable"; |
| | | import { |
| | | listCalendar, |
| | | getCalendar, |
| | | delCalendar, |
| | | addCalendar, |
| | | updateCalendar, |
| | | } from "@/api/basicData/calendar"; |
| | | supplyGapList |
| | | } from "@/api/basicData/sheetMetalConfig/sheetMetalConfig"; |
| | | import axios from "axios"; |
| | | 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([]); |
| | | const gapList = ref([]); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref([]); |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | description: null, |
| | | type: null, |
| | | effectiveDate: null, |
| | | expiringDate: null, |
| | | content: null, |
| | | applicableFactory: null, |
| | | applicableWorkshop: null, |
| | | applicableProcess: null, |
| | | bomLineCode: null, |
| | | requireId: null |
| | | }, |
| | | }); |
| | | const { queryParams, form, rules } = toRefs(data); |
| | |
| | | columns.value = [ |
| | | { |
| | | title: t("plan.table.requireID"), |
| | | field: "description", |
| | | field: "id", |
| | | width: 150, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.requireTraceID"), |
| | | 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.matchState"), |
| | | field: "expiringDate", |
| | | field: "matchState", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.matchPattern"), |
| | | field: "createTime", |
| | | field: "matchMode", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.unmatchedDemandQuantity"), |
| | | field: "createTime", |
| | | field: "unmatchedDemandAmount", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planStartDay"), |
| | | field: "createTime", |
| | | field: "startDate", |
| | | width: 200, |
| | | 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("plan.table.applicableFactories"), |
| | | field: "applicableFactory", |
| | | field: "orgCode", |
| | | width: 200, |
| | | align: "center", |
| | | formatter: ({ cellValue, row, column }) => { |
| | |
| | | }, |
| | | { |
| | | title: t("plan.table.productionBase"), |
| | | field: "updateTime", |
| | | field: "productionBase", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | |
| | | /** 查询日历管理列表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | listCalendar(queryParams.value).then((response) => { |
| | | calendarList.value = response.rows; |
| | | supplyGapList(queryParams.value).then((response) => { |
| | | gapList.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; |
| | | }).catch(()=>{ |
| | | loading.value = false; |
| | | }) |
| | | ) |
| | | .catch((error) => { |
| | | console.error("请求出错:", error); |
| | | }); |
| | | listAll_plant({}).then(response=>{ |
| | | plantList.value = response.data; |
| | | }) |
| | | } |
| | | |
| | | // 取消按钮 |
| | | 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, |
| | | queryParams.value = { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | bomLineCode: null, |
| | | requireId: null |
| | | }; |
| | | proxy.resetForm("calendarRef"); |
| | | } |
| | |
| | | /** 搜索按钮操作 */ |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1; |
| | | page.value.current = 1 |
| | | getList(); |
| | | } |
| | | |
| | |
| | | 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", |
| | | "aps/ApsPlateStandardRequire/supplyGapListExport", |
| | | { |
| | | ...queryParams.value, |
| | | }, |
| | | `calendar_${new Date().getTime()}.xlsx` |
| | | `supplyGapListExport_${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; |
| | |
| | | queryParams.value.pageSize = pageSize; |
| | | getList(); |
| | | } |
| | | // 多选框选中数据 |
| | | const handleCheckboxChange = (data) => { |
| | | ids.value = data.records.map((item) => item.id); |
| | | single.value = data.records.length !== 1; |
| | | multiple.value = !data.records.length; |
| | | }; |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |