张诺
20 小时以前 388e286dc8a5b3b8c4717cc74bf128c807eba6b7
src/views/salesManagement/salesQuotation/index.vue
@@ -103,18 +103,14 @@
            <el-row :gutter="24">
              <el-col :span="12">
                <el-form-item label="客户名称" prop="customer">
                  <el-select v-model="form.customer" placeholder="请选择客户" style="width: 100%" @change="handleCustomerChange" clearable>
                    <el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.customerName">
                      {{
                        item.customerName + "——" + item.taxpayerIdentificationNumber
                      }}
                    </el-option>
                  <el-select v-model="form.customer" placeholder="请选择客户" style="width: 100%" clearable filterable>
                    <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="业务员" prop="salesperson">
                  <el-select v-model="form.salesperson" placeholder="请选择业务员" style="width: 100%" clearable>
                  <el-select v-model="form.salesperson" placeholder="请选择业务员" style="width: 100%" clearable filterable>
                    <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
                      :value="item.nickName" />
                  </el-select>
@@ -190,6 +186,7 @@
                        v-model="node.userId"
                        placeholder="选择人员"
                        class="approver-select"
                                    filterable
                        clearable
                      >
                        <el-option
@@ -407,10 +404,11 @@
import { Search, Document, UserFilled, Box, EditPen, Plus, ArrowRight, Delete, Paperclip, View, Download } from '@element-plus/icons-vue'
import Pagination from '@/components/PIMTable/Pagination.vue'
import FormDialog from '@/components/Dialog/FormDialog.vue'
import {getQuotationList,addQuotation,updateQuotation,deleteQuotation} from '@/api/salesManagement/salesQuotation.js'
import {getQuotationList,addQuotation,updateQuotation,deleteQuotation,deleteFile} from '@/api/salesManagement/salesQuotation.js'
import {userListNoPage} from "@/api/system/user.js";
import { customerList, delLedgerFile } from "@/api/salesManagement/salesLedger.js";
import { customerList } from "@/api/salesManagement/salesLedger.js";
import {modelList, productTreeList} from "@/api/basicData/product.js";
import {listCustomerPrivatePool} from "@/api/basicData/customerFile.js";
import { getToken } from "@/utils/auth";
import filePreview from "@/components/filePreview/index.vue";
@@ -570,13 +568,8 @@
    userName: item.userName || ''
  }));
   getProductOptions();
   customerList().then((res) => {
      // 只复制需要的字段,避免将组件引用放入响应式对象
      customerOption.value = (Array.isArray(res) ? res : []).map(item => ({
      id: item.id,
      customerName: item.customerName || '',
      taxpayerIdentificationNumber: item.taxpayerIdentificationNumber || ''
    }))
   listCustomerPrivatePool({current: -1,size:-1}).then((res) => {
      customerOption.value = res.data.records;
   });
}
const getProductOptions = () => {
@@ -861,8 +854,13 @@
}
const calculateTotal = () => {
  form.discountAmount = form.subtotal * (form.discountRate / 100)
  form.totalAmount = form.subtotal + form.freight + form.otherFee - form.discountAmount
  const rate = Number(form.discountRate)
  const hasRate = Number.isFinite(rate) && rate > 0
  const subtotal = Number(form.subtotal) || 0
  const freight = Number(form.freight) || 0
  const otherFee = Number(form.otherFee) || 0
  form.discountAmount = hasRate ? subtotal * (rate / 100) : 0
  form.totalAmount = subtotal + freight + otherFee - form.discountAmount
}
const handleCustomerChange = () => {
@@ -893,7 +891,7 @@
function handleRemove(file) {
  if (!isEdit.value) return
  if (!file?.id) return
  delLedgerFile([file.id]).then((res) => {
  deleteFile([file.id]).then((res) => {
    if (res?.code === 200) {
      ElMessage.success("删除成功")
    } else {
@@ -939,6 +937,7 @@
      form.approveUserIds = approverNodes.value.map(node => node.userId).join(',')
      form.files = fileList.value.map(f => ({
        id: f.id,
        tempId: f.tempId,
        name: f.name,
        url: f.url,
@@ -950,7 +949,6 @@
        const price = Number(product.unitPrice) || 0
        return sum + price
      }, 0)
      if (isEdit.value) {
        // 编辑
        const index = quotationList.value.findIndex(item => item.id === editId.value)
@@ -1030,12 +1028,7 @@
    }
  })
   customerList().then((res) => {
      // 只复制需要的字段,避免将组件引用放入响应式对象
      customerOption.value = (Array.isArray(res) ? res : []).map(item => ({
      id: item.id,
      customerName: item.customerName || '',
      taxpayerIdentificationNumber: item.taxpayerIdentificationNumber || ''
    }))
      customerOption.value = res;
   });
}