中扬CRM客户关系管理系统
Junjie
2023-09-14 2a8710c50e2f7c4dd0e333dcf650a2dff960fff4
src/main/webapp/static/js/priOnline2/priOnline.js
@@ -84,14 +84,17 @@
        cols: [[
            {type: 'checkbox', fixed: 'left'}
            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80,hide: true}
            ,{field: 'templateName', align: 'center',title: '核价名',hide: false}
            ,{field: 'orderNum', align: 'center',title: '核价单号'}
            ,{field: 'planId$', align: 'center',title: '规划单号'}
            ,{field: 'templateName', align: 'center',title: '客户名称', style: 'color: #1890ff;cursor:pointer', event: 'moreCstmr', width: 350,hide: false}
            ,{field: 'cstmrId$', align: 'center',title: '客户id',hide: true}
            ,{field: 'orderNum', align: 'center',title: '核价单号',hide: false}
            ,{field: 'planId$', align: 'center',title: '规划单号', style: 'color: #1890ff;cursor:pointer', event: 'morePlan',hide: false}
            ,{field: 'itemId', align: 'center',title: '规划单号', hide: true}
            ,{field: 'createTime$', align: 'center',title: '创建时间'}
            ,{field: 'updateTime$', align: 'center',title: '更新时间'}
            ,{field: 'status$', align: 'center',title: '状态'}
            ,{field: 'memberId$', align: 'center',title: '业务员'}
            ,{field: 'user$', align: 'center',title: '创建人员'}
            ,{field: 'settle$', align: 'center',title: '进度', style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false}
            // ,{field: 'user$', align: 'center',title: '创建人员'}
            ,{field: 'updateUserId$', align: 'center',title: '更新人员'}
            ,{field: 'checkDataStatus$', align: 'center',title: '报价数据'}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:350}
@@ -169,7 +172,7 @@
                } else {
                    layer.confirm('确定删除'+(ids.length===1?'此':ids.length)+'条数据吗', function(){
                        $.ajax({
                            url: baseUrl+"/priOnline/delete/auth",
                            url: baseUrl+"/priOnline2/delete/auth",
                            headers: {'token': localStorage.getItem('token')},
                            data: {ids: ids},
                            method: 'POST',
@@ -207,7 +210,7 @@
                        'fields': fields
                    };
                    $.ajax({
                        url: baseUrl+"/priOnline/export/auth",
                        url: baseUrl+"/priOnline2/export/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: JSON.stringify(param),
                        dataType:'json',
@@ -233,6 +236,53 @@
    table.on('tool(priOnline)', function(obj){
        var data = obj.data;
        switch (obj.event) {
            case 'approval':
                layer.confirm('审批通过?', {
                    skin: 'layui-layer-admin',
                    shade: .1,
                    offset: '200px',
                    title: data.name
                }, function (i) {
                    layer.close(i);
                    approval(data.id);
                });
                break;
            case 'moreCstmr':
                top.cstmrByMore = data.cstmrId$;
                admin.popupRight({
                    type: 1,
                    window: "top",
                    area: "1250px",
                    url: "../cstmr/cstmr_more.html",
                    end: function () {
                        // $(".layui-laypage-btn")[0].click();
                    }
                })
                break;
            case 'morePlan':
                top.planByMore = data.itemId;
                admin.popupRight({
                    type: 1,
                    window: "top",
                    area: "1250px",
                    url: "../plan/plan_more_other.html",
                    end: function () {
                        // $(".layui-laypage-btn")[0].click();
                    }
                })
                break;
            case 'more':
                top.priOnlineByMore = data.id;
                admin.popupRight({
                    type: 1,
                    window: "top",
                    area: "1250px",
                    url: "priOnline_more.html",
                    end: function () {
                        // $(".layui-laypage-btn")[0].click();
                    }
                })
                break;
            // 核价
            case 'check':
                layer.open({
@@ -447,6 +497,34 @@
        });
    }
    function approval(priOnlineId, plannerId, dIdx) {
        let loadIndex = layer.load(2);
        $.ajax({
            url: baseUrl+"/priOnline2/approval/auth",
            headers: {'token': localStorage.getItem('token')},
            data: {
                priOnlineId: priOnlineId,
                plannerId: plannerId
            },
            method: 'POST',
            success: function (res) {
                if (dIdx) {
                    layer.close(dIdx);
                }
                layer.close(loadIndex);
                if (res.code === 200){
                    layer.msg(res.msg, {icon: 1});
                    tableReload();
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                } else {
                    layer.msg(res.msg, {icon: 2});
                }
            }
        })
    }
});
// 关闭动作