This commit is contained in:
dzc committed 2025-05-23 14:32:16 +08:00
commit 61041d4ae4
9 files changed
+68 -22

No files matched your search

+32 -21
View File
@@ -39,26 +39,38 @@
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="name" label="商品名称" show-overflow-tooltip/>
<el-table-column prop="unit" label="商品单位" show-overflow-tooltip/>
<el-table-column prop="purchasePrice" label="进价" show-overflow-tooltip/>
<el-table-column prop="baseStock" label="期初库存" show-overflow-tooltip/>
<el-table-column prop="currentStock" label="总库存" show-overflow-tooltip/>
<el-table-column prop="inventoryLowerLimit" label="库存下限" show-overflow-tooltip/>
<el-table-column prop="inventoryUpperLimit" label="库存上限" show-overflow-tooltip/>
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_canteenErpMaterial_edit'"
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenErpMaterial_del'" @click="handleDelete([scope.row.id])">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</div>
@sort-change="sortChangeHandle"
>
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="name" label="商品名称" show-overflow-tooltip />
<el-table-column prop="unit" label="商品单位" show-overflow-tooltip />
<el-table-column prop="purchasePrice" label="进价" show-overflow-tooltip>
<template #default="{ row }">{{ displayPrice(row.purchasePrice, "") }}</template>
</el-table-column>
<el-table-column prop="baseStock" label="期初库存" show-overflow-tooltip />
<el-table-column prop="currentStock" label="总库存" show-overflow-tooltip />
<el-table-column prop="inventoryLowerLimit" label="库存下限" show-overflow-tooltip />
<el-table-column prop="inventoryUpperLimit" label="库存上限" show-overflow-tooltip />
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button
icon="edit-pen"
text
type="primary"
v-auth="'canteen_canteenErpMaterial_edit'"
@click="formDialogRef.openDialog(scope.row.id)"
>
编辑
</el-button>
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenErpMaterial_del'" @click="handleDelete([scope.row.id])">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
@@ -73,7 +85,6 @@ import { displayPrice } from "/@/utils/formatMoney"
// 引入组件
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
// 定义查询字典
// 定义变量内容
const formDialogRef = ref()
@@ -250,6 +250,7 @@ const tableFormItems = () =>
totalAmount: storePrice((Number(item.quantity || 0) * Number(item.realPrice || 0)).toFixed(2)),
stock: item.stock,
remark: item.remark,
orderType: baseForm.orderType,
}))
// 提交数据 成功返回 true 失败返回 false
@@ -75,7 +75,9 @@
<!-- <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 />
<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>
@@ -116,6 +118,8 @@ import { BasicTableProps, useTable } from "/@/hooks/table"
import { fetchList, delObjs } from "/@/api/canteen/canteenInventoryRecords"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { displayPrice } from "/@/utils/formatMoney"
import { canteenSupplierSelect } from "/@/api/canteen/canteenSupplier"
import { getSimpleUserAll } from "/@/api/admin/user"
const CtForm = defineAsyncComponent(() => import("./form.vue"))
@@ -130,6 +134,8 @@ const state: BasicTableProps = reactive<BasicTableProps>({
},
pageList: fetchList,
})
const supplierSelect = ref<any>([])
// const handleUserSelect = ref<any>([])
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
@@ -169,4 +175,21 @@ const handleDelete = async (ids: string[]) => {
useMessage().error(err.msg)
}
}
onMounted(async () => {
// 获取经办人
try {
const { data } = await canteenSupplierSelect()
supplierSelect.value = data ? data : []
} catch (error) {
supplierSelect.value = []
}
// 获取货商
// try {
// const { data } = await getSimpleUserAll()
// handleUserSelect.value = data ?? []
// } catch (error) {
// handleUserSelect.value = []
// }
})
</script>
@@ -389,6 +389,7 @@ const cgPlanSpuItems = computed(() => {
totalAmount: Number(unit?.purchasePrice || 0) * item.quantity,
remark: item.remark,
unitId: item.unitId,
orderType: baseDataForm.orderType,
}
} else {
return {
@@ -399,6 +400,7 @@ const cgPlanSpuItems = computed(() => {
totalAmount: item?.purchasePrice && item.quantity ? Number(item.purchasePrice) * item.quantity : 0,
remark: item.remark,
unitId: item.unitId,
orderType: baseDataForm.orderType,
}
}
})
@@ -394,6 +394,7 @@ const cgPlanSpuItems = computed(() => {
totalAmount: Number(unit?.purchasePrice || 0) * item.quantity,
remark: item.remark,
unitId: item.unitId,
orderType: baseDataForm.orderType,
}
} else {
return {
@@ -404,6 +405,7 @@ const cgPlanSpuItems = computed(() => {
totalAmount: item?.purchasePrice && item.quantity ? Number(item.purchasePrice) * item.quantity : 0,
remark: item.remark,
unitId: item.unitId,
orderType: baseDataForm.orderType,
}
}
})
@@ -420,6 +420,7 @@ const cgPlanSpuItems = computed(() => {
totalAmount: storePrice(Number(unitObj?.realPrice || 0) * item.quantity),
remark: item.remark,
unitId: unitObj.id,
orderType: baseDataForm.orderType,
}
} else {
return {
@@ -431,6 +432,7 @@ const cgPlanSpuItems = computed(() => {
totalAmount: item?.realPrice && item.quantity ? storePrice(Number(item.realPrice) * item.quantity) : 0,
remark: item.remark,
unitId: item.unitId,
orderType: baseDataForm.orderType,
}
}
})
@@ -314,6 +314,7 @@ const cgPlanSpuItems = computed(() => {
totalAmount: Number(unit?.purchasePrice || 0) * item.quantity,
remark: item.remark,
unitId: item.unitId,
orderType: baseDataForm.orderType,
}
})
})
@@ -435,6 +435,7 @@ const cgPlanSpuItems = computed(() => {
totalAmount: unit?.purchasePrice && item.quantity ? Number(unit.purchasePrice) * item.quantity : 0,
remark: item.remark,
unitId: item.unitId,
orderType: baseDataForm.orderType,
}
} else {
return {
@@ -445,6 +446,7 @@ const cgPlanSpuItems = computed(() => {
totalAmount: item?.purchasePrice && item.quantity ? Number(item.purchasePrice) * item.quantity : 0,
remark: item.remark,
unitId: item.unitId,
orderType: baseDataForm.orderType,
}
}
})
@@ -427,6 +427,7 @@ const cgPlanSpuItems = computed(() => {
totalAmount: unit?.purchasePrice && item.quantity ? Number(unit.purchasePrice) * item.quantity : 0,
remark: item.remark,
unitId: item.unitId,
orderType: baseDataForm.orderType,
}
} else {
return {
@@ -437,6 +438,7 @@ const cgPlanSpuItems = computed(() => {
totalAmount: item?.purchasePrice && item.quantity ? Number(item.purchasePrice) * item.quantity : 0,
remark: item.remark,
unitId: item.unitId,
orderType: baseDataForm.orderType,
}
}
})