| .husky/commit-msg | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| .husky/pre-commit | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/api/product/attachment.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/production/twist/attachment/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/production/twist/report/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/production/wire/attachment/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/production/wire/report/wire.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | 
.husky/commit-msg
ÎļþÒÑɾ³ý .husky/pre-commit
ÎļþÒÑɾ³ý src/api/product/attachment.ts
@@ -63,7 +63,7 @@ }, // æ¥å·¥æ·»å éä»¶ addOutputAttachments(params: { id: number; attachmentIds: string }) { addOutputAttachments(params: { id: number; attachmentId: string }) { return request<BaseResult<any>>({ url: "/app/addOutputAttachments", method: "POST", src/pages/production/twist/attachment/index.vue
@@ -55,21 +55,27 @@ const reportType = ref("ç»çº¿"); const attachmentList = ref<any[]>([]); const detailData = ref<any>({}); // è·åéä»¶å表 const getAttachmentList = async () => { const getAttachmentList = async (data: any) => { try { detailData.value = data; console.log(" detailData.value", detailData.value); const pages = getCurrentPages(); const currentPage = pages[pages.length - 1]; const options = (currentPage as any).options; const currentReportId = options?.reportId; const currentReportId = detailData.value.id; if (currentReportId) { reportId.value = currentReportId; // ç´æ¥è°ç¨éç¨æ¥çæ¥å£æ¥è¯¢éä»¶å表 // 使ç¨ç¤ºä¾ä¸çéä»¶IDæ°ç» [850,851] const attachmentIds: number[] = [850, 851]; // 使ç¨HTTPæä»¶ä¸çç¤ºä¾æ°æ® const attachmentIds: number[] = detailData.value.attachmentId !== null? detailData.value.attachmentId.split(",") : []; // 使ç¨HTTPæä»¶ä¸çç¤ºä¾æ°æ® if (attachmentIds.length === 0) { return; } const { data } = await AttachmentAPI.listAttachmentFiles(attachmentIds); attachmentList.value = data || []; } else { @@ -95,20 +101,30 @@ const filePaths = Array.isArray(res.tempFilePaths) ? res.tempFilePaths : [res.tempFilePaths]; const uploadResults = await AttachmentAPI.uploadAttachmentFiles(filePaths); const uploadResults: any = await AttachmentAPI.uploadAttachmentFiles(filePaths); const result = uploadResults.map((it) => { return it.data; }); console.log("result", result); // æ´æ°éä»¶å表 const flattenedResult = result.flat(); attachmentList.value.push(...flattenedResult); console.log(attachmentList.value); // æåéä»¶ID const attachmentIds = uploadResults.map((result) => result.data.id).join(","); const attachmentId = attachmentList.value.map((item: any) => item.id).join(","); // å ³èå°æ¥å·¥ await AttachmentAPI.addOutputAttachments({ id: parseInt(reportId.value), attachmentIds: attachmentIds, }); if (attachmentId) { await AttachmentAPI.addOutputAttachments({ id: parseInt(detailData.value.id), attachmentId: attachmentId, }); detailData.value.attachmentId = attachmentId; } toast.show("ä¸ä¼ æå"); // éæ°è·åéä»¶å表 await getAttachmentList(); // await getAttachmentList(); } catch (error) { console.error("ä¸ä¼ 失败:", error); toast.show("ä¸ä¼ 失败"); @@ -122,7 +138,7 @@ }; // å é¤éä»¶ const deleteAttachment = async (attachmentId: number) => { const deleteAttachment = async (aid: number) => { try { uni.showModal({ title: "确认å é¤", @@ -130,18 +146,17 @@ success: async (res) => { if (res.confirm) { // å端æå¨å é¤ï¼ç´æ¥ä»å表ä¸ç§»é¤è¿æ¡æ°æ® attachmentList.value = attachmentList.value.filter((item) => item.id !== attachmentId); attachmentList.value = attachmentList.value.filter((item) => item.id !== aid); // è·åå©ä½çéä»¶IDç»å const remainingIds = attachmentList.value.map((item) => item.id); const attachmentIds = remainingIds.join(","); const attachmentId = attachmentList.value.map((item) => item.id).join(","); // è°ç¨æ¥å·¥æ·»å éä»¶æ¥å£ï¼æ´æ°éä»¶å ³è await AttachmentAPI.addOutputAttachments({ id: parseInt(reportId.value), attachmentIds: attachmentIds, id: parseInt(detailData.value.id), attachmentId: attachmentId, }); detailData.value.attachmentId = attachmentId; toast.show("å 餿å"); } }, @@ -235,7 +250,10 @@ }; onMounted(() => { getAttachmentList(); uni.$on("detailData", (data) => { // å¤çæ¥æ¶å°çæ°æ® getAttachmentList(data); }); }); </script>  src/pages/production/twist/report/index.vue
@@ -17,7 +17,7 @@ </template> <ProductionCard :data="cardAttr" :value="item" /> <template #footer> <wd-button size="small" plain @click="toAttachment(item.id)" style="margin-right: 10px"> <wd-button size="small" plain @click="toAttachment(item)" style="margin-right: 10px"> éä»¶ </wd-button> <wd-button size="small" plain @click="toCheck(item.id)">èªæ£</wd-button> @@ -103,17 +103,17 @@ dialog.visible = false; }; const toAttachment = (id: number) => { const toAttachment = (item: any) => { uni.navigateTo({ url: `/pages/production/twist/attachment/index?reportId=${id}`, url: "/pages/production/twist/attachment/index", success: () => { // 页é¢è·³è½¬æåååéäºä»¶ä¼ éæ°æ® uni.$emit("detailData", item); }, }); }; const toCheck = (id: number) => { uni.navigateTo({ url: `/pages/production/twist/selfInspect/index?id=${id}`, }); }; // è·åæä¸æ¥å·¥å表 const getTwistReportList = async () => { src/pages/production/wire/attachment/index.vue
@@ -52,24 +52,30 @@ // 页é¢åæ° const reportId = ref(""); const reportType = ref("æä¸"); const reportType = ref("ç»çº¿"); const attachmentList = ref<any[]>([]); const detailData = ref<any>({}); // è·åéä»¶å表 const getAttachmentList = async () => { const getAttachmentList = async (data: any) => { try { detailData.value = data; console.log(" detailData.value", detailData.value); const pages = getCurrentPages(); const currentPage = pages[pages.length - 1]; const options = (currentPage as any).options; const currentReportId = options?.reportId; const currentReportId = detailData.value.id; if (currentReportId) { reportId.value = currentReportId; // ç´æ¥è°ç¨éç¨æ¥çæ¥å£æ¥è¯¢éä»¶å表 // 使ç¨ç¤ºä¾ä¸çéä»¶IDæ°ç» [850,851] const attachmentIds: number[] = [850, 851]; // 使ç¨HTTPæä»¶ä¸çç¤ºä¾æ°æ® const attachmentIds: number[] = detailData.value.attachmentId !== null? detailData.value.attachmentId.split(",") : []; // 使ç¨HTTPæä»¶ä¸çç¤ºä¾æ°æ® if (attachmentIds.length === 0) { return; } const { data } = await AttachmentAPI.listAttachmentFiles(attachmentIds); attachmentList.value = data || []; } else { @@ -95,20 +101,30 @@ const filePaths = Array.isArray(res.tempFilePaths) ? res.tempFilePaths : [res.tempFilePaths]; const uploadResults = await AttachmentAPI.uploadAttachmentFiles(filePaths); const uploadResults: any = await AttachmentAPI.uploadAttachmentFiles(filePaths); const result = uploadResults.map((it) => { return it.data; }); console.log("result", result); // æ´æ°éä»¶å表 const flattenedResult = result.flat(); attachmentList.value.push(...flattenedResult); console.log(attachmentList.value); // æåéä»¶ID const attachmentIds = uploadResults.map((result) => result.data.id).join(","); const attachmentId = attachmentList.value.map((item: any) => item.id).join(","); // å ³èå°æ¥å·¥ await AttachmentAPI.addOutputAttachments({ id: parseInt(reportId.value), attachmentIds: attachmentIds, }); if (attachmentId) { await AttachmentAPI.addOutputAttachments({ id: parseInt(detailData.value.id), attachmentId: attachmentId, }); detailData.value.attachmentId = attachmentId; } toast.show("ä¸ä¼ æå"); // éæ°è·åéä»¶å表 await getAttachmentList(); // await getAttachmentList(); } catch (error) { console.error("ä¸ä¼ 失败:", error); toast.show("ä¸ä¼ 失败"); @@ -122,7 +138,7 @@ }; // å é¤éä»¶ const deleteAttachment = async (attachmentId: number) => { const deleteAttachment = async (aid: number) => { try { uni.showModal({ title: "确认å é¤", @@ -130,18 +146,17 @@ success: async (res) => { if (res.confirm) { // å端æå¨å é¤ï¼ç´æ¥ä»å表ä¸ç§»é¤è¿æ¡æ°æ® attachmentList.value = attachmentList.value.filter((item) => item.id !== attachmentId); attachmentList.value = attachmentList.value.filter((item) => item.id !== aid); // è·åå©ä½çéä»¶IDç»å const remainingIds = attachmentList.value.map((item) => item.id); const attachmentIds = remainingIds.join(","); const attachmentId = attachmentList.value.map((item) => item.id).join(","); // è°ç¨æ¥å·¥æ·»å éä»¶æ¥å£ï¼æ´æ°éä»¶å ³è await AttachmentAPI.addOutputAttachments({ id: parseInt(reportId.value), attachmentIds: attachmentIds, id: parseInt(detailData.value.id), attachmentId: attachmentId, }); detailData.value.attachmentId = attachmentId; toast.show("å 餿å"); } }, @@ -235,7 +250,10 @@ }; onMounted(() => { getAttachmentList(); uni.$on("detailData", (data) => { // å¤çæ¥æ¶å°çæ°æ® getAttachmentList(data); }); }); </script>  src/pages/production/wire/report/wire.vue
@@ -22,7 +22,7 @@ </template> <ProductionCard :data="cardAttr" :value="item" /> <template #footer> <wd-button size="small" plain @click="toAttachment(item.id)" style="margin-right: 10px"> <wd-button size="small" plain @click="toAttachment(item)" style="margin-right: 10px"> éä»¶ </wd-button> <wd-button size="small" plain @click="toCheck(item.id)">èªæ£</wd-button> @@ -123,9 +123,13 @@ dialog.visible = false; }; const toAttachment = (id: number) => { const toAttachment = (item: any) => { uni.navigateTo({ url: `/pages/production/wire/attachment/index?reportId=${id}`, url: "/pages/production/wire/attachment/index", success: () => { // 页é¢è·³è½¬æåååéäºä»¶ä¼ éæ°æ® uni.$emit("detailData", item); }, }); };