中扬CRM客户关系管理系统
#
LSH
2023-10-16 5ce545da7161c9fe0d82c6646381c517b34fe1d8
src/main/webapp/static/js/contract/contract.js
@@ -1,7 +1,7 @@
var pageCurr;
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).use(['table', 'laydate', 'form', 'admin', 'tree', 'dropdown'], function () {
}).use(['table', 'laydate', 'form', 'admin','xmSelect', 'tree', 'dropdown'], function () {
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
@@ -250,9 +250,12 @@
            title: (mData ? '修改' : '添加') + '合同',
            content: $('#editDialog').html(),
            success: function (layero, dIndex) {
                let loadNameXml = loadNameXmlSel()
                console.log(loadNameXml)
                layDateRender(mData);
                form.val('detail', mData);
                form.on('submit(editSubmit)', function (data) {
                    data.field.customer = loadNameXml.getValue()[0] ? loadNameXml.getValue()[0].name : null;
                    var loadIndex = layer.load(2);
                    $.ajax({
                        url: baseUrl + "/contract/" + (mData ? 'update' : 'add') + "/auth",
@@ -523,6 +526,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 + "/cstmr/all/get/kv",
                    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});
                        }
                    }
                });
            },
        });
    }
});
// 关闭动作