红色代码部分 还是和一楼的代码实现的效果一样 会保存数据
想让这fun1() fun2() fun3() fun4() 四个函数 都不弹出任何信息的情况下再执行
var tables = [e.form.edittable1.getdata(), e.form.edittable2.getdata(), e.form.edittable3.getdata(), e.form.edittable5.getdata()];
data.tables = JSON.stringify(tables);
data.onlytable = true;
e.form.save(data, function() {
fun()
})
有没有办法操作呢?
({
button13: {
text: '{{text}}', //系统自动匹配标题
visible: true,
click: function() { //按钮单击事件
e.form.button13.save(function() {
var rows1 = e.form.edittable1.rows;
for (var i in rows1) {
let row1 = rows1[i];
$.post("form700_gengxinwancheng.Ajax", {
guid: row1.guid
},
function(res) {})
}
e.form.edittable1.load();
var rows2 = e.form.edittable2.rows;
for (var i in rows2) {
let row2 = rows2[i];
$.post("form700_gengxinwancheng.Ajax", {
guid: row2.guid,
},
function(res) {})
}
e.form.edittable2.load();
var rows3 = e.form.edittable3.rows;
for (var i in rows3) {
let row3 = rows3[i];
$.post("form700_gengxinwancheng.Ajax", {
guid: row3.guid
},
function(res) {})
}
e.form.edittable3.load();
var rows5 = e.form.edittable5.rows;
for (var i in rows5) {
let row5 = rows5[i];
$.post("form700_gengxinwancheng.Ajax", {
guid: row5.guid
},
function(res) {})
}
e.form.edittable5.load();
e.form.showloading("正在提交测评数据,谢谢合作!");
form694.form.table1.load();
e.form.closeloading();
// e.form.close();
})
},
save: function(fun) {
var data1 = {};
var youdengci1
var youdengci2
var youdengci3
var youdengci5
var data = e.form.getdata();
function fun1() {
var rows = e.form.edittable1.rows;
if (rows.length != 0) {
let sum = 0;
let ary = ["好", "较好", "一般", "较差"];
for (var i in rows) {
let row = rows[i];
if (row.好 == "" && row.较好 == "" && row.一般 == "" && row.较差 == "" && row.弃权 == "") {
// if(row.好=="×"&&row.较好=="×"&&row.一般=="×"&&row.较差=="×"){
// row.弃权= "√"
e.form.alert("【" + row.测评对象 + "】---好、较好、一般、较差、弃权至少选择一个!", "温馨提示")
e.form.tabs1.active = "TabPage1";
return;
}
}
for (var i in rows) {
let row = rows[i];
if (row.好 == "√") {
sum = sum + 1;
}
}
data1.tablename = "SYS_Dictionary";
data1.colname = "字典值";
data1.filter = "备注='参公' and 分类='考核优等次数量'";
e.form.getitems(data1, function(res1) {
youdengci1 = res1[0].value;
if (sum > youdengci1) {
e.form.alert("参公【好】等次只能<或=" + youdengci1 + ",当前大于" + sum + ",请核实!", "温馨提示")
e.form.tabs1.active = "TabPage1";
return ;
}
})
}
}
function fun2() {
var rows2 = e.form.edittable2.rows;
if (rows2.length != 0) {
let sum2 = 0;
let ary2 = ["好", "较好", "一般", "较差"];
for (var i2 in rows2) {
let row2 = rows2[i2];
if (row2.好 == "" && row2.较好 == "" && row2.一般 == "" && row2.较差 == "" && row2.弃权 == "") {
e.form.alert("【" + row2.测评对象 + "】---好、较好、一般、较差、弃权至少选择一个!", "温馨提示")
e.form.tabs1.active = "TabPage2";
return;
}
}
for (var i2 in rows2) {
let row2 = rows2[i2];
if (row2.好 == "√") {
sum2 = sum2 + 1;
}
}
data1.tablename = "SYS_Dictionary";
data1.colname = "字典值";
data1.filter = "备注='综合保障中心' and 分类='考核优等次数量'";
e.form.getitems(data1, function(res1) {
youdengci2 = res1[0].value;
if (sum2 > youdengci2) {
e.form.alert("综合保障中心【好】等次只能<或=" + youdengci2 + ",当前大于" + sum2 + ",请核实!", "温馨提示")
e.form.tabs1.active = "TabPage2";
return ;
}
})
}
}
function fun3() {
var rows3 = e.form.edittable3.rows;
if (rows3.length != 0) {
let sum3 = 0;
let ary3 = ["好", "较好", "一般", "较差"];
for (var i3 in rows3) {
let row3 = rows3[i3];
if (row3.好 == "" && row3.较好 == "" && row3.一般 == "" && row3.较差 == "" && row3.弃权 == "") {
// if(row.好=="×"&&row.较好=="×"&&row.一般=="×"&&row.较差=="×"){
// row.弃权= "√"
e.form.alert("【" + row3.测评对象 + "】---好、较好、一般、较差、弃权至少选择一个!", "温馨提示")
e.form.tabs1.active = "TabPage3";
return;
}
}
for (var i3 in rows3) {
let row3 = rows3[i3];
if (row3.好 == "√") {
sum3 = sum3 + 1;
}
}
data1.tablename = "SYS_Dictionary";
data1.colname = "字典值";
data1.filter = "备注='工勤人员' and 分类='考核优等次数量'";
e.form.getitems(data1, function(res1) {
youdengci3 = res1[0].value;
if (sum3 > youdengci3) {
e.form.alert("工勤人员【好】等次只能<或=" + youdengci3 + ",当前大于" + sum3 + ",请核实!", "温馨提示")
e.form.tabs1.active = "TabPage3";
return ;
}
})
}
}
function fun4() {
var rows5 = e.form.edittable5.rows;
if (rows5.length != 0) {
let sum5 = 0;
let ary5 = ["好", "较好", "一般", "较差"];
for (var i5 in rows5) {
let row5 = rows5[i5];
if (row5.好 == "" && row5.较好 == "" && row5.一般 == "" && row5.较差 == "" && row5.弃权 == "") {
// if(row.好=="×"&&row.较好=="×"&&row.一般=="×"&&row.较差=="×"){
// row.弃权= "√"
e.form.alert("【" + row5.测评对象 + "】---好、较好、一般、较差、弃权至少选择一个!", "温馨提示")
e.form.tabs1.active = "TabPage5";
return;
}
}
for (var i5 in rows5) {
let row5 = rows5[i5];
if (row5.好 == "√") {
sum5 = sum5 + 1;
}
}
data1.tablename = "SYS_Dictionary";
data1.colname = "字典值";
data1.filter = "备注='服务中心' and 分类='考核优等次数量'";
e.form.getitems(data1, function(res1) {
youdengci5 = res1[0].value;
if (sum5 > youdengci5) {
e.form.alert("服务中心【好】等次只能<或=" + youdengci5 + ",当前大于" + sum5 + ",请核实!", "温馨提示")
e.form.tabs1.active = "TabPage5";
return ;
}
})
}
}
fun1()
{
fun2()
{
fun3()
{
fun4()
{
}
}
}
var tables = [e.form.edittable1.getdata(), e.form.edittable2.getdata(), e.form.edittable3.getdata(), e.form.edittable5.getdata()];
data.tables = JSON.stringify(tables);
data.onlytable = true;
e.form.save(data, function() {
fun()
})
}
}
}
})
红色代码部分 还是和一楼的代码实现的效果一样 会保存数据
想让这fun1() fun2() fun3() fun4() 四个函数 都不弹出任何信息的情况下再执行
var tables = [e.form.edittable1.getdata(), e.form.edittable2.getdata(), e.form.edittable3.getdata(), e.form.edittable5.getdata()];
data.tables = JSON.stringify(tables);
data.onlytable = true;
e.form.save(data, function() {
fun()
})
有没有办法操作呢?