review:【erp 系统】purchase/order 的管理

pull/191/head^2
YunaiV 2025-08-04 22:42:59 +08:00
parent 9a305e6cbd
commit 6d99bf3a46
5 changed files with 17 additions and 1 deletions

View File

@ -32,6 +32,7 @@ const props = withDefaults(defineProps<Props>(), {
}); });
/** 概览数据 */ /** 概览数据 */
// TODO @nehc 8 4
const overviewItems = computed<AnalysisOverviewItem[]>(() => [ const overviewItems = computed<AnalysisOverviewItem[]>(() => [
{ {
icon: SvgCardIcon, icon: SvgCardIcon,

View File

@ -35,6 +35,7 @@ function onRefresh() {
gridApi.query(); gridApi.query();
} }
// TODO @nehc handleRowCheckboxChange
const checkedIds = ref<number[]>([]); const checkedIds = ref<number[]>([]);
function handleRowCheckboxChange({ function handleRowCheckboxChange({
records, records,
@ -81,6 +82,7 @@ async function handleDelete(row: ErpPurchaseOrderApi.PurchaseOrder) {
} }
/** 批量删除 */ /** 批量删除 */
// TODO @nehc handleBatchDelete
async function handleBatchDelete() { async function handleBatchDelete() {
const hideLoading = message.loading({ const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting'), content: $t('ui.actionMessage.deleting'),
@ -106,6 +108,7 @@ function handleUpdateStatus(
row: ErpPurchaseOrderApi.PurchaseOrder, row: ErpPurchaseOrderApi.PurchaseOrder,
status: number, status: number,
) { ) {
// TODO @nehc status
const hideLoading = message.loading({ const hideLoading = message.loading({
content: `确定${status === 20 ? '审批' : '反审批'}该订单吗?`, content: `确定${status === 20 ? '审批' : '反审批'}该订单吗?`,
duration: 0, duration: 0,

View File

@ -1,4 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
// TODO @nehc erp
import type { ErpPurchaseOrderApi } from '#/api/erp/purchase/order'; import type { ErpPurchaseOrderApi } from '#/api/erp/purchase/order';
import { nextTick, onMounted, ref, watch } from 'vue'; import { nextTick, onMounted, ref, watch } from 'vue';
@ -25,6 +26,7 @@ const emit = defineEmits([
'update:total-price', 'update:total-price',
]); ]);
// TODO @nehc:
interface Props { interface Props {
items?: ErpPurchaseOrderApi.PurchaseOrderItem[]; items?: ErpPurchaseOrderApi.PurchaseOrderItem[];
disabled?: boolean; disabled?: boolean;
@ -70,6 +72,7 @@ watch(
await nextTick(); await nextTick();
tableData.value = [...items]; tableData.value = [...items];
await nextTick(); await nextTick();
// TODO @nehc await
gridApi.grid.reloadData(tableData.value); gridApi.grid.reloadData(tableData.value);
}, },
{ {
@ -92,6 +95,7 @@ watch(
props.discountPercent === null props.discountPercent === null
? 0 ? 0
: erpPriceMultiply(totalPrice, props.discountPercent / 100); : erpPriceMultiply(totalPrice, props.discountPercent / 100);
// TODO @nehc idea
const finalTotalPrice = totalPrice - discountPrice; const finalTotalPrice = totalPrice - discountPrice;
// //
@ -122,6 +126,7 @@ function handleAdd() {
stockCount: 0, stockCount: 0,
remark: '', remark: '',
}; };
// TODO @nehc
tableData.value.push(newRow); tableData.value.push(newRow);
gridApi.grid.insertAt(newRow, -1); gridApi.grid.insertAt(newRow, -1);
emit('update:items', [...tableData.value]); emit('update:items', [...tableData.value]);

View File

@ -71,6 +71,7 @@ const handleUpdateTotalPrice = (totalPrice: number) => {
} }
}; };
// TODO @nehc使 /** */
/** /**
* 创建或更新采购订单 * 创建或更新采购订单
*/ */
@ -82,6 +83,7 @@ const [Modal, modalApi] = useVbenModal({
} }
await nextTick(); await nextTick();
// TODO @nehc
const itemFormInstance = Array.isArray(itemFormRef.value) const itemFormInstance = Array.isArray(itemFormRef.value)
? itemFormRef.value[0] ? itemFormRef.value[0]
: itemFormRef.value; : itemFormRef.value;
@ -93,6 +95,7 @@ const [Modal, modalApi] = useVbenModal({
return; return;
} }
} catch (error) { } catch (error) {
// TODO @nehc
message.error(error.message || '子表单验证失败'); message.error(error.message || '子表单验证失败');
return; return;
} }
@ -144,6 +147,7 @@ const [Modal, modalApi] = useVbenModal({
// //
formData.value = { items: [] } as ErpPurchaseOrderApi.PurchaseOrder; formData.value = { items: [] } as ErpPurchaseOrderApi.PurchaseOrder;
await nextTick(); await nextTick();
// TODO @nehc
const itemFormInstance = Array.isArray(itemFormRef.value) const itemFormInstance = Array.isArray(itemFormRef.value)
? itemFormRef.value[0] ? itemFormRef.value[0]
: itemFormRef.value; : itemFormRef.value;
@ -157,6 +161,8 @@ const [Modal, modalApi] = useVbenModal({
try { try {
formData.value = await getPurchaseOrder(data.id); formData.value = await getPurchaseOrder(data.id);
// URL FileUpload // URL FileUpload
// TODO @nehc idea
// TODO @nehc
if ( if (
formData.value.fileUrl && formData.value.fileUrl &&
typeof formData.value.fileUrl === 'string' typeof formData.value.fileUrl === 'string'

View File

@ -1,4 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
// TODO @nehc
import type { ErpStockInApi } from '#/api/erp/stock/in'; import type { ErpStockInApi } from '#/api/erp/stock/in';
import { nextTick, onMounted, ref, watch } from 'vue'; import { nextTick, onMounted, ref, watch } from 'vue';