{
{ value: 'spec', label: '规格型号', perm: 'material_list:spec' },
{ value: 'unit', label: '单位', perm: 'material_list:unit' },
{ value: 'inventoryCount', label: '库存数', perm: 'material_list:inventoryCount' },
- { value: 'availableCount', label: '可用数', perm: 'material_list:availableCount' }
+ { value: 'availableCount', label: '可用数', perm: 'material_list:availableCount' },
+ { value: 'referencePrice', label: '参考价格', perm: 'material_list:referencePrice' }
];
// 根据用户权限过滤
return allFields.filter(item => userStore.hasPermission(item.perm));
@@ -916,6 +933,7 @@ const columns = reactive({
files: { visible: true },
isEnabled: { visible: true },
isInspectionRequired: { visible: true },
+ referencePrice: { visible: true },
warningStatus: { visible: true }
});
@@ -934,6 +952,7 @@ const permissionMap: Record = {
files: 'material_list:files',
isEnabled: 'material_list:isEnabled',
isInspectionRequired: 'material_list:operation',
+ referencePrice: 'material_list:referencePrice',
warningStatus: 'material_list:view_warning'
};
@@ -1103,6 +1122,7 @@ const initForm = {
generalManual: [] as string[],
generalImage: [] as string[],
isEnabled: true, // 已修改为默认 true
+ referencePrice: undefined as number | undefined,
productImageRemark: '',
manualLinkRemark: '',
};
@@ -1204,6 +1224,10 @@ const getList = () => {
...queryParams,
advancedFilters: JSON.stringify(queryParams.advancedFilters || [])
};
+ // 兼容旧版后端:company=ALL 时不传过滤参数
+ if (params.company === 'ALL') {
+ delete params.company
+ }
listMaterialBase(params)
.then((response: any) => {
if (response && response.data) {
@@ -1277,7 +1301,7 @@ const handleInputSearch = () => {
};
const handleSortChange = ({ column, prop, order }: any) => {
- const sortableColumns = ['inventoryCount', 'availableCount', 'companyName', 'name', 'commonName', 'category', 'type', 'spec', 'unit'];
+ const sortableColumns = ['inventoryCount', 'availableCount', 'referencePrice', 'companyName', 'name', 'commonName', 'category', 'type', 'spec', 'unit'];
if (prop && sortableColumns.includes(prop)) {
queryParams.orderByColumn = prop;
queryParams.isAsc = order === 'ascending' ? 'asc' : order === 'descending' ? 'desc' : undefined;
diff --git a/inventory-web/src/views/stock/inbound/buy.vue b/inventory-web/src/views/stock/inbound/buy.vue
index 00f7968..4a60542 100644
--- a/inventory-web/src/views/stock/inbound/buy.vue
+++ b/inventory-web/src/views/stock/inbound/buy.vue
@@ -231,8 +231,8 @@
-
- {{ formatMoney(scope.row[col.prop], scope.row.currency) }}
+
+ {{ formatMoney(scope.row[col.prop]) }}
@@ -767,7 +767,6 @@ const hasFormFieldPermission = (fieldName: string) => {
available_quantity: 'inbound_buy:available_quantity',
warehouse_location: 'inbound_buy:warehouse_location',
unit_price: 'inbound_buy:unit_price',
- post_tax_unit_price: 'inbound_buy:post_tax_unit_price',
tax_rate: 'inbound_buy:tax_rate',
total_price: 'inbound_buy:total_price',
currency: 'inbound_buy:currency',
@@ -889,7 +888,6 @@ const fieldOptions = computed(() => {
{ value: 'qty_stock', label: '库存数', perm: 'inbound_buy:qty_stock' },
{ value: 'qty_available', label: '可用数', perm: 'inbound_buy:qty_available' },
{ value: 'unit_price', label: '不含税单价', perm: 'inbound_buy:unit_price' },
- { value: 'post_tax_unit_price', label: '含税单价', perm: 'inbound_buy:post_tax_unit_price' },
{ value: 'total_price', label: '不含税总价', perm: 'inbound_buy:total_price' },
{ value: 'tax_rate', label: '税率', perm: 'inbound_buy:tax_rate' },
{ value: 'currency', label: '币种', perm: 'inbound_buy:currency' },
@@ -941,7 +939,6 @@ const stockColumns = [
{prop: 'tax_rate', label: '税率', minWidth: '80'},
{prop: 'unit_price', label: '不含税单价', minWidth: '120'},
- {prop: 'post_tax_unit_price', label: '含税单价', minWidth: '120'},
{prop: 'total_price', label: '不含税总价', minWidth: '120'},
{prop: 'currency', label: '币种', minWidth: '80'},
@@ -979,7 +976,6 @@ const permissionMap: Record = {
warehouse_loc: 'inbound_buy:warehouse_loc',
tax_rate: 'inbound_buy:tax_rate',
unit_price: 'inbound_buy:unit_price',
- post_tax_unit_price: 'inbound_buy:post_tax_unit_price',
total_price: 'inbound_buy:total_price',
currency: 'inbound_buy:currency',
exchange_rate: 'inbound_buy:exchange_rate',
@@ -1344,6 +1340,10 @@ const fetchData = async () => {
isAsc: queryParams.isAsc,
advancedFilters: JSON.stringify(queryParams.advancedFilters)
}
+ // 兼容旧版后端:company=ALL 时不传过滤参数
+ if (params.company === 'ALL') {
+ delete params.company
+ }
const res: any = await getBuyList(params)
tableData.value = res.data.items || []
total.value = res.data.total || 0
@@ -1684,7 +1684,7 @@ const resetAdvancedFilter = () => {
fetchData()
}
const isColumnSortable = (prop: string) => {
- const sortableColumns = ['company_name', 'material_name', 'material_type', 'category', 'spec_model', 'unit', 'sku', 'barcode', 'inbound_date', 'serial_number', 'batch_number', 'status', 'inspection_status', 'qty_inbound', 'qty_stock', 'qty_available', 'warehouse_loc', 'unit_price', 'post_tax_unit_price', 'total_price', 'tax_rate', 'currency', 'exchange_rate', 'supplier_name', 'purchaser', 'purchaser_email', 'source_link', 'detail_link']
+ const sortableColumns = ['company_name', 'material_name', 'material_type', 'category', 'spec_model', 'unit', 'sku', 'barcode', 'inbound_date', 'serial_number', 'batch_number', 'status', 'inspection_status', 'qty_inbound', 'qty_stock', 'qty_available', 'warehouse_loc', 'unit_price', 'total_price', 'tax_rate', 'currency', 'exchange_rate', 'supplier_name', 'purchaser', 'purchaser_email', 'source_link', 'detail_link']
return sortableColumns.includes(prop)
}
const handleSortChange = ({ column, prop, order }: any) => {
@@ -1777,12 +1777,12 @@ const resetForm = () => {
const getStatusType = (status: string) => { const map: any = {'在库': 'success', '出库': 'info', '损耗': 'danger'}; return map[status] || 'warning' }
// 列表金额显示增加千分位处理,并保留2位小数
-const formatMoney = (val: any, currency = '¥') => {
+const formatMoney = (val: any) => {
const num = Number(val);
if (isNaN(num)) return '-';
const parts = num.toFixed(2).split('.');
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
- return `${currency} ${parts.join('.')}`;
+ return parts.join('.');
}
onMounted(() => {
diff --git a/inventory-web/src/views/stock/inbound/product.vue b/inventory-web/src/views/stock/inbound/product.vue
index c31848a..f6ed6ce 100644
--- a/inventory-web/src/views/stock/inbound/product.vue
+++ b/inventory-web/src/views/stock/inbound/product.vue
@@ -3,6 +3,7 @@