This commit is contained in:
weipengfei 2024-06-21 17:56:47 +08:00
parent c1a0d51235
commit d8428fe82c
1 changed files with 23 additions and 2 deletions

View File

@ -47,6 +47,11 @@
<el-table-column label="商品批发价" prop="wholesale_price" show-overflow-tooltip />
<el-table-column label="销量" prop="sales" show-overflow-tooltip />
<el-table-column label="库存" prop="stock" show-overflow-tooltip />
<el-table-column label="厂家备注" prop="manufacturer_information" min-width="200" >
<template #default="{ row }">
<div style="white-space: pre;">{{ cMark(row.manufacturer_information) }}</div>
</template>
</el-table-column>
<el-table-column label="状态" prop="engineering_status_text" show-overflow-tooltip>
<template #default="{ row }">
<el-switch v-model="row.status" :active-value="1" :inactive-value="0"
@ -125,6 +130,23 @@ const handleEdit = async (data: any) => {
editRef.value?.getTableLists({ product_id: data.product_id, store_id })
}
const cMark = (str: any) => {
if (str) {
return str.replace(/(\d{5,})/g, (match: string) => {
let replacement;
//
if (match.length >= 11) {
// 11
replacement = match.slice(0, -8) + "****" + match.slice(-4);
} else {
// 511
replacement = match.slice(0, -4) + "****";
}
return replacement;
});
}
return '-';
}
const typeLists = reactive([])
@ -135,5 +157,4 @@ const getTypeLists = async () => {
// getTypeLists()
getLists()
</script>
</script>