产品id绑定改为code绑定
This commit is contained in:
@@ -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