|
|
@@ -3,7 +3,7 @@
|
|
|
title="编辑项目商机"
|
|
|
v-model="visible"
|
|
|
direction="rtl"
|
|
|
- size="80%"
|
|
|
+ size="85%"
|
|
|
:close-on-click-modal="false"
|
|
|
class="opp-drawer"
|
|
|
>
|
|
|
@@ -150,10 +150,18 @@
|
|
|
<el-button link type="primary" icon="Upload">上传附件</el-button>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
- <el-table :data="fileList" border class="file-table">
|
|
|
- <el-table-column label="文件名称" prop="name" show-overflow-tooltip />
|
|
|
- <el-table-column label="操作" width="100" align="center">
|
|
|
+ <el-table :data="fileList" border stripe class="file-table">
|
|
|
+ <el-table-column label="文件名称" prop="name" show-overflow-tooltip>
|
|
|
+ <template #default="scope">
|
|
|
+ <el-link type="primary" :underline="false" @click="downloadFile(scope.row)" class="file-link">
|
|
|
+ <el-icon style="margin-right: 4px;"><Document /></el-icon>
|
|
|
+ {{ scope.row.name }}
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="120" align="center">
|
|
|
<template #default="scope">
|
|
|
+ <el-button link type="primary" @click="downloadFile(scope.row)">下载</el-button>
|
|
|
<el-button link type="danger" @click="handleDeleteFile(scope.$index)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -173,11 +181,12 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, reactive, watch, computed, getCurrentInstance } from 'vue';
|
|
|
+import { useDebounceFn } from '@vueuse/core';
|
|
|
import { getOpportunity, updateOpportunity } from '@/api/saleManage/opportunity/index';
|
|
|
import { listCustomerOption } from "@/api/customer/customerInfo/index";
|
|
|
import { listByIds } from '@/api/system/oss/index';
|
|
|
import { globalHeaders } from '@/utils/request';
|
|
|
-import { Close, Upload } from '@element-plus/icons-vue';
|
|
|
+import { Close, Upload, Document } from '@element-plus/icons-vue';
|
|
|
|
|
|
const props = defineProps({
|
|
|
modelValue: Boolean,
|
|
|
@@ -206,7 +215,7 @@ const form = reactive({});
|
|
|
const customerLoading = ref(false);
|
|
|
const localCustomerOptions = ref([]);
|
|
|
|
|
|
-const remoteLoadCustomers = (query) => {
|
|
|
+const remoteLoadCustomers = useDebounceFn((query) => {
|
|
|
customerLoading.value = true;
|
|
|
listCustomerOption({ customerName: query, isHighSeas: 'all' }).then(res => {
|
|
|
const list = res.data || res.rows || [];
|
|
|
@@ -214,7 +223,7 @@ const remoteLoadCustomers = (query) => {
|
|
|
}).finally(() => {
|
|
|
customerLoading.value = false;
|
|
|
});
|
|
|
-};
|
|
|
+}, 300);
|
|
|
|
|
|
const rules = reactive({
|
|
|
companyId: [{ required: true, message: '归属公司不能为空', trigger: 'change' }],
|
|
|
@@ -284,7 +293,11 @@ const loadDetail = (id) => {
|
|
|
|
|
|
if (form.fileNo) {
|
|
|
listByIds(form.fileNo).then(ossRes => {
|
|
|
- fileList.value = ossRes.data.map(i => ({ name: i.originalName, url: i.url, ossId: i.ossId }));
|
|
|
+ fileList.value = ossRes.data.map(i => ({
|
|
|
+ name: i.originalName || i.fileName,
|
|
|
+ url: i.url,
|
|
|
+ ossId: i.ossId
|
|
|
+ }));
|
|
|
});
|
|
|
} else {
|
|
|
fileList.value = [];
|
|
|
@@ -309,12 +322,28 @@ const handleLeaderChange = (val) => {
|
|
|
|
|
|
const handleUploadSuccess = (res) => {
|
|
|
if (res.code === 200) {
|
|
|
- fileList.value.push({ name: res.data.fileName, url: res.data.url, ossId: res.data.ossId });
|
|
|
+ const file = res.data;
|
|
|
+ fileList.value.push({
|
|
|
+ name: file.originalName || file.fileName,
|
|
|
+ url: file.url,
|
|
|
+ ossId: file.ossId
|
|
|
+ });
|
|
|
form.fileNo = fileList.value.map(f => f.ossId).join(',');
|
|
|
proxy.$modal.msgSuccess("上传成功");
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const downloadFile = (row) => {
|
|
|
+ if (row.url) {
|
|
|
+ proxy.$modal.msgInfo("正在启动下载...");
|
|
|
+ if (proxy.$download && proxy.$download.resource) {
|
|
|
+ proxy.$download.resource(row.url);
|
|
|
+ } else {
|
|
|
+ window.open(row.url, '_blank');
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
const handleDeleteFile = (index) => {
|
|
|
fileList.value.splice(index, 1);
|
|
|
form.fileNo = fileList.value.map(f => f.ossId).join(',');
|
|
|
@@ -325,17 +354,29 @@ const submitForm = () => {
|
|
|
if (valid) {
|
|
|
submitting.value = true;
|
|
|
const data = {
|
|
|
- ...form,
|
|
|
+ id: form.id,
|
|
|
+ projectName: form.projectName,
|
|
|
projectBudget: Number(form.amount),
|
|
|
winRate: Number(form.winRate),
|
|
|
approvalDate: form.setupTime,
|
|
|
expectedCompletionTime: form.deadline,
|
|
|
companyNo: form.companyId,
|
|
|
leader: form.managerId,
|
|
|
+ leaderName: form.leaderName,
|
|
|
activityNo: form.marketingActivity,
|
|
|
procurementMethod: form.purchaseMethod,
|
|
|
infoSource: form.source,
|
|
|
- projectDescription: form.description
|
|
|
+ projectDescription: form.description,
|
|
|
+ competitor: form.competitor,
|
|
|
+ customerNo: form.customerNo,
|
|
|
+ customerName: form.customerName,
|
|
|
+ fileNo: form.fileNo,
|
|
|
+ projectLevel: form.projectLevel,
|
|
|
+ projectArea: form.projectArea,
|
|
|
+ profession: form.profession,
|
|
|
+ izClue: form.izClue || 0,
|
|
|
+ projectType: form.projectType || '销售商机',
|
|
|
+ status: form.status || '0'
|
|
|
};
|
|
|
updateOpportunity(data).then(() => {
|
|
|
proxy.$modal.msgSuccess("修改成功");
|
|
|
@@ -350,16 +391,28 @@ const submitForm = () => {
|
|
|
<style scoped lang="scss">
|
|
|
.opp-drawer {
|
|
|
:deep(.el-drawer__header) {
|
|
|
- margin-bottom: 0;
|
|
|
- span, div { font-weight: normal !important; color: #333; }
|
|
|
+ margin: 0;
|
|
|
+ padding: 0 20px;
|
|
|
+ height: 48px;
|
|
|
+ line-height: 48px;
|
|
|
+ border-bottom: 1px solid #f0f0f0;
|
|
|
+ span {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: normal;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
}
|
|
|
+ :deep(.el-drawer__body) { padding: 0 !important; background-color: #fff; }
|
|
|
}
|
|
|
|
|
|
.drawer-body {
|
|
|
- padding: 10px 20px;
|
|
|
+ padding: 0;
|
|
|
+ height: 100%;
|
|
|
+ overflow-y: auto;
|
|
|
}
|
|
|
|
|
|
.opp-form {
|
|
|
+ padding: 15px 24px;
|
|
|
:deep(.el-form-item__label) {
|
|
|
font-weight: normal !important;
|
|
|
color: #666;
|
|
|
@@ -367,24 +420,41 @@ const submitForm = () => {
|
|
|
}
|
|
|
|
|
|
.section-block {
|
|
|
- margin-bottom: 15px;
|
|
|
+ margin-bottom: 24px;
|
|
|
.section-title {
|
|
|
- font-size: 14px;
|
|
|
+ padding: 8px 15px;
|
|
|
+ background-color: #f8fbff;
|
|
|
color: #409eff;
|
|
|
- margin-bottom: 10px;
|
|
|
- padding-bottom: 6px;
|
|
|
- border-bottom: 1px solid #f0f2f5;
|
|
|
+ font-size: 14px;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ border-bottom: none;
|
|
|
+ &.attachment-header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding-top: 4px;
|
|
|
+ padding-bottom: 4px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-.attachment-header {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
+
|
|
|
+.file-table {
|
|
|
+ :deep(th.el-table__cell) {
|
|
|
+ background-color: #f8fafc !important;
|
|
|
+ color: #475569;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+ .file-link {
|
|
|
+ font-weight: normal;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
.drawer-footer {
|
|
|
- padding: 10px 20px;
|
|
|
+ padding: 12px 24px;
|
|
|
border-top: 1px solid #f0f2f5;
|
|
|
text-align: right;
|
|
|
- .el-button { font-weight: normal !important; }
|
|
|
+ background-color: #fff;
|
|
|
+ .el-button { font-weight: normal !important; padding: 8px 20px; }
|
|
|
}
|
|
|
</style>
|