|
|
@@ -8,27 +8,27 @@
|
|
|
<el-row :gutter="20" align="middle" style="display: flex; align-items: center; width: 100%; overflow: hidden; margin: 0">
|
|
|
<el-col :span="18" style="padding-left: 20px">报价限制</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-button type="primary" @click="handleSync" :disabled="!quoteForm.isEnabled">同步配置到其他保司</el-button>
|
|
|
- <el-button type="primary" @click="handleEdit" :disabled="!quoteForm.isEnabled" v-if="!quoteForm.isEnabled">编辑</el-button>
|
|
|
+ <el-button type="primary" @click="handleSync" :disabled="!isEdit">同步配置到其他保司</el-button>
|
|
|
+ <el-button type="primary" @click="handleEdit" v-if="!isEdit">编辑</el-button>
|
|
|
<el-button type="primary" @click="handleSave" v-else>保存</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-divider></el-divider>
|
|
|
<el-form :model="quoteForm" ref="QuoteFormRef" :rules="quoteRules" style="padding-left: 30px;" label-width="120px">
|
|
|
<el-form-item prop="count" label="报价次数限制">
|
|
|
- <el-switch v-model="quoteForm.isEnabled"></el-switch>
|
|
|
+ <el-switch v-model="quoteForm.isEnabled" :disabled="!isEdit"></el-switch>
|
|
|
<p class="tips">开启后,代理人的报价次数将受到限制,超出设置的报价次数后将停止代理人的报价功能</p>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="agentLimit" label="代理人限制">
|
|
|
<div>
|
|
|
- <el-radio-group v-model="quoteForm.authorize" :disabled="!quoteForm.isEnabled">
|
|
|
+ <el-radio-group v-model="quoteForm.authorize" :disabled="!isEdit">
|
|
|
<el-radio :label="0">限制全部代理人</el-radio>
|
|
|
<el-radio :label="1">限制部分代理人</el-radio>
|
|
|
</el-radio-group>
|
|
|
- <kt-button v-if="quoteForm.authorize" type="text" label="选择代理人" icon="el-icon-plus" style="color: #2D4D89; margin-left: 30px" @click="selectAgent" />
|
|
|
+ <kt-button v-if="quoteForm.authorize" type="text" label="选择代理人" :disabled="!isEdit" icon="el-icon-plus" style="color: #2D4D89; margin-left: 30px" @click="selectAgent" />
|
|
|
</div>
|
|
|
<el-table
|
|
|
- :data="selectedList"
|
|
|
+ :data="selectList"
|
|
|
>
|
|
|
<el-table-column prop="deptId" label="部门编码"></el-table-column>
|
|
|
<el-table-column prop="organization" label="机构名称"></el-table-column>
|
|
|
@@ -38,37 +38,47 @@
|
|
|
<el-table-column prop="mobile" label="联系电话"></el-table-column>
|
|
|
<el-table-column label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <kt-button :disabled="!quoteForm.isEnabled" type="text" label="删除" style="color: #2D4D89;" />
|
|
|
+ <el-popconfirm
|
|
|
+ confirm-button-text='确定'
|
|
|
+ cancel-button-text='取消'
|
|
|
+ icon="el-icon-info"
|
|
|
+ icon-color="red"
|
|
|
+ :ref="`popconfirm-${scope.row.id}`"
|
|
|
+ title="确定删除吗?"
|
|
|
+ @confirm="handleDelete(scope.row)"
|
|
|
+ >
|
|
|
+ <kt-button slot="reference" :disabled="!isEdit" type="text" label="删除" style="color: #2D4D89;" />
|
|
|
+ </el-popconfirm>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="quoteLimit" label="报价限制">
|
|
|
- <el-checkbox-group v-model="quoteForm.quoteLimit" :disabled="!quoteForm.isEnabled">
|
|
|
+ <el-checkbox-group v-model="quoteForm.quoteLimit">
|
|
|
<div>
|
|
|
- <el-checkbox :label="1">
|
|
|
+ <el-checkbox label="1" :disabled="!isEdit">
|
|
|
<div style="display: flex; align-items: center">
|
|
|
- 单日报价,出单比不满<el-input size="small" v-model="quoteForm.orderRatio" :disabled="!quoteForm.isEnabled" style="width: 100px; margin: 0 20px;">
|
|
|
+ 单日报价,出单比不满<el-input size="small" v-model="quoteForm.orderRatio" :disabled="!isEdit" style="width: 100px; margin: 0 20px;">
|
|
|
<template slot="append">%</template>
|
|
|
</el-input>后,锁定代理人报价次数
|
|
|
</div>
|
|
|
</el-checkbox>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <el-checkbox :label="2">
|
|
|
+ <el-checkbox label="2" :disabled="!isEdit">
|
|
|
<div>单日最大报价次数</div>
|
|
|
<div style="display: flex; align-items: center">
|
|
|
- 单日代理人报价满<el-input size="small" v-model="quoteForm.dayMaxQuoteNum" :disabled="!quoteForm.isEnabled" style="width: 100px; margin: 0 20px;">
|
|
|
+ 单日代理人报价满<el-input size="small" v-model="quoteForm.dayMaxQuoteNum" :disabled="!isEdit" style="width: 100px; margin: 0 20px;">
|
|
|
<template slot="append">次</template>
|
|
|
</el-input>后,锁定代理人报价次数
|
|
|
</div>
|
|
|
</el-checkbox>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <el-checkbox :label="3">
|
|
|
+ <el-checkbox label="3" :disabled="!isEdit">
|
|
|
<div>单日单车限制</div>
|
|
|
<div style="display: flex; align-items: center">
|
|
|
- 单日代理人单车最多报价<el-input size="small" :disabled="!quoteForm.isEnabled" v-model="quoteForm.carMaxQuoteNum" style="width: 100px; margin: 0 20px;">
|
|
|
+ 单日代理人单车最多报价<el-input size="small" :disabled="!isEdit" v-model="quoteForm.carMaxQuoteNum" style="width: 100px; margin: 0 20px;">
|
|
|
<template slot="append">次</template>
|
|
|
</el-input>后,锁定代理人报价次数
|
|
|
</div>
|
|
|
@@ -150,8 +160,8 @@
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
<template slot="footer">
|
|
|
- <kt-button label="取消" size="small" type="text" @click="agentTableShow = false" />
|
|
|
- <kt-button label="确认" size="small" type="primary" @click="agentTableShow = false" />
|
|
|
+ <kt-button label="取消" size="small" type="text" @click="handleCancel" />
|
|
|
+ <kt-button label="确认" size="small" type="primary" @click="handleOk" />
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
@@ -159,7 +169,7 @@
|
|
|
|
|
|
<script>
|
|
|
import KtButton from "../../Core/KtButton.vue";
|
|
|
-import {getAgentUser, setQuoteInfo} from "../../../http/moudules/quote";
|
|
|
+import {getAgentUser, getQuoteConfigInfo, setQuoteInfo, syncQuoteInfo} from "../../../http/moudules/quote";
|
|
|
import {findTree} from "../../../http/moudules/insCompany";
|
|
|
|
|
|
export default {
|
|
|
@@ -172,6 +182,7 @@ export default {
|
|
|
menuIndex: 0, // 保险公司item下标
|
|
|
syncShow: false, // 同步设置弹框
|
|
|
quoteForm: {
|
|
|
+ id: '',
|
|
|
isEnabled: false,
|
|
|
authorize: '',
|
|
|
quoteLimit: []
|
|
|
@@ -193,11 +204,12 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
}, // 报价form规则
|
|
|
- isCheckedAll: false,
|
|
|
- checkType: '',
|
|
|
- agentTableShow: false,
|
|
|
+ isEdit: false, // 是否可编辑
|
|
|
+ checkType: '', // 全选类型
|
|
|
+ agentTableShow: false, // 控制选择代理人弹框
|
|
|
agentDataList: [],
|
|
|
- selectList: [], // 勾选的数据(格式为每页勾选的为一个数组并作为数组元素保存)
|
|
|
+ myList: [], // 记录每个保险公司接口返回的已经选好的代理人
|
|
|
+ selectList: [], // 勾选的数据
|
|
|
selectedList: [], // 勾选的数据(格式为平铺后)
|
|
|
pageList: [1], // 记录点击了的页码
|
|
|
selectedLength: 0, // 选择(包括全选后)的数据数量
|
|
|
@@ -213,6 +225,7 @@ export default {
|
|
|
this.$api.quote.getCompany().then(res => {
|
|
|
if(res.code == 200) {
|
|
|
this.leftTree = res.data
|
|
|
+ this.initQuoteDetails(res.data[0].id)
|
|
|
} else {
|
|
|
this.$message.error(res.msg)
|
|
|
}
|
|
|
@@ -235,7 +248,7 @@ export default {
|
|
|
value: that.countDetailForm.orderNumber?that.countDetailForm.orderNumber: ''
|
|
|
},
|
|
|
deptId: {
|
|
|
- value: that.countDetailForm.organization?that.countDetailForm.organization: ''
|
|
|
+ value: that.countDetailForm.organization?that.countDetailForm.organization[that.countDetailForm.organization.length-1]: ''
|
|
|
}
|
|
|
}
|
|
|
}).then(res => {
|
|
|
@@ -269,12 +282,28 @@ export default {
|
|
|
reset() {
|
|
|
this.countDetailForm = {}
|
|
|
this.pageNum = 1
|
|
|
+ this.initAgentUser()
|
|
|
},
|
|
|
// 代理人分页页数变化函数
|
|
|
handlePageNumChange(page) {
|
|
|
this.pageNum = page
|
|
|
this.initAgentUser()
|
|
|
},
|
|
|
+ // 选择代理人确认
|
|
|
+ handleOk() {
|
|
|
+ if(this.checkType === 'all') {
|
|
|
+ this.quoteForm.authorize = 0
|
|
|
+ this.selectList = []
|
|
|
+ } else {
|
|
|
+ this.selectList = [...this.selectedList]
|
|
|
+ }
|
|
|
+ this.agentTableShow = false
|
|
|
+ },
|
|
|
+ // 选择代理人取消
|
|
|
+ handleCancel() {
|
|
|
+ this.selectList = [...this.myList]
|
|
|
+ this.agentTableShow = false
|
|
|
+ },
|
|
|
// 代理选择
|
|
|
handleSelectChange(rows) {
|
|
|
if(this.checkType === 'all') {
|
|
|
@@ -313,7 +342,40 @@ export default {
|
|
|
// 保险公司切换
|
|
|
handleSelect(item, index) {
|
|
|
this.menuIndex = index
|
|
|
- this.quoteForm = {}
|
|
|
+ this.quoteForm = {
|
|
|
+ id: '',
|
|
|
+ isEnabled: false,
|
|
|
+ authorize: '',
|
|
|
+ quoteLimit: []
|
|
|
+ }
|
|
|
+ this.initQuoteDetails(item.id)
|
|
|
+ },
|
|
|
+ // 获取详情
|
|
|
+ initQuoteDetails(id) {
|
|
|
+ this.selectList = []
|
|
|
+ this.selectedList = []
|
|
|
+ this.myList = []
|
|
|
+ this.$api.quote.getQuoteConfigInfo(id).then(res => {
|
|
|
+ if(res.code === 200) {
|
|
|
+ this.quoteForm = {...res.data}
|
|
|
+ this.quoteForm.isEnabled = res.data.isEnabled?true:false
|
|
|
+ this.quoteForm.quoteLimit = []
|
|
|
+ if(res.data.orderRatio){
|
|
|
+ this.quoteForm.quoteLimit.push('1')
|
|
|
+ }
|
|
|
+ if(res.data.dayMaxQuoteNum){
|
|
|
+ this.quoteForm.quoteLimit.push('2')
|
|
|
+ }
|
|
|
+ if(res.data.carMaxQuoteNum){
|
|
|
+ this.quoteForm.quoteLimit.push('3')
|
|
|
+ }
|
|
|
+ this.selectedList = res.data.proxyList
|
|
|
+ this.selectList = [...res.data.proxyList]
|
|
|
+ this.myList = [...res.data.proxyList]
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 同步到其他
|
|
|
handleSync() {
|
|
|
@@ -321,7 +383,7 @@ export default {
|
|
|
},
|
|
|
// 编辑
|
|
|
handleEdit() {
|
|
|
-
|
|
|
+ this.isEdit = true
|
|
|
},
|
|
|
// 保存
|
|
|
handleSave() {
|
|
|
@@ -330,16 +392,16 @@ export default {
|
|
|
this.$api.quote.setQuoteInfo({
|
|
|
companyId: this.leftTree[this.menuIndex].id,
|
|
|
isEnabled: this.quoteForm.isEnabled?1:0,
|
|
|
- id: null,
|
|
|
+ id: this.quoteForm.id,
|
|
|
authorize: this.quoteForm.authorize,
|
|
|
proxyList: this.selectedList,
|
|
|
orderRatio: this.quoteForm.orderRatio,
|
|
|
dayMaxQuoteNum: this.quoteForm.dayMaxQuoteNum,
|
|
|
carMaxQuoteNum: this.quoteForm.carMaxQuoteNum
|
|
|
}).then(res => {
|
|
|
- console.log('保存', res)
|
|
|
if(res.code == 200) {
|
|
|
this.$message.success(res.msg)
|
|
|
+ this.initQuoteDetails(this.leftTree[this.menuIndex].id)
|
|
|
this.quoteForm = {}
|
|
|
} else {
|
|
|
this.$message.error(res.msg)
|
|
|
@@ -348,11 +410,28 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error('请填写或选择必要数据!')
|
|
|
}
|
|
|
+ this.isEdit = false
|
|
|
})
|
|
|
},
|
|
|
// 同步到其他确定
|
|
|
handleSubmit() {
|
|
|
-
|
|
|
+ this.$api.quote.syncQuoteInfo({
|
|
|
+ companyId: this.leftTree[this.menuIndex].id,
|
|
|
+ isEnabled: this.quoteForm.isEnabled?1:0,
|
|
|
+ id: this.quoteForm.id,
|
|
|
+ authorize: this.quoteForm.authorize,
|
|
|
+ proxyList: this.selectedList,
|
|
|
+ orderRatio: this.quoteForm.orderRatio,
|
|
|
+ dayMaxQuoteNum: this.quoteForm.dayMaxQuoteNum,
|
|
|
+ carMaxQuoteNum: this.quoteForm.carMaxQuoteNum
|
|
|
+ }).then(res => {
|
|
|
+ if(res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ this.syncShow = false
|
|
|
+ })
|
|
|
},
|
|
|
// 选择代理人
|
|
|
selectAgent() {
|
|
|
@@ -365,7 +444,7 @@ export default {
|
|
|
selectTypeChange() {
|
|
|
if(this.agentDataList.length>0) {
|
|
|
this.agentDataList.forEach(item => {
|
|
|
- this.$refs.multipleTable.toggleRowSelection(item)
|
|
|
+ this.$refs.multipleTable.toggleRowSelection(item, true)
|
|
|
})
|
|
|
}
|
|
|
if(this.checkType === 'all') {
|
|
|
@@ -382,6 +461,16 @@ export default {
|
|
|
handleBeforeUnload(event) {
|
|
|
event.preventDefault();
|
|
|
event.returnValue = '';
|
|
|
+ },
|
|
|
+ // 删除选择的代理人
|
|
|
+ handleDelete(row) {
|
|
|
+ let list = []
|
|
|
+ list = this.selectList.filter((item) => {
|
|
|
+ return item.id != row.id
|
|
|
+ })
|
|
|
+ this.selectList = [...list]
|
|
|
+ this.selectedList = [...list]
|
|
|
+ this.myList = [...list]
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|