中扬CRM客户关系管理系统
#
LSH
2023-08-29 f68b291e69b92864db57bd76a614d2f312536b41
src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
@@ -452,7 +452,7 @@
                    cellMinWidth: 100,
                    cols: [[
                        {type: 'numbers', title: '#'},
                        {field: 'occupation', title: '事由', width: 100},
                        {field: 'occupation', title: '事由', width: 100, style: 'color: blue;font-weight: bold', templet: '#occupation'},
                        // {field: 'expenseType', title: '费用类型', width: 100},
                        {field: 'expenseType$', title: '费用类型', width: 100},
                        {field: 'taxRate', title: '税率', width: 60},
@@ -476,8 +476,29 @@
                        // {field: 'creationTime', title: '创建日期', width: 160}
                        {align: 'center', title: '操作', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80, fixed: 'right'}
                    ]],
                    done: function (res) {
                    done: function (res, curr, count) {
                        $(layero).find('.layui-table-view').css('margin', '0');
                        var options = this;
                        // 获取当前行数据
                        table.getRowData = function(elem){
                            var index = $(elem).closest('tr').data('index');
                            return table.cache[options.id][index] || {};
                        };
                        $('.input-occupation').on('text', function(){
                            var value = this.value; // 获取选中项 value
                            var data = table.getRowData(this);
                            console.log(value);
                            console.log("value------===");
                            xxDataList.forEach(res => {
                                if (data.id === res.id){
                                    console.log(res)
                                    res.occupation = value;
                                }
                            })
                        });
                    },
                    size: ''
                };
@@ -560,6 +581,7 @@
                            // 表单提交事件
                            form.on('submit(matEditSubmit)', function (data) {
                                let selectList = matXmSelect.getValue();
                                console.log(selectList)
                                for (let i = 0; i<selectList.length; i++) {
                                    let item = selectList[i];
                                    // 查询物料详情
@@ -571,13 +593,16 @@
                                        success: function (res) {
                                            if (res.code === 200){
                                                var bige=true;
                                                for (var j = 0; j < xxDataList.length; j++) {
                                                    if (xxDataList[j].matnr === res.data.matnr && xxDataList[j].batch === res.data.batch) {
                                                        bige=false;
                                                        break;
                                                    }
                                                }
                                                // console.log("-------2.1-------")
                                                // for (var j = 0; j < xxDataList.length; j++) {
                                                //     if (xxDataList[j].expenseType === res.data.expenseType && xxDataList[j].batch === res.data.batch) {
                                                //         bige=false;
                                                //         console.log("-------2.2-------")
                                                //         break;
                                                //     }
                                                // }
                                                if (bige){
                                                    // console.log("-------2.3-------")
                                                    xxDataList.push(res.data);
                                                    insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
                                                }