From 6f064a4b35e4bbca3f3eb801e0cbc7a27fde604d Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 18 九月 2025 13:33:50 +0800
Subject: [PATCH] 三联打印功能
---
src/views/basicData/customerFile/index.vue | 84 ++++++++++++++++++++++++++++++-----------
1 files changed, 61 insertions(+), 23 deletions(-)
diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index 7abc80a..8043d1a 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -92,25 +92,6 @@
</el-form-item>
</el-col>
</el-row>
- <el-row :gutter="30" v-for="(contact, index) in formYYs.contactList" :key="index">
- <el-col :span="12">
- <el-form-item label="鑱旂郴浜猴細" prop="contactPerson">
- <el-input v-model="contact.contactPerson" placeholder="璇疯緭鍏�" clearable />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鑱旂郴鐢佃瘽锛�" prop="contactPhone">
- <div style="display: flex; align-items: center;width: 100%;">
- <el-input v-model="contact.contactPhone" placeholder="璇疯緭鍏�" clearable />
- <el-button @click="removeContact(index)" type="danger" circle style="margin-left: 5px;">
- <el-icon><Close /></el-icon>
- </el-button>
- </div>
- </el-form-item>
- </el-col>
- </el-row>
- <el-button @click="addNewContact" style="margin-bottom: 10px;">+ 鏂板鑱旂郴浜�</el-button>
-
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="閾惰鍩烘湰鎴凤細" prop="basicBankAccount">
@@ -142,6 +123,24 @@
</el-form-item>
</el-col>
</el-row>
+ <el-row :gutter="30" v-for="(contact, index) in formYYs.contactList" :key="index">
+ <el-col :span="12">
+ <el-form-item label="鑱旂郴浜猴細" prop="contactPerson">
+ <el-input v-model="contact.contactPerson" placeholder="璇疯緭鍏�" clearable />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鑱旂郴鐢佃瘽锛�" prop="contactPhone">
+ <div style="display: flex; align-items: center;width: 100%;">
+ <el-input v-model="contact.contactPhone" placeholder="璇疯緭鍏�" clearable />
+ <el-button @click="removeContact(index)" type="danger" circle style="margin-left: 5px;">
+ <el-icon><Close /></el-icon>
+ </el-button>
+ </div>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-button @click="addNewContact" style="margin-bottom: 10px;">+ 鏂板鑱旂郴浜�</el-button>
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="缁存姢浜猴細" prop="maintainer">
@@ -197,8 +196,11 @@
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
- :on-progress="handleFileUploadProgress"
- :on-success="handleFileSuccess"
+ :before-upload="upload.beforeUpload"
+ :on-progress="upload.onProgress"
+ :on-success="upload.onSuccess"
+ :on-error="upload.onError"
+ :on-change="upload.onChange"
:auto-upload="false"
drag
>
@@ -228,7 +230,7 @@
</template>
<script setup>
-import { ref } from "vue";
+import {onMounted, ref} from "vue";
import { Search } from "@element-plus/icons-vue";
import {
addCustomer,
@@ -380,6 +382,40 @@
headers: { Authorization: "Bearer " + getToken() },
// 涓婁紶鐨勫湴鍧�
url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData",
+ // 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
+ beforeUpload: (file) => {
+ console.log('鏂囦欢鍗冲皢涓婁紶', file);
+ // 鍙互鍦ㄦ澶勫仛鏂囦欢绫诲瀷鎴栧ぇ灏忔牎楠�
+ const isValid = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.name.endsWith('.xlsx') || file.name.endsWith('.xls');
+ if (!isValid) {
+ proxy.$modal.msgError("鍙兘涓婁紶 Excel 鏂囦欢");
+ }
+ return isValid;
+ },
+ // 鏂囦欢鐘舵�佹敼鍙樻椂鐨勫洖璋�
+ onChange: (file, fileList) => {
+ console.log('鏂囦欢鐘舵�佹敼鍙�', file, fileList);
+ },
+ // 鏂囦欢涓婁紶鎴愬姛鏃剁殑鍥炶皟
+ onSuccess: (response, file, fileList) => {
+ console.log('涓婁紶鎴愬姛', response, file, fileList);
+ if(response.code === 200){
+ proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
+ }else if(response.code === 500){
+ proxy.$modal.msgError(response.msg);
+ }else{
+ proxy.$modal.msgWarning(response.msg);
+ }
+ },
+ // 鏂囦欢涓婁紶澶辫触鏃剁殑鍥炶皟
+ onError: (error, file, fileList) => {
+ console.error('涓婁紶澶辫触', error, file, fileList);
+ proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
+ },
+ // 鏂囦欢涓婁紶杩涘害鍥炶皟
+ onProgress: (event, file, fileList) => {
+ console.log('涓婁紶涓�...', event.percent);
+ }
});
const { searchForm, form, rules } = toRefs(data);
const addNewContact = () => {
@@ -554,7 +590,9 @@
return `${year}-${month}-${day}`;
}
-getList();
+onMounted(() => {
+ getList();
+});
</script>
<style scoped lang="scss"></style>
--
Gitblit v1.9.3