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 @@
-
+
复制
@@ -355,7 +355,6 @@
([])
const expandedRowKeys = ref([])
-const importTableRef = ref()
const selectedImportRows = ref([])
/** 子行选择:key=parentRowKey, value=选中的子行列表 */
const childSelectionMap = ref>({})
diff --git a/erp-frontend-vue/src/views/Production/PurchasePlan/index.vue b/erp-frontend-vue/src/views/Production/PurchasePlan/index.vue
index 358dc30..0e4454a 100644
--- a/erp-frontend-vue/src/views/Production/PurchasePlan/index.vue
+++ b/erp-frontend-vue/src/views/Production/PurchasePlan/index.vue
@@ -634,7 +634,7 @@ function handleExport() {
async function confirmExport() {
exportLoading.value = true
try {
- const blob = await exportPurchasePlan(queryParams)
+ const blob = (await exportPurchasePlan(queryParams)).data
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
diff --git a/erp-frontend-vue/src/views/Production/Reports/DetailReport.vue b/erp-frontend-vue/src/views/Production/Reports/DetailReport.vue
index 2696077..dc3044c 100644
--- a/erp-frontend-vue/src/views/Production/Reports/DetailReport.vue
+++ b/erp-frontend-vue/src/views/Production/Reports/DetailReport.vue
@@ -190,8 +190,8 @@ function formatNumber(val: number | undefined): string {
function handleDateChange(val: string[] | null) {
if (val && val.length === 2) {
- queryParams.beginDate = val[0]
- queryParams.endDate = val[1]
+ queryParams.beginDate = val[0] ?? ''
+ queryParams.endDate = val[1] ?? ''
} else {
queryParams.beginDate = ''
queryParams.endDate = ''
diff --git a/erp-frontend-vue/src/views/Production/Reports/TotalReport.vue b/erp-frontend-vue/src/views/Production/Reports/TotalReport.vue
index 0e520e0..d49e61d 100644
--- a/erp-frontend-vue/src/views/Production/Reports/TotalReport.vue
+++ b/erp-frontend-vue/src/views/Production/Reports/TotalReport.vue
@@ -170,8 +170,8 @@ function formatNumber(val: number | undefined): string {
function handleDateChange(val: string[] | null) {
if (val && val.length === 2) {
- queryParams.beginDate = val[0]
- queryParams.endDate = val[1]
+ queryParams.beginDate = val[0] ?? ''
+ queryParams.endDate = val[1] ?? ''
} else {
queryParams.beginDate = ''
queryParams.endDate = ''
diff --git a/erp-frontend-vue/src/views/Production/WorkOrder/form.vue b/erp-frontend-vue/src/views/Production/WorkOrder/form.vue
index 2744c8a..55ebb4e 100644
--- a/erp-frontend-vue/src/views/Production/WorkOrder/form.vue
+++ b/erp-frontend-vue/src/views/Production/WorkOrder/form.vue
@@ -728,7 +728,7 @@ async function handleQuickIssue() {
if (!formData.workorderId) return
try {
await ElMessageBox.confirm('是否根据BOM物料自动创建领料单?', '一键领料', { type: 'info' })
- const issueId = await quickIssue(formData.workorderId)
+ await quickIssue(formData.workorderId)
ElMessage.success('领料单创建成功')
await loadIssueList()
} catch (error: any) {
diff --git a/erp-frontend-vue/src/views/Purchasing/Order/form.vue b/erp-frontend-vue/src/views/Purchasing/Order/form.vue
index 56684ce..3316fd7 100644
--- a/erp-frontend-vue/src/views/Purchasing/Order/form.vue
+++ b/erp-frontend-vue/src/views/Purchasing/Order/form.vue
@@ -722,6 +722,7 @@ function handleSelectItem(selected: MdItem) {
const idx = editingLineIndex.value
if (idx < 0 || !form.lines) return
const row = form.lines[idx]
+ if (!row) return
row.itemId = selected.itemId ?? 0
row.itemCode = selected.itemCode ?? ''
row.itemName = selected.itemName ?? ''
diff --git a/erp-frontend-vue/src/views/Purchasing/Order/index.vue b/erp-frontend-vue/src/views/Purchasing/Order/index.vue
index 6445ddd..cc80982 100644
--- a/erp-frontend-vue/src/views/Purchasing/Order/index.vue
+++ b/erp-frontend-vue/src/views/Purchasing/Order/index.vue
@@ -182,8 +182,7 @@ import {
unapprovePurchaseOrder,
STATUS_MAP,
BUSINESS_STATUS_MAP,
- type PurchaseOrder,
- type PurchaseOrderQuery
+ type PurchaseOrder
} from '@/api/purchaseOrder'
const router = useRouter()
diff --git a/erp-frontend-vue/src/views/Purchasing/Supplier/index.vue b/erp-frontend-vue/src/views/Purchasing/Supplier/index.vue
index 2951f37..85fc237 100644
--- a/erp-frontend-vue/src/views/Purchasing/Supplier/index.vue
+++ b/erp-frontend-vue/src/views/Purchasing/Supplier/index.vue
@@ -481,7 +481,6 @@ const levelOptions = VENDOR_LEVEL_OPTIONS
const importDialogVisible = ref(false)
const importUpdateSupport = ref(false)
const importLoading = ref(false)
-const uploadRef = ref()
const importFile = ref(null)
// ============ 方法 ============
@@ -598,7 +597,7 @@ async function handleEdit(row: Supplier) {
/** 修改按钮(工具栏) */
async function handleUpdate() {
if (selectedRows.value.length !== 1) return
- await handleEdit(selectedRows.value[0])
+ await handleEdit(selectedRows.value[0]!)
}
/** 删除单个 */
diff --git a/erp-frontend-vue/src/views/RD/Ebom/form.vue b/erp-frontend-vue/src/views/RD/Ebom/form.vue
index 9258a41..958c227 100644
--- a/erp-frontend-vue/src/views/RD/Ebom/form.vue
+++ b/erp-frontend-vue/src/views/RD/Ebom/form.vue
@@ -407,7 +407,6 @@ const isReadonly = computed(() => mode.value === 'view' || form.status === 'APPR
const collapsed = ref(false)
const saveLoading = ref(false)
-const formRef = ref()
const form = reactive({
bomId: undefined,
diff --git a/erp-frontend-vue/src/views/Sales/Deliver/index.vue b/erp-frontend-vue/src/views/Sales/Deliver/index.vue
index 7385650..2806b5b 100644
--- a/erp-frontend-vue/src/views/Sales/Deliver/index.vue
+++ b/erp-frontend-vue/src/views/Sales/Deliver/index.vue
@@ -115,7 +115,7 @@ const handleSearch = () => { pagination.page = 1; loadData() }
const handleReset = () => { searchForm.code = ''; searchForm.customerName = ''; searchForm.status = ''; handleSearch() }
const handleAdd = () => router.push('/sales/deliver/new')
const handleView = (row: Deliver) => ElMessage.info(`查看发货单: ${row.code}`)
-const handleDelete = async (row: Deliver) => { await deleteDeliver(row.id); ElMessage.success('删除成功'); loadData() }
+const handleDelete = async (row: Deliver) => { await deleteDeliver(row.id!); ElMessage.success('删除成功'); loadData() }
const handleExport = () => ElMessage.info('导出功能开发中')
onMounted(() => loadData())
diff --git a/erp-frontend-vue/src/views/Sales/Invoice/index.vue b/erp-frontend-vue/src/views/Sales/Invoice/index.vue
index f8003a6..67c27fc 100644
--- a/erp-frontend-vue/src/views/Sales/Invoice/index.vue
+++ b/erp-frontend-vue/src/views/Sales/Invoice/index.vue
@@ -113,7 +113,7 @@ const loadData = async () => {
const handleSearch = () => { pagination.page = 1; loadData() }
const handleReset = () => { searchForm.code = ''; searchForm.customerName = ''; searchForm.status = ''; handleSearch() }
const handleAdd = () => router.push('/sales/invoice/new')
-const handleDelete = async (row: Invoice) => { await deleteInvoice(row.id); ElMessage.success('删除成功'); loadData() }
+const handleDelete = async (row: Invoice) => { await deleteInvoice(row.id!); ElMessage.success('删除成功'); loadData() }
const handleExport = () => ElMessage.info('导出功能开发中')
onMounted(() => loadData())
diff --git a/erp-frontend-vue/src/views/Sales/Saleback/index.vue b/erp-frontend-vue/src/views/Sales/Saleback/index.vue
index 9ab7729..41b78b8 100644
--- a/erp-frontend-vue/src/views/Sales/Saleback/index.vue
+++ b/erp-frontend-vue/src/views/Sales/Saleback/index.vue
@@ -107,7 +107,7 @@ const loadData = async () => {
const handleSearch = () => { pagination.page = 1; loadData() }
const handleReset = () => { searchForm.code = ''; searchForm.customerName = ''; searchForm.status = ''; handleSearch() }
const handleAdd = () => router.push('/sales/saleback/new')
-const handleDelete = async (row: Saleback) => { await deleteSaleback(row.id); ElMessage.success('删除成功'); loadData() }
+const handleDelete = async (row: Saleback) => { await deleteSaleback(row.id!); ElMessage.success('删除成功'); loadData() }
const handleExport = () => ElMessage.info('导出功能开发中')
onMounted(() => loadData())
diff --git a/erp-frontend-vue/src/views/System/Post/index.vue b/erp-frontend-vue/src/views/System/Post/index.vue
index b0ba8cb..1c17273 100644
--- a/erp-frontend-vue/src/views/System/Post/index.vue
+++ b/erp-frontend-vue/src/views/System/Post/index.vue
@@ -208,6 +208,7 @@ function handleAdd() {
async function handleUpdate(row?: Post) {
resetForm()
const postId = row?.postId || ids.value[0]
+ if (!postId) return
const res = await getPost(postId)
Object.assign(form, res.data)
dialogTitle.value = '修改岗位'
diff --git a/erp-frontend-vue/src/views/System/Role/index.vue b/erp-frontend-vue/src/views/System/Role/index.vue
index e1827ee..0cb94fe 100644
--- a/erp-frontend-vue/src/views/System/Role/index.vue
+++ b/erp-frontend-vue/src/views/System/Role/index.vue
@@ -246,6 +246,7 @@ function handleAdd() {
async function handleUpdate(row?: Role) {
resetForm()
const roleId = row?.roleId || ids.value[0]
+ if (!roleId) return
const res = await getRole(roleId)
Object.assign(form, res.data)
dialogTitle.value = '修改角色'
diff --git a/erp-frontend-vue/src/views/Warehouse/Issue/form.vue b/erp-frontend-vue/src/views/Warehouse/Issue/form.vue
index 57628e6..ec5b321 100644
--- a/erp-frontend-vue/src/views/Warehouse/Issue/form.vue
+++ b/erp-frontend-vue/src/views/Warehouse/Issue/form.vue
@@ -242,7 +242,7 @@
-
+
明细
@@ -418,7 +418,6 @@
重置
重置
重置
重置
([])
const workorderLoading = ref(false)
const selectedWorkorder = ref(null)
-const workorderTableRef = ref()
async function loadWorkorders() {
workorderLoading.value = true
@@ -752,7 +747,6 @@ const itemSearch = reactive({ itemCode: '', itemName: '' })
const itemList = ref([])
const itemLoading = ref(false)
const selectedItem = ref(null)
-const itemTableRef = ref()
async function loadItems() {
itemLoading.value = true
@@ -779,6 +773,7 @@ function confirmItemSelect() {
const idx = itemSelectTargetIndex.value
if (idx >= 0 && idx < lineList.value.length) {
const line = lineList.value[idx]
+ if (!line) return
line.itemId = row.itemId
line.itemCode = row.itemCode
line.itemName = row.itemName
@@ -804,7 +799,6 @@ const clientSearch = reactive({ clientCode: '', clientName: '' })
const clientList = ref([])
const clientLoading = ref(false)
const selectedClient = ref(null)
-const clientTableRef = ref()
async function loadClients() {
clientLoading.value = true
@@ -850,7 +844,6 @@ const workstationSearch = reactive({ workstationCode: '', workstationName: '' })
const workstationList = ref([])
const workstationLoading = ref(false)
const selectedWorkstation = ref(null)
-const workstationTableRef = ref()
async function loadWorkstations() {
workstationLoading.value = true
@@ -1024,6 +1017,7 @@ function handleEditDetail(lineIndex: number) {
async function handleDeleteLine(lineIndex: number) {
const line = lineList.value[lineIndex]
+ if (!line) return
try {
// 如果已保存到后端,调用删除接口
if (line.lineId) {
@@ -1094,6 +1088,7 @@ function handleAddDetail() {
async function handleDeleteDetail(detailIndex: number) {
const allDetails = currentDetailList.value
const detail = allDetails[detailIndex]
+ if (!detail) return
try {
if (detail.detailId) {
await deleteIssueDetail(detail.detailId)
diff --git a/erp-frontend-vue/src/views/Warehouse/Issue/index.vue b/erp-frontend-vue/src/views/Warehouse/Issue/index.vue
index b278f17..892df01 100644
--- a/erp-frontend-vue/src/views/Warehouse/Issue/index.vue
+++ b/erp-frontend-vue/src/views/Warehouse/Issue/index.vue
@@ -296,6 +296,7 @@ function handleEditSelected() {
return
}
const row = selectedRows.value[0]
+ if (!row) return
if (row.status !== 'PREPARE') {
ElMessage.warning('只能修改草稿状态的单据')
return
diff --git a/erp-frontend-vue/vite.config.ts b/erp-frontend-vue/vite.config.ts
index 009794b..05c5bc1 100644
--- a/erp-frontend-vue/vite.config.ts
+++ b/erp-frontend-vue/vite.config.ts
@@ -14,40 +14,40 @@ export default defineConfig({
strictPort: false, // 端口被占用时自动尝试下一个可用端口
proxy: {
'/api': {
- target: 'http://localhost:8080',
+ target: 'http://118.31.75.148:8090',
changeOrigin: true
},
'/erp': {
- target: 'http://localhost:8080',
+ target: 'http://118.31.75.148:8090',
changeOrigin: true
},
'/mes': {
- target: 'http://localhost:8080',
+ target: 'http://118.31.75.148:8090',
changeOrigin: true
},
'/system': {
- target: 'http://localhost:8080',
+ target: 'http://118.31.75.148:8090',
changeOrigin: true
},
// 登录相关接口代理
'/login': {
- target: 'http://localhost:8080',
+ target: 'http://118.31.75.148:8090',
changeOrigin: true
},
'/logout': {
- target: 'http://localhost:8080',
+ target: 'http://118.31.75.148:8090',
changeOrigin: true
},
'/captchaImage': {
- target: 'http://localhost:8080',
+ target: 'http://118.31.75.148:8090',
changeOrigin: true
},
'/getInfo': {
- target: 'http://localhost:8080',
+ target: 'http://118.31.75.148:8090',
changeOrigin: true
},
'/register': {
- target: 'http://localhost:8080',
+ target: 'http://118.31.75.148:8090',
changeOrigin: true
}
}