补充前期中期后期三个项目状态

This commit is contained in:
WindowBird 2025-11-18 16:47:49 +08:00
parent c26256f098
commit 9797ca3068

View File

@ -225,19 +225,57 @@ const filterParams = ref({
overdue: '', // '', true, false
});
//
const fallbackProjectStatusDict = [
{ dictLabel: '前期费用', dictValue: 'DEVELOPMENT_COST', listClass: 'primary', dictSort: 0 },
{ dictLabel: '中期费用', dictValue: 'MIDDLE_COST', listClass: 'success', dictSort: 0 },
{ dictLabel: '后期费用', dictValue: 'AFTER_COST', listClass: 'warning', dictSort: 0 },
{ dictLabel: '待开始', dictValue: 'WAIT_START', listClass: 'info', dictSort: 1 },
{ dictLabel: '开发中', dictValue: 'IN_PROGRESS', listClass: 'warning', dictSort: 100 },
{ dictLabel: '开发完成', dictValue: 'COMPLETED', listClass: 'primary', dictSort: 200 },
{ dictLabel: '已验收', dictValue: 'ACCEPTED', listClass: 'success', dictSort: 300 },
{ dictLabel: '维护中', dictValue: 'MAINTENANCE', listClass: 'warning', dictSort: 400 },
{ dictLabel: '维护到期', dictValue: 'MAINTENANCE_OVERDUE', listClass: 'warning', dictSort: 500 },
{ dictLabel: '开发超期', dictValue: 'DEVELOPMENT_OVERDUE', listClass: 'danger', dictSort: 600 }
];
// 使
const statusTabs = ref([
{ label: '待开始', value: 'WAIT_START' },
{ label: '开发中', value: 'IN_PROGRESS' },
{ label: '开发完成', value: 'COMPLETED' },
{ label: '已验收', value: 'ACCEPTED' },
{ label: '维护中', value: 'MAINTENANCE' },
{ label: '维护到期', value: 'MAINTENANCE_OVERDUE' },
{ label: '开发超期', value: 'DEVELOPMENT_OVERDUE' }
]);
const statusTabs = computed(() => {
const dictItems = typeof dictStore.getDictByType === 'function'
? dictStore.getDictByType('project_status')
: [];
const source = Array.isArray(dictItems) && dictItems.length > 0
? dictItems
: fallbackProjectStatusDict;
return source
.slice()
.sort((a, b) => {
const sortA = parseInt(a.dictSort) || 0;
const sortB = parseInt(b.dictSort) || 0;
return sortA - sortB;
})
.map(item => ({
label: item.dictLabel || item.label,
value: item.dictValue || item.value,
listClass: item.listClass || item.type || 'primary'
}));
});
const activeStatusTab = ref('IN_PROGRESS'); // ""
//
watch(statusTabs, (tabs) => {
if (!Array.isArray(tabs) || tabs.length === 0) {
return;
}
const exists = tabs.some(tab => tab.value === activeStatusTab.value);
if (!exists) {
activeStatusTab.value = tabs[0].value;
}
}, { immediate: true });
//
const memberOptions = ref([]);
const selectedMemberName = ref('');
@ -324,6 +362,9 @@ const getStatusText = (status) => {
}
//
const statusMap = {
'DEVELOPMENT_COST': '前期费用',
'MIDDLE_COST': '中期费用',
'AFTER_COST': '后期费用',
'WAIT_START': '待开始',
'IN_PROGRESS': '开发中',
'COMPLETED': '开发完成',
@ -348,6 +389,9 @@ const getStatusType = (status) => {
if (!status && status !== 0) return 'primary';
const typeMap = {
//
'DEVELOPMENT_COST': 'primary', //
'MIDDLE_COST': 'success', //
'AFTER_COST': 'warning', //
'WAIT_START': 'primary', //
'IN_PROGRESS': 'warning', //
'COMPLETED': 'success', //
@ -574,10 +618,10 @@ onPullDownRefresh(async () => {
//
const goToProjectDetail = (project) => {
// TODO:
uni.showToast({
title: '项目详情功能开发中',
icon: 'none'
});
// uni.showToast({
// title: '',
// icon: 'none'
// });
};
//