中扬CRM客户关系管理系统
LSH
2024-03-29 cc85911b19cc25838f19ffb2fbb120fbc72b2fb4
src/main/webapp/static/js/weekly/weekly.js
@@ -346,7 +346,7 @@
                                // ,{field: 'director', align: 'center',title: '负责人'}
                                // ,{field: 'settleSize', align: 'center',title: '流程长度'}
                                // ,{field: 'settleCurrent', align: 'center',title: '当前进度'}
                                ,{field: 'cstmrId', align: 'center',title: '甲方单位ID'}//, templet: function () { return htmlCstme;}
                                ,{field: 'cstmrId$', align: 'center',title: '甲方单位ID'}//, templet: function () { return htmlCstme;}
                                ,{field: 'memo', align: 'center',title: '备注',   edit:false}
                            ]],
                            request: {
@@ -409,7 +409,7 @@
                                // ,{field: 'director', align: 'center',title: '负责人'}
                                // ,{field: 'settleSize', align: 'center',title: '流程长度'}
                                // ,{field: 'settleCurrent', align: 'center',title: '当前进度'}
                                ,{field: 'cstmrId', align: 'center',title: '甲方单位ID'}//, templet: function () { return htmlCstme;}
                                ,{field: 'cstmrId$', align: 'center',title: '甲方单位ID'}//, templet: function () { return htmlCstme;}
                                ,{field: 'memo', align: 'center',title: '备注',   edit:false}
                            ]],
                            request: {
@@ -549,29 +549,22 @@
                        // 获取当前行数据
                        table.getRowData = function(elem){
                            var index = $(elem).closest('tr').data('index');
                            console.log("index-----")
                            console.log(index)
                            var indexArray = indexS.split(","); // 将字符串拆分为数组
                            // 遍历数组中的每个元素
                            for (var i = 0; i < indexArray.length; i++) {
                                var element = Number(indexArray[i]);
                                // 进行相应的操作
                                console.log("element-----");
                                console.log(element);
                                if (element===index){
                                    indexSign = 1;
                                }
                            }
                            if (indexSign === 0){
                                indexS = indexS+","+index;
                                console.log("indexS-----")
                                console.log(indexS)
                            }
                            return table.cache[options.id][index] || {};
                        };
                        if (indexSign === 0 && indexDelSign === 0){
                            console.log("渲染")
                            // 渲染搜索模板
                            $.ajax({
                                url: baseUrl+"/cstmr/all/get/kv",
@@ -582,10 +575,10 @@
                                method: 'POST',
                                // async: false, // 设置为同步执行
                                success: function (res) {
                                    console.log(res)
                                    console.log($("#cstmrId").html())
                                    // console.log(res)
                                    // console.log($("#cstmrId").html())
                                    res.data.forEach((item) => {
                                        console.log(item)
                                        // console.log(item)
                                        $("#cstmrId").append("<option value='" + item.value  + "';"+" class=\"cstmrDetl\""+">" + item.name + "</option>")
                                    })
                                }
@@ -593,7 +586,7 @@
                        }
                        $('.select-cstmr').on('change', function(){
                            console.log("cstmrId")
                            // console.log("cstmrId")
                            var value = this.value; // 获取选中项 value
                            var data = table.getRowData(this);
                            xxDataList.forEach(res => {
@@ -876,19 +869,52 @@
                    },
                    done: function (res, curr, count) {
                        $(".layui-table-cell").css('overflow', 'visible');//解决layui数据表格中嵌套下拉框显示问题
                        // $(".laytable-cell-2-0-6").css('color', 'rgba(0, 0, 0, 0)');
                        $(".laytable-cell-2-0-6").css('color', 'rgba(0, 0, 0, 0)');
                        $(layero).find('.layui-table-view').css('margin', '0');
                        var options = this;
                        var indexSign = 0;
                        // 获取当前行数据
                        table.getRowData = function(elem){
                            var index = $(elem).closest('tr').data('index');
                            var indexArray = indexS.split(","); // 将字符串拆分为数组
                            // 遍历数组中的每个元素
                            for (var i = 0; i < indexArray.length; i++) {
                                var element = Number(indexArray[i]);
                                // 进行相应的操作
                                if (element===index){
                                    indexSign = 1;
                                }
                            }
                            if (indexSign === 0){
                                indexS = indexS+","+index;
                            }
                            return table.cache[options.id][index] || {};
                        };
                        if (indexSign === 0 && indexDelSign === 0){
                            // 渲染搜索模板
                            $.ajax({
                                url: baseUrl+"/cstmr/all/get/kv",
                                headers: {'token': localStorage.getItem('token')},
                                data: {
                                    limit: 9999
                                },
                                method: 'POST',
                                // async: false, // 设置为同步执行
                                success: function (res) {
                                    // console.log(res)
                                    // console.log($("#cstmrId").html())
                                    res.data.forEach((item) => {
                                        // console.log(item)
                                        $("#cstmrId").append("<option value='" + item.value  + "';"+" class=\"cstmrDetl\""+">" + item.name + "</option>")
                                    })
                                }
                            })
                        }
                        $('.select-cstmr').on('change', function(){
                            console.log("cstmrId")
                            // console.log("cstmrId")
                            var value = this.value; // 获取选中项 value
                            var data = table.getRowData(this);
                            xxDataList.forEach(res => {
@@ -899,6 +925,29 @@
                                }
                            })
                        });
                        $(document).ready(function () {
                            $.ajax({
                                url: baseUrl + "/cstmr/all/get/kv",
                                headers: { 'token': localStorage.getItem('token') },
                                data: {
                                    limit: 9999
                                },
                                method: 'POST',
                                success: function (res) {
                                    if (res.code === 200) {
                                        // console.log("res111111111111")
                                        // console.log(res)
                                        var template = $('#cstmrId').html(); // 获取模板内容
                                        var compiledTemplate = Handlebars.compile(template); // 编译模板
                                        var html = compiledTemplate(res.data); // 将数据应用到模板中
                                        $('.select-cstmr').html(html); // 渲染模板到页面
                                    } else {
                                        // 处理异常情况
                                    }
                                }
                            });
                        });
                    },
                    size: ''
                };