增加列表更新线索客户等级

This commit is contained in:
lccsw
2025-11-22 15:34:38 +08:00
parent 046816bbae
commit db0a7a0edf
3 changed files with 66 additions and 10 deletions
+7
View File
@@ -91,3 +91,10 @@ export async function exportClues(params) {
}
return Promise.reject(new Error(res.data.message));
}
export async function updateLevel(data) {
const res = await request.post('/receiver/clues/level', data);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
+1
View File
@@ -27,6 +27,7 @@
<el-input
clearable
v-model="form.code"
maxlength="6"
prefix-icon="el-icon-_vercode"
:placeholder="$t('login.code')"
/>
+58 -10
View File
@@ -189,6 +189,20 @@
{{ row.statusCn }}
<template v-if="row.isUnlock"> <br />{{ row.isUnlock }} </template>
</template>
<template v-slot:level="{ row }">
<el-select
value=""
v-model="row.level"
@change="handleLevelChange($event, row)"
>
<el-option
v-for="(item, index) in levelList"
:value="item"
:key="index"
:label="item"
/>
</el-select>
</template>
<!-- 操作列 -->
<template v-slot:action="{ row }">
<el-button
@@ -210,7 +224,8 @@
pageClues,
getSearch,
callPhone,
exportClues
exportClues,
updateLevel
} from '@/api/receiver/clues';
import RegionsSelect from '@/components/RegionsSelect/index.vue';
import BrandSelect from '@/components/BrandSelect/index.vue';
@@ -237,17 +252,25 @@
{
prop: 'customer',
label: '线索',
minWidth: 115,
width: 220,
align: 'center',
fixed: 'left',
slot: 'customer'
},
{
prop: 'level',
label: '客户等级',
align: 'center',
showOverflowTooltip: true,
width: 100,
slot: 'level'
},
{
prop: 'belongUserName',
label: '归属',
align: 'center',
showOverflowTooltip: true,
minWidth: 80,
width: 100,
slot: 'belongUserName'
},
{
@@ -255,7 +278,7 @@
label: '中心',
align: 'center',
showOverflowTooltip: true,
minWidth: 50,
width: 100,
slot: 'centerNumber'
},
{
@@ -263,14 +286,14 @@
label: '机构',
align: 'center',
showOverflowTooltip: true,
minWidth: 50,
width: 100,
slot: 'orgName'
},
{
prop: 'brandSeries',
label: '关注车型',
align: 'center',
minWidth: 80,
width: 200,
resizable: false,
showOverflowTooltip: true,
slot: 'brandSeries'
@@ -280,19 +303,20 @@
label: '状态',
align: 'center',
showOverflowTooltip: true,
minWidth: 50,
width: 130,
slot: 'status'
},
{
prop: 'poi',
label: '所属地区',
align: 'center'
align: 'center',
width: 120
},
{
prop: 'enTime',
label: '入池时间',
align: 'center',
minWidth: 80,
width: 100,
resizable: false
},
{
@@ -300,7 +324,8 @@
label: '操作',
align: 'center',
width: 100,
slot: 'action'
slot: 'action',
fixed: 'right'
}
],
// 表格选中数据
@@ -494,6 +519,29 @@
this.$message.error(e.message);
});
});
},
handleLevelChange(value, row) {
this.$confirm(
`确定要将【"${row.mobile}"】客户等级修改为"${value}"吗?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
)
.then(() => {
updateLevel({ id: row.id, level: value })
.then((msg) => {
this.$message.success(msg);
})
.catch((e) => {
this.$message.error(e.message);
});
})
.catch(() => {
// 用户取消操作,恢复原值
});
}
}
};