From 760433983d2ab722774bc3384a789f3ddf2c4dd8 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 04 八月 2026 10:01:28 +0800
Subject: [PATCH] 新疆_马铃薯 1.角色管理页面角色编号不展示
---
src/views/salesManagement/salesQuotation/index.vue | 66 +++++++++++++++++++++++++++++++--
1 files changed, 62 insertions(+), 4 deletions(-)
diff --git a/src/views/salesManagement/salesQuotation/index.vue b/src/views/salesManagement/salesQuotation/index.vue
index 3944b41..9dece6c 100644
--- a/src/views/salesManagement/salesQuotation/index.vue
+++ b/src/views/salesManagement/salesQuotation/index.vue
@@ -52,6 +52,7 @@
>
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
<el-table-column prop="quotationNo" label="鎶ヤ环鍗曞彿" />
+ <el-table-column prop="masterContractNo" label="鎬诲悎鍚屽彿" width="150" show-overflow-tooltip />
<el-table-column prop="customer" label="瀹㈡埛鍚嶇О" />
<el-table-column prop="salesperson" label="涓氬姟鍛�" width="100" />
<el-table-column prop="quotationDate" label="鎶ヤ环鏃ユ湡" width="120" />
@@ -72,7 +73,7 @@
<template #default="scope">
<el-button link type="primary" @click="handleEdit(scope.row)">缂栬緫</el-button>
<el-button link type="primary" @click="handleView(scope.row)" style="color: #67C23A">鏌ョ湅</el-button>
- <el-button link type="danger" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
+ <el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['salesManagement:salesQuotation:remove']">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
@@ -103,11 +104,20 @@
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="瀹㈡埛鍚嶇О" prop="customerId">
- <el-select v-model="form.customerId" placeholder="璇烽�夋嫨瀹㈡埛" style="width: 100%" clearable filterable>
+ <el-select v-model="form.customerId" placeholder="璇烽�夋嫨瀹㈡埛" style="width: 100%" clearable filterable @change="handleCustomerChange">
<el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
+ <el-col :span="12">
+ <el-form-item label="鎬诲悎鍚屽彿">
+ <el-select v-model="form.masterContractNo" placeholder="璇峰厛閫夋嫨瀹㈡埛" style="width: 100%" clearable filterable :disabled="!form.customerId">
+ <el-option v-for="item in contractList" :key="item.id" :label="item.masterContractNo" :value="item.masterContractNo"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="24">
<el-col :span="12">
<el-form-item label="涓氬姟鍛�" prop="salesperson">
<el-select v-model="form.salesperson" placeholder="璇烽�夋嫨涓氬姟鍛�" style="width: 100%" clearable filterable>
@@ -148,7 +158,13 @@
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="浠樻鏂瑰紡" prop="paymentMethod">
- <el-input v-model="form.paymentMethod" placeholder="璇疯緭鍏ヤ粯娆炬柟寮�" clearable />
+ <el-select v-model="form.paymentMethod" placeholder="璇烽�夋嫨浠樻鏂瑰紡" clearable style="width: 100%">
+ <el-option label="鐜伴噾" value="鐜伴噾" />
+ <el-option label="鐢垫眹" value="鐢垫眹" />
+ <el-option label="寰俊" value="寰俊" />
+ <el-option label="鏀粯瀹�" value="鏀粯瀹�" />
+ <el-option label="鏀エ" value="鏀エ" />
+ </el-select>
</el-form-item>
</el-col>
</el-row>
@@ -258,6 +274,7 @@
<el-dialog v-model="viewDialogVisible" title="鎶ヤ环璇︽儏" width="800px">
<el-descriptions :column="2" border>
<el-descriptions-item label="鎶ヤ环鍗曞彿">{{ currentQuotation.quotationNo }}</el-descriptions-item>
+ <el-descriptions-item label="鎬诲悎鍚屽彿">{{ currentQuotation.masterContractNo || '--' }}</el-descriptions-item>
<el-descriptions-item label="瀹㈡埛鍚嶇О">{{ currentQuotation.customer }}</el-descriptions-item>
<el-descriptions-item label="涓氬姟鍛�">{{ currentQuotation.salesperson }}</el-descriptions-item>
<el-descriptions-item label="鎶ヤ环鏃ユ湡">{{ currentQuotation.quotationDate }}</el-descriptions-item>
@@ -303,6 +320,7 @@
import {modelList, productTreeList} from "@/api/basicData/product.js";
import {listCustomer} from "@/api/basicData/customer.js";
import { userListNoPage } from "@/api/system/user.js";
+import { getCustomerContractList } from "@/api/basicData/customerContract.js";
// 鍝嶅簲寮忔暟鎹�
const loading = ref(false)
@@ -316,6 +334,7 @@
const userList = ref([])
const productOptions = ref([]);
const modelOptions = ref([]);
+const contractList = ref([]);
const pagination = reactive({
total: 3,
currentPage: 1,
@@ -335,6 +354,7 @@
paymentMethod: '',
status: '鑽夌',
remark: '',
+ masterContractNo: '',
products: [],
subtotal: 0,
freight: 0,
@@ -346,7 +366,7 @@
salesperson: [{ required: true, message: '璇烽�夋嫨涓氬姟鍛�', trigger: 'change' }],
quotationDate: [{ required: true, message: '璇烽�夋嫨鎶ヤ环鏃ユ湡', trigger: 'change' }],
validDate: [{ required: true, message: '璇烽�夋嫨鏈夋晥鏈�', trigger: 'change' }],
- paymentMethod: [{ required: true, message: '璇疯緭鍏ヤ粯娆炬柟寮�', trigger: 'blur' }]
+ paymentMethod: [{ required: true, message: '璇烽�夋嫨浠樻鏂瑰紡', trigger: 'change' }]
}
const productRowRules = {
@@ -375,6 +395,7 @@
// 璁$畻灞炴��
const filteredList = computed(() => {
let list = quotationList.value
+ console.log(list)
return list
})
@@ -413,6 +434,23 @@
customerOption.value = res.data.records;
});
}
+
+// 瀹㈡埛閫夋嫨鍙樺寲鏃讹紝鍔犺浇璇ュ鎴风殑鍚堝悓鍒楄〃
+const handleCustomerChange = async (customerId) => {
+ form.masterContractNo = '';
+ contractList.value = [];
+ if (!customerId) return;
+
+ try {
+ const res = await getCustomerContractList(customerId);
+ if (res.code === 200) {
+ contractList.value = res.data || [];
+ }
+ } catch (error) {
+ console.error('鑾峰彇瀹㈡埛鍚堝悓鍒楄〃澶辫触:', error);
+ }
+};
+
const getProductOptions = () => {
// 杩斿洖 Promise锛屼究浜庣紪杈戞椂 await 纭繚鑳藉弽鏄�
return productTreeList().then((res) => {
@@ -515,6 +553,7 @@
quotationDate: row.quotationDate || '',
validDate: row.validDate || '',
paymentMethod: row.paymentMethod || '',
+ masterContractNo: row.masterContractNo || '',
status: row.status || '',
remark: row.remark || '',
products: row.products ? row.products.map(product => ({
@@ -551,6 +590,22 @@
form.paymentMethod = row.paymentMethod || ''
form.status = row.status || '鑽夌'
form.remark = row.remark || ''
+
+ // 缂栬緫鏃跺姞杞藉鎴风殑鍚堝悓鍒楄〃浠ヤ究鍥炴樉鎬诲悎鍚屽彿
+ if (row.customerId) {
+ try {
+ const contractRes = await getCustomerContractList(row.customerId);
+ if (contractRes.code === 200) {
+ contractList.value = contractRes.data || [];
+ }
+ } catch (error) {
+ console.error('鑾峰彇瀹㈡埛鍚堝悓鍒楄〃澶辫触:', error);
+ }
+ }
+
+ // 鍏煎鍚庣杩斿洖鐨� masterContractNo 鎴� master_contract_no锛屾斁鍦ㄥ悎鍚屽垪琛ㄥ姞杞藉悗璁剧疆
+ form.masterContractNo = row.masterContractNo || row.master_contract_no || ''
+
form.products = row.products ? await Promise.all(row.products.map(async (product) => {
const productName = product.product || product.productName || ''
// 浼樺厛鐢� productId锛涘鏋滃彧鏈夊悕绉帮紝灏濊瘯鍙嶆煡 id 浠ヤ究鏍戦�夋嫨鍣ㄥ弽鏄�
@@ -628,11 +683,13 @@
form.paymentMethod = ''
form.status = '鑽夌'
form.remark = ''
+ form.masterContractNo = ''
form.products = []
form.subtotal = 0
form.freight = 0
form.otherFee = 0
form.totalAmount = 0
+ contractList.value = []
}
const addProduct = () => {
@@ -743,6 +800,7 @@
customer: item.customer || '',
customerId: item.customerId || undefined,
salesperson: item.salesperson || '',
+ masterContractNo: item.masterContractNo || '',
quotationDate: item.quotationDate || '',
validDate: item.validDate || '',
paymentMethod: item.paymentMethod || '',
--
Gitblit v1.9.3