fan 2 vuotta sitten
vanhempi
commit
1f41deb9e4

+ 171 - 85
public/static/views/incomeTemplateExcel.html

@@ -59,14 +59,7 @@
 
 <body style="background: #fff;">
 <div class="layui-inline" id="monthSelect" style="width: 100%">
-    <div class="layui-input-inline">
-        <form>
-
-        </form>
-    </div>
-    <div style="float: right;padding-right: 10px" id="shareBtn">
-        <button id="share" class="btn btn-primary" style="padding:3px 6px;font-size: 18px;margin-right: 10px;width: 100px">分享</button>
-    </div>
+    <div style="float: right;padding-right: 10px" id="topBtn"></div>
 </div>
 <div style="height:90%;width: 100%;">
     <div id="luckysheet" style="width:100%;height:100%">
@@ -100,9 +93,31 @@
     var toolBar = '';
     var type = '';
     var emptyExcel = false;
+    var showToolBar = true;
     $(function () {
         userId = JSON.parse(window.top.sessionStorage.userInfo).loginNo
     })
+
+    //增加完权限之后解除新增按钮的锁定
+    function enableUpload() {
+        document.getElementById("enableUpload")["disabled"] = false;
+        document.getElementById("enableUpload").innerHTML = '新增';
+    }
+    //锁定新增按钮
+    function disableUpload() {
+        document.getElementById("enableUpload")["disabled"] = true;
+        document.getElementById("enableUpload").innerHTML = '新增(请先设置权限)';
+    }
+    function enableSave() {
+        document.getElementById("enableSave")["disabled"] = false;
+        document.getElementById("enableSave").innerHTML = '保存';
+    }
+
+    function disableSave() {
+        document.getElementById("enableSave")["disabled"] = true;
+        document.getElementById("enableSave").innerHTML = '保存(请先设置权限)';
+    }
+
     layui.use(['laydate', 'form'], function () {
         var laydate = layui.laydate;
         var form = layui.form;
@@ -126,33 +141,47 @@
             var url = '/market/cIncomeExcelTemplate/getExcelInfo';
             util.ajaxJson("数据加载中", ctx + url,
                 {
-                "id": excelId ? excelId : '', "type": type
-            }, function (res) {
-                if (res.result == 0) {
-                    // 查看和修改时 下拉框赋值
-                    excelInfo = res.body.excelInfo;
-                    excelLevel = res.body.excelLevel;
-                    isAdmin = res.body.isExcelAdmin;
-                    emptyExcel = res.body.emptyExcel;
-                    console.log(type);
-                    if (isAdmin) {
-                        toolBar += '<input id="imports" type="file" class="btn btn-primary" style="padding:3px 6px;font-size: 12px;margin-right: 10px;"></input>';
-                        toolBar += '<button id="exports" class="btn btn-primary btn-danger" style="padding:3px 6px;font-size: 12px;margin-right: 10px;">导出</button>';
+                    "excelId": excelId ? excelId : '', "type": type
+                }, function (res) {
+                    if (res.result == 0) {
+                        // 查看和修改时 下拉框赋值
+                        excelInfo = res.body.excelInfo;
+                        excelLevel = res.body.excelLevel;
+                        isAdmin = res.body.isExcelAdmin;
+                        emptyExcel = res.body.emptyExcel;
+                        console.log(type);
+                        if (isAdmin) {
+                            toolBar += '<span style="color: red">*</span><span style="padding:0px 6px;font-size: 16px;">模板类型</span><input type="text" id="templateType" style="padding:0px 6px;width: 100px;height: 25px">';
+                            toolBar += '<button id="share" class="btn btn-primary btn-primary" style="padding:3px 6px;font-size: 16px;margin-right: 10px;margin-left:10px;width: 80px">权限设置</button>'
+                            toolBar += '<input id="imports" type="file" class="btn btn-primary" style="padding:3px 6px;font-size: 14px;margin-right: 10px;width: 180px"></input>';
+                            toolBar += '<button id="fullScreen" class="btn btn-primary" style="padding:3px 6px;font-size: 16px;margin-right: 10px;">全屏显示</button>' +
+                                '<button id="exitFullScreen" class="btn btn-primary" style="padding:3px 6px;font-size: 16px;margin-right: 10px;display:none">退出全屏</button>';
+                            //toolBar += '<button id="exports" class="btn btn-primary btn-danger" style="padding:3px 6px;font-size: 12px;margin-right: 10px;">导出</button>';
+                            if (type == '1') {
+                                toolBar += '<button id="enableUpload" class="btn btn-primary btn-primary" style="padding:3px 6px;font-size: 16px;margin-right: 10px;" disabled>新增(请先设置权限)</button>';
+                            } else if (type == '2') {
+                                window.parent['setAuth'](excelId);
+                                toolBar += '<button id="enableSave" class="btn btn-primary btn-primary" style="padding:3px 6px;font-size: 16px;margin-right: 10px;">保存</button>';
+                            }
+                        }
+                        if (type == '3') {
+                            toolBar =  '<button id="fullScreen" class="btn btn-primary" style="padding:3px 6px;font-size: 16px;margin-right: 10px;">全屏显示</button>' +
+                                '<button id="exitFullScreen" class="btn btn-primary" style="padding:3px 6px;font-size: 16px;margin-right: 10px;display:none">退出全屏</button>';
+                            showToolBar = false;
+                        }
+                        //toolBar += '<button id="saves" class="btn btn-primary btn-danger" style=" padding:3px 6px; font-size: 12px; margin-right: 10px;">保存</button>';
+                        var eJson = res.body.excelJson;
+                        var cellData = luckysheet.transToCellData(eJson[0].data);
+                        eJson[0].celldata = cellData;
+                        $("#topBtn").html(toolBar);
+                        initExcel(res.body.excelJson);
                     }
-                    toolBar += '<button id="saves" class="btn btn-primary btn-danger" style=" padding:3px 6px; font-size: 12px; margin-right: 10px;">保存</button>';
-                    toolBar += '<button id="fullScreen" class="btn btn-primary" style="padding:3px 6px;font-size: 12px;margin-right: 10px;">全屏显示</button>' +
-                        '<button id="exitFullScreen" class="btn btn-primary" style="padding:3px 6px;font-size: 12px;margin-right: 10px;display:none">退出全屏</button>';
-                    var eJson = res.body.excelJson;
-                    var cellData = luckysheet.transToCellData(eJson[0].data);
-                    eJson[0].celldata = cellData;
-                    initExcel(res.body.excelJson);
-                }
-            });
+                });
             initExcel()
         }
 
         // 表格初始化
-        function initExcel(data,name) {
+        function initExcel(data, name) {
             if (type == '1') {
                 flag = true
             } else {
@@ -162,7 +191,7 @@
                 adminFlag = true;
             }
             var fileName = excelInfo.name;
-            if ($.trim(name)!=''){
+            if ($.trim(name) != '') {
                 fileName = name;
             }
             try {
@@ -176,45 +205,45 @@
                         sheet: false //sheet页显示
                     },
                     showstatisticBar: false, // 底部计数
-                    showtoolbar: true,
+                    showtoolbar: showToolBar,
                     myFolderUrl: '',
                     showtoolbarConfig: {
-                        undoRedo: true, //撤销重做,注意撤消重做是两个按钮,由这一个配置决定显示还是隐藏
-                        paintFormat: true, //格式刷
-                        currencyFormat: true, //货币格式
-                        percentageFormat: true, //百分比格式
-                        numberDecrease: true, // '减少小数位数'
-                        numberIncrease: true, // '增加小数位数
-                        moreFormats: true, // '更多格式'
-                        font: true, // '字体'
-                        fontSize: true, // '字号大小'
-                        bold: true, // '粗体 (Ctrl+B)'
-                        italic: true, // '斜体 (Ctrl+I)'
-                        strikethrough: true, // '删除线 (Alt+Shift+5)'
-                        underline: true, // '下划线 (Alt+Shift+6)'
-                        textColor: true, // '文本颜色'
-                        fillColor: true, // '单元格颜色'
-                        border: true, // '边框'
-                        mergeCell: true, // '合并单元格'
-                        horizontalAlignMode: true, // '水平对齐方式'
-                        verticalAlignMode: true, // '垂直对齐方式'
-                        textWrapMode: true, // '换行方式'
-                        textRotateMode: false, // '文本旋转方式'
-                        image: false, // '插入图片'
-                        link: false, // '插入链接'
-                        chart: false, // '图表'(图标隐藏,但是如果配置了chart插件,右击仍然可以新建图表)
-                        postil: false, //'批注'
-                        pivotTable: false,  //'数据透视表'
-                        function: true, // '公式'
-                        frozenMode: false, // '冻结方式'
-                        sortAndFilter: true, // '排序和筛选'
-                        conditionalFormat: false, // '条件格式'
-                        dataVerification: false, // '数据验证'
-                        splitColumn: true, // '分列'
-                        screenshot: false, // '截图'
-                        findAndReplace: true, // '查找替换'
-                        protection: false, // '工作表保护'
-                        print: false, // '打印'
+                        undoRedo: showToolBar, //撤销重做,注意撤消重做是两个按钮,由这一个配置决定显示还是隐藏
+                        paintFormat: showToolBar, //格式刷
+                        currencyFormat: showToolBar, //货币格式
+                        percentageFormat: showToolBar, //百分比格式
+                        numberDecrease: showToolBar, // '减少小数位数'
+                        numberIncrease: showToolBar, // '增加小数位数
+                        moreFormats: showToolBar, // '更多格式'
+                        font: showToolBar, // '字体'
+                        fontSize: showToolBar, // '字号大小'
+                        bold: showToolBar, // '粗体 (Ctrl+B)'
+                        italic: showToolBar, // '斜体 (Ctrl+I)'
+                        strikethrough: showToolBar, // '删除线 (Alt+Shift+5)'
+                        underline: showToolBar, // '下划线 (Alt+Shift+6)'
+                        textColor: showToolBar, // '文本颜色'
+                        fillColor: showToolBar, // '单元格颜色'
+                        border: showToolBar, // '边框'
+                        mergeCell: showToolBar, // '合并单元格'
+                        horizontalAlignMode: showToolBar, // '水平对齐方式'
+                        verticalAlignMode: showToolBar, // '垂直对齐方式'
+                        textWrapMode: showToolBar, // '换行方式'
+                        textRotateMode: showToolBar, // '文本旋转方式'
+                        image: showToolBar, // '插入图片'
+                        link: showToolBar, // '插入链接'
+                        chart: showToolBar, // '图表'(图标隐藏,但是如果配置了chart插件,右击仍然可以新建图表)
+                        postil: showToolBar, //'批注'
+                        pivotTable: showToolBar,  //'数据透视表'
+                        function: showToolBar, // '公式'
+                        frozenMode: showToolBar, // '冻结方式'
+                        sortAndFilter: showToolBar, // '排序和筛选'
+                        conditionalFormat: showToolBar, // '条件格式'
+                        dataVerification: showToolBar, // '数据验证'
+                        splitColumn: showToolBar, // '分列'
+                        screenshot: showToolBar, // '截图'
+                        findAndReplace: showToolBar, // '查找替换'
+                        protection: showToolBar, // '工作表保护'
+                        print: showToolBar, // '打印'
                     },
                     showinfobar: true, // 顶部信息 文件名称 按钮
                     allowUpdate: false, // 是否允许操作表格后的后台更新 在线文档websocket时为true
@@ -228,7 +257,7 @@
                         view: false, // 打印视图
                         zoom: false, // 缩放
                     },
-                    functionButton: toolBar,
+                    functionButton: '',
                     cellRightClickConfig: {
                         copy: false, // 复制
                         copyAs: false, // 复制为
@@ -274,29 +303,17 @@
             } catch (err) {
                 console.log(err)
             }
-            if (isAdmin == false) {
-
-            } else {
-
-            }
-            if (emptyExcel == true) {
-
-            } else {
-
-            }
-            if (excelInfo.shareStatus == '1') {
-
-            } else {
-
+            if (type == '2') {
+                $("#templateType").val(excelInfo.typeName);
             }
             initHandel();
         }
 
-
         // 绑定按钮事件
         function initHandel() {
             $("#fullScreen").on("click", function () {
                 fullScreen();
+                $('#monthSelect').show()
             })
             //退出全屏
             $("#exitFullScreen").on("click", function () {
@@ -305,6 +322,46 @@
             //分享
             $('#share').off("click").click(function () {
                 window.parent['showAuthDialog']('true');
+                if (type == '1') {
+                    disableUpload();
+                } else if (type == '2') {
+                    disableSave();
+                }
+                realExitFullScreen();
+            });
+            //修改
+            $('#enableSave').off("click").click(function () {
+                var excelId = $(window.parent.document).find("#excelId").attr("value");
+                var sheetName = luckysheet.getSheet().name;
+                var excelData = luckysheet.getSheet(sheetName);
+                var templateType = $("#templateType").val();
+                var excelName = luckysheet.toJson().title;
+                if ($.trim(templateType) == '') {
+                    window.top.$vm.$message({
+                        message: '请输入模板类型',
+                        type: 'info'
+                    })
+                    return;
+                }
+                //调用vue页面方法执行新增/修改
+                window.parent['addNewTemplate'](excelName, excelData, templateType);
+            });
+            //新增
+            $('#enableUpload').off("click").click(function () {
+                var excelId = $(window.parent.document).find("#excelId").attr("value");
+                var sheetName = luckysheet.getSheet().name;
+                var excelData = luckysheet.getSheet(sheetName);
+                var templateType = $("#templateType").val();
+                var excelName = luckysheet.toJson().title;
+                if ($.trim(templateType) == '') {
+                    window.top.$vm.$message({
+                        message: '请输入模板类型',
+                        type: 'info'
+                    })
+                    return;
+                }
+                //调用vue页面方法执行新增/修改
+                window.parent['addNewTemplate'](excelName, excelData, templateType);
             });
             // 保存
             $('#saves').off("click").click(function () {
@@ -428,7 +485,36 @@
         }
 
         getData()
-    })
+    });
+
+    //退出全屏,而不是切换
+    function realExitFullScreen() {
+        $('#monthSelect').show()
+        //$("#exitFullScreen").css("display", "");
+        $("#fullScreen").css("display", "show");
+        $('.excel-style').css('width', '100%')
+        $('.excel-style').css('height', '97%')
+        var isFullscreen = document.fullScreenElement //W3C
+            ||
+            document.msFullscreenElement //IE
+            ||
+            document.mozFullScreenElement //火狐
+            ||
+            document.webkitFullscreenElement //谷歌
+            ||
+            false;
+        if (isFullscreen) {
+            if (document.exitFullscreen) {
+                document.exitFullscreen();
+            } else if (document.msExitFullscreen) {
+                document.msExitFullscreen();
+            } else if (document.mozCancelFullScreen) {
+                document.mozCancelFullScreen();
+            } else if (document.webkitCancelFullScreen) {
+                document.webkitCancelFullScreen();
+            }
+        }
+    }
 
 </script>
 </body>

+ 370 - 21
src/pages/main/incomeExcel/incomeExcelInfo.vue

@@ -1,6 +1,7 @@
 <template>
-    <div class="container" id="container">
-        <iframe height="100%" width="100%" src="/static/views/incomeTemplateExcel.html" frameborder="0"></iframe>
+    <div class="container" id="container" v-loading="loading">
+        <iframe height="100%" width="100%" src="/static/views/incomeTemplateExcel.html" frameborder="0"
+                ref="iframe" name="excelIframe" id="excelIframe"></iframe>
         <el-dialog :title="'权限设置'" :visible.sync="authSettingStatus" width="50%" :destroy-on-close="true"
                    :modal-append-to-body="false" :close-on-click-modal="false">
             <el-form :model="testModel" ref="addInfoList">
@@ -9,65 +10,413 @@
                         <el-radio v-model="authType" label="1" style="margin: 10px">无特殊权限</el-radio>
                         <div id="noLimit" class="info-line">
                             <span style="margin-right: 20px;margin-left: 40px">负责人:</span>
-                            <el-button type="primary">组织机构</el-button>
-                            <span style="width: 80px;margin-right: 20px;margin-left: 20px">{{text}}</span>
+                            <el-button type="primary" @click="noLimitUserAdd()">组织机构</el-button>
+                            <span style="width: 80px;margin-right: 20px;margin-left: 20px">{{ noLimitUserName }}</span>
                         </div>
                     </div>
                     <div class="info-line">
                         <el-radio v-model="authType" label="2" style="margin: 10px">特殊权限</el-radio>
                         <div id="limit">
-                            <span style="margin-right: 20px;margin-left: 40px">负责人:</span>
-                            <el-button type="primary">组织机构</el-button>
-                            <span style="margin-right: 20px;margin-left: 20px">{{text}}</span>
-                            <span style="margin-right: 10px;margin-left: 10px">可编辑行:从</span>
-                            <el-input v-model="testModel.a" style="width: 60px;"></el-input>
-                            <span style="margin-right: 10px;margin-left: 10px">到</span>
-                            <el-input v-model="testModel.b" style="width: 60px;"></el-input>
-                            <br/><br/>
-                            <el-button style="width: 80px;margin-right: 20px;margin-left: 40px">添加</el-button>
+                            <div v-for="(item,index) in limitList">
+                                <span style="margin-right: 20px;margin-left: 40px">负责人:</span>
+                                <el-button type="primary" @click="limitUserAdd(index)">组织机构</el-button>
+                                <span style="margin-right: 20px;margin-left: 20px">{{ item.userName }}</span>
+                                <span style="margin-right: 10px;margin-left: 10px">可编辑行:从</span>
+                                <el-input v-model="item.editStart" style="width: 60px;"></el-input>
+                                <span style="margin-right: 10px;margin-left: 10px">到</span>
+                                <el-input v-model="item.editEnd" style="width: 60px;"></el-input>
+                                <br/><br/>
+                            </div>
+                            <el-button style="width: 80px;margin-right: 20px;margin-left: 40px"
+                                       @click="addNewLimitAuth()">添加
+                            </el-button>
                         </div>
                     </div>
                     <div slot="footer" style="text-align: right;padding-bottom: 20px;padding-top: 20px">
-                        <el-button>取 消</el-button>
-                        <el-button type="primary">确 定</el-button>
+                        <el-button @click="authSettingStatus = false">取 消</el-button>
+                        <el-button type="primary" @click="processAuth()">确 定</el-button>
                     </div>
                 </div>
             </el-form>
         </el-dialog>
+        <el-dialog title="选择填报人" :visible.sync="noLimitDialog" width="50%" :destroy-on-close="true"
+                   :modal-append-to-body="false" :close-on-click-modal="false">
+            <div>
+                <el-form :model="exaList" ref="addInfoList">
+                    <el-form-item prop="processUserId" class="info-line online">
+                        <span style="width: 80px;margin-right: 20px">审批人员</span>
+                        <deptTreeUserNew class="tree" @treeCheck="treeCheckonly" :defaultList="defaultList"
+                                         :type="depttype" :closeList="closeList"></deptTreeUserNew>
+                        <div class="tree treeUser">
+                            <p v-for="(item,index) in treeList" :key="index">{{ item.receiveName }}
+                                <i @click="deletes(item,index)" class="el-icon-error"></i>
+                            </p>
+                        </div>
+                    </el-form-item>
+                </el-form>
+
+                <div slot="footer" style="text-align: right;padding-bottom: 20px">
+                    <el-button @click="noLimitDialog = false">取 消</el-button>
+                    <el-button type="primary" @click="processNoLimitUsers()">确 定</el-button>
+                </div>
+            </div>
+        </el-dialog>
     </div>
 </template>
 <script>
 import myMessage from "../../../components/myMessage.vue"
+import deptTreeUserNew from "../../../components/deptTreeUserNew";
 
 export default {
     components: {
-        myMessage
+        myMessage,
+        deptTreeUserNew,
     },
     data() {
-
         return {
             testModel: {},
             authSettingStatus: false,
             authType: '1',
-            text:'负责人A 负责人B 负责人C'
-
+            noLimitUserName: '',
+            noLimitUsers: [],
+            noLimitDialog: false,
+            exaList: {},
+            defaultList: [],
+            treeList: [],
+            closeList: false,
+            depttype: 0,
+            limitUserIndex: -1,
+            limitList: [{}],
+            type: '',
+            loading: false
         }
     },
     methods: {
+        addNewTemplate(sheetName, excelData, templateType) {
+            //console.log(sheetName);
+            //console.log(excelData);
+            //console.log(templateType);
+            //处理一下数据,提交给后端
+            var authUser = [];
+            if (this.authType == '1') {
+                this.noLimitUsers.map((o) => {
+                    authUser.push({
+                        userId: o,
+                        type: 0
+                    })
+                });
+            } else {
+                //外层是权限组
+                this.limitList.map((o) => {
+                    //内层是权限用户
+                    o.userIds.map((o1) => {
+                        authUser.push({
+                            userId: o1,
+                            type: 1,
+                            editStart: o.editStart,
+                            editEnd: o.editEnd
+                        })
+                    })
+                });
+            }
+            //console.log(authUser);
+            //提交
+            var _this = this;
+            var url = '/market/cIncomeExcelTemplate/addNewTemplate';
+            if (this.type == '2') {
+                url = '/market/cIncomeExcelTemplate/updateTemplate';
+            }
+            this.loading = true;
+            this.$http({
+                url: url,
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
+                },
+                data: {
+                    excelData: excelData,
+                    excelName: sheetName,
+                    userList: authUser,
+                    templateType: templateType,
+                    excelId: this.getUrlKey('id'),
+                },
+            }).then((res) => {
+                this.loading = false;
+                if (res.data.result === 1) {
+                    _this.$message({
+                        message: res.data.desc,
+                        type: 'error'
+                    });
+                } else {
+                    var msgText = '新增成功';
+                    if (this.type == '2') {
+                        msgText = '修改成功';
+                    }
+                    _this.$message({
+                        message: msgText,
+                        type: 'success'
+                    });
+                    const newUrl = '#' + this.$route.path + '?type=2&id=' + res.data.desc;
+                    console.log(newUrl);
+                    window.history.replaceState('', '', newUrl);
+                    if (this.type == '1') {
+                        this.type = '2';
+                        document.getElementById('excelIframe').contentWindow.location.reload();
+                    }
+                }
+            });
+        },
         showAuthDialog() {
             this.authSettingStatus = true;
-        }
+        },
+        processAuth() {
+            console.log(this.limitList);
+            //判断一下
+            var success = true;
+            if (this.authType == '1') {
+                if (this.noLimitUsers.length == 0) {
+                    this.$message({
+                        message: '请选择无特殊权限的负责人',
+                        type: 'error'
+                    });
+                    success = false;
+                    return;
+                }
+            } else if (this.authType == '2') {
+                this.limitList.map((o) => {
+                    if (o.userIds == null) {
+                        this.$message({
+                            message: '请选择特殊权限的负责人',
+                            type: 'error'
+                        });
+                        success = false;
+                        return;
+                    }
+                    if (o.editStart == null || o.editEnd == null) {
+                        this.$message({
+                            message: '请填写可编辑行',
+                            type: 'error'
+                        });
+                        success = false;
+                        return;
+                    }
+                })
+            }
+            if (success) {
+                if (this.type == '1') {
+                    this.$refs.iframe.contentWindow.enableUpload('abc');
+                } else if (this.type == '2') {
+                    this.$refs.iframe.contentWindow.enableSave('def');
+                }
+                this.authSettingStatus = false;
+            }
+        },
+        addNewLimitAuth() {
+            var _this = this;
+            var lastLimitUserList = _this.limitList[_this.limitList.length - 1].userIds;
+            if (lastLimitUserList == null) {
+                _this.$message({
+                    message: '请先选择上一条记录的负责人',
+                    type: 'error'
+                });
+            } else {
+                _this.limitList.push({
+                    index: 1
+                });
+            }
+        },
+        processNoLimitUsers() {
+            var userNameString = '';
+            if (this.authType == '1') {
+                this.noLimitUsers = [];
+                this.treeList.map((o) => {
+                    this.noLimitUsers.push(o.receiveNo);
+                    userNameString += o.receiveName += ' ';
+                });
+                this.noLimitUserName = userNameString;
+            } else {
+                this.limitList[this.limitUserIndex].userIds = [];
+                this.treeList.map((o) => {
+                    this.limitList[this.limitUserIndex].userIds.push(o.receiveNo);
+                    userNameString += o.receiveName += ' ';
+                });
+                this.limitList[this.limitUserIndex].userName = userNameString;
+            }
+            this.exaList = {};
+            this.defaultList = [];
+            this.treeList = [];
+            this.noLimitDialog = false;
+        },
+        noLimitUserAdd() {
+            if (this.authType == '1') {
+                this.noLimitDialog = true;
+            } else {
+                this.$message({
+                    message: '请先选择无特殊权限,再添加负责人',
+                    type: 'error'
+                });
+            }
+        },
+        limitUserAdd(index) {
+            if (this.authType == '2') {
+                this.limitUserIndex = index;
+                this.noLimitDialog = true;
+            } else {
+                this.$message({
+                    message: '请先选择特殊权限,再添加负责人',
+                    type: 'error'
+                });
+            }
+        },
+        setAuth(id) {
+            var _this = this;
+            this.$http({
+                url: '/market/cIncomeExcelTemplate/getAuthInfo',
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json",
+                },
+                data: {
+                    excelId: id
+                },
+            }).then((res) => {
+                if (res.data.result === 1) {
+                    _this.$message({
+                        message: '获取负责人信息失败',
+                        type: 'error'
+                    });
+                } else {
+                    console.log(res.data);
+                    var authUsers = res.data.body;
+                    var i = -1;
+                    var nowStart = '';
+                    var nowEnd = '';
+                    this.limitList = [];
+                    this.noLimitUsers = [];
+                    this.noLimitUserName = '';
+                    authUsers.map((o) => {
+                        console.log(o);
+                        //无特殊权限的简单一点,有特殊权限的,需要把相同可编辑行的放在一起
+                        if (o.type == '0') {
+                            this.authType = '1';
+                            this.noLimitUsers.push(o.userId);
+                            this.noLimitUserName += o.userName += ' ';
+                        } else {
+                            this.authType = '2';
+                            if (o.editStart == nowStart && o.editEnd == nowEnd) {
+                                var processLimitUser = this.limitList[i];
+                                processLimitUser.userIds.push(o.userId);
+                                processLimitUser.userName += o.userName += ' ';
+                            } else {
+                                var userIds = [o.userId];
+                                var userName = o.userName += ' ';
+                                this.limitList.push({
+                                    userIds: userIds,
+                                    userName: userName,
+                                    editStart: o.editStart,
+                                    editEnd: o.editEnd
+                                })
+                                nowStart = o.editStart;
+                                nowEnd = o.editEnd;
+                                i++;
+                            }
+                        }
+                    });
+                }
+            });
+        },
+        //填报人相关
+        deletes(val, index) {
+            this.treeList.splice(index, 1);
+            this.closeList = this.treeList;
+        },
+        treeCheckonly(v) {
+            this.treeList = v;
+        },
+        getUrlKey(name) {
+            return (
+                decodeURIComponent(
+                    (new RegExp("[?|&]" + name + "=" + "([^&;]+?)(&|#|;|$)").exec(
+                        location.href
+                    ) || [, ""])[1].replace(/\+/g, "%20")
+                ) || null
+            );
+        },
     },
     mounted() {
-
+        this.type = this.getUrlKey("type")
     },
     created() {
         window['showAuthDialog'] = (rp) => {
             this.showAuthDialog(rp);
         }
+        window['addNewTemplate'] = (sheetName, excelData, templateType) => {
+            this.addNewTemplate(sheetName, excelData, templateType);
+        };
+        window['setAuth'] = (id) => {
+            this.setAuth(id);
+        };
     }
 }
 </script>
+<style lang="scss" scoped>
+.online {
+    width: 100%;
+
+    .el-select {
+        width: calc(100% - 100px);
+    }
+
+    span {
+        vertical-align: top;
+    }
+
+    .el-textarea {
+        width: calc(100% - 100px);
+    }
+
+    .tree {
+        width: calc(50% - 60px);
+        display: inline-block;
+        margin-right: 20px;
+        height: 300px;
+        overflow-y: scroll;
+
+        .el-icon-error {
+            float: right;
+            font-size: 20px;
+            margin-top: 9px;
+            cursor: pointer;
+        }
+    }
+
+    .treeUser {
+        margin: 0;
+        border: 1px solid #ddd;
+
+        p {
+            background: #f4f4f4;
+            padding: 0 20px;
+            margin-bottom: 5px;
+        }
+    }
+
+    .treeUserb {
+        width: calc(100% - 100px);
+        border: 1px solid #ddd;
+        background: #f4f4f4;
+        border-radius: 3px;
+        height: auto;
+        overflow: hidden;
+
+        p {
+            display: inline-block;
+            padding: 0 20px;
+            margin-bottom: 5px;
+        }
+    }
+}
+</style>
 <style scoped>
 .containerr {
     background: #fff;

+ 20 - 12
src/pages/main/incomeExcel/incomeExcelTemplate.vue

@@ -15,23 +15,23 @@
             <div class="tabbox">
                 <el-table height="calc(100% - 40px)" class="com-table" ref="multipleTable" :data="tableData"
                           tooltip-effect="dark" size="small" border style="width: 100%" v-loading="loading">
-                    <el-table-column prop="name" label="模板名称">
+                    <el-table-column prop="name" label="模板名称" align="center">
                     </el-table-column>
-                    <el-table-column prop="opTime" label="配置时间">
+                    <el-table-column prop="opTime" label="配置时间" align="center">
                     </el-table-column>
-                    <el-table-column prop="name" label="发起部门">
+                    <el-table-column prop="deptName" label="发起部门" align="center">
                     </el-table-column>
-                    <el-table-column prop="name" label="发起人">
+                    <el-table-column prop="addUserName" label="发起人" align="center">
                     </el-table-column>
-                    <el-table-column prop="name" label="模板类型">
+                    <el-table-column prop="typeName" label="模板类型" align="center">
                     </el-table-column>
-                    <el-table-column prop="name" label="状态">
+                    <el-table-column prop="status" label="状态" align="center">
                     </el-table-column>
                     <el-table-column label="操作" width="220px" align="center" fixed="right">
                         <template slot-scope="scope">
                             <el-button size="mini" type="primary">下发</el-button>
-                            <el-button size="mini">编辑</el-button>
-                            <el-button size="mini">查看</el-button>
+                            <el-button size="mini" @click="toEdit(scope.row)">编辑</el-button>
+                            <el-button size="mini" @click="toView(scope.row)">查看</el-button>
                             <el-button size="mini">删除</el-button>
                         </template>
                     </el-table-column>
@@ -85,7 +85,7 @@ export default {
         searchInfo(v) {
             this.params = {};
             v[0] ? this.params.name = v[0] : '';
-            v[1] ? this.params.type = v[1] : '';
+            v[1] ? this.params.templateType = v[1] : '';
             this.getList(this.params, this.pageSize);
         },
         //功能栏
@@ -108,7 +108,7 @@ export default {
             this.tableData = [];
             let _this = this;
             this.$http({
-                url: "/market/cKeyChannelCoopExcel/queryPage",
+                url: "/market/cIncomeExcelTemplate/getExcelTemplateList",
                 method: "post",
                 headers: {
                     "Content-Type": "application/json",
@@ -129,7 +129,15 @@ export default {
         },
         addNew() {
             var _this = this;
-            _this.jumpinfop('/incomeExcelInfo', 1, '新增模板', "853884899099357184")
+            _this.jumpinfop('/incomeExcelInfo', 1, '新增模板', "")
+        },
+        toEdit(row) {
+            var _this = this;
+            _this.jumpinfop('/incomeExcelInfo', 2, '修改模板', row.id);
+        },
+        toView(row) {
+            var _this = this;
+            _this.jumpinfop('/incomeExcelInfo', 3, '查看模板', row.id);
         },
         //跳转页面
         jumpinfop(p, v, n, id) {
@@ -162,7 +170,7 @@ export default {
         },
     },
     mounted() {
-
+        this.getList({}, 1);
     },
     created() {