From a9234a69b2b92bcd72938e3be211d9f23cae1c18 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Tue, 18 Nov 2025 16:02:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B9=E7=9B=AE=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=92=8C=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/project.js | 3 +- pages/project/form/index.vue | 55 ++++++++++++++++++++++-------------- pages/project/list/index.vue | 14 +++++---- 3 files changed, 45 insertions(+), 27 deletions(-) diff --git a/api/project.js b/api/project.js index 66cb8d4..dfb3b19 100644 --- a/api/project.js +++ b/api/project.js @@ -108,7 +108,8 @@ export const getProjectDetail = (id) => { export const createProject = (data) => { return uni.$uv.http.post('bst/project', data, { custom: { - auth: true + auth: true, + catch: true // 允许在 catch 中处理错误 } }); }; diff --git a/pages/project/form/index.vue b/pages/project/form/index.vue index c26d017..7f774f2 100644 --- a/pages/project/form/index.vue +++ b/pages/project/form/index.vue @@ -45,7 +45,7 @@ - 项目金额(元) + 项目金额(元) - 客户 + 客户 {{ formData.customerName || '请选择客户' }} @@ -305,11 +305,12 @@ const pendingDateField = ref(''); const canSubmit = computed(() => { return ( - !!formData.value.name && - !!formData.value.customerId && - !!formData.value.amount && - formData.value.memberList.length > 0 && - !submitting.value + !!formData.value.name + // && + // !!formData.value.customerId && + // !!formData.value.amount && + // formData.value.memberList.length > 0 && + // !submitting.value ); }); @@ -533,7 +534,7 @@ const loadProjectDetail = async (id) => { amount: merged.amount != null ? String(merged.amount) : '', customerId: merged.customerId ? String(merged.customerId) : merged.customerId, customerName: merged.customerName || '', - expireTime: normalizeDateString(merged.expireTime), + expireTime: merged.expireTime, projectTags: merged.projectTags || '', remark: merged.remark || '', developmentCost: safeNumberToString(merged.developmentCost), @@ -584,15 +585,15 @@ const buildPayload = () => { amount: parseNumber(formData.value.amount), customerId: formData.value.customerId, customerName: formData.value.customerName, - expireTime: formData.value.expireTime || null, + expireTime: formData.value.expireTime, projectTags: formData.value.projectTags || '', remark: formData.value.remark || '', developmentCost: parseNumber(formData.value.developmentCost), - developmentTime: formData.value.developmentTime || null, + developmentTime: formatDateTimeForPayload(formData.value.developmentTime), middleCost: parseNumber(formData.value.middleCost), - middleTime: formData.value.middleTime || null, + middleTime: formatDateTimeForPayload(formData.value.middleTime), afterCost: parseNumber(formData.value.afterCost), - afterTime: formData.value.afterTime || null, + afterTime: formatDateTimeForPayload(formData.value.afterTime), attaches: formData.value.attaches.map((file, index) => ({ name: file.name || getFileNameFromUrl(file.path), url: file.path, @@ -622,7 +623,16 @@ const safeNumberToString = (value) => { const normalizeDateString = (value) => { if (!value) return ''; - return value.split(' ')[0]; + return value.replace('T', ' ').split(' ')[0]; +}; + +const formatDateTimeForPayload = (value) => { + if (!value) return null; + const cleaned = value.replace('T', ' ').trim(); + if (cleaned.includes(':')) { + return cleaned; + } + return `${cleaned} 00:00:00`; }; const normalizeAttaches = (value) => { @@ -688,8 +698,8 @@ const formatDate = (timestamp) => { } .custom-navbar { - height: 56px; - padding: 0 16px; + + padding: 20px 20px; display: flex; align-items: flex-end; background: #fff; @@ -697,11 +707,12 @@ const formatDate = (timestamp) => { } .navbar-content { + margin-top: 15px; width: 100%; display: flex; justify-content: space-between; align-items: center; - padding-bottom: 10px; + } .nav-btn { @@ -803,6 +814,7 @@ const formatDate = (timestamp) => { align-items: center; font-size: 14px; color: #111; + box-sizing: border-box; } .form-textarea { @@ -917,7 +929,7 @@ const formatDate = (timestamp) => { } .col.role { - width: 180px; + width: 140px; } .col.action { @@ -1000,7 +1012,7 @@ const formatDate = (timestamp) => { padding: 16px; display: flex; flex-direction: column; - max-height: 80%; + } .modal-header { @@ -1021,7 +1033,7 @@ const formatDate = (timestamp) => { } .search-box { - margin-bottom: 12px; + //margin-bottom: 12px; } .search-input { @@ -1034,6 +1046,7 @@ const formatDate = (timestamp) => { .member-list { height: 600px; + margin: 12px 0; } .member-item { @@ -1074,8 +1087,8 @@ const formatDate = (timestamp) => { .modal-actions { display: flex; - gap: 12px; - margin-top: 12px; + justify-content: space-between; + } diff --git a/pages/project/list/index.vue b/pages/project/list/index.vue index ac4fd1b..0e1507a 100644 --- a/pages/project/list/index.vue +++ b/pages/project/list/index.vue @@ -133,13 +133,17 @@ {{ project.name }} - - - {{ getTagText(project) }} - + + + + + + + + + {{ project.remark }} -