中扬CRM客户关系管理系统
#
luxiaotao1123
2022-11-08 e7a01b236a9f6bee3616ddf2d1d88ada738490a9
src/main/webapp/views/cstmr/cstmr_more.html
@@ -328,26 +328,37 @@
                    // 表单提交事件
                    form.on('submit(followerSubmit)', function (data) {
                        let selectList = xmSelectIdx.getValue();
                        for (let i = 0; i<selectList.length; i++) {
                            let item = selectList[i];
                            // 查询物料详情
                            // $.ajax({
                            //     url: baseUrl+"/mat/covert/"+item.value+"/auth",
                            //     headers: {'token': localStorage.getItem('token')},
                            //     method: 'GET',
                            //     async: false,
                            //     success: function (res) {
                            //         if (res.code === 200){
                            //             xxDataList.push(res.data);
                            //             insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
                            //         } else if (res.code === 403){
                            //             top.location.href = baseUrl+"/";
                            //         }else {
                            //             layer.msg(res.msg, {icon: 2})
                            //         }
                            //     }
                            // })
                        if (selectList.length === 0) {
                            layer.msg("请选择至少一条数据", {icon: 3});
                            return false;
                        }
                        console.log(JSON.stringify({
                            cstmrId: cstmrId,
                            followerIds: selectList.map(function (d) {
                                return d.value;
                            })
                        }))
                        $.ajax({
                            url: baseUrl+"/cstmr/followers/add/auth",
                            headers: {'token': localStorage.getItem('token')},
                            data: {
                                cstmrId: cstmrId,
                                followerIds: selectList.map(function (d) {
                                    return d.value;
                                })
                            },
                            method: 'POST',
                            success: function (res) {
                                if (res.code === 200){
                                    layer.msg(res.msg, {icon: 1})
                                    // insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
                                } else if (res.code === 403){
                                    top.location.href = baseUrl+"/";
                                }else {
                                    layer.msg(res.msg, {icon: 2})
                                }
                            }
                        })
                        layer.close(dIndex);
                        return false;
                    });