| | |
| | | <div> |
| | | <el-button type="primary" |
| | | @click="openForm('add')">新增客户</el-button> |
| | | <el-button type="primary" |
| | | plain |
| | | @click="back">流入公海</el-button> |
| | | <el-button @click="handleOut">导出</el-button> |
| | | <el-button type="info" |
| | | plain |
| | |
| | | @click="handleImport">导入</el-button> |
| | | <el-button type="danger" |
| | | plain |
| | | @click="handleDelete">删除</el-button> |
| | | @click="handleDelete" v-hasPermi="['basicData:customerFile:remove']">删除</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="纳税人识别号:" |
| | | prop="taxpayerIdentificationNumber"> |
| | | <el-input v-model="form.taxpayerIdentificationNumber" |
| | | placeholder="请输入" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="银行基本户:" |
| | | prop="basicBankAccount"> |
| | | <el-input v-model="form.basicBankAccount" |
| | | placeholder="请输入" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="银行账号:" |
| | | prop="bankAccount"> |
| | | <el-input v-model="form.bankAccount" |
| | | placeholder="请输入" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="开户行号:" |
| | | prop="bankCode"> |
| | | <el-input v-model="form.bankCode" |
| | | placeholder="请输入" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户分类:" |
| | | prop="customerType"> |
| | | <el-select v-model="form.customerType" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30" |
| | | v-for="(contact, index) in formYYs.contactList" |
| | | :key="index"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系人:" |
| | | prop="contactPerson"> |
| | | <el-input v-model="contact.contactPerson" |
| | | placeholder="请输入" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系电话:" |
| | | prop="contactPhone"> |
| | | <div style="display: flex; align-items: center;width: 100%;"> |
| | | <el-input v-model="contact.contactPhone" |
| | | placeholder="请输入" |
| | | clearable /> |
| | | <el-button @click="removeContact(index)" |
| | | type="danger" |
| | | circle |
| | | style="margin-left: 5px;"> |
| | | <el-icon> |
| | | <Close /> |
| | | </el-icon> |
| | | </el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-button @click="addNewContact" |
| | | style="margin-bottom: 10px;">+ 新增联系人</el-button> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="维护人:" |
| | |
| | | :limit="1" |
| | | accept=".xlsx, .xls" |
| | | :headers="upload.headers" |
| | | :action="upload.url + '?updateSupport=' + upload.updateSupport" |
| | | :action="upload.url" |
| | | :data="upload.data" |
| | | :disabled="upload.isUploading" |
| | | :before-upload="upload.beforeUpload" |
| | | :on-progress="upload.onProgress" |
| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">纳税人识别号:</span> |
| | | <span class="info-value">{{ detailForm.taxpayerIdentificationNumber }}</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">公司电话:</span> |
| | | <span class="info-value">{{ detailForm.companyPhone }}</span> |
| | | </div> |
| | |
| | | <div class="info-item"> |
| | | <span class="info-label">公司地址:</span> |
| | | <span class="info-value">{{ detailForm.companyAddress }}</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">银行基本户:</span> |
| | | <span class="info-value">{{ detailForm.basicBankAccount }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">银行账号:</span> |
| | | <span class="info-value">{{ detailForm.bankAccount }}</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">开户行号:</span> |
| | | <span class="info-value">{{ detailForm.bankCode }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">联系人:</span> |
| | | <span class="info-value">{{ detailForm.contactPerson }}</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">联系电话:</span> |
| | | <span class="info-value">{{ detailForm.contactPhone }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | | <!-- 洽谈进度记录 --> |
| | | <div class="detail-section"> |
| | | <div class="section-header"> |
| | | <h3 class="section-title">洽谈进度记录</h3> |
| | | <el-button type="primary" |
| | | size="small" |
| | | @click="openNegotiationDialog(detailForm)"> |
| | | 添加进度 |
| | | </el-button> |
| | | </div> |
| | | <el-table :data="negotiationRecords" |
| | | border |
| | | style="width: 100%"> |
| | | <el-table-column prop="followUpTime" |
| | | label="跟进时间" |
| | | width="160" /> |
| | | <el-table-column prop="followUpMethod" |
| | | label="跟进方式" |
| | | width="100" /> |
| | | <el-table-column prop="followUpLevel" |
| | | label="跟进程度" /> |
| | | <el-table-column prop="followerUserName" |
| | | label="跟进人" |
| | | width="100" /> |
| | | <el-table-column prop="content" |
| | | label="内容" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="附件" |
| | | width="100" |
| | | align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button type="info" |
| | | link |
| | | @click="openAttachmentDialog(row)"> |
| | | <el-icon> |
| | | <Paperclip /> |
| | | </el-icon> |
| | | 附件 |
| | | <!-- {{ row.fileList && row.fileList.length > 0 ? row.fileList.length : '上传' }} --> |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" |
| | | width="150" |
| | | align="center"> |
| | | <template #default="{ row, $index }"> |
| | | <el-button type="primary" |
| | | link |
| | | @click="editNegotiationRecord(row, $index)"> |
| | | 修改 |
| | | </el-button> |
| | | <el-button type="danger" |
| | | link |
| | | @click="deleteNegotiationRecord(row, $index)"> |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div v-if="negotiationRecords.length === 0" |
| | | class="no-records"> |
| | | 暂无洽谈进度记录 |
| | | </div> |
| | | </div> |
| | | <!-- Tab切换区域 --> |
| | | <el-tabs v-model="detailActiveTab" class="detail-tabs"> |
| | | <!-- 洽谈进度记录 --> |
| | | <el-tab-pane label="洽谈进度记录" name="negotiation"> |
| | | <div class="section-header"> |
| | | <el-button type="primary" |
| | | size="small" |
| | | @click="openNegotiationDialog(detailForm)"> |
| | | 添加进度 |
| | | </el-button> |
| | | </div> |
| | | <el-table :data="negotiationRecords" |
| | | border |
| | | style="width: 100%"> |
| | | <el-table-column prop="followUpTime" |
| | | label="跟进时间" |
| | | width="160" /> |
| | | <el-table-column prop="followUpMethod" |
| | | label="跟进方式" |
| | | width="100" /> |
| | | <el-table-column prop="followUpLevel" |
| | | label="跟进程度" /> |
| | | <el-table-column prop="followerUserName" |
| | | label="跟进人" |
| | | width="100" /> |
| | | <el-table-column prop="content" |
| | | label="内容" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="附件" |
| | | width="100" |
| | | align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button type="info" |
| | | link |
| | | @click="openAttachmentDialog(row)"> |
| | | <el-icon> |
| | | <Paperclip /> |
| | | </el-icon> |
| | | 附件 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" |
| | | width="150" |
| | | align="center"> |
| | | <template #default="{ row, $index }"> |
| | | <el-button type="primary" |
| | | link |
| | | @click="editNegotiationRecord(row, $index)"> |
| | | 修改 |
| | | </el-button> |
| | | <el-button type="danger" |
| | | link |
| | | @click="deleteNegotiationRecord(row, $index)" v-hasPermi="['basicData:customerFile:remove']"> |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div v-if="negotiationRecords.length === 0" |
| | | class="no-records"> |
| | | 暂无洽谈进度记录 |
| | | </div> |
| | | </el-tab-pane> |
| | | <!-- 合同记录 --> |
| | | <el-tab-pane label="合同记录" name="contract"> |
| | | <div class="section-header"> |
| | | <el-button type="primary" |
| | | size="small" |
| | | @click="handleAddContract"> |
| | | 新增合同记录 |
| | | </el-button> |
| | | </div> |
| | | <el-table :data="contractList" |
| | | border |
| | | style="width: 100%"> |
| | | <el-table-column prop="masterContractNo" |
| | | label="总合同号" |
| | | show-overflow-tooltip /> |
| | | <el-table-column prop="entryDate" |
| | | label="录入日期" |
| | | width="180" /> |
| | | <el-table-column prop="entryPerson" |
| | | label="录入人" |
| | | width="120" /> |
| | | <el-table-column prop="remark" |
| | | label="备注" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="附件" |
| | | width="100" |
| | | align="center"> |
| | | <template #default="{ row }"> |
| | | <el-link type="primary" |
| | | v-if="row.fileList && row.fileList.length" |
| | | @click="handleViewContractFiles(row)"> |
| | | 查看({{ row.fileList.length }}) |
| | | </el-link> |
| | | <span v-else>-</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" |
| | | width="150" |
| | | align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button type="primary" |
| | | link |
| | | @click="handleEditContract(row)"> |
| | | 编辑 |
| | | </el-button> |
| | | <el-button type="danger" |
| | | link |
| | | @click="handleDeleteContract(row)" v-hasPermi="['basicData:customerFile:remove']"> |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div v-if="contractList.length === 0" |
| | | class="no-records"> |
| | | 暂无合同记录 |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="closeDetailDialog">关闭</el-button> |
| | |
| | | </el-button> |
| | | <el-button type="danger" |
| | | link |
| | | @click="deleteAttachment(row, $index)"> |
| | | @click="deleteAttachment(row, $index)" v-hasPermi="['basicData:customerFile:remove']"> |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 合同记录新增/编辑弹窗 --> |
| | | <el-dialog :title="contractDialogTitle" |
| | | v-model="contractDialogVisible" |
| | | width="600px" |
| | | @close="closeContractDialog"> |
| | | <el-form :model="contractForm" |
| | | :rules="contractRules" |
| | | ref="contractFormRef" |
| | | label-width="100px"> |
| | | <el-form-item label="总合同号" prop="masterContractNo"> |
| | | <el-input v-model="contractForm.masterContractNo" |
| | | placeholder="请输入总合同号" /> |
| | | </el-form-item> |
| | | <el-form-item label="录入日期" prop="entryDate"> |
| | | <el-date-picker v-model="contractForm.entryDate" |
| | | type="datetime" |
| | | placeholder="选择日期时间" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | style="width: 100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="录入人" prop="entryPerson"> |
| | | <el-input v-model="contractForm.entryPerson" |
| | | placeholder="请输入录入人" /> |
| | | </el-form-item> |
| | | <el-form-item label="附件"> |
| | | <FileUpload v-model:file-list="contractForm.storageBlobDTOs" /> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="contractForm.remark" |
| | | type="textarea" |
| | | :rows="3" |
| | | placeholder="请输入备注" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="contractDialogVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="submitContractForm">确定</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 合同附件查看弹窗 --> |
| | | <el-dialog title="附件列表" |
| | | v-model="contractFileDialogVisible" |
| | | width="600px"> |
| | | <el-table :data="currentContractFiles" |
| | | border |
| | | style="width: 100%"> |
| | | <el-table-column prop="name" |
| | | label="文件名" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="操作" |
| | | width="120" |
| | | align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button type="primary" |
| | | link |
| | | @click="downloadContractFile(row)"> |
| | | 下载 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div v-if="!currentContractFiles || currentContractFiles.length === 0" |
| | | class="no-records"> |
| | | 暂无附件 |
| | | </div> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="contractFileDialogVisible = false">关闭</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue"; |
| | | import { Search, Paperclip, Upload } from "@element-plus/icons-vue"; |
| | | import { |
| | | delCustomerPrivate, |
| | | addCustomerFollow, |
| | | updateCustomerFollow, |
| | | delCustomerFollow, |
| | | addReturnVisit, |
| | | getReturnVisit, |
| | | } from "@/api/basicData/customerFile.js"; |
| | | import {listCustomer, getCustomer, addCustomer, updateCustomer, delCustomer} from "@/api/basicData/customer.js"; |
| | | import { |
| | | getCustomerContractList, |
| | | getCustomerContractById, |
| | | addCustomerContract, |
| | | updateCustomerContract, |
| | | delCustomerContract, |
| | | } from "@/api/basicData/customerContract.js"; |
| | | import {listCustomer, getCustomer, addCustomer, updateCustomer, delCustomer, backCustomer} from "@/api/basicData/customer.js"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { getToken } from "@/utils/auth.js"; |
| | | import FileUpload from "@/components/AttachmentUpload/file/index.vue"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const userStore = useUserStore(); |
| | | |
| | |
| | | |
| | | // 详情相关 |
| | | const detailDialogVisible = ref(false); |
| | | const detailActiveTab = ref("negotiation"); |
| | | const detailForm = reactive({ |
| | | customerName: "", |
| | | customerType: "", |
| | | taxpayerIdentificationNumber: "", |
| | | companyPhone: "", |
| | | companyAddress: "", |
| | | basicBankAccount: "", |
| | | bankAccount: "", |
| | | bankCode: "", |
| | | contactPerson: "", |
| | | contactPhone: "", |
| | | maintainer: "", |
| | | maintenanceTime: "", |
| | | }); |
| | | const negotiationRecords = ref([]); |
| | | |
| | | // 合同记录相关 |
| | | const contractList = ref([]); |
| | | const contractDialogVisible = ref(false); |
| | | const contractDialogTitle = ref(""); |
| | | const contractFormRef = ref(); |
| | | const contractForm = reactive({ |
| | | id: null, |
| | | customerId: null, |
| | | masterContractNo: "", |
| | | entryDate: "", |
| | | entryPerson: "", |
| | | entryPersonId: null, |
| | | remark: "", |
| | | storageBlobDTOs: [], |
| | | }); |
| | | const contractRules = { |
| | | masterContractNo: [ |
| | | { required: true, message: "请输入总合同号", trigger: "blur" }, |
| | | ], |
| | | entryDate: [ |
| | | { required: true, message: "请选择录入日期", trigger: "change" }, |
| | | ], |
| | | }; |
| | | const contractFileDialogVisible = ref(false); |
| | | const currentContractFiles = ref([]); |
| | | |
| | | // 附件相关 |
| | | const attachmentDialogVisible = ref(false); |
| | |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "纳税人识别码", |
| | | prop: "taxpayerIdentificationNumber", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "地址及联系方式", |
| | | prop: "companyAddress", |
| | | width: 250, |
| | | }, |
| | | { |
| | | label: "联系人", |
| | | prop: "contactPerson", |
| | | }, |
| | | { |
| | | label: "联系电话", |
| | | prop: "contactPhone", |
| | | width: 150, |
| | | }, |
| | | { |
| | | label: "跟进进度", |
| | | prop: "followUpLevel", |
| | | width: 120, |
| | |
| | | label: "跟进时间", |
| | | prop: "followUpTime", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "银行基本户", |
| | | prop: "basicBankAccount", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "银行账号", |
| | | prop: "bankAccount", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "开户行号", |
| | | prop: "bankCode", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "维护人", |
| | |
| | | // 用户信息表单弹框数据 |
| | | const operationType = ref(""); |
| | | const dialogFormVisible = ref(false); |
| | | const formYYs = ref({ |
| | | // 其他字段... |
| | | contactList: [ |
| | | { |
| | | contactPerson: "", |
| | | contactPhone: "", |
| | | }, |
| | | ], |
| | | }); |
| | | const data = reactive({ |
| | | searchForm: { |
| | | customerName: "", |
| | |
| | | }, |
| | | form: { |
| | | customerName: "", |
| | | taxpayerIdentificationNumber: "", |
| | | companyAddress: "", |
| | | companyPhone: "", |
| | | contactPerson: "", |
| | | contactPhone: "", |
| | | maintainer: "", |
| | | maintenanceTime: "", |
| | | basicBankAccount: "", |
| | | bankAccount: "", |
| | | bankCode: "", |
| | | customerType: "", |
| | | type: 0 |
| | | }, |
| | | rules: { |
| | | customerName: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | taxpayerIdentificationNumber: [ |
| | | { required: true, message: "请输入", trigger: "blur" }, |
| | | ], |
| | | companyAddress: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | companyPhone: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | // contactPerson: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | // contactPhone: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | maintainer: [{ required: false, message: "请选择", trigger: "change" }], |
| | | maintenanceTime: [ |
| | | { required: false, message: "请选择", trigger: "change" }, |
| | | ], |
| | | basicBankAccount: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | bankAccount: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | bankCode: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | customerType: [{ required: true, message: "请选择", trigger: "change" }], |
| | | }, |
| | | }); |
| | |
| | | // 设置上传的请求头部 |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | // 上传的地址 |
| | | url: import.meta.env.VITE_APP_BASE_API + "/customerPrivate/importData", |
| | | url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData", |
| | | data: { |
| | | type: 0 |
| | | }, |
| | | // 文件上传前的回调 |
| | | beforeUpload: file => { |
| | | console.log("文件即将上传", file); |
| | |
| | | }, |
| | | }); |
| | | const { searchForm, form, rules } = toRefs(data); |
| | | const addNewContact = () => { |
| | | formYYs.value.contactList.push({ |
| | | contactPerson: "", |
| | | contactPhone: "", |
| | | }); |
| | | }; |
| | | |
| | | const removeContact = index => { |
| | | if (formYYs.value.contactList.length > 1) { |
| | | formYYs.value.contactList.splice(index, 1); |
| | | } |
| | | }; |
| | | // 查询列表 |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | |
| | | } |
| | | /** 下载模板 */ |
| | | function importTemplate() { |
| | | proxy.download("/customerPrivate/downloadTemplate", {}, "客户导入模板.xlsx"); |
| | | proxy.download("/basic/customer/downloadTemplate", {}, "客户导入模板.xlsx"); |
| | | } |
| | | // 打开弹框 |
| | | const openForm = (type, row) => { |
| | | operationType.value = type; |
| | | form.value = {}; |
| | | form.value.maintainer = userStore.nickName; |
| | | formYYs.value.contactList = [ |
| | | { |
| | | contactPerson: "", |
| | | contactPhone: "", |
| | | }, |
| | | ]; |
| | | form.value.type = 0; |
| | | form.value.maintenanceTime = getCurrentDate(); |
| | | userListNoPage().then(res => { |
| | |
| | | if (type === "edit") { |
| | | getCustomer(row.id).then(res => { |
| | | form.value = { ...res.data }; |
| | | formYYs.value.contactList = res.data.contactPerson |
| | | .split(",") |
| | | .map((item, index) => { |
| | | return { |
| | | contactPerson: item, |
| | | contactPhone: res.data.contactPhone.split(",")[index], |
| | | }; |
| | | }); |
| | | }); |
| | | } |
| | | dialogFormVisible.value = true; |
| | |
| | | }; |
| | | // 提交新增 |
| | | const submitAdd = () => { |
| | | if (formYYs.value.contactList.length < 1) { |
| | | return proxy.$modal.msgWarning("请至少添加一个联系人"); |
| | | } |
| | | form.value.contactPerson = formYYs.value.contactList |
| | | .map(item => item.contactPerson) |
| | | .join(","); |
| | | form.value.contactPhone = formYYs.value.contactList |
| | | .map(item => item.contactPhone) |
| | | .join(","); |
| | | addCustomer(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | closeDia(); |
| | |
| | | }; |
| | | // 提交修改 |
| | | const submitEdit = () => { |
| | | form.value.contactPerson = formYYs.value.contactList |
| | | .map(item => item.contactPerson) |
| | | .join(","); |
| | | form.value.contactPhone = formYYs.value.contactList |
| | | .map(item => item.contactPhone) |
| | | .join(","); |
| | | updateCustomer(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | closeDia(); |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/customerPrivate/export", {}, "客户档案.xlsx"); |
| | | proxy.download("/basic/customer/export", {type: 0}, "客户档案.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | |
| | | const back = () => { |
| | | if (selectedRows.value.length === 0) { |
| | | proxy.$modal.msgWarning("请选择数据"); |
| | | return; |
| | | } |
| | | const ids = selectedRows.value.map(item => item.id); |
| | | ElMessageBox.confirm("选中的客户将流入公海,是否确认?", "流入公海提示", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | tableLoading.value = true; |
| | | return Promise.all(ids.map(id => backCustomer(id))) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("流入公海成功"); |
| | | selectedRows.value = []; |
| | | getList(); |
| | | }) |
| | | .finally(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }) |
| | | .catch(error => { |
| | | if (error === "cancel" || error === "close") { |
| | | proxy.$modal.msg("已取消"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | |
| | | |
| | | // 打开详情弹窗 |
| | | const openDetailDialog = row => { |
| | | detailActiveTab.value = "negotiation"; |
| | | getCustomer(row.id).then(res => { |
| | | // 填充客户基本信息 |
| | | Object.assign(detailForm, res.data); |
| | | detailForm.id = row.id; // 保存客户ID |
| | | |
| | | // 获取洽谈进度记录 |
| | | negotiationRecords.value = res.data.followUpList || []; |
| | | |
| | | detailDialogVisible.value = true; |
| | | }); |
| | | |
| | | // 获取合同记录列表 |
| | | getContractList(row.id); |
| | | }; |
| | | |
| | | // 获取合同记录列表 |
| | | const getContractList = customerId => { |
| | | getCustomerContractList(customerId).then(res => { |
| | | if (res.code === 200) { |
| | | contractList.value = res.data || []; |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 新增合同记录 |
| | | const handleAddContract = () => { |
| | | contractDialogTitle.value = "新增合同记录"; |
| | | contractForm.id = null; |
| | | contractForm.customerId = detailForm.id; |
| | | contractForm.masterContractNo = ""; |
| | | contractForm.entryDate = ""; |
| | | contractForm.entryPerson = userStore.nickName; |
| | | contractForm.entryPersonId = userStore.id; |
| | | contractForm.remark = ""; |
| | | contractForm.storageBlobDTOs = []; |
| | | contractDialogVisible.value = true; |
| | | }; |
| | | |
| | | // 编辑合同记录 |
| | | const handleEditContract = row => { |
| | | contractDialogTitle.value = "编辑合同记录"; |
| | | getCustomerContractById(row.id).then(res => { |
| | | if (res.code === 200) { |
| | | contractForm.id = res.data.id; |
| | | contractForm.customerId = res.data.customerId; |
| | | contractForm.masterContractNo = res.data.masterContractNo; |
| | | contractForm.entryDate = res.data.entryDate; |
| | | contractForm.entryPerson = res.data.entryPerson; |
| | | contractForm.entryPersonId = res.data.entryPersonId; |
| | | contractForm.remark = res.data.remark; |
| | | contractForm.storageBlobDTOs = res.data.fileList || []; |
| | | contractDialogVisible.value = true; |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 删除合同记录 |
| | | const handleDeleteContract = row => { |
| | | ElMessageBox.confirm("确定删除该合同记录吗?", "提示", { |
| | | type: "warning", |
| | | }).then(() => { |
| | | delCustomerContract(row.id).then(res => { |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | getContractList(detailForm.id); |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | |
| | | // 提交合同记录表单 |
| | | const submitContractForm = () => { |
| | | proxy.$refs.contractFormRef.validate(valid => { |
| | | if (valid) { |
| | | const submitData = { |
| | | id: contractForm.id, |
| | | customerId: contractForm.customerId, |
| | | masterContractNo: contractForm.masterContractNo, |
| | | entryDate: contractForm.entryDate, |
| | | entryPerson: contractForm.entryPerson, |
| | | entryPersonId: contractForm.entryPersonId, |
| | | remark: contractForm.remark, |
| | | storageBlobDTOs: contractForm.storageBlobDTOs.map(f => ({ id: f.id })), |
| | | }; |
| | | |
| | | const request = contractForm.id ? updateCustomerContract : addCustomerContract; |
| | | request(submitData).then(res => { |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("操作成功"); |
| | | contractDialogVisible.value = false; |
| | | getContractList(detailForm.id); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 关闭合同记录弹窗 |
| | | const closeContractDialog = () => { |
| | | proxy.resetForm("contractFormRef"); |
| | | contractDialogVisible.value = false; |
| | | }; |
| | | |
| | | // 查看合同附件 |
| | | const handleViewContractFiles = row => { |
| | | currentContractFiles.value = row.fileList || []; |
| | | contractFileDialogVisible.value = true; |
| | | }; |
| | | |
| | | // 下载合同附件 |
| | | const downloadContractFile = row => { |
| | | if (row.downloadURL || row.url) { |
| | | proxy.$download.byUrl(row.downloadURL || row.url, row.name || row.originalFilename); |
| | | } else { |
| | | proxy.$modal.msgError("下载链接不存在"); |
| | | } |
| | | }; |
| | | |
| | | // 关闭详情弹窗 |
| | | const closeDetailDialog = () => { |
| | | detailDialogVisible.value = false; |
| | | detailActiveTab.value = "negotiation"; |
| | | contractList.value = []; |
| | | }; |
| | | |
| | | // 修改洽谈记录 |
| | |
| | | const downloadAttachment = row => { |
| | | if (row.url) { |
| | | // proxy.download(row.url, {}, row.name); |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } else { |
| | | proxy.$modal.msgError("下载链接不存在"); |
| | | } |
| | |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .detail-tabs { |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .attachment-section { |
| | | .upload-area { |
| | | margin-bottom: 20px; |