Files
ss-crm-manage-web/src/views/Basic/GeneralSet/Comp/BSClue.vue

89 lines
2.2 KiB
Vue
Raw Normal View History

2024-05-16 16:33:20 +08:00
<template>
<el-form :model="form" ref="formRef" label-width="auto">
2024-07-31 18:35:36 +08:00
<!-- <el-form-item v-if="getConfig('usePhoneConfig')">
2024-05-16 16:33:20 +08:00
<template #label>
2024-06-17 11:31:14 +08:00
<Tooltip
v-if="getConfig('usePhoneConfig').remark"
:message="getConfig('usePhoneConfig').remark"
/>
<span>使用外呼</span>
2024-05-16 16:33:20 +08:00
</template>
2024-06-23 16:48:28 +08:00
<el-radio-group
v-model="form.usePhoneConfig"
2024-06-24 23:28:56 +08:00
:disabled="!getConfig('usePhoneConfig').modifiable"
2024-06-23 16:48:28 +08:00
>
2024-06-17 11:31:14 +08:00
<el-radio
v-for="(item, index) in getConfig('usePhoneConfig').options"
:key="index"
:label="item.id"
>
{{ item.name }}
</el-radio>
2024-05-16 16:33:20 +08:00
</el-radio-group>
2024-07-31 18:35:36 +08:00
</el-form-item> -->
2024-06-17 11:31:14 +08:00
<el-form-item v-if="getConfig('showFollowConfig')">
<template #label>
<Tooltip
v-if="getConfig('showFollowConfig').remark"
:message="getConfig('showFollowConfig').remark"
/>
<span>跟进信息</span>
</template>
<el-radio-group v-model="form.showFollowConfig">
<el-radio
v-for="(item, index) in getConfig('showFollowConfig').options"
:key="index"
:label="item.id"
>
{{ item.name }}
</el-radio>
2024-05-16 16:33:20 +08:00
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">保存</el-button>
<el-button @click="getData">刷新</el-button>
</el-form-item>
</el-form>
</template>
<script setup name="BasicSettingClue">
2024-06-17 11:31:14 +08:00
import * as ConfigApi from '@/api/system/set'
2024-05-16 16:33:20 +08:00
const message = useMessage()
2024-06-17 11:31:14 +08:00
const form = ref({})
const configList = ref([])
function getConfig(val) {
return configList.value.find((it) => it.configKey == val)
}
2024-05-16 16:33:20 +08:00
function getData() {
2024-06-17 11:31:14 +08:00
ConfigApi.getConfigList({ module: 100 }).then((data) => {
configList.value = data
// 获取所有配置项
data.map((it) => {
form.value[it.configKey] = it.configValue
})
})
2024-05-16 16:33:20 +08:00
}
function onSubmit() {
2024-06-17 11:31:14 +08:00
const params = configList.value.map((it) => ({
configId: it.configId,
configKey: it.configKey,
configValue: form.value[it.configKey]
}))
ConfigApi.updateConfig(params).then(() => {
message.success('保存成功')
})
2024-05-16 16:33:20 +08:00
}
2024-06-17 11:31:14 +08:00
onMounted(() => {
getData()
})
2024-05-16 16:33:20 +08:00
</script>
<style lang="scss" scoped></style>