feat: 统一半成品和成品入库页面的高级筛选权限管理
- 将semi.vue和product.vue的fieldOptions改为computed属性,根据用户权限动态过滤 - 确保筛选字段与后端支持的字段完全一致 - 完善permissionMap,添加缺失的字段权限映射 - 遵循buy.vue和material/list.vue的权限管理模式
This commit is contained in:
@ -559,7 +559,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref, reactive, onMounted, watch} from 'vue'
|
||||
import {ref, reactive, onMounted, watch, computed} from 'vue'
|
||||
import {Plus, Setting, Refresh, Search, Lock, Box, House, InfoFilled, Link, Printer, Camera, Picture} from '@element-plus/icons-vue'
|
||||
import {ElMessage, ElLoading} from 'element-plus'
|
||||
import dayjs from 'dayjs'
|
||||
@ -620,37 +620,40 @@ const typeOptions = ref<string[]>([])
|
||||
const companyOptions = ref<string[]>([]) // [新增]
|
||||
const advancedFilterVisible = ref(false)
|
||||
const advancedConditions = ref([{ field: '', operator: '', value: '' }])
|
||||
const fieldOptions = ref([
|
||||
{ label: 'ID', value: 'id' },
|
||||
{ label: 'BaseID', value: 'base_id' },
|
||||
{ label: '所属公司', value: 'company_name' },
|
||||
{ label: '名称', value: 'material_name' },
|
||||
{ label: '规格型号', value: 'spec_model' },
|
||||
{ label: '类别', value: 'category' },
|
||||
{ label: '类型', value: 'material_type' },
|
||||
{ label: '单位', value: 'unit' },
|
||||
{ label: 'SKU', value: 'sku' },
|
||||
{ label: '入库日期', value: 'inbound_date' },
|
||||
{ label: '条码', value: 'barcode' },
|
||||
{ label: '批号', value: 'batch_number' },
|
||||
{ label: '序列号', value: 'serial_number' },
|
||||
{ label: '库位', value: 'warehouse_location' },
|
||||
{ label: '入库数量', value: 'qty_inbound' },
|
||||
{ label: '当前库存', value: 'qty_stock' },
|
||||
{ label: '当前可用', value: 'qty_available' },
|
||||
{ label: '库存状态', value: 'status' },
|
||||
{ label: '质量状态', value: 'quality_status' },
|
||||
{ label: 'BOM编号', value: 'bom_code' },
|
||||
{ label: 'BOM版本', value: 'bom_version' },
|
||||
{ label: '工单号', value: 'work_order_code' },
|
||||
{ label: '生产负责人', value: 'production_manager' },
|
||||
{ label: '生产时间', value: 'production_start_time' },
|
||||
{ label: '生产结束时间', value: 'production_end_time' },
|
||||
{ label: '估算成本', value: 'raw_material_cost' },
|
||||
{ label: '基于BOM成本', value: 'unit_total_cost' },
|
||||
{ label: '总成本', value: 'total_price' },
|
||||
{ label: '详情链接', value: 'detail_link' },
|
||||
])
|
||||
const fieldOptions = computed(() => {
|
||||
const allFields = [
|
||||
{ value: 'id', label: 'ID', perm: 'inbound_semi:id' },
|
||||
{ value: 'base_id', label: 'BaseID', perm: 'inbound_semi:base_id' },
|
||||
{ value: 'company_name', label: '所属公司', perm: 'inbound_semi:company_name' },
|
||||
{ value: 'material_name', label: '名称', perm: 'inbound_semi:material_name' },
|
||||
{ value: 'spec_model', label: '规格型号', perm: 'inbound_semi:spec_model' },
|
||||
{ value: 'category', label: '类别', perm: 'inbound_semi:category' },
|
||||
{ value: 'material_type', label: '类型', perm: 'inbound_semi:material_type' },
|
||||
{ value: 'unit', label: '单位', perm: 'inbound_semi:unit' },
|
||||
{ value: 'sku', label: 'SKU', perm: 'inbound_semi:sku' },
|
||||
{ value: 'inbound_date', label: '入库日期', perm: 'inbound_semi:inbound_date' },
|
||||
{ value: 'barcode', label: '条码', perm: 'inbound_semi:barcode' },
|
||||
{ value: 'batch_number', label: '批号', perm: 'inbound_semi:sn_bn' },
|
||||
{ value: 'serial_number', label: '序列号', perm: 'inbound_semi:sn_bn' },
|
||||
{ value: 'warehouse_location', label: '库位', perm: 'inbound_semi:warehouse_loc' },
|
||||
{ value: 'qty_inbound', label: '入库数量', perm: 'inbound_semi:qty_inbound' },
|
||||
{ value: 'qty_stock', label: '当前库存', perm: 'inbound_semi:qty_stock' },
|
||||
{ value: 'qty_available', label: '当前可用', perm: 'inbound_semi:qty_available' },
|
||||
{ value: 'status', label: '库存状态', perm: 'inbound_semi:status' },
|
||||
{ value: 'quality_status', label: '质量状态', perm: 'inbound_semi:quality_status' },
|
||||
{ value: 'bom_code', label: 'BOM编号', perm: 'inbound_semi:bom_code' },
|
||||
{ value: 'bom_version', label: 'BOM版本', perm: 'inbound_semi:bom_version' },
|
||||
{ value: 'work_order_code', label: '工单号', perm: 'inbound_semi:work_order_code' },
|
||||
{ value: 'production_manager', label: '生产负责人', perm: 'inbound_semi:production_manager' },
|
||||
{ value: 'production_start_time', label: '生产开始时间', perm: 'inbound_semi:production_start_time' },
|
||||
{ value: 'production_end_time', label: '生产结束时间', perm: 'inbound_semi:production_end_time' },
|
||||
{ value: 'raw_material_cost', label: '估算成本', perm: 'inbound_semi:raw_material_cost' },
|
||||
{ value: 'unit_total_cost', label: '基于BOM成本', perm: 'inbound_semi:unit_total_cost' },
|
||||
{ value: 'total_price', label: '总成本', perm: 'inbound_semi:total_price' }
|
||||
]
|
||||
// 根据用户权限过滤
|
||||
return allFields.filter(item => userStore.hasPermission(item.perm))
|
||||
})
|
||||
const operatorOptions = ref([
|
||||
{ label: '等于', value: '=' },
|
||||
{ label: '不等于', value: '!=' },
|
||||
|
||||
Reference in New Issue
Block a user