| | |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="开户银行:" |
| | | prop="bankName"> |
| | | <el-input v-model="form.bankName" |
| | | placeholder="请输入" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="开户行号:" |
| | | prop="bankCode"> |
| | | <el-input v-model="form.bankCode" |
| | |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户分类:" |
| | | prop="customerType"> |
| | |
| | | <el-option label="进销商客户" |
| | | value="进销商客户" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="法人" |
| | | prop="corporation"> |
| | | <el-input v-model="form.corporation" |
| | | placeholder="请输入" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="代理人" |
| | | prop="agent"> |
| | | <el-select v-model="form.agent" |
| | | placeholder="请选择代理人" |
| | | clearable |
| | | filterable |
| | | :disabled="agentOptions.length === 0" |
| | | :no-data-text="agentNoDataText"> |
| | | <el-option v-for="(contact, index) in agentOptions" |
| | | :key="getAgentOptionKey(contact, index)" |
| | | :label="getAgentLabel(contact)" |
| | | :value="contact.contactPhone" |
| | | :disabled="!contact.contactPhone"> |
| | | <span>{{ contact.contactPerson || "-" }}</span> |
| | | <span style="float: right; color: var(--el-text-color-secondary); font-size: 12px;"> |
| | | {{ contact.contactPhone || "" }} |
| | | </span> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="传真" |
| | | prop="fax"> |
| | | <el-input v-model="form.fax" |
| | | placeholder="请输入" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </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> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue"; |
| | | import { onMounted, ref, reactive, getCurrentInstance, toRefs, computed, watch } from "vue"; |
| | | import { Search, Paperclip, Upload } from "@element-plus/icons-vue"; |
| | | import { |
| | | addCustomer, |
| | |
| | | companyPhone: "", |
| | | companyAddress: "", |
| | | basicBankAccount: "", |
| | | corporation: "", |
| | | fax: "", |
| | | bankAccount: "", |
| | | bankCode: "", |
| | | contactPerson: "", |
| | |
| | | { |
| | | label: "开户行号", |
| | | prop: "bankCode", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "法人代表", |
| | | prop: "corporation", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "传真", |
| | | prop: "fax", |
| | | width: 220, |
| | | }, |
| | | { |
| | |
| | | maintenanceTime: "", |
| | | basicBankAccount: "", |
| | | bankAccount: "", |
| | | fax: "", |
| | | corporation: "", |
| | | bankCode: "", |
| | | customerType: "", |
| | | }, |
| | |
| | | ], |
| | | basicBankAccount: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | bankAccount: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | corporation: [{ required: true, message: "请输入法人代表", trigger: "blur" }], |
| | | agent: [{ required: true, message: "请选择代理人", trigger: "change" }], |
| | | bankName: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | bankCode: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | customerType: [{ required: true, message: "请选择", trigger: "change" }], |
| | | }, |
| | |
| | | }, |
| | | }); |
| | | const { searchForm, form, rules } = toRefs(data); |
| | | |
| | | const agentOptions = computed(() => { |
| | | const list = formYYs.value?.contactList || []; |
| | | return list.filter(item => item && (item.contactPerson || item.contactPhone)); |
| | | }); |
| | | |
| | | const agentNoDataText = computed(() => { |
| | | if (agentOptions.value.length === 0) return "请先新增联系人"; |
| | | return "无匹配联系人"; |
| | | }); |
| | | |
| | | const getAgentLabel = contact => { |
| | | const person = (contact?.contactPerson || "").trim(); |
| | | const phone = (contact?.contactPhone || "").trim(); |
| | | if (person && phone) return `${person}(${phone})`; |
| | | return person || phone || "-"; |
| | | }; |
| | | |
| | | const getAgentOptionKey = (contact, index) => { |
| | | return contact?.contactPhone || contact?.contactPerson || index; |
| | | }; |
| | | |
| | | watch( |
| | | () => agentOptions.value.map(item => item.contactPhone), |
| | | phones => { |
| | | const val = form.value?.agent; |
| | | if (!val) return; |
| | | if (!phones.includes(val)) { |
| | | form.value.agent = ""; |
| | | } |
| | | } |
| | | ); |
| | | |
| | | const addNewContact = () => { |
| | | formYYs.value.contactList.push({ |
| | | contactPerson: "", |