1
yangle
2024-04-02 c92a58fa7f3df1a15914fd59709a053f8e15d538
WebTM/views/É豸¹ÜÀí/Sb_EquipDotCheckPlanBillEdit.html
@@ -702,6 +702,7 @@
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    if (checkStatus.data.length === 1) {
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HDotCheckItemID: checkStatus.data[0].HItemID,
@@ -710,6 +711,27 @@
                                        //HDotCheckPart: 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]["HDotCheckItemID"] != 0 && tableBak[i]["HDotCheckItemID"] != "" && tableBak[i]["HDotCheckItemID"] != undefined && tableBak[i]["HDotCheckItemID"] != null) {
                                                buttonArr.push(tableBak[i]);  //如果关键字段不为空,则将之前的数据存储
                                            }
                                        }
                                        //将批量选择的数据写入数组(多选行)
                                        for (var i = 0; i < checkStatus.data.length; i++) {
                                            buttonArr.push({ "HDotCheckItemID": checkStatus.data[i].HItemID, "HDotCheckCode": checkStatus.data[i].点检项目代码, "HDotCheckItem": checkStatus.data[i].点检项目名称, "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "" });
                                        }
                                        table.reload("mainTable", {
                                            data: buttonArr    //将数据重新载入表格
                                        })
                                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                    }
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调