自动化立体仓库 - WMS系统
zhou zhou
2025-12-18 7f04f17507063dbd922055bf5dcd1190da686071
src/main/webapp/static/js/orderPakout/order.js
@@ -44,6 +44,8 @@
        cols: [[
            {type: 'numbers'},
            {field: 'orderNo', title: '单据编号', templet: '#orderNoTpl'},
            { field: 'orderTime', align: 'center', title: '业务时间' },
            { field: 'cstmrName', align: 'center', title: '客户' },
            {field: 'docType$', align: 'center', title: '类型',  minWidth: 160, width: 160},
            {align: 'center', title: '明细', toolbar: '#tbLook', minWidth: 160, width: 160},
            {field: 'createTime$', title: '创建时间', minWidth: 200, width: 200},
@@ -179,8 +181,63 @@
                if (expTpe) {
                    $('#orderNo').attr("disabled", "disabled");
                }
                // 初始化业务时间日期选择器
                layDate.render({
                    elem: '#orderTime',
                    type: 'datetime',
                    format: 'yyyy-MM-dd HH:mm:ss'
                });
                // 初始化客户选择器
                var cstmrData = [];
                $.ajax({
                    url: baseUrl + "/client/list/auth",
                    headers: { 'token': localStorage.getItem('token') },
                    data: { limit: 9999 },
                    method: 'POST',
                    async: false,
                    success: function (res) {
                        if (res.code === 200) {
                            // 转换为 xmSelect 需要的格式
                            res.data.records.forEach(function (item) {
                                cstmrData.push({
                                    name: item.name,
                                    value: item.code
                                });
                            });
                        } else {
                            layer.msg(res.msg, { icon: 2 });
                        }
                    }
                });
                var cstmrXmSelect = xmSelect.render({
                    el: '#cstmrSelect',
                    radio: true,
                    clickClose: true,
                    filterable: true,
                    create: function (val, arr) {
                        if (arr.length === 0) {
                            return {
                                name: val,
                                value: val
                            }
                        }
                    },
                    model: {
                        icon: 'hidden',
                        label: {
                            type: 'text',
                        }
                    },
                    data: cstmrData,
                    initValue: expTpe && expTpe.cstmr ? [expTpe.cstmr] : []
                });
                // 表单提交事件
                form.on('submit(orderEditSubmit)', function (data) {
                    // 验证客户必选
                    if (!cstmrXmSelect.getValue()[0]) {
                        layer.msg('请选择客户', { icon: 2 });
                        return false;
                    }
                    // 组装数据
                    if (xxDataList.length <= 0) {
                        layer.tips('请添加单据明细', '#matAddBtnComment', {tips: [1, '#ff4c4c']});
@@ -205,6 +262,8 @@
                            orderId: Number(data.field.id),
                            docType: Number(data.field.docType),
                            orderNo: data.field.orderNo,
                            cstmrName: cstmrXmSelect.getValue()[0] ? cstmrXmSelect.getValue()[0].name : null,
                            orderTime: data.field.orderTime,
                            orderDetlPakoutList: nList
                        }),
                        contentType:'application/json;charset=UTF-8',