diff --git a/erp-frontend-vue/src/api/productionPlan.ts b/erp-frontend-vue/src/api/productionPlan.ts index 3c78367..0dc4dac 100644 --- a/erp-frontend-vue/src/api/productionPlan.ts +++ b/erp-frontend-vue/src/api/productionPlan.ts @@ -57,10 +57,6 @@ export interface ProductionPlan { slaveList?: PlanLine[] /** 部门名称(单据视图) */ deptName?: string - /** 操作员/业务人员(单据视图表头) */ - operatorName?: string - /** 审核日期 */ - approveDate?: string /** 物料清单(BOM运算结果,详情页只读) */ mbomList?: MbomLine[] /** 补料清单(详情页只读) */ diff --git a/erp-frontend-vue/src/api/rd/ebom.ts b/erp-frontend-vue/src/api/rd/ebom.ts index 7524383..1775629 100644 --- a/erp-frontend-vue/src/api/rd/ebom.ts +++ b/erp-frontend-vue/src/api/rd/ebom.ts @@ -67,6 +67,9 @@ export interface EbomLine { delFlag?: string /** 前端临时字段 */ _isNew?: boolean + /** 扩展属性(后端可能返回 attr1/attr2 等) */ + attr1?: string + attr2?: string } /** 查询参数 */ diff --git a/erp-frontend-vue/src/permission.ts b/erp-frontend-vue/src/permission.ts index a08fb86..fe63a5e 100644 --- a/erp-frontend-vue/src/permission.ts +++ b/erp-frontend-vue/src/permission.ts @@ -10,7 +10,7 @@ const whiteList = ['/login', '/register'] const DEV_SKIP_AUTH = import.meta.env.DEV && !import.meta.env.VITE_REQUIRE_AUTH // 路由守卫 -router.beforeEach(async (to, from, next) => { +router.beforeEach(async (to, _from, next) => { // 设置页面标题 document.title = to.meta.title ? `${to.meta.title} - ERP系统` : 'ERP系统' diff --git a/erp-frontend-vue/src/views/MasterData/Item/index.vue b/erp-frontend-vue/src/views/MasterData/Item/index.vue index 2bfb907..3f2a63a 100644 --- a/erp-frontend-vue/src/views/MasterData/Item/index.vue +++ b/erp-frontend-vue/src/views/MasterData/Item/index.vue @@ -432,6 +432,7 @@ async function handleUpdate(row?: MdItem) { resetForm() await getTreeselect() const itemId = row?.itemId || ids.value[0] + if (!itemId) return const res = await getMdItem(itemId) Object.assign(form, res.data) optType.value = 'edit' diff --git a/erp-frontend-vue/src/views/MasterData/Unit/index.vue b/erp-frontend-vue/src/views/MasterData/Unit/index.vue index 15e9e49..08f0da9 100644 --- a/erp-frontend-vue/src/views/MasterData/Unit/index.vue +++ b/erp-frontend-vue/src/views/MasterData/Unit/index.vue @@ -218,6 +218,7 @@ function handleAdd() { async function handleUpdate(row?: UnitMeasure) { resetForm() const measureId = row?.measureId || ids.value[0] + if (!measureId) return const res = await getUnitMeasure(measureId) Object.assign(form, res.data) dialogTitle.value = '修改计量单位' diff --git a/erp-frontend-vue/src/views/MasterData/Workshop/index.vue b/erp-frontend-vue/src/views/MasterData/Workshop/index.vue index 93806bf..3905064 100644 --- a/erp-frontend-vue/src/views/MasterData/Workshop/index.vue +++ b/erp-frontend-vue/src/views/MasterData/Workshop/index.vue @@ -209,6 +209,7 @@ function handleAdd() { async function handleUpdate(row?: Workshop) { resetForm() const workshopId = row?.workshopId || ids.value[0] + if (!workshopId) return const res = await getWorkshop(workshopId) Object.assign(form, res.data) dialogTitle.value = '修改车间' diff --git a/erp-frontend-vue/src/views/MasterData/Workstation/index.vue b/erp-frontend-vue/src/views/MasterData/Workstation/index.vue index 06d47af..98e3595 100644 --- a/erp-frontend-vue/src/views/MasterData/Workstation/index.vue +++ b/erp-frontend-vue/src/views/MasterData/Workstation/index.vue @@ -230,6 +230,7 @@ async function handleUpdate(row?: Workstation) { resetForm() await getWorkshops() const workstationId = row?.workstationId || ids.value[0] + if (!workstationId) return const res = await getWorkstation(workstationId) Object.assign(form, res.data) dialogTitle.value = '修改工作站' diff --git a/erp-frontend-vue/src/views/Production/Mbom/form.vue b/erp-frontend-vue/src/views/Production/Mbom/form.vue index bfcd92a..e2080dc 100644 --- a/erp-frontend-vue/src/views/Production/Mbom/form.vue +++ b/erp-frontend-vue/src/views/Production/Mbom/form.vue @@ -41,7 +41,7 @@ {{ getStatusLabel(form.status) }} {{ getBusinessTypeLabel(form.businessType) }} - {{ getSupplyTypeLabel(form.supplyType) }} + {{ getSupplyTypeLabel(form.supplyType ?? '') }} {{ form.planCode }} {{ form.planCode || '-' }} @@ -52,7 +52,7 @@ {{ form.unitName || '-' }} {{ formatNumber(form.quantity) }} {{ form.workshopName || '-' }} - {{ getIssueStatusLabel(form.issueStatus) }} + {{ getIssueStatusLabel(form.issueStatus ?? '') }} {{ form.approverName || '-' }} {{ form.approveDate || '-' }} {{ form.remark || '-' }} diff --git a/erp-frontend-vue/src/views/Production/Parts/index.vue b/erp-frontend-vue/src/views/Production/Parts/index.vue index 9b2bb56..848cfa2 100644 --- a/erp-frontend-vue/src/views/Production/Parts/index.vue +++ b/erp-frontend-vue/src/views/Production/Parts/index.vue @@ -237,11 +237,11 @@ function handleAdd() { ElMessage.info('新增零部件订单功能开发中') } -function handleView(row: PartsOrder) { +function handleView(_row: PartsOrder) { ElMessage.info('查看零部件订单详情') } -function handleProgress(row: PartsOrder) { +function handleProgress(_row: PartsOrder) { ElMessage.info('查看生产进度') } diff --git a/erp-frontend-vue/src/views/Production/PlanOrder/form.vue b/erp-frontend-vue/src/views/Production/PlanOrder/form.vue index e6c8681..d403962 100644 --- a/erp-frontend-vue/src/views/Production/PlanOrder/form.vue +++ b/erp-frontend-vue/src/views/Production/PlanOrder/form.vue @@ -652,7 +652,7 @@ import { ref, reactive, computed, onMounted, watch, nextTick } from 'vue' import { useRoute, useRouter } from 'vue-router' import { ElMessage, ElMessageBox } from 'element-plus' -import { Check, Finished, Upload, Plus, Edit, ArrowLeft, ArrowRight, View } from '@element-plus/icons-vue' +import { Check, Finished, Upload, Plus, Edit, ArrowLeft, ArrowRight } from '@element-plus/icons-vue' import { getProductionPlanDetail, getProductionPlanList, @@ -1166,7 +1166,7 @@ async function handleConfirmImport() { firstOrder = detail formData.salesOrderId = detail.orderId formData.salesOrderCode = detail.orderCode - formData.salesUserName = detail.userName ?? detail.salesmanName ?? detail.salesUserName ?? '' + formData.salesUserName = detail.userName ?? detail.salesmanName ?? '' formData.deliveryDate = detail.deliveryDate || '' } if (detail.lines && detail.lines.length > 0) { @@ -1353,7 +1353,7 @@ async function handleSave() { if (isAdd.value) { const res = await createProductionPlan(formData) ElMessage.success('保存成功') - const planId = res?.planId ?? res?.data?.planId + const planId = res?.planId if (planId != null) { formData.planId = planId router.replace(`/production/plan-order/edit/${planId}`) diff --git a/erp-frontend-vue/src/views/Production/PlanOrder/index.vue b/erp-frontend-vue/src/views/Production/PlanOrder/index.vue index 8b7fe66..ccd9104 100644 --- a/erp-frontend-vue/src/views/Production/PlanOrder/index.vue +++ b/erp-frontend-vue/src/views/Production/PlanOrder/index.vue @@ -357,8 +357,7 @@ import { BUSINESS_STATUS_OPTIONS, type ProductionPlan, type PlanDetailView, - type PlanQuery, - type MbomLine + type PlanQuery } from '@/api/productionPlan' const router = useRouter() diff --git a/erp-frontend-vue/src/views/Production/PurchasePlan/form.vue b/erp-frontend-vue/src/views/Production/PurchasePlan/form.vue index 5ca2c20..031d8bf 100644 --- a/erp-frontend-vue/src/views/Production/PurchasePlan/form.vue +++ b/erp-frontend-vue/src/views/Production/PurchasePlan/form.vue @@ -291,7 +291,7 @@ -