From 39b2b67a94947f5dca9fa52ae4a2e561bf3e2576 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 03 三月 2026 09:50:27 +0800
Subject: [PATCH] 公司 1.商机管理添加字段合同金额与付款描述字段,以及其他字段优化修改
---
src/views/salesManagement/opportunityManagement/index.vue | 227 ++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 202 insertions(+), 25 deletions(-)
diff --git a/src/views/salesManagement/opportunityManagement/index.vue b/src/views/salesManagement/opportunityManagement/index.vue
index 9a45e12..dc95edf 100644
--- a/src/views/salesManagement/opportunityManagement/index.vue
+++ b/src/views/salesManagement/opportunityManagement/index.vue
@@ -2,7 +2,7 @@
<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"
@@ -23,6 +23,39 @@
@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"
placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
@@ -30,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,27 +200,105 @@
</el-select>
</el-form-item>
- <el-form-item label="瀹㈡埛鍚嶇О" prop="customerName">
- <el-select v-model="form.customerName" placeholder="璇烽�夋嫨" clearable :disabled="operationType === 'detail' || operationType === 'addOperation'">
- <el-option v-for="item in customerOption" :key="item.customerName" :label="item.customerName" :value="item.customerName">
- {{
- item.customerName + "鈥斺��" + item.taxpayerIdentificationNumber
- }}
- </el-option>
- </el-select>
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="瀹㈡埛鍚嶇О" prop="customerName">
+ <el-select
+ v-model="form.customerName"
+ placeholder="璇烽�夋嫨"
+ clearable
+ style="width: 100%"
+ :disabled="operationType === 'detail' || operationType === 'addOperation'"
+ >
+ <el-option
+ v-for="item in customerOption"
+ :key="item.customerName"
+ :label="item.customerName"
+ :value="item.customerName"
+ >
+ {{
+ item.customerName + "鈥斺��" + item.taxpayerIdentificationNumber
+ }}
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍟嗘満鏉ユ簮" prop="businessSource">
+ <el-input
+ v-model="form.businessSource"
+ 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.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="contractAmount">
+ <el-input
+ v-model="form.contractAmount"
+ placeholder="璇疯緭鍏ュ悎鍚岄噾棰�"
+ clearable
+ :disabled="operationType === 'detail' || operationType === 'addOperation'"
+ >
+ <template #append>鍏�</template>
+ </el-input>
</el-form-item>
- <el-form-item label="鍟嗘満鏉ユ簮" prop="businessSource">
- <el-input v-model="form.businessSource" placeholder="璇疯緭鍏ュ晢鏈烘潵婧�" :disabled="operationType === 'detail' || operationType === 'addOperation'" />
- </el-form-item>
-
- <el-form-item label="瀹㈡埛鎻忚堪" prop="description" v-if="operationType !== 'detail'">
+ <el-form-item label="鏀归�犲唴瀹�" prop="description">
<el-input
v-model="form.description"
type="textarea"
- :rows="3"
- placeholder="璇疯緭鍏ュ鎴锋弿杩�"
+ :autosize="{ minRows: 4, maxRows: 10 }"
+ :placeholder="renovationPlaceholder"
show-word-limit
+ :disabled="operationType === 'detail'"
+ />
+ </el-form-item>
+
+ <el-form-item label="浠樻鎻忚堪" prop="paymentDescription">
+ <el-input
+ v-model="form.paymentDescription"
+ type="textarea"
+ :autosize="{ minRows: 3, maxRows: 10 }"
+ placeholder="鏄惁鍨祫锛熶紒涓氭槸鍚﹀紑绁紵浼佷笟鏄惁鍒嗚ˉ璐存垨棰濆鍑洪挶锛�"
+ show-word-limit
+ :disabled="operationType === 'detail'"
/>
</el-form-item>
@@ -229,6 +338,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>
@@ -256,7 +384,7 @@
</el-tag>
</div>
<div class="description-change" v-if="record.description">
- <span class="label">瀹㈡埛鎻忚堪锛�</span>
+ <span class="label">鏀归�犲唴瀹癸細</span>
<span class="description-text">{{ record.description }}</span>
</div>
</div>
@@ -277,6 +405,8 @@
<!-- 闄勪欢鍒楄〃瀵硅瘽妗� -->
<FileList ref="fileListRef" @refresh="handleFileListRefresh" />
+ <!-- 鏂囦欢棰勮缁勪欢 -->
+ <filePreview ref="filePreviewRef" />
</div>
</template>
@@ -298,6 +428,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()
@@ -320,6 +451,8 @@
const searchForm = reactive({
customerName: '',
city: '',
+ status: '',
+ entryPerson: '',
entryDate: [],
entryDateStart: '',
entryDateEnd: ''
@@ -335,11 +468,20 @@
province: '',
city: '',
customerName: '',
+ industry: '',
+ informationState: '',
+ mainBusinessRevenue: '',
+ customerScale: '',
+ mainProducts: '',
businessSource: '',
+ contractAmount: '',
description: '',
+ paymentDescription: '',
entryPerson: userStore.nickName,
entryDate: dayjs().format('YYYY-MM-DD')
})
+
+const renovationPlaceholder = '1.鏍囧噯鍖栵細\n2.瀹氬埗鍖栵細\n3.澶栭噰锛�'
// 鍙樻洿璁板綍鏁版嵁锛堟ā鎷熸暟鎹級
const changeHistory = ref([])
@@ -350,6 +492,7 @@
// FileList缁勪欢寮曠敤
const fileListRef = ref(null)
const currentAttachmentRow = ref(null)
+const filePreviewRef = ref(null)
// 涓婁紶閰嶇疆
const upload = reactive({
@@ -388,6 +531,7 @@
{ value: '鏂板缓', label: '鏂板缓' },
{ value: '椤圭洰璺熻釜', label: '椤圭洰璺熻釜' },
{ value: '鍚堝悓绛剧害', label: '鍚堝悓绛剧害' },
+ { value: '澶囨鐢虫姤', label: '澶囨鐢虫姤' },
{ value: '椤圭洰浜や粯', label: '椤圭洰浜や粯' },
{ value: '椤圭洰楠屾敹', label: '椤圭洰楠屾敹' }
]
@@ -402,7 +546,8 @@
'鏂板缓': 'info',
'椤圭洰璺熻釜': 'primary',
'鍚堝悓绛剧害': 'warning',
- '椤圭洰浜や粯': 'success',
+ '澶囨鐢虫姤': 'primary',
+ '椤圭洰浜や粯': 'success',
'椤圭洰楠屾敹': 'success'
}
return typeMap[status] || 'info'
@@ -414,7 +559,8 @@
'鏂板缓': '鏂板缓',
'椤圭洰璺熻釜': '椤圭洰璺熻釜',
'鍚堝悓绛剧害': '鍚堝悓绛剧害',
- '椤圭洰浜や粯': '椤圭洰浜や粯',
+ '澶囨鐢虫姤': '澶囨鐢虫姤',
+ '椤圭洰浜や粯': '椤圭洰浜や粯',
'椤圭洰楠屾敹': '椤圭洰楠屾敹'
}
return textMap[status] || '鏈煡'
@@ -436,6 +582,9 @@
const resetQuery = () => {
Object.assign(searchForm, {
customerName: '',
+ city: '',
+ status: '',
+ entryPerson: '',
entryDate: [],
entryDateStart: '',
entryDateEnd: ''
@@ -536,6 +685,7 @@
// 淇濈暀鍘熷鍟嗘満ID锛岀敤浜庡叧鑱旀搷浣滆褰�
status: row.status,
description: '', // 娓呯┖瀹㈡埛鎻忚堪锛屽厑璁搁噸鏂板~鍐�
+ paymentDescription: '', // 娓呯┖浠樻鎻忚堪锛屽厑璁搁噸鏂板~鍐�
entryPerson: userStore.nickName, // 璁剧疆褰曞叆浜轰负褰撳墠璐﹀彿
entryDate: dayjs().format('YYYY-MM-DD') // 璁剧疆褰曞叆鏃堕棿涓哄綋澶�
})
@@ -679,6 +829,7 @@
submitData = {
status: form.status,
description: form.description,
+ paymentDescription: form.paymentDescription,
entryPerson: form.entryPerson,
entryDate: form.entryDate,
tempFileIds: tempFileIds,
@@ -746,11 +897,19 @@
const resetForm = () => {
Object.assign(form, {
id: undefined,
- status: '鏂板缓',
+ status: '',
province: '',
+ city: '',
customerName: '',
+ industry: '',
+ informationState: '',
+ mainBusinessRevenue: '',
+ customerScale: '',
+ mainProducts: '',
businessSource: '',
+ contractAmount: '',
description: '',
+ paymentDescription: '',
entryPerson: userStore.nickName,
entryDate: dayjs().format('YYYY-MM-DD')
})
@@ -807,6 +966,21 @@
fileListRef.value.open(row.businessCommonFiles, row.id)
}
+// 涓嬭浇闄勪欢锛堣鎯呴〉闈級
+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) {
// 閲嶆柊鑾峰彇鍒楄〃鏁版嵁
@@ -823,7 +997,10 @@
}, 300)
}
-onMounted(() => {
+onMounted(async () => {
+ // 鍔犺浇鐢ㄦ埛鍒楄〃渚涙悳绱娇鐢�
+ const userLists = await userListNoPage()
+ userList.value = userLists.data
getList()
})
</script>
--
Gitblit v1.9.3