修改从表中枚举多选保存不上问题

master
孙亮 6 months ago
parent 9ad24aed77
commit 8e859a4e9d

@ -352,11 +352,12 @@
function newRowParse(insertTr, newRowIndex) { function newRowParse(insertTr, newRowIndex) {
var threadTh = getUseHeadTh(); var threadTh = getUseHeadTh();
var isNewRow = true;
$.each(threadTh, function (k, threadThObj) { $.each(threadTh, function (k, threadThObj) {
if ($(threadThObj).data().colname != undefined) { if ($(threadThObj).data().colname != undefined) {
var o = $(threadThObj); var o = $(threadThObj);
var tmplate = figure_MapAttr_Template(o.data()); var tmplate = figure_MapAttr_Template(o.data(), isNewRow);
if (o.data().UIIsInput == 1) { if (o.data().UIIsInput == 1) {
tmplate.attr('class', "mustInput"); tmplate.attr('class', "mustInput");
} }
@ -374,6 +375,7 @@
} }
}); });
var td = $('<td align="center" style="vertical-align: middle;" class="My-Handle"></td>'); var td = $('<td align="center" style="vertical-align: middle;" class="My-Handle"></td>');
if (o.data().UIVisible == 0) if (o.data().UIVisible == 0)
td = $('<td style="display:none"></td>'); td = $('<td style="display:none"></td>');
@ -458,14 +460,20 @@
} }
else { else {
if (textVal !="-1") {
tmplate.val(textVal); tmplate.val(textVal);
} }
}
var td = $('<td style="vertical-align: middle;" class="My-Handle"></td>'); var td = $('<td style="vertical-align: middle;" class="My-Handle"></td>');
if (mapAttr.MyDataType == 1 && (mapAttr.TextModel == 0 || mapAttr.TextModel == 2)) if (mapAttr.MyDataType == 1 && (mapAttr.TextModel == 0 || mapAttr.TextModel == 2))
td = $('<td style="vertical-align: middle;"></td>'); td = $('<td style="vertical-align: middle;"></td>');
if (o.data().UIVisible == 0) if (o.data().UIVisible == 0)
td = $('<td style="display:none"></td>'); td = $('<td style="display:none"></td>');
//td.text('');
$($(insertTr).children('td')[k]).text('');
td.append(tmplate); td.append(tmplate);
insertTr.append(td); insertTr.append(td);
if (mapAttr.UIContralType == 6) if (mapAttr.UIContralType == 6)
@ -1930,13 +1938,13 @@
} }
//升级表单元素 初始化文本框、日期、时间 //升级表单元素 初始化文本框、日期、时间
function figure_MapAttr_Template(mapAttr) { function figure_MapAttr_Template(mapAttr,isNewRow) {
var eleHtml = ''; var eleHtml = '';
if (mapAttr.UIVisible == 1) {//是否显示 if (mapAttr.UIVisible == 1) {//是否显示
var str = ''; var str = '';
var defValue = ConvertDefVal(workNodeData, mapAttr.DefVal, mapAttr.KeyOfEn); var defValue = ConvertDefVal(workNodeData, mapAttr.DefVal, mapAttr.KeyOfEn,isNewRow);
defValue = GetValByDefVal(defValue, mapAttr); defValue = GetValByDefVal(defValue, mapAttr);
var isInOneRow = false; //是否占一整行 var isInOneRow = false; //是否占一整行
var islabelIsInEle = false; // var islabelIsInEle = false; //
@ -3570,7 +3578,7 @@
} }
//填充默认数据 //填充默认数据
function ConvertDefVal(workNodeData, defVal, keyOfEn, myDataType) { function ConvertDefVal(workNodeData, defVal, keyOfEn, myDataType,isNewRow) {
//计算URL传过来的表单参数@TXB_Title=事件测试 //计算URL传过来的表单参数@TXB_Title=事件测试
var pageParams = getQueryString(); var pageParams = getQueryString();
@ -3586,7 +3594,7 @@
//通过MAINTABLE返回的参数 //通过MAINTABLE返回的参数
for (var ele in workNodeData.DBDtl[0]) { for (var ele in workNodeData.DBDtl[0]) {
if (keyOfEn == ele && workNodeData.DBDtl[0][ele] != '') { if (keyOfEn == ele && workNodeData.DBDtl[0][ele] != '' && isNewRow == true) {
result = workNodeData.DBDtl[0][ele]; result = workNodeData.DBDtl[0][ele];
break; break;
} }

Loading…
Cancel
Save