yangle
2024-03-28 d740ef122b2e776fccd91b409eae8f5a01c1775d
WebTM/views/ÖÊÁ¿¹ÜÀí/¼ìÑé·½°¸µ¥/QC_Add_CheckProject.html
@@ -444,14 +444,36 @@
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    if (checkStatus.data.length === 1) {
                                        //同步更新表格和缓存对应的值
                                        obj.update({
                                            HQCCheckItemID: checkStatus.data[0].HItemID,
                                            HQCCheckItemNumber: checkStatus.data[0].代码,
                                            HQCCheckItemName: checkStatus.data[0].名称,
                                        });
                                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                    } else {
                                        //(多选行)
                                        //将原有表体数据写入数组
                                        var tableBak = table.cache["mainTable"]; //获取之前编辑过的表格数据
                                        buttonArr = [];//清空数组
                                        for (var i = 0; i < tableBak.length; i++) {
                                            if (tableBak[i]["HQCCheckItemID"] != 0 || tableBak[i]["HQCCheckItemID"] != "") {
                                                buttonArr.push(tableBak[i]);  //如果关键字段不为空,则将之前的数据存储
                                            }
                                        }
                                        //将批量选择的数据写入数组(多选行)
                                        for (var i = 0; i < checkStatus.data.length; i++) {
                                            buttonArr.push({ "HPrjNo": 0, "HQCCheckItemID": checkStatus.data[i].HItemID, "HQCCheckItemNumber": checkStatus.data[i].代码, "HQCCheckItemName": checkStatus.data[i].名称, "HQCStd": "", "HQCStdMax": "", "HQCUnit": "", "HRemark": "" });
                                        }
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HQCCheckItemID: checkStatus.data[0].HItemID,
                                        HQCCheckItemNumber: checkStatus.data[0].代码,
                                        HQCCheckItemName: checkStatus.data[0].名称,
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                        table.reload("mainTable", {
                                            data: buttonArr    //将数据重新载入表格
                                        })
                                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                    }
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
@@ -522,7 +544,7 @@
                columns = [
                    { type: 'checkbox', fixed: 'left', totalRowText: '合计行' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe" }
                    , { field: 'HPrjNo', title: '次序号', edit: 'text' }
                    , { field: 'HPrjNo', title: '次序号', edit: 'text', hide: true }
                    , { field: 'HQCCheckItemID', title: '检验项目ID', edit: 'text', hide: true }
                    , { field: 'HQCCheckItemNumber', title: '检验项目代码', edit: 'text', event: 'HQCCheckItemNumber' }
                    , { field: 'HQCCheckItemName', title: '检验项目名称', edit: 'text' }