| | |
| | | style="width: 240px" |
| | | clearable |
| | | @change="handleQuery"> |
| | | <el-option label="零售客户" |
| | | value="零售客户" /> |
| | | <el-option label="进销商客户" |
| | | value="进销商客户" /> |
| | | <el-option v-for="dict in customer_type" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" /> |
| | | </el-select> |
| | | <el-button type="primary" |
| | | @click="handleQuery" |
| | |
| | | :isSelection="true" |
| | | @selection-change="handleSelectionChange" |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination"></PIMTable> |
| | | @pagination="pagination"> |
| | | <template #depositAmountSlot="{ row }"> |
| | | <el-tooltip v-if="row.exceedsTrustFund" |
| | | :content="`代储金额合计已超出该客户信托基金(信托基金:${row.trustFund})`" |
| | | placement="top"> |
| | | <el-text type="danger">{{ formatAmount(row.depositTotalAmount) }}</el-text> |
| | | </el-tooltip> |
| | | <span v-else>{{ formatAmount(row.depositTotalAmount) }}</span> |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" |
| | | :title="operationType === 'add' ? '新增客户信息' : '编辑客户信息'" |
| | |
| | | <el-select v-model="form.customerType" |
| | | placeholder="请选择" |
| | | clearable> |
| | | <el-option label="零售客户" |
| | | value="零售客户" /> |
| | | <el-option label="进销商客户" |
| | | value="进销商客户" /> |
| | | <el-option v-for="dict in customer_type" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="信托基金(元):" |
| | | prop="trustFund"> |
| | | <el-input-number v-model="form.trustFund" |
| | | :min="0" |
| | | :precision="2" |
| | | :controls="false" |
| | | placeholder="请输入,可为空" |
| | | style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </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">{{ formatAmount(detailForm.trustFund) }}</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">代储金额(元):</span> |
| | | <span class="info-value" |
| | | :class="{ 'text-danger': detailForm.exceedsTrustFund }"> |
| | | {{ formatAmount(detailForm.depositTotalAmount) }} |
| | | </span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="detailForm.exceedsTrustFund" |
| | | :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-alert type="warning" |
| | | show-icon |
| | | :closable="false" |
| | | :title="`该客户代储金额合计 ${formatAmount(detailForm.depositTotalAmount)} 元,已超出信托基金 ${formatAmount(detailForm.trustFund)} 元`" /> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | | <!-- 洽谈进度记录 --> |
| | |
| | | import { getToken } from "@/utils/auth.js"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const userStore = useUserStore(); |
| | | const { customer_type } = proxy.useDict("customer_type"); |
| | | |
| | | // 回访提醒相关 |
| | | const reminderDialogVisible = ref(false); |
| | |
| | | content: [{ required: true, message: "请输入内容", trigger: "blur" }], |
| | | }; |
| | | |
| | | const formatAmount = value => { |
| | | return value === null || value === undefined || value === "" |
| | | ? "-" |
| | | : Number(value).toFixed(2); |
| | | }; |
| | | // 详情相关 |
| | | const detailDialogVisible = ref(false); |
| | | const detailForm = reactive({ |
| | |
| | | contactPhone: "", |
| | | maintainer: "", |
| | | maintenanceTime: "", |
| | | trustFund: "", |
| | | depositTotalAmount: "", |
| | | exceedsTrustFund: false, |
| | | }); |
| | | const negotiationRecords = ref([]); |
| | | |
| | |
| | | label: "客户分类", |
| | | prop: "customerType", |
| | | width: 120, |
| | | formatData: value => proxy.selectDictLabel(customer_type.value, value), |
| | | }, |
| | | { |
| | | label: "客户名称", |
| | |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "信托基金(元)", |
| | | prop: "trustFund", |
| | | width: 140, |
| | | formatData: value => |
| | | value === null || value === undefined || value === "" |
| | | ? "-" |
| | | : Number(value).toFixed(2), |
| | | }, |
| | | { |
| | | label: "代储金额(元)", |
| | | prop: "depositTotalAmount", |
| | | dataType: "slot", |
| | | slot: "depositAmountSlot", |
| | | width: 150, |
| | | }, |
| | | { |
| | | label: "开户行号", |
| | | prop: "bankCode", |
| | | width: 220, |
| | |
| | | { |
| | | name: "编辑", |
| | | type: "text", |
| | | showHide: row => !isCustomerEditLocked(row), |
| | | clickFun: row => { |
| | | if (isCustomerEditLocked(row)) { |
| | | proxy.$modal.msgWarning("已被销售模块引用的私海客户不能编辑"); |
| | | return; |
| | | } |
| | | openForm("edit", row); |
| | | }, |
| | | }, |
| | |
| | | bankAccount: "", |
| | | bankCode: "", |
| | | customerType: "", |
| | | // 金额字段给 null 而非 "",避免 el-input-number 把空串折算成 0 |
| | | trustFund: null, |
| | | type: 0 |
| | | }, |
| | | rules: { |
| | |
| | | } |
| | | // 打开弹框 |
| | | const openForm = (type, row) => { |
| | | if (type === "edit" && isCustomerEditLocked(row)) { |
| | | proxy.$modal.msgWarning("已被销售模块引用的私海客户不能编辑"); |
| | | return; |
| | | } |
| | | operationType.value = type; |
| | | form.value = {}; |
| | | form.value.maintainer = userStore.nickName; |
| | |
| | | }); |
| | | } |
| | | dialogFormVisible.value = true; |
| | | }; |
| | | const isCustomerEditLocked = row => { |
| | | const salesReferenced = Number(row?.salesReferenceFlag || 0) === 1; |
| | | const customerType = Number(row?.type); |
| | | const usageStatus = Number(row?.usageStatus || 0); |
| | | return salesReferenced && (customerType === 0 || (customerType === 1 && usageStatus === 1)); |
| | | }; |
| | | // 提交表单 |
| | | const submitForm = () => { |
| | |
| | | word-break: break-word; |
| | | } |
| | | |
| | | .text-danger { |
| | | color: var(--el-color-danger); |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .no-records { |
| | | text-align: center; |
| | | padding: 30px; |