| | |
| | | const fileList = ref([]); |
| | | |
| | | const form = reactive({ |
| | | id: undefined, |
| | | caseNo: "", |
| | | projectId: "", |
| | | projectName: "", |
| | |
| | | |
| | | const initProjects = async () => { |
| | | try { |
| | | const res = await listProject({ pageSize: 1000 }); |
| | | const rows = res?.rows || res?.data?.rows || []; |
| | | projectOptions.value = rows.map((p) => ({ label: p.projectName, value: p.id })); |
| | | const res = await listProject({ pageSize: 1000, current: 1, size: 1000 }); |
| | | const rows = res?.records || res?.rows || res?.data?.records || res?.data?.rows || res?.data || []; |
| | | projectOptions.value = rows.map((p) => ({ |
| | | label: (p.no ? p.no + ' - ' : '') + (p.title || ''), |
| | | value: p.id, |
| | | title: p.title |
| | | })); |
| | | } catch (e) { |
| | | console.error("加载项目列表失败", e); |
| | | } |
| | |
| | | const initContracts = async () => { |
| | | try { |
| | | const res = await contractListNoPage({}); |
| | | const list = Array.isArray(res) ? res : res?.data ?? res?.records ?? []; |
| | | const list = Array.isArray(res) ? res : (res?.data?.records || res?.data || res?.records || []); |
| | | contractOptions.value = list.map((item) => ({ |
| | | label: item.contractNo + (item.signingUnit ? `(${item.signingUnit})` : ""), |
| | | value: item.id, |
| | |
| | | |
| | | const handleProjectChange = (val) => { |
| | | const project = projectOptions.value.find((item) => item.value === val); |
| | | form.projectName = project ? project.label : ""; |
| | | form.projectName = project ? (project.title || project.label) : ""; |
| | | }; |
| | | |
| | | const handleContractChange = (val) => { |
| | |
| | | form[key] = ""; |
| | | }); |
| | | form.claimAmount = undefined; |
| | | form.id = undefined; |
| | | }; |
| | | |
| | | const openForm = async (type, row) => { |