From cd8f12dd244a5e52901b334b9ce5439f241598cd Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 02 十一月 2026 15:04:53 +0800
Subject: [PATCH] refactor(app): 移除页面附件上传功能

---
 src/pages/crm/receivable/form.vue |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/pages/crm/receivable/form.vue b/src/pages/crm/receivable/form.vue
index 6a7c2e7..2fa1d9f 100644
--- a/src/pages/crm/receivable/form.vue
+++ b/src/pages/crm/receivable/form.vue
@@ -27,7 +27,7 @@
 const returnTypeLabel = () => returnTypes.value.find(item => Number(item.value) === form.returnType)?.label || "璇烽�夋嫨鍥炴鏂瑰紡";
 async function loadRelated() { if (!state.accessToken || !form.contractId) { invoices.value = []; plans.value = []; return; } const [invoiceData, planData] = await Promise.all([getInvoiceSimpleList(state.accessToken, form.contractId), form.customerId ? getReceivablePlanSimpleList(state.accessToken, form.customerId, form.contractId) : Promise.resolve([])]); invoices.value = invoiceData; plans.value = planData; }
 function selectCustomer(index: number) { const customer = customers.value[index]; form.customerId = customer.id; form.customerName = customer.name; form.contractId = undefined; form.contractNo = undefined; form.invoiceId = undefined; form.planId = undefined; form.returnTime = ""; form.returnType = undefined; form.price = undefined; invoices.value = []; plans.value = []; }
-async function selectContract(index: number) { const contract = availableContracts.value[index]; form.contractId = contract.id; form.contractNo = contract.no || contract.name; form.customerId = contract.customerId; form.customerName = contract.customerName; form.invoiceId = undefined; form.planId = undefined; form.returnTime = ""; form.returnType = undefined; form.price = undefined; await loadRelated(); uni.showToast({ title: "璇峰厛瀹屾垚寮�绁ㄥ苟涓婁紶鍙戠エ闄勪欢锛屽啀杩涜鍥炴鎿嶄綔", icon: "none", duration: 2400 }); }
+async function selectContract(index: number) { const contract = availableContracts.value[index]; form.contractId = contract.id; form.contractNo = contract.no || contract.name; form.customerId = contract.customerId; form.customerName = contract.customerName; form.invoiceId = undefined; form.planId = undefined; form.returnTime = ""; form.returnType = undefined; form.price = undefined; await loadRelated(); uni.showToast({ title: "璇峰厛瀹屾垚寮�绁紝鍐嶈繘琛屽洖娆炬搷浣�", icon: "none", duration: 2400 }); }
 function selectPlan(index: number) { const plan = plans.value[index]; form.planId = plan.id; form.returnTime = plan.returnTime?.slice(0, 10) || ""; form.returnType = plan.returnType; form.price = plan.price; }
 async function save() { if (!state.accessToken || saving.value || !editable.value) return; if (!form.customerId || !form.contractId || !form.invoiceId || !form.ownerUserId || !form.returnTime || form.returnType === undefined || !Number(form.price)) return uni.showToast({ title: "璇峰~鍐欏鎴枫�佸悎鍚屻�佸叧鑱斿彂绁ㄣ�佽礋璐d汉銆佸洖娆炬棩鏈熴�佹柟寮忓拰閲戦", icon: "none" }); saving.value = true; try { const data = { ...form, returnTime: `${form.returnTime} 00:00:00`, price: Number(form.price) }; if (id.value) await updateReceivable(state.accessToken, { ...data, id: id.value }); else await createReceivable(state.accessToken, data); uni.showToast({ title: "淇濆瓨鎴愬姛", icon: "success" }); setTimeout(() => uni.navigateBack(), 500); } catch (error) { uni.showToast({ title: error instanceof Error ? error.message : "淇濆瓨澶辫触", icon: "none" }); } finally { saving.value = false; } }
 onLoad(async query => { id.value = query.id ? Number(query.id) : undefined; const contractId = query.contractId ? Number(query.contractId) : undefined; const customerId = query.customerId ? Number(query.customerId) : undefined; const planId = query.planId ? Number(query.planId) : undefined; if (!state.accessToken) return; try { const [customerData, contractData, userData, dictData] = await Promise.all([getCustomerSimpleList(state.accessToken), getContractPage(state.accessToken, { pageNo: 1, pageSize: 100 }), getCrmUserList(state.accessToken), getSimpleDictDataList(state.accessToken)]); customers.value = customerData; contracts.value = contractData.list; users.value = userData; dicts.value = dictData; if (id.value) { const data = await getReceivable(state.accessToken, id.value); Object.assign(form, data, { returnTime: data.returnTime?.slice(0, 10) || "" }); await loadRelated(); } else { form.customerId = customerId; form.customerName = customers.value.find(item => item.id === customerId)?.name; form.ownerUserId = state.user?.id; form.ownerUserName = state.user?.nickname; if (contractId) { const contract = contracts.value.find(item => item.id === contractId) || await getContract(state.accessToken, contractId); if (!contracts.value.some(item => item.id === contract.id)) contracts.value.push(contract); form.contractId = contract.id; form.contractNo = contract.no || contract.name; form.customerId = contract.customerId; form.customerName = contract.customerName; await loadRelated(); } if (planId && form.customerId && form.contractId) { const plan = plans.value.find(item => item.id === planId); if (plan) selectPlan(plans.value.indexOf(plan)); } } } catch (error) { uni.showToast({ title: error instanceof Error ? error.message : "鏁版嵁鍔犺浇澶辫触", icon: "none" }); } });

--
Gitblit v1.9.3