feat: 添加参考价格列 + 修复公司筛选跨域问题 + CLIP模型持久化
## 新增功能 - material_base 表新增 reference_price 列(NUMERIC(10,2)) - 基础信息 list.vue / buyOdoo.vue 页面增加「参考价格」列展示和编辑 - 新增 material_list:referencePrice 权限元素,支持按角色控制可见性 ## Bug 修复 - 入库三页面(buy/product/semi)公司筛选:非超管用户 company=ALL 不再传给旧版后端 - 基础信息两页面(list/buyOdoo):buyOdoo 增加 v-if=isSuperAdmin 与 list.vue 行为统一 - company=ALL 默认值在各页面 getList/fetchData 中自动过滤,兼容旧版后端 ## 运维优化 - docker-compose.prod.yml 增加 models_prod 卷挂载,CLIP模型持久化免重复上传 - deploy_code.sh 增加 models_prod 目录检查与模型文件存在性告警
This commit is contained in:
@ -231,8 +231,8 @@
|
||||
</el-link>
|
||||
</template>
|
||||
|
||||
<template #default="scope" v-else-if="['unit_price', 'post_tax_unit_price', 'total_price'].includes(col.prop)">
|
||||
<span class="money-text">{{ formatMoney(scope.row[col.prop], scope.row.currency) }}</span>
|
||||
<template #default="scope" v-else-if="['unit_price', 'total_price'].includes(col.prop)">
|
||||
<span class="money-text">{{ formatMoney(scope.row[col.prop]) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
@ -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<string, string> = {
|
||||
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(() => {
|
||||
|
||||
Reference in New Issue
Block a user