Compare commits

..

No commits in common. '735d638b49a6a267b0ea6962198c7e843f279ee9' and '9ebd81cc2c852ea20e138bb9015691d4f561028d' have entirely different histories.

  1. 10
      src/api/system/dept/index.ts
  2. 7
      src/api/system/dict/dict.data.ts
  3. 25
      src/api/system/role/daliyReport.js
  4. 57
      src/views/Basic/Dept/DeptForm.vue
  5. 133
      src/views/Basic/Dept/DialogTarget.vue
  6. 17
      src/views/Basic/Dept/index.vue
  7. 95
      src/views/Basic/Role/Comp/ReportDaily.vue
  8. 10
      src/views/Clue/Order/Comp/DialogOrder.vue

@ -41,13 +41,3 @@ export const updateDept = async (params: DeptVO) => {
export const deleteDept = async (id: number) => { export const deleteDept = async (id: number) => {
return await request.delete({ url: '/admin-api/system/dept/delete?id=' + id }) return await request.delete({ url: '/admin-api/system/dept/delete?id=' + id })
} }
// 获取部门业务指标
export const getDeptTarget = async (deptId: number) => {
return await request.get({ url: '/admin-api/crm/dept-target/get', params: { deptId } })
}
// 更新部门业务指标
export const updateDeptTarget = async (data: any) => {
return await request.put({ url: '/admin-api/crm/dept-target/save', data, isSubmitForm: true })
}

@ -44,11 +44,6 @@ export const deleteDictData = (id: number) => {
} }
// 导出字典类型数据 // 导出字典类型数据
export const exportDictData = (params: any) => { export const exportDictData = (params) => {
return request.get({ url: '/admin-api/crm/dict-data/export', params }) return request.get({ url: '/admin-api/crm/dict-data/export', params })
} }
// 获取通用字典数据
export const getGeneralSysDictData = (dictType: string) => {
return request.get({ url: '/admin-api/system/dict-data/get-by-type', params: { dictType } })
}

@ -1,25 +0,0 @@
import request from '@/config/axios'
// 获取角色快报配置
export const getRoleDaliyReport = async (roleId) => {
return await request.get({
url: '/admin-api/system/role-message-setting/get',
params: { roleId }
})
}
// 保存角色每日快报配置
export const updateRoleDaliyReport = async (data) => {
return await request.post({
url: '/admin-api/system/role-message-setting/save',
data,
isSubmitForm: true
})
}
// 获取每日快报发送内容
export const getDaliyReportContent = async () => {
return await request.get({
url: '/admin-api/system/message-item/list-all-simple'
})
}

@ -1,5 +1,7 @@
<template> <template>
<Dialog v-model="dialogVisible" :title="dialogTitle" width="800px"> <Dialog v-model="dialogVisible" :title="dialogTitle" width="800px">
<el-tabs v-model="tabIndex">
<el-tab-pane label="基础信息" :name="1">
<el-form <el-form
ref="formRef" ref="formRef"
v-loading="formLoading" v-loading="formLoading"
@ -64,6 +66,57 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</el-tab-pane>
<el-tab-pane label="业务指标" :name="2">
<el-form :model="formData" label-width="auto">
<el-form-item label="每日跟进指标数">
<el-input-number
v-model="formData.followDaliyNum"
:controls="false"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="跟进指标生效日期">
<el-date-picker
v-model="formData.effectDate"
type="date"
placeholder="选择日期时间"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width: 150px"
/>
</el-form-item>
</el-form>
<el-divider direction="horizontal" content-position="left">成交额指标</el-divider>
<el-button class="mb-10px" type="primary" @click="taskList.push({})">添加年份</el-button>
<el-table :data="taskList" border>
<el-table-column label="年份" width="120">
<template #default="{ row }">
<el-date-picker
v-model="row.year"
type="year"
placeholder="选择年份"
size="small"
format="YYYY"
value-format="YYYY"
style="width: 100%"
/>
</template>
</el-table-column>
<el-table-column v-for="col in 12" :key="col" :label="`${col}月`" width="100px">
<template #default="{ row }">
<el-input-number
v-model="row[`month${col}`]"
size="small"
:controls="false"
style="width: 100%"
/>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<template #footer> <template #footer>
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
@ -82,6 +135,8 @@ const message = useMessage() // 消息弹窗
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const tabIndex = ref(1)
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
@ -177,4 +232,6 @@ const getTree = async () => {
dept.children = handleTree(data) dept.children = handleTree(data)
deptTree.value.push(dept) deptTree.value.push(dept)
} }
const taskList = ref([])
</script> </script>

@ -1,133 +0,0 @@
<template>
<Dialog v-model="dialogVisible" :title="dialogTitle" width="800px">
<el-form ref="formRef" :model="formData" label-width="130px">
<el-form-item label="每日跟进指标数">
<el-input-number v-model="formData.targetNum" :controls="false" style="width: 150px" />
</el-form-item>
<el-form-item label="跟进指标生效日期">
<el-date-picker
v-model="formData.startDate"
type="date"
placeholder="选择日期时间"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width: 150px"
/>
</el-form-item>
</el-form>
<el-divider direction="horizontal" content-position="left">成交额指标</el-divider>
<el-button class="mb-10px" type="primary" @click="handleAddPrice"> 添加年份 </el-button>
<el-table :data="formData.deptSignPriceTargetVOList" border>
<el-table-column label="年份" width="120">
<template #default="{ row }">
<el-date-picker
v-model="row.year"
type="year"
placeholder="选择年份"
size="small"
format="YYYY"
value-format="YYYY"
style="width: 100%"
/>
</template>
</el-table-column>
<el-table-column v-for="col in 12" :key="col" :label="`${col}月`" width="100px">
<template #default="{ row }">
<el-input-number
v-model="row.monthTargetVOList[col - 1].targetPrice"
size="small"
:controls="false"
style="width: 100%"
/>
</template>
</el-table-column>
</el-table>
<template #footer>
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup name="DialogTarget">
import * as DeptApi from '@/api/system/dept'
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formData = ref({
remark: undefined
})
/** 打开弹窗 */
const open = async (deptId) => {
dialogVisible.value = true
dialogTitle.value = '业绩指标'
resetForm()
//
if (deptId) {
formLoading.value = true
try {
formData.value = await DeptApi.getDeptTarget(deptId)
formData.value.deptId = deptId
if (formData.value?.deptSignPriceTargetVOList) {
formData.value.deptSignPriceTargetVOList.forEach((it) => {
it.year = it.year + ''
})
}
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const formRef = ref() // Ref
const submitForm = async () => {
//
formLoading.value = true
try {
await DeptApi.updateDeptTarget(formData.value)
message.success('修改成功')
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
targetNum: undefined,
startDate: undefined,
deptSignPriceTargetVOList: []
}
formRef.value?.resetFields()
}
function handleAddPrice() {
const obj = {
year: undefined,
monthTargetVOList: []
}
for (let i = 1; i <= 12; i++) {
obj.monthTargetVOList.push({
month: i,
targetPrice: undefined
})
}
if (!formData.value.deptSignPriceTargetVOList) {
formData.value.deptSignPriceTargetVOList = []
}
formData.value.deptSignPriceTargetVOList.push(obj)
}
</script>
<style lang="scss" scoped></style>

@ -25,7 +25,7 @@
<el-table-column prop="sort" label="排序" width="200" /> <el-table-column prop="sort" label="排序" width="200" />
<el-table-column prop="status" label="状态" width="100" /> <el-table-column prop="status" label="状态" width="100" />
<el-table-column label="创建时间" prop="createTime" width="180" :formatter="dateFormatter" /> <el-table-column label="创建时间" prop="createTime" width="180" :formatter="dateFormatter" />
<el-table-column label="操作" class-name="fixed-width" width="240"> <el-table-column label="操作" class-name="fixed-width" width="160">
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
@ -35,14 +35,6 @@
> >
修改 修改
</el-button> </el-button>
<el-button
link
type="primary"
@click="openTarget(scope.row.id)"
v-hasPermi="['basic:dept:update']"
>
业绩指标
</el-button>
<el-button <el-button
link link
type="danger" type="danger"
@ -57,13 +49,11 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<DeptForm ref="formRef" @success="getList" /> <DeptForm ref="formRef" @success="getList" />
<DialogTarget ref="targetDialogRef" @success="getList" />
</template> </template>
<script setup lang="ts" name="SystemDept"> <script setup lang="ts" name="SystemDept">
import { handleTree } from '@/utils/tree' import { handleTree } from '@/utils/tree'
import * as DeptApi from '@/api/system/dept' import * as DeptApi from '@/api/system/dept'
import DeptForm from './DeptForm.vue' import DeptForm from './DeptForm.vue'
import DialogTarget from './DialogTarget.vue'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -103,11 +93,6 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id) formRef.value.open(type, id)
} }
const targetDialogRef = ref()
const openTarget = (id: number) => {
targetDialogRef.value.open(id)
}
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
try { try {

@ -2,36 +2,35 @@
<div class="pl-20px pr-20px"> <div class="pl-20px pr-20px">
<el-form :model="form" ref="formRef" :rules="rules" label-width="auto" v-loading="formLoading"> <el-form :model="form" ref="formRef" :rules="rules" label-width="auto" v-loading="formLoading">
<el-form-item label="开启通知"> <el-form-item label="开启通知">
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.kaiqitongzhi">
<el-radio :label="1"> 开启 </el-radio> <el-radio :label="1"> 开启 </el-radio>
<el-radio :label="0"> 关闭 </el-radio> <el-radio :label="0"> 关闭 </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="发送途径"> <el-form-item label="发送途径">
<el-checkbox-group v-model="form.sendType"> <el-checkbox-group v-model="form.fasongtujing">
<el-checkbox v-for="(item, index) in sendTypeOptions" :key="index" :label="item.value"> <el-checkbox :label="1">系统通知</el-checkbox>
{{ item.label }} <el-checkbox :label="2">微信公众号</el-checkbox>
</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item label="发送时间"> <el-form-item label="发送时间">
<el-time-picker <el-time-picker
v-model="form.sendTime" v-model="form.sendTime"
placeholder="任意时间点" placeholder="任意时间点"
format="HH:mm" format="HH:mm:ss"
value-format="HH:mm" value-format="HH:mm:ss"
/> />
</el-form-item> </el-form-item>
<el-form-item label="发送内容"> <el-form-item label="发送内容">
<el-tree <el-tree
ref="treeRef" ref="treeRef"
:data="contentOptions" :data="contentOptions"
:props="defaultProps"
empty-text="加载中,请稍候" empty-text="加载中,请稍候"
node-key="id" node-key="value"
show-checkbox show-checkbox
default-expand-all default-expand-all
:default-checked-keys="form.sendContent"
style="width: 100%" style="width: 100%"
/> />
</el-form-item> </el-form-item>
@ -43,9 +42,7 @@
</template> </template>
<script setup name="ReportDaily"> <script setup name="ReportDaily">
import * as DaliyReportApi from '@/api/system/role/daliyReport' import { handleTree } from '@/utils/tree'
import { defaultProps, handleTree } from '@/utils/tree'
import { getGeneralSysDictData } from '@/api/system/dict/dict.data'
const message = useMessage() // const message = useMessage() //
const props = defineProps({ const props = defineProps({
@ -56,16 +53,9 @@ const props = defineProps({
const formLoading = ref(false) const formLoading = ref(false)
const form = ref({ const form = ref({
sendItem: [] checkedMenuIds: []
}) })
watch(
() => props.roleId,
() => {
getReportInfo()
}
)
onMounted(() => { onMounted(() => {
init() init()
}) })
@ -81,39 +71,43 @@ async function init() {
getReportInfo() getReportInfo()
} }
const sendTypeOptions = ref([])
const treeRef = ref() const treeRef = ref()
function getOptions() { function getOptions() {
getGeneralSysDictData('message_send_type').then((data) => { const arr = [
sendTypeOptions.value = data {
}) value: 1,
DaliyReportApi.getDaliyReportContent().then((data) => { label: '销售快报',
contentOptions.value = handleTree(data) children: [
}) { value: 11, label: '今日跟进线索数', pId: 1 },
{ value: 12, label: '今日待跟进数', pId: 1 },
{ value: 13, label: '今日接受线索数', pId: 1 }
]
},
{
value: 2,
label: '管理快报',
children: [
{ value: 21, label: '当日业绩(成交数,成交额)', pId: 2 },
{ value: 22, label: '当月业绩(成交数,成交额)', pId: 2 },
{ value: 23, label: '本月业绩完成情况(数值,比例)', pId: 2 }
]
}
]
contentOptions.value = arr
handleTree(arr)
} }
async function getReportInfo() { async function getReportInfo() {
try { try {
formLoading.value = true formLoading.value = true
const data = await DaliyReportApi.getRoleDaliyReport(props.roleId) form.value = {
form.value = { ...data } kaiqitongzhi: 1,
fasongtujing: [1, 2],
if (!form.value.sendType) { sendTime: '21:00:00',
form.value.sendType = [] sendContent: [21, 22, 23]
} }
if (!form.value.sendTime) {
form.value.sendTime = '22:00'
}
if (!form.value.sendItem) {
form.value.sendItem = []
}
treeRef.value.setCheckedKeys([], false)
//
form.value.sendItem.forEach((menuId) => {
treeRef.value.setChecked(menuId, true, false)
})
formLoading.value = false formLoading.value = false
} catch (error) { } catch (error) {
console.log(error) console.log(error)
@ -127,19 +121,16 @@ const submitForm = async () => {
formLoading.value = true formLoading.value = true
try { try {
const data = { const data = {
id: form.value.id,
roleId: props.roleId, roleId: props.roleId,
sendType: form.value.sendType, menuIds: [
sendTime: form.value.sendTime,
status: form.value.status,
sendItem: [
...treeRef.value.getCheckedKeys(false), // ...treeRef.value.getCheckedKeys(false), //
...treeRef.value.getHalfCheckedKeys() // ...treeRef.value.getHalfCheckedKeys() //
] ]
} }
await DaliyReportApi.updateRoleDaliyReport(data) // await PermissionApi.assignRoleMenu(data)
console.log(data)
message.success('保存成功') message.success('保存成功')
getReportInfo()
} finally { } finally {
formLoading.value = false formLoading.value = false
} }

@ -191,17 +191,11 @@ function getFields() {
}) })
getOrderFieldList().then((data) => { getOrderFieldList().then((data) => {
const list = useCrudSchemas(data).allSchemas.detailSchema const arr = useCrudSchemas(data).allSchemas.detailSchema
const arr = [] arr.forEach((it) => {
list.forEach((it) => {
if (it.label.includes('日期')) { if (it.label.includes('日期')) {
it.dateFormat = 'YYYY-MM-DD' it.dateFormat = 'YYYY-MM-DD'
} }
if (it.field == 'receivedMoney') {
checkPermi(['clue:order:return-list']) && arr.push(it)
} else {
arr.push(it)
}
}) })
if (arr.length % 2 != 0) { if (arr.length % 2 != 0) {
arr.push({}) arr.push({})

Loading…
Cancel
Save