hsy
13 小时以前 2d3530a7c11557a40807ad7c0b9e302ce6ce3a9f
src/views/salesManagement/salesQuotation/index.vue
@@ -3,7 +3,7 @@
    <el-card class="box-card">
      <!-- 搜索区域 -->
      <el-row :gutter="20" class="search-row">
        <el-col :span="8">
        <el-col :span="6">
          <el-input
            v-model="searchForm.quotationNo"
            placeholder="请输入报价单号"
@@ -15,7 +15,7 @@
            </template>
          </el-input>
        </el-col>
        <el-col :span="8">
        <el-col :span="6">
          <el-select v-model="searchForm.customerId" placeholder="请选择客户" clearable>
                  <el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.id">
                     {{
@@ -32,7 +32,12 @@
<!--            <el-option label="已过期" value="已过期"></el-option>-->
<!--          </el-select>-->
<!--        </el-col>-->
        <el-col :span="8">
        <el-col :span="6">
          <el-select v-model="searchForm.projectId" placeholder="请选择项目名称" clearable filterable>
            <el-option v-for="item in projectOptions" :key="item.id" :label="item.no + ' - ' + item.title" :value="item.id" />
          </el-select>
        </el-col>
        <el-col :span="6">
          <el-button type="primary" @click="handleSearch">搜索</el-button>
          <el-button @click="resetSearch">重置</el-button>
          <el-button style="float: right;" type="primary" @click="handleAdd">
@@ -52,6 +57,7 @@
      >
            <el-table-column align="center" label="序号" type="index" width="60" />
        <el-table-column prop="quotationNo" label="报价单号" />
        <el-table-column prop="projectName" label="项目名称" />
        <el-table-column prop="customer" label="客户名称" />
        <el-table-column prop="salesperson" label="业务员" width="100" />
        <el-table-column prop="quotationDate" label="报价日期" width="120" />
@@ -149,6 +155,13 @@
              <el-col :span="12">
                <el-form-item label="付款方式" prop="paymentMethod">
                  <el-input v-model="form.paymentMethod" placeholder="请输入付款方式" clearable />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="项目名称" prop="projectId">
                  <el-select v-model="form.projectId" placeholder="请选择项目名称" style="width: 100%" clearable filterable>
                    <el-option v-for="item in projectOptions" :key="item.id" :label="item.no + ' - ' + item.title" :value="item.id" />
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
@@ -258,6 +271,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.projectName }}</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,19 +317,22 @@
import {modelList, productTreeList} from "@/api/basicData/product.js";
import {listCustomer} from "@/api/basicData/customer.js";
import { userListNoPage } from "@/api/system/user.js";
import { listProject } from "@/api/projectManagement/project.js";
// 响应式数据
const loading = ref(false)
const searchForm = reactive({
  quotationNo: '',
  customerId: '',
  status: ''
  status: '',
  projectId: undefined
})
const quotationList = ref([])
const userList = ref([])
const productOptions = ref([]);
const modelOptions  = ref([]);
const projectOptions = ref([]);
const pagination = reactive({
  total: 3,
  currentPage: 1,
@@ -328,6 +345,7 @@
const form = reactive({
  quotationNo: '',
  customerId: undefined,
  projectId: undefined,
  customer: '',
  salesperson: '',
  quotationDate: '',
@@ -396,6 +414,7 @@
  searchForm.quotationNo = ''
  searchForm.customer = ''
  searchForm.status = ''
  searchForm.projectId = undefined
  // 重置到第一页并重新查询
  pagination.currentPage = 1
  handleSearch()
@@ -407,7 +426,15 @@
  resetForm()
  dialogVisible.value = true
  getProductOptions();
  fetchCustomerOptions()
  fetchCustomerOptions();
  fetchProjectOptions();
}
const fetchProjectOptions = () => {
  if (projectOptions.value.length > 0) return
  listProject({current: -1,size:-1}).then((res) => {
    projectOptions.value = res.data.records;
  });
}
const fetchCustomerOptions = () => {
@@ -530,7 +557,8 @@
      unitPrice: product.unitPrice || 0,
      amount: product.amount || 0
    })) : [],
    totalAmount: row.totalAmount || 0
    totalAmount: row.totalAmount || 0,
    projectName: row.projectName || ''
  }
  viewDialogVisible.value = true
}
@@ -543,11 +571,13 @@
  // 先加载产品树数据,否则 el-tree-select 无法反显产品名称
  await getProductOptions()
  await fetchCustomerOptions()
  await fetchProjectOptions()
  // 只复制需要的字段,避免将组件引用放入响应式对象
  form.quotationNo = row.quotationNo || ''
  form.customer = row.customer || ''
  form.customerId = row.customerId || undefined
  form.projectId = row.projectId || undefined
  form.salesperson = row.salesperson || ''
  form.quotationDate = row.quotationDate || ''
  form.validDate = row.validDate || ''
@@ -629,6 +659,8 @@
const resetForm = () => {
  form.customer = ''
  form.customerId = undefined
  form.projectId = undefined
  form.salesperson = ''
  form.quotationDate = ''
  form.validDate = ''
@@ -790,6 +822,7 @@
  getUserList()
  handleSearch()
  fetchCustomerOptions()
  fetchProjectOptions()
})
</script>