中扬CRM客户关系管理系统
#
LSH
2023-11-04 aa0161bf05195ccb00bc1d8da4b1b8218f93f4d3
src/main/webapp/static/js/priOnline2/priOnline.js
@@ -5,7 +5,7 @@
    base: baseUrl + "/static/layui/lay/modules/"
}).extend({
    cascader: 'cascader/cascader',
}).use(['table','laydate', 'form', 'admin', 'xmSelect', 'element', 'cascader', 'tree', 'dropdown'], function() {
}).use(['table', 'laydate', 'form', 'admin', 'xmSelect', 'element', 'cascader', 'tree', 'dropdown'], function () {
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
@@ -104,7 +104,7 @@
                hide: false
            }
            , {field: 'itemId', align: 'center', title: '规划单号', hide: true}
            , {field: 'status$', align: 'center', title: '状态',hide : false}
            , {field: 'status$', align: 'center', title: '状态', hide: false}
            // ,{field: 'memberId$', align: 'center',title: ''}
            , {
                field: 'settle$',
@@ -114,12 +114,13 @@
                event: 'more',
                hide: false
            }
            , {field: 'user$', align: 'center', title: '业务员',hide : false}
            , {field: 'deptId$', align: 'center', title: '部门',hide : true}
            , {field: 'checkDataStatus$', align: 'center', title: '报价数据',hide : false}
            , {field: 'createTime$', align: 'center', title: '创建时间',hide : true}
            , {field: 'updateUserId$', align: 'center', title: '更新人员',hide : false}
            , {field: 'updateTime$', align: 'center', title: '更新时间',hide : false}
            , {field: 'settleSize', align: 'center', title: '流程长度', hide: true}
            , {field: 'user$', align: 'center', title: '业务员', hide: false}
            , {field: 'deptId$', align: 'center', title: '部门', hide: true}
            , {field: 'checkDataStatus$', align: 'center', title: '报价数据', hide: false}
            , {field: 'createTime$', align: 'center', title: '创建时间', hide: true}
            , {field: 'updateUserId$', align: 'center', title: '更新人员', hide: false}
            , {field: 'updateTime$', align: 'center', title: '更新时间', hide: false}
            , {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 350}
        ]],
        request: {
@@ -267,6 +268,7 @@
                    title: data.name
                }, function (i) {
                    layer.close(i);
                    console.log(data)
                    approvalEnd(data.id);
                });
                break;
@@ -277,13 +279,14 @@
                    offset: '200px',
                    title: data.name
                }, function (i) {
                    console.log(data)
                    layer.close(i);
                    // 指定规划员
                    if (data.settle === 1) {
                    // 指定模板
                    if ((data.settle === 1 && data.settleSize===3) || (data.settle===2 && data.settleSize===4)) {
                        admin.open({
                            type: 1,
                            area: '300px',
                            title: '选择规划员',
                            title: '选择报价模板',
                            content: $('#plannerListDialog').html(),
                            success: function (layero, dIndex) {
                                let plannerSel = xmSelect.render({
@@ -582,10 +585,11 @@
            }
        });
    }
    function approvalEnd(planId, plannerId, dIdx) {
    function approvalEnd(priOnlineId, plannerId, dIdx) {
        let loadIndex = layer.load(2);
        $.ajax({
            url: baseUrl+"/priOnline2/approvalEnd/auth",
            url: baseUrl + "/priOnline2/approvalEnd/auth",
            headers: {'token': localStorage.getItem('token')},
            data: {
                priOnlineId: priOnlineId,
@@ -597,11 +601,11 @@
                    layer.close(dIdx);
                }
                layer.close(loadIndex);
                if (res.code === 200){
                if (res.code === 200) {
                    layer.msg(res.msg, {icon: 1});
                    tableReload();
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/";
                } else {
                    layer.msg(res.msg, {icon: 2});
                }
@@ -612,7 +616,7 @@
    function approval(priOnlineId, plannerId, dIdx) {
        let loadIndex = layer.load(2);
        $.ajax({
            url: baseUrl+"/priOnline2/approval/auth",
            url: baseUrl + "/priOnline2/approval/auth",
            headers: {'token': localStorage.getItem('token')},
            data: {
                priOnlineId: priOnlineId,
@@ -624,11 +628,11 @@
                    layer.close(dIdx);
                }
                layer.close(loadIndex);
                if (res.code === 200){
                if (res.code === 200) {
                    layer.msg(res.msg, {icon: 1});
                    tableReload();
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/";
                } else {
                    layer.msg(res.msg, {icon: 2});
                }
@@ -639,13 +643,13 @@
});
// 关闭动作
$(document).on('click','#data-detail-close', function () {
$(document).on('click', '#data-detail-close', function () {
    parent.layer.closeAll();
});
function tableReload(child) {
    var searchData = {};
    $.each($('#search-box [name]').serializeArray(), function() {
    $.each($('#search-box [name]').serializeArray(), function () {
        searchData[this.name] = this.value;
    });
    (child ? parent.tableIns : tableIns).reload({
@@ -655,14 +659,14 @@
        },
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
                top.location.href = baseUrl + "/";
            }
            pageCurr=curr;
            pageCurr = curr;
            if (res.data.length === 0 && count !== 0) {
                tableIns.reload({
                    where: searchData,
                    page: {
                        curr: pageCurr-1
                        curr: pageCurr - 1
                    }
                });
                pageCurr -= 1;
@@ -676,9 +680,9 @@
    for (var val in data) {
        var find = el.find(":input[id='" + val + "']");
        find.val(data[val]);
        if (showImg){
        if (showImg) {
            var next = find.next();
            if (next.get(0)){
            if (next.get(0)) {
                if (next.get(0).localName === "img") {
                    find.hide();
                    next.attr("src", data[val]);
@@ -698,13 +702,13 @@
function detailScreen(index) {
    var detail = layer.getChildFrame('#data-detail', index);
    var height = detail.height()+60;
    if (height > ($(window).height()*0.9)) {
        height = ($(window).height()*0.9);
    var height = detail.height() + 60;
    if (height > ($(window).height() * 0.9)) {
        height = ($(window).height() * 0.9);
    }
    layer.style(index, {
        top: (($(window).height()-height)/3)+"px",
        height: height+'px'
        top: (($(window).height() - height) / 3) + "px",
        height: height + 'px'
    });
    $(".layui-layer-shade").remove();
}