This commit is contained in:
zjf committed 2025-05-28 14:02:37 +08:00
1 parent 3590100cc8
commit 393f52090b
2 files changed
+37 -2

No files matched your search

@@ -39,3 +39,11 @@ export function putObj(obj?: Object) {
})
}
export function acceptanceObj(id: string) {
return request({
url: '/canteen/canteenInventoryRecords/ys',
method: 'post',
params: { id }
})
}
@@ -72,12 +72,13 @@
</template>
</el-table-column>
<el-table-column prop="handlerUserName" label="经办人" show-overflow-tooltip />
<!-- <el-table-column prop="checkStatus" label="审批状态" show-overflow-tooltip /> -->
<el-table-column prop="checkStatus" label="验收状态" show-overflow-tooltip />
<!-- <el-table-column prop="checkUserId" label="审批人id" show-overflow-tooltip /> -->
<!-- <el-table-column prop="checkTime" label="审核日期" show-overflow-tooltip /> -->
<el-table-column prop="supplierId" label="货商" show-overflow-tooltip>
<template #default="{ row }">{{ supplierSelect?.find((item: any) => item.supplierId == row.supplierId)?.supplierName }}</template>
</el-table-column>
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
<el-table-column prop="totalAmount" label="入库总金额" show-overflow-tooltip>
<template #default="{ row }">{{ displayPrice(row.totalAmount) }}</template>
@@ -103,6 +104,15 @@
>
删除
</el-button>
<el-button
icon="Check"
text
type="success"
v-auth="'canteen_canteenInventoryRecords_ys'"
@click="handleAcceptance(scope.row.id)"
>
验收
</el-button>
</template>
</el-table-column>
</el-table>
@@ -115,7 +125,7 @@
<script setup lang="ts">
import { BasicTableProps, useTable } from "/@/hooks/table"
import { fetchList, delObjs } from "/@/api/canteen/canteenInventoryRecords"
import { fetchList, delObjs, acceptanceObj } from "/@/api/canteen/canteenInventoryRecords"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { displayPrice } from "/@/utils/formatMoney"
import { canteenSupplierSelect } from "/@/api/canteen/canteenSupplier"
@@ -176,6 +186,23 @@ const handleDelete = async (ids: string[]) => {
}
}
// 验收操作
const handleAcceptance = async (id: string) => {
try {
await useMessageBox().confirm("确认验收此记录?")
} catch {
return
}
try {
await acceptanceObj(id)
getDataList()
useMessage().success("验收成功")
} catch (err: any) {
useMessage().error(err.msg || "验收失败")
}
}
onMounted(async () => {
// 获取经办人
try {