|
|
@ -2,35 +2,36 @@ |
|
|
|
<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.kaiqitongzhi"> |
|
|
|
<el-radio-group v-model="form.status"> |
|
|
|
<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.fasongtujing"> |
|
|
|
<el-checkbox-group v-model="form.sendType"> |
|
|
|
<el-checkbox :label="1">系统通知</el-checkbox> |
|
|
|
<el-checkbox v-for="(item, index) in sendTypeOptions" :key="index" :label="item.value"> |
|
|
|
<el-checkbox :label="2">微信公众号</el-checkbox> |
|
|
|
{{ item.label }} |
|
|
|
|
|
|
|
</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:ss" |
|
|
|
format="HH:mm" |
|
|
|
value-format="HH:mm:ss" |
|
|
|
value-format="HH:mm" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</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="value" |
|
|
|
node-key="id" |
|
|
|
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> |
|
|
@ -42,7 +43,9 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script setup name="ReportDaily"> |
|
|
|
<script setup name="ReportDaily"> |
|
|
|
import { handleTree } from '@/utils/tree' |
|
|
|
import * as DaliyReportApi from '@/api/system/role/daliyReport' |
|
|
|
|
|
|
|
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({ |
|
|
@ -53,9 +56,16 @@ const props = defineProps({ |
|
|
|
|
|
|
|
|
|
|
|
const formLoading = ref(false) |
|
|
|
const formLoading = ref(false) |
|
|
|
const form = ref({ |
|
|
|
const form = ref({ |
|
|
|
checkedMenuIds: [] |
|
|
|
sendItem: [] |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
|
|
|
|
() => props.roleId, |
|
|
|
|
|
|
|
() => { |
|
|
|
|
|
|
|
getReportInfo() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
onMounted(() => { |
|
|
|
init() |
|
|
|
init() |
|
|
|
}) |
|
|
|
}) |
|
|
@ -71,43 +81,39 @@ async function init() { |
|
|
|
getReportInfo() |
|
|
|
getReportInfo() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const sendTypeOptions = ref([]) |
|
|
|
const treeRef = ref() |
|
|
|
const treeRef = ref() |
|
|
|
function getOptions() { |
|
|
|
function getOptions() { |
|
|
|
const arr = [ |
|
|
|
getGeneralSysDictData('message_send_type').then((data) => { |
|
|
|
{ |
|
|
|
sendTypeOptions.value = data |
|
|
|
value: 1, |
|
|
|
}) |
|
|
|
label: '销售快报', |
|
|
|
DaliyReportApi.getDaliyReportContent().then((data) => { |
|
|
|
children: [ |
|
|
|
contentOptions.value = handleTree(data) |
|
|
|
{ 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 |
|
|
|
form.value = { |
|
|
|
const data = await DaliyReportApi.getRoleDaliyReport(props.roleId) |
|
|
|
kaiqitongzhi: 1, |
|
|
|
form.value = { ...data } |
|
|
|
fasongtujing: [1, 2], |
|
|
|
|
|
|
|
sendTime: '21:00:00', |
|
|
|
if (!form.value.sendType) { |
|
|
|
sendContent: [21, 22, 23] |
|
|
|
form.value.sendType = [] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) |
|
|
@ -121,16 +127,19 @@ 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, |
|
|
|
menuIds: [ |
|
|
|
sendType: form.value.sendType, |
|
|
|
|
|
|
|
sendTime: form.value.sendTime, |
|
|
|
|
|
|
|
status: form.value.status, |
|
|
|
|
|
|
|
sendItem: [ |
|
|
|
...treeRef.value.getCheckedKeys(false), // 获得当前选中节点 |
|
|
|
...treeRef.value.getCheckedKeys(false), // 获得当前选中节点 |
|
|
|
...treeRef.value.getHalfCheckedKeys() // 获得半选中的父节点 |
|
|
|
...treeRef.value.getHalfCheckedKeys() // 获得半选中的父节点 |
|
|
|
] |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
// await PermissionApi.assignRoleMenu(data) |
|
|
|
await DaliyReportApi.updateRoleDaliyReport(data) |
|
|
|
console.log(data) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
message.success('保存成功') |
|
|
|
message.success('保存成功') |
|
|
|
|
|
|
|
getReportInfo() |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
formLoading.value = false |
|
|
|
formLoading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|