中扬CRM客户关系管理系统
#
LSH
2023-11-04 93ef3f2ab542b7b6fe941c30bf56b35e743cf299
src/main/webapp/static/js/priOnline2/priOnline.js
@@ -177,6 +177,9 @@
            case 'addBlank':
                showEditModel();
                break;
            case 'addBlank2':
                showEditModel2();
                break;
            case 'refreshData':
                tableIns.reload({
                    page: {
@@ -547,6 +550,42 @@
        });
    }
    /* 弹窗 - 新增、修改 */
    function showEditModel2(mData) {
        admin.open({
            type: 1,
            area: '800px',
            title: '接取' + '核价',
            content: $('#editDialogHJ').html(),
            success: function (layero, dIndex) {
                let loadNameXml = loadNameXmlSel()
                form.val('detailHJ', mData);
                form.on('submit(editSubmitHJ)', function (data) {
                    data.field.id = loadNameXml.getValue()[0] ? loadNameXml.getValue()[0].id : null;
                    $.ajax({
                        url: baseUrl+"/priOnline2/HJ/add/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: data.field,
                        method: 'POST',
                        success: function (res) {
                            if (res.code === 200){
                                layer.close(dIndex);
                                layer.msg(res.msg, {icon: 1});
                                tableReload()
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            }else {
                                layer.msg(res.msg, {icon: 2});
                            }
                        }
                    })
                });
                $(layero).children('.layui-layer-content').css('overflow', 'visible');
                layui.form.render('select');
            }
        });
    }
    //更新form
    function showEditForm(mData) {
        admin.open({
@@ -640,6 +679,35 @@
        })
    }
    window.loadNameXmlSel = function () {
        return xmSelect.render({
            el: '#nameXmlSel',
            autoRow: true,
            filterable: true,
            remoteSearch: true,
            clickClose: true,
            radio: true,
            remoteMethod: function (val, cb, show) {
                $.ajax({
                    url: baseUrl + "/priOnline2/HJ/search/auth",
                    headers: {'token': localStorage.getItem('token')},
                    data: {
                        condition: val
                    },
                    method: 'POST',
                    success: function (res) {
                        if (res.code === 200) {
                            cb(res.data)
                        } else {
                            cb([]);
                            layer.msg(res.msg, {icon: 2});
                        }
                    }
                });
            }
        });
    }
});
// 关闭动作