提交
This commit is contained in:
@@ -7,5 +7,10 @@ export const getConfigByConfigKey = (params) => {
|
||||
|
||||
// 保存配置项
|
||||
export const updateConfig = (data) => {
|
||||
return request.put({ url: '/admin-api/crm/config/update', data })
|
||||
return request.put({ url: '/admin-api/crm/config/batchUpdateConfigValue', data })
|
||||
}
|
||||
|
||||
// 根据模块获取配置列表
|
||||
export const getConfigList = (params) => {
|
||||
return request.get({ url: '/admin-api/crm/config/query', params })
|
||||
}
|
||||
|
||||
@@ -1,18 +1,39 @@
|
||||
<template>
|
||||
<el-form :model="form" ref="formRef" label-width="auto">
|
||||
<el-form-item>
|
||||
<el-form-item v-if="getConfig('usePhoneConfig')">
|
||||
<template #label>
|
||||
<Tooltip message="请联系客服开通或关闭,客服电话:15955599959" />使用外呼
|
||||
<Tooltip
|
||||
v-if="getConfig('usePhoneConfig').remark"
|
||||
:message="getConfig('usePhoneConfig').remark"
|
||||
/>
|
||||
<span>使用外呼</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.callEnable" disabled>
|
||||
<el-radio :label="1"> 使用 </el-radio>
|
||||
<el-radio :label="0"> 不使用 </el-radio>
|
||||
<el-radio-group v-model="form.usePhoneConfig">
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('usePhoneConfig').options"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="跟进信息">
|
||||
<el-radio-group v-model="form.followType">
|
||||
<el-radio :label="1"> 展示所有 </el-radio>
|
||||
<el-radio :label="2"> 仅展示本人 </el-radio>
|
||||
<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>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -23,23 +44,42 @@
|
||||
</template>
|
||||
|
||||
<script setup name="BasicSettingClue">
|
||||
import * as ConfigApi from '@/api/system/set'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const form = ref({
|
||||
followType: 1,
|
||||
callEnable: 1
|
||||
})
|
||||
const form = ref({})
|
||||
|
||||
const configList = ref([])
|
||||
|
||||
function getConfig(val) {
|
||||
return configList.value.find((it) => it.configKey == val)
|
||||
}
|
||||
|
||||
function getData() {
|
||||
form.value = {
|
||||
followType: 1,
|
||||
callEnable: 1
|
||||
}
|
||||
ConfigApi.getConfigList({ module: 100 }).then((data) => {
|
||||
configList.value = data
|
||||
// 获取所有配置项
|
||||
data.map((it) => {
|
||||
form.value[it.configKey] = it.configValue
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
message.success('保存成功')
|
||||
const params = configList.value.map((it) => ({
|
||||
configId: it.configId,
|
||||
configKey: it.configKey,
|
||||
configValue: form.value[it.configKey]
|
||||
}))
|
||||
ConfigApi.updateConfig(params).then(() => {
|
||||
message.success('保存成功')
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -1,16 +1,31 @@
|
||||
<template>
|
||||
<el-form :model="form" ref="formRef" label-width="auto">
|
||||
<el-form-item label="是否关联成交率">
|
||||
<el-radio-group v-model="form.withSuccess">
|
||||
<el-radio :label="1"> 是 </el-radio>
|
||||
<el-radio :label="0"> 否 </el-radio>
|
||||
<el-form-item v-if="getConfig('saleCommissionRelateDealConfig')">
|
||||
<template #label>
|
||||
<Tooltip
|
||||
v-if="getConfig('saleCommissionRelateDealConfig').remark"
|
||||
:message="getConfig('saleCommissionRelateDealConfig').remark"
|
||||
/>
|
||||
<span>是否关联成交率</span>
|
||||
</template>
|
||||
<el-radio-group
|
||||
v-model="form.saleCommissionRelateDealConfig"
|
||||
@change="form.saleCommissionRelateRulesConfig = []"
|
||||
>
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('saleCommissionRelateDealConfig').options"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联规则" v-if="form.withSuccess">
|
||||
<el-form-item label="关联规则" v-if="form.saleCommissionRelateDealConfig == 'true'">
|
||||
<div>
|
||||
<el-button @click="form.rules.push({})">新增规则</el-button>
|
||||
<el-button @click="form.saleCommissionRelateRulesConfig.push({})">新增规则</el-button>
|
||||
<div
|
||||
v-for="(item, index) in form.rules"
|
||||
v-for="(item, index) in form.saleCommissionRelateRulesConfig"
|
||||
:key="index"
|
||||
class="mt-10px flex justify-center items-center"
|
||||
>
|
||||
@@ -48,22 +63,52 @@
|
||||
</template>
|
||||
|
||||
<script setup name="BasicSettingClue">
|
||||
import * as ConfigApi from '@/api/system/set'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const form = ref({
|
||||
withSuccess: 1,
|
||||
rules: []
|
||||
})
|
||||
const form = ref({})
|
||||
const configList = ref([])
|
||||
|
||||
const jsonArr = ['saleCommissionRelateRulesConfig']
|
||||
|
||||
function getConfig(val) {
|
||||
return configList.value.find((it) => it.configKey == val)
|
||||
}
|
||||
|
||||
function getData() {
|
||||
form.value = {
|
||||
withSuccess: 1
|
||||
}
|
||||
ConfigApi.getConfigList({ module: 101 }).then((data) => {
|
||||
configList.value = data
|
||||
// 获取所有配置项
|
||||
data.map((it) => {
|
||||
form.value[it.configKey] = it.configValue
|
||||
if (it.configKey == 'saleCommissionRelateRulesConfig') {
|
||||
if (!form.value[it.configKey]) {
|
||||
form.value[it.configKey] = []
|
||||
} else {
|
||||
form.value[it.configKey] = JSON.parse(it.configValue)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
message.success('保存成功')
|
||||
const params = configList.value.map((it) => ({
|
||||
configId: it.configId,
|
||||
configKey: it.configKey,
|
||||
configValue: jsonArr.includes(it.configKey)
|
||||
? JSON.stringify(form.value[it.configKey])
|
||||
: form.value[it.configKey]
|
||||
}))
|
||||
ConfigApi.updateConfig(params).then(() => {
|
||||
message.success('保存成功')
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -1,21 +1,57 @@
|
||||
<template>
|
||||
<el-form :model="form" ref="formRef" label-width="auto">
|
||||
<el-form-item label="售后申请自动通过">
|
||||
<el-radio-group v-model="form.autoAudiAfterSale">
|
||||
<el-radio :label="0"> 是 </el-radio>
|
||||
<el-radio :label="1"> 否 </el-radio>
|
||||
<el-form-item v-if="getConfig('afterSalesAuditAutoCompleteConfig')">
|
||||
<template #label>
|
||||
<Tooltip
|
||||
v-if="getConfig('afterSalesAuditAutoCompleteConfig').remark"
|
||||
:message="getConfig('afterSalesAuditAutoCompleteConfig').remark"
|
||||
/>
|
||||
<span>售后申请自动通过</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.afterSalesAuditAutoCompleteConfig">
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('afterSalesAuditAutoCompleteConfig').options"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="发货自动发起采购">
|
||||
<el-radio-group v-model="form.autoSend">
|
||||
<el-radio :label="0"> 是 </el-radio>
|
||||
<el-radio :label="1"> 否 </el-radio>
|
||||
<el-form-item v-if="getConfig('deliveryAutoStartPurchaseConfig')">
|
||||
<template #label>
|
||||
<Tooltip
|
||||
v-if="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
||||
:message="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
||||
/>
|
||||
<span>发货自动发起采购</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.deliveryAutoStartPurchaseConfig">
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('deliveryAutoStartPurchaseConfig').options"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="回款申请自动通过">
|
||||
<el-radio-group v-model="form.autoAuditReturn">
|
||||
<el-radio :label="0"> 是 </el-radio>
|
||||
<el-radio :label="1"> 否 </el-radio>
|
||||
<el-form-item v-if="getConfig('repaymentAuditAutoCompleteConfig')">
|
||||
<template #label>
|
||||
<Tooltip
|
||||
v-if="getConfig('repaymentAuditAutoCompleteConfig').remark"
|
||||
:message="getConfig('repaymentAuditAutoCompleteConfig').remark"
|
||||
/>
|
||||
<span>回款申请自动通过</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.repaymentAuditAutoCompleteConfig">
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('repaymentAuditAutoCompleteConfig').options"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -26,25 +62,42 @@
|
||||
</template>
|
||||
|
||||
<script setup name="GeneralClue">
|
||||
import * as ConfigApi from '@/api/system/set'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const form = ref({
|
||||
autoAudiAfterSale: 0,
|
||||
autoSend: 0,
|
||||
autoAuditReturn: 0
|
||||
})
|
||||
const form = ref({})
|
||||
|
||||
const configList = ref([])
|
||||
|
||||
function getConfig(val) {
|
||||
return configList.value.find((it) => it.configKey == val)
|
||||
}
|
||||
|
||||
function getData() {
|
||||
form.value = {
|
||||
autoAudiAfterSale: 0,
|
||||
autoSend: 0,
|
||||
autoAuditReturn: 0
|
||||
}
|
||||
ConfigApi.getConfigList({ module: 1 }).then((data) => {
|
||||
configList.value = data
|
||||
// 获取所有配置项
|
||||
data.map((it) => {
|
||||
form.value[it.configKey] = it.configValue
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
message.success('保存成功')
|
||||
const params = configList.value.map((it) => ({
|
||||
configId: it.configId,
|
||||
configKey: it.configKey,
|
||||
configValue: form.value[it.configKey]
|
||||
}))
|
||||
ConfigApi.updateConfig(params).then(() => {
|
||||
message.success('保存成功')
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
<template>
|
||||
<el-form :model="form" ref="formRef" label-width="auto">
|
||||
<el-form-item label="采购申请自动通过">
|
||||
<el-form-item v-if="getConfig('purchaseAuditAutoCompleteConfig')">
|
||||
<template #label>
|
||||
<Tooltip
|
||||
v-if="getConfig('purchaseAuditAutoCompleteConfig').remark"
|
||||
:message="getConfig('purchaseAuditAutoCompleteConfig').remark"
|
||||
/>
|
||||
<span>采购申请自动通过</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.purchaseAuditAutoCompleteConfig">
|
||||
<el-radio label="true"> 是 </el-radio>
|
||||
<el-radio label="false"> 否 </el-radio>
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('purchaseAuditAutoCompleteConfig').options"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -17,27 +29,31 @@ import * as ConfigApi from '@/api/system/set'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const form = ref({
|
||||
purchaseAuditAutoCompleteConfig: 'true'
|
||||
})
|
||||
const form = ref({})
|
||||
|
||||
const info = ref({})
|
||||
const configList = ref([])
|
||||
|
||||
function getConfig(val) {
|
||||
return configList.value.find((it) => it.configKey == val)
|
||||
}
|
||||
|
||||
function getData() {
|
||||
ConfigApi.getConfigByConfigKey({ configKey: 'purchaseAuditAutoCompleteConfig' }).then((data) => {
|
||||
info.value = data
|
||||
form.value = {
|
||||
purchaseAuditAutoCompleteConfig: data.configValue
|
||||
}
|
||||
ConfigApi.getConfigList({ module: 3 }).then((data) => {
|
||||
configList.value = data
|
||||
// 获取所有配置项
|
||||
data.map((it) => {
|
||||
form.value[it.configKey] = it.configValue
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
const data = {
|
||||
...info,
|
||||
purchaseAuditAutoCompleteConfig: form.value.purchaseAuditAutoCompleteConfig
|
||||
}
|
||||
ConfigApi.updateConfig(data).then(() => {
|
||||
const params = configList.value.map((it) => ({
|
||||
configId: it.configId,
|
||||
configKey: it.configKey,
|
||||
configValue: form.value[it.configKey]
|
||||
}))
|
||||
ConfigApi.updateConfig(params).then(() => {
|
||||
message.success('保存成功')
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user