Merge branch 'main' of http://114.55.169.15:3000/qiushanhe/ss-crm-manage-web into dev-cl
commit
125f6f28ad
@ -0,0 +1,30 @@ |
||||
import request from '@/config/axios' |
||||
|
||||
// 获得列表
|
||||
export const getExtraFeePage = (params) => { |
||||
return request.get({ url: '/admin-api/crm/extra-pay/page', params }) |
||||
} |
||||
|
||||
// 创建
|
||||
export const createExtraFee = (data) => { |
||||
return request.post({ url: '/admin-api/crm/extra-pay/create', data, isSubmitForm: true }) |
||||
} |
||||
|
||||
// 更新
|
||||
export const updateExtraFee = (data) => { |
||||
return request.put({ url: '/admin-api/crm/extra-pay/update', data }) |
||||
} |
||||
|
||||
// 删除
|
||||
export const deleteExtraFee = (id) => { |
||||
return request.delete({ url: `/admin-api/crm/extra-pay/delete?id=${id}` }) |
||||
} |
||||
|
||||
// 获得
|
||||
export const getExtraFee = (id) => { |
||||
return request.get({ url: `/admin-api/crm/extra-pay/get?id=${id}` }) |
||||
} |
||||
|
||||
export const getExtraFeeSimpleList = async () => { |
||||
return await request.get({ url: '/admin-api/crm/extra-pay/simple-list' }) |
||||
} |
@ -0,0 +1,97 @@ |
||||
<template> |
||||
<Dialog title="批量修改跟进人" v-model="show" width="400px"> |
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="auto"> |
||||
<el-form-item label="修改线索数"> |
||||
{{ form.clueIdList.length }} |
||||
</el-form-item> |
||||
<el-form-item label="原跟进人" prop="originFollowUserId"> |
||||
<el-select v-model="form.originFollowUserId" placeholder="原跟进人" filterable> |
||||
<el-option |
||||
v-for="item in props.userOptions" |
||||
:key="item.id" |
||||
:label="item.nickname" |
||||
:value="item.id" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="新跟进人" prop="newFollowUserId"> |
||||
<el-select v-model="form.newFollowUserId" placeholder="新跟进人" filterable> |
||||
<el-option |
||||
v-for="item in props.userOptions" |
||||
:key="item.id" |
||||
:label="item.nickname" |
||||
:value="item.id" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-form> |
||||
<template #footer> |
||||
<span> |
||||
<el-button @click="show = false">取 消</el-button> |
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button> |
||||
</span> |
||||
</template> |
||||
</Dialog> |
||||
</template> |
||||
|
||||
<script setup name="DialogBatchChangeFollow"> |
||||
import { batchUpdateFollowUser } from '@/api/clue' |
||||
|
||||
const props = defineProps({ |
||||
userOptions: { |
||||
type: Array |
||||
} |
||||
}) |
||||
|
||||
const show = ref(false) |
||||
const form = ref({ |
||||
clueIdList: [], |
||||
originFollowUserId: undefined, |
||||
newFollowUserId: undefined |
||||
}) |
||||
|
||||
const rules = ref({ |
||||
originFollowUserId: { required: true, message: '原跟进人不可为空', trigger: 'change' }, |
||||
newFollowUserId: { required: true, message: '新跟进人不可为空', trigger: 'change' } |
||||
}) |
||||
|
||||
function open(clueIdList) { |
||||
resetForm(clueIdList) |
||||
show.value = true |
||||
} |
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
||||
|
||||
function resetForm(clueIdList) { |
||||
form.value = { |
||||
clueIdList, |
||||
originFollowUserId: undefined, |
||||
newFollowUserId: undefined |
||||
} |
||||
} |
||||
|
||||
const formLoading = ref(false) |
||||
const emit = defineEmits(['success']) |
||||
const formRef = ref() |
||||
async function handleSave() { |
||||
// 校验表单 |
||||
if (!formRef.value) return |
||||
const valid = await formRef.value.validate() |
||||
if (!valid) return |
||||
|
||||
// 提交请求 |
||||
formLoading.value = true |
||||
try { |
||||
await batchUpdateFollowUser(form.value) |
||||
message.success('修改成功!') |
||||
show.value = false |
||||
// 发送操作成功的事件 |
||||
emit('success') |
||||
} catch (err) { |
||||
console.log(err) |
||||
} finally { |
||||
formLoading.value = false |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
Loading…
Reference in new issue