|
|
@@ -121,8 +121,8 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="合作公司" prop="insuranceCompany">
|
|
|
- <el-cascader style="width: 100%;" v-model="agreement.insuranceCompany" :show-all-levels="false"
|
|
|
+ <el-form-item label="合作公司" prop="insuranceCompanyId">
|
|
|
+ <el-cascader style="width: 100%;" v-model="agreement.insuranceCompanyId" :show-all-levels="false"
|
|
|
:options="options" :props="optionProps" @change="handleChange" clearable></el-cascader>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -217,9 +217,9 @@
|
|
|
<el-checkbox v-for="item in productList" :label="item.id" :key="item.id"
|
|
|
@change="event => pruductChange(event, item)">{{ item.name }}</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
- <el-button type="success" :size="overSize" style="margin-left: 20px;"
|
|
|
+ <!-- <el-button type="success" :size="overSize" style="margin-left: 20px;"
|
|
|
@click="otherproductsdialogVisible = true">
|
|
|
- <i class="el-icon-s-operation"></i> 其他产品费用</el-button>
|
|
|
+ <i class="el-icon-s-operation"></i> 其他产品费用</el-button> -->
|
|
|
</div>
|
|
|
<div>
|
|
|
<el-form ref="costform" :model="costform" label-width="100px" :size="overSize">
|
|
|
@@ -1091,6 +1091,59 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
+ <el-tab-pane label="保险公司账号配置" name="inscommany">
|
|
|
+ <el-form class="demo-ruleForm wrap-scrollbar scroll-style" :model="attributionform" ref="attributionform"
|
|
|
+ label-width="130px" size="small">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="api类型:">
|
|
|
+ <el-select class="widths1" v-model="attributionform.apiType" @change="apiChange">
|
|
|
+ <el-option label="API" :value="1"></el-option>
|
|
|
+ <el-option label="python" :value="2"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <div v-if="attributionform.apiType == 2 && attributionform.fields.length > 0">
|
|
|
+ <el-col :span="24">
|
|
|
+ <div>
|
|
|
+ <h4>账号配置</h4>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="用户名:" prop="username">
|
|
|
+ <el-input v-model="attributionform.username" placeholder="请输入用户名"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="密码:" prop="password">
|
|
|
+ <el-input v-model="attributionform.password" placeholder="请输入密码"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
+ <template v-if="attributionform.fields.length > 0">
|
|
|
+ <el-col :span="24">
|
|
|
+ <div>
|
|
|
+ <h4>配置参数</h4>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8" :span="8"
|
|
|
+ v-for="(domain, index) in attributionform.fields" :key="domain.index">
|
|
|
+ <el-form-item :label="domain.label + ':'" :prop="'fields.' + index + '.value'" :rules="{
|
|
|
+ required: true, message: domain.label + '不能为空', trigger: 'blur'
|
|
|
+ }">
|
|
|
+ <el-input class="widths1" v-model="domain.value" :type="domain.type"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </template>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="授权" name="authorize">
|
|
|
+ <el-tree class="filter-tree" :data="treedata" accordion :props="defaultProps" show-checkbox node-key="id"
|
|
|
+ :filter-node-method="filterNode" :default-checked-keys="treekeys" ref="trees" @check="treechange"
|
|
|
+ :default-expand-all="expandshow">
|
|
|
+ </el-tree>
|
|
|
+ </el-tab-pane>
|
|
|
</el-tabs>
|
|
|
<!-- 底部区域 -->
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
@@ -1477,7 +1530,7 @@ export default {
|
|
|
totalSize: null,
|
|
|
queryInfo: {
|
|
|
|
|
|
- insuranceCompany: "",
|
|
|
+ insuranceCompanyId: "",
|
|
|
},
|
|
|
agreementdialogVisible: false, //控制协议对话框显示
|
|
|
otherproductsdialogVisible: false,//其他产品费用对话框显示
|
|
|
@@ -1488,6 +1541,21 @@ export default {
|
|
|
//产品list获取
|
|
|
productList: [],//产品接口数据
|
|
|
roductList1: ['车险'],//产品绑定list
|
|
|
+ treedata: [],//授权结构树
|
|
|
+ defaultProps: {//自定义参数
|
|
|
+ children: 'children',
|
|
|
+ label: 'name'
|
|
|
+ },
|
|
|
+ treekeys: [],
|
|
|
+ expandshow: false,
|
|
|
+ dept: [],//授权id数据
|
|
|
+ attributionform: {
|
|
|
+ fields: [],
|
|
|
+ apiType: "", //接口类型
|
|
|
+ templateId: "", //保险公司id
|
|
|
+ password: "",
|
|
|
+ username: "",
|
|
|
+ },
|
|
|
agreement: {
|
|
|
agreementAbbreviation: "",//协议简称
|
|
|
agreementCode: "",//协议代码
|
|
|
@@ -1498,7 +1566,7 @@ export default {
|
|
|
dockingPhone: "",//联系方式(对接人)
|
|
|
endDate: "",//协议止期
|
|
|
fileId: "",// 附件id
|
|
|
- insuranceCompany: "",//合作公司
|
|
|
+ insuranceCompanyId: "",//合作公司
|
|
|
matchType: "",//保单日期类型
|
|
|
moneyTime: 0,//结算周期
|
|
|
moneyType: "",//佣金发放方式
|
|
|
@@ -1835,9 +1903,18 @@ export default {
|
|
|
activeTabs: "scheme",
|
|
|
operType: "ADD", //'ADD','EDIT'
|
|
|
dialogTitle: "新增协议",
|
|
|
+ attributionformRules: {
|
|
|
|
|
|
+ username: [
|
|
|
+ { required: true, message: "请输入账号", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ password: [
|
|
|
+ { required: true, message: "请输入密码", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
addAgreementRules: {
|
|
|
//新增协议的表单验证规则对象
|
|
|
+
|
|
|
agreementCode: [
|
|
|
{ required: true, message: "请输入协议代码", trigger: "blur" },
|
|
|
],
|
|
|
@@ -1850,7 +1927,7 @@ export default {
|
|
|
agreementType: [
|
|
|
{ required: true, message: "请选择协议类型", trigger: "blur" },
|
|
|
],
|
|
|
- insuranceCompany: [
|
|
|
+ insuranceCompanyId: [
|
|
|
{ required: true, message: "请选择合作公司", trigger: "blur" },
|
|
|
],
|
|
|
cooperationChannels: [
|
|
|
@@ -1937,7 +2014,7 @@ export default {
|
|
|
watch: {
|
|
|
containsSubChecked(val) {
|
|
|
if (val) {
|
|
|
- this.queryInfo.insuranceCompany = "";
|
|
|
+ this.queryInfo.insuranceCompanyId = "";
|
|
|
this.findPage();
|
|
|
} else {
|
|
|
this.pageRequest.columnFilters.inscode.value = this.currentTreeNode.id;
|
|
|
@@ -2008,6 +2085,10 @@ export default {
|
|
|
this.productList = res.data;
|
|
|
})
|
|
|
localStorage.setItem('rule', JSON.stringify(this.UnderwritingRules))
|
|
|
+ this.$api.dept.findDeptTree().then((res) => {
|
|
|
+ this.treedata = res.data;
|
|
|
+ })
|
|
|
+ this.defaultattributionform = JSON.parse(JSON.stringify(this.attributionform))
|
|
|
},
|
|
|
mounted() {
|
|
|
this.findLeftTreeData();
|
|
|
@@ -2016,6 +2097,44 @@ export default {
|
|
|
this.changeTreeWidth(200); // 初始化树的宽度
|
|
|
},
|
|
|
methods: {
|
|
|
+ //请求类型change
|
|
|
+ apiChange(e) {
|
|
|
+ let params = {
|
|
|
+ insCompanyId: this.agreement.insuranceCompanyId,
|
|
|
+ apiType: e,
|
|
|
+ }
|
|
|
+ this.$api.insCompany.getPtlInsAttributionTemplate(params).then(res => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ this.attributionform.templateId = res.data.id;
|
|
|
+ this.attributionform.fields = res.data.fields;
|
|
|
+ } else {
|
|
|
+ this.attributionform.fields = [];
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //修改开关事件
|
|
|
+ isEditchange(val, id) {
|
|
|
+ this.attributionform.fields[id].isEdit = val;
|
|
|
+ },
|
|
|
+ //授权树节点过滤
|
|
|
+ filterNode(value, data) {
|
|
|
+ console.log(value, data)
|
|
|
+ if (!value) return true;
|
|
|
+ return data.name.indexOf(value) !== -1;
|
|
|
+ },
|
|
|
+ //获取选中节点
|
|
|
+ treechange(data, node) {
|
|
|
+ console.log(node)
|
|
|
+ this.dept = [];
|
|
|
+ node.checkedKeys.map(ele => {
|
|
|
+ this.dept.push(ele);
|
|
|
+ })
|
|
|
+ },
|
|
|
//编辑事件
|
|
|
uplatequery(index, row) {
|
|
|
this.agreementId = row.id;
|
|
|
@@ -2023,10 +2142,19 @@ export default {
|
|
|
this.dialogTitle = "协议编辑";
|
|
|
this.$api.insCompany.agreementId(row.id).then(res => {
|
|
|
if (res.code == '200') {
|
|
|
+ console.log(res)
|
|
|
let scheme = res.data.scheme;
|
|
|
this.agreement = res.data.agreement;
|
|
|
this.costform.scheme = scheme;
|
|
|
this.UnderwritingRules = res.data.underwritingRules;
|
|
|
+ this.attributionform = res.data.ptlAgreementAttribution;
|
|
|
+ if (res.data.dept.length > 0) {
|
|
|
+ res.data.dept.map(ele => {
|
|
|
+ this.treekeys.push(ele.deptId);
|
|
|
+ this.dept.push(ele.deptId);
|
|
|
+ return ele;
|
|
|
+ })
|
|
|
+ }
|
|
|
scheme.map(ele => {
|
|
|
this.roductList1.push(ele.productId)
|
|
|
return ele;
|
|
|
@@ -2289,8 +2417,13 @@ export default {
|
|
|
if (this.costform.scheme.length > 0) {
|
|
|
this.costform.scheme = [];
|
|
|
}
|
|
|
- // let data = localStorage.getItem('rule')
|
|
|
- // this.UnderwritingRules = JSON.parse(data)
|
|
|
+ this.attributionform = JSON.parse(JSON.stringify(this.defaultattributionform))
|
|
|
+ if (this.treekeys.length) {
|
|
|
+ this.$refs.trees.setCheckedKeys([])
|
|
|
+ this.expandshow = false;
|
|
|
+ this.parentkeys = [];
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
//获取所有机构列表Start
|
|
|
@@ -2354,7 +2487,7 @@ export default {
|
|
|
onZTreeClick: function (evt, treeId, treeNode) {
|
|
|
// 点击事件
|
|
|
this.containsSubChecked = false;
|
|
|
- this.queryInfo.insuranceCompany = treeNode.id;
|
|
|
+ this.queryInfo.insuranceCompanyId = treeNode.id;
|
|
|
this.findPage();
|
|
|
},
|
|
|
onZTreeCreated: function (ztreeObj) {
|
|
|
@@ -2408,7 +2541,7 @@ export default {
|
|
|
let parmas = {
|
|
|
pageNum: this.pageNum,
|
|
|
pageSize: this.pageSize,
|
|
|
- insuranceCompany: this.queryInfo.insuranceCompany
|
|
|
+ insuranceCompanyId: this.queryInfo.insuranceCompanyId
|
|
|
}
|
|
|
this.$api.insCompany.agreementPage(parmas).then(res => {
|
|
|
this.pageResult = res.data.content;
|
|
|
@@ -2466,7 +2599,8 @@ export default {
|
|
|
//-- formatter end--
|
|
|
// 选择合作公司Start
|
|
|
handleChange(value) {
|
|
|
- this.agreement.insuranceCompany = value[value.length - 1];
|
|
|
+ console.log(value)
|
|
|
+ this.agreement.insuranceCompanyId = value[value.length - 1];
|
|
|
this.carareaoptions = [];
|
|
|
this.rulesForm.cancity = [];
|
|
|
if (value.length == 0 || value.length == 1) {
|
|
|
@@ -2474,7 +2608,7 @@ export default {
|
|
|
for (let i = 0; i < citydata.rawCitiesData.length; i++) {
|
|
|
if (
|
|
|
citydata.rawCitiesData[i].code.substring(0, 2) ==
|
|
|
- this.agreement.insuranceCompany.substring(6, 8)
|
|
|
+ this.agreement.insuranceCompanyId.substring(6, 8)
|
|
|
) {
|
|
|
this.carareaoptions = citydata.rawCitiesData[i].sub;
|
|
|
}
|
|
|
@@ -2484,7 +2618,7 @@ export default {
|
|
|
this.$api.insCompany
|
|
|
.getInsCompanyById(value[value.length - 1])
|
|
|
.then((res) => {
|
|
|
- this.agreement.insureshort = res.data.namesimple;
|
|
|
+ this.agreement.insuranceCompany = res.data.namesimple;
|
|
|
});
|
|
|
},
|
|
|
// 选择合作公司end
|
|
|
@@ -2569,7 +2703,10 @@ export default {
|
|
|
agreement: this.agreement,
|
|
|
scheme: this.costform.scheme,
|
|
|
underwritingRules: this.UnderwritingRules,
|
|
|
+ attribution: this.attributionform,
|
|
|
+ dept: this.dept
|
|
|
}
|
|
|
+ console.log(params)
|
|
|
this.$api.insCompany.addagreement(params).then(res => {
|
|
|
if (res.code == '200') {
|
|
|
this.$message({
|
|
|
@@ -2580,13 +2717,15 @@ export default {
|
|
|
this.findPage();
|
|
|
}
|
|
|
})
|
|
|
- console.log(params)
|
|
|
} else {
|
|
|
let upparams = {
|
|
|
agreement: this.agreement,
|
|
|
scheme: this.costform.scheme,
|
|
|
underwritingRules: this.UnderwritingRules,
|
|
|
+ attribution: this.attributionform,
|
|
|
+ dept: this.dept
|
|
|
}
|
|
|
+ console.log(upparams)
|
|
|
this.$api.insCompany.updateagreement(this.agreementId, upparams).then(res => {
|
|
|
if (res.code == '200') {
|
|
|
this.$message({
|