From 51e5f620708fe900b4278222824d0155aea528f7 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 02 十一月 2026 14:59:33 +0800
Subject: [PATCH] refactor(app): 移除页面附件上传功能
---
src/pages/purchase/components/PurchaseForm.vue | 41 -----------------------------------------
1 files changed, 0 insertions(+), 41 deletions(-)
diff --git a/src/pages/purchase/components/PurchaseForm.vue b/src/pages/purchase/components/PurchaseForm.vue
index cf96678..77483d5 100644
--- a/src/pages/purchase/components/PurchaseForm.vue
+++ b/src/pages/purchase/components/PurchaseForm.vue
@@ -19,8 +19,6 @@
import { getMaterialPage, type MaterialItem } from "../../../api/basic-data";
import {
getSupplierSimpleList,
- uploadCertificateFile,
- type StorageAttachment,
type SupplierItem,
} from "../../../api/supplier";
import { useAuth } from "../../../stores/auth";
@@ -188,35 +186,6 @@
);
form.totalPrice = total;
form.paymentPrice = total - (form.discountPrice || 0);
- }
- function chooseAttachment() {
- if (!state.accessToken) return;
- uni.chooseFile({
- count: 1,
- success: async result => {
- const file = result.tempFiles?.[0];
- if (!file?.path) return;
- try {
- const attachment = await uploadCertificateFile(
- state.accessToken!,
- file.path
- );
- form.blobIds = [...(form.blobIds || []), attachment.id];
- form.attachmentList = [...(form.attachmentList || []), attachment];
- uni.showToast({ title: "涓婁紶鎴愬姛", icon: "success" });
- } catch (error) {
- uni.showToast({ title: message(error), icon: "none" });
- }
- },
- });
- }
- function removeAttachment(index: number) {
- form.blobIds?.splice(index, 1);
- form.attachmentList?.splice(index, 1);
- }
- function previewAttachment(attachment: StorageAttachment) {
- if (attachment.url) uni.previewImage({ urls: [attachment.url] });
- else uni.showToast({ title: "闄勪欢鍦板潃涓嶅彲鐢�", icon: "none" });
}
async function load() {
if (!state.accessToken) return;
@@ -627,16 +596,6 @@
class="summary"><text>鍚堣</text>
<view><text>鏁伴噺锛歿{ (form.items || []).reduce((sum, item) => sum + (item.count || 0), 0).toFixed(3) }}</text><text>閲戦锛毬� {{ (form.items || []).reduce((sum, item) => sum + (kind === 'request' ? requestItemAmount(item) : orderItemAmounts(item).totalAmount), 0).toFixed(2) }}</text></view>
</view>
- </view>
- <view class="card attachments">
- <view class="section"><text>闄勪欢</text><button @click="chooseAttachment">涓婁紶闄勪欢</button></view>
- <view v-if="form.attachmentList?.length">
- <view v-for="(attachment, index) in form.attachmentList"
- :key="attachment.id"
- class="attachment"><text @click="previewAttachment(attachment)">{{ attachment.name || `闄勪欢 #${attachment.id}` }}</text><text class="danger"
- @click="removeAttachment(index)">鍒犻櫎</text></view>
- </view><text v-else
- class="empty">鏆傛棤闄勪欢</text>
</view>
<button class="save"
:loading="saving"
--
Gitblit v1.9.3