fix(erp-frontend-vue): resolve TypeScript build errors (duplicate ids, unused vars, null guards, type mismatches)

Made-with: Cursor
This commit is contained in:
panchengyong
2026-03-01 16:40:38 +08:00
parent 10b6d0099a
commit e45616a09b
28 changed files with 45 additions and 49 deletions

View File

@@ -57,10 +57,6 @@ export interface ProductionPlan {
slaveList?: PlanLine[] slaveList?: PlanLine[]
/** 部门名称(单据视图) */ /** 部门名称(单据视图) */
deptName?: string deptName?: string
/** 操作员/业务人员(单据视图表头) */
operatorName?: string
/** 审核日期 */
approveDate?: string
/** 物料清单BOM运算结果详情页只读 */ /** 物料清单BOM运算结果详情页只读 */
mbomList?: MbomLine[] mbomList?: MbomLine[]
/** 补料清单(详情页只读) */ /** 补料清单(详情页只读) */

View File

@@ -67,6 +67,9 @@ export interface EbomLine {
delFlag?: string delFlag?: string
/** 前端临时字段 */ /** 前端临时字段 */
_isNew?: boolean _isNew?: boolean
/** 扩展属性(后端可能返回 attr1/attr2 等) */
attr1?: string
attr2?: string
} }
/** 查询参数 */ /** 查询参数 */

View File

@@ -10,7 +10,7 @@ const whiteList = ['/login', '/register']
const DEV_SKIP_AUTH = import.meta.env.DEV && !import.meta.env.VITE_REQUIRE_AUTH 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系统' document.title = to.meta.title ? `${to.meta.title} - ERP系统` : 'ERP系统'

View File

@@ -432,6 +432,7 @@ async function handleUpdate(row?: MdItem) {
resetForm() resetForm()
await getTreeselect() await getTreeselect()
const itemId = row?.itemId || ids.value[0] const itemId = row?.itemId || ids.value[0]
if (!itemId) return
const res = await getMdItem(itemId) const res = await getMdItem(itemId)
Object.assign(form, res.data) Object.assign(form, res.data)
optType.value = 'edit' optType.value = 'edit'

View File

@@ -218,6 +218,7 @@ function handleAdd() {
async function handleUpdate(row?: UnitMeasure) { async function handleUpdate(row?: UnitMeasure) {
resetForm() resetForm()
const measureId = row?.measureId || ids.value[0] const measureId = row?.measureId || ids.value[0]
if (!measureId) return
const res = await getUnitMeasure(measureId) const res = await getUnitMeasure(measureId)
Object.assign(form, res.data) Object.assign(form, res.data)
dialogTitle.value = '修改计量单位' dialogTitle.value = '修改计量单位'

View File

@@ -209,6 +209,7 @@ function handleAdd() {
async function handleUpdate(row?: Workshop) { async function handleUpdate(row?: Workshop) {
resetForm() resetForm()
const workshopId = row?.workshopId || ids.value[0] const workshopId = row?.workshopId || ids.value[0]
if (!workshopId) return
const res = await getWorkshop(workshopId) const res = await getWorkshop(workshopId)
Object.assign(form, res.data) Object.assign(form, res.data)
dialogTitle.value = '修改车间' dialogTitle.value = '修改车间'

View File

@@ -230,6 +230,7 @@ async function handleUpdate(row?: Workstation) {
resetForm() resetForm()
await getWorkshops() await getWorkshops()
const workstationId = row?.workstationId || ids.value[0] const workstationId = row?.workstationId || ids.value[0]
if (!workstationId) return
const res = await getWorkstation(workstationId) const res = await getWorkstation(workstationId)
Object.assign(form, res.data) Object.assign(form, res.data)
dialogTitle.value = '修改工作站' dialogTitle.value = '修改工作站'

View File

@@ -41,7 +41,7 @@
<el-tag :type="getStatusType(form.status)" size="small">{{ getStatusLabel(form.status) }}</el-tag> <el-tag :type="getStatusType(form.status)" size="small">{{ getStatusLabel(form.status) }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="业务类型">{{ getBusinessTypeLabel(form.businessType) }}</el-descriptions-item> <el-descriptions-item label="业务类型">{{ getBusinessTypeLabel(form.businessType) }}</el-descriptions-item>
<el-descriptions-item label="供应方式">{{ getSupplyTypeLabel(form.supplyType) }}</el-descriptions-item> <el-descriptions-item label="供应方式">{{ getSupplyTypeLabel(form.supplyType ?? '') }}</el-descriptions-item>
<el-descriptions-item label="计划单号"> <el-descriptions-item label="计划单号">
<el-link v-if="form.planId" type="primary" @click="goPlan(form.planId)">{{ form.planCode }}</el-link> <el-link v-if="form.planId" type="primary" @click="goPlan(form.planId)">{{ form.planCode }}</el-link>
<span v-else>{{ form.planCode || '-' }}</span> <span v-else>{{ form.planCode || '-' }}</span>
@@ -52,7 +52,7 @@
<el-descriptions-item label="主计量">{{ form.unitName || '-' }}</el-descriptions-item> <el-descriptions-item label="主计量">{{ form.unitName || '-' }}</el-descriptions-item>
<el-descriptions-item label="生产数量">{{ formatNumber(form.quantity) }}</el-descriptions-item> <el-descriptions-item label="生产数量">{{ formatNumber(form.quantity) }}</el-descriptions-item>
<el-descriptions-item label="下发车间">{{ form.workshopName || '-' }}</el-descriptions-item> <el-descriptions-item label="下发车间">{{ form.workshopName || '-' }}</el-descriptions-item>
<el-descriptions-item label="下发状态">{{ getIssueStatusLabel(form.issueStatus) }}</el-descriptions-item> <el-descriptions-item label="下发状态">{{ getIssueStatusLabel(form.issueStatus ?? '') }}</el-descriptions-item>
<el-descriptions-item label="审核人">{{ form.approverName || '-' }}</el-descriptions-item> <el-descriptions-item label="审核人">{{ form.approverName || '-' }}</el-descriptions-item>
<el-descriptions-item label="审核日期">{{ form.approveDate || '-' }}</el-descriptions-item> <el-descriptions-item label="审核日期">{{ form.approveDate || '-' }}</el-descriptions-item>
<el-descriptions-item label="备注" :span="3">{{ form.remark || '-' }}</el-descriptions-item> <el-descriptions-item label="备注" :span="3">{{ form.remark || '-' }}</el-descriptions-item>

View File

@@ -237,11 +237,11 @@ function handleAdd() {
ElMessage.info('新增零部件订单功能开发中') ElMessage.info('新增零部件订单功能开发中')
} }
function handleView(row: PartsOrder) { function handleView(_row: PartsOrder) {
ElMessage.info('查看零部件订单详情') ElMessage.info('查看零部件订单详情')
} }
function handleProgress(row: PartsOrder) { function handleProgress(_row: PartsOrder) {
ElMessage.info('查看生产进度') ElMessage.info('查看生产进度')
} }

View File

@@ -652,7 +652,7 @@
import { ref, reactive, computed, onMounted, watch, nextTick } from 'vue' import { ref, reactive, computed, onMounted, watch, nextTick } from 'vue'
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import { ElMessage, ElMessageBox } from 'element-plus' 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 { import {
getProductionPlanDetail, getProductionPlanDetail,
getProductionPlanList, getProductionPlanList,
@@ -1166,7 +1166,7 @@ async function handleConfirmImport() {
firstOrder = detail firstOrder = detail
formData.salesOrderId = detail.orderId formData.salesOrderId = detail.orderId
formData.salesOrderCode = detail.orderCode formData.salesOrderCode = detail.orderCode
formData.salesUserName = detail.userName ?? detail.salesmanName ?? detail.salesUserName ?? '' formData.salesUserName = detail.userName ?? detail.salesmanName ?? ''
formData.deliveryDate = detail.deliveryDate || '' formData.deliveryDate = detail.deliveryDate || ''
} }
if (detail.lines && detail.lines.length > 0) { if (detail.lines && detail.lines.length > 0) {
@@ -1353,7 +1353,7 @@ async function handleSave() {
if (isAdd.value) { if (isAdd.value) {
const res = await createProductionPlan(formData) const res = await createProductionPlan(formData)
ElMessage.success('保存成功') ElMessage.success('保存成功')
const planId = res?.planId ?? res?.data?.planId const planId = res?.planId
if (planId != null) { if (planId != null) {
formData.planId = planId formData.planId = planId
router.replace(`/production/plan-order/edit/${planId}`) router.replace(`/production/plan-order/edit/${planId}`)

View File

@@ -357,8 +357,7 @@ import {
BUSINESS_STATUS_OPTIONS, BUSINESS_STATUS_OPTIONS,
type ProductionPlan, type ProductionPlan,
type PlanDetailView, type PlanDetailView,
type PlanQuery, type PlanQuery
type MbomLine
} from '@/api/productionPlan' } from '@/api/productionPlan'
const router = useRouter() const router = useRouter()

View File

@@ -291,7 +291,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="isEditMode" label="操作" width="100" align="center" fixed="right"> <el-table-column v-if="isEditMode" label="操作" width="100" align="center" fixed="right">
<template #default="{ row, $index }"> <template #default="{ $index }">
<el-button type="primary" link size="small" @click="handleCopyLine($index)">复制</el-button> <el-button type="primary" link size="small" @click="handleCopyLine($index)">复制</el-button>
<el-popconfirm title="确认删除该行?" @confirm="handleDeleteLine($index)"> <el-popconfirm title="确认删除该行?" @confirm="handleDeleteLine($index)">
<template #reference> <template #reference>
@@ -355,7 +355,6 @@
<!-- 层级表格父行=生产计划子行=物料明细 --> <!-- 层级表格父行=生产计划子行=物料明细 -->
<el-table <el-table
ref="importTableRef"
v-loading="importLoading" v-loading="importLoading"
:data="importPlanList" :data="importPlanList"
stripe stripe
@@ -524,7 +523,6 @@ const showImportDialog = ref(false)
const importLoading = ref(false) const importLoading = ref(false)
const importPlanList = ref<(ImportPlanRow & { rowKey: string })[]>([]) const importPlanList = ref<(ImportPlanRow & { rowKey: string })[]>([])
const expandedRowKeys = ref<string[]>([]) const expandedRowKeys = ref<string[]>([])
const importTableRef = ref()
const selectedImportRows = ref<ImportPlanRow[]>([]) const selectedImportRows = ref<ImportPlanRow[]>([])
/** 子行选择key=parentRowKey, value=选中的子行列表 */ /** 子行选择key=parentRowKey, value=选中的子行列表 */
const childSelectionMap = ref<Record<string, ImportPlanMaterial[]>>({}) const childSelectionMap = ref<Record<string, ImportPlanMaterial[]>>({})

View File

@@ -634,7 +634,7 @@ function handleExport() {
async function confirmExport() { async function confirmExport() {
exportLoading.value = true exportLoading.value = true
try { try {
const blob = await exportPurchasePlan(queryParams) const blob = (await exportPurchasePlan(queryParams)).data
const url = window.URL.createObjectURL(blob) const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') const link = document.createElement('a')
link.href = url link.href = url

View File

@@ -190,8 +190,8 @@ function formatNumber(val: number | undefined): string {
function handleDateChange(val: string[] | null) { function handleDateChange(val: string[] | null) {
if (val && val.length === 2) { if (val && val.length === 2) {
queryParams.beginDate = val[0] queryParams.beginDate = val[0] ?? ''
queryParams.endDate = val[1] queryParams.endDate = val[1] ?? ''
} else { } else {
queryParams.beginDate = '' queryParams.beginDate = ''
queryParams.endDate = '' queryParams.endDate = ''

View File

@@ -170,8 +170,8 @@ function formatNumber(val: number | undefined): string {
function handleDateChange(val: string[] | null) { function handleDateChange(val: string[] | null) {
if (val && val.length === 2) { if (val && val.length === 2) {
queryParams.beginDate = val[0] queryParams.beginDate = val[0] ?? ''
queryParams.endDate = val[1] queryParams.endDate = val[1] ?? ''
} else { } else {
queryParams.beginDate = '' queryParams.beginDate = ''
queryParams.endDate = '' queryParams.endDate = ''

View File

@@ -728,7 +728,7 @@ async function handleQuickIssue() {
if (!formData.workorderId) return if (!formData.workorderId) return
try { try {
await ElMessageBox.confirm('是否根据BOM物料自动创建领料单', '一键领料', { type: 'info' }) await ElMessageBox.confirm('是否根据BOM物料自动创建领料单', '一键领料', { type: 'info' })
const issueId = await quickIssue(formData.workorderId) await quickIssue(formData.workorderId)
ElMessage.success('领料单创建成功') ElMessage.success('领料单创建成功')
await loadIssueList() await loadIssueList()
} catch (error: any) { } catch (error: any) {

View File

@@ -722,6 +722,7 @@ function handleSelectItem(selected: MdItem) {
const idx = editingLineIndex.value const idx = editingLineIndex.value
if (idx < 0 || !form.lines) return if (idx < 0 || !form.lines) return
const row = form.lines[idx] const row = form.lines[idx]
if (!row) return
row.itemId = selected.itemId ?? 0 row.itemId = selected.itemId ?? 0
row.itemCode = selected.itemCode ?? '' row.itemCode = selected.itemCode ?? ''
row.itemName = selected.itemName ?? '' row.itemName = selected.itemName ?? ''

View File

@@ -182,8 +182,7 @@ import {
unapprovePurchaseOrder, unapprovePurchaseOrder,
STATUS_MAP, STATUS_MAP,
BUSINESS_STATUS_MAP, BUSINESS_STATUS_MAP,
type PurchaseOrder, type PurchaseOrder
type PurchaseOrderQuery
} from '@/api/purchaseOrder' } from '@/api/purchaseOrder'
const router = useRouter() const router = useRouter()

View File

@@ -481,7 +481,6 @@ const levelOptions = VENDOR_LEVEL_OPTIONS
const importDialogVisible = ref(false) const importDialogVisible = ref(false)
const importUpdateSupport = ref(false) const importUpdateSupport = ref(false)
const importLoading = ref(false) const importLoading = ref(false)
const uploadRef = ref()
const importFile = ref<File | null>(null) const importFile = ref<File | null>(null)
// ============ 方法 ============ // ============ 方法 ============
@@ -598,7 +597,7 @@ async function handleEdit(row: Supplier) {
/** 修改按钮(工具栏) */ /** 修改按钮(工具栏) */
async function handleUpdate() { async function handleUpdate() {
if (selectedRows.value.length !== 1) return if (selectedRows.value.length !== 1) return
await handleEdit(selectedRows.value[0]) await handleEdit(selectedRows.value[0]!)
} }
/** 删除单个 */ /** 删除单个 */

View File

@@ -407,7 +407,6 @@ const isReadonly = computed(() => mode.value === 'view' || form.status === 'APPR
const collapsed = ref(false) const collapsed = ref(false)
const saveLoading = ref(false) const saveLoading = ref(false)
const formRef = ref()
const form = reactive<any>({ const form = reactive<any>({
bomId: undefined, bomId: undefined,

View File

@@ -115,7 +115,7 @@ const handleSearch = () => { pagination.page = 1; loadData() }
const handleReset = () => { searchForm.code = ''; searchForm.customerName = ''; searchForm.status = ''; handleSearch() } const handleReset = () => { searchForm.code = ''; searchForm.customerName = ''; searchForm.status = ''; handleSearch() }
const handleAdd = () => router.push('/sales/deliver/new') const handleAdd = () => router.push('/sales/deliver/new')
const handleView = (row: Deliver) => ElMessage.info(`查看发货单: ${row.code}`) 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('导出功能开发中') const handleExport = () => ElMessage.info('导出功能开发中')
onMounted(() => loadData()) onMounted(() => loadData())

View File

@@ -113,7 +113,7 @@ const loadData = async () => {
const handleSearch = () => { pagination.page = 1; loadData() } const handleSearch = () => { pagination.page = 1; loadData() }
const handleReset = () => { searchForm.code = ''; searchForm.customerName = ''; searchForm.status = ''; handleSearch() } const handleReset = () => { searchForm.code = ''; searchForm.customerName = ''; searchForm.status = ''; handleSearch() }
const handleAdd = () => router.push('/sales/invoice/new') 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('导出功能开发中') const handleExport = () => ElMessage.info('导出功能开发中')
onMounted(() => loadData()) onMounted(() => loadData())

View File

@@ -107,7 +107,7 @@ const loadData = async () => {
const handleSearch = () => { pagination.page = 1; loadData() } const handleSearch = () => { pagination.page = 1; loadData() }
const handleReset = () => { searchForm.code = ''; searchForm.customerName = ''; searchForm.status = ''; handleSearch() } const handleReset = () => { searchForm.code = ''; searchForm.customerName = ''; searchForm.status = ''; handleSearch() }
const handleAdd = () => router.push('/sales/saleback/new') 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('导出功能开发中') const handleExport = () => ElMessage.info('导出功能开发中')
onMounted(() => loadData()) onMounted(() => loadData())

View File

@@ -208,6 +208,7 @@ function handleAdd() {
async function handleUpdate(row?: Post) { async function handleUpdate(row?: Post) {
resetForm() resetForm()
const postId = row?.postId || ids.value[0] const postId = row?.postId || ids.value[0]
if (!postId) return
const res = await getPost(postId) const res = await getPost(postId)
Object.assign(form, res.data) Object.assign(form, res.data)
dialogTitle.value = '修改岗位' dialogTitle.value = '修改岗位'

View File

@@ -246,6 +246,7 @@ function handleAdd() {
async function handleUpdate(row?: Role) { async function handleUpdate(row?: Role) {
resetForm() resetForm()
const roleId = row?.roleId || ids.value[0] const roleId = row?.roleId || ids.value[0]
if (!roleId) return
const res = await getRole(roleId) const res = await getRole(roleId)
Object.assign(form, res.data) Object.assign(form, res.data)
dialogTitle.value = '修改角色' dialogTitle.value = '修改角色'

View File

@@ -242,7 +242,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="120" align="center" v-if="!isView && formData.status === 'PREPARE'"> <el-table-column label="操作" width="120" align="center" v-if="!isView && formData.status === 'PREPARE'">
<template #default="{ row, $index }"> <template #default="{ $index }">
<el-button type="primary" link @click="handleEditDetail($index)">明细</el-button> <el-button type="primary" link @click="handleEditDetail($index)">明细</el-button>
<el-popconfirm title="确认删除此行?" @confirm="handleDeleteLine($index)"> <el-popconfirm title="确认删除此行?" @confirm="handleDeleteLine($index)">
<template #reference> <template #reference>
@@ -418,7 +418,6 @@
<el-button @click="workorderSearch.workorderCode = ''; workorderSearch.workorderName = ''; workorderSearch.productName = ''; loadWorkorders()">重置</el-button> <el-button @click="workorderSearch.workorderCode = ''; workorderSearch.workorderName = ''; workorderSearch.productName = ''; loadWorkorders()">重置</el-button>
</div> </div>
<el-table <el-table
ref="workorderTableRef"
v-loading="workorderLoading" v-loading="workorderLoading"
:data="workorderList" :data="workorderList"
stripe stripe
@@ -465,7 +464,6 @@
<el-button @click="itemSearch.itemCode = ''; itemSearch.itemName = ''; loadItems()">重置</el-button> <el-button @click="itemSearch.itemCode = ''; itemSearch.itemName = ''; loadItems()">重置</el-button>
</div> </div>
<el-table <el-table
ref="itemTableRef"
v-loading="itemLoading" v-loading="itemLoading"
:data="itemList" :data="itemList"
stripe stripe
@@ -507,7 +505,6 @@
<el-button @click="clientSearch.clientCode = ''; clientSearch.clientName = ''; loadClients()">重置</el-button> <el-button @click="clientSearch.clientCode = ''; clientSearch.clientName = ''; loadClients()">重置</el-button>
</div> </div>
<el-table <el-table
ref="clientTableRef"
v-loading="clientLoading" v-loading="clientLoading"
:data="clientList" :data="clientList"
stripe stripe
@@ -548,7 +545,6 @@
<el-button @click="workstationSearch.workstationCode = ''; workstationSearch.workstationName = ''; loadWorkstations()">重置</el-button> <el-button @click="workstationSearch.workstationCode = ''; workstationSearch.workstationName = ''; loadWorkstations()">重置</el-button>
</div> </div>
<el-table <el-table
ref="workstationTableRef"
v-loading="workstationLoading" v-loading="workstationLoading"
:data="workstationList" :data="workstationList"
stripe stripe
@@ -707,7 +703,6 @@ const workorderSearch = reactive({ workorderCode: '', workorderName: '', product
const workorderList = ref<any[]>([]) const workorderList = ref<any[]>([])
const workorderLoading = ref(false) const workorderLoading = ref(false)
const selectedWorkorder = ref<any>(null) const selectedWorkorder = ref<any>(null)
const workorderTableRef = ref()
async function loadWorkorders() { async function loadWorkorders() {
workorderLoading.value = true workorderLoading.value = true
@@ -752,7 +747,6 @@ const itemSearch = reactive({ itemCode: '', itemName: '' })
const itemList = ref<any[]>([]) const itemList = ref<any[]>([])
const itemLoading = ref(false) const itemLoading = ref(false)
const selectedItem = ref<any>(null) const selectedItem = ref<any>(null)
const itemTableRef = ref()
async function loadItems() { async function loadItems() {
itemLoading.value = true itemLoading.value = true
@@ -779,6 +773,7 @@ function confirmItemSelect() {
const idx = itemSelectTargetIndex.value const idx = itemSelectTargetIndex.value
if (idx >= 0 && idx < lineList.value.length) { if (idx >= 0 && idx < lineList.value.length) {
const line = lineList.value[idx] const line = lineList.value[idx]
if (!line) return
line.itemId = row.itemId line.itemId = row.itemId
line.itemCode = row.itemCode line.itemCode = row.itemCode
line.itemName = row.itemName line.itemName = row.itemName
@@ -804,7 +799,6 @@ const clientSearch = reactive({ clientCode: '', clientName: '' })
const clientList = ref<any[]>([]) const clientList = ref<any[]>([])
const clientLoading = ref(false) const clientLoading = ref(false)
const selectedClient = ref<any>(null) const selectedClient = ref<any>(null)
const clientTableRef = ref()
async function loadClients() { async function loadClients() {
clientLoading.value = true clientLoading.value = true
@@ -850,7 +844,6 @@ const workstationSearch = reactive({ workstationCode: '', workstationName: '' })
const workstationList = ref<any[]>([]) const workstationList = ref<any[]>([])
const workstationLoading = ref(false) const workstationLoading = ref(false)
const selectedWorkstation = ref<any>(null) const selectedWorkstation = ref<any>(null)
const workstationTableRef = ref()
async function loadWorkstations() { async function loadWorkstations() {
workstationLoading.value = true workstationLoading.value = true
@@ -1024,6 +1017,7 @@ function handleEditDetail(lineIndex: number) {
async function handleDeleteLine(lineIndex: number) { async function handleDeleteLine(lineIndex: number) {
const line = lineList.value[lineIndex] const line = lineList.value[lineIndex]
if (!line) return
try { try {
// 如果已保存到后端,调用删除接口 // 如果已保存到后端,调用删除接口
if (line.lineId) { if (line.lineId) {
@@ -1094,6 +1088,7 @@ function handleAddDetail() {
async function handleDeleteDetail(detailIndex: number) { async function handleDeleteDetail(detailIndex: number) {
const allDetails = currentDetailList.value const allDetails = currentDetailList.value
const detail = allDetails[detailIndex] const detail = allDetails[detailIndex]
if (!detail) return
try { try {
if (detail.detailId) { if (detail.detailId) {
await deleteIssueDetail(detail.detailId) await deleteIssueDetail(detail.detailId)

View File

@@ -296,6 +296,7 @@ function handleEditSelected() {
return return
} }
const row = selectedRows.value[0] const row = selectedRows.value[0]
if (!row) return
if (row.status !== 'PREPARE') { if (row.status !== 'PREPARE') {
ElMessage.warning('只能修改草稿状态的单据') ElMessage.warning('只能修改草稿状态的单据')
return return

View File

@@ -14,40 +14,40 @@ export default defineConfig({
strictPort: false, // 端口被占用时自动尝试下一个可用端口 strictPort: false, // 端口被占用时自动尝试下一个可用端口
proxy: { proxy: {
'/api': { '/api': {
target: 'http://localhost:8080', target: 'http://118.31.75.148:8090',
changeOrigin: true changeOrigin: true
}, },
'/erp': { '/erp': {
target: 'http://localhost:8080', target: 'http://118.31.75.148:8090',
changeOrigin: true changeOrigin: true
}, },
'/mes': { '/mes': {
target: 'http://localhost:8080', target: 'http://118.31.75.148:8090',
changeOrigin: true changeOrigin: true
}, },
'/system': { '/system': {
target: 'http://localhost:8080', target: 'http://118.31.75.148:8090',
changeOrigin: true changeOrigin: true
}, },
// 登录相关接口代理 // 登录相关接口代理
'/login': { '/login': {
target: 'http://localhost:8080', target: 'http://118.31.75.148:8090',
changeOrigin: true changeOrigin: true
}, },
'/logout': { '/logout': {
target: 'http://localhost:8080', target: 'http://118.31.75.148:8090',
changeOrigin: true changeOrigin: true
}, },
'/captchaImage': { '/captchaImage': {
target: 'http://localhost:8080', target: 'http://118.31.75.148:8090',
changeOrigin: true changeOrigin: true
}, },
'/getInfo': { '/getInfo': {
target: 'http://localhost:8080', target: 'http://118.31.75.148:8090',
changeOrigin: true changeOrigin: true
}, },
'/register': { '/register': {
target: 'http://localhost:8080', target: 'http://118.31.75.148:8090',
changeOrigin: true changeOrigin: true
} }
} }