#
luxiaotao1123
2021-04-12 0b88bff9c283553707d493360b68c7752509602e
src/main/webapp/static/js/ioWorks/matQuery.js
@@ -13,12 +13,14 @@
    base: baseUrl + "/static/layui/lay/modules/"
}).extend({
    notice: 'notice/notice',
}).use(['table','laydate', 'form',  'notice'], function() {
}).use(['table','laydate', 'form', 'admin', 'notice'], function() {
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var form = layui.form;
    var notice = layui.notice;
    var layDate = layui.laydate;
    var admin = layui.admin;
    tableIns = table.render({
        elem: '#chooseData',
@@ -61,16 +63,80 @@
                            return false;
                        }
                    }
                    var index = layer.load(1, {shade: [0.1,'#000']});
                    // 单据类型
                    var docTypeData;
                    $.ajax({
                        url: baseUrl+"/work/docType/all/get",
                        headers: {'token': localStorage.getItem('token')},
                        method: 'POST',
                        async: false,
                        success: function (res) {
                            if (res.code === 200){
                                docTypeData = res;
                            } else {
                                layer.msg(res.msg, {icon: 2})
                            }
                        }
                    });
                    var tpl1 = $('#docTypeSelectTpl').html();
                    var template1 = Handlebars.compile(tpl1);
                    var html1 = template1(docTypeData);
                    $("#docType").html(html1);
                    // 客户
                    var cstmrData;
                    $.ajax({
                        url: baseUrl+"/work/cstmr/all/get",
                        headers: {'token': localStorage.getItem('token')},
                        method: 'POST',
                        async: false,
                        success: function (res) {
                            if (res.code === 200){
                                cstmrData = res;
                            } else {
                                layer.msg(res.msg, {icon: 2})
                            }
                        }
                    });
                    var tpl2 = $('#cstmrSelectTpl').html();
                    var template2 = Handlebars.compile(tpl2);
                    var html2 = template2(cstmrData);
                    $("#cstmr").html(html2);
                    // 项目
                    var itemData;
                    $.ajax({
                        url: baseUrl+"/work/item/all/get",
                        headers: {'token': localStorage.getItem('token')},
                        method: 'POST',
                        async: false,
                        success: function (res) {
                            if (res.code === 200){
                                itemData = res;
                            } else {
                                layer.msg(res.msg, {icon: 2})
                            }
                        }
                    });
                    var tpl3 = $('#itemSelectTpl').html();
                    var template3 = Handlebars.compile(tpl3);
                    var html3 = template3(itemData);
                    $("#item").html(html3);
                    layer.close(index);
                    if (success) {
                        layer.open({
                        admin.open({
                            type: 1,
                            title: '定义采购退货单编号',
                            title: '单据填充',
                            offset: '100px',
                            area: ['360px'],
                            shade: 0.1,
                            shade: 0.3,
                            content: $('#getOrderNo'),
                            success: function(layero, index){
                                layer.iframeAuto(index)
                                layer.iframeAuto(index);
                                $(layero).children('.layui-layer-content').css('overflow', 'visible');
                                layui.form.render('select');
                            },
                            cancel: function () {
                                $('#orderNo').val('');
@@ -172,6 +238,12 @@
        }});
    }
    layDate.render({
        elem: '#orderTime',
        trigger: 'click',
        type: 'date'
    });
})
// 提取物料