From 5afd9f97735894e558af58841d39e76da3c465f2 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 09 二月 2026 15:02:28 +0800
Subject: [PATCH] 公司 1.商机管理附件删除修改 2.商机管理添加新状态,并添加筛选条件 3.商机管理添加行业、信息化现状、主营业务收入等字段
---
src/views/salesManagement/opportunityManagement/index.vue | 178 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 166 insertions(+), 12 deletions(-)
diff --git a/src/views/salesManagement/opportunityManagement/index.vue b/src/views/salesManagement/opportunityManagement/index.vue
index 405cd8a..888a9ac 100644
--- a/src/views/salesManagement/opportunityManagement/index.vue
+++ b/src/views/salesManagement/opportunityManagement/index.vue
@@ -2,16 +2,59 @@
<div class="app-container">
<!-- 鎼滅储鍖哄煙 -->
<div class="search_form">
- <el-form :model="searchForm" :inline="true" label-width="auto">
+ <el-form :model="searchForm" :inline="true">
<el-form-item label="瀹㈡埛鍚嶇О">
<el-input
v-model="searchForm.customerName"
placeholder="璇疯緭鍏ュ鎴峰悕绉�"
clearable
prefix-icon="Search"
- style="width: 200px"
+ style="width: 200px;"
@change="handleQuery"
/>
+ </el-form-item>
+ <el-form-item label="鍩庡競">
+ <el-input
+ v-model="searchForm.city"
+ placeholder="璇疯緭鍏ュ煄甯傚悕绉�"
+ clearable
+ prefix-icon="Search"
+ style="width: 200px"
+ @change="handleQuery"
+ />
+ </el-form-item>
+ <el-form-item label="鐘舵��">
+ <el-select
+ v-model="searchForm.status"
+ placeholder="璇烽�夋嫨鐘舵��"
+ clearable
+ style="width: 160px"
+ @change="handleQuery"
+ >
+ <el-option
+ v-for="item in statusOptions"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="褰曞叆浜�">
+ <el-select
+ v-model="searchForm.entryPerson"
+ placeholder="璇烽�夋嫨褰曞叆浜�"
+ clearable
+ filterable
+ style="width: 200px"
+ @change="handleQuery"
+ >
+ <el-option
+ v-for="item in userList"
+ :key="item.nickName"
+ :label="item.nickName"
+ :value="item.nickName"
+ />
+ </el-select>
</el-form-item>
<el-form-item label="褰曞叆鏃ユ湡锛�">
<el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
@@ -20,12 +63,10 @@
<el-form-item>
<el-button type="primary" @click="handleQuery">鎼滅储</el-button>
<el-button @click="resetQuery">閲嶇疆</el-button>
+ <el-button type="primary" @click="handleAdd">鏂板缓</el-button>
+ <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
</el-form-item>
</el-form>
- <div class="actions">
- <el-button type="primary" @click="handleAdd">鏂板缓</el-button>
- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
- </div>
</div>
<!-- 琛ㄦ牸鍖哄煙 -->
<div class="table_list">
@@ -169,6 +210,40 @@
</el-select>
</el-form-item>
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="琛屼笟">
+ <el-input v-model="form.industry" placeholder="璇疯緭鍏ヨ涓�" clearable :disabled="operationType === 'detail' || operationType === 'addOperation'" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="涓昏惀浜у搧">
+ <el-input v-model="form.mainProducts" placeholder="璇疯緭鍏ヤ富钀ヤ骇鍝�" clearable :disabled="operationType === 'detail' || operationType === 'addOperation'" />
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="涓昏惀涓氬姟鏀跺叆">
+ <el-input v-model="form.mainBusinessRevenue" placeholder="璇疯緭鍏ヤ富钀ヤ笟鍔℃敹鍏�" clearable :disabled="operationType === 'detail' || operationType === 'addOperation'" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="瀹㈡埛瑙勬ā">
+ <el-input v-model="form.customerScale" placeholder="璇疯緭鍏ュ鎴疯妯�" clearable :disabled="operationType === 'detail' || operationType === 'addOperation'" />
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="24">
+ <el-form-item label="淇℃伅鍖栫幇鐘�">
+ <el-input v-model="form.informationState" placeholder="璇疯緭鍏ヤ俊鎭寲鐜扮姸" clearable :disabled="operationType === 'detail' || operationType === 'addOperation'" />
+ </el-form-item>
+ </el-col>
+ </el-row>
+
<el-form-item label="鍟嗘満鏉ユ簮" prop="businessSource">
<el-input v-model="form.businessSource" placeholder="璇疯緭鍏ュ晢鏈烘潵婧�" :disabled="operationType === 'detail' || operationType === 'addOperation'" />
</el-form-item>
@@ -219,6 +294,25 @@
</el-row>
</el-form>
+ <!-- 闄勪欢鏌ョ湅锛堜粎鍦ㄨ鎯呮ā寮忎笅鏄剧ず锛� -->
+ <div v-if="operationType === 'detail'" class="attachment-section">
+ <el-divider content-position="left">闄勪欢鏉愭枡</el-divider>
+ <div v-if="form.businessCommonFiles && form.businessCommonFiles.length > 0">
+ <el-table :data="form.businessCommonFiles" border stripe style="width: 100%">
+ <el-table-column label="闄勪欢鍚嶇О" prop="name" min-width="400" show-overflow-tooltip />
+ <el-table-column fixed="right" label="鎿嶄綔" width="150" align="center">
+ <template #default="scope">
+ <el-button link type="primary" size="small" @click="downloadAttachment(scope.row)">涓嬭浇</el-button>
+ <el-button link type="primary" size="small" @click="previewAttachment(scope.row)">棰勮</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <div v-else style="text-align: center; padding: 20px; color: #999;">
+ 鏆傛棤闄勪欢
+ </div>
+ </div>
+
<!-- 鍙樻洿璁板綍鏃堕棿绾匡紙浠呭湪璇︽儏妯″紡涓嬫樉绀猴級 -->
<div v-if="operationType === 'detail'" class="change-history-section">
<el-divider content-position="left">鍙樻洿璁板綍</el-divider>
@@ -266,7 +360,9 @@
</el-dialog>
<!-- 闄勪欢鍒楄〃瀵硅瘽妗� -->
- <FileList ref="fileListRef" />
+ <FileList ref="fileListRef" @refresh="handleFileListRefresh" />
+ <!-- 鏂囦欢棰勮缁勪欢 -->
+ <filePreview ref="filePreviewRef" />
</div>
</template>
@@ -288,6 +384,7 @@
import { userListNoPage } from '@/api/system/user.js'
import {customerList, getSalesLedgerWithProducts} from '@/api/salesManagement/salesLedger.js'
import FileList from './fileList.vue'
+import filePreview from '@/components/filePreview/index.vue'
const { proxy } = getCurrentInstance()
const userStore = useUserStore()
@@ -309,6 +406,9 @@
// 鎼滅储琛ㄥ崟
const searchForm = reactive({
customerName: '',
+ city: '',
+ status: '',
+ entryPerson: '',
entryDate: [],
entryDateStart: '',
entryDateEnd: ''
@@ -324,6 +424,11 @@
province: '',
city: '',
customerName: '',
+ industry: '',
+ informationState: '',
+ mainBusinessRevenue: '',
+ customerScale: '',
+ mainProducts: '',
businessSource: '',
description: '',
entryPerson: userStore.nickName,
@@ -338,6 +443,8 @@
// FileList缁勪欢寮曠敤
const fileListRef = ref(null)
+const currentAttachmentRow = ref(null)
+const filePreviewRef = ref(null)
// 涓婁紶閰嶇疆
const upload = reactive({
@@ -376,6 +483,7 @@
{ value: '鏂板缓', label: '鏂板缓' },
{ value: '椤圭洰璺熻釜', label: '椤圭洰璺熻釜' },
{ value: '鍚堝悓绛剧害', label: '鍚堝悓绛剧害' },
+ { value: '澶囨鐢虫姤', label: '澶囨鐢虫姤' },
{ value: '椤圭洰浜や粯', label: '椤圭洰浜や粯' },
{ value: '椤圭洰楠屾敹', label: '椤圭洰楠屾敹' }
]
@@ -390,7 +498,8 @@
'鏂板缓': 'info',
'椤圭洰璺熻釜': 'primary',
'鍚堝悓绛剧害': 'warning',
- '椤圭洰浜や粯': 'success',
+ '澶囨鐢虫姤': 'primary',
+ '椤圭洰浜や粯': 'success',
'椤圭洰楠屾敹': 'success'
}
return typeMap[status] || 'info'
@@ -402,7 +511,8 @@
'鏂板缓': '鏂板缓',
'椤圭洰璺熻釜': '椤圭洰璺熻釜',
'鍚堝悓绛剧害': '鍚堝悓绛剧害',
- '椤圭洰浜や粯': '椤圭洰浜や粯',
+ '澶囨鐢虫姤': '澶囨鐢虫姤',
+ '椤圭洰浜や粯': '椤圭洰浜や粯',
'椤圭洰楠屾敹': '椤圭洰楠屾敹'
}
return textMap[status] || '鏈煡'
@@ -424,6 +534,9 @@
const resetQuery = () => {
Object.assign(searchForm, {
customerName: '',
+ city: '',
+ status: '',
+ entryPerson: '',
entryDate: [],
entryDateStart: '',
entryDateEnd: ''
@@ -734,9 +847,15 @@
const resetForm = () => {
Object.assign(form, {
id: undefined,
- status: '鏂板缓',
+ status: '',
province: '',
+ city: '',
customerName: '',
+ industry: '',
+ informationState: '',
+ mainBusinessRevenue: '',
+ customerScale: '',
+ mainProducts: '',
businessSource: '',
description: '',
entryPerson: userStore.nickName,
@@ -791,10 +910,45 @@
// 鏌ョ湅闄勪欢
function handleAttachment(row) {
- fileListRef.value.open(row.businessCommonFiles)
+ currentAttachmentRow.value = row
+ fileListRef.value.open(row.businessCommonFiles, row.id)
}
-onMounted(() => {
+// 涓嬭浇闄勪欢锛堣鎯呴〉闈級
+function downloadAttachment(row) {
+ proxy.$download.name(row.url)
+}
+
+// 棰勮闄勪欢锛堣鎯呴〉闈級
+function previewAttachment(row) {
+ if (filePreviewRef.value) {
+ filePreviewRef.value.open(row.url)
+ } else {
+ // 濡傛灉娌℃湁棰勮缁勪欢锛岀洿鎺ユ墦寮�閾炬帴
+ window.open(row.url, '_blank')
+ }
+}
+
+// 闄勪欢鍒楄〃鍒锋柊
+function handleFileListRefresh(rowId) {
+ // 閲嶆柊鑾峰彇鍒楄〃鏁版嵁
+ getList()
+ // 绛夊緟鍒楄〃鏁版嵁鏇存柊鍚庯紝鎵惧埌瀵瑰簲鐨勮骞舵洿鏂伴檮浠跺垪琛�
+ setTimeout(() => {
+ if (currentAttachmentRow.value && tableData.value) {
+ const updatedRow = tableData.value.find(item => item.id === currentAttachmentRow.value.id)
+ if (updatedRow && updatedRow.businessCommonFiles) {
+ currentAttachmentRow.value = updatedRow
+ fileListRef.value.open(updatedRow.businessCommonFiles, updatedRow.id)
+ }
+ }
+ }, 300)
+}
+
+onMounted(async () => {
+ // 鍔犺浇鐢ㄦ埛鍒楄〃渚涙悳绱娇鐢�
+ const userLists = await userListNoPage()
+ userList.value = userLists.data
getList()
})
</script>
--
Gitblit v1.9.3