From fdd3687e392462822226fd4e0ffc20c92a1caaba Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 02 十一月 2026 16:08:30 +0800
Subject: [PATCH] refactor(app): 移除页面附件上传功能
---
src/pages/supplier/certificate/index.vue | 41 +----------------------------------------
1 files changed, 1 insertions(+), 40 deletions(-)
diff --git a/src/pages/supplier/certificate/index.vue b/src/pages/supplier/certificate/index.vue
index 5c523ff..ea32f1d 100644
--- a/src/pages/supplier/certificate/index.vue
+++ b/src/pages/supplier/certificate/index.vue
@@ -9,10 +9,8 @@
getExpiringCertificates,
getSupplierSimpleList,
updateCertificate,
- uploadCertificateFile,
type SupplierCertificateItem,
type SupplierItem,
- type StorageAttachment,
} from "../../../api/supplier";
import { useAuth } from "../../../stores/auth";
import { statusToneClass } from "../../../utils/status";
@@ -169,38 +167,6 @@
});
}
}
- 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 (e) {
- uni.showToast({
- title: e instanceof Error ? e.message : "涓婁紶澶辫触",
- icon: "none",
- });
- }
- },
- });
- }
- function removeAttachment(index: number) {
- form.blobIds?.splice(index, 1);
- form.attachmentList?.splice(index, 1);
- }
- function previewAttachment(item: StorageAttachment) {
- if (item.url) uni.previewImage({ urls: [item.url] });
- else uni.showToast({ title: "闄勪欢鍦板潃涓嶅彲鐢�", icon: "none" });
- }
onShow(() => load(true));
onPullDownRefresh(async () => {
await load(true);
@@ -304,12 +270,7 @@
</view>
<view class="area"><text>澶囨敞</text><textarea v-model="form.remark"
placeholder="澶囨敞" ></textarea></view>
- <view class="attachments">
- <view class="attachmentHead"><text>璇佷功闄勪欢</text><text @click="chooseAttachment">涓婁紶闄勪欢</text></view>
- <view v-for="(item,index) in form.attachmentList"
- :key="item.id"
- class="attachment"><text @click="previewAttachment(item)">{{item.name||`闄勪欢${index+1}`}}</text><text @click="removeAttachment(index)">鍒犻櫎</text></view>
- </view><button class="save"
+<button class="save"
@click="save">淇濆瓨</button>
</scroll-view></view>
</view>
--
Gitblit v1.9.3