修改用户页面 询单

This commit is contained in:
浅念
2025-08-06 18:36:42 +08:00
parent 3e24d1905f
commit 8deecc8197
8 changed files with 197 additions and 189 deletions
+60 -31
View File
@@ -60,9 +60,7 @@
}}</el-button>
</div>
<div class="form-btn-right">
<el-button class="reset-button" @click="addfn()"
><i class="iconfont-sys">&#xe602;</i> 录单</el-button
>
</div>
</div>
</el-col>
@@ -70,6 +68,7 @@
</el-form>
</section>
<div class="table">
<el-button class="reset-button" @click="addfn()" ><i class="iconfont-sys">&#xe602;</i> 录单</el-button>
<ArtTable
ref="tableRef"
row-key="id"
@@ -92,7 +91,8 @@
<span>
{{scope.row.countryInfo? scope.row.countryInfo.cn_addr : ''}}
</span>
<span class="steer" v-if="scope.row.countryInfo">{{ scope.row.countryInfo.steering }}</span>
<el-tag class="steer" type="warning" v-if="scope.row.countryInfo">{{ scope.row.countryInfo.steering }}</el-tag>
<!-- <span class="steer" v-if="scope.row.countryInfo">{{ scope.row.countryInfo.steering }}</span> -->
</template>
</el-table-column>
<el-table-column prop="phone" label="渠道">
@@ -118,8 +118,9 @@
</el-table-column>
<el-table-column prop="recipient" label="跟单人">
<template #default="scope">
<span>
<span style="color:#008477;cursor: pointer;" v-if="scope.row.recipientInfo" @click="onFenpei(scope.row,'edit')">
{{scope.row.recipientInfo? scope.row.recipientInfo.name : ''}}
<i class="iconfont-sys">&#xe626;</i>
</span>
</template>
</el-table-column>
@@ -143,11 +144,11 @@
<el-table-column prop="created_at" label="创建时间"></el-table-column>
<el-table-column fixed="right" label="操作" width="260px">
<template #default="scope">
<div class="follow-action fenpei" @click="onFenpei(scope.row)" v-if="scope.row.status!= 2">
<div class="follow-action fenpei" @click="onFenpei(scope.row,'add')" v-if="scope.row.status!= 2">
<span class="custom-clock-icon" style="margin-right: 2px; vertical-align: middle"
><i class="iconfont-sys">&#xe852;</i></span
>
分配跟单
分配
</div>
<div class="follow-action detil" @click="onDetail(scope.row)">
<span class="custom-clock-icon" style="margin-right: 2px; vertical-align: middle"
@@ -279,11 +280,24 @@
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="24">
<el-col :span="12">
<el-form-item label="WhatsApp" prop="whatsapp">
<el-input v-model="addForm.whatsapp" placeholder="请输入WhatsApp" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="跟单人" prop="country">
<el-select v-model="addForm.recipient" filterable placeholder="请选择跟单人">
<el-option
v-for="item in userOptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="详情内容" prop="content">
<ArtWangEditor class="el-top" v-model="editorHtml" />
@@ -296,7 +310,7 @@
</el-form>
</el-dialog>
<!-- 分配 -->
<el-dialog v-model="fenpeiDialogVisible" title="分配跟单" width="360px">
<el-dialog v-model="fenpeiDialogVisible" :title="dialogTypefp === 'add' ? '分配跟单' : '重新分配跟单'" width="360px">
<el-form :model="fenpeiForm" label-width="0">
<el-form-item>
<el-select v-model="fenpeiForm.recipient" filterable placeholder="请选择" style="width: 100%">
@@ -324,6 +338,7 @@
import { manageService } from '@/api/adminApi'
const loading = ref(false)
const dialogType = ref('add')
const dialogTypefp = ref('add')
const { width } = useWindowSize()
const isMobile = computed(() => width.value < 500)
const filter = ref({
@@ -355,7 +370,8 @@
tel: '',
contacts: '',
whatsapp: '',
content: ''
content: '',
recipient: ''
})
// 响应式表单数据
const formFilters = reactive({ ...filter })
@@ -396,6 +412,13 @@
const res = await CrmService.getCountry()
countryOptions.value = res || []
}
const userOptions = ref<any>()
const getuserList = async () => {
// 这里调用获取用户列表的接口
const res = await manageService.presetusers()
userOptions.value = res || []
// return res || []
}
// 计算属性:将时间格式化为 "开始日期 - 结束日期"
const formattedTimeRange = () => {
if (!filter.value.time || filter.value.time.length !== 2) {
@@ -448,6 +471,7 @@
onMounted(() => {
getgetChannel()
gettableList()
getuserList()
timer.value = window.setInterval(() => {
refreshKey.value++
}, 1000)
@@ -507,7 +531,8 @@
tel: '',
contacts: '',
whatsapp: '',
content: ''
content: '',
recipient: ''
})
editorHtml.value = ''
}
@@ -565,7 +590,8 @@
tel: row.tel,
contacts: row.contacts,
whatsapp: row.whatsapp,
content: row.content
content: row.content,
recipient: row.recipientInfo ? row.recipientInfo.id : ''
})
editorHtml.value = row.content
// 这里可以添加编辑逻辑
@@ -614,16 +640,9 @@
id: '',
recipient: ''
})
const userOptions = ref<any>()
const getuserList = async () => {
// 这里调用获取用户列表的接口
const res = await manageService.presetusers()
userOptions.value = res || []
// return res || []
}
//分配
const onFenpei = (row: any) => {
getuserList()
const onFenpei = (row: any, edits: any) => {
dialogTypefp.value = edits
fenpeiForm.id = row.id
fenpeiDialogVisible.value = true
}
@@ -632,12 +651,21 @@
ElMessage.warning('请选择跟单人')
return
}
const res = await manageService.inquiryallocation({
id: fenpeiForm.id,
recipient: fenpeiForm.recipient,
status: 2
})
ElMessage.success(res?.message || '分配成功!')
if (dialogTypefp.value === 'add') {
const res = await manageService.inquiryallocation({
id: fenpeiForm.id,
recipient: fenpeiForm.recipient,
status: 2
})
ElMessage.success(res?.message || '分配成功!')
} else {
const res = await manageService.inquiryreallocation({
id: fenpeiForm.id,
recipient: fenpeiForm.recipient,
status: 2
})
ElMessage.success(res?.message || '分配成功!')
}
fenpeiDialogVisible.value = false
gettableList()
}
@@ -711,6 +739,7 @@
}
.table {
margin-top: 10px;
:deep(.el-table__empty-block) {
height: 300px !important;
}
@@ -816,10 +845,10 @@
}
.steer {
margin-left: 5px;
display: inline-block;
border: 1px solid #00a43f;
padding: 0px 4px;
color: #00a43f;
// display: inline-block;
// border: 1px solid #00a43f;
// padding: 0px 4px;
// color: #00a43f;
}
.dtitle {
line-height: 40px;