提交 bdd3e0b0 authored 作者: wangyizheng's avatar wangyizheng

添加触达文案

上级 12afe8c7
...@@ -9,7 +9,7 @@ export function createReachScheme(data) { ...@@ -9,7 +9,7 @@ export function createReachScheme(data) {
} }
// 触达详情 // 触达详情
export function ReachScheme(id, params = {}) { export function reachScheme(id, params = {}) {
var headers = { var headers = {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
} }
......
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
<el-input v-model="addForm.name" autocomplete="off"></el-input> <el-input v-model="addForm.name" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="案例等级" :label-width="formLabelWidth"> <el-form-item label="案例等级" :label-width="formLabelWidth">
<el-select v-model="addForm.level" placeholder="请选择案例等级"> <el-select v-model.number="addForm.level" placeholder="请选择案例等级">
<el-option label="低风险" value="1"></el-option> <el-option label="低风险" value="1"></el-option>
<el-option label="中风险" value="2"></el-option> <el-option label="中风险" value="2"></el-option>
<el-option label="高风险" value="3"></el-option> <el-option label="高风险" value="3"></el-option>
...@@ -271,7 +271,7 @@ ...@@ -271,7 +271,7 @@
<el-form-item style="margin-left: 2%" label="关键词" :label-width="formLabelWidth"> <el-form-item style="margin-left: 2%" label="关键词" :label-width="formLabelWidth">
<el-input v-model="keywrod.name" placeholder="请输入关键词" style="width: 50%"></el-input> <el-input v-model="keywrod.name" placeholder="请输入关键词" style="width: 50%"></el-input>
<span>关键词得分:</span> <span>关键词得分:</span>
<el-input v-model="keywrod.score" placeholder="得分" style="width: 20%"></el-input> <el-input v-model.number="keywrod.score" placeholder="得分" style="width: 20%"></el-input>
<i class="el-icon-circle-plus-outline" @click="addKeywords('production_detail', index)"></i> <i class="el-icon-circle-plus-outline" @click="addKeywords('production_detail', index)"></i>
<i class="el-icon-remove-outline" @click="removeKeywords('production_detail', index, index1)"></i> <i class="el-icon-remove-outline" @click="removeKeywords('production_detail', index, index1)"></i>
</el-form-item> </el-form-item>
...@@ -292,7 +292,7 @@ ...@@ -292,7 +292,7 @@
<el-form-item style="margin-left: 2%" label="关键词" :label-width="formLabelWidth"> <el-form-item style="margin-left: 2%" label="关键词" :label-width="formLabelWidth">
<el-input v-model="fundKeywrod.name" placeholder="请输入关键词" style="width: 50%"></el-input> <el-input v-model="fundKeywrod.name" placeholder="请输入关键词" style="width: 50%"></el-input>
<span>关键词得分:</span> <span>关键词得分:</span>
<el-input v-model="fundKeywrod.score" placeholder="得分" style="width: 20%"></el-input> <el-input v-model.number="fundKeywrod.score" placeholder="得分" style="width: 20%"></el-input>
<i class="el-icon-circle-plus-outline" @click="addKeywords('fund_detail', fundIndex)"></i> <i class="el-icon-circle-plus-outline" @click="addKeywords('fund_detail', fundIndex)"></i>
<i class="el-icon-remove-outline" @click="removeKeywords('fund_detail', fundIndex, fundIndex1)"></i> <i class="el-icon-remove-outline" @click="removeKeywords('fund_detail', fundIndex, fundIndex1)"></i>
</el-form-item> </el-form-item>
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
<el-form-item style="margin-left: 2%" label="关键词" :label-width="formLabelWidth"> <el-form-item style="margin-left: 2%" label="关键词" :label-width="formLabelWidth">
<el-input v-model="investKeyword.name" placeholder="请输入关键词" style="width: 50%"></el-input> <el-input v-model="investKeyword.name" placeholder="请输入关键词" style="width: 50%"></el-input>
<span>关键词得分:</span> <span>关键词得分:</span>
<el-input v-model="investKeyword.score" placeholder="得分" style="width: 20%"></el-input> <el-input v-model.number="investKeyword.score" placeholder="得分" style="width: 20%"></el-input>
<i class="el-icon-circle-plus-outline" @click="addKeywords('invest_detail', investIndex)"></i> <i class="el-icon-circle-plus-outline" @click="addKeywords('invest_detail', investIndex)"></i>
<i class="el-icon-remove-outline" @click="removeKeywords('invest_detail', investIndex, investIndex1)"></i> <i class="el-icon-remove-outline" @click="removeKeywords('invest_detail', investIndex, investIndex1)"></i>
</el-form-item> </el-form-item>
......
...@@ -44,10 +44,10 @@ ...@@ -44,10 +44,10 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover <el-popover
placement="right" placement="right"
width="500" width="600"
trigger="click"> trigger="click">
<el-card :body-style="{ padding: '0px' }">
<div style="padding: 14px;" v-for="(option, optionIndex) in scope.row.options" :key="'option-' + optionIndex"> <div style="padding: 14px;" v-for="(option, optionIndex) in scope.row.options" :key="'option-' + optionIndex">
<el-card>
<div> <div>
<span><strong>特征选项名称:</strong></span><span>{{ option.name }}</span> <span><strong>特征选项名称:</strong></span><span>{{ option.name }}</span>
</div> </div>
...@@ -70,9 +70,8 @@ ...@@ -70,9 +70,8 @@
<br/> <br/>
</div> </div>
</div> </div>
<el-divider v-if="optionIndex < scope.row.options.length - 1" content-position="right"></el-divider>
</div>
</el-card> </el-card>
</div>
<el-button slot="reference" size="mini">查看配置</el-button> <el-button slot="reference" size="mini">查看配置</el-button>
</el-popover> </el-popover>
</template> </template>
...@@ -83,8 +82,8 @@ ...@@ -83,8 +82,8 @@
placement="right" placement="right"
width="500" width="500"
trigger="click"> trigger="click">
<el-card :body-style="{ padding: '0px' }">
<div style="padding: 14px;" v-for="(rule, ruleIndex) in scope.row.rules" :key="'rule-' + ruleIndex"> <div style="padding: 14px;" v-for="(rule, ruleIndex) in scope.row.rules" :key="'rule-' + ruleIndex">
<el-card>
<div> <div>
<span><strong>分数范围:</strong></span> <span><strong>分数范围:</strong></span>
<span>{{ rule.min }} ~ {{ rule.max }}</span> <span>{{ rule.min }} ~ {{ rule.max }}</span>
...@@ -93,9 +92,8 @@ ...@@ -93,9 +92,8 @@
<span><strong>得分:</strong></span> <span><strong>得分:</strong></span>
<span>{{ rule.score }}</span> <span>{{ rule.score }}</span>
</div> </div>
<el-divider v-if="ruleIndex < scope.row.rules.length - 1" content-position="right"></el-divider>
</div>
</el-card> </el-card>
</div>
<el-button slot="reference" size="mini">查看择算分规则</el-button> <el-button slot="reference" size="mini">查看择算分规则</el-button>
</el-popover> </el-popover>
</template> </template>
...@@ -106,8 +104,8 @@ ...@@ -106,8 +104,8 @@
placement="right" placement="right"
width="500" width="500"
trigger="click"> trigger="click">
<el-card :body-style="{ padding: '0px' }">
<div style="padding: 14px;" v-for="(level, levelIndex) in scope.row.levels" :key="'level-' + levelIndex"> <div style="padding: 14px;" v-for="(level, levelIndex) in scope.row.levels" :key="'level-' + levelIndex">
<el-card>
<div> <div>
<span><strong>分数范围:</strong></span> <span><strong>分数范围:</strong></span>
<span>{{ level.min }} ~ {{ level.max }}</span> <span>{{ level.min }} ~ {{ level.max }}</span>
...@@ -116,13 +114,24 @@ ...@@ -116,13 +114,24 @@
<span><strong>风险等级规则:</strong></span> <span><strong>风险等级规则:</strong></span>
<span><el-tag size="mini" type="" effect="plain">{{ getLevel(level.level) }}</el-tag></span> <span><el-tag size="mini" type="" effect="plain">{{ getLevel(level.level) }}</el-tag></span>
</div> </div>
<el-divider v-if="levelIndex < scope.row.levels.length - 1" content-position="right"></el-divider>
</div>
</el-card> </el-card>
</div>
<el-button slot="reference" size="mini">查看风险等级规则</el-button> <el-button slot="reference" size="mini">查看风险等级规则</el-button>
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.created_at }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.updated_at }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作"> <el-table-column fixed="right" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select size="mini" :value="opera" @change="operation" placeholder="请选择"> <el-select size="mini" :value="opera" @change="operation" placeholder="请选择">
...@@ -204,19 +213,19 @@ ...@@ -204,19 +213,19 @@
</div> </div>
<div style="margin-top: 2%"> <div style="margin-top: 2%">
<span>分值: <span>分值:
<el-input size="mini" v-model="childOption.score" placeholder="分值" style="width: 30%"></el-input> <el-input size="mini" v-model.number="childOption.score" placeholder="分值" style="width: 30%"></el-input>
</span> </span>
</div> </div>
<div style="margin-top: 2%"> <div style="margin-top: 2%">
<span>是否正确: <span>是否正确:
<el-radio size="mini" v-model="childOption.answer" :label="0"></el-radio> <el-radio size="mini" v-model.number="childOption.answer" :label="0"></el-radio>
<el-radio size="mini" v-model="childOption.answer" :label="1"></el-radio> <el-radio size="mini" v-model.number="childOption.answer" :label="1"></el-radio>
</span> </span>
</div> </div>
<div style="margin-top: 2%"> <div style="margin-top: 2%">
<span>是否触及红线: <span>是否触及红线:
<el-radio size="mini" v-model="childOption.warning" :label="0"></el-radio> <el-radio size="mini" v-model.number="childOption.warning" :label="0"></el-radio>
<el-radio size="mini" v-model="childOption.warning" :label="1"></el-radio> <el-radio size="mini" v-model.number="childOption.warning" :label="1"></el-radio>
</span> </span>
</div> </div>
</el-card> </el-card>
...@@ -231,13 +240,13 @@ ...@@ -231,13 +240,13 @@
<el-card class="box-card" style="margin-left: 10%; margin-top: 2%"> <el-card class="box-card" style="margin-left: 10%; margin-top: 2%">
<div style="margin-top: 2%"> <div style="margin-top: 2%">
<span>最小分区间: <span>最小分区间:
<el-input size="mini" v-model="rule.min" placeholder="最小分" style="width: 10%"></el-input> <el-input size="mini" v-model.number="rule.min" placeholder="最小分" style="width: 10%"></el-input>
</span> </span>
<span style="margin-left: 2%">最大分区间: <span style="margin-left: 2%">最大分区间:
<el-input size="mini" v-model="rule.max" placeholder="最小分" style="width: 10%"></el-input> <el-input size="mini" v-model.number="rule.max" placeholder="最小分" style="width: 10%"></el-input>
</span> </span>
<span style="margin-left: 2%">择算分: <span style="margin-left: 2%">择算分:
<el-input size="mini" v-model="rule.score" placeholder="择算分" style="width: 10%"></el-input> <el-input size="mini" v-model.number="rule.score" placeholder="择算分" style="width: 10%"></el-input>
</span> </span>
</div> </div>
</el-card> </el-card>
...@@ -251,15 +260,15 @@ ...@@ -251,15 +260,15 @@
<el-card class="box-card" style="margin-left: 10%; margin-top: 2%"> <el-card class="box-card" style="margin-left: 10%; margin-top: 2%">
<div style="margin-top: 2%"> <div style="margin-top: 2%">
<span>最小分区间: <span>最小分区间:
<el-input size="mini" v-model="level.min" placeholder="最小分" style="width: 20%"></el-input> <el-input size="mini" v-model.number="level.min" placeholder="最小分" style="width: 20%"></el-input>
</span> </span>
<span style="margin-left: 2%">最大分区间: <span style="margin-left: 2%">最大分区间:
<el-input size="mini" v-model="level.max" placeholder="最小分" style="width: 20%"></el-input> <el-input size="mini" v-model.number="level.max" placeholder="最小分" style="width: 20%"></el-input>
</span> </span>
</div> </div>
<div style="margin-top: 2%"> <div style="margin-top: 2%">
<span>风险等级: <span>风险等级:
<el-select size="mini" v-model="level.level" placeholder="请选择风险等级等级"> <el-select size="mini" v-model.number="level.level" placeholder="请选择风险等级等级">
<el-option label="低风险" :value="1"></el-option> <el-option label="低风险" :value="1"></el-option>
<el-option label="中风险" :value="2"></el-option> <el-option label="中风险" :value="2"></el-option>
<el-option label="高风险" :value="3"></el-option> <el-option label="高风险" :value="3"></el-option>
......
...@@ -33,13 +33,43 @@ ...@@ -33,13 +33,43 @@
stripe stripe
size="mini" size="mini"
style="width: 100%"> style="width: 100%">
<el-table-column fixed prop="id" label="ID" width="150px"> <el-table-column fixed prop="id" label="ID" width="80px">
</el-table-column> </el-table-column>
<el-table-column fixed width="150px" label="案例名称"> <el-table-column label="案例名称">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.case.name }}</span> <span>{{ scope.row.case.name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="关键词配置">
<template slot-scope="scope">
<el-popover
placement="right"
width="500"
trigger="click">
<div style="padding: 14px;" v-for="(keyword, keywordIndex) in scope.row.keywords" :key="'keyword-' + keywordIndex">
<el-card>
<span><strong>关键词:</strong></span>
<span>{{ keyword.keyword }}</span>
<span><strong>分数:</strong></span>
<span>{{ keyword.score }}</span>
</el-card>
</div>
<el-button slot="reference" size="mini">查看关键词</el-button>
</el-popover>
</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.created_at }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.updated_at }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作"> <el-table-column fixed="right" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select size="mini" :value="opera" @change="operation" placeholder="请选择"> <el-select size="mini" :value="opera" @change="operation" placeholder="请选择">
...@@ -63,10 +93,68 @@ ...@@ -63,10 +93,68 @@
</div> </div>
</el-card> </el-card>
</div> </div>
<div>
<el-drawer
title="创建特征"
:visible.sync="drawer"
direction="rtl"
:append-to-body="true"
:withHeader="true"
:before-close="handleClose"
ref="drawer"
size="50%">
<div class="demo-drawer__content">
<el-form :model="addForm" size="mini">
<el-form-item label="案例" :label-width="formLabelWidth">
<el-select
v-model="addForm.case2_id"
filterable
remote
reserve-keyword
placeholder="请输入案例名称"
:remote-method="remoteMethod"
:loading="caseLoading">
<el-option
v-for="casesItem in cases"
:key="casesItem.value"
:label="casesItem.name"
:value="casesItem.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-divider content-position="left">关键词配置</el-divider>
</el-form-item>
<div style="margin-top: 2%" v-for="(keyword, keywordIndex) in addForm.keywords" :key="'keyword-' + keywordIndex">
<div style="margin-left: 15%; margin-top: 2%">
<i class="el-icon-circle-plus-outline" @click="addKeywords(keywordIndex)">添加</i>
<i class="el-icon-remove-outline" @click="removeKeywords(keywordIndex)">删除</i>
</div>
<el-card style="margin-left: 5%; margin-top: 2%">
<span><strong>关键词:</strong></span>
<el-input size="mini" v-model="keyword.keyword" placeholder="请输入关键词" style="width: 40%"></el-input>
<span style="margin-left: 2%"><strong>分数:</strong></span>
<el-input size="mini" v-model.number="keyword.score" placeholder="请输入分数" style="width: 20%"></el-input>
</el-card>
</div>
<el-form-item>
<el-divider content-position="left"></el-divider>
</el-form-item>
<el-form-item>
<div class="demo-drawer__footer" style="margin-left: 60%">
<el-button @click="cancelForm">取 消</el-button>
<el-button type="primary" @click="$refs.drawer.closeDrawer()" :loading="loading">{{ loading ? '提交中 ...' : '确 定' }}</el-button>
</div>
</el-form-item>
</el-form>
</div>
</el-drawer>
</div>
</div> </div>
</template> </template>
<script> <script>
import * as casesApi from '@/api/cases2'
import * as reachSchemeApi from '@/api/reach-scheme' import * as reachSchemeApi from '@/api/reach-scheme'
export default { export default {
name: 'index', name: 'index',
...@@ -78,11 +166,25 @@ export default { ...@@ -78,11 +166,25 @@ export default {
limit: 10, limit: 10,
tableData: [], tableData: [],
drawer: false, drawer: false,
opera: '' opera: '',
loading: false,
formLabelWidth: '100px',
caseLoading: false,
cases: [],
addForm: {
case2_id: '',
keywords: [
{
keyword: '',
score: 0
}
]
}
} }
}, },
mounted() { mounted() {
this.list({ page: this.currentPage, limit: this.limit }) this.list({ page: this.currentPage, limit: this.limit })
this.caseList({ page: 1, limit: 10 })
}, },
methods: { methods: {
handleSizeChange(val) { handleSizeChange(val) {
...@@ -105,7 +207,7 @@ export default { ...@@ -105,7 +207,7 @@ export default {
reachSchemeApi.reachSchemeList(params).then(res => { reachSchemeApi.reachSchemeList(params).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = res.data.data this.tableData = res.data.data
this.currentPage = res.data.current_page this.currentPage = res.current_page
this.totalPage = res.data.total this.totalPage = res.data.total
return true return true
} else { } else {
...@@ -114,9 +216,77 @@ export default { ...@@ -114,9 +216,77 @@ export default {
} }
}) })
}, },
caseList(params = {}) {
this.caseLoading = true
casesApi.case2s(params).then(res => {
if (res.code === 0) {
this.cases = res.data.data
this.caseLoading = false
return true
} else {
this.$message.error(res.message)
return false
}
})
},
refresh() { refresh() {
this.searchCaseName = '' this.searchCaseName = ''
this.list({ page: 1, limit: this.limit }) this.list({ page: 1, limit: this.limit })
},
handleClose(done) {
if (this.loading) {
return
}
this.$confirm('确定要提交表单吗?')
.then(_ => {
this.loading = true
// 提交表单
console.log(this.addForm)
reachSchemeApi.createReachScheme(this.addForm).then(res => {
if (res.code === 0) {
this.list({ page: 1, limit: this.limit })
this.caseList({ page: 1, limit: 10 })
this.addForm = {
case2_id: '',
keywords: [
{
keyword: '',
score: 0
}
]
}
this.$message.success(res.message)
return true
} else {
this.$message.error(res.message)
return false
}
})
this.timer = setTimeout(() => {
done()
// 动画关闭需要一定的时间
setTimeout(() => {
this.loading = false
}, 400)
}, 2000)
})
.catch(_ => {})
},
remoteMethod(query) {
this.caseList({ name: query, page: 1, limit: 10 })
},
cancelForm() {
this.loading = false
this.drawer = false
clearTimeout(this.timer)
},
addKeywords(keywordIndex) {
this.addForm.keywords.push({ keyword: '', score: 0 })
},
removeKeywords(keywordIndex) {
if (this.addForm.keywords.length > 1) {
this.addForm.keywords.splice(keywordIndex, 1)
}
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论