|
|
@@ -1,12 +1,305 @@
|
|
|
<!-- 模板区域 -->
|
|
|
<template>
|
|
|
<div>
|
|
|
- <PageMain>
|
|
|
- </PageMain>
|
|
|
+ <PageMain class="vh100">
|
|
|
+ <el-row :gutter="20" class="vh100">
|
|
|
+ <el-col :span="5" class="vh100">
|
|
|
+ <el-input v-model="filterText" prefix-icon="search"></el-input>
|
|
|
+ <div class="company">
|
|
|
+ <div class="companyItem" :class="{'active': filterIndex === index}" v-for="(item, index) in filterChange" @click="handleClick(item, index)">
|
|
|
+ {{ item?.nameSimple }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-divider direction="vertical" class="vh100"></el-divider>
|
|
|
+ <el-col :span="18" class="vh100">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="20">
|
|
|
+ <h4>租户功能配置</h4>
|
|
|
+ <p>配置租户的系统功能,报价功能,订单功能。</p>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-button type="primary" @click="handleEdit">编辑</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-divider style="width: 100%"></el-divider>
|
|
|
+ <el-descriptions title="系统信息配置">
|
|
|
+ <el-descriptions-item>
|
|
|
+ <el-form :model="functionForm" :rules="functionRules" ref="functionRef" label-width="200" label-position="left">
|
|
|
+ <el-form-item label="支持报价的保司" prop="quoteCompany">
|
|
|
+ <el-radio-group style="width: 100%" v-model="functionForm.quoteCompany">
|
|
|
+ <el-radio :value="1">全部保险公司</el-radio>
|
|
|
+ <el-radio :value="2">部分保险公司</el-radio>
|
|
|
+ <el-button v-if="functionForm.quoteCompany == 2" link type="primary" @click="select" icon="CirclePlus">选择保险公司</el-button>
|
|
|
+ </el-radio-group>
|
|
|
+ <div v-if="functionForm.quoteCompany == 2" style="display: flex; justify-content: flex-start">
|
|
|
+ <div style="display: flex; align-items: center; background: #cccccc; padding: 2px 10px; border-radius: 3px; margin-right: 10px" v-for="(item, index) in companySelected">{{ item.nameSimple }}
|
|
|
+ <el-icon style="cursor: pointer; margin-left: 20px;" @click="handleDelete(item, index)"><Close /></el-icon></div>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="报价/出单方式" prop="orderMode">
|
|
|
+ <el-radio-group v-model="functionForm.orderMode">
|
|
|
+ <el-radio :value="1">协议报价/出单</el-radio>
|
|
|
+ <el-radio :value="2">账号报价/出单</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="订单审核机构" prop="orderAuditDept">
|
|
|
+ <el-radio-group style="width: 100%" v-model="functionForm.orderAuditDept">
|
|
|
+ <el-radio :value="1">业务员归属机构</el-radio>
|
|
|
+ <el-radio :value="2">协议/账号归属机构</el-radio>
|
|
|
+ <el-radio :value="3">指定机构</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+<!-- <el-cascader v-if="functionForm.orderAuditDept == 3" v-model="functionForm.orderAuditDeptList" :props="optionProps"></el-cascader>-->
|
|
|
+ <div>
|
|
|
+ <el-select style="width: 200px" v-if="functionForm.orderAuditDept == 3" v-model="functionForm.orderAuditDeptList">
|
|
|
+ <el-option v-for="item in institutionList" :value="item.id" :label="item.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="业务员审核机构" prop="salesmanAuditDept">
|
|
|
+ <el-radio-group style="width: 100%" v-model="functionForm.salesmanAuditDept">
|
|
|
+ <el-radio :value="1">业务员归属机构</el-radio>
|
|
|
+ <el-radio :value="2">指定机构</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+<!-- <el-cascader v-if="functionForm.salesmanAuditDept == 2" v-model="functionForm.salesmanAuditDeptList" :props="optionProps"></el-cascader>-->
|
|
|
+ <el-select style="width: 200px" v-if="functionForm.salesmanAuditDept == 2" v-model="functionForm.salesmanAuditDeptList">
|
|
|
+ <el-option v-for="item in institutionList" :value="item.id" :label="item.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="业务员提现账号审核机构" prop="salesmanWithdrawAccountAuditDept">
|
|
|
+ <el-radio-group style="width: 100%" v-model="functionForm.salesmanWithdrawAccountAuditDept">
|
|
|
+ <el-radio :value="1">业务员归属机构</el-radio>
|
|
|
+ <el-radio :value="2">指定机构</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+<!-- <el-cascader v-if="functionForm.salesmanWithdrawAccountAuditDept == 2" v-model="functionForm.salesmanWithdrawAccountAuditDeptList" :props="optionProps"></el-cascader>-->
|
|
|
+ <el-select style="width: 200px" v-if="functionForm.salesmanWithdrawAccountAuditDept == 2" v-model="functionForm.salesmanWithdrawAccountAuditDeptList">
|
|
|
+ <el-option v-for="item in institutionList" :value="item.id" :label="item.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="业务员提现申请付款审核机构" prop="salesmanWithdrawPaymentAuditDept">
|
|
|
+ <el-radio-group style="width: 100%" v-model="functionForm.salesmanWithdrawPaymentAuditDept">
|
|
|
+ <el-radio :value="1">业务员归属机构</el-radio>
|
|
|
+ <el-radio :value="2">指定机构</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+<!-- <el-cascader v-if="functionForm.salesmanWithdrawPaymentAuditDept == 2" v-model="functionForm.salesmanWithdrawPaymentAuditDeptList" :props="optionProps"></el-cascader>-->
|
|
|
+ <el-select style="width: 200px" v-if="functionForm.salesmanWithdrawPaymentAuditDept == 2" v-model="functionForm.salesmanWithdrawPaymentAuditDeptList">
|
|
|
+ <el-option v-for="item in institutionList" :value="item.id" :label="item.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </PageMain>
|
|
|
+ <div class="footer">
|
|
|
+ <el-button plain type="primary" @click="handleCancel">取消</el-button>
|
|
|
+ <el-button type="primary" @click="handleComfirm">保存</el-button>
|
|
|
+ </div>
|
|
|
+ <el-dialog
|
|
|
+ v-model="companyShow"
|
|
|
+ title="选择保险公司"
|
|
|
+ width="600"
|
|
|
+ >
|
|
|
+ <companys ref="companyRef" @close="handleClose"></companys>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
- </template>
|
|
|
+</template>
|
|
|
|
|
|
- <!-- 行为区域 -->
|
|
|
- <script lang='ts' setup>
|
|
|
- </script>
|
|
|
- <!-- 样式区域 -->
|
|
|
+<!-- 行为区域 -->
|
|
|
+<script lang='ts' setup>
|
|
|
+import { FormInstance } from 'element-plus'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
+import api from '@/api'
|
|
|
+import companys from './modules/companySelect.vue'
|
|
|
+
|
|
|
+const functionRef = ref<FormInstance>()
|
|
|
+const companyRef = ref(null)
|
|
|
+
|
|
|
+// 保司相关数据
|
|
|
+// 保司查询条件
|
|
|
+let filterText = ref('')
|
|
|
+let company = ref([])
|
|
|
+let filterIndex = ref(0)
|
|
|
+let companyId = ref('')
|
|
|
+const filterChange = computed(() => {
|
|
|
+ return company.value.filter(a => a.nameSimple.includes(filterText.value))
|
|
|
+})
|
|
|
+const handleClick = (item, index) => {
|
|
|
+ filterIndex.value = index
|
|
|
+ companyId.value = item.id
|
|
|
+ console.log(11111, index)
|
|
|
+ handleCancel()
|
|
|
+}
|
|
|
+// 保司
|
|
|
+const initCompany = () => {
|
|
|
+ api.configurate.liveCompanyList().then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ company.value = res.data
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 机构
|
|
|
+let institutionList = ref([])
|
|
|
+const initInstitution = () => {
|
|
|
+ let code = localStorage.getItem('login_system')
|
|
|
+ api.configurate.getDeptListBySystemCode(code).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ institutionList.value = res.data
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const handleEdit = () => {
|
|
|
+ return api.configurate.getBusPerms({
|
|
|
+ systemCode: localStorage.getItem('login_system'),
|
|
|
+ companyId: companyId.value?companyId.value:filterChange.value[0].id
|
|
|
+ }).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ functionForm.value = res.data
|
|
|
+ functionForm.value.orderAuditDeptList = functionForm.value.orderAuditDeptList[0]
|
|
|
+ functionForm.value.salesmanAuditDeptList = functionForm.value.salesmanAuditDeptList[0]
|
|
|
+ functionForm.value.salesmanWithdrawAccountAuditDeptList = functionForm.value.salesmanWithdrawAccountAuditDeptList[0]
|
|
|
+ functionForm.value.salesmanWithdrawPaymentAuditDeptList = functionForm.value.salesmanWithdrawPaymentAuditDeptList[0]
|
|
|
+ if(functionForm.value.quoteCompanyList.length > 0) {
|
|
|
+ companySelected.value = functionForm.value.quoteCompanyList.map(a => {
|
|
|
+ let obj = company.value.find(b => b.id === a)
|
|
|
+ return obj || null
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// form表单
|
|
|
+let functionForm = ref({
|
|
|
+ companyId: '',
|
|
|
+ systemCode: '',
|
|
|
+ quoteCompany: null,
|
|
|
+ quoteCompanyList: [],
|
|
|
+ orderMode: null,
|
|
|
+ orderAuditDept: null,
|
|
|
+ orderAuditDeptList: '',
|
|
|
+ salesmanAuditDept: null,
|
|
|
+ salesmanAuditDeptList: '',
|
|
|
+ salesmanWithdrawAccountAuditDept: null,
|
|
|
+ salesmanWithdrawAccountAuditDeptList: '',
|
|
|
+ salesmanWithdrawPaymentAuditDept: null,
|
|
|
+ salesmanWithdrawPaymentAuditDeptList: ''
|
|
|
+})
|
|
|
+const functionRules = {
|
|
|
+ a: [
|
|
|
+ { }
|
|
|
+ ]
|
|
|
+}
|
|
|
+const optionProps = {
|
|
|
+ value: 'areaCode',
|
|
|
+ label: 'areaCname',
|
|
|
+ children: 'children'
|
|
|
+}
|
|
|
+
|
|
|
+// 选择保险公司弹框
|
|
|
+let companyShow = ref(false)
|
|
|
+let companySelected = ref([])
|
|
|
+const select = () => {
|
|
|
+ companyShow.value = true
|
|
|
+ nextTick(() => {
|
|
|
+ companyRef.value.initEditData(companySelected.value)
|
|
|
+ })
|
|
|
+}
|
|
|
+const handleDelete = (item, index) => {
|
|
|
+ companySelected.value.splice(index, 1)
|
|
|
+}
|
|
|
+const handleClose = (data) => {
|
|
|
+ companyShow.value = false
|
|
|
+ if(data && data.length > 0) {
|
|
|
+ companySelected.value = JSON.parse(JSON.stringify(data))
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//取消
|
|
|
+const handleCancel = () => {
|
|
|
+ functionForm.value = {
|
|
|
+ companyId: '',
|
|
|
+ systemCode: '',
|
|
|
+ quoteCompany: null,
|
|
|
+ quoteCompanyList: [],
|
|
|
+ orderMode: null,
|
|
|
+ orderAuditDept: null,
|
|
|
+ orderAuditDeptList: '',
|
|
|
+ salesmanAuditDept: null,
|
|
|
+ salesmanAuditDeptList: '',
|
|
|
+ salesmanWithdrawAccountAuditDept: null,
|
|
|
+ salesmanWithdrawAccountAuditDeptList: '',
|
|
|
+ salesmanWithdrawPaymentAuditDept: null,
|
|
|
+ salesmanWithdrawPaymentAuditDeptList: ''
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 保存
|
|
|
+const handleComfirm = () => {
|
|
|
+ let formData = {...functionForm.value}
|
|
|
+ formData.companyId = companyId.value?companyId.value:filterChange.value[0].id
|
|
|
+ formData.systemCode = localStorage.getItem('login_system')
|
|
|
+ if(companySelected.value.length > 0) {
|
|
|
+ formData.quoteCompanyList = companySelected.value.map(a => {
|
|
|
+ return a.id
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ formData.quoteCompanyList = []
|
|
|
+ }
|
|
|
+ formData.orderAuditDeptList = formData.orderAuditDeptList?[formData.orderAuditDeptList]:[]
|
|
|
+ formData.salesmanAuditDeptList = formData.salesmanAuditDeptList?[formData.salesmanAuditDeptList]:[]
|
|
|
+ formData.salesmanWithdrawAccountAuditDeptList = formData.salesmanWithdrawAccountAuditDeptList?[formData.salesmanWithdrawAccountAuditDeptList]:[]
|
|
|
+ formData.salesmanWithdrawPaymentAuditDeptList = formData.salesmanWithdrawPaymentAuditDeptList?[formData.salesmanWithdrawPaymentAuditDeptList]:[]
|
|
|
+ api.configurate.saveBusPerms({...formData}).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ ElMessage.success(res.msg)
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ initCompany()
|
|
|
+ initInstitution()
|
|
|
+})
|
|
|
+
|
|
|
+</script>
|
|
|
+<!-- 样式区域 -->
|
|
|
+<style scoped lang="scss">
|
|
|
+ .company{
|
|
|
+ height: calc(100% - 60px);
|
|
|
+ .companyItem{
|
|
|
+ width: 100%;
|
|
|
+ padding: 10px 15px;
|
|
|
+ margin: 10px 0;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover{
|
|
|
+ background: #F4FAFF;
|
|
|
+ border-radius: 3px 0 0 3px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .active{
|
|
|
+ background: #F4FAFF;
|
|
|
+ border-radius: 3px 0 0 3px;
|
|
|
+ border-right: 1px solid #0083FF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .footer{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+</style>
|