|
|
@@ -0,0 +1,362 @@
|
|
|
+<template>
|
|
|
+ <div class="page">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6" style="padding: 20px;">
|
|
|
+ <el-button type="danger" size="small" @click="add()">新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-table size="small" :data="pageResult" height="690" border style="width: 100%" v-loading="loading"
|
|
|
+ highlight-current-row stripe
|
|
|
+ :header-cell-style="{ background: '#F2F7FC', fontWeight: '700', color: '#606266' }">
|
|
|
+ <el-table-column prop="id" label="ID" width="200" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="insCompanyId" label="保险公司" width="100" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="fields" label="配置参数" align="center" :formatter="configureformatter"></el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" width="200" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="text" @click="CloseEdit(scope.$index, scope.row)">编辑</el-button>
|
|
|
+ <el-button size="mini" type="text" style="color: #f78989;"
|
|
|
+ @click="empowerBtn(scope.$index, scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!-- 分页功能 -->
|
|
|
+ <div class="block">
|
|
|
+ <el-pagination @size-change="applyhandleSizeChange" @current-change="applyhandleCurrentChange"
|
|
|
+ :current-page="pageNum" :page-size="pageSize" :page-sizes="[10, 20, 50, 100]"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="totalSize"></el-pagination>
|
|
|
+ </div>
|
|
|
+ <el-dialog title="续保配置新增" :visible.sync="dialogVisible" width="1000px">
|
|
|
+ <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="请求类型:">
|
|
|
+ <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>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="保险公司:">
|
|
|
+ <el-select class="widths1" v-model="attributionform.insCompanyId" @change="companyChange">
|
|
|
+ <el-option v-for="(item, index) in companyselect" :key="index.id" :label="item.namesimple"
|
|
|
+ :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <div v-if="attributionform.apiType==2">
|
|
|
+ <el-col :span="24">
|
|
|
+ <div>
|
|
|
+ <h4>URL配置</h4>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" v-for="(apiitem, apiindex) in attributionform.api" :key="apiindex">
|
|
|
+ <el-form-item :label="apiitem.name + ':'">
|
|
|
+ <el-input v-model="apiitem.url" placeholder="请输入指定链接" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
+ <el-col :span="24">
|
|
|
+ <div>
|
|
|
+ <h4>配置参数</h4>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col v-for="(configureitem, configureindex) in attributionform.fields" :key="configureindex">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="字段名:">
|
|
|
+ <el-input v-model="configureitem.field" class="widths1" placeholder="请输入字段名"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="标签:">
|
|
|
+ <el-input v-model="configureitem.label" class="widths1" placeholder="标签名"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="表单类型:">
|
|
|
+ <el-radio-group v-model="configureitem.type">
|
|
|
+ <el-radio label="text"></el-radio>
|
|
|
+ <el-radio label="select"></el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="是否可修改:">
|
|
|
+ <el-switch v-model="configureitem.edit"
|
|
|
+ @change="(event) => isEditchange(event, configureindex)" class="widths1"></el-switch>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4" v-show="configureindex != 0 && show">
|
|
|
+ <el-button @click.prevent="removeDomain(configureitem)" size="small">删除</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="small" @click="configuration" v-if="show">新增配置</el-button>
|
|
|
+ <el-button size="small" @click="dialogVisible = false">取 消</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="submitForm('attributionform')">提 交</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ switchvalue: false, //开启开关
|
|
|
+ updatevalue: false, //修改开关
|
|
|
+ filterText: "",
|
|
|
+ treedata: [], //树形数据
|
|
|
+ show: true,
|
|
|
+ loading: false, //加载效果
|
|
|
+ dialogVisible: false, //归属信息弹框
|
|
|
+ empowerdialogVisible: false, //授权弹框
|
|
|
+ pageNum: 1, //页数
|
|
|
+ pageSize: 20, //条数
|
|
|
+ totalSize: null, //总数
|
|
|
+ pageResult: [], //表格数据
|
|
|
+
|
|
|
+ attributionform: {
|
|
|
+ fields: [
|
|
|
+ {
|
|
|
+ field: "",
|
|
|
+ edit: false,
|
|
|
+ label: "",
|
|
|
+ type: "",
|
|
|
+ value: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ apiType: "", //接口类型
|
|
|
+ insCompanyId: "", //保险公司id
|
|
|
+ },
|
|
|
+ pythonApi: [
|
|
|
+ {
|
|
|
+ name: "归属配置",
|
|
|
+ apiType: 1,
|
|
|
+ url: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "报价",
|
|
|
+ apiType: 2,
|
|
|
+ url: "",
|
|
|
+ }, {
|
|
|
+ name: "影像上传",
|
|
|
+ apiType: 3,
|
|
|
+ url: "",
|
|
|
+ }, {
|
|
|
+ name: "核保",
|
|
|
+ apiType: 4,
|
|
|
+ url: "",
|
|
|
+ }, {
|
|
|
+ name: "缴费查询",
|
|
|
+ apiType: 5,
|
|
|
+ url: "",
|
|
|
+ }, {
|
|
|
+ name: "保单下载",
|
|
|
+ apiType: 6,
|
|
|
+ url: "",
|
|
|
+ }, {
|
|
|
+ name: "非车险查询",
|
|
|
+ apiType: 7,
|
|
|
+ url: "",
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ pageRequest: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ columnFilters: {
|
|
|
+ parentId: {
|
|
|
+ name: "parentId",
|
|
|
+ value: "0",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ companyselect: [],
|
|
|
+ configurelist: [],
|
|
|
+ id: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.$api.insCompany.findPage(this.pageRequest).then((res) => {
|
|
|
+ this.companyselect = res.data.content;
|
|
|
+ });
|
|
|
+ this.findpage();
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ filterText(val) {
|
|
|
+ this.$refs.tree.filter(val);
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ add() {
|
|
|
+ let params = {
|
|
|
+ fields: [
|
|
|
+ {
|
|
|
+ field: "",
|
|
|
+ edit: false,
|
|
|
+ label: "",
|
|
|
+ type: "",
|
|
|
+ value: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ insCompanyId: "", //保险公司id
|
|
|
+ };
|
|
|
+ this.id = "";
|
|
|
+ this.attributionform = params;
|
|
|
+ this.show = true;
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
+ //表格参数自定义内容
|
|
|
+ configureformatter(row) {
|
|
|
+ let data = JSON.stringify(row.fields);
|
|
|
+ return data;
|
|
|
+ },
|
|
|
+ findpage() {
|
|
|
+ this.$api.insCompany
|
|
|
+ .pagebelong(this.pageNum, this.pageSize)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == "200") {
|
|
|
+ this.pageResult = res.data.content;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //删除事件
|
|
|
+ removeDomain(item) {
|
|
|
+ var index = this.attributionform.fields.indexOf(item);
|
|
|
+ if (index !== -1) {
|
|
|
+ this.attributionform.fields.splice(index, 1);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //新增配置按钮
|
|
|
+ configuration() {
|
|
|
+ this.attributionform.fields.push({
|
|
|
+ field: "",
|
|
|
+ edit: false,
|
|
|
+ label: "",
|
|
|
+ type: "",
|
|
|
+ value: "",
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //开启开关事件
|
|
|
+ isOpenchange(val) {
|
|
|
+ if (val) {
|
|
|
+ this.attributionform.isOpen = 1;
|
|
|
+ } else {
|
|
|
+ this.attributionform.isOpen = 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //修改开关事件
|
|
|
+ isEditchange(val, id) {
|
|
|
+ this.attributionform.fields[id].edit = val;
|
|
|
+ },
|
|
|
+ //获取选中节点
|
|
|
+ treechange(data, node) {
|
|
|
+ var treelist = [];
|
|
|
+ node.checkedKeys.map((ele) => {
|
|
|
+ treelist.push(ele);
|
|
|
+ });
|
|
|
+ this.treeparams.deptIds = treelist;
|
|
|
+ },
|
|
|
+ //节点过滤
|
|
|
+ filterNode(value, data) {
|
|
|
+ console.log(value, data);
|
|
|
+ if (!value) return true;
|
|
|
+ return data.name.indexOf(value) !== -1;
|
|
|
+ },
|
|
|
+ //选择保险公司获取归属模板
|
|
|
+ companyChange(e) { },
|
|
|
+ apiChange(e){
|
|
|
+ e==2? this.attributionform['api']=this.pythonApi:"";
|
|
|
+ console.log(this.attributionform)
|
|
|
+ },
|
|
|
+ //提交授权
|
|
|
+ // treesubmit() {
|
|
|
+ // if (this.treeparams.deptIds.length > 0) {
|
|
|
+ // this.$api.insCompany.authorize(this.treeparams).then((res) => {
|
|
|
+ // if (res.code == "200") {
|
|
|
+ // this.$message({ message: "保存成功", type: "success" });
|
|
|
+ // this.empowerdialogVisible = false;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // this.$message({ message: "未选择归属机构", type: "warning" });
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ //提交表单
|
|
|
+ submitForm(formName) {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.id) {
|
|
|
+ this.$api.insCompany
|
|
|
+ .updateTemplate(this.id, this.attributionform)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == "200") {
|
|
|
+ this.$message({ message: "修改成功", type: "success" });
|
|
|
+ this.findpage();
|
|
|
+ this.dialogVisible = false;
|
|
|
+ } else {
|
|
|
+ this.$message({ message: res.msg, type: "warning" });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$api.insCompany
|
|
|
+ .addbelong(this.attributionform)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == "200") {
|
|
|
+ this.$message({ message: "新增成功", type: "success" });
|
|
|
+ this.findpage();
|
|
|
+ this.dialogVisible = false;
|
|
|
+ } else {
|
|
|
+ this.$message({ message: res.msg, type: "success" });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //删除操作
|
|
|
+ empowerBtn(index, row) {
|
|
|
+ this.$api.insCompany.deleteTemplate(row.id).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.code == "200") {
|
|
|
+ this.findpage();
|
|
|
+ this.$message({ message: res.msg, type: "success" });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //编辑操作
|
|
|
+ CloseEdit(index, row) {
|
|
|
+ (this.show = false), (this.attributionform = row);
|
|
|
+ this.id = row.id;
|
|
|
+ this.dialogVisible = true;
|
|
|
+ if (row.isOpen == 1) {
|
|
|
+ this.switchvalue = true;
|
|
|
+ } else {
|
|
|
+ this.switchvalue = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 设置每页条数
|
|
|
+ applyhandleSizeChange(val) {
|
|
|
+ this.pageSize = val;
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.pageRequest.pageNum = 1;
|
|
|
+ this.pageRequest.pageSize = val;
|
|
|
+ this.findPage();
|
|
|
+ },
|
|
|
+ // 当前页
|
|
|
+ // 当前页 当前页
|
|
|
+ applyhandleCurrentChange(val) {
|
|
|
+ this.pageNum = val;
|
|
|
+ this.pageRequest.pageNum = val;
|
|
|
+ this.findPage();
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style scoped >
|
|
|
+.widths1 {
|
|
|
+ width: 250px;
|
|
|
+}
|
|
|
+</style>
|