产品id绑定改为code绑定
This commit is contained in:
+10
-10
@@ -168,8 +168,8 @@
|
||||
<!-- ============ 绑定产品 ============ -->
|
||||
<el-tab-pane label="绑定产品" name="product">
|
||||
<div class="pane-toolbar">
|
||||
<product-select v-model="form.productIds" />
|
||||
<span class="pane-tip">绑定结果以产品ID逗号串存入客户主表 product_ids,仅用于产品对接映射</span>
|
||||
<product-select v-model="form.productCodes" />
|
||||
<span class="pane-tip">绑定结果以产品代码逗号串存入客户主表 product_codes,产品代码在新旧库间稳定,用于产品对接映射</span>
|
||||
</div>
|
||||
<el-table :data="boundProducts" border size="small" class="bound-table">
|
||||
<el-table-column label="序号" type="index" width="55" align="center" />
|
||||
@@ -192,7 +192,7 @@
|
||||
<el-table-column label="生效日期" prop="effectiveDate" width="110" align="center" />
|
||||
<el-table-column label="操作" width="90" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="danger" size="small" @click="removeProduct(row.productId)">移除</el-button>
|
||||
<el-button link type="danger" size="small" @click="removeProduct(row.productCode)">移除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #empty>
|
||||
@@ -725,7 +725,7 @@ import {
|
||||
import { getToken } from '@/utils/auth'
|
||||
import axios from 'axios'
|
||||
import { saveAs } from 'file-saver'
|
||||
import { useProducts, parseProductIds } from '@/components/ProductSelect/useProducts'
|
||||
import { useProducts, parseProductCodes } from '@/components/ProductSelect/useProducts'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const route = useRoute()
|
||||
@@ -773,7 +773,7 @@ function buildEmptyForm() {
|
||||
weightThreshold: null,
|
||||
throwRatio: null,
|
||||
creditEd: 0,
|
||||
productIds: null,
|
||||
productCodes: null,
|
||||
attachmentList: [],
|
||||
companyList: [],
|
||||
contactList: [],
|
||||
@@ -788,14 +788,14 @@ const productStatusMap = { 0: '待生效', 1: '已生效', 2: '已失效' }
|
||||
const productStatusTagType = { 0: 'info', 1: 'success', 2: 'danger' }
|
||||
|
||||
const boundProducts = computed(() =>
|
||||
parseProductIds(form.value.productIds)
|
||||
.map(id => findProduct(id))
|
||||
parseProductCodes(form.value.productCodes)
|
||||
.map(code => findProduct(code))
|
||||
.filter(Boolean)
|
||||
)
|
||||
|
||||
function removeProduct(productId) {
|
||||
const ids = parseProductIds(form.value.productIds).filter(id => id !== String(productId))
|
||||
form.value.productIds = ids.join(',')
|
||||
function removeProduct(productCode) {
|
||||
const codes = parseProductCodes(form.value.productCodes).filter(code => code !== String(productCode))
|
||||
form.value.productCodes = codes.join(',')
|
||||
}
|
||||
|
||||
/* ---------------- 套餐绑定(prc_customer_price_set,一客户一套餐) ---------------- */
|
||||
|
||||
@@ -167,10 +167,10 @@
|
||||
<span v-else>{{ scope.row.creditEd }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="isColVisible('productIds')" label="绑定产品" align="center" prop="productIds" min-width="180">
|
||||
<el-table-column v-if="isColVisible('productCodes')" label="绑定产品" align="center" prop="productCodes" min-width="180">
|
||||
<template #default="scope">
|
||||
<span v-if="productNames(scope.row.productIds)" :title="productNames(scope.row.productIds)">
|
||||
{{ productNames(scope.row.productIds) }}
|
||||
<span v-if="productNames(scope.row.productCodes)" :title="productNames(scope.row.productCodes)">
|
||||
{{ productNames(scope.row.productCodes) }}
|
||||
</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
@@ -198,7 +198,7 @@
|
||||
|
||||
<script setup name="Customer">
|
||||
import { listCustomer, delCustomer } from "@/api/customersuppliermanagement/customerinfo/customer.js"
|
||||
import { useProducts, parseProductIds } from '@/components/ProductSelect/useProducts'
|
||||
import { useProducts, parseProductCodes } from '@/components/ProductSelect/useProducts'
|
||||
import { useColumnSettings } from '@/utils/columnSettings'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
@@ -222,7 +222,7 @@ const columnDefs = [
|
||||
{ key: 'weightThreshold', label: '重量阈值' },
|
||||
{ key: 'throwRatio', label: '抛比' },
|
||||
{ key: 'creditEd', label: '信用额度' },
|
||||
{ key: 'productIds', label: '绑定产品' },
|
||||
{ key: 'productCodes', label: '绑定产品' },
|
||||
{ key: 'remark', label: '备注说明' }
|
||||
]
|
||||
const { colVisible, isColVisible, toggleColumn, resetColumns } = useColumnSettings('customer-info-list', columnDefs)
|
||||
@@ -237,10 +237,10 @@ const total = ref(0)
|
||||
|
||||
const { sys_normal_disable, settlement_type, customer_type } = useDict("sys_normal_disable", "settlement_type", "customer_type")
|
||||
|
||||
/** 绑定产品ID串 -> 产品名称展示(产品代码+名称;查不到的产品回显原ID) */
|
||||
/** 绑定产品代码串 -> 产品名称展示(产品代码+名称;查不到的产品回显原代码) */
|
||||
const { ensureProducts, getProductLabel } = useProducts()
|
||||
function productNames(productIds) {
|
||||
return parseProductIds(productIds).map(id => getProductLabel(id)).join(',')
|
||||
function productNames(productCodes) {
|
||||
return parseProductCodes(productCodes).map(code => getProductLabel(code)).join(',')
|
||||
}
|
||||
ensureProducts()
|
||||
|
||||
@@ -275,7 +275,7 @@ const data = reactive({
|
||||
weightThreshold: undefined,
|
||||
throwRatio: undefined,
|
||||
creditEd: undefined,
|
||||
productIds: undefined,
|
||||
productCodes: undefined,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user