Просмотр исходного кода

续保配置和渠道模版配置

@dongkboy 3 лет назад
Родитель
Сommit
a88a2bbe8f
3 измененных файлов с 456 добавлено и 119 удалено
  1. 30 0
      src/http/moudules/insCompany.js
  2. 320 0
      src/views/Sys/CompanyTemplate.vue
  3. 106 119
      src/views/Sys/Continuousconfiguration.vue

+ 30 - 0
src/http/moudules/insCompany.js

@@ -132,4 +132,34 @@ export const deleterenewal = (id) => {
         url: '/order/renewal/' + id,
         url: '/order/renewal/' + id,
         method: "delete",
         method: "delete",
     })
     })
+}
+//分页查询模版信息
+export const queryTemplate = (pageNum, pageSize) => {
+    return axios({
+        url: '/esm/attributionTemplate?pageNum=' + pageNum + '&pageSize=' + pageSize,
+        method: "get",
+    })
+}
+//提交模版信息
+export const addTemplate = (data) => {
+    return axios({
+        url: '/esm/attributionTemplate',
+        method: "post",
+        data
+    })
+}
+//修改模版信息
+export const updateTemplate = (id, data) => {
+    return axios({
+        url: '/esm/attributionTemplate/' + id,
+        method: "put",
+        data
+    })
+}
+//删除模版信息
+export const deleteTemplate = (id) => {
+    return axios({
+        url: '/esm/attributionTemplate/' + id,
+        method: "delete",
+    })
 }
 }

+ 320 - 0
src/views/Sys/CompanyTemplate.vue

@@ -0,0 +1,320 @@
+<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="10">
+                        <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>
+                    <!-- <el-col :span="10">
+                        <el-form-item label="保险公司简称:">
+                            <el-input v-model="attributionform.namesimple" class="widths1" placeholder="填写公司简称"></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="10">
+                        <el-form-item label="续保请求url:">
+                            <el-input v-model="attributionform.url" style="width: 100%;" placeholder="填写续保链接"></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="10">
+                        <el-form-item label="是否开启:">
+                            <el-switch v-model="switchvalue" @change="isOpenchange" class="widths1"></el-switch>
+                        </el-form-item>
+                    </el-col> -->
+                    <el-col :span="24">
+                        <div>
+                            <h4>配置参数</h4>
+                        </div>
+                    </el-col>
+                    <el-col v-for="(configureitem, configureindex) in attributionform.fields" :key="configureindex">
+                        <el-col :span="10">
+                            <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="10">
+                            <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: "",
+                    },
+                ],
+                insCompanyId: "", //保险公司id
+            },
+            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.attributionform = params;
+            this.show=true;
+            this.dialogVisible = true;
+        },
+        //表格参数自定义内容
+        configureformatter(row) {
+            let data = JSON.stringify(row.fields);
+            return data;
+        },
+        findpage() {
+            this.$api.insCompany
+                .queryTemplate(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) { },
+        //提交授权
+        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
+                            .addTemplate(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) {
+            console.log(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>

+ 106 - 119
src/views/Sys/Continuousconfiguration.vue

@@ -1,52 +1,28 @@
 <template>
 <template>
     <div class="page">
     <div class="page">
-        <el-form :inline="true" :model="formInline" class="demo-form-inline" size="small" label-width="130px"
-            style="text-align:center;">
-            <el-row>
-                <el-col :span="6">
-                    <el-form-item label="车牌号">
-                        <el-input v-model="formInline.licenseNo" placeholder="请输入车牌号" class="widths"></el-input>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="6">
-                    <el-form-item label="车架号">
-                        <el-input v-model="formInline.frameNo" placeholder="请输入车架号" class="widths"></el-input>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="6">
-                    <el-form-item label="订单状态">
-                        <el-select v-model="formInline.orderstatus" class="widths">
-                            <el-option label="待继续" value="0"></el-option>
-                            <el-option label="已核保待缴费" value="5"></el-option>
-                            <el-option label="已承保" value="7"></el-option>
-                            <el-option label="已关闭" value="99"></el-option>
-
-                        </el-select>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="6">
-                    <el-button type="primary" size="small">查询</el-button>
-                    <el-button type="danger" size="small" @click="dialogVisible = true">新增</el-button>
-                </el-col>
-            </el-row>
-        </el-form>
+        <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"
         <el-table size="small" :data="pageResult" height="690" border style="width: 100%" v-loading="loading"
             highlight-current-row stripe
             highlight-current-row stripe
             :header-cell-style="{ background: '#F2F7FC', fontWeight: '700', color: '#606266' }">
             :header-cell-style="{ background: '#F2F7FC', fontWeight: '700', color: '#606266' }">
-            <el-table-column prop="companyId" label="ID" width="300" align="center"></el-table-column>
+            <el-table-column prop="companyId" label="ID" width="200" align="center"></el-table-column>
             <el-table-column prop="namesimple" label="保险公司" width="100" align="center"></el-table-column>
             <el-table-column prop="namesimple" label="保险公司" width="100" align="center"></el-table-column>
-            <el-table-column prop="url" label="地址" align="center" width="150"></el-table-column>
+            <el-table-column prop="url" label="地址" align="center" width="300"></el-table-column>
             <el-table-column prop="isOpen" label="状态" align="center" width="200">
             <el-table-column prop="isOpen" label="状态" align="center" width="200">
                 <template slot-scope="scope">
                 <template slot-scope="scope">
                     <el-tag v-if="(scope.row.isOpen == '1')">开启</el-tag>
                     <el-tag v-if="(scope.row.isOpen == '1')">开启</el-tag>
                     <el-tag v-if="(scope.row.isOpen == '0')">关闭</el-tag>
                     <el-tag v-if="(scope.row.isOpen == '0')">关闭</el-tag>
                 </template>
                 </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column prop="configure" label="配置参数" align="center" width="200"></el-table-column>
-            <el-table-column label="操作" align="center" min-width="300" fixed="right">
+            <el-table-column prop="configure" label="配置参数" align="center" :formatter="configureformatter"></el-table-column>
+            <el-table-column label="操作" align="center" width="200" fixed="right">
                 <template slot-scope="scope">
                 <template slot-scope="scope">
                     <el-button size="mini" type="text" @click="CloseEdit(scope.$index, scope.row)">编辑</el-button>
                     <el-button size="mini" type="text" @click="CloseEdit(scope.$index, scope.row)">编辑</el-button>
-                    <el-button size="mini" type="text" @click="empowerBtn(scope.$index, scope.row)">授权</el-button>
+                    <el-button size="mini" type="text" style="color: #f78989;"
+                        @click="empowerBtn(scope.$index, scope.row)">删除</el-button>
                 </template>
                 </template>
             </el-table-column>
             </el-table-column>
         </el-table>
         </el-table>
@@ -57,8 +33,8 @@
                 layout="total, sizes, prev, pager, next, jumper" :total="totalSize"></el-pagination>
                 layout="total, sizes, prev, pager, next, jumper" :total="totalSize"></el-pagination>
         </div>
         </div>
         <el-dialog title="续保配置新增" :visible.sync="dialogVisible" width="1000px">
         <el-dialog title="续保配置新增" :visible.sync="dialogVisible" width="1000px">
-            <el-form class="demo-ruleForm" :model="attributionform" ref="attributionform" label-width="130px" size="small"
-                style="margin-top:30px;">
+            <el-form class="demo-ruleForm wrap-scrollbar scroll-style" :model="attributionform" ref="attributionform"
+                label-width="130px" size="small" style=" ">
                 <el-row>
                 <el-row>
                     <el-col :span="10">
                     <el-col :span="10">
                         <el-form-item label="保险公司:">
                         <el-form-item label="保险公司:">
@@ -99,43 +75,29 @@
                         </el-col>
                         </el-col>
                         <el-col :span="10">
                         <el-col :span="10">
                             <el-form-item label="表单类型:">
                             <el-form-item label="表单类型:">
-                                <!-- <el-input v-model="configureitem.type" class="widths1" placeholder="表单类型"></el-input> -->
                                 <el-radio-group v-model="configureitem.type">
                                 <el-radio-group v-model="configureitem.type">
-                                    <el-radio label="input"></el-radio>
+                                    <el-radio label="text"></el-radio>
                                     <el-radio label="select"></el-radio>
                                     <el-radio label="select"></el-radio>
                                 </el-radio-group>
                                 </el-radio-group>
                             </el-form-item>
                             </el-form-item>
                             <el-form-item label="是否可修改:">
                             <el-form-item label="是否可修改:">
-                                <el-switch v-model="updatevalue" @change="(event) => isEditchange(event, configureindex)"
-                                    class="widths1"></el-switch>
+                                <el-switch v-model="configureitem.edit"
+                                    @change="(event) => isEditchange(event, configureindex)" class="widths1"></el-switch>
                             </el-form-item>
                             </el-form-item>
                         </el-col>
                         </el-col>
-                        <el-col :span="4" v-show="configureindex != 0">
+                        <el-col :span="4" v-show="configureindex != 0 && show">
                             <el-button @click.prevent="removeDomain(configureitem)" size="small">删除</el-button>
                             <el-button @click.prevent="removeDomain(configureitem)" size="small">删除</el-button>
                         </el-col>
                         </el-col>
-
                     </el-col>
                     </el-col>
                 </el-row>
                 </el-row>
             </el-form>
             </el-form>
             <span slot="footer" class="dialog-footer">
             <span slot="footer" class="dialog-footer">
-                <el-button size="small" @click="configuration">新增配置</el-button>
+                <el-button size="small" @click="configuration" v-if="show">新增配置</el-button>
                 <el-button size="small" @click="dialogVisible = false">取 消</el-button>
                 <el-button size="small" @click="dialogVisible = false">取 消</el-button>
                 <el-button size="small" type="primary" @click="submitForm('attributionform')">提 交</el-button>
                 <el-button size="small" type="primary" @click="submitForm('attributionform')">提 交</el-button>
             </span>
             </span>
         </el-dialog>
         </el-dialog>
-        <el-dialog title="归属授权" :visible.sync="empowerdialogVisible" width="50vw">
-            <div style=" padding:20px;max-height: 500px; overflow-y: auto;">
-                <el-input placeholder="输入关键字进行过滤" v-model="filterText" style="margin-bottom:20px;">
-                </el-input>
-                <el-tree class="filter-tree" :data="treedata" accordion :props="defaultProps" show-checkbox node-key="id"
-                    :filter-node-method="filterNode" ref="tree" @check="treechange">
-                </el-tree>
-            </div>
-            <span slot="footer" class="dialog-footer">
-                <el-button size="mini" @click="empowerdialogVisible = false">取 消</el-button>
-                <el-button size="mini" type="primary" @click="treesubmit()">保 存</el-button>
-            </span>
-        </el-dialog>
+
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
@@ -146,10 +108,7 @@ export default {
             updatevalue: false,//修改开关
             updatevalue: false,//修改开关
             filterText: '',
             filterText: '',
             treedata: [],//树形数据
             treedata: [],//树形数据
-            defaultProps: {
-                children: 'children',
-                label: 'name'
-            },
+            show: true,
             loading: false,//加载效果
             loading: false,//加载效果
             dialogVisible: false,//归属信息弹框
             dialogVisible: false,//归属信息弹框
             empowerdialogVisible: false,//授权弹框
             empowerdialogVisible: false,//授权弹框
@@ -163,15 +122,16 @@ export default {
                 orderstatus: "",//订单状态
                 orderstatus: "",//订单状态
                 monthvalue: "",//日期
                 monthvalue: "",//日期
             },
             },
+
             attributionform: {
             attributionform: {
                 configure: [{
                 configure: [{
                     field: "",
                     field: "",
-                    isEdit: 0,
+                    edit: false,
                     label: "",
                     label: "",
                     type: "",
                     type: "",
                     value: "",
                     value: "",
                 }],
                 }],
-                insCompanyId: "",//保险公司id
+                companyId: "",//保险公司id
                 isOpen: 0,//是/否开启
                 isOpen: 0,//是/否开启
                 namesimple: "",//保险公司简称
                 namesimple: "",//保险公司简称
                 url: "",//续保请求url
                 url: "",//续保请求url
@@ -189,23 +149,15 @@ export default {
             },
             },
             companyselect: [],
             companyselect: [],
             configurelist: [],
             configurelist: [],
-            treeparams: {
-                deptIds: [],
-                attributionId: "",
-                insCompanyId: "",
-            }
+            id: "",
+
         }
         }
     },
     },
     created() {
     created() {
         this.$api.insCompany.findPage(this.pageRequest).then((res) => {
         this.$api.insCompany.findPage(this.pageRequest).then((res) => {
             this.companyselect = res.data.content;
             this.companyselect = res.data.content;
         })
         })
-        this.$api.insCompany.queryrenewal(this.pageNum, this.pageSize).then((res) => {
-            console.log(res)
-            if (res.code == '200') {
-                this.pageResult = res.data.content;
-            }
-        })
+        this.findpage();
 
 
 
 
     },
     },
@@ -214,7 +166,37 @@ export default {
             this.$refs.tree.filter(val);
             this.$refs.tree.filter(val);
         }
         }
     },
     },
+
     methods: {
     methods: {
+        add() {
+            let params = {
+                configure: [{
+                    field: "",
+                    edit: false,
+                    label: "",
+                    type: "",
+                    value: "",
+                }],
+                companyId: "",//保险公司id
+                isOpen: 0,//是/否开启
+                namesimple: "",//保险公司简称
+                url: "",//续保请求url
+            }
+            this.attributionform = params;
+            this.dialogVisible = true;
+        },
+        //表格参数自定义内容
+        configureformatter(row) {
+            let data = JSON.stringify(row.configure)
+            return data;
+        },
+        findpage() {
+            this.$api.insCompany.queryrenewal(this.pageNum, this.pageSize).then((res) => {
+                if (res.code == '200') {
+                    this.pageResult = res.data.content;
+                }
+            })
+        },
         //删除事件
         //删除事件
         removeDomain(item) {
         removeDomain(item) {
             var index = this.attributionform.configure.indexOf(item)
             var index = this.attributionform.configure.indexOf(item)
@@ -226,11 +208,12 @@ export default {
         configuration() {
         configuration() {
             this.attributionform.configure.push({
             this.attributionform.configure.push({
                 field: "",
                 field: "",
-                isEdit: 0,
+                edit: false,
                 label: "",
                 label: "",
                 type: "",
                 type: "",
                 value: "",
                 value: "",
             })
             })
+
         },
         },
         //开启开关事件
         //开启开关事件
         isOpenchange(val) {
         isOpenchange(val) {
@@ -242,12 +225,7 @@ export default {
         },
         },
         //修改开关事件
         //修改开关事件
         isEditchange(val, id) {
         isEditchange(val, id) {
-            if (val) {
-                this.attributionform.configure[id].isEdit = 1;
-            } else {
-                this.attributionform.configure[id].isEdit = 0;
-            }
-
+            this.attributionform.configure[id].edit = val;
         },
         },
         //获取选中节点
         //获取选中节点
         treechange(data, node) {
         treechange(data, node) {
@@ -265,23 +243,6 @@ export default {
         },
         },
         //选择保险公司获取归属模板
         //选择保险公司获取归属模板
         companyChange(e) {
         companyChange(e) {
-            console.log(e)
-            // this.$api.insCompany.attributionTemplate(e).then((res) => {
-            //     if (res.data) {
-            //         this.configurelist = JSON.parse(res.data.configure);
-            //         this.configurelist.map((ele, index) => {
-            //             this.attributionform.configure.push({
-            //                 field: ele.field,
-            //                 isEdit: ele.isEdit,
-            //                 label: ele.label,
-            //                 type: ele.type,
-            //                 value: "",
-            //             });
-            //         })
-            //     } else {
-            //         this.$message({ message: "暂无信息", type: "warning" });
-            //     }
-            // })
         },
         },
         //提交授权
         //提交授权
         treesubmit() {
         treesubmit() {
@@ -293,36 +254,62 @@ export default {
                     }
                     }
                 })
                 })
             } else {
             } else {
-                this.$message({ message: "未选择归属机构", type: "warning" }); attribution
+                this.$message({ message: "未选择归属机构", type: "warning" });
             }
             }
         },
         },
         //提交表单
         //提交表单
         submitForm(formName) {
         submitForm(formName) {
             this.$refs[formName].validate((valid) => {
             this.$refs[formName].validate((valid) => {
                 if (valid) {
                 if (valid) {
-                    console.log(this.attributionform)
+                    if (this.id) {
+
+                        this.$api.insCompany.qudaterenewal(this.id, this.attributionform).then(res => {
+                            if (res.code = "200") {
+                                this.$message({ message: "修改成功", type: "success" });
+                                this.findpage();
+                                this.dialogVisible = false;
+                            }
+                        })
+                    } else {
+                        this.$api.insCompany.addrenewal(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) {
         empowerBtn(index, row) {
-            this.empowerdialogVisible = true;
-            this.treeparams.attributionId = row.id;
-            this.treeparams.insCompanyId = row.insCompanyId;
+            this.$api.insCompany.deleterenewal(row.id).then(res => {
+                console.log(res)
+                if (res.code == '200') {
+                    this.findpage();
+                    this.$message({ message: res.msg, type: "success" });
+                }
+            })
+
         },
         },
         //编辑操作 
         //编辑操作 
         CloseEdit(index, row) {
         CloseEdit(index, row) {
-            let fileslist = JSON.parse(row.configure);
-            this.attributionform = {
-                configure: fileslist,
-                id: row.id,
-                insCompanyId: row.insCompanyId,
-                password: row.password,
-                username: row.username,
-            };
+            this.show = false,
+                this.attributionform = row;
+            this.id = row.id;
             this.dialogVisible = true;
             this.dialogVisible = true;
+            if (row.isOpen == 1) {
+                this.switchvalue = true;
+            } else {
+                this.switchvalue = false;
+            }
+
         },
         },
         // 设置每页条数
         // 设置每页条数
         applyhandleSizeChange(val) {
         applyhandleSizeChange(val) {
@@ -342,14 +329,14 @@ export default {
     }
     }
 }
 }
 </script>
 </script>
-<style>
-.saomazhifucodeClass .el-dialog__body,
-.saomazhifucodeClass .el-dialog__header {
-    padding: 0;
-}
-</style>
-<style scoped>
+<style scoped >
 .widths1 {
 .widths1 {
     width: 250px;
     width: 250px;
 }
 }
+
+.scroll-style {
+    margin-top: 30px;
+    height: 400px;
+    overflow-y: scroll;
+}
 </style>
 </style>