From 7b51e925d5be81c795476cb59208b99906e4a5fd Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 19 九月 2025 09:36:27 +0800
Subject: [PATCH] 部署修改
---
src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue | 97 ++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 92 insertions(+), 5 deletions(-)
diff --git a/src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue b/src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue
index a71d689..83585a1 100644
--- a/src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue
+++ b/src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue
@@ -53,7 +53,10 @@
:key="node.id"
style="margin-right: 30px; text-align: center; margin-bottom: 10px;"
>
- <div>鑺傜偣{{ index + 1 }} 鈫�</div>
+ <div>
+ <span>瀹℃壒浜�</span>
+ 鈫�
+ </div>
<el-select
v-model="node.userId"
placeholder="閫夋嫨浜哄憳"
@@ -109,6 +112,23 @@
</el-form-item>
</el-col>
</el-row>
+ <el-row :gutter="30">
+ <el-col :span="24">
+ <el-form-item label="闄勪欢鏉愭枡锛�" prop="remark">
+ <el-upload v-model:file-list="fileList" :action="upload.url" multiple ref="fileUpload" auto-upload
+ :headers="upload.headers" :before-upload="handleBeforeUpload" :on-error="handleUploadError"
+ :on-success="handleUploadSuccess" :on-remove="handleRemove">
+ <el-button type="primary" v-if="operationType !== 'view'">涓婁紶</el-button>
+ <template #tip v-if="operationType !== 'view'">
+ <div class="el-upload__tip">
+ 鏂囦欢鏍煎紡鏀寔
+ doc锛宒ocx锛寈ls锛寈lsx锛宲pt锛宲ptx锛宲df锛宼xt锛寈ml锛宩pg锛宩peg锛宲ng锛実if锛宐mp锛宺ar锛寊ip锛�7z
+ </div>
+ </template>
+ </el-upload>
+ </el-form-item>
+ </el-col>
+ </el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
@@ -126,8 +146,12 @@
approveProcessAdd, approveProcessGetInfo,
approveProcessUpdate,
getDept
-} from "../../../../api/collaborativeApproval/approvalProcess.js";
-import {userListNoPage, getUserProfile} from "../../../../api/system/user.js";
+} from "@/api/collaborativeApproval/approvalProcess.js";
+import {
+ delLedgerFile,
+} from "@/api/salesManagement/salesLedger.js";
+import {userListNoPageByTenantId} from "@/api/system/user.js";
+import { getToken } from "@/utils/auth";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
import useUserStore from "@/store/modules/user";
@@ -135,6 +159,13 @@
const dialogFormVisible = ref(false);
const operationType = ref('')
+const fileList = ref([]);
+const upload = reactive({
+ // 涓婁紶鐨勫湴鍧�
+ url: import.meta.env.VITE_APP_BASE_API + "/file/upload",
+ // 璁剧疆涓婁紶鐨勮姹傚ご閮�
+ headers: { Authorization: "Bearer " + getToken() },
+});
const data = reactive({
form: {
approveTime: "",
@@ -143,6 +174,7 @@
approveDeptId: "",
approveReason: "",
checkResult: "",
+ tempFileIds: [],
approverList: [] // 鏂板瀛楁锛屽瓨鍌ㄦ墍鏈夎妭鐐圭殑瀹℃壒浜篿d
},
rules: {
@@ -156,6 +188,13 @@
});
const { form, rules } = toRefs(data);
const productOptions = ref([]);
+const currentApproveStatus = ref(0)
+const props = defineProps({
+ approveType: {
+ type: [Number, String],
+ default: 0
+ }
+})
// 瀹℃壒浜鸿妭鐐圭浉鍏�
const approverNodes = ref([
@@ -172,9 +211,10 @@
// 鎵撳紑寮规
const openDialog = (type, row) => {
+ console.log('openDialog', type, row)
operationType.value = type;
dialogFormVisible.value = true;
- userListNoPage().then((res) => {
+ userListNoPageByTenantId().then((res) => {
userList.value = res.data;
});
getProductOptions();
@@ -188,6 +228,9 @@
// 鑾峰彇褰撳墠鐢ㄦ埛淇℃伅骞惰缃儴闂↖D
form.value.approveDeptId = userStore.currentDeptId
if (operationType.value === 'edit') {
+ fileList.value = row.commonFileList
+ form.value.tempFileIds = fileList.value.map(file => file.id)
+ currentApproveStatus.value = row.approveStatus
approveProcessGetInfo({id: row.approveId,approveReason: '1'}).then(res => {
form.value = {...res.data}
// 鍙嶆樉瀹℃壒浜�
@@ -228,6 +271,7 @@
const submitForm = () => {
// 鏀堕泦鎵�鏈夎妭鐐圭殑瀹℃壒浜篿d
form.value.approveUserIds = approverNodes.value.map(node => node.userId).join(',')
+ form.value.approveType = props.approveType
// 瀹℃壒浜哄繀濉牎楠�
const hasEmptyApprover = approverNodes.value.some(node => !node.userId)
if (hasEmptyApprover) {
@@ -236,7 +280,7 @@
}
proxy.$refs.formRef.validate(valid => {
if (valid) {
- if (operationType.value === "add") {
+ if (operationType.value === "add" || currentApproveStatus.value == 3) {
approveProcessAdd(form.value).then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
@@ -252,6 +296,7 @@
}
// 鍏抽棴寮规
const closeDia = () => {
+ fileList.value = []
proxy.resetForm("formRef");
dialogFormVisible.value = false;
emit('close')
@@ -264,6 +309,48 @@
const day = String(today.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
}
+
+// 涓婁紶鍓嶆牎妫�
+function handleBeforeUpload(file) {
+ // 鏍℃鏂囦欢澶у皬
+ // if (file.size > 1024 * 1024 * 10) {
+ // proxy.$modal.msgError("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃10MB!");
+ // return false;
+ // }
+ proxy.$modal.loading("姝e湪涓婁紶鏂囦欢锛岃绋嶅��...");
+ return true;
+}
+// 涓婁紶澶辫触
+function handleUploadError(err) {
+ proxy.$modal.msgError("涓婁紶鏂囦欢澶辫触");
+ proxy.$modal.closeLoading();
+}
+// 涓婁紶鎴愬姛鍥炶皟
+function handleUploadSuccess(res, file, uploadFiles) {
+ proxy.$modal.closeLoading();
+ if (res.code === 200) {
+ // 纭繚 tempFileIds 瀛樺湪涓斾负鏁扮粍
+ if (!form.value.tempFileIds) {
+ form.value.tempFileIds = [];
+ }
+ form.value.tempFileIds.push(res.data.tempId);
+ proxy.$modal.msgSuccess("涓婁紶鎴愬姛");
+ } else {
+ proxy.$modal.msgError(res.msg);
+ proxy.$refs.fileUpload.handleRemove(file);
+ }
+}
+// 绉婚櫎鏂囦欢
+function handleRemove(file) {
+ if (operationType.value === "edit") {
+ let ids = [];
+ ids.push(file.id);
+ delLedgerFile(ids).then((res) => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ });
+ }
+}
+
defineExpose({
openDialog,
});
--
Gitblit v1.9.3