| | |
| | | // itemvalue = customBase.getItemValue(itemId,type); |
| | | // } |
| | | // if(value == 8888){ |
| | | // ////console.log(itemvalue) |
| | | // //// |
| | | // } |
| | | // if(itemvalue == undefined || itemvalue == '' || itemvalue == 0){ |
| | | // customBase.setItemValue(itemId,type,value,"","",num); |
| | |
| | | //} |
| | | |
| | | //customBase.submitForm = function(){ |
| | | // ////console.log(window.customBase); |
| | | // ////console.log(window.customShow); |
| | | // //// |
| | | // //// |
| | | // var submit_data = { |
| | | // "formId":customShow.options.formid, |
| | | // "dataRowNUm":customShow.options.dataRowNum |
| | |
| | | // var customShow = window.customShow; |
| | | // // 2017/10/17 李元杰 msgInfo渲染 |
| | | // customBase.groupInfo(res_data) |
| | | //// ////console.log(window.customBase); |
| | | //// //// |
| | | // _.each(res_data.data,function(redata){ |
| | | // var cu_item = customBase.options.customItems[redata.fieldKey]; |
| | | // ////console.log(cu_item) |
| | | // //// |
| | | // if(cu_item != undefined && cu_item.type != "dropdownlist" && cu_item.type != "subform"){ |
| | | // customBase.query_set_value(cu_item.id,cu_item.type,redata.value); |
| | | // } |
| | |
| | | // var check_minfo = undefined; |
| | | // _.each(redata.msgInfo.header,function(minfo){ |
| | | // if(minfo.validate){ |
| | | // //console.log(minfo) |
| | | // // |
| | | // $("#"+base_item_id+"ActiveId").find("h8[name='el_title']").append("<span class='" + classname + "'>" + minfo.name + ":" + minfo.value + "</span>"); |
| | | // check_minfo = minfo; |
| | | // }else{ |
| | |
| | | // }); |
| | | // } |
| | | // var sub_type = customShow.options.customItemShow.item[base_item_id].tag_Attribute.allcopy; |
| | | //// ////console.log(sub_type); |
| | | //// //// |
| | | // _.each(redata.child,function(recd,i){ |
| | | // _.each(recd.items,function(recd_item){ |
| | | // ////console.log(recd_item); |
| | | // ////console.log(customShow.options.customItemShow); |
| | | // //// |
| | | // //// |
| | | // var cu_cd_item = customBase.options.customItems[recd_item.fieldKey]; |
| | | // ////console.log(cu_cd_item); |
| | | // //// |
| | | // if(cu_cd_item != undefined && cu_cd_item.type != "dropdownlist"){ |
| | | // customBase.query_set_value(cu_cd_item.id,cu_cd_item.type,recd_item.value,i); |
| | | // } |
| | |
| | | // var base_item_cd = $("[fieldKey='" + recd_item.fieldKey + "']:eq('" + i + "')"); |
| | | // var base_item_id_cd = base_item_cd.attr('id'); |
| | | // var base_item_type_cd = base_item_cd.attr('type'); |
| | | //// ////console.log(base_item_cd); |
| | | //// ////console.log(base_item_id_cd); |
| | | //// ////console.log(base_item_type_cd); |
| | | //// ////console.log(recd_item); |
| | | //// //// |
| | | //// //// |
| | | //// //// |
| | | //// //// |
| | | // if(sub_type){ |
| | | // $("[id='"+base_item_id_cd+"ActiveId']:eq('" + i + "')").find("." + classname).remove(); |
| | | // }else{ |
| | |
| | | // if(recd_item.msgInfo){ |
| | | // var check_minfo_cd = undefined; |
| | | // _.each(recd_item.msgInfo.header,function(minfo_cd){ |
| | | //// ////console.log($("#"+base_item_id_cd+"ActiveId")); |
| | | //// ////console.log($("[id='"+base_item_id_cd+"ActiveId']:eq('" + i + "')")); |
| | | //// //// |
| | | //// //// |
| | | // if(minfo_cd.validate){ |
| | | // check_minfo_cd = minfo_cd; |
| | | // if(sub_type){ |
| | |
| | | //// if(base_item.length > 0){ |
| | | //// var base_item_id = base_item.attr('id'); |
| | | //// var base_item_type = base_item.attr('type'); |
| | | //// ////console.log(base_item_id); |
| | | //// ////console.log($("#"+base_item_id+"ActiveId").find(".listen_check")); |
| | | //// //// |
| | | //// //// |
| | | //// if($("#"+base_item_id+"ActiveId").find(".listen_check").length == 0){ |
| | | //// $("#"+base_item_id+"ActiveId").find("h8[name='el_title']").append("<span class='listen_check'>" + redata.amount + "</span>"); |
| | | //// }else{ |
| | |
| | | // }else{ |
| | | // var now_value = customBase.getItemValue(base_item_id, base_item_type)[i]; |
| | | // } |
| | | // ////console.log(base_item_id); |
| | | // ////console.log($("#" + base_item_id + "ActiveId")); |
| | | // ////console.log($("[id='"+base_item_id+"ActiveId']:eq('" + i + "')")); |
| | | // //// |
| | | // //// |
| | | // //// |
| | | // if(sub_type){ |
| | | // $("[id='"+base_item_id+"ActiveId']:eq('" + i + "')").find("." + classname).css("color", "#333"); |
| | | // if(now_value != minfo.value) { |
| | |
| | | setItem: function (itemId, type, value, showClass) { |
| | | //被选择项目设定 |
| | | checkboxRadioItem = function (itemList, value) { |
| | | console.log(itemList) |
| | | |
| | | if (typeof value == "string") { |
| | | value = [value]; |
| | | } |
| | |
| | | }, |
| | | setItem: function (itemId, value, showClass) { |
| | | itemId = itemId+"Item"; |
| | | console.log(value) |
| | | var rValue = value.join(",");//html回显bug修改 李伟民 0201 |
| | | |
| | | var rValue = value.join(",");//html回显bug修改 0201 |
| | | if(showClass ==undefined){ |
| | | showClass = 'customViewUEditorCss'; |
| | | } |
| | |
| | | return itemListReturn; |
| | | }, |
| | | setItem: function (itemId, value, showClass, dropdowntype) { |
| | | console.log(value) |
| | | |
| | | // var select2Item = customBase.options.dropdownlistText[itemId]; |
| | | // //单多选框数据设定 |
| | | // //2017/10/27 马习同修改 |
| | | // //2017/10/27 修改 |
| | | // var customItem = customBase.options.customItems; |
| | | // var itemAttr = ""; |
| | | // for(let key in customItem){ |
| | |
| | | // itemAttr = customItem[key]; |
| | | // } |
| | | // } |
| | | // console.log(_.cloneDeep(customItem)) |
| | | // console.log(itemAttr); |
| | | // //2017/10/27 马习同修改 |
| | | // |
| | | // |
| | | // //2017/10/27 修改 |
| | | // setelect2Item = function (itemId,value){ |
| | | // if(typeof value == "string"){ |
| | | // value = [value]; |
| | |
| | | // } |
| | | // $(itemId).val(itemsTemp).trigger("change"); |
| | | // } |
| | | // //多个下拉菜单 马习同 |
| | | // //多个下拉菜单 |
| | | // var itemList = $("."+showClass+" #itemId_"+itemAttr.parentsubFormNum+" ."+itemId+"value"); |
| | | // var itemList1 = $("."+showClass+" ."+itemId+"value"); |
| | | // console.log(itemList); |
| | | // console.log(itemList1); |
| | | // console.log(value) |
| | | // |
| | | // |
| | | // |
| | | // if(itemList.length ==1){ |
| | | // setelect2Item(itemList[0],value); |
| | | // }else{ |
| | | // for (var i = 0; i < itemList.length; i++) { |
| | | // console.log(value) |
| | | // console.log(itemList[i],value[i]) |
| | | // |
| | | // |
| | | // setelect2Item(itemList1[i],value[i]); |
| | | // } |
| | | // } |
| | |
| | | return itemListReturn; |
| | | }, |
| | | setItem: function (itemId, value, showClass, dropdowntype) { |
| | | //2017/10/27 马习同修改 |
| | | console.log(value); |
| | | //2017/10/27 修改 |
| | | |
| | | var customItem = customBase.options.customItems; |
| | | var itemAttr = ""; |
| | | for (let key in customItem) { |
| | |
| | | itemAttr = customItem[key]; |
| | | } |
| | | } |
| | | //2017/10/27 马习同修改 |
| | | //2017/10/27 修改 |
| | | |
| | | var select2Item = customBase.options.dropdownlistText[itemId]; |
| | | if (itemAttr.parentsubFormNum != 0) {//非子表单中 无需添加parentformnum 李伟民 11-14 |
| | | if (itemAttr.parentsubFormNum != 0) {//非子表单中 无需添加parentformnum 11-14 |
| | | var itemList = $("#itemId_" + itemAttr.parentsubFormNum + " #" + itemId); |
| | | } else { |
| | | var itemList = $("#" + itemId); |
| | | } |
| | | console.log(itemList); |
| | | |
| | | if (itemList.length == 1) { |
| | | // setelect2Item(itemId,value,0); |
| | | xhSelect.setValue(itemId, value, 0) |
| | |
| | | // fileReturn.push(customBase.options.uploaderItemReady[itemId][i]); |
| | | } |
| | | }; |
| | | //////console.log(fileReturn); |
| | | ////// |
| | | return fileReturn; |
| | | }, |
| | | setItem: function (itemId, value) { |
| | |
| | | if (treeItem[i].getAttribute("value") == "") { |
| | | var treeItem = {}; |
| | | } else { |
| | | ////console.log(selectItme[i].getAttribute("value")); |
| | | //// |
| | | dataItemJSson = $.parseJSON(treeItem[i].getAttribute("value")); |
| | | } |
| | | |
| | |
| | | }, |
| | | setItem: function (itemId, value) { |
| | | var treeDiv = $('div#' + itemId); |
| | | console.log(value) |
| | | |
| | | // 判断是否在子表单内 |
| | | var isSubformTree = false; |
| | | _.forIn(customShow.options.customItemShow.item, function (value, key) { |
| | |
| | | // 更新数据的时候需要在div上绑定一个存储数据的value |
| | | // 单选 |
| | | if(value) |
| | | console.log(value); |
| | | |
| | | // if(value == ' '){ |
| | | // if(value == ' '){ |
| | | // value = window.localStorage.getItem('businessTypeAuto'); |
| | | // value = window.getEnclocal('businessTypeAuto'); |
| | | // } |
| | | // }else{ |
| | | if (typeof value == "string") { |
| | |
| | | } |
| | | } |
| | | $('#' + itemId).attr('value', JSON.stringify(dataObj)) |
| | | console.log(value) |
| | | console.log(itemId) |
| | | |
| | | |
| | | var b = $('#'+itemId + "tree") |
| | | console.log($('#'+itemId + "tree")) |
| | | |
| | | var treeObj = $.fn.zTree.getZTreeObj(itemId + "tree"); |
| | | console.log(treeObj) |
| | | |
| | | if (treeObj == null) { |
| | | return; |
| | | } |
| | |
| | | for (var i = 0, l = value.length; i < l; i++) { |
| | | if (treeObj.setting.check.chkStyle == "radio") { |
| | | // 单选 |
| | | console.log(value) |
| | | |
| | | var nodes = treeObj.getNodeByParam("id", value[i], null); |
| | | console.log(nodes); |
| | | |
| | | if (_.isNull(nodes)) { |
| | | // treeObj.checkAllNodes(false); |
| | | // return false; |
| | |
| | | if (value == nodes.id) { |
| | | value = nodes.name; |
| | | } |
| | | console.log(value) |
| | | |
| | | if (nodes != null) { |
| | | // 2017 /11/6 选中 |
| | | //选择节点设定 |
| | |
| | | // 多选 |
| | | for (var j = 0; j < value[i].length; j++) { |
| | | //取得设定节点 |
| | | console.log(value[j]); |
| | | |
| | | var nodes = treeObj.getNodeByParam("id", value[j], null); |
| | | console.log(nodes) |
| | | |
| | | if (_.isNull(nodes)) { |
| | | // treeObj.checkAllNodes(false); |
| | | // return false; |
| | |
| | | if (value[j] == nodes.id) { |
| | | value[j] = nodes.name; |
| | | } |
| | | console.log(nodes) |
| | | |
| | | if (nodes != null) { |
| | | // 2017 /11/6 选中 |
| | | //选择节点设定 |
| | |
| | | // ${value} |
| | | // </div>` |
| | | // $('#customShow').find(`#${itemId}ActiveId`).children(':nth-child(4)').remove(); |
| | | $('#customShow').find(`[treeitemid=${itemId}]`).html(value);//普通模式树形回显 李伟民 0130 |
| | | $('#customShow').find(`[treeitemid=${itemId}]`).html(value);//普通模式树形回显 0130 |
| | | // $('#customShow').find(`#${itemId}ActiveId`).append(showTreeDiv); |
| | | $('#' + itemId).parents('div[name="TreeWin"]').find('.citySel').val(value); |
| | | // } |
| | |
| | | var valueData = []; |
| | | // 更新数据的时候需要在div上绑定一个存储数据的value |
| | | // 单选 |
| | | console.log(value); |
| | | |
| | | // 不在子表单里的树更新时需要的数据 |
| | | if(value){ |
| | | if (typeof value[0] == "string" && value[0]!= '') { |
| | |
| | | // var treeObj = $.fn.zTree.getZTreeObj(itemId + "tree1"); |
| | | // 单选 |
| | | var nodes = treeObj.getNodeByParam("id", value[i], null); |
| | | console.log(nodes) |
| | | |
| | | if (_.isNull(nodes)) { |
| | | |
| | | var tid = ''; |
| | |
| | | for (var i = 0; i < nodes.length; i++) { |
| | | tid = nodes[i].tId |
| | | } |
| | | console.log(tid) |
| | | |
| | | // 强行制空 |
| | | $('#'+tid+'_check').click() |
| | | $('#' + tid + '_check').click() |
| | |
| | | if (nodes != null) { |
| | | // 2017 /11/6 选中 |
| | | //选择节点设定 |
| | | console.log(nodes) |
| | | |
| | | treeObj.checkNode(nodes, true, true); |
| | | treeObj.expandAll(true); |
| | | console.log(treeObj) |
| | | |
| | | var tid = ''; |
| | | nodes11 = treeObj.getCheckedNodes(true); |
| | | console.log(nodes11) |
| | | |
| | | for (var i = 0; i < nodes11.length; i++) { |
| | | tid = nodes11[i].tId |
| | | } |
| | | console.log(tid); |
| | | // console.log($('#'+tid+'_check')) |
| | | |
| | | // |
| | | // $('#'+tid+'_check').click() |
| | | // $('#'+tid+'_check').click() |
| | | |
| | |
| | | // 多选 |
| | | for (var j = 0; j < value[i].length; j++) { |
| | | //取得设定节点 |
| | | console.log(value[i][j]); |
| | | |
| | | var nodes = treeObj.getNodeByParam("id", value[i][j], null); |
| | | console.log(nodes) |
| | | |
| | | if (_.isNull(nodes)) { |
| | | // treeObj.checkAllNodes(false); |
| | | // return false; |
| | |
| | | if (value[i][j] == nodes.id) { |
| | | value[i][j] = nodes.name; |
| | | } |
| | | console.log(nodes) |
| | | |
| | | if (nodes != null) { |
| | | // 2017 /11/6 选中 |
| | | //选择节点设定 |
| | | treeObj.checkNode(nodes, true, true); |
| | | treeObj.expandAll(true); |
| | | console.log(treeObj) |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | $($(showItem[i])[0]).remove(); |
| | | } |
| | | var treeDiv = $('div#' + itemId); |
| | | console.log(treeDiv) |
| | | |
| | | // 插入input里的value |
| | | var iptValue = []; |
| | | var iptValueObj = {}; |
| | |
| | | // 2017/11/6 回显的地方 |
| | | // 单选 |
| | | if (treeObj.setting.check.chkStyle == "radio") { |
| | | console.log($(treeDiv[j])) |
| | | console.log(value); |
| | | |
| | | |
| | | for (var i = 0; i < value.length; i++) { |
| | | if (value[i] == '') { |
| | | console.log(1) |
| | | |
| | | // dataObj = {} |
| | | } else { |
| | | console.log(2) |
| | | |
| | | if (i == j) { |
| | | dataObj[value[i]] = '1'; |
| | | } |
| | |
| | | } |
| | | $(treeDiv[j]).attr('value', JSON.stringify(dataObj)) |
| | | dataObj = {} |
| | | console.log(j) |
| | | console.log(value[j]) |
| | | |
| | | |
| | | var nodes = treeObj.getNodeByParam("id", value[j], null); |
| | | console.log(nodes) |
| | | console.log(treeObj) |
| | | |
| | | |
| | | if (_.isNull(nodes)) { |
| | | // treeObj.checkAllNodes(false); |
| | | var tid = ''; |
| | |
| | | for (var i = 0; i < nodes.length; i++) { |
| | | tid = nodes[i].tId |
| | | } |
| | | console.log(tid) |
| | | |
| | | $('#' + tid + '_check').click() |
| | | $(treeDiv[j]).prev().find('.citySel').val('') |
| | | } else { |
| | |
| | | if (nodes != null) { |
| | | // 2017 /11/6 选中 |
| | | //选择节点设定 |
| | | console.log(treeObj); |
| | | console.log(nodes) |
| | | |
| | | |
| | | treeObj.checkNode(nodes, true, true); |
| | | treeObj.expandAll(true); |
| | | } |
| | |
| | | } else { |
| | | // 多选 |
| | | |
| | | console.log(value[j]) |
| | | |
| | | if (typeof value[j] == "string") { |
| | | var strValue = value[j].split(','); |
| | | // 导入excel时状态多选为字符串形式 |
| | | if (strValue.length > 1) { |
| | | console.log(strValue) |
| | | |
| | | for (var n = 0; n < strValue.length; n++) { |
| | | var nodes = treeObj.getNodeByParam("id", strValue[n], null); |
| | | console.log(nodes) |
| | | |
| | | if (strValue[n] == '') { |
| | | |
| | | } else { |
| | |
| | | mytext: { |
| | | getItem: function (itemId) { |
| | | // var newmytextObj = $('#'+itemId+' ul'); |
| | | // console.log(newmytextObj); |
| | | // |
| | | // var chooseFormData = {}; |
| | | // var str = []; |
| | | // _.each(newmytextObj,(opt,i)=>{ |
| | | // var $mytextObj = $('#'+opt.id+' [class="data1 DATAROWNUM"]'); |
| | | // var $mytextObj2 = $('#'+opt.id+' [class="data2 DATAROWNUM"]'); |
| | | //// console.log($mytextObj); |
| | | //// console.log($mytextObj2); |
| | | //// console.log($mytextObj.html()); |
| | | //// console.log($mytextObj2.html()); |
| | | //// |
| | | //// |
| | | //// |
| | | //// |
| | | //// for(let i = 0;i < $mytextObj.length ;i++){ |
| | | //// var $myText = $mytextObj.eq(i).html(); |
| | | //// console.log($myText) |
| | | //// console.log($mytextObj2.eq(i).html()) |
| | | //// |
| | | //// |
| | | //// chooseFormData[$myText] = $mytextObj2.eq(i).html(); |
| | | //// |
| | | //// } |
| | | //// dataArr1.push($mytextObj2.html()); |
| | | // console.log(i); |
| | | // console.log(newmytextObj.length); |
| | | // |
| | | // |
| | | // if(i<newmytextObj.length-1){ |
| | | // str += $mytextObj2.html()+","; |
| | | // }else{ |
| | | // str += $mytextObj2.html(); |
| | | // } |
| | | // }) |
| | | // console.log(str) |
| | | // |
| | | |
| | | var str = $('#' + itemId).attr("mxtVal");//关联数据 取值 11-07 李伟民 |
| | | var str = $('#' + itemId).attr("mxtVal");//关联数据 取值 11-07 |
| | | return str; |
| | | |
| | | |
| | | }, |
| | | setItem: function (itemId, value) { |
| | | console.log(value); |
| | | |
| | | if (!_.isString(value)) { |
| | | var new_value = []; |
| | | _.each(value.list, function (v) { |
| | |
| | | } |
| | | }); |
| | | new_value = new_value.join(); |
| | | $('#' + itemId).attr("mxtVal", new_value);//关联数据 存值 11-07 李伟民 |
| | | $('#' + itemId).attr("mxtVal", new_value);//关联数据 存值 11-07 |
| | | } else { |
| | | $('#' + itemId).attr("mxtVal", value);//关联数据 存值 11-07 李伟民 |
| | | $('#' + itemId).attr("mxtVal", value);//关联数据 存值 11-07 |
| | | } |
| | | }, |
| | | }, |
| | |
| | | customBase.getItemValue = function (itemId, type) { |
| | | |
| | | var item = ""; |
| | | //单行文本 多行文本 数字 日历 customBase.itemEdit var prefix = JSON.parse(window.localStorage.getItem("customItem")); |
| | | //单行文本 多行文本 数字 日历 customBase.itemEdit var prefix = JSON.parse(window.getEnclocal("customItem")); |
| | | if (type == 'text' || type == 'textarea' || type == 'number' || type == 'calendar' || type == "auto") { |
| | | item = customBase.itemEdit['text'].getItem("." + itemId + "value"); |
| | | } else if (type == 'radio' || type == 'checkbox') { |
| | |
| | | } |
| | | //设定表单画面项目 12/7 |
| | | customBase.setItemValue = function (itemId, type, value, showClass, dropdowntype, num) { |
| | | console.log(type) |
| | | console.log(value) |
| | | console.log(itemId) |
| | | |
| | | |
| | | |
| | | var item; |
| | | if (showClass == "") { |
| | | showClass = 'customViewUEditorCss'; |
| | |
| | | } else if (type == 'tree') { |
| | | customBase.itemEdit['tree'].setItem(itemId, value); |
| | | } else if (type == 'dropdownlistText') { |
| | | //console.log(value); |
| | | // |
| | | customBase.itemEdit[type].setItem(itemId, value, showClass, dropdowntype); |
| | | //console.log(1); |
| | | // |
| | | customBase.itemEdit["dropdownlistText2"].setItem(itemId, value, showClass, dropdowntype); |
| | | } else if (type == 'splitline' || type == 'subform' || type == 'tag' || type == 'tab') { |
| | | } else if (type == 'image') { |
| | |
| | | |
| | | //文件上传 |
| | | customBase.uploaderFileShow = function (potion) { |
| | | console.log(potion); |
| | | |
| | | var itemId = potion.id; |
| | | |
| | | customBase.options.uploaderItem[itemId] = {}; |
| | |
| | | ); |
| | | $list.after($addLi); |
| | | |
| | | //不可见辑情况下 附件追加按钮隐藏 李伟民 0123 |
| | | //不可见辑情况下 附件追加按钮隐藏 0123 |
| | | if (!potion.visible) { |
| | | $addLi.addClass("cfg_contentNone"); |
| | | } |
| | | if (!potion.editable) {//不可编辑 附件追加按钮样式修改 李伟民 0123 |
| | | if (!potion.editable) {//不可编辑 附件追加按钮样式修改 0123 |
| | | $addLi.find('button').addClass("disabled"); |
| | | } |
| | | //默认图片追加 |
| | |
| | | // var $list = $uploadimg, |
| | | var fileDir = fileid.path; |
| | | var suffix = fileDir.substr(fileDir.lastIndexOf(".")+1); |
| | | console.log(fileItem.path) |
| | | |
| | | if(suffix == "mp4"){ |
| | | $li = $( |
| | | '<div id="' + fileid + '" class="thumbnail01">' + |
| | |
| | | $uploaderItem.append($uploadimg); |
| | | customBase.uploaderTemp += 500; |
| | | setTimeout(function () { |
| | | if (!potion.editable) {//不可编辑 点击无效果 李伟民 0123 |
| | | if (!potion.editable) {//不可编辑 点击无效果 0123 |
| | | return false; |
| | | } |
| | | var uploader; |
| | |
| | | '<div id="' + file.id + '" class="thumbnail01">' + |
| | | '<div class="frm_item_icons01">' + |
| | | '<div class="frm_item_icon remove" imgId="' + file.id + '">' + |
| | | '<img style="width:14px;height:14px;" src="./../../css/img/icon/delete.png"></div>' + |
| | | '<img style="width:14px;height:14px;" src="../../formEngine/resources/css/img/icon/delete.png"></div>' + |
| | | '</div>' + |
| | | // '<img class = "fileQueuedAddItem">' + |
| | | '<div class="info"><a target="_blank" onclick=toastr.warning("加载中");>' + file.name + '</a>'+ |
| | |
| | | |
| | | // 文件上传成功,给item添加成功class, 用样式标记上传成功。 |
| | | uploader.on('uploadSuccess', function (file, response) { |
| | | //////console.log(file); |
| | | //////console.log(response); |
| | | ////// |
| | | ////// |
| | | |
| | | $("#" + itemId + "mesageErrDiv").remove(); |
| | | $(".customViewUEditorCss #" + itemId).popover('hide') |
| | |
| | | } |
| | | //图片上传 |
| | | customBase.uploaderShow = function (potion) { |
| | | var customShowFlag = window.localStorage.getItem("customShowFlag") |
| | | console.log(customShowFlag); |
| | | console.log(customBase.options); |
| | | console.log(customShow.options.customItemShow.item); |
| | | var customShowFlag = window.getEnclocal("customShowFlag") |
| | | |
| | | |
| | | |
| | | var customItem = customShow.options.customItemShow.item; |
| | | //////console.log(potion); |
| | | ////// |
| | | var itemId = potion.id; |
| | | // var uploader; |
| | | customBase.options.uploaderItem[itemId] = {}; |
| | |
| | | '</div>' |
| | | ); |
| | | var $list = $uploadimg.find("#" + potion.id + "fileList"); |
| | | console.log($('#' + itemId)) |
| | | |
| | | var $addLi = $( |
| | | '<div id="' + potion.id + 'imgPicker" class="file-item thumbnail">' + |
| | | '<div style="background:url(./../../formEngine/resources/css/image.png) no-repeat ;width: 100px;height: 100px;>" </div>' + |
| | |
| | | // if (!potion.editable) { |
| | | // $addLi.addClass("cfg_contentNone"); |
| | | // } |
| | | //不可见辑情况下 图片追加按钮隐藏 李伟民 0123 |
| | | //不可见辑情况下 图片追加按钮隐藏 0123 |
| | | if (!potion.visible) { |
| | | $addLi.addClass("cfg_contentNone"); |
| | | } |
| | | if (!potion.editable) {//不可编辑 图片追加样式修改 李伟民 0123 |
| | | if (!potion.editable) {//不可编辑 图片追加样式修改 0123 |
| | | $addLi.css("cursor","not-allowed") |
| | | } |
| | | //默认图片追加 |
| | |
| | | } |
| | | } |
| | | //数据编辑的情况下,数据表示 |
| | | console.log(arrItemReady) |
| | | |
| | | if (arrItemReady > 0) { |
| | | console.log(potion.ItemReady) |
| | | |
| | | for (fileid in potion.ItemReady) { |
| | | if (potion.ItemReady.hasOwnProperty(fileid)) { |
| | | var fileItem = potion.ItemReady[fileid]; |
| | |
| | | '<div class="frm_item_icons">' + |
| | | '<div class="frm_item_icon remove" imgId="' + fileid + '">' + |
| | | // '<img style="width:14px;height:14px;" src="./../../css/img/icon/delete.png"></div>' + |
| | | '<div style="width:14px;height:14px;background:url(./../../formEngine/resources/css/img/icon/delete.png);"> </div></div>' + |
| | | '<div style="width:14px;height:14px;background:url(../../formEngine/resources/css/img/icon/delete.png);"> </div></div>' + |
| | | |
| | | '</div>' + |
| | | // '<div class="info">' + file.name + '</div>' + |
| | |
| | | if (potion.imagetype == "single") { |
| | | $addLi.removeClass("cfg_contentNone"); |
| | | } |
| | | console.log($(this)) |
| | | |
| | | event.stopPropagation(); |
| | | }); |
| | | // $list为容器jQuery实例 |
| | | $list.prepend($li); |
| | | console.log($('#customShow').children()) |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | setTimeout(function () { |
| | | $addLi.addClass("cfg_contentNone"); |
| | | }, 10); |
| | | console.log($('#customShow').children()) |
| | | |
| | | |
| | | } |
| | | |
| | | $uploaderItem.append($uploadimg); |
| | | customBase.uploaderTemp += 500; |
| | | setTimeout(function () { |
| | | if (!potion.editable) {//不可编辑 取消点击事件 李伟民 0123 |
| | | if (!potion.editable) {//不可编辑 取消点击事件 0123 |
| | | return false; |
| | | } |
| | | var uploader; |
| | |
| | | '<div id="' + file.id + '" class="file-item thumbnail">' + |
| | | '<div class="frm_item_icons">' + |
| | | '<div class="frm_item_icon remove" imgId="' + file.id + '">' + |
| | | '<img style="width:14px;height:14px;" src="./../../formEngine/resources/css/img/icon/delete.png"></div>' + |
| | | '<div style="width:14px;height:14px;background:url(../../formEngine/resources/css/img/icon/delete.png)"></div></div>' + |
| | | '</div>' + |
| | | '<img class = "fileQueuedAddItem">' + |
| | | // '<div class="info">' + file.name + '</div>' + |
| | |
| | | $img.replaceWith('<span>不能预览</span>'); |
| | | return; |
| | | } |
| | | // //////console.log(customBase.options.uploaderItem[itemId][file.id]); |
| | | // ////// |
| | | // customBase.options.uploaderItem[itemId][file.id]["base64"] = src; |
| | | $img.attr('src', src); |
| | | // 12/21 |
| | | console.log($img) |
| | | |
| | | $img.attr('data-original', src); |
| | | // 发布页面查看大图 曲辰明 3-27 |
| | | var viewer = new Viewer(document.getElementById(file.id), { |
| | | url: 'data-original', |
| | | movable: false |
| | | }); |
| | | |
| | | var viewer = new Viewer(document.getElementById(potion.id), { |
| | | show: function (){ |
| | | viewer.update(); |
| | | } |
| | | }); |
| | | |
| | | }, 400, 400); |
| | | }); |
| | | // 文件上传过程中创建进度条实时显示。 |
| | |
| | | .appendTo($li) |
| | | .find('span'); |
| | | } |
| | | //////console.log(percentage); |
| | | ////// |
| | | $percent.css('width', percentage * 100 + '%'); |
| | | }); |
| | | |
| | | // 文件上传成功,给item添加成功class, 用样式标记上传成功。 |
| | | uploader.on('uploadSuccess', function (file, response) { |
| | | //////console.log(file); |
| | | //////console.log(response); |
| | | ////// |
| | | ////// |
| | | $('#' + file.id).addClass('upload-state-done'); |
| | | // customBase.options.uploaderFileName[file.id] = response.data; |
| | | customBase.options.uploaderItem[itemId][file.id] = response.data; |
| | | // //////console.log(customBase.options.uploaderItem[itemId][file.id]); |
| | | // ////// |
| | | customBase.options.uploaderItem[itemId][file.id]["base64"] = $("#" + file.id + " .fileQueuedAddItem")[0].getAttribute("src"); |
| | | }); |
| | | |
| | |
| | | }); |
| | | }, customBase.uploaderTemp); |
| | | // 12/19 |
| | | console.log($uploadimg) |
| | | console.log($('#customViewUEditor').find('#itemId_1').children()) |
| | | |
| | | |
| | | |
| | | var $uploaderItems = $($("#customViewUEditor #" + potion.id)[0]); |
| | | var imgId = $uploaderItems.attr('id'); |
| | | var srcUrl = $uploaderItems.find('img').attr('src'); |
| | | // $uploaderItem.find('img').attr('data-original',srcUrl); |
| | | console.log($('#' + imgId).children().children()) |
| | | |
| | | |
| | | console.log($('#' + imgId).find('#itemId_1fileList').find('label')) |
| | | |
| | | $('#' + imgId).find('#itemId_1fileList').find('label').css({ |
| | | 'height': '150px', |
| | | 'width': '150px' |
| | |
| | | var id = $('#' + imgId).children().children().attr('id') |
| | | //编辑 |
| | | var viewer = new Viewer(document.getElementById(id), { |
| | | url: 'data-original', |
| | | movable: false |
| | | show: function (){ |
| | | viewer.update(); |
| | | } |
| | | }); |
| | | console.log($('#customShow').children()) |
| | | console.log($("[style='opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255)']")) |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | // 成功 |
| | | if (cur === 'error' || cur === 'invalid') { |
| | | //////////console.log( file.statusText ); |
| | | ////////// |
| | | showError(file.statusText); |
| | | percentages[file.id][1] = 1; |
| | | } else if (cur === 'interrupt') { |
| | |
| | | } |
| | | oNode += '<hr style="border:0px;background-color:' + hrcolor + ';color:' + hrcolor + ';float: left;width: 1px;height:' + lineheight + 'px;margin-top:' + margin_top + 'px;"/>'; |
| | | // oNode += '<span style="width:'+linewidth+'px;float:left;line-height:'+height+'px;">'+items[i+1]+'</span>'; |
| | | ////////////console.log(items[i+1]); |
| | | if (items[i + 1] == "nbsp") { |
| | | // items[0] = "0"; |
| | | oNode += '<span style="width:' + linewidth + 'px;float:left;line-height:' + height + 'px;color:#fff;">' + ' ' + '</span>'; |
| | |
| | | callback(text, barWidth, barHeight, sizeWidthHeight); |
| | | } |
| | | customBase.zTreeOnClick = function (event, treeId, treeNode) { |
| | | console.log(this); |
| | | console.log(event); |
| | | console.log(treeId); |
| | | console.log(treeNode); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | if (treeNode.checked) { |
| | | // 单击事件 by kill |
| | | if ($('#span_' + treeNode.id).val() == undefined || $('#span_' + treeNode.id).val() == "") { |
| | | var i = $('#' + treeId).children(':first').children(':nth-child(2)').attr('class').indexOf('radio'); |
| | | if (i != -1) { |
| | | ////console.log(i) |
| | | ////console.log('span_'+treeId) |
| | | //// |
| | | //// |
| | | $('.span_' + treeId).remove(); |
| | | $('#' + treeId.replace("tree", "")) |
| | | .parent().parent().children(':first').children(':nth-child(4)').remove(); |
| | |
| | | }; |
| | | // 2017/11/2 李元杰 单选树选中事件 |
| | | customBase.zTreeOncheckRadio = function (e, treeId, treeNode) { |
| | | //console.log($('#citySel').parents('div[name=treeWinTitle]').next().attr('id')); |
| | | // |
| | | |
| | | var zTree = $.fn.zTree.getZTreeObj(treeId); |
| | | //console.log(zTree) |
| | | // |
| | | var nodes = zTree.getCheckedNodes(true); |
| | | var v = ""; |
| | | var dataObj = {} |
| | | for (var i = 0, l = nodes.length; i < l; i++) { |
| | | v += nodes[i].name + ","; |
| | | console.log(nodes) |
| | | |
| | | dataObj[nodes[i].id] = '1' |
| | | } |
| | | if (v.length > 0) v = v.substring(0, v.length - 1) |
| | | // 2017/11/6 李元杰 单选树 |
| | | |
| | | // console.log($('#'+treeId).parents('div[name="TreeWin"]').find('.citySel')) |
| | | // console.log( ) |
| | | // |
| | | // |
| | | |
| | | $(e.currentTarget).parent().attr('value', JSON.stringify(dataObj)) |
| | | $(e.currentTarget).parents('div[name="TreeWin"]').find('.citySel').val(v); |
| | | // // cityObj.attr("value", v); |
| | | // console.log(e); |
| | | // console.log(treeId); |
| | | // console.log(treeNode); |
| | | // |
| | | // |
| | | // |
| | | // // $('#'+treeId).parents('div[type="tree"]').find('h8').children(':nth-child(4)').remove(); |
| | | // console.log( $('#'+treeId).parents('div[type="tree"]').find('h8')); |
| | | // console.log( $('#'+treeId).parents('div[type="tree"]').find('h8').children(':nth-child(3)')) |
| | | // |
| | | // |
| | | |
| | | // if(treeNode.checked){ |
| | | // // 单击事件 by kill |
| | | // if($('#span_'+treeNode.id).val()==undefined||$('#span_'+treeNode.id).val()==""){ |
| | | // //console.log($('#'+treeId)) |
| | | // // |
| | | // var i=$('#'+treeId).children(':first').children(':nth-child(2)').attr('class').indexOf('radio'); |
| | | // if(i!=-1){ |
| | | // //console.log(i) |
| | | // //console.log('span_'+treeId) |
| | | // // |
| | | // // |
| | | // $('.span_'+treeId).remove(); |
| | | // $('#'+treeId.replace("tree","")) |
| | | // .parent().parent().children(':first').children(':nth-child(4)').remove(); |
| | |
| | | disposableBtn: { name: "取消", cssName: 'icon iconfont icon-kongjian_danhangwenben', functionName: 'customShow.onclickCancel' }, |
| | | //fromSaveBtn: { name: "保存", cssName: 'icon iconfont icon-bianji ', functionName: "customShow.onclickSave2" }, |
| | | editableBtn: { name: "编辑", cssName: 'icon iconfont icon-kongjian_danhangwenben', functionName: "customShow.onEditor" }, |
| | | //添加权限按钮 马习同 2017-12-14 |
| | | //添加权限按钮 2017-12-14 |
| | | billuploadingBtn: { name: "票据上传", cssName: 'icon iconfont icon-kongjian_danhangwenben', functionName: "customShow.billuploading" }, |
| | | reuploadBtn: { name: "重新上传票据", cssName: 'icon iconfont icon-kongjian_danhangwenben', functionName: "customShow.reupload" }, |
| | | checkbillBtn: { name: "查看票据", cssName: 'icon iconfont icon-kongjian_danhangwenben', functionName: "customShow.checkbill" }, |
| | | } |
| | | console.log(Flatpickr) |
| | | |
| | | Flatpickr.localize(Flatpickr.l10ns.zh); // 设置为中文 |
| | | customShow.options = { |
| | | customItem: {}, |
| | |
| | | //画面check |
| | | fromCheck: function (items, callback) { |
| | | return customShow.onfromCheck(items); |
| | | ////console.log(1) |
| | | //// |
| | | }, |
| | | //03检证执行 |
| | | validationRuleCheck: function (items, callback) { return true }, |
| | | //检证接口函数(第三口) |
| | | validationRuleCheck3rd: function (items, callback) { return customShow.interfaceCheck(items) },//保存前计算费用 李伟民 10 - 31 |
| | | validationRuleCheck3rd: function (items, callback) { return customShow.interfaceCheck(items) },//保存前计算费用 10 - 31 |
| | | //发送数据到后台服务器,保存data |
| | | fromSave: function (items, callback) { |
| | | |
| | |
| | | //初期化接口 |
| | | interfaceInit: function (customShowFlag) { |
| | | //表示模式 |
| | | console.log(customShowFlag) |
| | | |
| | | if (customShowFlag == 2) { |
| | | customShow.controlInit("customViewUEditorCss"); |
| | | //控件初始化 |
| | |
| | | } |
| | | |
| | | function getProcessLog() {//获得流程信息 李雁鸣 12-25 |
| | | localStorage.setItem("processLog", null); |
| | | if (localStorage.getItem("customItem") != undefined && localStorage.getItem("customItem") != "undefined" && localStorage.getItem("customItem") != null && localStorage.getItem("customItem") != "" && localStorage.getItem("customItem") != null) { |
| | | var ss = { "formID": JSON.parse(localStorage.getItem("customForm")).newFormID, "dataRowNum": JSON.parse(localStorage.getItem("customItem")).DATAROWNUM }; |
| | | setDeclocal("processLog", null); |
| | | if (getEnclocal("customItem") != undefined && getEnclocal("customItem") != "undefined" && getEnclocal("customItem") != null && getEnclocal("customItem") != "" && getEnclocal("customItem") != null) { |
| | | var ss = { "formID": getEnclocal("customForm").newFormID, "dataRowNum":getEnclocal("customItem").DATAROWNUM }; |
| | | var requestSingleForm = window.commonAjax("/ubp-api-seache/process/inst/log", ss, "POST", true, false); |
| | | requestSingleForm.done(function (rs) { |
| | | console.log(rs.data); |
| | | console.log("新改的"); |
| | | |
| | | |
| | | if (rs.data != undefined) { |
| | | localStorage.setItem("processLog", JSON.stringify(rs.data.data)); |
| | | setDeclocal("processLog", JSON.stringify(rs.data.data)); |
| | | } else { |
| | | |
| | | } |
| | |
| | | |
| | | customShow.Init = function () { |
| | | getProcessLog() //获得流程信息 李雁鸣 12-25 |
| | | customShow.exCouldNumber = undefined;//初始化 云单编号 李伟民 12-22 |
| | | customShow.orderStatus = undefined;//初始化 表单状态 李伟民 12-26 |
| | | customShow.exCouldNumber = undefined;//初始化 云单编号 12-22 |
| | | customShow.orderStatus = undefined;//初始化 表单状态 12-26 |
| | | //数据源 |
| | | |
| | | //数据源信息取得 |
| | | var datasource = $.parseJSON(window.localStorage.getItem("datasource")); |
| | | var datasource = window.getEnclocal("datasource"); |
| | | customShow.options.datasource = {}; |
| | | if (datasource != null) { |
| | | |
| | |
| | | } |
| | | |
| | | // 0:预览 1:数据管理中新建 2:数据管理中展示(数据表示) 3:发布 4:模板中心 |
| | | var customShowFlag = window.localStorage.getItem("customShowFlag"); |
| | | var customShowFlag = window.getEnclocal("customShowFlag"); |
| | | customShow.options.customShowFlag = customShowFlag; |
| | | // 12/13 测试模拟用 |
| | | |
| | | if (customShowFlag == "0" || customShowFlag == "1") {// 新建 预览 隐藏 详情页 李伟民 11-17 |
| | | console.log(customShowFlag); |
| | | if (customShowFlag == "0" || customShowFlag == "1") {// 新建 预览 隐藏 详情页 11-17 |
| | | |
| | | // 12/4 李元杰 日历当前时间 |
| | | // var dataObj = { |
| | | // "time":"yyyy-MM-dd HH:mm:ss" |
| | |
| | | // var requestRight = window.commonAjax('/epc/getTime', dataObj, 'POST', true); |
| | | // requestRight.done(function (res) { |
| | | // // if (res.rspCode == "000000") { |
| | | // console.log(res) |
| | | // |
| | | // // } |
| | | // }) |
| | | var myDate = new Date(); |
| | |
| | | myDate.getMonth(); //获取当前月份(0-11,0代表1月) |
| | | myDate.getDate(); |
| | | customShow.currentDate = myDate.getFullYear() + '-' + (myDate.getMonth() + 1) + '-' + myDate.getDate(); |
| | | console.log(new Date()) |
| | | console.log(customShow.currentDate) |
| | | |
| | | |
| | | $("#customShow").removeClass("fui-form"); |
| | | console.log(customBase.options.customItemShow) |
| | | |
| | | // $(".preview-edit-pane").css("display", "none"); |
| | | // 12/23 |
| | | |
| | | |
| | | |
| | | |
| | | }// 新建 预览 隐藏 详情页 李伟民 11-17 |
| | | }// 新建 预览 隐藏 详情页 11-17 |
| | | if (customShowFlag == "2") { |
| | | console.log(customShowFlag); |
| | | |
| | | //12/23 |
| | | $(".preview-edit-pane").css("display", "block"); |
| | | // $("#editableBtn").on("click",() => { |
| | | // console.log($(".preview-edit-pane")); |
| | | // |
| | | |
| | | // }) |
| | | } |
| | |
| | | } |
| | | if (customShowFlag == "0") { |
| | | //表单ID |
| | | var customlocalStorage = window.localStorage.getItem("customForm"); |
| | | var customlocalStorage = window.getEnclocal("customForm"); |
| | | customlocalStorage = $.parseJSON(customlocalStorage); |
| | | customShow.options.formid = customlocalStorage.newFormID; |
| | | var customViewItem = window.localStorage.getItem("customViewItem"); |
| | | var customViewItem = window.getEnclocal("customViewItem"); |
| | | |
| | | customShow.InitShow({ |
| | | //绑定DIV |
| | |
| | | $(".s_savebtn").hide(); |
| | | // $(".customShow .fa-calendar").addClass(); |
| | | } else { |
| | | customShow.options.formid = window.localStorage.getItem("newFormID"); |
| | | customShow.options.formid = window.getEnclocal("newFormID"); |
| | | //初期数据取得 |
| | | customDataBound.getFormbase(customShow.options.formid, function (rs) { |
| | | if (rs.rspCode == "000000" && rs.data != null) { |
| | |
| | | var field = JSON.parse(rs.data.fieldset); |
| | | //转换成数组 |
| | | var fields = _.keysIn(field); |
| | | console.log(rs.data.fieldset) |
| | | |
| | | |
| | | //循环读取tag_Type是否含有‘auto’ |
| | | for (var i = 0; i < fields.length; i++) { |
| | |
| | | } |
| | | } |
| | | |
| | | var formbase = window.localStorage.getItem("customItem"); |
| | | //console.log(formbase) |
| | | //////////////console.log(formbase); |
| | | // //console.log(formbase); |
| | | var formbase = window.getEnclocal("customItem"); |
| | | // |
| | | ////////////// |
| | | // // |
| | | var customItem = { |
| | | formeditor: rs.data.resultForm, |
| | | item: $.parseJSON(rs.data.fieldset), |
| | |
| | | customFlag: rs.data.designMode, |
| | | Linkage: rs.data.linkage |
| | | } |
| | | //console.log(customItem); |
| | | //console.log(formbase) |
| | | // |
| | | // |
| | | customShow.InitShow({ |
| | | //绑定DIV |
| | | showDiv: "customViewUEditor", |
| | |
| | | } |
| | | // 12/4 李元杰 当前时间 |
| | | customShow.currentDate = ''; |
| | | function changeOrderStatus(orderStatus){//修改表单状态 李伟民 01-04 |
| | | function changeOrderStatus(orderStatus){//修改表单状态 01-04 |
| | | if(orderStatus == undefined){ |
| | | return false; |
| | | } |
| | |
| | | customBase.customInit = customInit; |
| | | //画面初期迁移源属性取得 |
| | | // 0:预览 1:数据管理中新建 2:数据管理中展示 3:发布 4:模板中心 |
| | | //console.log(customInit) |
| | | // |
| | | if (customInit.customViewItem != null && customInit.customViewItem != undefined) { |
| | | customShow.costType = customInit.customViewItem.item; |
| | | } |
| | |
| | | //展示数据表示 |
| | | |
| | | if (customShowFlag == "0" || customShowFlag == "6") { |
| | | //2017-12-27 马习同 专家模式打印 |
| | | var print_btnFlag = window.localStorage.getItem("print_btnFlag"); |
| | | //2017-12-27 专家模式打印 |
| | | var print_btnFlag = window.getEnclocal("print_btnFlag"); |
| | | if (customShowFlag == "0" && print_btnFlag == "1"){ |
| | | var btns = [ |
| | | "printableBtn" |
| | | ]; |
| | | customShow.setToolBtn(btns); |
| | | } |
| | | ////console.log(window.customBase); |
| | | //// |
| | | //标题头表示 |
| | | $('#childclick').css("display", "none"); |
| | | $(".header")[0].style.display = "block"; |
| | |
| | | //1:数据管理中新建 3:发布 4:模板中心 |
| | | } else if (customShowFlag == "1" || customShowFlag == "3") { |
| | | //标题头表示 |
| | | console.log("显示X"); |
| | | console.log($('#childclick')); |
| | | |
| | | |
| | | $('#childclick').css("display", "block"); |
| | | $('#childclick').click(() => { |
| | | customShow.onclickCancel(); |
| | | console.log("点击父元素关闭"); |
| | | |
| | | }); |
| | | |
| | | $(".header")[0].style.display = "block"; |
| | |
| | | //第三方事件绑定 |
| | | // customShow.setEventBind(); |
| | | } else if (customShowFlag == "2") { |
| | | console.log("显示X"); |
| | | console.log($('#childclick')); |
| | | |
| | | |
| | | $('#childclick').css("display", "block"); |
| | | if (JSON.parse(window.localStorage.getItem('allow')) == true) { |
| | | if (window.getEnclocal('allow') == true) { |
| | | $('#childclick').css("display", "none"); |
| | | } else { |
| | | $('#childclick').css("display", "block"); |
| | | } |
| | | $('#childclick').click(() => { |
| | | customShow.onclickCancel(); |
| | | console.log("点击父元素关闭"); |
| | | |
| | | |
| | | }); |
| | | //按钮修改 马习同 2017-12-13 |
| | | //按钮修改 2017-12-13 |
| | | // var btnshowFlag = { |
| | | // a = true, |
| | | // b = flase, |
| | |
| | | 'printableBtn',//打印 |
| | | ]; |
| | | //画面内容的初始化设定 |
| | | console.log(customItem); |
| | | console.log(customViewDiv); |
| | | |
| | | |
| | | customShow.setContentHtml(customItem, customViewDiv); |
| | | var items = {}; |
| | | //数据变换 |
| | | //console.log(customInit); |
| | | //console.log(customInit.formbase) |
| | | // |
| | | // |
| | | var formbase = $.parseJSON(customInit.formbase); |
| | | //console.log(formbase); |
| | | // |
| | | customShow.options.dataRowNum = formbase['DATAROWNUM']; |
| | | customShow.exCouldNumber = formbase['orderCode'];//获取云单编号 李伟民 12-26 |
| | | customShow.exCouldNumber = formbase['orderCode'];//获取云单编号 12-26 |
| | | if(customShow.exCouldNumber){ |
| | | $('#exCloudNumberText').html('云单编号:' + customShow.exCouldNumber); |
| | | } |
| | | customShow.orderStatus = formbase['orderStatus'];// 获取表单状态 李伟民 12-26 |
| | | customShow.orderStatus = formbase['orderStatus'];// 获取表单状态 12-26 |
| | | changeOrderStatus(customShow.orderStatus); |
| | | items = formbase; |
| | | customShow.options.itemFormbase = formbase; |
| | | console.log(_.cloneDeep(items)); |
| | | |
| | | delete items['DATAROWNUM']; |
| | | console.log(_.cloneDeep(items)); |
| | | |
| | | //初期化后,数据赋值(编辑模式) |
| | | console.log(_.cloneDeep(items)); |
| | | |
| | | customShow.showCustom(items, customShow.options.customInit); |
| | | //初期化后,数据赋值(预览) |
| | | console.log(_.cloneDeep(items)); |
| | | |
| | | customShow.setShowCustomItem(items); |
| | | //初期化后,票据信息追加 李伟民 12-26 |
| | | //初期化后,票据信息追加 12-26 |
| | | SC.billInfoInit(items); |
| | | |
| | | |
| | | //数据源再次追加 |
| | | // var customItems = customShow.options.customItemShow.item; |
| | | var customItems = customBase.options.customItems; |
| | | console.log(customItems); |
| | | |
| | | for (item in customItems) { |
| | | if (customItems.hasOwnProperty(item)) { |
| | | if (customItems[item].type == 'dropdownlist' || customItems[item].type == 'radio' || |
| | | customItems[item].type == 'checkbox' || customItems[item].type == 'tree') { |
| | | var datasourcetype = customShow.options.customItemShow.item[customItems[item].id].tag_Attribute.datasourcetype; |
| | | console.log(datasourcetype); |
| | | |
| | | if (datasourcetype == "custom") { |
| | | //数据源绑定(自定义数据) |
| | | customShow.setDatasourceData(customItems[item]); |
| | |
| | | $(".modal-title")[0].innerHTML = customItem.formName; |
| | | // 12/19 |
| | | $("#customViewUEditor")[0].style.display = "none"; |
| | | //2017/11/18 马习同修改 隐藏预览模式下 导入数据按钮 |
| | | //2017/11/18 修改 隐藏预览模式下 导入数据按钮 |
| | | $(".sonImportFile").addClass("cfg_contentNone"); |
| | | $(".s_savebtn").hide(); |
| | | $(".customShow .fa-calendar").addClass("cfg_contentNone"); |
| | | |
| | | console.log($(".customShow .tdContentClass")) |
| | | |
| | | // _.each($(".customShow .tdContentClass"),opt=>{ |
| | | // // $(opt).attr("title", $(opt).children().children().html()); |
| | | // console.log($(opt).html()) |
| | | // |
| | | // if ($(opt).children().children().attr("type") == "text"){ |
| | | // $(opt).attr("title", $(opt).children().children().val()); |
| | | // }else{ |
| | | // console.log(_.cloneDeep($(opt).children().children())) |
| | | // console.log(opt.innerHTML) |
| | | // console.log($(opt).children().children()[0].innerHTML) |
| | | // |
| | | // |
| | | // |
| | | // $(opt).attr("title", $(opt).children().children()[0].innerHTML); |
| | | // } |
| | | // }) |
| | | |
| | | } |
| | | //第三方事件绑定 |
| | | var token = localStorage.getItem('token');//页面事件绑定 李伟民 12-22 |
| | | if (token != '' && token != undefined) { |
| | | token = JSON.parse(token); |
| | | } |
| | | var token = getEnclocal('token');//页面事件绑定 12-22 |
| | | var postdata = { 'formID': customShow.options.formid }; |
| | | _.extend(postdata, token); |
| | | var eventBindRquest = window.commonAjax('/formevent/getFormEventListService', postdata, 'GET', true, false); |
| | |
| | | customShow.initEvent.eventBind = res.data; |
| | | } |
| | | customShow.setEventBind(); |
| | | });//页面事件绑定 李伟民 12-22 |
| | | });//页面事件绑定 12-22 |
| | | |
| | | SC.showUser()//报销人根据当前登录人自动带出 李伟民 0108 |
| | | SC.showUser()//报销人根据当前登录人自动带出 0108 |
| | | |
| | | customShow.setToolBtn(btns); |
| | | $(".select2-selection").remove(); |
| | | customShow.hidesubform(); |
| | | var unvisible = customBase.options.customItems; |
| | | for (item in unvisible) { |
| | | |
| | | if (unvisible[item].type == "subform") { |
| | | var itemId = unvisible[item].id; |
| | | // var itemTwo = itemId; |
| | | // var itemSubform = $('.'+"customViewUEditorCss" +" #"+itemId+"ActiveId"); |
| | | ////////////console.log(item); |
| | | //子表单删除第一条可添加 2017/10/26 马习同 |
| | | //////////// |
| | | //子表单删除第一条可添加 2017/10/26 |
| | | // var divIcon = $('<div id="'+itemId+'save" class="cfg_contentNone"></div>'); |
| | | var cloneE = $('#' + itemId + 'subformTr').clone(); |
| | | if (customInit.designMode == 1){ |
| | | if ($('#' + itemId + ' .firstRow td').attr("valign") == "top"){ |
| | | var cloneE = $('#' + itemId + ' .firstRow').clone(); |
| | | }else{ |
| | | var cloneE = $('#' + itemId + ' tr:eq(1)').clone(); |
| | | } |
| | | } else if (customInit.designMode == 2){ |
| | | var cloneE = $('#' + itemId + 'subformTr').clone(); |
| | | } |
| | | // divIcon.append(cloneE); |
| | | console.log(cloneE); |
| | | |
| | | // itemSubform.append(divIcon); |
| | | customBase.options.customItems[item]['cloneDiv'] = cloneE; |
| | | } |
| | | } |
| | | //2017-12-12 马习同隐藏 |
| | | //2017-12-12 隐藏 |
| | | SC.Superior_hide(); |
| | | if (customShowFlag == "1" || customShowFlag == "0") { |
| | | // window.localStorage.setItem('businessTypeAuto','240'); |
| | | // window.setDeclocal('businessTypeAuto','240'); |
| | | $(".preview-edit-pane").find('#disposableBtn').css('display', 'none'); |
| | | $(".preview-edit-pane").find('#clearBtn').css('display', 'none'); |
| | | $(".preview-edit-pane").find('#queryBtn').css('display', 'none'); |
| | |
| | | $(".preview-edit-pane").find('#rejectBtn').css('display', 'none'); |
| | | } |
| | | } |
| | | // 2017/10/20 李元杰 抽出了 李伟民的计算费用的方法 最后将数据return出去了 |
| | | // 2017/10/20 李元杰 抽出了 的计算费用的方法 最后将数据return出去了 |
| | | //计算费用 |
| | | //customShow.queryCostAllData = function(){ |
| | | // var post_data = []; |
| | | // var items = customShow.getItems(); |
| | | // var items_key = _.keysIn(items); |
| | | // var all_data = {}; |
| | | // //console.log(items); |
| | | // // |
| | | // _.each(items_key,function(item){ |
| | | // var control = {}; |
| | | // var item_attr = customBase.options.customItems[item]; |
| | |
| | | // } |
| | | // post_data.push(control); |
| | | // }); |
| | | // var customShowFlag = window.localStorage.getItem("customShowFlag"); |
| | | // var customForm = window.localStorage.getItem("customForm"); |
| | | // var customShowFlag = window.getEnclocal("customShowFlag"); |
| | | // var customForm = window.getEnclocal("customForm"); |
| | | // if(customForm && customForm != ""){ |
| | | // customForm = JSON.parse(customForm); |
| | | // } |
| | | // if(customShowFlag == 2){//详情 |
| | | // var customItem = window.localStorage.getItem("customItem"); |
| | | // var customItem = window.getEnclocal("customItem"); |
| | | // if(customItem && customItem != ""){ |
| | | // customItem = JSON.parse(customItem); |
| | | // //console.log(customItem); |
| | | // // |
| | | // } |
| | | // _.extend(all_data,{"data":post_data,"formId":customForm.newFormID,"id":customItem.DATAROWNUM}); |
| | | // }else{//新建或预览 |
| | |
| | | // // var items = customShow.getItems(); |
| | | // // var items_key = _.keysIn(items); |
| | | // // var all_data = {}; |
| | | // // //console.log(items); |
| | | // // //console.log(items_key) |
| | | // // // |
| | | // // // |
| | | // // _.each(items_key,function(item){ |
| | | // // var control = {}; |
| | | // // //console.log(item); |
| | | // // // |
| | | // // var item_attr = customBase.options.customItems[item]; |
| | | // // //console.log(item_attr) |
| | | // // // |
| | | // // if(_.isArray(items[item]) && _.isObject(items[item][0])){//判断是否为子表单 |
| | | // // _.extend(control,{'fieldKey':item,'mdCode':'','value':'','type':item_attr.type,'child':[]}); |
| | | // // _.each(items[item],function(cd){ |
| | | // // //console.log(cd) |
| | | // // // |
| | | // // var cd_key = _.keysIn(cd); |
| | | // // //console.log(cd_key) |
| | | // // // |
| | | // // var item_cd = { |
| | | // // "items":[], |
| | | // // "cid":"" |
| | |
| | | // // _.each(cd_key,function(cdk){ |
| | | // // var control_cd = {}; |
| | | // // var item_attr_cd = customBase.options.customItems[cdk]; |
| | | // // //console.log(item_attr_cd); |
| | | // // // |
| | | // // _.extend(control_cd,{'fieldKey':cdk,'mdCode':customShow.getmasterdataById(item_attr_cd.id),'value':cd[cdk],'type':item_attr_cd.type}); |
| | | // // item_cd.items.push(control_cd); |
| | | // // if(cdk == "dataRowNum"){ |
| | |
| | | // // } |
| | | // // post_data.push(control); |
| | | // // }); |
| | | // // var customShowFlag = window.localStorage.getItem("customShowFlag"); |
| | | // // var customForm = window.localStorage.getItem("customForm"); |
| | | // // var customShowFlag = window.getEnclocal("customShowFlag"); |
| | | // // var customForm = window.getEnclocal("customForm"); |
| | | // // if(customForm && customForm != ""){ |
| | | // // customForm = JSON.parse(customForm); |
| | | // // } |
| | | // // if(customShowFlag == 2){//详情 |
| | | // // var customItem = window.localStorage.getItem("customItem"); |
| | | // // var customItem = window.getEnclocal("customItem"); |
| | | // // if(customItem && customItem != ""){ |
| | | // // customItem = JSON.parse(customItem); |
| | | // // //console.log(customItem); |
| | | // // // |
| | | // // } |
| | | // // _.extend(all_data,{"data":post_data,"formId":customForm.newFormID,"id":customItem.DATAROWNUM}); |
| | | // // }else{//新建或预览 |
| | |
| | | // // } |
| | | // // _.extend(all_data,{'orderCode':""}); |
| | | // // _.extend(all_data,{'ctId':"240"});// 费用类型 假 |
| | | // // //console.log(all_data); |
| | | // // //console.log(JSON.stringify(all_data)) |
| | | // // // |
| | | // // // |
| | | // var all_data = customShow.queryCostAllData(); |
| | | // // 2017/10/20 李元杰 queryCostAllData 抽出来存这里了 end |
| | | // var query_request = window.queryAjax("epc-count/countCost",all_data,"POST",true,false); |
| | | // ////console.log(query_request); |
| | | // //// |
| | | // query_request.done(function(res){ |
| | | // ////console.log("6531289"); |
| | | // //// |
| | | // customBase.listen_check(res.data,"query_check"); |
| | | // }) |
| | | // |
| | |
| | | //扩展费用自定义方法,yuezhw 2017-11-13 |
| | | customShow.extended_budget = function (where) { |
| | | var obj = {}; |
| | | obj.formId = localStorage.getItem("newFormID"); |
| | | obj.dataId = JSON.parse(localStorage.getItem("customItem")).DATAROWNUM; |
| | | obj.tenantID = JSON.parse(localStorage.getItem("tenantID")).tenantID; |
| | | obj.formId = getEnclocal("newFormID"); |
| | | obj.dataId = getEnclocal("customItem").DATAROWNUM; |
| | | obj.tenantID = getEnclocal("tenantID").tenantID; |
| | | var query_request; |
| | | flatpickr("#budget_time", { |
| | | dateFormat: "Y-m-d" |
| | |
| | | obj.department = $('#budget_department').val(); |
| | | obj.info = $('#budget_time').val(); |
| | | var nowTime = new Date(Date.parse(obj.info)); |
| | | var endTime = new Date(Date.parse(JSON.parse(localStorage.getItem("customItem")).budgetEndDate)); |
| | | console.log(obj.info); |
| | | console.log(nowTime); |
| | | console.log(endTime); |
| | | var endTime = new Date(Date.parse(getEnclocal("customItem").budgetEndDate)); |
| | | |
| | | |
| | | |
| | | if (obj.info.length < 1) { |
| | | alert("请输入增加时间"); |
| | | } else if (nowTime < endTime) { |
| | |
| | | } else { |
| | | var query_request = window.queryAjaxQQ("epc-form/extend/budget/time", obj, "POST", true, false); |
| | | query_request.done(function (res) { |
| | | console.log(typeof res.data) |
| | | console.log(res.data) |
| | | |
| | | |
| | | if (res.data === true) { |
| | | alert("扩展时间成功!"); |
| | | customShow.clean(); |
| | |
| | | } |
| | | }) |
| | | query_request.error(function (rs) { |
| | | // console.log(rs) |
| | | // |
| | | toastr.error(rs.responseJSON.rspDesc); |
| | | |
| | | }) |
| | |
| | | //根据别名获取主数据 |
| | | customShow.getmasterdataById = function (itemid) { |
| | | var mdata = undefined; |
| | | ////console.log(itemid); |
| | | //// |
| | | if (customShow.options.customItemShow.item[itemid] != undefined) { |
| | | if (customShow.options.customItemShow.item[itemid].tag_Attribute.masterData != undefined && customShow.options.customItemShow.item[itemid].tag_Attribute.masterData != '') { |
| | | mdata = JSON.parse(customShow.options.customItemShow.item[itemid].tag_Attribute.masterData); |
| | |
| | | customShow.setShowCustomItem = function (items) { |
| | | // 2017/10/19 李元杰 在费用明细里插入一些信息 |
| | | // 需要传给后端的对象 |
| | | //console.log(items); |
| | | // |
| | | // var objData = customShow.queryCostAllData(); |
| | | // 获取orderCode的值 |
| | | |
| | |
| | | // } |
| | | // }); |
| | | // } |
| | | //delete items['DATAROWNUM']; // 子表单中 不删除datarownum 李伟民 11-16 |
| | | //delete items['DATAROWNUM']; // 子表单中 不删除datarownum 11-16 |
| | | var items = _.cloneDeep(items); |
| | | var customItems = customBase.options.customItems; |
| | | //console.log(customItems); |
| | | // |
| | | //数据值变换 |
| | | for (item in items) { |
| | | if (items.hasOwnProperty(item)) { |
| | |
| | | } |
| | | if (customItems[item].type == 'subform' || customItems[item].type == 'tag' || customItems[item].type == 'tab') { |
| | | var subformTemp = items[item]; |
| | | console.log(subformTemp) |
| | | |
| | | if (subformTemp == undefined) { |
| | | subformTemp = [{}]; |
| | | } |
| | |
| | | items[subformItem] = []; |
| | | } |
| | | } |
| | | console.log(subformTemp.length);//主数据丢失 |
| | | |
| | | for (var i = 0; i < subformTemp.length; i++) { |
| | | if (i != 0) { |
| | | //子表单项目追加 |
| | |
| | | } |
| | | } |
| | | |
| | | //delete items['DATAROWNUM']; // 子表单中 不删除datarownum 李伟民 11-16 |
| | | console.log(_.cloneDeep(items)) |
| | | console.log(customItems); |
| | | //delete items['DATAROWNUM']; // 子表单中 不删除datarownum 11-16 |
| | | |
| | | |
| | | //数据赋值 |
| | | for (item in items) { |
| | | console.log(item); |
| | | |
| | | if (items.hasOwnProperty(item)) { |
| | | if (customItems[item] == undefined) { |
| | | delete customItems[item]; |
| | |
| | | } |
| | | var type = customItems[item].type; |
| | | var id = customItems[item].id; |
| | | console.log(id); |
| | | console.log(items[item]); |
| | | |
| | | |
| | | if ( |
| | | // type == 'radio' || type == 'checkbox' || |
| | | // type == 'dropdownlist'|| |
| | |
| | | var item_title = []; |
| | | var itemVal = []; |
| | | var $mytext = $("#customShow " + "#" + customItems[item].id + "ActiveId"); |
| | | if (itemAttribute.tag_Attribute.relevancesourcetype == "fundata") {// 关联数据回显渲染 李伟民 11-30 |
| | | if (itemAttribute.tag_Attribute.relevancesourcetype == "fundata") {// 关联数据回显渲染 11-30 |
| | | var titleObj = { "key": JSON.parse(itemAttribute.tag_Attribute.fundata)["key"] }; |
| | | var dataObj = { |
| | | "formID": customShow.options.formid, |
| | |
| | | var requesTitle = window.commonAjax("/datamanagement/getAssociateTitle", titleObj, "POST", true, false); |
| | | var requesData = window.commonAjax("/datamanagement/getAssociateData", dataObj, "POST", true, false); |
| | | requesTitle.done(function (res) { |
| | | console.log(res); |
| | | |
| | | item_title = res.data; |
| | | }); |
| | | requesData.done(function (res) { |
| | | console.log(res); |
| | | |
| | | if (!_.isNull(res.data) && res.data != undefined) { |
| | | itemVal = res.data; |
| | | } |
| | | }); |
| | | } else { |
| | | var myTitle = JSON.parse(window.localStorage.getItem("title")); |
| | | var myTitle = window.getEnclocal("title"); |
| | | item_title = myTitle[item]; |
| | | itemVal = items[item]; |
| | | } |
| | | console.log(myTitle); |
| | | console.log(itemVal) |
| | | console.log(item_title); |
| | | console.log(itemVal.list); |
| | | var iconID = "customShow #" + customItems[item].id + "ActiveId";// 关联数据回显渲染 李伟民 11-30 |
| | | createMxtTable(iconID, item_title, itemVal.list);// 关联数据回显渲染 李伟民 11-30 |
| | | |
| | | |
| | | |
| | | |
| | | var iconID = "customShow #" + customItems[item].id + "ActiveId";// 关联数据回显渲染 11-30 |
| | | createMxtTable(iconID, item_title, itemVal.list);// 关联数据回显渲染 11-30 |
| | | // var newData = []; |
| | | // _.each(itemVal.list,function(opt){ |
| | | // opt = _.mapKeys(opt,function(value,key){ |
| | |
| | | // }) |
| | | // return key; |
| | | // }) |
| | | // console.log(_.cloneDeep(opt)) |
| | | // |
| | | // newData.push(opt); |
| | | // }) |
| | | // console.log(itemVal.list); |
| | | // console.log(newData); |
| | | // |
| | | // |
| | | //// var $value = newData; |
| | | // var show = ""; |
| | | // var divBox = $("<div></div>"); |
| | | // divBox.attr('id',customItems[item].id+'divBox'); |
| | | // //console.log($value) |
| | | // // |
| | | // var sdata_head = ""; |
| | | // _.each($value,(opt,j)=>{ |
| | | // //console.log(opt); |
| | | // // |
| | | // var ulBox = $("<ul></ul>"); |
| | | // for(let i in opt){ |
| | | // show = ""; |
| | |
| | | // show += '<li>'+'<span class="data1 '+i+'">'+i+'</span>'+'<span class="data2 '+i+'">'+opt[i]+'</span>'+'</li>'; |
| | | // ulBox.attr("class","addUl ulBox"+j); |
| | | // ulBox.attr("id","ulBox"+j); |
| | | // //console.log(show) |
| | | // // |
| | | // ulBox.append(show); |
| | | // } |
| | | // console.log(sdata_head); |
| | | // |
| | | // divBox.append(ulBox); |
| | | // }); |
| | | // $mytext.append(divBox); |
| | |
| | | var orderid = ""; |
| | | function getepc() { |
| | | window.queryAjaxsd("epc/epc-form/getOrderCode", {}, "POST", true).done(function (res) { |
| | | //console.log("云账房id"); |
| | | //console.log(res); |
| | | // |
| | | // |
| | | if (res.data != undefined) { |
| | | orderid = res.data.orderCode; |
| | | setepc(orderid); |
| | |
| | | }) |
| | | } |
| | | function setepc(orderid) { |
| | | //console.log(orderid); |
| | | //console.log(customBase); |
| | | //console.log(window.customShow); |
| | | // |
| | | // |
| | | // |
| | | if (customBase.options.customItems.orderCode != undefined) { |
| | | var id = customBase.options.customItems.orderCode.id; |
| | | var type = customBase.options.customItems.orderCode.type; |
| | | //console.log(id); |
| | | //console.log(type); |
| | | // |
| | | // |
| | | |
| | | customBase.setItemValue(id, type, orderid); |
| | | } |
| | |
| | | |
| | | customShow.uploadBill = function () {//票据上传 |
| | | $('#upload_iframe').show(); |
| | | var token = localStorage.getItem(token); |
| | | var token = getEnclocal(token); |
| | | if (token != '' && token != undefined) { |
| | | token = JSON.parse(token).accessToken; |
| | | token = token.accessToken; |
| | | } |
| | | var compid = getCookie('companyId'); |
| | | var tenantId = localStorage.getItem("tenantID"); |
| | | var tenantId = getEnclocal("tenantID"); |
| | | // var iframe_src = "http://csza.chfcloud.com/views/order_create_visit.html?token=" + token + "&compid=" + compid +"&tenantId=" + tenantId; |
| | | var iframe_src = "http://csza.chfcloud.com/views/order_create_visit.html?token=" + localStorage.getItem("testToken") + "&compid=" + localStorage.getItem("testCompanyId") +"&tenantId=" + localStorage.getItem("testTenantId"); |
| | | var iframe_src = "http://csza.chfcloud.com/views/order_create_visit.html?token=" + getEnclocal("testToken") + "&compid=" + getEnclocal("testCompanyId") +"&tenantId=" + getEnclocal("testTenantId"); |
| | | //var iframe_src = "http://csza.chfcloud.com/views/order_create_visit.html?token=a23efb1df2303a914b1139d4e1d1859f&compid=66&tenantId=13"; |
| | | $("#upload_iframe").append("<iframe id='uploadBill' style='width:100%;overflow: auto;'></iframe>"); |
| | | ////console.log($("body")); |
| | | //// |
| | | var thisHeight = $("body").height(); |
| | | ////console.log(thisHeight); |
| | | //// |
| | | $('#upload_iframe').height(thisHeight); |
| | | $('#uploadBill').height(thisHeight); |
| | | $('#uploadBill').attr("src", iframe_src); |
| | |
| | | customShow.getExCouldNumber = function (event) { |
| | | if (event && event.data && event.data.indexOf('csc_OrderCode=') != -1) { |
| | | var exCouldNumber = event.data.split('=')[1]; |
| | | console.log(exCouldNumber); |
| | | |
| | | customShow.exCouldNumber = exCouldNumber; |
| | | if(localStorage.getItem('customShowFlag') == 2){//详情页上传票据需将云单编号传给后台 李伟民 01-04 |
| | | if(getEnclocal('customShowFlag') == 2){//详情页上传票据需将云单编号传给后台 01-04 |
| | | var orderData = { |
| | | "formId":customShow.options.formid, |
| | | "formDataId":localStorage.getItem("datarowNum"), |
| | | "formDataId":getEnclocal("datarowNum"), |
| | | "orderCode":exCouldNumber |
| | | } |
| | | var orderUpdate = window.cloudAjax("epc-form/formData/updataBillInfoAndForm",orderData,"POST",true); |
| | |
| | | $(div).css("width", "100%"); |
| | | // $(customViewDiv).css("height",customItem.fromheigh); |
| | | // $(customViewDiv).css("width",customItem.fromwidth); |
| | | console.log(1); |
| | | |
| | | } |
| | | |
| | | } else { |
| | |
| | | |
| | | // $(div)[0].style.overflowY ='auto'; |
| | | $(div)[0].style.width = '100%'; |
| | | $(div)[0].style.height = '100%'; |
| | | //$(div)[0].style.height = '100%'; |
| | | |
| | | $(div).css("display", "flex"); |
| | | $(div).css("justify-content", "flex-start"); |
| | |
| | | |
| | | //基本信息List取得 |
| | | customBase.options.customItems = customShow.getItemsList(); |
| | | console.log(customShow.getItemsList()) |
| | | console.log(customShow.options.customItemShow.item) |
| | | |
| | | |
| | | |
| | | //接口绑定 |
| | | interfaceBind = customShow.initEvent.interfaceBind; |
| | |
| | | |
| | | //画面初期化 |
| | | customShow.initEvent.interfaceInit(customShow.options.customShowFlag); |
| | | console.log(customShow.options.customItemShow.item); |
| | | |
| | | //第三方初始化 |
| | | |
| | | customShow.initEvent.interfaceInit3rd(); |
| | |
| | | // 12/16 end |
| | | } |
| | | $('.customViewUEditorCss').off('click.tree').on('click.tree', function () { |
| | | console.log(1); |
| | | console.log($('div.drop_down_sel')) |
| | | |
| | | |
| | | $('div.drop_down_sel').remove(); |
| | | $('.zTreeDemoBackground').css("display", "none"); |
| | | $(".search_input").css("display", "none"); |
| | |
| | | |
| | | $('div.TreeWin').off('click.tree').on('click.tree', function (event) { |
| | | // 展开树 12/4 |
| | | console.log($(this)) |
| | | |
| | | $('div.drop_down_sel').remove(); |
| | | var fieldKey = $(this).find('.zTreeDemoBackground').attr('fieldkey'); |
| | | $('.zTreeDemoBackground').css("display", "none"); |
| | |
| | | overflow: "hidden", |
| | | 'overflow-y': "auto", |
| | | } |
| | | if(customShow.options.customInit.designMode == 2){//快捷模式处理 李伟民 0123 |
| | | if(customShow.options.customInit.designMode == 2){//快捷模式处理 0123 |
| | | $(".ztree").parent().parent().attr("name", "TreeWin"); |
| | | $(".ztree").parent().parent().attr("class", "TreeWin"); |
| | | }else{ |
| | |
| | | $('.ztree').parents('div[name="TreeWin"]').show(); |
| | | // 2017/11/4 点击预览的时候产生的树样式 李元杰 |
| | | $('div[type="Tree"]').append('<button class="btn btn-primary" name="treeButton1" style="display:none">选择</button>'); |
| | | //马习同 下拉树样式修改 11/13 |
| | | // 下拉树样式修改 11/13 |
| | | // $('div[name="TreeWin"]').prepend(` |
| | | // <div name="treeWinTitle"> |
| | | // <div class="content_wrap"> |
| | |
| | | $(".ztree").parent().css(subFormTreeCss); |
| | | for (var i = 0; i < ztreeParentCss.length; i++) { |
| | | // 11/16 李元杰 子表单内树形搜索框定位 |
| | | console.log($(ztreeParentCss[i]).find('ul')) |
| | | console.log($(ztreeParentCss[i]).parents('.fieldOrderNum')) |
| | | |
| | | |
| | | var isAllCopyTreeIs = $(ztreeParentCss[i]).find('ul').attr('id').split('tree')[0]; |
| | | if (customShow.options.customItemShow.item[isAllCopyTreeIs].parentsubFormNum != 0) { |
| | | $(ztreeParentCss[i]).css(subFormTreeCss); |
| | |
| | | if ($('button[name="treeButton1"]').length > 0) { |
| | | var treeId = $('button[name="treeButton1"]').prev().attr("id"); |
| | | var treeJson = $('button[name="treeButton1"]').prev().children(':nth-child(2)').attr("masterdata"); |
| | | //////console.log($(this).prev()[0]); |
| | | // console.log(treeJson); |
| | | //console.log(treeId); |
| | | ////// |
| | | // |
| | | // |
| | | if (typeof (treeJson) == "undefined" || treeJson == "") { |
| | | // alert("该控件没有进行数据绑定!") |
| | | } else { |
| | | // $("#occlusion").fadeTo(200); |
| | | console.log($('button[name="treeButton1"]')) |
| | | |
| | | $('button[name="treeButton1"]').prev().show(); |
| | | console.log($('div[name="treeWinTitle"]')) |
| | | |
| | | var treeWinTitle = $('div[name="treeWinTitle"]'); |
| | | console.log(treeWinTitle[0]) |
| | | |
| | | for (var i = 0; i < treeWinTitle.length; i++) { |
| | | console.log($(treeWinTitle[i])); |
| | | |
| | | $(treeWinTitle[i]).find('input[type="text"]').attr('id', `search_input${i}`) |
| | | } |
| | | } |
| | |
| | | // 12/7 end |
| | | $('.ztree').addClass('search_list'); |
| | | // 搜索框获得焦点时 初始化 |
| | | console.log($('.tabBox')) |
| | | |
| | | $('.tabBox').on('focus', '.search_input', function () { |
| | | console.log($(this)) |
| | | |
| | | var searchListId = $(this).parents('div[name="TreeWin"]').find('.ztree').attr('id'); |
| | | console.log($(this).parents('div[name="TreeWin"]').find('.ztree')); |
| | | |
| | | $(this).fastLiveFilter(`#${searchListId}`, {}); |
| | | }) |
| | | // $('button[name="treeButton2"]').click(function(){ |
| | |
| | | // } |
| | | // for(var x=0;x<a.length;x++){ |
| | | // $('#'+a[x]).click(); |
| | | // ////console.log(a[x]) |
| | | // //// |
| | | // } |
| | | |
| | | // // $("#occlusion").fadeOut(200); |
| | |
| | | //事件绑定 |
| | | eventBind = customShow.initEvent.eventBind; |
| | | //02事件绑定:字段别名 字段类型 事件名 自定义事件名 |
| | | console.log(eventBind); |
| | | |
| | | for (var i = 0; i < eventBind.length; i++) { |
| | | // 自定义事件名 |
| | | var funstr = eventBind[i].eventmethod + "()";//页面事件绑定 李伟民 12-22 |
| | | //页面事件绑定 李伟民 12-22 |
| | | var funstr = eventBind[i].eventmethod + "()";//页面事件绑定 12-22 |
| | | //页面事件绑定 12-22 |
| | | // 事件名 |
| | | var eventName = eventBind[i].event; |
| | | // 字段类型 |
| | |
| | | $("#" + itemId).attr('funstr',funstr) |
| | | //事件绑定 |
| | | $("#" + itemId).on(eventName, function () { |
| | | try {//页面事件 无资源文件 JS报错解决 李伟民 0131 |
| | | try {//页面事件 无资源文件 JS报错解决 0131 |
| | | eval($(this).attr('funstr')); |
| | | } catch (error) { |
| | | console.log('资源文件中无此方法') |
| | | |
| | | } |
| | | }); |
| | | }; |
| | |
| | | //初期化公式接口 |
| | | customShow.initEvent.interfaceInitLinkage(); |
| | | }, 200); |
| | | //马习同 合计 2017-12-07 公式初期化后 |
| | | // 合计 2017-12-07 公式初期化后 |
| | | customShow.oneTotle(); |
| | | } |
| | | |
| | |
| | | customShow.itemId = ""; |
| | | //数据设定值取得(主数据 API 数据源 自定义) |
| | | customShow.setDatasourceData = function (customItem) { |
| | | //马习同 获取 |
| | | // 获取 |
| | | customItems = customShow.options.customItemShow.item; |
| | | |
| | | var setDataItem = { |
| | |
| | | var itemId = unvisible[item].id; |
| | | // var itemTwo = itemId; |
| | | // var itemSubform = $('.'+"customViewUEditorCss" +" #"+itemId+"ActiveId"); |
| | | ////////////console.log(item); |
| | | //子表单删除第一条可添加 2017/10/26 马习同 |
| | | //////////// |
| | | //子表单删除第一条可添加 2017/10/26 |
| | | // var divIcon = $('<div id="'+itemId+'save" class="cfg_contentNone"></div>'); |
| | | var cloneE = $('#' + itemId + 'subformTr').clone(); |
| | | // divIcon.append(cloneE); |
| | | console.log(cloneE); |
| | | |
| | | // itemSubform.append(divIcon); |
| | | |
| | | |
| | |
| | | // $($($('.customViewUEditorCss #'+itemId)[0]).parentNode).find(".select2").remove(); |
| | | var dropdowntype = customShow.options.customItemShow.item[itemId].tag_Attribute.dropdowntype; |
| | | var editable = customShow.options.customItemShow.item[itemId].tag_Attribute.editable; |
| | | // ////console.log(editable); |
| | | // //// |
| | | var readonly = "readonly"; |
| | | if (editable) { |
| | | readonly = ""; |
| | | } |
| | | var width = $(item[0])[0].style.width.replace("px", ""); |
| | | width = parseInt(width); |
| | | console.log(width) |
| | | |
| | | customBase.options.dropdownlistText[itemId] = listData; |
| | | // $("#"+itemId).parent().empty(); |
| | | var itemIdClass = "selectClass js-example-basic-single defaultHeight customShowItemClass dropdowntypeCss " + itemId + "value " + readonly; |
| | |
| | | } else { |
| | | if (customShow.options.customItemShow.item[itemId].tag_Attribute.datasourcetype == "custom") { |
| | | var customItemsTemp = customShow.options.customItemShow.item[itemId].tag_Attribute.custom; |
| | | ////////console.log(customItemsTemp); |
| | | //////// |
| | | var initTempDataCustom = [] |
| | | var j = 0; |
| | | |
| | |
| | | if (customItemsTemp[i].ischecked) { |
| | | initTempDataCustom[j] = customItemsTemp[i].itemtext; |
| | | j++; |
| | | // ////////console.log(customItems[i].itemtext); |
| | | // ////////console.log(customItems[i]); |
| | | // //////// |
| | | // //////// |
| | | } |
| | | } |
| | | ////////console.log(initTempDataCustom); |
| | | //////// |
| | | if (customShow.options.customItemShow.item[itemId].tag_Attribute.dropdowntype == "single") { |
| | | customBase.setItemValue(itemId, "dropdownlistText", [initTempDataCustom[0]], "customViewUEditorCss", dropdowntype); |
| | | } else { |
| | |
| | | var oNode = ""; |
| | | var customItemsData = customBase.options.customItems; |
| | | for (data in customItemsData) { |
| | | // console.log(customBase.options.customItems[data]); |
| | | // console.log(itemId); |
| | | // |
| | | // |
| | | for (var i = 0; i < listData.length; i++) { |
| | | if (customBase.options.customItems[data].id == itemId) { |
| | | // 11/9 李元杰 是否有选中 |
| | | console.log(customBase.options.customItems[data]) |
| | | |
| | | var curFlag = ''; |
| | | if(listData[i].ischecked){ |
| | | curFlag = 'cur' |
| | |
| | | } |
| | | }; |
| | | // if(customBase.options.customItems[data].id == itemId ){ |
| | | // // console.log(listData); |
| | | // // |
| | | |
| | | // } |
| | | } |
| | |
| | | customBase.setItemValue(itemId, tag_Type, initTempData, "customViewUEditorCss"); |
| | | customShow.setShowItem(itemId, tag_Type, initTempData); |
| | | } |
| | | console.log($(item)) |
| | | |
| | | // 12/11 禁用背景 |
| | | var spanDiv = $(item).find('li').find('span'); |
| | | console.log($(item).parent().attr('editable')) |
| | | |
| | | if (($(item).parent().attr('editable') == "true")) { |
| | | $(item).find('li').find('span').addClass("disableUrl"); |
| | | for (var i = 0; i < spanDiv.length; i++) { |
| | | console.log($(spanDiv[i])) |
| | | |
| | | if (tag_Type == "radio") { |
| | | $(spanDiv[i]).removeClass("disableRadUrl"); |
| | | } else if (tag_Type == "checkbox") { |
| | |
| | | } |
| | | } else { |
| | | for (var i = 0; i < spanDiv.length; i++) { |
| | | console.log($(spanDiv[i])) |
| | | |
| | | if (tag_Type == "radio") { |
| | | $(spanDiv[i]).addClass("disableRadUrl"); |
| | | } else if (tag_Type == "checkbox") { |
| | |
| | | $(treeDiv[i]).find('ul').attr('id', ultreeId + i); |
| | | $.fn.zTree.init($($('.customViewUEditorCss #' + itemId + "tree" + i)), setting, listData); |
| | | // $('#'+itemId).parents('div[name="TreeWin"]').find('.citySel').addClass('disableColor') |
| | | console.log('#' + itemId); |
| | | |
| | | var treeObj = $.fn.zTree.getZTreeObj(itemId + "tree" + i); |
| | | // customShow.setTree.disableParentNode.set(treeObj); |
| | | if (treeObj) { |
| | |
| | | $('#' + itemId).attr('value', JSON.stringify(dataObj)) |
| | | $('#' + itemId).prev().find('.citySel').val(defaultValue); |
| | | // 12/8 禁止选中 李元杰' |
| | | console.log(itemId) |
| | | |
| | | var treeArray = _.filter(customShow.options.customItemShow.item, ['tag_Type', 'tree']) |
| | | for (var i = 0; i < treeArray.length; i++) { |
| | | if (treeArray[i].tag_Id == itemId) { |
| | |
| | | |
| | | //API数据 |
| | | setApiDatasource = function (item, callback) { |
| | | console.log(item) |
| | | |
| | | var apiUrl = item.tag_Attribute.apiUrl; |
| | | var callbackId = item.tag_Id; |
| | | callbackApiData = function (itemData, url) { |
| | | |
| | | console.log(url) |
| | | |
| | | var ItemId = url.split("callbackId=")[1]; |
| | | console.log(url) |
| | | |
| | | var item = customShow.options.customItemShow.item[ItemId]; |
| | | var apiIdKey = item.tag_Attribute.apiIdKey;// 表示项 |
| | | var apiPIdKey = item.tag_Attribute.apiPIdKey;// 表示值 |
| | | itemData = itemData.data; |
| | | |
| | | things = []; |
| | | console.log(itemData); |
| | | |
| | | // var textcolumn = itemData[apiIdKey]; |
| | | |
| | | // var valuecolumn = itemData[apiPIdKey]; |
| | |
| | | }; |
| | | } else if (item.tag_Type == 'tree') { |
| | | var apiName = item.tag_Attribute.apiName; |
| | | console.log(apiName) |
| | | |
| | | // var namecolumn = itemData[apiName]; |
| | | // if (textcolumn.length != namecolumn.length) { |
| | | // return; |
| | |
| | | things[i] = { id: itemData[i][apiIdKey], pId: itemData[i][apiPIdKey], name: itemData[i][apiName] }; |
| | | }; |
| | | } else { |
| | | console.log(itemData) |
| | | |
| | | |
| | | for (var i = 0; i < itemData.length; i++) { |
| | | console.log(itemData[i]) |
| | | console.log(apiPIdKey) |
| | | console.log(apiIdKey) |
| | | console.log(itemData[i][apiPIdKey]) |
| | | console.log(itemData[i][apiIdKey]) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | things[i] = { id: i, value: itemData[i][apiPIdKey], text: itemData[i][apiIdKey] }; |
| | | |
| | | }; |
| | | } |
| | | console.log(things); |
| | | |
| | | callback(ItemId, things); |
| | | } |
| | | |
| | |
| | | setMasterData = function (item, callback) { |
| | | var callbackId = item.tag_Id; |
| | | var code = item.tag_Attribute.masterData; |
| | | console.log(code); |
| | | |
| | | // 11/9 |
| | | |
| | | |
| | | |
| | | console.log(callbackId) |
| | | |
| | | // if(code == ""){ |
| | | // return; |
| | | // } |
| | | callbackMasterData = function (itemid, itemData) { |
| | | things = []; |
| | | console.log('√') |
| | | console.log(itemData); |
| | | console.log(itemid); |
| | | |
| | | |
| | | |
| | | var customItems = customBase.options.customItems; |
| | | for (item in customItems) { |
| | | if (customBase.options.customItems[item].id == callbackId) { |
| | |
| | | }; |
| | | } else if (item.tag_Type == 'tree') { |
| | | //------------------------- |
| | | console.log(itemData) |
| | | |
| | | if (itemData != null) { |
| | | for (var i = 0; i < itemData.length; i++) { |
| | | things[i] = { |
| | |
| | | } |
| | | |
| | | callbackDatasource = function (rs) { |
| | | console.log(this); |
| | | console.log(this.url); |
| | | |
| | | |
| | | var ItemId = this.url.split("callbackId=")[1]; |
| | | |
| | | item = customShow.options.customItemShow.item[ItemId]; |
| | |
| | | } |
| | | |
| | | var datasourcetype = item.tag_Attribute.datasourcetype; |
| | | // ////console.log(datasourcetype); |
| | | console.log(item); |
| | | console.log(datasourcetype); |
| | | // //// |
| | | |
| | | |
| | | setDataItem[datasourcetype](item, setCallbackItem); |
| | | // _.each($(".customShow .tdContentClass"), opt => { |
| | | // // $(opt).attr("title", $(opt).children().children().html()); |
| | | // console.log($(opt).html()) |
| | | // |
| | | // if ($(opt).children().children().attr("type") == "text") { |
| | | // $(opt).attr("title", $(opt).children().children().val()); |
| | | // } else { |
| | | // console.log(_.cloneDeep($(opt).children().children())) |
| | | // console.log(opt.innerHTML) |
| | | // console.log($(opt).children().children()[0].innerHTML) |
| | | // |
| | | // |
| | | // |
| | | // $(opt).attr("title", $(opt).children().children()[0].innerHTML); |
| | | // } |
| | | // }) |
| | |
| | | // return itemData; |
| | | // _.each($(".customShow .tdContentClass"), opt => { |
| | | // // $(opt).attr("title", $(opt).children().children().html()); |
| | | // console.log($(opt).html()) |
| | | // |
| | | // if ($(opt).children().children().attr("type") == "text") { |
| | | // $(opt).attr("title", $(opt).children().children().val()); |
| | | // } else { |
| | | // console.log(_.cloneDeep($(opt).children().children())) |
| | | // console.log(opt.innerHTML) |
| | | // console.log($(opt).children().children()[0].innerHTML) |
| | | // |
| | | // |
| | | // |
| | | // $(opt).attr("title", $(opt).children().children()[0].innerHTML); |
| | | // } |
| | | // }) |
| | |
| | | } |
| | | defaultValue = defaultValueArray.join(',') |
| | | } |
| | | console.log(dataObj) |
| | | |
| | | objValue[0] = defaultValue; |
| | | objValue[1] = dataObj; |
| | | } |
| | |
| | | defaultvalue: item.tag_Attribute.defaultvalue, |
| | | // field:"", |
| | | } |
| | | console.log(item.tag_Attribute.defaultvalue) |
| | | |
| | | } |
| | | }; |
| | | return itemsList; |
| | |
| | | // 单选框 |
| | | $('.select .custom-radio').unbind(); |
| | | $('.select .custom-radio').on('click', function () { |
| | | // //////////console.log(this.className); |
| | | // ////////// |
| | | if (this.className.indexOf("readonly") > -1) { |
| | | return; |
| | | } |
| | |
| | | } |
| | | $(this).toggleClass('cur'); |
| | | // $($(this).parent().parent().parent().parent()).find(".errorItemCss").removeClass('errorItemCss'); |
| | | // //////////console.log($($(this).parent().parent().parent())[0].id); |
| | | // ////////// |
| | | // var id = $($(this).parent().parent().parent())[0].id; |
| | | // $("#"+id+"mesageErrDiv").remove(); |
| | | // $(".customViewUEditorCss #"+id).popover('hide') |
| | | }); |
| | | customLinkageAnalysis.bindLinkageSubform("checkbox"); |
| | | //删除子表单项目 |
| | | $('.divshowEditor .iconfontcolorTH').unbind(); |
| | | $('.divshowEditor .iconfontcolorTH').on('click', function () { |
| | | ////////////////console.log($(this).parent().parent().parent()); |
| | | $(this).parent().parent().parent().parent().parent().remove(); |
| | | $('.iconfontcolorTH').unbind(); |
| | | $('.iconfontcolorTH').on('click', function () { |
| | | $(this).parent().parent().parent().parent().remove(); |
| | | }); |
| | | |
| | | $('.iconfontcolor').unbind(); |
| | | // iconfontcolorTH |
| | | $('.iconfontcolor').on('click', function () { |
| | | $(this).parent().parent().parent().remove(); |
| | | }); |
| | |
| | | customShow.controlInit = function (showClass) { |
| | | |
| | | var customItems = customBase.options.customItems; |
| | | console.log(customItems) |
| | | |
| | | if ('customShow' != showClass) { |
| | | //HTML内容控件初期化 |
| | | var htmlediterShow = $(".customViewUEditorCss .htmlediterShowClass"); |
| | |
| | | var htmlediterShowItemId = itemId.replace("Item", ""); |
| | | // var heightShow = htmlediterShow[i].getAttribute("heightShow"); |
| | | // var widthShow = htmlediterShow[i].getAttribute("widthShow"); |
| | | // ////////console.log(customShow.options.customItemShow.item[htmlediterShowItemId].tag_Attribute.alias); |
| | | // //////// |
| | | var heightShow = customShow.options.customItemShow.item[htmlediterShowItemId].tag_Attribute.height; |
| | | var widthShow = customShow.options.customItemShow.item[htmlediterShowItemId].tag_Attribute.width; |
| | | // customShow.options.customItemShow.item[itemId].tag_Attribute.alias; |
| | |
| | | //,iframeCssUrl:"css/bootstrap/css/bootstrap.css" //引入自身 css使编辑器兼容你网站css |
| | | //更多其他参数,请参考ueditor.config.js中的配置项 |
| | | }).ready(function () { |
| | | ////////////console.log(customBase.options.customItems); |
| | | //////////// |
| | | id = this.key; |
| | | for (i in customBase.options.customItems) { |
| | | if (customBase.options.customItems.hasOwnProperty(i)) { |
| | |
| | | UE.getEditor(id).setContent(customBase.options.customItems[i].defaultvalue); |
| | | } else { |
| | | var defaultvalue = customShow.options.itemFormbase[i]; |
| | | // ////////console.log(defaultvalue); |
| | | // //////// |
| | | // defaultvalue=defaultvalue+" "; |
| | | UE.getEditor(id).setContent(defaultvalue); |
| | | // setTimeout(function() { |
| | | // // this.body.focus(); |
| | | // ////////console.log(UE.getEditor(id)); |
| | | // //////// |
| | | // UE.getEditor(id).options.scaleEnabled =false; |
| | | // }, 1000); |
| | | } |
| | |
| | | } |
| | | $(".edui-editor-bottomContainer").addClass("cfg_contentNone"); |
| | | this.body.onclick = function (event, ui) { |
| | | //////////console.log(this); |
| | | //////////console.log(this.getAttribute("id")); |
| | | ////////// |
| | | ////////// |
| | | // $(this).removeClass("errorItemCss"); |
| | | // $("#"+this.getAttribute("id")+"mesageErrDiv").remove(); |
| | | } |
| | |
| | | else if (customItems[item].type == "mytext") { |
| | | if ("customViewUEditorCss" == showClass) { |
| | | var itemId = customItems[item].id; |
| | | ////console.log(itemId); |
| | | //// |
| | | var showCustomItem = customShow.options.customItemShow.item[itemId]; |
| | | // var itemValue = $('.'+showClass +" #"+itemId)[0].getAttribute("qrcodeurl"); |
| | | // var widthQrcode = $("#"+customItems[item].id)[0].width; |
| | |
| | | $("#" + itemId + "ActiveId").find("#" + itemTwo + "uld form input").attr("id", itemTwo + "btn"); |
| | | $("#" + itemId + "ActiveId").find("#" + itemTwo + "uld form").attr("itemId", itemTwo); |
| | | |
| | | //////////////console.log(item); |
| | | ////////////// |
| | | var ulIcon = document.createElement("ul"); |
| | | var liIcon = ""; |
| | | var m_customItems = customShow.options.customItemShow.item; |
| | | console.log(customBase.options) |
| | | |
| | | var subItems = []; |
| | | var parentNum = itemId.replace("itemId_", ""); |
| | | _.each(m_customItems, opt => { |
| | |
| | | subItems.push(opt); |
| | | } |
| | | }) |
| | | console.log(subItems) |
| | | |
| | | _.remove(subItems, n => { |
| | | return n.tag_Attribute.alias == "DATAROWNUM" || n.tag_Attribute.visible == false; |
| | | }); |
| | | //_.sortBy(orderArr, ['fieldOrderNum']); |
| | | subItems = _.sortBy(subItems, ['fieldOrderNum']); |
| | | _.each(subItems, opt => { |
| | | console.log(opt) |
| | | |
| | | if (opt.tag_Type == "number") { |
| | | liIcon += "<li class='n_totle'><input class='" + opt.tag_Id + "totle textCssDiv defaultHeight' type='text' readonly></li>" |
| | | console.log(1) |
| | | |
| | | } else { |
| | | liIcon += "<li class='p_totle'></li>" |
| | | console.log(2) |
| | | |
| | | } |
| | | }); |
| | | $(ulIcon).append(liIcon); |
| | | $("#" + itemId + "ActiveId").find(".h_totle").append(ulIcon); |
| | | console.log($("#" + itemId + "ActiveId").find(".h_totle")) |
| | | console.log(ulIcon) |
| | | |
| | | |
| | | // 单行文本 多行文本 数字 日历 |
| | | } else if (customItems[item].type == "text" || customItems[item].type == "textarea" || customItems[item].type == "number" || customItems[item].type == "calendar") { |
| | | var itemId = customItems[item].id; |
| | |
| | | } |
| | | } |
| | | } |
| | | console.log(defaultvalue) |
| | | |
| | | // 之前表单日历默认值不存在时 12/4 |
| | | if (defaultvalue == undefined || defaultvalue == 'undefined') { |
| | | defaultvalue = '' |
| | |
| | | || customItems[item].type == "htmlediter" || customItems[item].type == "link" |
| | | || customItems[item].type == "subform" |
| | | ) { |
| | | console.log(customBase.options.customItems[item]) |
| | | |
| | | customShow.setShowAttribute(customBase.options.customItems[item]); |
| | | } |
| | | // 12/15 |
| | |
| | | if(linkurl == ''){ |
| | | linkurl = 'javascript:void(0)'; |
| | | } |
| | | if(customShow.costType[customItems[item].id].tag_Attribute.editable){//不可编辑控制 李伟民 0124 |
| | | if(customShow.costType[customItems[item].id].tag_Attribute.editable){//不可编辑控制 0124 |
| | | $('#'+customItems[item].id).attr('href',linkurl) |
| | | } |
| | | } |
| | |
| | | $('.subformAdd').unbind(); |
| | | function addSubFunc() { |
| | | //子表单项目追加 |
| | | //console.log($(this)[0]); |
| | | // |
| | | customShow.addsubformList($(this)[0], "customViewUEditorCss"); |
| | | // customShow.setXhSelectListAdd(); |
| | | //子表单事件追加 |
| | |
| | | //公式初期化 |
| | | customLinkageAnalysis.bindLinkage(); |
| | | customShow.oneTotle(); |
| | | //console.log($('.subformAdd')); |
| | | // |
| | | $('.subformAdd').unbind('click', addSubFunc); |
| | | $('.subformAdd').on('click', addSubFunc); |
| | | //行程排序初期化 |
| | |
| | | //主数据丢失 |
| | | // $('.subformAdd').unbind(); |
| | | // $('.subformAdd').on('click', function(){ |
| | | // console.log(1) |
| | | // |
| | | // //子表单项目追加 |
| | | // customShow.addsubformList($(this)[0],"customViewUEditorCss"); |
| | | // //子表单事件追加 |
| | |
| | | //lym子表单上传 |
| | | $('.sonImportFile').unbind(); |
| | | $(".sonImportFile").click(function () { |
| | | console.log("进入点击事件"); |
| | | |
| | | //var checkedObj = $("#tbody input[type=checkbox]:checked"); |
| | | console.log("fdsffddffd"); |
| | | |
| | | // //创建文件上传对象 |
| | | var a = $(this).attr("itemId") |
| | | console.log(a) |
| | | |
| | | $("#" + a + "btn").click( |
| | | |
| | | ); |
| | | $("#" + a + "btn").change(function () { |
| | | console.log("uqwhdoqwhdo"); |
| | | |
| | | //var objFile = $("#"+itemTwo+"btn"); |
| | | //改变 |
| | | |
| | | let mthis = this; |
| | | var tenantId = localStorage.getItem("tenantID"); |
| | | var formID = localStorage.getItem("newFormID"); |
| | | var tenant = JSON.parse(tenantId); |
| | | var user = localStorage.getItem("userName"); |
| | | var userName = JSON.parse(user); |
| | | var tenantId = getEnclocal("tenantID"); |
| | | var formID = getEnclocal("newFormID"); |
| | | var tenant =tenantId; |
| | | var user = getEnclocal("userName"); |
| | | var userName = user; |
| | | var aba = a; |
| | | console.log(aba); |
| | | |
| | | //结束 |
| | | console.log(tenantId); |
| | | console.log(formID); |
| | | |
| | | |
| | | var objFile = $(this); |
| | | if (objFile.value == "") { |
| | | return; |
| | |
| | | async: false, |
| | | success: function (data) {//异步上传成功之后的操作 |
| | | if (data != undefined && data != null) { |
| | | console.log("返回参数"); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | var requestData = window.SonfiledUpload(dataObj, options, "/excel/impSonExcel", $(this).attr("itemId"), fileext); |
| | | var excels = JSON.parse(requestData); |
| | | console.log(requestData); |
| | | // console.log("最后"); |
| | | |
| | | // |
| | | // |
| | | // console.log($(this).attr("itemId")) |
| | | // |
| | | //改变 |
| | | $(mthis).val(""); |
| | | if (excels.data != undefined) { |
| | |
| | | }); |
| | | //文本文件上传 |
| | | var uploaderFile = $(".customViewUEditorCss .uploaderFile"); |
| | | console.log(uploaderFile) |
| | | |
| | | for (var i = 0; i < uploaderFile.length; i++) { |
| | | |
| | | var imageItem = customShow.options.customItemShow.item[uploaderFile[i].id]; |
| | |
| | | //必须入力验证 |
| | | // var mustcheckCss = $(".mustcheckCss");//-----------todo |
| | | // for (var i = 0; i < mustcheckCss.length; i++) { |
| | | // ////////////////console.log('#'+$(mustcheckCss)[i].id); |
| | | // //////////////// |
| | | // }; |
| | | |
| | | //子表单默认删除项目去掉 |
| | |
| | | |
| | | var showItem = customBase.getAmountHtml(defaultSize, true); |
| | | customBase.amount2Image(showItem, "amount", defaultSize, function (amountHtml) { |
| | | // ////////////////console.log(idTemp); |
| | | // //////////////// |
| | | $("#" + idTemp + "amount").addClass("cfg_contentNone"); |
| | | for (var i = 0; i < $("." + idTemp + "value").length; i++) { |
| | | $("." + idTemp + "value")[i].setAttribute("src", amountHtml); |
| | |
| | | $('.chooseMenu').unbind(); |
| | | $(".mytext_icon").on("click", function () { |
| | | $(this).closest("[type='mytext']").find('.boxBtn').click(); |
| | | console.log(customShow.options); |
| | | console.log(customBase.options); |
| | | |
| | | |
| | | }) |
| | | $('.boxBtn').on('click', (obj) => { |
| | | console.log(customBase.options) |
| | | |
| | | addVal = []; |
| | | //取得父页面变量 |
| | | var outWindowObj = window.parent; |
| | | var $iconId = $(obj)[0].target.getAttribute("myAttr"); |
| | | var iconAttr = customShow.options.customItemShow.item[$iconId]; |
| | | console.log(iconAttr); |
| | | |
| | | if ($("#" + $iconId).attr("formhuixian") != undefined) { |
| | | var formhuixian = JSON.parse($("#" + $iconId).attr("formhuixian")); |
| | | } |
| | | //console.log(formhuixian); |
| | | // |
| | | let head = ""; |
| | | if ($(obj)[0].target.previousSibling.getAttribute("chooseForm") != "" || iconAttr.tag_Attribute.relevancesourcetype == "fundata") { |
| | | console.log(attrData); |
| | | if (iconAttr.tag_Attribute.relevancesourcetype == "fundata") {//函数分支修改 李伟民 12-05 |
| | | |
| | | if (iconAttr.tag_Attribute.relevancesourcetype == "fundata") {//函数分支修改 12-05 |
| | | var titleObj = { "key": JSON.parse(iconAttr.tag_Attribute.fundata)['key'] }; |
| | | var requestTitle = window.commonAjax("/datamanagement/getAssociateTitle", titleObj, "POST", true, false); |
| | | requestTitle.done(function (res) { |
| | |
| | | } else { |
| | | var attrData = JSON.parse($(obj)[0].target.previousSibling.getAttribute("chooseForm")); |
| | | head = attrData.huixianObj.chooseData; |
| | | }//函数分支修改 李伟民 12-05 |
| | | // window.localStorage.setItem("bussiness", attrData.formID.bussinessSystem) //不用了? |
| | | }//函数分支修改 12-05 |
| | | // window.setDeclocal("bussiness", attrData.formID.bussinessSystem) //不用了? |
| | | //获取id值 |
| | | //用于验证是否已经存在div |
| | | var $divsLength = $('#' + $iconId + 'divIcons').length; |
| | |
| | | if (attrData && attrData.ScreenCondition != undefined) { |
| | | //下拉框取值 |
| | | let getVal = attrData.ScreenCondition.child; |
| | | console.log(getVal); |
| | | |
| | | _.each(getVal, opts => { |
| | | _.each(customBase.options.customItems, opt => { |
| | | if (opt.fieldKey == opts.fieldKey && opts.side == "thi") { |
| | | opts.value = ""; |
| | | if (opt.type == "dropdownlist") { |
| | | var getVals = customBase.getItemValue(opt.id, "dropdownlistText"); |
| | | console.log(getVals); |
| | | |
| | | if (getVals[0][0] != undefined) { |
| | | opts.value = getVals[0]; |
| | | } else { |
| | | opts.value = ""; |
| | | } |
| | | } else if (opt.type == "tree") {//树控件 处理 李伟民 12-5 |
| | | } else if (opt.type == "tree") {//树控件 处理 12-5 |
| | | var getVals = customBase.getItemValue(opt.id, opt.type); |
| | | console.log(getVals); |
| | | |
| | | if (getVals[0][0] != undefined) { |
| | | opts.value = getVals[0]; |
| | | } else { |
| | | opts.value = ""; |
| | | } |
| | | } else {//树控件 处理 李伟民 12-5 |
| | | } else {//树控件 处理 12-5 |
| | | var getVals = customBase.getItemValue(opt.id, opt.type); |
| | | console.log(getVals); |
| | | |
| | | if (getVals != undefined) { |
| | | opts.value = getVals; |
| | | } else { |
| | |
| | | } |
| | | if ($divsLength == 0) { |
| | | //外层蒙版 |
| | | console.log(customShow.options.customItemShow.item) |
| | | console.log($iconId) |
| | | |
| | | |
| | | var my_text_title = customShow.options.customItemShow.item[$iconId].tag_Attribute.title; |
| | | |
| | | var menuContent = document.createElement('div'); |
| | |
| | | var count = fenye("5", "1", formId, sCondition, formhuixian, head, $iconId, addVal, []); |
| | | |
| | | lastPage = Math.ceil(count / 5); |
| | | //console.log($(".pageF")) |
| | | // |
| | | $(".pageF").paging({ |
| | | pageNo: 1, |
| | | totalPage: lastPage, |
| | | totalSize: count, |
| | | callback: function (num) { |
| | | console.log(num); |
| | | |
| | | fenye("5", num, formId, sCondition, formhuixian, head, $iconId, addVal, []); |
| | | } |
| | | }); |
| | |
| | | } |
| | | |
| | | customShow.addtree = function (itemId, item) { |
| | | console.log(customBase.settingRadioType) |
| | | //修改克隆树的实例化 马习同2017-11-21 |
| | | console.log(customShow.options.customItemShow.item) |
| | | |
| | | //修改克隆树的实例化 2017-11-21 |
| | | |
| | | var customItem = customShow.options.customItemShow.item; |
| | | var ztree = {}; |
| | | for (let key in customItem) { |
| | |
| | | // var disableparentnode = false; |
| | | for (let key in ztree) { |
| | | if ($(item).find("#" + key).find('.ztree').parent().attr('disableparentnode') == "true") { |
| | | $(item).find("#" + key).find('.ztree').attr("id", key + "tree" + index_i);//修改克隆树的id 马习同2017-11-21 |
| | | $(item).find("#" + key).find('.ztree').attr("id", key + "tree" + index_i);//修改克隆树的id 2017-11-21 |
| | | if (ztree[key].tag_Attribute.dropdowntype == "single") { |
| | | $.fn.zTree.init($($(".customViewUEditorCss #" + key + "tree" + index_i)), customBase.settingRadioType, customShow.listData[key]); |
| | | // 12/2 树展开 |
| | |
| | | } |
| | | } |
| | | } else { |
| | | $(item).find("#" + key).find('.ztree').attr("id", key + "tree" + index_i);//修改克隆树的id 马习同2017-11-21 |
| | | $(item).find("#" + key).find('.ztree').attr("id", key + "tree" + index_i);//修改克隆树的id 2017-11-21 |
| | | if (ztree[key].tag_Attribute.dropdowntype == "single") { |
| | | $.fn.zTree.init($($(".customViewUEditorCss #" + key + "tree" + index_i)), customBase.settingRadioType, customShow.listData[key]); |
| | | // 12/2 树展开 |
| | | treeObj = $.fn.zTree.getZTreeObj(key + "tree" + index_i); |
| | | console.log(treeObj) |
| | | |
| | | if (treeObj) { |
| | | treeObj.expandAll(true); |
| | | } |
| | | } else if (ztree[key].tag_Attribute.dropdowntype == "multiple") { |
| | | $.fn.zTree.init($($(".customViewUEditorCss #" + key + "tree" + index_i)), customBase.settingChkboxType, customShow.listData[key]); |
| | | treeObj = $.fn.zTree.getZTreeObj(key + "tree" + index_i); |
| | | console.log(treeObj) |
| | | |
| | | if (treeObj) { |
| | | treeObj.expandAll(true); |
| | | } |
| | |
| | | var defaultValue = $('#' + treeId).parent().attr('defaultvalue'); |
| | | // // 12/7 默认值 |
| | | if (defaultValue != '') { |
| | | console.log(treeObj) |
| | | |
| | | customShow.treeDefaultSet(treeObj, defaultValue); |
| | | } |
| | | } |
| | | |
| | | } |
| | | console.log(treeObj) |
| | | console.log($(item)) |
| | | //修改克隆树的实例化End 马习同2017-11-21 |
| | | |
| | | |
| | | //修改克隆树的实例化End 2017-11-21 |
| | | index_i++; |
| | | |
| | | } |
| | | |
| | | //子表单项目追加 |
| | | customShow.addsubformList = function (subformAdd, showClass) { |
| | | console.log(i) |
| | | |
| | | |
| | | var allcopy = subformAdd.getAttribute('allcopy'); |
| | | var itemId = subformAdd.getAttribute('itemId'); |
| | | //单行记录更新 |
| | | |
| | | if (allcopy == "false") { |
| | | console.log(customBase.options.customItems); |
| | | console.log(customBase.options.customItems[customShow.options.customItemShow.item[itemId].tag_Attribute.alias].cloneDiv); |
| | | |
| | | |
| | | |
| | | var item = customBase.options.customItems[customShow.options.customItemShow.item[itemId].tag_Attribute.alias].cloneDiv; |
| | | // 子表单隐藏 马习同 11-13 |
| | | // 子表单隐藏 11-13 |
| | | // var item =$("."+showClass+" #"+itemId+"save").children()[0]; |
| | | //子表单情况为U情况 |
| | | if (item == undefined) {// 子表单回显 修改 李伟民 11-10 |
| | | if (item == undefined) {// 子表单回显 修改 11-10 |
| | | var tbody = $("." + showClass + " #" + itemId + "ActiveId").find("tbody"); |
| | | tbody = tbody[0].cloneNode(true); |
| | | console.log(tbody) |
| | | |
| | | // 清空input 12/7 |
| | | console.log($(item)) |
| | | |
| | | if ($(item).find('.zTreeDemoBackground').attr('defaultvalue') == '') { |
| | | $(item).find(".citySel").val(''); |
| | | } |
| | | $(tbody).find(".select2").remove(); |
| | | console.log($(tbody).html()); |
| | | |
| | | $(tbody).find(".tdTitleClass").closest("tr").addClass("table_title"); |
| | | $(tbody).find(".dropdowntypeCss").select2({ theme: "classic" }); |
| | | // $(tbody).find(".zTreeDemoBackground").select2({theme: "classic"}); |
| | |
| | | //删除头行 |
| | | $(tbody).find(".table_title").remove(); |
| | | } |
| | | if ($(tbody).find(".trContentClass").length > 1) {// 去除重复的tr 李伟民 11-14 |
| | | if ($(tbody).find(".trContentClass").length > 1) {// 去除重复的tr 11-14 |
| | | $($(tbody).find(".trContentClass")[0]).siblings().remove(); |
| | | }// 去除重复的tr 李伟民 11-14 |
| | | }// 去除重复的tr 11-14 |
| | | // $(tbody).find(".cfg_contentNone").removeClass("cfg_contentNone"); |
| | | tbody = customShow.addsubformListInit(itemId, $(tbody).find("tr")); |
| | | console.log(tbody); |
| | | console.log(itemId); |
| | | console.log($(tbody).find("#" + itemId).attr("class")); |
| | | $(tbody).find("input").attr("funarr", "");//公式绑定 清空 李伟民 12-11 |
| | | |
| | | |
| | | |
| | | $(tbody).find("input").attr("funarr", "");//公式绑定 清空 12-11 |
| | | $(tbody).find("input").attr("checkfunarr", ""); |
| | | $(tbody).find(".select_get").attr("funarr", ""); |
| | | $(tbody).find(".select_get").attr("checkfunarr", "");//公式绑定 清空 李伟民 12-11 |
| | | $($("." + showClass + " #" + itemId + "ActiveId").find("table")[0]).append(tbody);// 子表单回显 修改 李伟民 11-10 |
| | | $(tbody).find(".select_get").attr("checkfunarr", "");//公式绑定 清空 12-11 |
| | | $($("." + showClass + " #" + itemId + "ActiveId").find("table")[0]).append(tbody);// 子表单回显 修改 11-10 |
| | | customShow.hidesubform(); |
| | | customShow.setXhSelectList(false);//添加记录 重复问题 李伟民11-14 |
| | | customShow.setXhSelectList(false);//添加记录 重复问题 11-14 |
| | | } else { |
| | | item = item[0].cloneNode(true); |
| | | // 12/7 清空input |
| | | var defaultvalue = $(item).find('.zTreeDemoBackground').attr('defaultvalue'); |
| | | var itemIdTree = $(item).find('.ztree').attr('id'); |
| | | var treeObj = $.fn.zTree.getZTreeObj(itemIdTree); |
| | | console.log(treeObj) |
| | | |
| | | // 12/7 默认值 |
| | | if ($(item).find('.zTreeDemoBackground').attr('defaultvalue') == '') { |
| | | $(item).find(".citySel").val(''); |
| | |
| | | $(item).find(".dropdowntypeCss").select2({ theme: "classic" }); |
| | | $(item).find(".subformAddiconShow .cfg_contentNone").removeClass("cfg_contentNone"); |
| | | item = customShow.addsubformListInit(itemId, item); |
| | | $(item).find("input").attr("funarr", "");//公式绑定 清空 李伟民 12-11 |
| | | $(item).find("input").attr("funarr", "");//公式绑定 清空 12-11 |
| | | $(item).find("input").attr("checkfunarr", ""); |
| | | $(item).find(".select_get").attr("funarr", ""); |
| | | $(item).find(".select_get").attr("checkfunarr", "");//公式绑定 清空 李伟民 12-11 |
| | | $(item).find(".select_get").attr("checkfunarr", "");//公式绑定 清空 12-11 |
| | | $($("." + showClass + " #" + itemId + "ActiveId").find("table")[0]).append(item); |
| | | customShow.setXhSelectList(true);//添加记录 重复问题 李伟民11-14 |
| | | customShow.setXhSelectList(true);//添加记录 重复问题 11-14 |
| | | } |
| | | |
| | | customShow.addtree(itemId, item); |
| | | //普通模式下 子表单添加记录 |
| | | } else if (allcopy == null){ |
| | | |
| | | |
| | | |
| | | var item = customBase.options.customItems[customShow.options.customItemShow.item[itemId].tag_Attribute.alias].cloneDiv; |
| | | // 子表单隐藏 11-13 |
| | | // var item =$("."+showClass+" #"+itemId+"save").children()[0]; |
| | | //子表单情况为U情况 |
| | | if (item == undefined) {// 子表单回显 修改 11-10 |
| | | var tbody = $("." + showClass + " #" + itemId + "ActiveId").find("tbody"); |
| | | tbody = tbody[0].cloneNode(true); |
| | | |
| | | // 清空input 12/7 |
| | | |
| | | if ($(item).find('.zTreeDemoBackground').attr('defaultvalue') == '') { |
| | | $(item).find(".citySel").val(''); |
| | | } |
| | | $(tbody).find(".select2").remove(); |
| | | |
| | | $(tbody).find(".tdTitleClass").closest("tr").addClass("table_title"); |
| | | $(tbody).find(".dropdowntypeCss").select2({ theme: "classic" }); |
| | | // $(tbody).find(".zTreeDemoBackground").select2({theme: "classic"}); |
| | | if ($(tbody).find(".table_title").length > 0) { |
| | | //删除头行 |
| | | $(tbody).find(".table_title").remove(); |
| | | } |
| | | if ($(tbody).find(".trContentClass").length > 1) {// 去除重复的tr 11-14 |
| | | $($(tbody).find(".trContentClass")[0]).siblings().remove(); |
| | | }// 去除重复的tr 11-14 |
| | | // $(tbody).find(".cfg_contentNone").removeClass("cfg_contentNone"); |
| | | tbody = customShow.addsubformListInit(itemId, $(tbody).find("tr")); |
| | | |
| | | |
| | | |
| | | $(tbody).find("input").attr("funarr", "");//公式绑定 清空 12-11 |
| | | $(tbody).find("input").attr("checkfunarr", ""); |
| | | $(tbody).find(".select_get").attr("funarr", ""); |
| | | $(tbody).find(".select_get").attr("checkfunarr", "");//公式绑定 清空 12-11 |
| | | $($("." + showClass + " #" + itemId + "ActiveId").find("table")[0]).append(tbody);// 子表单回显 修改 11-10 |
| | | customShow.hidesubform(); |
| | | customShow.setXhSelectList(false);//添加记录 重复问题 11-14 |
| | | } else { |
| | | if(item[0] == undefined){ |
| | | item = $("." + showClass + " #" + itemId + "ActiveId").find("tbody"); |
| | | } |
| | | item = item[0].cloneNode(true); |
| | | // 12/7 清空input |
| | | var defaultvalue = $(item).find('.zTreeDemoBackground').attr('defaultvalue'); |
| | | var itemIdTree = $(item).find('.ztree').attr('id'); |
| | | var treeObj = $.fn.zTree.getZTreeObj(itemIdTree); |
| | | |
| | | // 12/7 默认值 |
| | | if ($(item).find('.zTreeDemoBackground').attr('defaultvalue') == '') { |
| | | $(item).find(".citySel").val(''); |
| | | } |
| | | $(item).find(".select2").remove(); |
| | | $(item).find(".dropdowntypeCss").select2({ theme: "classic" }); |
| | | $(item).find(".subformAddiconShow .cfg_contentNone").removeClass("cfg_contentNone"); |
| | | item = customShow.addsubformListInit(itemId, item); |
| | | $(item).find("input").attr("funarr", "");//公式绑定 清空 12-11 |
| | | $(item).find("input").attr("checkfunarr", ""); |
| | | $(item).find(".select_get").attr("funarr", ""); |
| | | $(item).find(".select_get").attr("checkfunarr", "");//公式绑定 清空 12-11 |
| | | $($("." + showClass + " #" + itemId + "ActiveId").find("table")[0]).append(item); |
| | | customShow.setXhSelectList(true);//添加记录 重复问题 11-14 |
| | | } |
| | | customShow.addtree(itemId, item); |
| | | //子表单事件追加 |
| | | } else { |
| | | |
| | | //全子表单复制 |
| | | // //console.log(1); |
| | | |
| | | var item = $("." + showClass + " #" + itemId + "ActiveId")[0]; |
| | | // //console.log(item); |
| | | // // |
| | | var itemstr = "." + showClass + " #" + itemId + "ActiveId"; |
| | | var item = $(itemstr)[0]; |
| | | // // |
| | | item = item.cloneNode(true); |
| | | //console.log(item); |
| | | // |
| | | var divIcons = document.createElement("div"); |
| | | divIcons.setAttribute("class", "frm_item_icons allCopyCss"); |
| | | var divIcon = document.createElement("div"); |
| | |
| | | // $(item).find(".icon-jiahao").parent().addClass("cfg_contentNone"); |
| | | $(item).append(divIcons); |
| | | // 清空 树的input |
| | | console.log($(item)) |
| | | |
| | | if ($(item).find('.zTreeDemoBackground').attr('defaultvalue') != '') { |
| | | |
| | | } else { |
| | |
| | | } |
| | | $(item).find(".select2").remove(); |
| | | $(item).find(".dropdowntypeCss").select2({ theme: "classic" }); |
| | | //console.log(item); |
| | | // |
| | | item = customShow.addsubformListInit(itemId, item); |
| | | // 10/23添加子表单记录 |
| | | var beforeitem = $("." + showClass + " #" + itemId + "ActiveId"); |
| | | //console.log(beforeitem); |
| | | $(item).find("input").attr("funarr", "");//公式绑定 清空 李伟民 12-11 |
| | | // |
| | | $(item).find("input").attr("funarr", "");//公式绑定 清空 12-11 |
| | | $(item).find("input").attr("checkfunarr", ""); |
| | | $(item).find(".select_get").attr("funarr", ""); |
| | | $(item).find(".select_get").attr("checkfunarr", "");//公式绑定 清空 李伟民 12-11 |
| | | $(item).find(".select_get").attr("checkfunarr", "");//公式绑定 清空 12-11 |
| | | $("." + showClass + " #" + itemId + "ActiveId").eq(0).after(item); |
| | | // _.each(beforeitem,function(bitem){ |
| | | if (beforeitem.length > 1) { |
| | |
| | | } else { |
| | | $(beforeitem[0]).find(".icon-jiahao").parent().addClass("cfg_contentNone"); |
| | | } |
| | | customShow.setXhSelectList();//添加记录 重复问题 李伟民11-14 |
| | | customShow.setXhSelectList();//添加记录 重复问题 11-14 |
| | | // }); |
| | | customShow.addtree(itemId, item); |
| | | } |
| | | } |
| | | //马习同修改 子表单隐藏 11/13 |
| | | //修改 子表单隐藏 11/13 |
| | | customShow.hidesubform = function () { |
| | | // console.log($("[tag_type='subform']")) |
| | | // |
| | | _.each($("[tag_type='subform']"), opt => { |
| | | console.log(opt) |
| | | |
| | | $($(opt).find(".tdTitleClass")[0]).addClass("cfg_contentNone"); |
| | | $($(opt).find(".tdContentClass")[0]).addClass("cfg_contentNone"); |
| | | }) |
| | |
| | | // _.remove(unvisibleArr,n => { |
| | | // return n.fieldKey == "DATAROWNUM"; |
| | | // }) |
| | | // console.log(unvisibleArr) |
| | | // |
| | | _.each(unvisibleArr, opt => { |
| | | $("[id='" + opt.id + "']").parent().parent().addClass("cfg_contentNone"); |
| | | $($(".customShow #itemId_" + opt.parentsubFormNum + " .tdTitleClass")[$("[id='" + opt.id + "']").parent().parent().index()]).addClass("cfg_contentNone"); |
| | |
| | | } |
| | | //子表单内数据初始化 |
| | | customShow.addsubformListInit = function (itemId, tbodys) { |
| | | //console.log(tbodys); |
| | | // |
| | | var itemList = customShow.options.customItemShow.item; |
| | | var item = itemList[itemId]; |
| | | var parentsubFormNum = item.columnOrderNum + ""; |
| | |
| | | } else if (type == "dropdownlist") { |
| | | var itemListIdTemp = itemListId + "_" + customShow.options.dropdownlist_I; |
| | | var item = $(tbodys).find("#" + itemListId); |
| | | ////////console.log($(tbodys)); |
| | | //////// |
| | | // var dropdowntype = $(item.find('select'))[0].getAttribute("dropdowntype"); |
| | | var dropdowntype = customShow.options.customItemShow.item[itemListId].tag_Attribute.dropdowntype; |
| | | if ($("#" + itemListId + " .select3-element")[0] == undefined) { |
| | |
| | | |
| | | width = parseInt(width); |
| | | var listData = customBase.options.dropdownlistText[itemListId]; |
| | | ////////console.log(customBase.options.dropdownlistText); |
| | | //////// |
| | | // $("#"+itemId).parent().empty(); |
| | | var itemIdClass = "selectClass js-example-basic-single defaultHeight customShowItemClass dropdowntypeCss " + itemListId + "value " + itemListIdTemp; |
| | | var DropdownlistItem = item.parent(); |
| | | // DropdownlistItem.css("background-color","red"); |
| | | // var setDiv = $('<div id="'+itemListId+'" class="selectClass '+itemIdClass+'"></div>'); |
| | | var setDiv = $('<div id="' + itemListId + '" class="selectClass lwm' + itemIdClass + '"></div>'); |
| | | console.log("11122211") |
| | | |
| | | DropdownlistItem.empty(); |
| | | setDiv.empty(); |
| | | console.log(itemListId); |
| | | |
| | | DropdownlistItem.append(setDiv); |
| | | console.log($(DropdownlistItem).html()); |
| | | //////console.log(dropdowntype); |
| | | |
| | | ////// |
| | | |
| | | if (dropdowntype == "multiple") { |
| | | customShow.options.subformDList[itemListIdTemp] = { |
| | |
| | | } |
| | | |
| | | } |
| | | //console.log(customShow); |
| | | //console.log(customBase); |
| | | // |
| | | // |
| | | |
| | | ////////console.log(customShow.options.customItemShow.item); |
| | | ////////console.log(itemId); |
| | | ////////console.log(item); |
| | | ////////console.log(parentsubFormNum); |
| | | //////// |
| | | //////// |
| | | //////// |
| | | //////// |
| | | // customShow.setXhSelectList(); |
| | | return tbodys; |
| | | } |
| | |
| | | auditableBtn(); |
| | | } |
| | | function auditableBtn() { |
| | | var processLog = JSON.parse(localStorage.getItem("processLog")); |
| | | var processLog = getEnclocal("processLog"); |
| | | if (processLog != null && processLog != undefined) { |
| | | } else { |
| | | alert("请先创建一个流程"); |
| | |
| | | } |
| | | customShow.onclickSave1 = function () { |
| | | // SC.sendanydata(function(flag){ |
| | | // console.log(flag); |
| | | // |
| | | // if(!flag){ |
| | | // console("if") |
| | | // customShow.onclickSave(1); |
| | |
| | | |
| | | //清空按钮按下是 |
| | | customShow.onclickClear = function () { |
| | | console.log(customBase); |
| | | console.log(customShow); |
| | | |
| | | |
| | | var itemKey = _.keys(customShow.options.customItemShow.item); |
| | | var item = customShow.options.customItemShow.item; |
| | | console.log(itemKey); |
| | | |
| | | _.each(itemKey, function (itemId) { |
| | | console.log(itemId); |
| | | console.log(item[itemId].tag_Type); |
| | | |
| | | |
| | | customBase.setItemValue(itemId, item[itemId].tag_Type, "", ""); |
| | | }); |
| | | } |
| | | //保存按钮按下时 |
| | | customShow.onclickSave = function (clickFlag) { |
| | | console.log(clickFlag); |
| | | |
| | | var saveReturn = customShow.initEvent.fromSaveLinkage(); |
| | | |
| | | //画面项目取得 --------------------------画面项目取得------ |
| | | var items = customShow.getItems(true); |
| | | console.log(items) |
| | | |
| | | // customShow.queryCost(); |
| | | try { |
| | | if (typeof (eval(eachitem)) == "function") { |
| | | eachitem(items); |
| | | } |
| | | } catch (e) { |
| | | console.log("不存在的函数"); |
| | | |
| | | } |
| | | |
| | | console.log("遍历数组") |
| | | console.log(items); |
| | | |
| | | |
| | | // 画面check |
| | | var returnfromCheck = customShow.initEvent.fromCheck(items); //-------------------- |
| | | if (returnfromCheck) { |
| | |
| | | // } |
| | | // 发送数据到后台服务器,保存data |
| | | var saveReturn = customShow.initEvent.fromSave3rd(items);//-------------------- |
| | | console.log(customShow.options.customShowFlag) |
| | | |
| | | if (saveReturn) { |
| | | console.log(1) |
| | | |
| | | if (customShow.options.customShowFlag == "1") { |
| | | //保存 |
| | | customDataBound.fromSave(customShow.options.formid, items, function (rs) { |
| | |
| | | window.parent.addFormData(rs); |
| | | $(window.parent.document.body).css({ "overflow-x": "auto", "overflow-y": "auto" }); |
| | | } |
| | | // //////console.log(rs); |
| | | // ////// |
| | | }); |
| | | } else if (customShow.options.customShowFlag == "2") { |
| | | console.log(2) |
| | | |
| | | //保存 |
| | | customDataBound.fromEdit(customShow.options.formid, items, customShow.options.dataRowNum, function (rs) { |
| | | if (rs.rspCode == "100004") { |
| | |
| | | customShow.options.breakFlag = true; |
| | | //预览模式表示 |
| | | $("#customViewUEditor")[0].style.display = "none"; |
| | | //马习同 2018-1-2 布局修改 |
| | | // 2018-1-2 布局修改 |
| | | $("#customShow")[0].style.display = "flex"; |
| | | // $(".footer")[0].style.display ="none"; |
| | | |
| | |
| | | ]; |
| | | customShow.showCustom(items, customShow.options.customInit); |
| | | customShow.setToolBtn(btns); |
| | | console.log("关闭") |
| | | |
| | | customShow.onclickCancel(); |
| | | |
| | | }); |
| | |
| | | } |
| | | else if (customShow.options.customShowFlag == "3") { |
| | | // 保存 |
| | | console.log(3) |
| | | |
| | | if (clickFlag == 2 && customShow.options.dataRowNum != "") { |
| | | //保存 |
| | | customDataBound.fromEdit(customShow.options.formid, items, customShow.options.dataRowNum, function (rs) { |
| | | ////console.log(rs); |
| | | //// |
| | | if (rs.rspCode == "000000") { |
| | | var strMessage = customBase.getMessage("mesage_ID015"); |
| | | customBase.alert("S", strMessage); |
| | |
| | | // window.parent.addFormData(rs); |
| | | // $(window.parent.document.body).css({"overflow-x": "auto","overflow-y": "auto"}); |
| | | // } |
| | | if(customShow.options.customShowFlag != "3" ){//发布差异修改 李伟民 0120 |
| | | if(customShow.options.customShowFlag != "3" ){//发布差异修改 0120 |
| | | customShow.options.dataRowNum = rs.data.dataRowNum; |
| | | } |
| | | //////console.log(rs); |
| | | ////// |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | // customShow.onclickCancel(); |
| | | // window.parent.$('#myModal').modal('hide'); |
| | | // console.log($('.boxOne')) |
| | | // |
| | | // $('.boxOne').css("display","none"); |
| | | } |
| | | |
| | | //保存按钮按下时(项目预览表示) |
| | | customShow.showCustom = function (items, customInit) { |
| | | console.log(items); |
| | | console.log(customInit); |
| | | |
| | | |
| | | customShow.options.customItemShow = customInit.customViewItem; |
| | | var customItem = customShow.options.customItemShow; |
| | | // $(".preview-edit-pane").css("display","block"); |
| | |
| | | $("#customShow")[0].innerHTML = divHtml; |
| | | var height = customShow.options.customItemShow.height; |
| | | // height = parseInt(height)-50; |
| | | //////////console.log(height); |
| | | ////////// |
| | | $("#customShow")[0].style.height = height + "px"; |
| | | $("#customShow")[0].style.width = customShow.options.customItemShow.width; |
| | | $("#customShow")[0].style.display = "flex"; |
| | |
| | | } |
| | | if (customItems[item].type == 'subform') { |
| | | var subformTemp = items[item]; |
| | | //////console.log(items); |
| | | ////console.log(item); |
| | | console.log(subformTemp); |
| | | // console.log(customItems); |
| | | ////// |
| | | //// |
| | | |
| | | // |
| | | if (subformTemp == undefined) { |
| | | subformTemp = [{}]; |
| | | } |
| | |
| | | //选项卡回显 |
| | | if (customItems[item].type == 'tag') { |
| | | var subformTemp = items[item]; |
| | | ////console.log(items); |
| | | ////console.log(item); |
| | | ////console.log(subformTemp); |
| | | ////console.log(customItems); |
| | | //// |
| | | //// |
| | | //// |
| | | //// |
| | | if (subformTemp == undefined) { |
| | | subformTemp = [{}]; |
| | | } |
| | |
| | | |
| | | //删除项目(select2项目删除) |
| | | $('.customShow .selection').remove(); |
| | | //console.log(customItems); |
| | | // |
| | | //数据设定 |
| | | for (item in customItems) { |
| | | console.log(items) |
| | | |
| | | if (customItems.hasOwnProperty(item)) { |
| | | if (customItems[item] == undefined) { |
| | | delete customItems[item]; |
| | |
| | | //标签数据设定 |
| | | } else if (customItems[item].type == 'link') { |
| | | var htmlediterShow = $(".customShow").find("#" + id)[0]; |
| | | // console.log($(htmlediterShow)) |
| | | // |
| | | // $(htmlediterShow)[0].setAttribute("href","javascript:;"); |
| | | $(htmlediterShow).css("font-size", "16px;"); |
| | | //单选 多选按钮 |
| | |
| | | // $($(".customShow").find("#"+id)[0]).after(oNode); |
| | | // $($(".customShow").find("#"+id)[0]).remove(); |
| | | var showItem = $($(".customShow").find("#" + id)); |
| | | console.log(showItem) |
| | | |
| | | for (var i = 0; i < showItem.length; i++) { |
| | | $($(showItem[i])[0]).after(oNode); |
| | | $($(showItem[i])[0]).remove(); |
| | | } |
| | | console.log(value) |
| | | |
| | | //单选复选回显问题 |
| | | customShow.setShowItem(id, type, value, true); |
| | | } |
| | | else if (customItems[item].type == 'tree') { |
| | | //普通模式树形回显 李伟民 0130 |
| | | //普通模式树形回显 0130 |
| | | var oNode = '<div treeitemid=' + id + ' style="word-break:break-all;border-width: 0px;border-style: solid;border-color: rgb(204, 204, 204);width:200px;" class="customShowItemClass edui-default customShowItemClassTemp">'; |
| | | // 2017 /11/7 李元杰 树的回显 |
| | | // var treeShow = $('#customShow').find('div[type=tree]'); |
| | | |
| | | // if(value !=undefined && value !=""){ |
| | | // console.log(1); |
| | | // |
| | | // if(typeof value == "string"){ |
| | | // // value = $.parseJSON(value); |
| | | // console.log(2); |
| | | // |
| | | // value =[value]; |
| | | // } |
| | | // // 2017/11/7 李元杰回显 |
| | | // if(value.length>0){ |
| | | // console.log(value); |
| | | // |
| | | // for(var i =0;i<value.length;i++){ |
| | | // value[i] |
| | | // } |
| | | |
| | | |
| | | // console.log(value) |
| | | // |
| | | |
| | | // if(typeof value[0] == "string"){ |
| | | // //console.log(value[0]); |
| | | // // |
| | | // // value[0] = $.parseJSON(value[0]); |
| | | // } |
| | | |
| | | // oNode +=value[0]; |
| | | // } |
| | | // for (var i = 1; i < value.length; i++) { |
| | | // console.log(4); |
| | | // |
| | | // if(typeof value[i] == "string"){ |
| | | // console.log(5); |
| | | // |
| | | // // value[i] = $.parseJSON(value[i]); |
| | | // } |
| | | // console.log(value) |
| | | // |
| | | // oNode +=" , "+value[i]; |
| | | // console.log(oNode) |
| | | // |
| | | // }; |
| | | // } |
| | | // console.log(oNode) |
| | | // |
| | | |
| | | // oNode +="</div>"; |
| | | "</div>"; |
| | | $($(".customShow").find("#" + id)[0]).after(oNode); |
| | | $($(".customShow").find("#" + id)[0]).remove(); |
| | | // customShow.setShowItem(id, type, value, true); |
| | | console.log($($(".customShow").find("#" + id)[0])) |
| | | |
| | | } |
| | | else if (customItems[item].type == 'amount') { |
| | | var id = id + "amount"; |
| | |
| | | }; |
| | | } |
| | | $uploadimg.appendTo($uploaderItem); |
| | | //2017-12-17 马习同修改 图片 |
| | | //2017-12-17 修改 图片 |
| | | // $(".info_box").on("click", function () { |
| | | // $(".x_box").show(); |
| | | // $(".img_box").show(); |
| | | // $(".x_box").unbind(); |
| | | // $(".x_box").on("click", function () { |
| | | // console.log(1); |
| | | // |
| | | // $(".x_box").hide(); |
| | | // $(".img_box").hide(); |
| | | // }) |
| | |
| | | } else if (customItems[item].type == 'image') { |
| | | // var $wrap = $(".customShow #" + customItems[item].id); |
| | | var $uploaderItem = $($(".customShow #" + customItems[item].id)[0]); |
| | | console.log($('#' + customItems[item].id)); |
| | | console.log($uploaderItem) |
| | | |
| | | |
| | | $uploaderItem.empty(); |
| | | |
| | | var $uploadimg = $( |
| | |
| | | '</div>' |
| | | ); |
| | | // var $list = $uploadimg.find("#"+potion.id+"fileList"); |
| | | console.log(value) |
| | | if(customItems[item].defaultvalue != undefined){//详细显示默认值 李伟民 0131 |
| | | |
| | | if(customItems[item].defaultvalue != undefined){//详细显示默认值 0131 |
| | | var $list = $uploadimg.find("#fileList"); |
| | | var $addLi = $( |
| | | '<div class="file-item thumbnail">' + |
| | |
| | | var value = JSON.parse(value); |
| | | |
| | | } |
| | | console.log(value) |
| | | |
| | | if (typeof value != "string") { |
| | | if (typeof value == "string") { |
| | | // value = $.parseJSON(value); |
| | |
| | | // itemId_32uploadimg |
| | | |
| | | // 编辑页 |
| | | // console.log($('#customViewUEditor').find('#'+imgId).children()) |
| | | // console.log($('#'+imgId)) |
| | | // console.log($uploaderItem) |
| | | // |
| | | // |
| | | // |
| | | // var viewer = new Viewer(document.getElementById(imgId), { |
| | | // url: 'data-original', |
| | | // show:function(){ |
| | | // console.log('显示') |
| | | // |
| | | // } |
| | | // }); |
| | | // 12/18 |
| | |
| | | |
| | | } else if (customItems[item].type == 'mytext') { |
| | | //选择表单编辑回显 |
| | | console.log(customItems); |
| | | console.log(customShow); |
| | | |
| | | |
| | | var itemAttribute = customShow.options.customItemShow.item[customItems[item].id]; |
| | | var $mytext = $("#" + customItems[item].id); |
| | | var item_title = []; |
| | | var itemVal = []; |
| | | if (itemAttribute.tag_Attribute.relevancesourcetype == "fundata") {// 关联数据回显渲染 李伟民 11-30 |
| | | if (itemAttribute.tag_Attribute.relevancesourcetype == "fundata") {// 关联数据回显渲染 11-30 |
| | | var titleObj = { "key": JSON.parse(itemAttribute.tag_Attribute.fundata)["key"] }; |
| | | var dataObj = { |
| | | "formID": customShow.options.formid, |
| | |
| | | var requesTitle = window.commonAjax("/datamanagement/getAssociateTitle", titleObj, "POST", true, false); |
| | | var requesData = window.commonAjax("/datamanagement/getAssociateData", dataObj, "POST", true, false); |
| | | requesTitle.done(function (res) { |
| | | console.log(res); |
| | | |
| | | item_title = res.data; |
| | | }); |
| | | requesData.done(function (res) { |
| | | console.log(res); |
| | | |
| | | if (!_.isNull(res.data) && res.data != undefined) { |
| | | itemVal = res.data; |
| | | } |
| | | }); |
| | | } else { |
| | | var myTitle = JSON.parse(window.localStorage.getItem("title")); |
| | | var myTitle = window.getEnclocal("title"); |
| | | item_title = myTitle[item]; |
| | | itemVal = items[item]; |
| | | } |
| | | console.log(itemVal) |
| | | console.log(item_title); |
| | | console.log(itemVal.list); |
| | | createMxtTable(customItems[item].id, item_title, itemVal.list);// 关联数据回显渲染 李伟民 11-30 |
| | | |
| | | |
| | | |
| | | createMxtTable(customItems[item].id, item_title, itemVal.list);// 关联数据回显渲染 11-30 |
| | | // var newData = []; |
| | | // _.each(itemVal.list,function(opt){ |
| | | // opt = _.mapKeys(opt,function(value,key){ |
| | |
| | | // }) |
| | | // return key; |
| | | // }) |
| | | // console.log(_.cloneDeep(opt)) |
| | | // |
| | | // newData.push(opt); |
| | | // }) |
| | | // console.log(itemVal.list); |
| | | // console.log(newData); |
| | | // |
| | | // |
| | | var formhuixian = itemVal.list; |
| | | |
| | | //console.log(formhuixian); |
| | | // |
| | | var huixianStr = ""; |
| | | for (let i in formhuixian) { |
| | | //console.log($mytext.attr("fieldkey")); |
| | | //console.log(i); |
| | | //console.log(formhuixian[i]); |
| | | // |
| | | // |
| | | // |
| | | if (i = $mytext.attr("fieldkey")) { |
| | | huixianStr = formhuixian[i]; |
| | | } |
| | | } |
| | | //console.log(huixianStr); |
| | | // |
| | | $mytext.attr("formhuixian", JSON.stringify(itemVal.list)); |
| | | // if(newData){ |
| | | // var $value = newData; |
| | | // console.log($value) |
| | | // |
| | | // |
| | | // var show = ""; |
| | | // var divBox = $("<div></div>"); |
| | |
| | | // show += '<li>'+'<span class="data1 '+i+'">'+i+'</span>'+'<span class="data2 '+i+'">'+opt[i]+'</span>'+'</li>'; |
| | | // ulBox.attr("class","addUl ulBox"+j); |
| | | // ulBox.attr("id","ulBox"+j); |
| | | // //console.log(show) |
| | | // // |
| | | // ulBox.append(show); |
| | | // } |
| | | // divBox.append(ulBox); |
| | | // }); |
| | | // console.log(sdata_head); |
| | | // |
| | | // $mytext.append(divBox); |
| | | // } |
| | | } |
| | |
| | | //画面表示项目取得 ----------------- |
| | | customShow.getItems = function (saveflag) { |
| | | var items = customBase.options.customItems; |
| | | console.log(items); |
| | | |
| | | var itemTempS = {}; |
| | | for (item in items) { |
| | | if (items.hasOwnProperty(item)) { |
| | | console.log(item); |
| | | console.log(items[item].type); |
| | | |
| | | |
| | | if (items[item].type == "button" || items[item].type == "link") { |
| | | } else if (items[item].type == "dropdownlist") { |
| | | // var datasourcetype = $("#"+items[item].id)[0].getAttribute("datasourcetype"); |
| | |
| | | // itemTempS[item] = customBase.getItemValue(items[item].id,"dropdownlistText"); |
| | | // } |
| | | itemTempS[item] = customBase.getItemValue(items[item].id, "dropdownlistText"); |
| | | console.log(itemTempS[item]) |
| | | if (saveflag) {//下拉框 传值 修改 李伟民 11-09 |
| | | console.log(itemTempS[item]); |
| | | |
| | | if (saveflag) {//下拉框 传值 修改 11-09 |
| | | |
| | | _.each(itemTempS[item], function (sval, i) { |
| | | if (_.isArray(sval)) { |
| | | itemTempS[item][i] = sval.join(); |
| | |
| | | // if(_.isArray(itemTempS[item][0])){ |
| | | // itemTempS[item][0] = itemTempS[item][0].join(",") |
| | | // } |
| | | console.log(itemTempS[item]); |
| | | }//下拉框 传值 修改 李伟民 11-09 |
| | | |
| | | }//下拉框 传值 修改 11-09 |
| | | } else if (items[item].type == "tree") { |
| | | itemTempS[item] = customBase.getItemValue(items[item].id, "tree"); |
| | | console.log(itemTempS[item]) |
| | | |
| | | if (saveflag) {//树形传值 修改 李元杰 11-21 |
| | | console.log(itemTempS[item]); |
| | | |
| | | _.each(itemTempS[item], function (sval, i) { |
| | | if (_.isArray(sval)) { |
| | | itemTempS[item][i] = sval.join(); |
| | |
| | | }//树形 传值 修改 李元杰 11-21 |
| | | } else if (items[item].type == "checkbox") { |
| | | itemTempS[item] = customBase.getItemValue(items[item].id, "checkbox"); |
| | | console.log(itemTempS[item]) |
| | | console.log(saveflag) |
| | | if (saveflag) {//复选框传值 修改 马习同 12-6 |
| | | console.log(itemTempS[item]); |
| | | |
| | | |
| | | if (saveflag) {//复选框传值 修改 12-6 |
| | | |
| | | _.each(itemTempS[item], function (sval, i) { |
| | | if (_.isArray(sval)) { |
| | | itemTempS[item][i] = sval.join(); |
| | |
| | | // if(_.isArray(itemTempS[item][0])){ |
| | | // itemTempS[item][0] = itemTempS[item][0].join(",") |
| | | // } |
| | | }////复选框传值 修改 马习同 12-6 |
| | | }////复选框传值 修改 12-6 |
| | | } else if (items[item].type == "radio") { |
| | | itemTempS[item] = customBase.getItemValue(items[item].id, "radio"); |
| | | console.log(itemTempS[item]) |
| | | console.log(saveflag) |
| | | if (saveflag) {//复选框传值 修改 马习同 12-6 |
| | | console.log(itemTempS[item]); |
| | | |
| | | |
| | | if (saveflag) {//复选框传值 修改 12-6 |
| | | |
| | | _.each(itemTempS[item], function (sval, i) { |
| | | if (_.isArray(sval)) { |
| | | itemTempS[item][i] = sval.join(); |
| | |
| | | // if(_.isArray(itemTempS[item][0])){ |
| | | // itemTempS[item][0] = itemTempS[item][0].join(",") |
| | | // } |
| | | }////复选框传值 修改 马习同 12-6 |
| | | }////复选框传值 修改 12-6 |
| | | } else if (items[item].type == "subform" || items[item].type == "tag" || items[item].type == "tab") { |
| | | |
| | | } else if (items[item].type == "auto") { |
| | | var str = window.localStorage.getItem("customItem"); |
| | | var str = window.getEnclocal("customItem"); |
| | | var prefix = (str != undefined && str != "undefined") ? JSON.parse(str) : null; |
| | | if (prefix != null && (prefix[item] != null || prefix[item] != undefined)) { |
| | | itemTempS[item] = prefix[item]; |
| | |
| | | } |
| | | } else { |
| | | itemTempS[item] = customBase.getItemValue(items[item].id, items[item].type); |
| | | console.log(itemTempS[item]); |
| | | |
| | | } |
| | | } |
| | | }; |
| | |
| | | } |
| | | } |
| | | } |
| | | console.log(_.cloneDeep(itemRetuen)); |
| | | console.log(_.cloneDeep(itemTempS)); |
| | | |
| | | |
| | | //子表单内数据保存 |
| | | for (item in itemTempS) { |
| | | ////console.log(items); |
| | | ////console.log(itemTempS); |
| | | ////console.log(item); |
| | | //// |
| | | //// |
| | | //// |
| | | if (itemTempS.hasOwnProperty(item)) { |
| | | var parentsubFormNum = customBase.options.customItems[item].parentsubFormNum; |
| | | ////console.log(customBase.options) |
| | | ////console.log(customBase.options.customItems[item]); |
| | | ////console.log(parentsubFormNum); |
| | | //// |
| | | //// |
| | | //// |
| | | if (parentsubFormNum == "0") { |
| | | if (customBase.options.customItems[item].type == "radio" || |
| | | customBase.options.customItems[item].type == "checkbox" || |
| | |
| | | itemRetuen[item] = itemTempS[item]; |
| | | } |
| | | } else { |
| | | ////console.log(item); |
| | | ////console.log(items); |
| | | ////console.log(itemRetuen[parentsubFormNum]); |
| | | ////console.log(itemTempS[item]); |
| | | ////console.log(itemRetuen); |
| | | ////console.log(parentsubFormNum); |
| | | //// |
| | | //// |
| | | //// |
| | | //// |
| | | //// |
| | | //// |
| | | itemRetuen[parentsubFormNum][item] = itemTempS[item]; |
| | | } |
| | | } |
| | | } |
| | | //子表单内最终数据变换 |
| | | console.log(_.cloneDeep(itemRetuen)); |
| | | console.log(customBase.options.customItems); |
| | | |
| | | |
| | | for (item in customBase.options.customItems) { |
| | | if (customBase.options.customItems.hasOwnProperty(item)) { |
| | | if (customBase.options.customItems[item].type == "subform" || customBase.options.customItems[item].type == "tag" || customBase.options.customItems[item].type == "tab") { |
| | |
| | | var tepItem = itemRetuen[id]; |
| | | var subformIten = []; |
| | | var i = 0; |
| | | console.log(tepItem); |
| | | |
| | | for (tem in tepItem) { |
| | | if (tepItem.hasOwnProperty(tem)) { |
| | | if (typeof tepItem[tem] == "string") { |
| | |
| | | } |
| | | subformIten[0][tem] = tepItem[tem]; |
| | | } else { |
| | | console.log(tepItem[tem]); |
| | | |
| | | for (var i = 0; i < tepItem[tem].length; i++) { |
| | | if (subformIten[i] == undefined) { |
| | | subformIten[i] = {}; |
| | |
| | | } |
| | | } |
| | | delete itemRetuen[id]; |
| | | console.log(_.cloneDeep(subformIten)); |
| | | |
| | | itemRetuen[customBase.options.customItems[item].fieldKey] = subformIten; |
| | | } |
| | | } |
| | | } |
| | | console.log(_.cloneDeep(itemRetuen)); |
| | | |
| | | return itemRetuen; |
| | | } |
| | | |
| | |
| | | var removePrintArea = function (id) { |
| | | $("iframe#" + id).remove(); |
| | | }; |
| | | var customShowFlag = window.localStorage.getItem("customShowFlag"); |
| | | var customShowFlag = window.getEnclocal("customShowFlag"); |
| | | if (customShowFlag == "0") { |
| | | var itemOnPrint = $("#customViewUEditor")[0].cloneNode(true); |
| | | $(itemOnPrint).css("overflow", 'visible'); |
| | |
| | | //编辑按钮按下时 |
| | | customShow.onEditor = function () { |
| | | // $(".preview-edit-pane").css("display", "none"); |
| | | window.localStorage.setItem("customShowFlag", 3); |
| | | window.setDeclocal("customShowFlag", 3); |
| | | var formIDs = customlocalStorage.newFormID; |
| | | |
| | | customDataBound.formsetting(formIDs, function () { }); |
| | | //console.log("编辑存值"); |
| | | // |
| | | $("#customShow").empty(); |
| | | if (customShow.options.customShowFlag != "3") { |
| | | //图片文件上传 |
| | |
| | | customShow.setXhSelectList(); |
| | | //子表单事件调用 |
| | | customShow.clickBindSubform(); |
| | | //2017/11/18 马习同修改 隐藏预览模式下 导入数据按钮 |
| | | //2017/11/18 修改 隐藏预览模式下 导入数据按钮 |
| | | $(".sonImportFile").removeClass("cfg_contentNone"); |
| | | //s_savebtn |
| | | $(".s_savebtn").show(); |
| | |
| | | mustcheck = true; |
| | | } |
| | | } else if (tag_Type == "checkbox" || tag_Type == "dropdownlist") { |
| | | // //////////console.log(value); |
| | | // ////////// |
| | | if (value.length == 0) { |
| | | customShow.showErrorItem(tag_Type, ItemId, N); |
| | | var message = customBase.getMessage("mesage_ID004"); |
| | |
| | | customShow.setShowMesageErr(ItemId, message, N); |
| | | mustcheck = true; |
| | | } |
| | | ////////console.log(customShow.options.customItemShow.item[ItemId].tag_Attribute); |
| | | //////// |
| | | } |
| | | } |
| | | |
| | |
| | | for (fieldKey in customItems) { |
| | | |
| | | if (customItems.hasOwnProperty(fieldKey)) { |
| | | ////console.log(customItems); |
| | | //// |
| | | var tag_Type = customItems[fieldKey].type; |
| | | var ItemId = customItems[fieldKey].id; |
| | | if (customItems[fieldKey].visible) { |
| | |
| | | //文本格式验证 |
| | | if (customItems[fieldKey].type == "text") { |
| | | var value = items[fieldKey]; |
| | | ////console.log(fieldKey); |
| | | ////console.log(customItems); |
| | | ////console.log(value); |
| | | //// |
| | | //// |
| | | //// |
| | | var format = customShow.options.customItemShow.item[ItemId].tag_Attribute.format; |
| | | //子表单的情况 |
| | | if (value == undefined) { |
| | |
| | | var subformItemId = "itemId_" + customItems[fieldKey].parentsubFormNum; |
| | | var subformItemAlias = customShow.options.customItemShow.item[subformItemId].tag_Attribute.alias; |
| | | var subformItem = items[subformItemAlias]; |
| | | ////console.log(items); |
| | | ////console.log(subformItemAlias); |
| | | ////console.log(subformItem); |
| | | //// |
| | | //// |
| | | //// |
| | | for (var i = 0; i < subformItem.length; i++) { |
| | | textFormatCheck(format, subformItem[i][fieldKey], ItemId, i); |
| | | } |
| | |
| | | // $(".errorItemCss").unbind('focus'); |
| | | // $(".errorItemCss").on('focus', function() { |
| | | // $(this).removeClass("errorItemCss"); |
| | | // ////////////console.log($(this)[0].id); |
| | | // //////////// |
| | | // $("#"+$(this)[0].id+"mesageErrDiv").remove(); |
| | | // $(".customViewUEditorCss #"+$(this)[0].id).popover('hide') |
| | | // }); |
| | |
| | | } |
| | | |
| | | //检证验证 |
| | | customShow.interfaceCheck = function (items) {//保存前计算费用 李伟民 10 - 31 |
| | | customShow.interfaceCheck = function (items) {//保存前计算费用 10 - 31 |
| | | var flag = true; |
| | | _.each(customBase.interfaceData, function (intdata) { |
| | | var func = intdata.customInterfacemethod + "()"; |
| | | if(intdata.interfacemethod == 'fromSave3rd'){//只执行保存接口事件 |
| | | try {//解决不上传资源文件JS报错 导致无法保存 李伟民 0129 |
| | | try {//解决不上传资源文件JS报错 导致无法保存 0129 |
| | | var thisChheck = eval(func); |
| | | console.log(thisChheck); |
| | | |
| | | if (thisChheck == false) { |
| | | flag = false; |
| | | } |
| | |
| | | } |
| | | }); |
| | | return flag; |
| | | }//保存前计算费用 李伟民 10 - 31 |
| | | }//保存前计算费用 10 - 31 |
| | | |
| | | //错误信息 |
| | | customShow.showErrorItem = function (errorClass, tag_Type, id, N) { |
| | |
| | | } |
| | | UE.getEditor(id + "Item").body.setAttribute("heightFlag", height); |
| | | |
| | | // //////////console.log(UE.getEditor(id+"Item").body.style.height = ); |
| | | // ////////// |
| | | } else if (tag_Type == "dropdownlist") { |
| | | // $(".customViewUEditorCss #"+id).p + ".selection").addClass(errorClass); |
| | | // //////////console.log($('.customViewUEditorCss #'+id)[0].parentNode); |
| | | // ////////// |
| | | $($('.customViewUEditorCss #' + id)[N].parentNode).find(".select2").addClass(errorClass); |
| | | // $(".customViewUEditorCss #"+id+" .select2-search__field") |
| | | if ($($('.customViewUEditorCss #' + id)[N].parentNode).find(".select2-search__field").length > 0) { |
| | |
| | | |
| | | //画面属性设定(初始值 表示/非表示 只读 必须 审查必须) |
| | | customShow.setShowAttribute = function (aliasItem) { |
| | | console.log(aliasItem) |
| | | |
| | | // 12/7 不可编辑 可以编辑 |
| | | id = aliasItem.id; |
| | | //表示非表示 |
| | |
| | | itemTemp.removeAttr('readonly'); |
| | | // 非编辑情况移除背景颜色 12/7 李元杰 |
| | | for (var i = 0; i < itemTemp.length; i++) { |
| | | console.log(itemTemp[i]); |
| | | |
| | | $(itemTemp[i]).removeClass('disableColor') |
| | | } |
| | | if (tag_Type == "calendar") { |
| | |
| | | $(itemTemp).removeClass("disableColor"); |
| | | |
| | | $(itemTemp).removeClass("readonly"); |
| | | // ////console.log($(itemTemp).find(".select-container")); |
| | | // //// |
| | | } else if (tag_Type == "button") {//---------------------------------------------------------OK |
| | | $(itemTemp).removeClass('disabled'); |
| | | } else if (tag_Type == "link") {//-----------------------------------------------------------OK |
| | |
| | | if (tag_Type == "text" || tag_Type == "textarea" || tag_Type == "number" || tag_Type == "calendar") {//--OK |
| | | for (var i = 0; i < itemTemp.length; i++) { |
| | | // 12/7 李元杰 添加背景颜色 |
| | | console.log(itemTemp[i]); |
| | | |
| | | itemTemp[i].setAttribute('readonly', ''); |
| | | $(itemTemp[i]).addClass('disableColor') |
| | | } |
| | |
| | | itemTemp.removeClass('dateFromyyyymm'); |
| | | itemTemp.removeClass('dateFromyyyymmdd'); |
| | | itemTemp.removeClass('dateFromhhmiss'); |
| | | ////////console.log(itemTemp); |
| | | //////// |
| | | var itemDateFromTemp = itemTemp[0].cloneNode(true); |
| | | var $DateFromTemp = "<div id='itemDateFromTemp'></div>" |
| | | itemTemp.after($DateFromTemp); |
| | |
| | | } else if (tag_Type == "dropdownlist") {//---------------------------------------------------OK |
| | | // $(itemTemp).addClass('editableDisabled'); |
| | | // $(itemTemp).prop("disabled", true); //设置下拉框不可用 |
| | | // ////console.log($(itemTemp).find(".select-container")); |
| | | // //// |
| | | // itemTemp = $(itemTemp).find(".select-container"); |
| | | // for(var i = 0 ;i<itemTemp.length;i++){ |
| | | // itemTemp[i].setAttribute('readonly',''); |
| | | // } |
| | | console.log($(itemTemp)) |
| | | |
| | | $(itemTemp).find('.select-container_box').addClass('disableColor') |
| | | $(itemTemp).addClass("readonly"); |
| | | ////console.log( $(itemTemp)); |
| | | //// |
| | | } else if (tag_Type == "button") {//---------------------------------------------------------OK |
| | | $(itemTemp).addClass('disabled'); |
| | | } else if (tag_Type == "link") {//-----------------------------------------------------------OK |
| | |
| | | itemTemp[i].setAttribute('disabled', 'disabled'); |
| | | } |
| | | } else if (tag_Type == "fileupload") {//----------------------------------------------------todo |
| | | console.log($(itemTemp)); |
| | | |
| | | debugger |
| | | } else if (tag_Type == "tree") {//----------------------------------------------------------todo |
| | | // 禁用背景颜色 |
| | | console.log($(itemTemp).parents('div[name="TreeWin"]')) |
| | | console.log($(itemTemp)) |
| | | |
| | | |
| | | |
| | | itemTemp[0].setAttribute('editable', aliasItem.editable); |
| | | } |
| | | // else if (tag_Type == "tree" || tag_Type == "tree" || tag_Type == "tree") { |
| | | // // var itemTemp = $("#customResultFormDiv").find("#"+tag_Id)[0]; |
| | | // console.log($(itemTemp)) |
| | | // |
| | | // itemTemp.setAttribute('editable', aliasItem.editable); |
| | | // } |
| | | } |
| | | } |
| | | //错误信息显示 |
| | | customShow.setShowMesageErr = function (id, message, N, type) { |
| | | console.log("setShowMesageErr"); |
| | | console.log(message); |
| | | ////console.log(id); |
| | | |
| | | |
| | | //// |
| | | var mesageHtml = '<div class="' + id + 'Popover"></div>'; |
| | | if (customShow.options.customInit.designMode == "1") { |
| | | ////console.log(id); |
| | | ////console.log(message); |
| | | ////console.log(N); |
| | | ////console.log($($(".customViewUEditorCss #"+id)[N])); |
| | | //// |
| | | //// |
| | | //// |
| | | //// |
| | | // $($(".customViewUEditorCss #"+id)[N]).popover('hide'); |
| | | // if($($(".customViewUEditorCss #" + id)[N]).attr('popoverFalg') != undefined){ |
| | | // $('.' + id + 'Popover').html(message); |
| | |
| | | content: mesageHtml, |
| | | trigger: 'manual' |
| | | }); |
| | | $($(".customViewUEditorCss #" + id)[N]).hover(function(){// 普通模式 错误提示修改 李伟民 0125 |
| | | $($(".customViewUEditorCss #" + id)[N]).hover(function(){// 普通模式 错误提示修改 0125 |
| | | if($($(".customViewUEditorCss #" + id)[N]).attr('popoverFalg') != 'false'){ |
| | | $($(".customViewUEditorCss #" + id)[N]).popover('show'); |
| | | $('.' + id + 'Popover').html(message); |
| | |
| | | $($(".customViewUEditorCss #" + id)[N]).popover('hide'); |
| | | },2000) |
| | | customShow.options.showErrId[id] = N; |
| | | //////console.log($($(".customViewUEditorCss #"+id+"Item")[N]).length); |
| | | ////// |
| | | |
| | | if ($($(".customViewUEditorCss #" + id + "Item")[N]).length == 1) { |
| | | $($(".customViewUEditorCss #" + id + "Item")[N]).attr('popoverFalg','true'); |
| | |
| | | $($(".customViewUEditorCss #" + id + "Item")[N]).on('focus',function(){ |
| | | $($(".customViewUEditorCss #" + id + "Item")[N]).attr('popoverFalg','false'); |
| | | $($(".customViewUEditorCss #" + id + "Item")[N]).popover('hide'); |
| | | })// 普通模式 错误提示修改 李伟民 0125 |
| | | })// 普通模式 错误提示修改 0125 |
| | | } |
| | | |
| | | } else { |
| | | var mesageErrDiv = document.createElement("div"); |
| | | mesageErrDiv.setAttribute("class", "mesageErrDiv"); |
| | | mesageErrDiv.setAttribute("id", id + "mesageErrDiv"); |
| | | if(type){//验证消息 修改 李伟民 |
| | | if(type){//验证消息 修改 |
| | | $(mesageErrDiv).addClass("checkErr"); |
| | | }//验证消息 修改 李伟民 |
| | | }//验证消息 修改 |
| | | $(mesageErrDiv).append(message); |
| | | var tempActiveId = $($(".customViewUEditorCss #" + id + "ActiveId")[N]).find("#" + id + "mesageErrDiv"); |
| | | $($(".customViewUEditorCss #" + id + "ActiveId")[N]).find("#" + id + "mesageErrDiv").remove(); |
| | |
| | | var requiredHint = $($($(".customViewUEditorCss #" + id + "ActiveId")[N])[0]); |
| | | if (requiredHint.find('input').val() === '') { |
| | | if ($(".customViewUEditorCss #" + id + "ActiveId").length == 0) { |
| | | console.log($(".customViewUEditorCss [id='" + id + "']:eq(" + N + ")").closest("td")); |
| | | |
| | | $(".customViewUEditorCss [id='" + id + "']:eq(" + N + ")").closest("td").append(mesageErrDiv); |
| | | } else { |
| | | $($($(".customViewUEditorCss #" + id + "ActiveId")[N])[0]).append(mesageErrDiv); |
| | |
| | | $(mesageErrDiv).html(requiredHint.children('h8').children('span').html() + "必须输入") |
| | | } else { |
| | | if ($(".customViewUEditorCss #" + id + "ActiveId").length == 0) { |
| | | console.log($(".customViewUEditorCss [id='" + id + "']:eq(" + N + ")").closest("td")); |
| | | |
| | | if ($(".customViewUEditorCss [id='" + id + "']:eq(" + N + ")").closest("td").find(".mesageErrDiv").length == 0) { |
| | | $(".customViewUEditorCss [id='" + id + "']:eq(" + N + ")").closest("td").append(mesageErrDiv); |
| | | } |
| | |
| | | //表示模式下,数据设定(单选 复选 下拉菜单) |
| | | customShow.setShowItem = function (itemId, type, value, flag) { |
| | | //被选择项目设定 |
| | | console.log(1) |
| | | // console.log(_.cloneDeep(itemId)) |
| | | // console.log(_.cloneDeep(type)) |
| | | console.log(_.cloneDeep(value)) |
| | | // console.log(_.cloneDeep(flag)) |
| | | |
| | | // |
| | | // |
| | | |
| | | // |
| | | checkboxRadioShow = function (showItem, value) { |
| | | console.log($(showItem), value) |
| | | |
| | | var listData = customBase.options.dropdownlistText[itemId]; |
| | | if (listData == undefined) { |
| | | return; |
| | |
| | | } |
| | | var temp = []; |
| | | var tempStr = ""; |
| | | console.log(listData); |
| | | console.log(value) |
| | | |
| | | |
| | | for (var i = 0; i < listData.length; i++) { |
| | | for (var j = 0; j < value.length; j++) { |
| | | if (value[j] == listData[i].value) { |
| | | console.log(1) |
| | | |
| | | temp[j] = listData[i].text; |
| | | } |
| | | } |
| | | } |
| | | console.log(temp) |
| | | |
| | | for (var i = 0; i < temp.length; i++) { |
| | | if (i == 0) { |
| | | tempStr = temp[i]; |
| | |
| | | tempStr += "," + temp[i]; |
| | | } |
| | | } |
| | | console.log(tempStr) |
| | | |
| | | $(showItem).empty(); |
| | | //console.log(tempStr); |
| | | // |
| | | $(showItem).append(tempStr); |
| | | |
| | | } |
| | | var showItem = $("." + itemId + "_showItem"); |
| | | console.log(showItem) |
| | | |
| | | //页面返回 |
| | | if (flag) { |
| | | if (type == "checkbox" || type == "radio") { |
| | |
| | | |
| | | //工具栏设定button |
| | | customShow.setToolBtn = function (btns) { |
| | | console.log(btns) |
| | | |
| | | $(".edit-pane").empty(); |
| | | var $editPaneBtn = $($(".edit-pane")[0]); |
| | | |
| | | console.log($editPaneBtn) |
| | | // //////console.log(btns); |
| | | |
| | | // ////// |
| | | for (var i = 0; i < btns.length; i++) { |
| | | if (customShow.button[btns[i]].functionName == "") { |
| | | $a = '<a id="' + btns[i] + '" href="javascript:void(0);">' + |
| | |
| | | var defindCode = masterData.defindCode; |
| | | var eleCode = masterData.eleCode; |
| | | customLinkageAnalysis.getElement("itemId_1", eleCode, function (re) { |
| | | ////////console.log(re); |
| | | //////// |
| | | }) |
| | | } |
| | | |
| | | //主数据重复 |
| | | customShow.setXhSelectList = function (addflag) { |
| | | // console.log(1) |
| | | // |
| | | var subformDList = customShow.options.subformDList; |
| | | //console.log(subformDList); |
| | | //console.log(85244445) |
| | | //console.log(addflag) |
| | | // |
| | | // |
| | | // |
| | | var setValueItem = {}; |
| | | // |
| | | //var subArr = []; |
| | |
| | | // subObj[key] = subformDList[key]; |
| | | // } |
| | | //} |
| | | //console.log(_.cloneDeep(subObj)); |
| | | // |
| | | for (var id in subformDList) { |
| | | console.log(id); |
| | | |
| | | if ($(".customViewUEditorCss ." + id).length == 1) { |
| | | var xhSelectTemp = { |
| | | selectId: customShow.options.subformDList[id].selectId, |
| | |
| | | listData: customBase.options.dropdownlistText[customShow.options.subformDList[id].selectId], |
| | | setDiv: id |
| | | }; |
| | | console.log(xhSelectTemp); |
| | | console.log(1) |
| | | |
| | | |
| | | xhSelect.setXhSelect(xhSelectTemp); |
| | | var item = customShow.options.customItemShow.item[customShow.options.subformDList[id].selectId]; |
| | | setValueItem[item.tag_Attribute.alias] = customShow.options.subformDList[id].selectId; |
| | | } |
| | | } |
| | | console.log(setValueItem); |
| | | console.log(customShow.options); |
| | | |
| | | |
| | | if (!addflag) { |
| | | for (var valueItem in setValueItem) { |
| | | var setList = customShow.options.subformDValue[valueItem]; |
| | | console.log(setList); |
| | | |
| | | if (setList != undefined) { |
| | | for (var i = 0; i < setList.length; i++) { |
| | | xhSelect.setValue(setValueItem[valueItem], setList[i], i); |
| | |
| | | } |
| | | //子表单添加记录 复制下拉框方法 2017/10/06 |
| | | customShow.setXhSelectListAdd = function () { |
| | | // //////console.log(table); |
| | | // ////// |
| | | var subformDList = customShow.options.subformDList; |
| | | var setValueItem = {}; |
| | | //10/2/27 马习同修改 下拉框复制重复 |
| | | //10/2/27 修改 下拉框复制重复 |
| | | var xhSelectTemp = {}; |
| | | for (var id in subformDList) { |
| | | if ($(".customViewUEditorCss ." + id).length == 1) { |
| | |
| | | listData: customBase.options.dropdownlistText[customShow.options.subformDList[id].selectId], |
| | | setDiv: id |
| | | }; |
| | | // //////console.log($(".customViewUEditorCss ."+id).find('select > option')); |
| | | // ////// |
| | | if ($(".customViewUEditorCss ." + id).find('select > option').length == 0) { |
| | | // //////console.log("----------------------------------------------"); |
| | | console.log(1) |
| | | // ////// |
| | | |
| | | xhSelect.setXhSelect(xhSelectTemp); |
| | | } |
| | | } |
| | | } |
| | | xhSelect.setXhSelect(xhSelectTemp); |
| | | //10/2/27 马习同修改 下拉框复制重复 |
| | | //10/2/27 修改 下拉框复制重复 |
| | | } |
| | | |
| | | |
| | | customShow.getFormSetting = function (btnFlag) { |
| | | var ren = 1; |
| | | if (btnFlag == 'printableBtn') { |
| | | ren = customShow.options.formsetting['printable']; |
| | | } else if (btnFlag == 'exportBtn') { |
| | | ren = customShow.options.formsetting['exportable']; |
| | | } else if (btnFlag == 'rejectBtn') { |
| | | ren = customShow.options.formsetting['rejectable']; |
| | | } else if (btnFlag == 'submitBtn') { |
| | | ren = customShow.options.formsetting['submitable']; |
| | | } else if (btnFlag == 'auditableBtn') { |
| | | ren = customShow.options.formsetting['auditable']; |
| | | } else if (btnFlag == 'queryBtn') { |
| | | ren = customShow.options.formsetting['queryable']; |
| | | } else if (btnFlag == 'createBtn') { |
| | | ren = customShow.options.formsetting['createable']; |
| | | } else if (btnFlag == 'clearBtn') { |
| | | // ren = customShow.options.formsetting['clearable']; |
| | | ren = 1; |
| | | } else if (btnFlag == 'disposableBtn') { |
| | | // ren = customShow.options.formsetting['disposable']; |
| | | ren = 1; |
| | | //} else if (btnFlag == 'fromSaveBtn') { |
| | | // if(customShow.options.customShowFlag != '3'){//发布修改 李伟民 0120 |
| | | // ren = customShow.options.formsetting['saveable']; |
| | | // console.log(ren) |
| | | // }else{ |
| | | // ren = 1; |
| | | // } |
| | | // ren = 1; |
| | | } else if (btnFlag == 'editableBtn') { |
| | | ren = customShow.options.formsetting['editableBtn'];//编辑按钮受权限控制 李伟民 0204 |
| | | // ren = 1; |
| | | } |
| | | return ren; |
| | | if(customShow.options.customShowFlag == '3'){//发布修改 0120 |
| | | if (btnFlag == 'saveable') { |
| | | ren = 1; |
| | | } |
| | | } else { |
| | | var ren = 1; |
| | | if (btnFlag == 'printableBtn') { |
| | | ren = customShow.options.formsetting['printable']; |
| | | } else if (btnFlag == 'exportBtn') { |
| | | ren = customShow.options.formsetting['exportable']; |
| | | } else if (btnFlag == 'rejectBtn') { |
| | | ren = customShow.options.formsetting['rejectable']; |
| | | } else if (btnFlag == 'submitBtn') { |
| | | ren = customShow.options.formsetting['submitable']; |
| | | } else if (btnFlag == 'auditableBtn') { |
| | | ren = customShow.options.formsetting['auditable']; |
| | | } else if (btnFlag == 'queryBtn') { |
| | | ren = customShow.options.formsetting['queryable']; |
| | | } else if (btnFlag == 'createBtn') { |
| | | ren = customShow.options.formsetting['createable']; |
| | | } else if (btnFlag == 'clearBtn') { |
| | | // ren = customShow.options.formsetting['clearable']; |
| | | ren = 1; |
| | | } else if (btnFlag == 'disposableBtn') { |
| | | // ren = customShow.options.formsetting['disposable']; |
| | | } else if (btnFlag == 'fromSaveBtn') { |
| | | ren = customShow.options.formsetting['saveable']; |
| | | // ren = 1; |
| | | } else if (btnFlag == 'editableBtn') { |
| | | ren = customShow.options.formsetting['editableBtn'];//编辑按钮受权限控制 0204 |
| | | // ren = 1; |
| | | } |
| | | |
| | | } |
| | | return ren; |
| | | |
| | | } |
| | | var customLinkageAnalysis = customLinkageAnalysis || {}; |
| | |
| | | result = items[customShow.options.customItemShow.item[ItemId].tag_Attribute.alias]; |
| | | } |
| | | } |
| | | ////console.log(result); |
| | | //// |
| | | var resultTemp = ""; |
| | | |
| | | for (var i = 0; i < result.length; i++) { |
| | |
| | | } |
| | | |
| | | } |
| | | ////console.log(resultTemp); |
| | | //// |
| | | return resultTemp; |
| | | } else if (typeof result != "string") { |
| | | result = result.join(','); |
| | | } |
| | | ////console.log(customShow); |
| | | ////console.log(customLinkageAnalysis); |
| | | console.log(result); |
| | | //// |
| | | //// |
| | | |
| | | return result; |
| | | } |
| | | |
| | |
| | | * value:设定值 |
| | | */ |
| | | customLinkageAnalysis.setValue = function (itemId, value, num) { |
| | | console.log(itemId); |
| | | console.log(value); |
| | | |
| | | |
| | | var item = customShow.options.customItemShow.item[itemId]; |
| | | //数据类型 |
| | | var type = item.tag_Type; |
| | |
| | | editable //可编辑 true:可编辑 false:不可编辑 |
| | | */ |
| | | customLinkageAnalysis.getAttribut = function (itemId, attributeName) { |
| | | console.log(itemId); |
| | | console.log(attributeName) |
| | | |
| | | |
| | | var item = customShow.options.customItemShow.item[itemId]; |
| | | // return customLinkageAnalysis.validationEx(item.tag_Attribute.alias); |
| | | var alias = item.tag_Attribute.alias; |
| | | var ttn = customBase.options.customItems[alias][attributeName]; |
| | | ////console.log(ttn) |
| | | //// |
| | | return ttn; |
| | | } |
| | | |
| | |
| | | var item = customShow.options.customItemShow.item[itemId]; |
| | | // return customLinkageAnalysis.validationEx(item.tag_Attribute.alias); |
| | | var alias = item.tag_Attribute.alias; |
| | | console.log(alias) |
| | | |
| | | attributeValue = attributeValue + ""; |
| | | attributeValue = attributeValue.toLowerCase(); |
| | | if (attributeValue == "true") { |
| | |
| | | num = 0; |
| | | } |
| | | var errorClass; |
| | | if (mode == "0") {//验证消息 修改 李伟民 |
| | | if (mode == "0") {//验证消息 修改 |
| | | errorClass = "errorCheckCss" |
| | | } else { |
| | | errorClass = "errorItemCss"; |
| | | }//验证消息 修改 李伟民 |
| | | }//验证消息 修改 |
| | | customShow.showErrorItem(errorClass, type, ItemId, num); |
| | | //焦点事件 |
| | | // $("." + errorClass).unbind('focus'); |
| | | $("[id='" + ItemId + "']:eq(" + num + ")").unbind("focus"); |
| | | $("[id='" + ItemId + "']:eq(" + num + ")").on('focus', function () { |
| | | console.log("focus"); |
| | | |
| | | $(this).removeClass(errorClass); |
| | | ////////console.log($(this)[0].id); |
| | | $(this).closest("#" + $(this)[0].id + "ActiveId").find("[id='" + $(this)[0].id + "mesageErrDiv']").remove();//修改错误信息删除 李伟民 2017-10-18 14:15 |
| | | //////// |
| | | $(this).closest("#" + $(this)[0].id + "ActiveId").find("[id='" + $(this)[0].id + "mesageErrDiv']").remove();//修改错误信息删除 2017-10-18 14:15 |
| | | $(this).closest(".tdContentClass").find("[id='" + $(this)[0].id + "mesageErrDiv']").remove();//列表模式 |
| | | // $("#"+$(this)[0].id+"mesageErrDiv").remove(); |
| | | $(".customViewUEditorCss #" + $(this)[0].id).popover('hide') |
| | |
| | | $("#" + id + "mesageErrDiv").remove(); |
| | | $($(".customViewUEditorCss #" + id)[N]).popover('hide') |
| | | }); |
| | | if (mode == "0") {//验证消息 修改 李伟民 |
| | | if (mode == "0") {//验证消息 修改 |
| | | customShow.setShowMesageErr(ItemId, message, num, true); |
| | | } else { |
| | | customShow.setShowMesageErr(ItemId, message, num); |
| | | }//验证消息 修改 李伟民 |
| | | }//验证消息 修改 |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | // 初期调用 |
| | | customLinkageAnalysis.bindLinkage = function () { |
| | | // ////console.log(window.customBase); |
| | | // //// |
| | | //取得公式的JSON数据 |
| | | // ////console.log(customShow); |
| | | // ////console.log(customLinkageAnalysis); |
| | | // //// |
| | | // //// |
| | | var rules = customShow.options.jsonLinkage; |
| | | if (typeof rules == 'string') { |
| | | rules = eval(rules); |
| | |
| | | //保存接口 (false:不继续执行 true:继续执行) |
| | | // customShow.initEvent.fromSaveLinkage; |
| | | for (var i = 0; i < rules.length; i++) { |
| | | //console.log(rules[i]); |
| | | // |
| | | var dofunction = {}; |
| | | try { |
| | | dofunction = customLinkageAnalysis.makeLinkage(rules[i]); |
| | | } catch (e) { |
| | | ////console.log(e.message); |
| | | //// |
| | | continue; |
| | | } |
| | | var allFunction = customLinkageAnalysis.changeDoFunction(dofunction); |
| | |
| | | if (item.tag_Type == "htmlediter") { |
| | | UE.getEditor(fieldId + "Item").onclick = function (event, ui) { |
| | | // eval(strFunction); |
| | | // ////console.log(UE.getEditor(fieldId+"Item").getContent()); |
| | | // //// |
| | | customLinkageAnalysis.options[fieldId + "Item"] = UE.getEditor(fieldId + "Item").getContent(); |
| | | } |
| | | UE.getEditor(fieldId + "Item").onblur = function (event, ui) { |
| | | //////console.log(UE.getEditor(fieldId+"Item").getContent()); |
| | | ////// |
| | | var fieldIdItem = UE.getEditor(fieldId + "Item").getContent(); |
| | | if (fieldIdItem != customLinkageAnalysis.options[fieldId + "Item"]) { |
| | | eval(allFunction.strFunction); |
| | | } |
| | | |
| | | } |
| | | ////console.log(UE.getEditor(fieldId+"Item")); |
| | | //// |
| | | } else if (item.tag_Type == "tree") { |
| | | customBase.options.zTreeOnClickItems[fieldId + "tree"] = allFunction.strFunction; |
| | | } else if (item.tag_Type == "radio" || item.tag_Type == "checkbox") { |
| | |
| | | } |
| | | |
| | | } |
| | | _.each(rules[i].results, function (ru) {// 自定义验证 为弹出消息控件绑定验证方法 李伟民 2017-10-18 15:09 |
| | | _.each(rules[i].results, function (ru) {// 自定义验证 为弹出消息控件绑定验证方法 2017-10-18 15:09 |
| | | if ((ru.mode == "2" || ru.mode == "0") && rules[i].event.eventFieldId != ru.eventFieldId) {//判断是否为验证公式 判断触发控件与弹出消息控件是否为同一控件 |
| | | //console.log(ru); |
| | | // |
| | | customLinkageAnalysis.bindEvent(ru.eventFieldId, "blur", allFunction); |
| | | } |
| | | });// 自定义验证 为弹出消息控件绑定验证方法 李伟民 2017-10-18 15:09 end |
| | | });// 自定义验证 为弹出消息控件绑定验证方法 2017-10-18 15:09 end |
| | | } |
| | | } |
| | | |
| | |
| | | try { |
| | | dofuncion = customLinkageAnalysis.makeLinkage(rules[i]); |
| | | } catch (e) { |
| | | ////console.log(e.message); |
| | | //// |
| | | continue; |
| | | } |
| | | var fieldId = rules[i].event.eventFieldId; |
| | |
| | | if (inType == item.tag_Type) { |
| | | if (item.tag_Type == "radio") { |
| | | $("#" + fieldId + ' .custom-radio').on('click', function () { |
| | | // //////console.log(this.className); |
| | | // ////// |
| | | if (this.className.indexOf("readonly") > -1) { |
| | | return; |
| | | } |
| | |
| | | }); |
| | | } else if (item.tag_Type == "checkbox") { |
| | | $("#" + fieldId + ' .custom-check').on('click', function () { |
| | | // //////console.log(this.className); |
| | | // ////// |
| | | if (this.className.indexOf("readonly") > -1) { |
| | | return; |
| | | } |
| | |
| | | } |
| | | |
| | | customLinkageAnalysis.bindFunctionEvent = function (strFunction) { |
| | | //console.log(strFunction); |
| | | // |
| | | return function () { |
| | | try { |
| | | eval(strFunction); |
| | | } catch (e) { |
| | | ////console.log(e.message); |
| | | //// |
| | | } |
| | | } |
| | | } |
| | | |
| | | customLinkageAnalysis.changeDoFunction = function (doFunction) { |
| | | var conditionCode = doFunction.conditionCode; |
| | | //console.log(doFunction); |
| | | // |
| | | var code = ""; |
| | | var strFunction = ""; |
| | | var checkFunction = "";// 单独检查校验规则代码 李伟民 2017-10-19 14:33 |
| | | var checkFunction = "";// 单独检查校验规则代码 2017-10-19 14:33 |
| | | if (conditionCode != null) { |
| | | code = conditionCode.code |
| | | var conditionListCode = conditionCode.listCode; |
| | | |
| | | for (var i = 0; i < conditionListCode.length; i++) { |
| | | strFunction += "var code" + i + " = " + conditionListCode[i] + ";\r\n"; |
| | | checkFunction += "var code" + i + " = " + conditionListCode[i] + ";\r\n";// 单独检查校验规则代码 李伟民 2017-10-19 14:33 |
| | | checkFunction += "var code" + i + " = " + conditionListCode[i] + ";\r\n";// 单独检查校验规则代码 2017-10-19 14:33 |
| | | var reg = new RegExp('\\{' + i + '\\}', "g"); |
| | | code = code.replace(reg, "\"+customLinkageAnalysis.changeEvalType(eval('code" + i + "'))+\""); |
| | | } |
| | | for (var i = 0; i < conditionListCode.length; i++) { |
| | | var reg = new RegExp('\\{' + i + '\\}', "g"); |
| | | strFunction = strFunction.replace(reg, "code" + i); |
| | | checkFunction = strFunction.replace(reg, "code" + i);// 单独检查校验规则代码 李伟民 2017-10-19 14:33 |
| | | checkFunction = strFunction.replace(reg, "code" + i);// 单独检查校验规则代码 2017-10-19 14:33 |
| | | } |
| | | if (conditionCode.clearCode != undefined) {//添加清空错误信息 李伟民 2017-10-18 17:45 |
| | | if (conditionCode.clearCode != undefined) {//添加清空错误信息 2017-10-18 17:45 |
| | | _.each(conditionCode.clearCode, function (_clearCode) { |
| | | strFunction += _clearCode; |
| | | checkFunction += _clearCode;// 单独检查校验规则代码 李伟民 2017-10-19 14:33 |
| | | checkFunction += _clearCode;// 单独检查校验规则代码 2017-10-19 14:33 |
| | | }) |
| | | }//添加清空错误信息 李伟民 2017-10-18 17:45 end |
| | | }//添加清空错误信息 2017-10-18 17:45 end |
| | | if (code != null && code != "") { |
| | | if (code.indexOf('Math.floor') != -1) { |
| | | code = eval(code); |
| | | ////console.log(code); |
| | | //// |
| | | } |
| | | code = "customLinkageAnalysis.expeval(\"=" + code + "\")"; |
| | | strFunction += "if (" + code + " == 'true') { \r\n"; |
| | | checkFunction += "if (" + code + " == 'true') { \r\n";// 单独检查校验规则代码 李伟民 2017-10-19 14:33 |
| | | checkFunction += "if (" + code + " == 'true') { \r\n";// 单独检查校验规则代码 2017-10-19 14:33 |
| | | } |
| | | } |
| | | var results = doFunction.results; |
| | |
| | | for (var j = 0; j < listCode.length; j++) { |
| | | strFunction += "var resultCode" + j + " = " + listCode[j] + ";\r\n"; |
| | | var reg = new RegExp('\\{' + j + '\\}', "g"); |
| | | ////console.log(resultCode); |
| | | //// |
| | | resultCode = resultCode.replace(reg, "\"+customLinkageAnalysis.changeEvalType(eval('resultCode" + j + "'))+\""); |
| | | } |
| | | for (var j = 0; j < listCode.length; j++) { |
| | |
| | | strFunction = strFunction.replace(reg, "resultCode" + j); |
| | | } |
| | | // if(resultCode.indexOf('Math.floor') != -1){ |
| | | ////console.log(resultCode); |
| | | //// |
| | | // resultCode = eval(resultCode); |
| | | // } |
| | | //console.log(resultCode); |
| | | // |
| | | resultCode = "customLinkageAnalysis.expeval(\"=" + resultCode + "\")"; |
| | | strFunction += resultJsText.replace(/\{0\}/g, resultCode); |
| | | } else if (results[i].resultJsText.indexOf("setMessage")) {// 判断是否为 规则校验公式 |
| | | strFunction += resultJsText + "; \r\n"; |
| | | checkFunction += resultJsText + "; \r\n";// 单独检查校验规则代码 李伟民 2017-10-19 14:33 |
| | | checkFunction += resultJsText + "; \r\n";// 单独检查校验规则代码 2017-10-19 14:33 |
| | | } else { |
| | | strFunction += resultJsText + "; \r\n"; |
| | | } |
| | |
| | | |
| | | if (code != null && code != "") { |
| | | strFunction += "}"; |
| | | checkFunction += "}";// 单独检查校验规则代码 李伟民 2017-10-19 14:33 |
| | | checkFunction += "}";// 单独检查校验规则代码 2017-10-19 14:33 |
| | | } |
| | | ////console.log(strFunction); |
| | | //// |
| | | var allFunction = { "strFunction": strFunction, "checkFunction": checkFunction }; |
| | | return allFunction; |
| | | } |
| | |
| | | var flag = true; |
| | | if (optarr != undefined && optarr != '') { |
| | | optarr = JSON.parse(optarr); |
| | | console.log(optarr); |
| | | console.log(allFunction); |
| | | |
| | | |
| | | _.each(optarr, function (fn) { |
| | | if (fn.strFunction == allFunction.strFunction && fn.checkFunction == allFunction.checkFunction) { |
| | | console.log("falg false"); |
| | | |
| | | flag = false; |
| | | } |
| | | }) |
| | |
| | | } |
| | | |
| | | customLinkageAnalysis.bindEvent = function (fieldId, doEvent, allFunction) {//aaaaaa |
| | | console.log(allFunction); |
| | | |
| | | var evalstr = ""; |
| | | var evalchekstr = ""; |
| | | ////console.log(customShow.options.customItemShow.item[fieldId].tag_Type); |
| | | //// |
| | | if (customShow.options.customItemShow.item[fieldId].tag_Type == "dropdownlist") { |
| | | ////console.log($("[id='" + fieldId+"']")); |
| | | ////console.log($("[id='" + fieldId+"']").find(".select_get")); |
| | | ////console.log($(".select_get")); |
| | | ////console.log(strFunction); |
| | | //// |
| | | //// |
| | | //// |
| | | //// |
| | | _.each($("[id='" + fieldId + "']").find(".select_get"),function(opt){ |
| | | var optarr = $(opt).attr("funarr"); |
| | | if(funCheck(optarr,allFunction)){ |
| | |
| | | if (customShow.options.customItemShow.item[fieldId].parentsubFormNum != 0) { |
| | | // _.each($("[id='" + fieldId + "']").find(".select_get"), (item, i) => { |
| | | if (allFunction.strFunction.indexOf("var i=") == -1) { |
| | | ////console.log(i); |
| | | //// |
| | | evalstr = "var i=" + $("[id='" + fieldId + "']").find(".select_get").index(this) + ";" + allFunction.strFunction; |
| | | } |
| | | // }) |
| | |
| | | evalstr = allFunction.strFunction; |
| | | } |
| | | try { |
| | | console.log(evalstr); |
| | | |
| | | eval(evalstr); |
| | | } catch (e) { |
| | | ////console.log(e.message); |
| | | //// |
| | | } |
| | | }); |
| | | var funarr; |
| | |
| | | } |
| | | var checkarr = $(opt).attr("checkfunarr"); |
| | | if(funCheck(checkarr,allFunction)){ |
| | | $(opt).on(doEvent + ".check", function () {//单独检验校验规则绑定 李伟民 2017-10-19 15:18 |
| | | $(opt).on(doEvent + ".check", function () {//单独检验校验规则绑定 2017-10-19 15:18 |
| | | if (customShow.options.customItemShow.item[fieldId].parentsubFormNum != 0) { |
| | | // _.each($("[id='" + fieldId + "']").find(".select_get"), (item, i) => { |
| | | if (allFunction.checkFunction.indexOf("var i=") == -1) { |
| | |
| | | try { |
| | | eval(evalchekstr); |
| | | } catch (e) { |
| | | //console.log(e.message); |
| | | // |
| | | } |
| | | });//单独检验校验规则绑定 李伟民 2017-10-19 15:18 end |
| | | });//单独检验校验规则绑定 2017-10-19 15:18 end |
| | | var checkfunarr; |
| | | if($(opt).attr("checkfunarr") == undefined || $(opt).attr("checkfunarr") == ""){ |
| | | checkfunarr = [allFunction]; |
| | |
| | | // if (customShow.options.customItemShow.item[fieldId].parentsubFormNum != 0) { |
| | | // // _.each($("[id='" + fieldId + "']").find(".select_get"), (item, i) => { |
| | | // if (allFunction.strFunction.indexOf("var i=") == -1) { |
| | | // ////console.log(i); |
| | | // //// |
| | | // evalstr = "var i=" + $("[id='" + fieldId + "']").find(".select_get").index(this) + ";" + allFunction.strFunction; |
| | | // } |
| | | // // }) |
| | |
| | | // evalstr = allFunction.strFunction; |
| | | // } |
| | | // try { |
| | | // console.log(evalstr); |
| | | // |
| | | // eval(evalstr); |
| | | // } catch (e) { |
| | | // ////console.log(e.message); |
| | | // //// |
| | | // } |
| | | // }); |
| | | // $("[id='" + fieldId + "']").find(".select_get").unbind(doEvent + ".check"); |
| | | // $("[id='" + fieldId + "']").find(".select_get").on(doEvent + ".check", function () {//单独检验校验规则绑定 李伟民 2017-10-19 15:18 |
| | | // $("[id='" + fieldId + "']").find(".select_get").on(doEvent + ".check", function () {//单独检验校验规则绑定 2017-10-19 15:18 |
| | | // if (customShow.options.customItemShow.item[fieldId].parentsubFormNum != 0) { |
| | | // // _.each($("[id='" + fieldId + "']").find(".select_get"), (item, i) => { |
| | | // if (allFunction.checkFunction.indexOf("var i=") == -1) { |
| | |
| | | // try { |
| | | // eval(evalchekstr); |
| | | // } catch (e) { |
| | | // //console.log(e.message); |
| | | // // |
| | | // } |
| | | // });//单独检验校验规则绑定 李伟民 2017-10-19 15:18 end |
| | | // });//单独检验校验规则绑定 2017-10-19 15:18 end |
| | | } else { |
| | | // $("[id='" + fieldId + "']").unbind(doEvent + ".value"); |
| | | _.each($("[id='" + fieldId + "']"),function(opt){ |
| | |
| | | if(funCheck(optarr,allFunction)){ |
| | | $(opt).on(doEvent + ".value", function () { |
| | | if (customShow.options.customItemShow.item[fieldId].parentsubFormNum != 0 && allFunction.strFunction.indexOf("getSum") == -1) { |
| | | console.log($("[id='" + fieldId + "']")); |
| | | console.log($(this)); |
| | | console.log($("[id='" + fieldId + "']").index(this)); |
| | | |
| | | |
| | | |
| | | // _.each($("[id='" + fieldId + "']"), (item, i) => { |
| | | // console.log($(item)); |
| | | // |
| | | if (allFunction.strFunction.indexOf("var i=") == -1) { |
| | | ////console.log(i); |
| | | //// |
| | | evalstr = "var i=" + $("[id='" + fieldId + "']").index(this) + ";" + allFunction.strFunction; |
| | | } |
| | | // }) |
| | | }else if(allFunction.strFunction.indexOf("getSum") > 0){ |
| | | console.log(allFunction.strFunction); |
| | | console.log("replace"); |
| | | |
| | | |
| | | evalstr = allFunction.strFunction; |
| | | // allFunction.strFunction = allFunction.strFunction.replace(new RegExp(".split(',')[i]") ,""); |
| | | while(evalstr.indexOf(".split(',')[i]") != -1){ |
| | |
| | | evalstr = allFunction.strFunction; |
| | | } |
| | | // try { |
| | | console.log(evalstr); |
| | | |
| | | eval(evalstr); |
| | | // } catch (e) { |
| | | // ////console.log(e.message); |
| | | // //// |
| | | // } |
| | | }); |
| | | var funarr; |
| | |
| | | }; |
| | | var checkarr = $(opt).attr("checkfunarr"); |
| | | if(funCheck(checkarr,allFunction)){ |
| | | $(opt).on("blur.check", function () {//单独检验校验规则绑定 李伟民 2017-10-19 15:18 |
| | | $(opt).on("blur.check", function () {//单独检验校验规则绑定 2017-10-19 15:18 |
| | | if (customShow.options.customItemShow.item[fieldId].parentsubFormNum != 0) { |
| | | console.log("change.check"); |
| | | |
| | | _.each($("[id='" + fieldId + "']"), (item, i) => { |
| | | if (allFunction.checkFunction.indexOf("var i=") == -1) { |
| | | ////console.log(i); |
| | | //// |
| | | evalchekstr = "var i=" + $("[id='" + fieldId + "']").index(this) + ";" + allFunction.checkFunction; |
| | | } |
| | | }) |
| | |
| | | eval(evalchekstr); |
| | | } |
| | | } catch (e) { |
| | | ////console.log(e.message); |
| | | //// |
| | | } |
| | | });//单独检验校验规则绑定 李伟民 2017-10-19 15:18 end |
| | | });//单独检验校验规则绑定 2017-10-19 15:18 end |
| | | var checkfunarr; |
| | | if($(opt).attr("checkfunarr") == undefined || $(opt).attr("checkfunarr") == ""){ |
| | | checkfunarr = [allFunction]; |
| | |
| | | |
| | | }); |
| | | // $("[id='" + fieldId + "']").unbind(doEvent + ".check"); |
| | | // $("[id='" + fieldId + "']").on(doEvent + ".check", function () {//单独检验校验规则绑定 李伟民 2017-10-19 15:18 |
| | | // $("[id='" + fieldId + "']").on(doEvent + ".check", function () {//单独检验校验规则绑定 2017-10-19 15:18 |
| | | // if (customShow.options.customItemShow.item[fieldId].parentsubFormNum != 0) { |
| | | // console.log("change.check"); |
| | | // |
| | | // _.each($("[id='" + fieldId + "']"), (item, i) => { |
| | | // if (allFunction.checkFunction.indexOf("var i=") == -1) { |
| | | // ////console.log(i); |
| | | // //// |
| | | // evalchekstr = "var i=" + $("[id='" + fieldId + "']").index(this) + ";" + allFunction.checkFunction; |
| | | // } |
| | | // }) |
| | |
| | | // try { |
| | | // eval(evalchekstr); |
| | | // } catch (e) { |
| | | // ////console.log(e.message); |
| | | // //// |
| | | // } |
| | | // });//单独检验校验规则绑定 李伟民 2017-10-19 15:18 end |
| | | // });//单独检验校验规则绑定 2017-10-19 15:18 end |
| | | } |
| | | } |
| | | |
| | | customLinkageAnalysis.changeEvalType = function (str) { |
| | | console.log(str); |
| | | if (isNaN(Number(str)) && (str.substring(0, 1) != "\"" || str.substring(str.length - 1, 1) != "\"") && (str.indexOf('||') != -1) && (str.indexOf('&&') != -1)) {//|| && 修改 李伟民 公式不稳定修改 0202 |
| | | |
| | | if (isNaN(Number(str)) && (str.substring(0, 1) != "\"" || str.substring(str.length - 1, 1) != "\"") && (str.indexOf('||') != -1) && (str.indexOf('&&') != -1)) {//|| && 修改 公式不稳定修改 0202 |
| | | return "'" + str + "'"; |
| | | } else { |
| | | ////console.log(str); |
| | | //// |
| | | return str; |
| | | } |
| | | } |
| | |
| | | if (item.type == "button" || item.type == "link") { |
| | | } else if (item.type == "dropdownlist") { |
| | | var datasourcetype = $("#" + item.id)[0].getAttribute("datasourcetype"); |
| | | //////////console.log(datasourcetype); |
| | | ////////// |
| | | //主数据源 |
| | | if (datasourcetype == "masterdata") { |
| | | itemTempS = customBase.getItemValue(item.id, item.type); |
| | |
| | | itemTempS = customBase.getItemValue(item.id, item.type); |
| | | } |
| | | item.value = itemTempS; |
| | | ////////console.log(item); |
| | | //////// |
| | | return item; |
| | | } |
| | | } |
| | |
| | | var defindCode = masterData.defindCode; |
| | | var eleCode = masterData.eleCode; |
| | | var eleValue = customLinkageAnalysis.getValue(itemId); |
| | | if(num != undefined && eleValue != undefined && eleValue.indexOf(',') != -1){//子表单中控件处理 李伟民 0106 |
| | | if(num != undefined && eleValue != undefined && eleValue.indexOf(',') != -1){//子表单中控件处理 0106 |
| | | eleValue = eleValue.split(',')[num]; |
| | | } |
| | | var opt = { |
| | |
| | | } |
| | | //主数据取得 |
| | | var result = customDataBound.getElement1(opt); |
| | | console.log(result); |
| | | console.log(itemId) |
| | | |
| | | |
| | | if (result.rspCode == "000000") { |
| | | if (result.data[itemId].length > 0) { |
| | | console.log(result.data[itemId][0].value) |
| | | |
| | | return result.data[itemId][0].value; |
| | | } else { |
| | | return ""; |
| | |
| | | } |
| | | } |
| | | |
| | | customLinkageAnalysis.clearMessage = function (itemId, num) {//清空错误信息方法 李伟民 2017-10-18 16:36 |
| | | customLinkageAnalysis.clearMessage = function (itemId, num) {//清空错误信息方法 2017-10-18 16:36 |
| | | if (num == undefined) { |
| | | num = 0; |
| | | } |
| | | //console.log($("[id='"+itemId+"']:eq("+num+")")); |
| | | //console.log($("[id='"+itemId+"ActiveId']:eq("+num+")")); |
| | | // |
| | | // |
| | | $("[id='" + itemId + "']:eq(" + num + ")").removeClass("errorItemCss"); |
| | | $("[id='" + itemId + "']:eq(" + num + ")").removeClass("errorCheckCss"); |
| | | $("[id='" + itemId + "ActiveId']:eq(" + num + ")").find("#" + itemId + "mesageErrDiv").remove(); |
| | | }//清空错误信息方法 李伟民 2017-10-18 16:36 end |
| | | }//清空错误信息方法 2017-10-18 16:36 end |
| | | |
| | | customLinkageAnalysis.makeLinkage = function (rule) { |
| | | ////console.log(rule); |
| | | //// |
| | | var result = {}; |
| | | var conditionCode = {}; |
| | | conditionCode = customLinkageAnalysis.changeCodeMirror(rule.conditionCode, rule.conditionHistory._history); |
| | | |
| | | if (rule.conditionCode != "" && !_.isNull(rule.conditionCode)) {//清空错误信息 李伟民 2017-10-18 16:36 |
| | | if (rule.conditionCode != "" && !_.isNull(rule.conditionCode)) {//清空错误信息 2017-10-18 16:36 |
| | | var clearCode = []; |
| | | _.each(rule.results, function (ru) { |
| | | if (ru.mode == "2") { |
| | |
| | | } |
| | | }); |
| | | conditionCode["clearCode"] = clearCode; |
| | | }//清空错误信息 李伟民 2017-10-18 16:36 end |
| | | }//清空错误信息 2017-10-18 16:36 end |
| | | |
| | | var results = new Array(); |
| | | for (var i = 0; i < rule.results.length; i++) { |
| | |
| | | // todo |
| | | } |
| | | } else if ("2" == rule.results[i].mode || "0" == rule.results[i].mode) { |
| | | if (resultTargrtItem.parentsubFormNum != 0) {//自定义校验支持子表单中控件 李伟民 2017-10-18 14:34 |
| | | if (resultTargrtItem.parentsubFormNum != 0) {//自定义校验支持子表单中控件 2017-10-18 14:34 |
| | | // resultJsText += "customLinkageAnalysis.clearMessage('" + rule.results[i].eventFieldId + "',i);"; |
| | | resultJsText += "customLinkageAnalysis.setMessage('" + rule.results[i].mode + "','" + rule.results[i].eventFieldId + "','" + rule.results[i].message + "',i);"; |
| | | } else { |
| | | // resultJsText += "customLinkageAnalysis.clearMessage('" + rule.results[i].eventFieldId + "');"; |
| | | resultJsText += "customLinkageAnalysis.setMessage('" + rule.results[i].mode + "','" + rule.results[i].eventFieldId + "','" + rule.results[i].message + "');"; |
| | | }//自定义校验支持子表单中控件 李伟民 2017-10-18 14:34 end |
| | | }//自定义校验支持子表单中控件 2017-10-18 14:34 end |
| | | |
| | | } else if ("3" == rule.results[i].mode) { |
| | | resultJsText += "customLinkageAnalysis.alert('" + rule.results[i].messageType + "','" + rule.results[i].message + "');"; |
| | |
| | | resultJs.resultJsText = resultJsText; |
| | | resultJs.targetid = rule.results[i].eventFieldId;// 公式联动追加 目标控件 |
| | | var targetDoEvent = ''; |
| | | // ////console.log(customShow.options.jsonLinkage); |
| | | var jsonLinkage_add = customShow.options.jsonLinkage;//预览公式联动修改 李伟民 0117 |
| | | // //// |
| | | var jsonLinkage_add = customShow.options.jsonLinkage;//预览公式联动修改 0117 |
| | | if (_.isString(jsonLinkage_add)) { |
| | | jsonLinkage_add = JSON.parse(jsonLinkage_add); |
| | | } |
| | |
| | | } |
| | | result.conditionCode = conditionCode; |
| | | result.results = results; |
| | | ////console.log(result); |
| | | //// |
| | | return result; |
| | | } |
| | | |
| | |
| | | if (code.trim() == "") { |
| | | return null; |
| | | } |
| | | //console.log(code); |
| | | //console.log(history); |
| | | // |
| | | // |
| | | var result = {}; |
| | | var conditionCode = ""; |
| | | var listCode = new Array(); |
| | | var arrConditionCode = code.split('\r\n'); |
| | | ////console.log(arrConditionCode); |
| | | //// |
| | | var resultIndex = 0; |
| | | |
| | | if (history != null && history.length > 0) { |
| | |
| | | replaceText = "customLinkageAnalysis.getValue('" + id + "').split(',')[i]"; |
| | | } else { |
| | | replaceText = "customLinkageAnalysis.getValue('" + id + "')"; |
| | | } // ////console.log(replaceText); |
| | | } // //// |
| | | } else if (textType == 'visible' || textType == 'editable') { |
| | | replaceText = "customLinkageAnalysis.getAttribut('" + id + "','" + textType + "')"; |
| | | } else { |
| | | if (idItem.parentsubFormNum != 0) {//主数据关联也需区分子表单中控件 李伟民 0106 |
| | | if (idItem.parentsubFormNum != 0) {//主数据关联也需区分子表单中控件 0106 |
| | | replaceText = "customLinkageAnalysis.getElement('" + id + "','" + textType + "',i)"; |
| | | } else { |
| | | replaceText = "customLinkageAnalysis.getElement('" + id + "','" + textType + "')"; |
| | |
| | | conditionCode = conditionCode.replace(/###\)###/g, ")"); |
| | | result.code = conditionCode; |
| | | result.listCode = listCode; |
| | | //console.log(result); |
| | | // |
| | | return result; |
| | | } |
| | | |
| | |
| | | sign = "Sum"; |
| | | } else if (sign.indexOf('COUNT') >= 0) { |
| | | sign = "Count"; |
| | | } else if (sign.indexOf('||') >= 0) {//|| &&修改 李伟民 0202 公式不稳定修改 |
| | | } else if (sign.indexOf('||') >= 0) {//|| &&修改 0202 公式不稳定修改 |
| | | return sign + eval("[" + inner + "]").toString(); |
| | | } else { |
| | | return ""; |
| | |
| | | } |
| | | |
| | | customLinkageAnalysis.expeval = function (str) { |
| | | // console.log(str); |
| | | // |
| | | if (str.trim().replace(/=/, "") == "") { |
| | | console.log("str err"); |
| | | |
| | | return " "; |
| | | } |
| | | console.log("str scc"); |
| | | |
| | | var exp = igame.Expression; |
| | | // console.log(exp); |
| | | // console.log(str); |
| | | // console.log(new exp.Formula(str)); |
| | | // console.log(new exp.Formula(str).evaluate()); |
| | | // console.log(new exp.Formula(str).evaluate().toString()); |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | return new exp.Formula(str).evaluate().toString(); |
| | | } |
| | | |
| | | customLinkageAnalysis.changeSign = function (conditionCode, listCode, resultIndex) { |
| | | ////console.log(conditionCode); |
| | | //// |
| | | var index = 0; |
| | | var indexOf = -1; |
| | | var result = {}; |
| | |
| | | || (indexOf = conditionCode.substring(index).indexOf('parseInt')) >= 0 |
| | | || (indexOf = conditionCode.substring(index).indexOf('addtest')) >= 0 |
| | | || (indexOf = conditionCode.substring(index).indexOf('getDay')) >= 0 |
| | | || (indexOf = conditionCode.substring(index).indexOf('getSum')) >= 0) {//时间函数 李伟民 2017-10-17 21:49 修改公式 |
| | | || (indexOf = conditionCode.substring(index).indexOf('getSum')) >= 0) {//时间函数 2017-10-17 21:49 修改公式 |
| | | var before = conditionCode.substring(0, indexOf); |
| | | var beforeInner = 0; |
| | | var afterIndexOf = 0; |
| | |
| | | if ((indexOf = conditionCode.substring(index).indexOf('parseInt')) >= 0 |
| | | || (indexOf = conditionCode.substring(index).indexOf('addtest')) >= 0 |
| | | || (indexOf = conditionCode.substring(index).indexOf('getDay')) >= 0 |
| | | || (indexOf = conditionCode.substring(index).indexOf('getSum')) >= 0) {//时间函数 李伟民 2017-10-17 21:49 修改公式 |
| | | || (indexOf = conditionCode.substring(index).indexOf('getSum')) >= 0) {//时间函数 2017-10-17 21:49 修改公式 |
| | | listCode.push(sign + "(" + inner + ")"); |
| | | } else { |
| | | listCode.push("customLinkageAnalysis.changeCodeSign('" + sign + "',\[" + inner + "\])"); |
| | |
| | | } |
| | | result.conditionCode = conditionCode; |
| | | result.resultIndex = resultIndex; |
| | | ////console.log(result); |
| | | //// |
| | | return result; |
| | | } |
| | | addtest = function (arg1, arg2) { |
| | | return arg1 + arg2; |
| | | } |
| | | |
| | | getDay = function (arg1, arg2) {//时间函数 李伟民 2017-10-17 21:49 |
| | | getDay = function (arg1, arg2) {//时间函数 2017-10-17 21:49 |
| | | var date1 = new Date(arg1) |
| | | var date2 = new Date(arg2) |
| | | var s1 = date1.getTime(), s2 = date2.getTime(); |
| | | var total = (s1 - s2) / 1000; |
| | | var day = parseInt(total / (24 * 60 * 60));//计算整数天数 |
| | | //console.log(day); |
| | | // |
| | | return day; |
| | | }//时间函数 李伟民 2017-10-17 21:49 end |
| | | }//时间函数 2017-10-17 21:49 end |
| | | |
| | | getSum = function () { |
| | | console.log(arguments); |
| | | |
| | | var allItem = []; |
| | | _.each(arguments, function (arg) { |
| | | allItem.push(arg.split(",")); |
| | | }); |
| | | console.log(allItem); |
| | | |
| | | var sum = 0; |
| | | _.each(allItem, function (item) { |
| | | _.each(item, function (cd) { |
| | |
| | | |
| | | //表单保存 |
| | | customDataBound.savaFormbase = function (formbase, callback) { |
| | | ////////////console.log(formbase); |
| | | //////////// |
| | | var dataObj = {}; |
| | | dataObj = formbase; |
| | | console.log(formbase); |
| | | |
| | | var requestRight = window.commonAjax("/formbase/saveformService", dataObj, "POST", true); |
| | | requestRight.done(function (rs) { |
| | | |
| | |
| | | |
| | | //表单数据保存 |
| | | customDataBound.fromSave = function (formid, formbase, callback) { |
| | | // if(window.localStorage.getItem("bussinessSystem")){ |
| | | // var flag = window.localStorage.getItem("bussinessSystem"); |
| | | // if(window.getEnclocal("bussinessSystem")){ |
| | | // var flag = window.getEnclocal("bussinessSystem"); |
| | | // } |
| | | var dataObj = {}; |
| | | dataObj.formID = formid; |
| | |
| | | // dataObj.tenantID = "001"; |
| | | // dataObj.flag = flag; |
| | | //dataObj.flag = "cloud" |
| | | //console.log(dataObj); |
| | | if (customShow.exCouldNumber != undefined && customShow.exCouldNumber != '') {//保存时 传云单标号 李伟民 12-22 |
| | | // |
| | | if (customShow.exCouldNumber != undefined && customShow.exCouldNumber != '') {//保存时 传云单标号 12-22 |
| | | _.extend(dataObj, { 'orderCode': customShow.exCouldNumber }); |
| | | }//保存时 传云单标号 李伟民 12-22 |
| | | }//保存时 传云单标号 12-22 |
| | | //_.extend(dataObj,{'orderCode': '1012000170900005'});//临时修改 |
| | | var requestRight = window.commonAjax("/datamanagement/addFormDataService", dataObj, "POST", true); |
| | | requestRight.done(function (rs) { |
| | | callback(rs); |
| | | if(rs.data==null){ |
| | | customBase.alert("E","表单未启用"); |
| | | }else{ |
| | | callback(rs); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //表单数据编辑 |
| | | customDataBound.fromEdit = function (formid, formbase, dataRowNum, callback) { |
| | | var dataObj = {}; |
| | | // if(window.localStorage.getItem("bussinessSystem")){ |
| | | // var flag = window.localStorage.getItem("bussinessSystem"); |
| | | // if(window.getEnclocal("bussinessSystem")){ |
| | | // var flag = window.getEnclocal("bussinessSystem"); |
| | | // } |
| | | // dataObj.flag = flag; |
| | | dataObj.formID = formid; |
| | | dataObj.dataRowNum = dataRowNum; |
| | | dataObj.data = formbase; |
| | | if (customShow.exCouldNumber != undefined && customShow.exCouldNumber != '') {//保存时 传云单标号 李伟民 12-22 |
| | | if (customShow.exCouldNumber != undefined && customShow.exCouldNumber != '') {//保存时 传云单标号 12-22 |
| | | _.extend(dataObj, { 'orderCode': customShow.exCouldNumber }); |
| | | }//保存时 传云单标号 李伟民 12-22 |
| | | }//保存时 传云单标号 12-22 |
| | | //_.extend(dataObj,{'orderCode': '1012000170900005'});//临时修改 |
| | | var requestRight = window.commonAjax("/datamanagement/updateFormDataService", dataObj, "POST", true); |
| | | requestRight.done(function (rs) { |
| | |
| | | dataObj.code = JSON.stringify(code); |
| | | } |
| | | dataObj.callbackId = callbackId; |
| | | //console.log(dataObj); |
| | | let customlocalStorage = window.localStorage.getItem("bussinessSystem"); |
| | | // |
| | | let customlocalStorage = window.getEnclocal("bussinessSystem"); |
| | | var reg = new RegExp('"', "g"); // service 修改 李元杰 11-16 |
| | | customlocalStorage = customlocalStorage.replace(reg, ""); // service 修改 李元杰 11-16 |
| | | console.log(customlocalStorage); |
| | | |
| | | dataObj.flag = customlocalStorage; |
| | | var requestRight = window.commonAjax("/te-csc-api/search/base/elementprivate", dataObj, "POST", true); |
| | | |
| | | requestRight.done(function (rs) { |
| | | console.log(rs) |
| | | |
| | | if (rs.rspCode == "000000") { |
| | | console.log(rs) |
| | | |
| | | callback(rs); |
| | | customShow.addTitle(); |
| | | SC.money_cur(); |
| | | // 12/13 |
| | | |
| | | console.log(window.localStorage.getItem('customShowFlag')) |
| | | if (window.localStorage.getItem('customShowFlag') == 1) { |
| | | |
| | | if (window.getEnclocal('customShowFlag') == 1) { |
| | | // customShow.businessTypeAutoFun( 'businessTypeAuto','budget_itemCostType'); |
| | | SC.autoFieldKey(); |
| | | } |
| | | } else { |
| | | callback(rs); |
| | | console.log(rs) |
| | | |
| | | toastr.error(rs.rspDesc.responseJSON); |
| | | } |
| | | }); |
| | | requestRight.error(function (rs) { |
| | | // console.log(rs) |
| | | // |
| | | // toastr.error(rs.responseJSON.rspDesc); |
| | | |
| | | }) |
| | |
| | | // 参数: formID,tenantID |
| | | // JSON: {"rspCode":"000000","rspDesc":"请求成功","data":[{"单选按钮组测试":{"datasource":"","textcolumn":"","valuecolumn":""}}]} |
| | | customDataBound.getApiDatasource = function (url, callbackId, callback) { |
| | | // console.log(1); |
| | | // |
| | | var urls = url; |
| | | var url = url + "&callbackId={callbackId}"; |
| | | |
| | |
| | | // debugger |
| | | // xhr.onreadystatechange = function () { |
| | | // var res = JSON.parse(xhr.responseText); |
| | | // console.log(res); |
| | | // |
| | | // } |
| | | $.ajax({ |
| | | type: "get", |
| | | url: urls, |
| | | async: true, |
| | | success: function (rs) { |
| | | console.log(url); |
| | | console.log(rs); |
| | | |
| | | |
| | | callback(rs, url); |
| | | } |
| | | }); |
| | | // // var url = url + "&callbackId={callbackId}"; |
| | | // // url = url.replace("{callbackId}", callbackId); |
| | | // // //////////console.log(url); |
| | | // // ////////// |
| | | // // window.commonGetApiJson(url, callback); |
| | | // //////////console.log(url); |
| | | // ////////// |
| | | // //window.commonGetApiJson(url,callback); |
| | | } |
| | | |
| | | customDataBound.bindInterface = function (formid) {//绑定接口注册方法//保存前计算费用 李伟民 10 - 31 |
| | | customDataBound.bindInterface = function (formid) {//绑定接口注册方法//保存前计算费用 10 - 31 |
| | | var dataObj = {}; |
| | | dataObj.formID = formid; |
| | | var accessToken = JSON.parse(localStorage.getItem("token")).accessToken; |
| | | var accessToken = getEnclocal("token").accessToken; |
| | | dataObj.access_token = accessToken; |
| | | var requestRight = window.commonAjax("/forminterface/getFormInterfaceListService", dataObj, "GET", true, false); |
| | | requestRight.done(function (rs) { |
| | | //console.log(rs); |
| | | // |
| | | customBase.interfaceData = rs.data; |
| | | |
| | | }) |
| | | }//保存前计算费用 李伟民 10 - 31 |
| | | }//保存前计算费用 10 - 31 |
| | | |
| | | customDataBound.formsetting = function (formid, callback) { |
| | | // 工具栏自定义10/18 |
| | | $('.edit_form').html(""); |
| | | var type = ""; |
| | | var flag = window.localStorage.getItem("customShowFlag"); |
| | | var flag = window.getEnclocal("customShowFlag"); |
| | | switch (flag) { |
| | | case "1": type = "TJ"; break; |
| | | case "3": type = "XG"; break; |
| | |
| | | case "4": type = "LB"; break; |
| | | } |
| | | |
| | | //console.log(type); |
| | | // |
| | | var dataObj = {}; |
| | | if(formid == undefined){ |
| | | formid = getEnclocal("newFormID"); |
| | | } |
| | | dataObj.formID = formid; |
| | | dataObj.type = type; |
| | | console.log(dataObj) |
| | | |
| | | var dataObjFlag = _.cloneDeep(dataObj); |
| | | delete dataObjFlag.type |
| | | var request = window.commonAjax("/formbase/getFormInfoService", dataObjFlag, "GET", true); |
| | | request.done(function (rs) { |
| | | if (rs.data != null) { |
| | | window.localStorage.setItem('bussinessSystem', rs.data.bussinesssystem) |
| | | window.setDeclocal('bussinessSystem', rs.data.bussinesssystem) |
| | | } |
| | | }) |
| | | |
| | |
| | | var requestRight = window.commonAjax("/formsetting/getFormsettingInfoService", dataObj, "POST", true); |
| | | requestRight.done(function (rs) { |
| | | customDataBound.bindInterface(formid); |
| | | // ////console.log(rs); |
| | | //console.log(type); |
| | | // //// |
| | | // |
| | | if (rs.data.saveable == "0") { |
| | | $(".sure_box").hide(); |
| | | } |
| | |
| | | if (rs.data.subCustomButton) { |
| | | // var dd=document.createElement('span'); |
| | | var formdata = []; |
| | | //console.log("查询类型"); |
| | | //console.log(type); |
| | | // |
| | | // |
| | | switch (type) { |
| | | case "TJ": formdata = rs.data.subCustomButton.addCustomButton; break; |
| | | case "XG": formdata = rs.data.subCustomButton.updateCustomButton; break; |
| | | case "XX": formdata = rs.data.subCustomButton.detailedCustomButton; break; |
| | | case "LB": formdata = rs.data.subCustomButton.listCustomButton; break; |
| | | } |
| | | //console.log("渲染结果"); |
| | | // |
| | | var srcd = document.createElement('script'); |
| | | // var tabledata=rs.data.customButtons; |
| | | srcd.type = "text/javascript"; |
| | |
| | | |
| | | $(".edit_form").append(dd); |
| | | |
| | | //console.log(obt.buttonName); |
| | | // |
| | | if (obt.buttonName == "驳回") { |
| | | //console.log("等于撤回"); |
| | | // |
| | | // 定义审批流程定义的方法 |
| | | // 撤销流程实例 |
| | | |
| | | $("#" + dd.id).click(function () { |
| | | var process = localStorage.getItem("processid"); |
| | | var process = getEnclocal("processid"); |
| | | |
| | | //console.log(process); |
| | | var dd = JSON.parse(process); |
| | | var tent = JSON.parse(localStorage.getItem("tenantID")).tenantID; |
| | | // |
| | | var dd = process; |
| | | var tent = getEnclocal("tenantID").tenantID; |
| | | |
| | | //console.log(dd.data); |
| | | // |
| | | window.queryAjaxs("ubp-api-seache/process/inst/log", { "processInstId": dd.data.processInstId }, "POST", true).done(function (res) { |
| | | //console.log("打印回执"); |
| | | //console.log(res); |
| | | // |
| | | // |
| | | if (res != undefined) { |
| | | //console.log("发送请求"); |
| | | // |
| | | window.queryAjaxs("ubp-api-control/process/inst/drawBack", { "processInstId": res.data[0].processInstId, "activityInstId": res.data[0].activityInstId }, "POST", true).done(function (res) { |
| | | //console.log("打印回执"); |
| | | //console.log(res); |
| | | // |
| | | // |
| | | if (res.data == 1) { |
| | | //console.log("撤销成功"); |
| | | // |
| | | customBase.alert('S',"撤销成功"); |
| | | // localStorage.removeItem('userinfo') |
| | | } |
| | |
| | | $("#" + dd.id)[0].setAttribute('data-toggle', "modal"); |
| | | $("#" + dd.id)[0].setAttribute('data-target', ".bs-example-modal-sm"); |
| | | $("#" + dd.id).click(function () { |
| | | var processLog = JSON.parse(localStorage.getItem("processLog")); |
| | | var processLog =getEnclocal("processLog"); |
| | | if (processLog != null && processLog != undefined) { |
| | | } else { |
| | | $("#liucheng").html("<h3 class='sp_title'>请先创建一个流程<h3>"); |
| | |
| | | $("#" + dd.id)[0].setAttribute('data-toggle', "modal"); |
| | | $("#" + dd.id)[0].setAttribute('data-target', ".bs-example-modal-sm"); |
| | | $("#" + dd.id).click(function () { |
| | | var processLog = JSON.parse(localStorage.getItem("processLog")); |
| | | var processLog = getEnclocal("processLog"); |
| | | if (processLog[0].processState == 60) { |
| | | customBase.alert('E',"流程已结束"); |
| | | return null; |
| | | } else { |
| | | if (processLog != "null" && processLog != undefined) { |
| | | console.log(processLog.length); |
| | | |
| | | if (processLog.length == 1) { |
| | | customBase.alert('W',"无可退回活动"); |
| | | return null; |
| | |
| | | } |
| | | var requestSingleForm = window.commonAjax("/ubp-api-seache/process/get/back", ss, "POST", true); |
| | | requestSingleForm.done(function (rs) { |
| | | console.log(rs); |
| | | |
| | | var res = rs.data; |
| | | if (res != undefined & res != null) { |
| | | |
| | |
| | | } |
| | | inputs += "<div class='footerbtn' style='display:flex;justify-content:space-around;'><input class='btn btn-default choosebtn' type='button' value='取消' onclick='tui(false)'/><input type='button' class='btn btn-default choosebtn2' value='确定' onclick='tui(true," + activeitem + ")'/>"; |
| | | inputs += "</div>"; |
| | | console.log(inputs); |
| | | |
| | | $("#liucheng").html(inputs); |
| | | |
| | | |
| | |
| | | } else if (obt.buttonName == "审批") { |
| | | $("#" + dd.id).click(function () { |
| | | |
| | | var processLog = JSON.parse(localStorage.getItem("processLog")); |
| | | var processLog =getEnclocal("processLog"); |
| | | if (processLog != null && processLog != undefined) { |
| | | } else { |
| | | customBase.alert('W',"请先创建一个流程"); |
| | |
| | | |
| | | var fuc = obt.methodName + "()"; |
| | | eval(fuc); |
| | | //console.log(fuc); |
| | | // |
| | | //调用自定义js中的方法 |
| | | //console.log("调用自定义方法"); |
| | | // |
| | | fuc; |
| | | |
| | | }); |
| | |
| | | srcd.src = rs.data.resourceFilePath; |
| | | |
| | | // $("#customShow").append(srcd); |
| | | if(rs.data.resourceFilePath != undefined && flag != 3 && rs.data.resourceFilePath != ''){//自定义JS加载修改 李伟民 0109 |
| | | document.getElementsByTagName("head")[0].appendChild(srcd); // 接口注册 初期化事件 李伟民 12-18 |
| | | if(rs.data.resourceFilePath != undefined && flag != 3 && rs.data.resourceFilePath != ''){//自定义JS加载修改 0109 |
| | | document.getElementsByTagName("head")[0].appendChild(srcd); // 接口注册 初期化事件 12-18 |
| | | srcd.onload = function () { |
| | | _.each(customBase.interfaceData, function (data) { |
| | | if (data.interfacemethod == "interfaceInit3rd") { |
| | |
| | | } |
| | | } |
| | | }); |
| | | callback(rs);//自定义JS加载修改 李伟民 0109 |
| | | callback(rs);//自定义JS加载修改 0109 |
| | | } |
| | | }else{ |
| | | callback(rs);//自定义JS加载修改 李伟民 0109 |
| | | callback(rs);//自定义JS加载修改 0109 |
| | | } |
| | | |
| | | // $(".preview-edit-pane").append(dd); |
| | |
| | | |
| | | // var fuc=arr[1]+"()"; |
| | | // eval(fuc); |
| | | // ////console.log(fuc); |
| | | // //// |
| | | |
| | | // ////console.log("调用自定义方法"); |
| | | // //// |
| | | // fuc; |
| | | |
| | | // }); |
| | | }else{ |
| | | callback(rs);//自定义JS加载修改 李伟民 0109 |
| | | callback(rs);//自定义JS加载修改 0109 |
| | | } |
| | | }); |
| | | var dataObjDo = {}; |
| | | dataObjDo = dataObj; |
| | | delete dataObjDo.type |
| | | console.log(dataObj) |
| | | |
| | | var requestRight = window.commonAjax("/tabConfiguration/queryTabConfiguration", dataObjDo, "POST", true); |
| | | requestRight.done(function (rs) { |
| | | //2017/10/31 李元杰 附件 流程先洗 选项卡添加 |
| | | console.log(rs) |
| | | |
| | | $('.boxTwo').hide(); |
| | | $('.sTab').find('ul li').eq(1).hide(); |
| | | $('.boxThr').hide(); |
| | | $('.sTab').find('ul li').eq(2).hide(); |
| | | if (rs.data != '') { |
| | | if (rs.data[0].appendix == "do") { |
| | | console.log($('.sTab').find('ul li')) |
| | | |
| | | $('.sTab').find('ul li').eq(1).show(); |
| | | } else { |
| | | $('.boxTwo').hide(); |
| | |
| | | xhSelect.setValue = function (itemId, listData, N) { |
| | | var selectItme = $("#" + itemId + " .selectItme"); |
| | | var listDataJson = {}; |
| | | if (_.isString(listData)) {// 下拉款填值 修改 李伟民 11-14 |
| | | if (_.isString(listData)) {// 下拉款填值 修改 11-14 |
| | | listData = listData.split(",") |
| | | }// 下拉款填值 修改 李伟民 11-14 |
| | | console.log(listData); |
| | | }// 下拉款填值 修改 11-14 |
| | | |
| | | for (var i = 0; i < listData.length; i++) { |
| | | listDataJson[listData[i]] = "1"; |
| | | } |
| | |
| | | xhSelect.getValue = function (itemId) { |
| | | var returnItem = []; |
| | | var selectItme = $("#" + itemId + " .selectItme"); |
| | | console.log(selectItme) |
| | | |
| | | for (var i = 0; i < selectItme.length; i++) { |
| | | if (selectItme[i].getAttribute("value") == "") { |
| | | var selectItmeJson = {}; |
| | | } else { |
| | | ////console.log(selectItme[i].getAttribute("value")); |
| | | //// |
| | | var selectItmeJson = $.parseJSON(selectItme[i].getAttribute("value")); |
| | | } |
| | | |
| | |
| | | } |
| | | // 下拉框主数据渲染 |
| | | xhSelect.setXhSelect = function (options) { |
| | | ////console.log(options); |
| | | ////console.log(_.cloneDeep(xhSelect.options)); |
| | | //// |
| | | //// |
| | | //解决主数据重复 |
| | | var options_xh = _.cloneDeep(xhSelect.options); |
| | | options_xh.listData = []; |
| | | //解决主数据重复END |
| | | options = $.extend(true, options_xh, options); |
| | | var optionArr = ""; |
| | | console.log(options.selectId); |
| | | ////console.log(options.listData); |
| | | // ////console.log(options.listData.length); |
| | | |
| | | //// |
| | | // //// |
| | | for (var i = 0; i < options.listData.length; i++) { |
| | | optionArr += '<option value="' + options.listData[i].value + '">' + options.listData[i].text + '</option>'; |
| | | } |
| | | console.log(optionArr); |
| | | |
| | | var multiple = ""; |
| | | if (options.multiple) { |
| | | multiple = 'multiple'; |
| | |
| | | ' </div>' + |
| | | ' </div> ' + |
| | | '</div>'; |
| | | console.log(options); |
| | | |
| | | if (options.setDiv == '') { |
| | | var $el = $("#" + options.selectId); |
| | | } else { |
| | | var $el = $("." + options.setDiv); |
| | | } |
| | | console.log(optionArr) |
| | | console.log($xhSelectDiv) |
| | | _.each($el, function (sel) {//添加记录 重复问题 李伟民11-14 主数据丢失 11-29 再次修改 |
| | | |
| | | |
| | | _.each($el, function (sel) {//添加记录 重复问题 11-14 主数据丢失 11-29 再次修改 |
| | | if ($(sel).find(".selectClass").length == 0) { |
| | | $(sel).append($xhSelectDiv) |
| | | } else { |
| | | $(sel).find(".selectClass").find(".select_get").html(optionArr); |
| | | } |
| | | })//添加记录 重复问题 李伟民11-14 主数据丢失 11-29 再次修改 |
| | | })//添加记录 重复问题 11-14 主数据丢失 11-29 再次修改 |
| | | |
| | | |
| | | //添加记录 重复问题 李伟民11-14 |
| | | //添加记录 重复问题 11-14 |
| | | // $("#"+options.selectId).find() |
| | | |
| | | xhSelect.selectContainer(options); |
| | |
| | | } |
| | | xhSelect.rm_option = function (val, vals_selected) { |
| | | xhSelect.scope.rm_optionFlag = true; |
| | | console.log(val); |
| | | console.log(vals_selected) |
| | | |
| | | |
| | | $('div.drop_down_sel').remove(); |
| | | var selectItmeJson = $($(val).parent().parent().parent().parent()).find(".selectItme")[0].getAttribute("value"); |
| | | |
| | |
| | | |
| | | //张吉男修改 下拉框默认值不可以清空 |
| | | var cla=new RegExp("disableColor"); |
| | | //console.log(cla.test($(val).parent().parent().attr("class"))); |
| | | // |
| | | //判断下拉框是否是可编辑 |
| | | if(!(cla.test($(val).parent().parent().attr("class")))){ |
| | | $(val).parent().remove(); |
| | |
| | | // 12/4 李元杰 |
| | | $('.zTreeDemoBackground').css("display", "none"); |
| | | $(".search_input").css("display", "none"); |
| | | console.log(selectedItem); |
| | | console.log(event); |
| | | console.log($(this)) |
| | | ////console.log("-------------------this-----------------------------------"); |
| | | |
| | | |
| | | |
| | | //// |
| | | if ($el[0].className.indexOf("readonly") > -1) { |
| | | return; |
| | | } |
| | |
| | | if (xhSelect.scope.rm_optionFlag) { |
| | | return; |
| | | } |
| | | console.log(2) |
| | | |
| | | $('div.drop_down_sel').remove(); |
| | | var $select = $el.find('select'); |
| | | var isMultiple = $select.attr('multiple'); |
| | | var $options = $el.find('select > option'); |
| | | ////console.log($el); |
| | | ////console.log($options); |
| | | //// |
| | | //// |
| | | var $options_str = '<ul>' + '<li class="sel_query">' + '<input type="text" name="query" >' + '</li>' + '</ul>'; |
| | | |
| | | $options_str += '<div class="select "><ul class="line">'; |
| | |
| | | }); |
| | | |
| | | $options_str += '</ul></div>'; |
| | | console.log($options_str) |
| | | console.log(3) |
| | | |
| | | |
| | | $("div.drop_down_sel").remove(); |
| | | var $select_obj = $('<div drop-down-selector="" filterlist="searchlist" class="drop_down_sel" style="position: absolute;">' + $options_str + '</div>'); |
| | | $el.find('div.select3-element').append($select_obj); |
| | | $('body').off('click.sel').on('click.sel', function () { |
| | | console.log(5); |
| | | |
| | | $('div.drop_down_sel').remove(); |
| | | $('.zTreeDemoBackground').css("display", "none"); |
| | | $(".search_input").css("display", "none"); |
| | |
| | | |
| | | event.stopPropagation(); |
| | | }); |
| | | console.log(6) |
| | | |
| | | $select_obj.find('input[name="query"]').on('keyup', |
| | | function () { |
| | | var $el = $(this); |
| | |
| | | 'label': checkboxLabel |
| | | }]; |
| | | set_valueleft(vals_selected); |
| | | console.log(7) |
| | | |
| | | $('div.drop_down_sel').remove(); |
| | | } else { |
| | | var vls = []; |
| | |
| | | }); |
| | | } |
| | | |
| | | //customBase.reCharge = function(){//重新记账 李伟民 2017-10-18 21:30 |
| | | // //console.log(customBase); |
| | | // //console.log(customShow); |
| | | //customBase.reCharge = function(){//重新记账 2017-10-18 21:30 |
| | | // // |
| | | // // |
| | | // var rePostData = {}; |
| | | // rePostData['formID'] = customShow.options.formid; |
| | | // rePostData['dataRowNum'] = customShow.options.dataRowNum; |
| | | // var reCharge_request = window.cloudAjax("epc-tenant/accounting/record",rePostData,"POST",true); |
| | | // reCharge_request.done(function(res){ |
| | | // //console.log(res); |
| | | // // |
| | | // }) |
| | | //}//重新记账 李伟民 2017-10-18 21:30 end |
| | | //}//重新记账 2017-10-18 21:30 end |
| | | |
| | | //customBase.checkItem = function(){//提交验证 李伟民2017-10-19 15:52 |
| | | // //console.log(customBase); |
| | | // //console.log(customShow); |
| | | //customBase.checkItem = function(){//提交验证 2017-10-19 15:52 |
| | | // // |
| | | // // |
| | | // //画面项目取得 --------------------------画面项目取得------ |
| | | // var items = customShow.getItems(); |
| | | // ////console.log(items) |
| | | // //// |
| | | // // 画面check |
| | | // var returnfromCheck = customShow.initEvent.fromCheck(items); //-------------------- |
| | | // if(returnfromCheck){ |
| | |
| | | // var rules = customShow.options.jsonLinkage; |
| | | // if(!_.isNull(rules) && rules != undefined){ |
| | | // rules = JSON.parse(rules); |
| | | // //console.log(rules); |
| | | // // |
| | | // var checkId = []; |
| | | // _.each(rules,function(ru){ |
| | | // _.each(ru.results,function(res){ |
| | |
| | | // }) |
| | | // }); |
| | | // checkId = _.uniq(checkId); |
| | | // //console.log(checkId); |
| | | // // |
| | | // _.each(checkId,function(cid){ |
| | | // $("[id='" + cid + "']").trigger("change.check"); |
| | | // }); |
| | | // } |
| | | //}//提交验证 李伟民2017-10-19 15:52 end |
| | | //}//提交验证 2017-10-19 15:52 end |
| | | |
| | | // function checkSameDay(day1, day2) {//判断是否为同一天 李伟民 2017-10-20 17:00 |
| | | // function checkSameDay(day1, day2) {//判断是否为同一天 2017-10-20 17:00 |
| | | // var seconds; |
| | | // seconds = day1 - day2; |
| | | // //console.log(seconds); |
| | | // // |
| | | // if (seconds < 24 * 60 * 60 * 1000 && seconds >= 0) { |
| | | // return true; |
| | | // } else { |
| | | // return false; |
| | | // } |
| | | // }//判断是否为同一天 李伟民 2017-10-20 17:00 end |
| | | // }//判断是否为同一天 2017-10-20 17:00 end |
| | | |
| | | // customBase.checkTimeCross = function () {//跨行程验证时间 李伟民 2017-10-20 11:35 |
| | | // //console.log(customBase); |
| | | // //console.log(customShow); |
| | | // customBase.checkTimeCross = function () {//跨行程验证时间 2017-10-20 11:35 |
| | | // // |
| | | // // |
| | | // var items = customShow.getItems(); |
| | | // //console.log(items); |
| | | // // |
| | | // var itemKey = _.keys(customBase.options.customItems); |
| | | // var subItem = []; |
| | | // _.each(itemKey, function (keys) { |
| | |
| | | // }); |
| | | // var FromDateArr = []; |
| | | // var LeaveDateArr = []; |
| | | // //console.log(subItem); |
| | | // // |
| | | // _.each(subItem, function (sub) { |
| | | // if (items[sub] != undefined) { |
| | | // _.each(items[sub], function (isub, i) { |
| | |
| | | // }); |
| | | // } |
| | | // }); |
| | | // //console.log(FromDateArr); |
| | | // //console.log(LeaveDateArr); |
| | | // // |
| | | // // |
| | | // if (FromDateArr.length > 1 && LeaveDateArr.length > 1 && FromDateArr.length == LeaveDateArr.length) { |
| | | // _.each(FromDateArr, function (fdate, k) { |
| | | // if (k > 0) { |
| | | // //console.log(checkSameDay(fdate.value,LeaveDateArr[k-1].value)); |
| | | // // |
| | | // if (checkSameDay(fdate.value, LeaveDateArr[k - 1].value) == false) { |
| | | // var message = customShow.options.customItemShow.item[fdate.property.id].tag_Attribute.title + "与上一行程不连续"; |
| | | // customLinkageAnalysis.setMessage(fdate.property.id, message, k); |
| | |
| | | // } |
| | | // }); |
| | | // } |
| | | // }//跨行程验证时间 李伟民 2017-10-20 11:35 end |
| | | // customBase.checkLandCross = function () {//跨行程验地点 李伟民 2017-10-20 11:35 |
| | | // }//跨行程验证时间 2017-10-20 11:35 end |
| | | // customBase.checkLandCross = function () {//跨行程验地点 2017-10-20 11:35 |
| | | // var items = customShow.getItems(); |
| | | // //console.log(items); |
| | | // // |
| | | // var itemKey = _.keys(customBase.options.customItems); |
| | | // var subItem = []; |
| | | // _.each(itemKey, function (keys) { |
| | |
| | | // _.each(FromLandeArr, function (fland, k) { |
| | | // if (k > 0) { |
| | | // customLinkageAnalysis.clearMessage(fland.property.id, k); |
| | | // //console.log(fland.value != ToLandArr[k-1].value); |
| | | // // |
| | | // if (fland.value != ToLandArr[k - 1].value) { |
| | | // var message = customShow.options.customItemShow.item[fland.property.id].tag_Attribute.title + "与上一行程不连续"; |
| | | // customLinkageAnalysis.setMessage(fland.property.id, message, k); |
| | |
| | | // } |
| | | // }); |
| | | // } |
| | | // }//跨行程验地点 李伟民 2017-10-20 11:35 end |
| | | // }//跨行程验地点 2017-10-20 11:35 end |
| | | //自定义表单扩展函数 增加行 删除行 |
| | | customShow.addRow = function (subId, data) { |
| | | console.log(data); |
| | | console.log(subId); |
| | | console.log($("#" + subId)); |
| | | console.log($("#" + subId).find(".trContentClass")); |
| | | |
| | | |
| | | |
| | | |
| | | $("#" + subId).find(".trContentClass").remove(); |
| | | // console.log(data[0].length - 1); |
| | | // |
| | | for (var i = 0; i < data[0].length; i++) { |
| | | var itemId = subId; |
| | | var showClass = "customViewUEditorCss"; |
| | | var item = customBase.options.customItems[customShow.options.customItemShow.item[itemId].tag_Attribute.alias].cloneDiv; |
| | | //console.log(customShow.options) |
| | | console.log(itemId, item) |
| | | console.log(itemId, customBase.options.customItems) |
| | | // |
| | | |
| | | |
| | | //子表单情况为U情况 |
| | | if (item == undefined) {// 子表单回显 修改 李伟民 11-10 |
| | | if (item == undefined) {// 子表单回显 修改 11-10 |
| | | var tbody = $("." + showClass + " #" + itemId + "ActiveId").find("tbody"); |
| | | tbody = tbody[0].cloneNode(true); |
| | | $(tbody).find(".select2").remove(); |
| | | console.log($(tbody).html()); |
| | | |
| | | $(tbody).find(".tdTitleClass").closest("tr").addClass("table_title"); |
| | | $(tbody).find(".dropdowntypeCss").select2({ theme: "classic" }); |
| | | // $(tbody).find(".zTreeDemoBackground").select2({theme: "classic"}); |
| | |
| | | //删除头行 |
| | | $(tbody).find(".table_title").remove(); |
| | | } |
| | | if ($(tbody).find(".trContentClass").length > 1) {// 去除重复的tr 李伟民 11-14 |
| | | if ($(tbody).find(".trContentClass").length > 1) {// 去除重复的tr 11-14 |
| | | $($(tbody).find(".trContentClass")[0]).siblings().remove(); |
| | | }// 去除重复的tr 李伟民 11-14 |
| | | }// 去除重复的tr 11-14 |
| | | // $(tbody).find(".cfg_contentNone").removeClass("cfg_contentNone"); |
| | | tbody = customShow.addsubformListInit(itemId, $(tbody).find("tr")); |
| | | console.log(tbody); |
| | | console.log(itemId); |
| | | console.log($(tbody).find("#" + itemId).attr("class")); |
| | | $($("." + showClass + " #" + itemId + "ActiveId").find("table")[0]).append(tbody);// 子表单回显 修改 李伟民 11-10 |
| | | |
| | | |
| | | |
| | | $($("." + showClass + " #" + itemId + "ActiveId").find("table")[0]).append(tbody);// 子表单回显 修改 11-10 |
| | | customShow.hidesubform(); |
| | | customShow.setXhSelectList(false);//添加记录 重复问题 李伟民11-14 |
| | | customShow.setXhSelectList(false);//添加记录 重复问题 11-14 |
| | | } else { |
| | | console.log(item); |
| | | |
| | | item = item[0].cloneNode(true); |
| | | console.log(item); |
| | | |
| | | $(item).find(".select2").remove(); |
| | | $(item).find(".dropdowntypeCss").select2({ theme: "classic" }); |
| | | |
| | |
| | | $($("." + showClass + " #" + itemId + "ActiveId").find("table")[0]).append(item); |
| | | |
| | | } |
| | | customShow.setXhSelectList(true);//添加记录 重复问题 李伟民11-14 |
| | | customShow.setXhSelectList(true);//添加记录 重复问题 11-14 |
| | | customShow.addtree(itemId, item); |
| | | //子表单事件追加 |
| | | customShow.clickBindSubform(); |
| | |
| | | $('.iconfontcolor').on('click', function () { |
| | | $(this).parent().parent().parent().remove(); |
| | | }); |
| | | console.log($(item)) |
| | | |
| | | customShow.addtree(itemId, item); |
| | | } |
| | | var customItems = customBase.options.customItems; |
| | | console.log(customItems) |
| | | |
| | | var order = $($("#" + subId + "ActiveId .trContentClass")[0]).find(".tdContentClass"); |
| | | var orderid = []; |
| | | var orderObj = {}; |
| | |
| | | orderid.push($(opt).find("div").children().eq(1).attr("id")); |
| | | } |
| | | }); |
| | | console.log(orderid); |
| | | |
| | | orderid.splice(0, 1); |
| | | console.log(orderid); |
| | | |
| | | var subArr = []; |
| | | console.log(subId) |
| | | |
| | | _.each(customItems, opt => { |
| | | if (opt.parentsubFormNum == subId.replace("itemId_", "")) { |
| | | subArr.push(opt); |
| | |
| | | _.remove(subArr, n => { |
| | | return n.fieldKey == "DATAROWNUM"; |
| | | }) |
| | | console.log(subArr); |
| | | |
| | | var endArr = []; |
| | | _.each(orderid, opt => { |
| | | var a = {}; |
| | |
| | | }); |
| | | endArr.push(a); |
| | | }) |
| | | console.log(endArr); |
| | | console.log(data); |
| | | |
| | | |
| | | _.each(endArr, (opts, i) => { |
| | | console.log(opts.id, opts.type, data[i]); |
| | | if (opts.type == "dropdownlist") {// 不可修改 控件type 李伟民 11-17 |
| | | |
| | | if (opts.type == "dropdownlist") {// 不可修改 控件type 11-17 |
| | | customBase.setItemValue(opts.id, "dropdownlistText", data[i], "", ""); |
| | | } else { |
| | | customBase.setItemValue(opts.id, opts.type, data[i], "", ""); |
| | | } |
| | | }); |
| | | console.log(subId) |
| | | |
| | | customShow.subTotle(subId) |
| | | }; |
| | | //关联表单控件 列表渲染 |
| | | createTable = function (rs, formId, formhuixian, head, $iconId, addVal) { |
| | | var showVal = []; |
| | | var iconAttr = customShow.options.customItemShow.item[$iconId];//关联数据 函数 数据源 李伟民 11-07 |
| | | var iconAttr = customShow.options.customItemShow.item[$iconId];//关联数据 函数 数据源 11-07 |
| | | //接收table内容请求 |
| | | var content = ""; |
| | | var counts = ""; |
| | |
| | | //渲染table内容变量 |
| | | let contentdata = ""; |
| | | //表头渲染数据 |
| | | //console.log(head); |
| | | // |
| | | _.remove(head, n => { |
| | | return n.fieldKey == "DATAROWNUM"; |
| | | }); |
| | |
| | | head_tr.append('<td class="td1">选择</td>' + headtr); |
| | | $(".requestMenu").append(head_tr); |
| | | |
| | | //console.log(rs) |
| | | // |
| | | if (rs.data != undefined && !_.isNull(rs.data) && rs.data.count != undefined) { |
| | | counts = rs.data.count; |
| | | } |
| | |
| | | // }else{ |
| | | // codeContent = rs.data.code; |
| | | // } |
| | | console.log(content); |
| | | |
| | | if (content.length == 0) { |
| | | var div_empty = $("<div><i style='width:20px;height:20px;' class='fa fa-envelope-o' aria-hidden='true'></i><p>您还没有数据显示</p></div>"); |
| | | $(".requestMenu").append(div_empty); |
| | |
| | | }); |
| | | var tr = $("<tr class='bodytr'></tr>"); |
| | | tr.append('<td class="td1"><li class="checkLine"><span class="custom-check ' + opt.show + '"></span><i class="label"></i></li></td>' + contentdata); |
| | | console.log(tr); |
| | | |
| | | $(".requestMenu").append(tr); |
| | | }); |
| | | } |
| | | //console.log(formhuixian); |
| | | // |
| | | |
| | | |
| | | if (formhuixian != undefined) { |
| | |
| | | head.push({ fieldKey: "DATAROWNUM", title: "DATAROWNUM" }); |
| | | //判断单选多选 |
| | | var selItem = customShow.options.customItemShow.item; |
| | | console.log(selItem); |
| | | |
| | | var sel = ""; |
| | | var datarow = ""; |
| | | var tag_Id = ""; |
| | | console.log(selItem); |
| | | |
| | | for (let key in selItem) { |
| | | if (key == $iconId) { |
| | | sel = selItem[key].tag_Attribute.mytextSel; |
| | | console.log(selItem[key].tag_Attribute.singleSetValue); |
| | | |
| | | if (selItem[key].tag_Attribute.singleSetValue != "itemId") { |
| | | datarow = JSON.parse(selItem[key].tag_Attribute.singleSetValue).columnOrderNum; |
| | | tag_Id = JSON.parse(selItem[key].tag_Attribute.singleSetValue).tag_Id; |
| | | } |
| | | } |
| | | } |
| | | console.log(sel) |
| | | |
| | | if (sel == "single") { |
| | | $(".custom-check").on("click", function () { |
| | | var addVals = []; |
| | | var showVals = []; |
| | | $(this).parent().parent().parent().siblings().find(".custom-check").removeClass('cur'); |
| | | $(this).toggleClass('cur'); |
| | | console.log($(this)); |
| | | console.log($(this).siblings()); |
| | | |
| | | |
| | | // var showObj = {}; |
| | | let $index = $(this).parent().parent().parent().index() - 1; |
| | | var check = $(".custom-check"); |
| | | console.log(check); |
| | | |
| | | _.each(check, opt => { |
| | | console.log(opt) |
| | | |
| | | if ($(opt).hasClass('cur')) { |
| | | addVals.push(content[$(opt).parent().parent().parent().index() - 1]); |
| | | // showVals.push(content[$(opt).parent().parent().parent().index() - 1]); |
| | | // addVals.push(codeContent[$(opt).parent().parent().parent().index() - 1]);//填值时使用code 李伟民 12-05 |
| | | // console.log(codeContent[$(opt).parent().parent().parent().index() - 1]) |
| | | // addVals.push(codeContent[$(opt).parent().parent().parent().index() - 1]);//填值时使用code 12-05 |
| | | // |
| | | } else { |
| | | _.remove(addVals, n => { |
| | | return n.DATAROWNUM == content[$(opt).parent().parent().parent().index() - 1].DATAROWNUM; |
| | | // return n.DATAROWNUM == codeContent[$(opt).parent().parent().parent().index() - 1].DATAROWNUM;//填值时使用code 李伟民 12-05 |
| | | // return n.DATAROWNUM == codeContent[$(opt).parent().parent().parent().index() - 1].DATAROWNUM;//填值时使用code 12-05 |
| | | }); |
| | | // _.remove(showVals, n => { |
| | | // return n.DATAROWNUM == content[$(opt).parent().parent().parent().index() - 1].DATAROWNUM; |
| | |
| | | }); |
| | | addVal = addVals; |
| | | // showVal = showVals; |
| | | console.log(addVal); |
| | | console.log(datarow); |
| | | |
| | | |
| | | customShow.sureonclick(addVal, $iconId, head, sel, iconAttr, datarow, formId); |
| | | }); |
| | | console.log(addVal); |
| | | |
| | | |
| | | } else if (sel == "multiple") { |
| | | $(".custom-check").on("click", function () { |
| | |
| | | if ($(this).hasClass('cur')) { |
| | | addVal.push(content[$index]); |
| | | // showVal.push(content[$index]); |
| | | // addVal.push(codeContent[$index]);//填值时使用code 李伟民 12-05 |
| | | //console.log(content[$index]) |
| | | // addVal.push(codeContent[$index]);//填值时使用code 12-05 |
| | | // |
| | | } else { |
| | | _.remove(addVal, n => { |
| | | return n.DATAROWNUM == content[$index].DATAROWNUM; |
| | | // return n.DATAROWNUM == codeContent[$index].DATAROWNUM;//填值时使用code 李伟民 12-05 |
| | | // return n.DATAROWNUM == codeContent[$index].DATAROWNUM;//填值时使用code 12-05 |
| | | }); |
| | | // _.remove(showVal, n => { |
| | | // return n.DATAROWNUM == content[$index].DATAROWNUM; |
| | |
| | | customShow.sureonclick(addVal, $iconId, head, sel, iconAttr, datarow, formId); |
| | | }); |
| | | } |
| | | console.log(addVal); |
| | | |
| | | //选择方法END |
| | | return counts; |
| | | } |
| | | |
| | | function createMxtTable($iconId, head, addVal) {// 关联数据渲染修改 李伟民 11-30 |
| | | console.log(head); |
| | | console.log(addVal); |
| | | function createMxtTable($iconId, head, addVal) {// 关联数据渲染修改 11-30 |
| | | |
| | | |
| | | if (head == "" || addVal == "" || head == undefined || addVal == undefined) { |
| | | return false; |
| | | } |
| | |
| | | tableBox.append(tableHead); |
| | | tableBox.append(tableBody); |
| | | $('#' + $iconId).append(tableBox); |
| | | }// 关联数据渲染修改 李伟民 11-30 |
| | | }// 关联数据渲染修改 11-30 |
| | | |
| | | function setValByAnother(iconAttr, addVal, formId, head, typeflag) {//遍历对比别名相同填值 typefalg为true代表关联的是函数 |
| | | var datarowNum = addVal[0].DATAROWNUM; |
| | |
| | | ajaxtype = "GET"; |
| | | } |
| | | |
| | | console.log(postdata); |
| | | |
| | | var rquest = window.commonAjax(getCodeUrl, postdata, ajaxtype, true); |
| | | rquest.done(function (res) { |
| | | console.log(res); |
| | | |
| | | var rsdata = ""; |
| | | if (res.data && res.data.main != undefined) { |
| | | if (typeflag) { |
| | |
| | | } else { |
| | | rsdata = res.data.main; |
| | | } |
| | | console.log(iconAttr); |
| | | console.log(rsdata); |
| | | |
| | | |
| | | if (rsdata == undefined) { |
| | | return false; |
| | | } |
| | |
| | | } |
| | | |
| | | customShow.sureonclick = function (addVal, $iconId, head, sel, iconAttr, datarow, formId) { |
| | | console.log(datarow) |
| | | |
| | | $(".btn-primary").on("click", function () { |
| | | var showObj = {}; |
| | | console.log(addVal); |
| | | |
| | | $('#' + $iconId).empty(); |
| | | //回显属性 |
| | | $("#" + $iconId).attr("formhuixian", JSON.stringify(addVal)); |
| | | var saveval = '';//关联数据空间 存值 李伟民 11-07 |
| | | var saveval = '';//关联数据空间 存值 11-07 |
| | | var saveArr = []; |
| | | _.each(addVal, function (v) { |
| | | if (v.DATAROWNUM != undefined) { |
| | |
| | | } |
| | | }); |
| | | saveval = saveArr.join(); |
| | | customBase.setItemValue($iconId, customShow.options.customItemShow.item[$iconId].tag_Type, saveval);//关联数据空间 存值 李伟民 11-07 end |
| | | customBase.setItemValue($iconId, customShow.options.customItemShow.item[$iconId].tag_Type, saveval);//关联数据空间 存值 11-07 end |
| | | if (addVal != "" && addVal != undefined) { |
| | | $("#" + iconAttr.tag_Id).attr("checkVal", JSON.stringify(addVal));//将选中值存储起来 用于验证 |
| | | $("#" + iconAttr.tag_Id).attr("checkHead", JSON.stringify(head)); |
| | |
| | | var data2 = customShow.columnToRow(head, addVal); |
| | | //子表单自动增加行 |
| | | var subId = $('#' + $iconId + "ActiveId").attr("choosesubform"); |
| | | console.log(subId); |
| | | |
| | | if (subId == "itemId") { |
| | | createMxtTable($iconId, head, addVal); |
| | | console.log(addVal); |
| | | console.log(head); |
| | | |
| | | |
| | | setValByAnother(iconAttr, addVal, formId, head); |
| | | //遍历对比别名相同填值 |
| | | // _.each(customBase.options.customItems, opt => { |
| | |
| | | // }) |
| | | // }); |
| | | } else { |
| | | console.log(addVal) |
| | | |
| | | if (sel == "single" && iconAttr.tag_Attribute.relevancesourcetype != "fundata") { |
| | | setValByAnother(iconAttr, addVal, formId, head) |
| | | // _.each(addVal,(opt,j)=>{ |
| | |
| | | //// ulBox.append(show); |
| | | // } |
| | | // ulBox.append("<tr>"+sdata_head+"</tr><tr>"+sdata_boby+"</tr>"); |
| | | // console.log(sdata_head); |
| | | // |
| | | // $('#'+$iconId).append(ulBox); |
| | | // }); |
| | | createMxtTable($iconId, head, addVal); |
| | | var subdata = {}; |
| | | console.log(datarow) |
| | | |
| | | subdata.formdataNum = datarow; |
| | | subdata.datarowNum = addVal[0].DATAROWNUM; |
| | | subdata.formID = formId.formID; |
| | | var subformData = window.commonAjax("/datamanagement/getSubFormDataListService", subdata, "GET", true, false); |
| | | subformData.done(function (rs) { |
| | | console.log(rs.data); |
| | | |
| | | var c_data = SC.cur_zero(rs.data); |
| | | console.log(c_data) |
| | | |
| | | var rsArr = []; |
| | | _.each(c_data, opt => { |
| | | var opts = _.omit(opt, ['DATAROWNUM']); |
| | | rsArr.push(opts) |
| | | }); |
| | | var rslength = _.keys(rsArr[0]).length; |
| | | console.log(rsArr); |
| | | |
| | | var subId = $('#' + $iconId + "ActiveId").attr("choosesubform"); |
| | | console.log($(".myipt")) |
| | | var formObj = window.localStorage.getItem("netformid"); |
| | | |
| | | var formObj = window.getEnclocal("netformid"); |
| | | var globalFormID = formObj; |
| | | var dataObj = {}; |
| | | dataObj.formID = globalFormID; |
| | | var order_id = []; |
| | | // 11/25 李元杰 存flag |
| | | console.log(dataObj) |
| | | |
| | | var requestRight = window.commonAjax("/datamanagement/getFormFieldListService", dataObj, "GET", true, false); |
| | | requestRight.done(function (rs) { |
| | | console.log(rs) |
| | | |
| | | order_id = rs.data; |
| | | }) |
| | | |
| | | // var tenantID =JSON.parse(window.localStorage.getItem('tenantID')) |
| | | // var tenantID =JSON.parse(window.getEnclocal('tenantID')) |
| | | // dataObj.tenantID= tenantID.tenantID; |
| | | |
| | | // var order_ids = JSON.parse($(".myipt").val()); |
| | | console.log(order_id); |
| | | // console.log(order_ids) |
| | | |
| | | // |
| | | |
| | | |
| | | if (customShow.options.customItemShow.item[$iconId].tag_Attribute.singleSetValue) { |
| | | var message = JSON.parse(customShow.options.customItemShow.item[$iconId].tag_Attribute.singleSetValue); |
| | | } |
| | | console.log(message.columnOrderNum) |
| | | |
| | | |
| | | console.log(subId); |
| | | |
| | | var subIds = subId.replace("itemId_", "") |
| | | console.log(subIds); |
| | | |
| | | var orderArr = []; //存储关联表单内子表单的数组 |
| | | _.each(order_id, opt => { |
| | | console.log(opt) |
| | | |
| | | if (opt.parentsubFormNum == message.columnOrderNum) { |
| | | orderArr.push(opt); |
| | | } |
| | |
| | | _.remove(orderArr, n => { |
| | | return n.fieldKey == "DATAROWNUM"; |
| | | }) |
| | | console.log(orderArr); |
| | | |
| | | orderArr = _.sortBy(orderArr, ['fieldOrderNum']); |
| | | var resArr = []; |
| | | for (i = 0; i < rslength; i++) { |
| | | resArr.push([]) |
| | | } |
| | | console.log(rsArr); |
| | | console.log(orderArr) |
| | | |
| | | |
| | | _.each(rsArr, (opt, i) => { |
| | | var j = 0 |
| | | _.each(orderArr, n => { |
| | |
| | | j++; |
| | | }) |
| | | }); |
| | | console.log(resArr); |
| | | |
| | | if (resArr.length == 0){ |
| | | alert("上级预算为0"); |
| | | } else { |
| | |
| | | |
| | | }); |
| | | } else if (sel == "multiple" || iconAttr.tag_Attribute.relevancesourcetype == "fundata") { |
| | | console.log("fundata"); |
| | | |
| | | if (iconAttr.tag_Attribute.relevancesourcetype == "fundata") {//关联函数时 别名相同填值 |
| | | setValByAnother(iconAttr, addVal, "", head, true); |
| | | } |
| | |
| | | $(".subformAddiconShow").hide(); |
| | | } |
| | | } |
| | | console.log(customShow.customJs(subId)) |
| | | |
| | | SC.setSubForm(customShow.customJs(subId), subId); |
| | | if (addVal.length != 0) { |
| | | SC.Superior_show() |
| | |
| | | |
| | | customShow.customJs = function (subId) { |
| | | var subArr = []; |
| | | console.log(subId) |
| | | |
| | | var customItems = customBase.options.customItems; |
| | | console.log(customItems) |
| | | |
| | | _.each(customItems, opt => { |
| | | if (opt.parentsubFormNum == subId.replace("itemId_", "")) { |
| | | subArr.push(opt); |
| | |
| | | _.remove(subArr, n => { |
| | | return n.fieldKey == "DATAROWNUM"; |
| | | }) |
| | | console.log(subArr); |
| | | |
| | | var aliasArr = []; |
| | | _.each(subArr, opt => { |
| | | aliasArr.push(opt.fieldKey) |
| | | }) |
| | | console.log(aliasArr); |
| | | |
| | | return aliasArr; |
| | | } |
| | | |
| | | //表单引用 扩展 回显子表单功能 |
| | | fenye = function (pageSize, pageNum, formId, sCondition, formhuixian, head, $iconId, addVal, anydata) { |
| | | console.log($iconId); |
| | | console.log("findmany"); |
| | | console.log(anydata); |
| | | console.log(head); |
| | | var iconAttr = customShow.options.customItemShow.item[$iconId];//关联数据 函数 数据源 李伟民 11-07 |
| | | console.log(iconAttr); |
| | | |
| | | |
| | | |
| | | |
| | | var iconAttr = customShow.options.customItemShow.item[$iconId];//关联数据 函数 数据源 11-07 |
| | | |
| | | var dataUrl = ""; |
| | | var dataObj; |
| | | if (anydata) { |
| | |
| | | } else { |
| | | dataUrl = "/datamanagement/getAssociatedFormDataService"; |
| | | dataObj = { "formID": formId.formID, "tenantID": "001", "screenCondition": sCondition, "pageSize": pageSize, "pageNum": pageNum, "search": anydata }; |
| | | window.localStorage.setItem("netformid", dataObj.formID); |
| | | window.setDeclocal("netformid", dataObj.formID); |
| | | } |
| | | //关联数据 函数 数据源 李伟民 11-07 |
| | | //关联数据 函数 数据源 11-07 |
| | | // var dataObj = {"formID":formId.formID,"tenantID":"001","screenCondition":sCondition,"pageSize":pageSize,"pageNum":pageNum}; |
| | | //window.localStorage.setItem("netformid",dataObj.formID); |
| | | //window.setDeclocal("netformid",dataObj.formID); |
| | | var requestRight = window.commonAjax(dataUrl, dataObj, "POST", true, false); |
| | | var counts = ""; |
| | | requestRight.done(function (rs) { |
| | |
| | | }); |
| | | $('.closeBtn').on('click', () => { |
| | | $('#' + $iconId + 'menuContent').remove(); |
| | | console.log($('.maskLayer')) |
| | | |
| | | $('.maskLayer').css('display', 'none'); |
| | | }) |
| | | return counts; |
| | | } |
| | | customShow.journeySort = function () {//行程排序 初始化 李伟民 2017-10-23 15:56 |
| | | //console.log(customShow); |
| | | customShow.journeySort = function () {//行程排序 初始化 2017-10-23 15:56 |
| | | // |
| | | var itemKey = _.keys(customShow.options.customItemShow.item); |
| | | _.each(itemKey, function (keys) { |
| | | if (customShow.options.customItemShow.item[keys].tag_Type == "subform" && customShow.options.customItemShow.item[keys].tag_Attribute.sorttype != undefined && customShow.options.customItemShow.item[keys].tag_Attribute.sorttype != "") { |
| | |
| | | } |
| | | }); |
| | | // customShow.bindSort("itemId_6","itemId_3"); |
| | | }//行程排序 初始化 李伟民 2017-10-23 15:56 end |
| | | }//行程排序 初始化 2017-10-23 15:56 end |
| | | |
| | | customShow.bindSort = function (sorttype, sub) {//排序事件绑定 |
| | | if (customShow.options.customItemShow.item[sorttype] == undefined) { |
| | |
| | | var type = event.data.msg.type; |
| | | var sub = event.data.msg.sub; |
| | | var subType = customShow.options.customItemShow.item[sub].tag_Attribute.allcopy; |
| | | console.log(event); |
| | | |
| | | var allValue; |
| | | var allItem = []; |
| | | allValue = customBase.getItemValue(sorttype, type); |
| | | if(_.isString(allValue)){ |
| | | allValue = [allValue]; |
| | | } |
| | | //console.log(allValue); |
| | | // |
| | | _.each(allValue, function (v, i) { |
| | | var optValue; |
| | | if(type == "calendar"){ |
| | |
| | | } |
| | | |
| | | }); |
| | | //console.log(allItem); |
| | | // |
| | | var sortValue = _.sortBy(allItem, function (o) { |
| | | return o.value; |
| | | }); |
| | | console.log(sortValue); |
| | | |
| | | if(subType){ |
| | | _.each($("[id='" + sub + "ActiveId']"), function (subform, k) { |
| | | $(subform).replaceWith(sortValue[k].temp); |
| | |
| | | customLinkageAnalysis.bindLinkage(); |
| | | customShow.journeySort(); |
| | | } |
| | | //马习同 2017/10/25 |
| | | // 2017/10/25 |
| | | $(".sTab ul li").on('click', function () { |
| | | $(this).css('border-bottom', '2px solid #23b7e5'); |
| | | $(this).css('box-sizing', 'border-box'); |
| | | $(this).siblings().css('border', 'none'); |
| | | //console.log($($(".tabBox>div")[$(this).index()])); |
| | | // |
| | | $($(".tabBox>div")[$(this).index()]).show(); |
| | | $($(".tabBox>div")[$(this).index()]).siblings().hide(); |
| | | if($(this).index() == 0){//切换选项卡导致 保存按钮消失修改 李伟民 0201 |
| | | if($(this).index() == 0){//切换选项卡导致 保存按钮消失修改 0201 |
| | | $(".tabBox .sure_box").show(); |
| | | } |
| | | }); |
| | | $(".tag_two").on("click", function () { |
| | | // $(".boxTwo iframe").attr("src","http://122.114.176.216:8087/#/IframeExample?token=C3CDE94FE9CBDDDD37312D3331AC091EC737F5555007677E45A390EFEC7147996A49AA4E117EDC02F0D15984E725CA3B5B93DDAF0C989C35642B58B29360D998DDDAC06EB509BE1C22B19D555A1BB75A07A36FD6C4A7E87C9C9EA0070A213BFB44FF8D3B2AD5A33086EAF1F22E978B24951EA806054F94042533CA73EA7901C5E8B13D4DB7DC87308266E769258DEDFF&openId=3dc22baf5d484170&tenantId=13&companyId=17& appId=1&processInstId=1483") |
| | | }) |
| | | //马习同 11/7 行转化列 |
| | | // 11/7 行转化列 |
| | | customShow.columnToRow = function (head, addVal) { |
| | | var data = [] |
| | | _.remove(head, n => { |
| | |
| | | _.each(addVal, opts => { |
| | | data1.push(opts[opt.fieldKey]); |
| | | }); |
| | | console.log(data1) |
| | | |
| | | data.push(data1) |
| | | }); |
| | | return data; |
| | | } |
| | | |
| | | function submitErrShow(item,num){//审查必须错误提示 李伟民 0119 |
| | | console.log(item,num); |
| | | function submitErrShow(item,num){//审查必须错误提示 0119 |
| | | |
| | | var itemId = item.tag_Id; |
| | | if(num == undefined){ |
| | | num = 0; |
| | |
| | | var mesageErrStr = item.tag_Attribute.title + '不能为空(审查必须)'; |
| | | mesageErrDiv.setAttribute("id", id + "mesageErrDiv"); |
| | | $(mesageErrDiv).append(mesageErrStr); |
| | | if(customShow.options.customInit.designMode != 1){//快捷模式 李伟民 0126 |
| | | if(customShow.options.customInit.designMode != 1){//快捷模式 0126 |
| | | if ($(".customShow #" + itemId + "ActiveId").length == 0) { |
| | | console.log($(".customViewUEditorCss [id='" + itemId + "']:eq(" + num + ")").closest("td")); |
| | | |
| | | $(".customShow [id='" + itemId + "']:eq(" + num + ")").closest("td").append(mesageErrDiv); |
| | | $(".customShow ." + itemId + "_showItem:eq(" + num + ")").append(mesageErrDiv); |
| | | } else { |
| | | $($($(".customShow #" + itemId + "ActiveId")[num])[0]).append(mesageErrDiv); |
| | | } |
| | | }else{//普通模式 李伟民 0126 |
| | | }else{//普通模式 0126 |
| | | if ($(".customShow #" + itemId).length == 0) { |
| | | $($(".customShow ." + itemId + "_showItem")[num]).css({ |
| | | 'height':"20px", |
| | |
| | | } |
| | | } |
| | | |
| | | function submitCheck(){//提交前验证审查必须 李伟民 0119 |
| | | function submitCheck(){//提交前验证审查必须 0119 |
| | | $('.submitrErr').remove(); |
| | | var checkFlag = true; |
| | | var item = localStorage.getItem('customItem'); |
| | | var item = getEnclocal('customItem'); |
| | | if(item != undefined && item != ''){ |
| | | item = JSON.parse(item); |
| | | } |
| | | console.log(customBase); |
| | | console.log(customShow); |
| | | console.log(item); |
| | | |
| | | |
| | | |
| | | var allItemKey = _.keys(customBase.options.customItems); |
| | | var allItemId = _.keys(customShow.options.customItemShow.item); |
| | | var allItem = _.cloneDeep(customShow.options.customItemShow.item); |
| | |
| | | _.extend(cd,{'parentId':parentItem[cd.parentsubFormNum].tag_Attribute.alias}); |
| | | }); |
| | | allItemValue = _.concat(allItemValue,childItem); |
| | | console.log(allItemValue); |
| | | console.log(item); |
| | | |
| | | |
| | | _.each(allItemValue,function(item_value){ |
| | | if(item_value.parentsubFormNum == 0){ |
| | | var value = item[item_value.tag_Attribute.alias] |
| | |
| | | if(checkFlag != true){ |
| | | return false; |
| | | } |
| | | console.log(localStorage.getItem("organizationId")); |
| | | console.log(localStorage.getItem("datarowNum")); |
| | | |
| | | |
| | | //从local取出log |
| | | var processLog = localStorage.getItem("processLog"); |
| | | var tenant = JSON.parse(localStorage.getItem("tenantID")); |
| | | var cust = JSON.parse(localStorage.getItem("customItem")); |
| | | var processLog = getEnclocal("processLog"); |
| | | var tenant = getEnclocal("tenantID"); |
| | | var cust = getEnclocal("customItem"); |
| | | //暂时修改流程lym |
| | | // var org = cust.expend_department.trim(); |
| | | //暂时修改流程lym |
| | | console.log(processLog); |
| | | console.log(processLog !== null); |
| | | |
| | | |
| | | //12/11 |
| | | if (processLog != "null") { |
| | | var strMessage = customBase.getMessage("mesage_ID034"); |
| | |
| | | // return null; |
| | | // } |
| | | //暂时修改流程lym |
| | | // 画面check 提交前验证 李伟民 12-26 |
| | | // 画面check 提交前验证 12-26 |
| | | // var returnfromCheck = customShow.initEvent.fromCheck(items); //-------------------- |
| | | // if (returnfromCheck) { |
| | | // return; |
| | |
| | | var ss = { |
| | | "tenantID": tenant.tenantID, |
| | | //"organizationId": org, |
| | | "formID": localStorage.getItem("newFormID"), |
| | | "dataRowNum": localStorage.getItem("datarowNum") |
| | | "formID": getEnclocal("newFormID"), |
| | | "dataRowNum": getEnclocal("datarowNum") |
| | | } |
| | | var requestSingleForm = window.commonAjax("/ubp-api-control/process/inst/create", ss, "POST", true); |
| | | requestSingleForm.done(function (rs) { |
| | | console.log(rs); |
| | | |
| | | if (rs.resCode == 00000) { |
| | | |
| | | customBase.alert('S', "提交成功"); |
| | |
| | | function over(data) { |
| | | if (data == true) { |
| | | //确定提交后操作 |
| | | var processLog = JSON.parse(localStorage.getItem("processLog")); |
| | | console.log(processLog); |
| | | var processLog = getEnclocal("processLog"); |
| | | |
| | | var ss = { |
| | | "processInstId": processLog[0].processInstId |
| | | } |
| | | console.log(ss); |
| | | |
| | | var requestSingleForm = window.commonAjax("/ubp-api-control/process/inst/over", ss, "POST", true); |
| | | requestSingleForm.done(function (rs) { |
| | | console.log(rs); |
| | | |
| | | if (rs.data == 1) { |
| | | customBase.alert('S',"结束成功"); |
| | | $("#sssd").click(); |
| | |
| | | function tui(data, item) { |
| | | |
| | | if (data == true) { |
| | | console.log($('.actcur').val()); |
| | | |
| | | if ($('.actcur').val() == undefined) { |
| | | customBase.alert("W","请选择退回的活动"); |
| | | return null; |
| | | } |
| | | var processLog = JSON.parse(localStorage.getItem("processLog")); |
| | | var processLog = getEnclocal("processLog"); |
| | | var ss = { |
| | | "activityInstId": processLog[0].activityInstId, |
| | | "activityDefId": $('.actcur').val(), |
| | | "processInstId": processLog[0].processInstId, |
| | | "formID": localStorage.getItem("newFormID"), |
| | | "dataRowNum": localStorage.getItem("datarowNum") |
| | | "formID": getEnclocal("newFormID"), |
| | | "dataRowNum": getEnclocal("datarowNum") |
| | | } |
| | | var requestSingleForm = window.commonAjax("/ubp-api-control/process/inst/bac", ss, "POST", true); |
| | | requestSingleForm.done(function (rs) { |
| | | console.log(rs); |
| | | |
| | | |
| | | if (rs.data == 1) { |
| | | customBase.alert("S","退回成功"); |
| | |
| | | } |
| | | //lym 审批确定后方法 |
| | | function zhixing(data) { |
| | | console.log(data); |
| | | console.log($("#datas").val()); |
| | | |
| | | |
| | | if (data == false) { |
| | | $("#sssd").click(); |
| | | } else { |
| | | |
| | | var processLog = JSON.parse(localStorage.getItem("processLog")); |
| | | console.log(processLog[0].processInstId); |
| | | var processLog = getEnclocal("processLog"); |
| | | |
| | | var ss = { |
| | | "processInstId": processLog[0].processInstId, |
| | | "activityInstId": processLog[0].activityInstId, |
| | | "data": $("#datas").val(), |
| | | "formID": localStorage.getItem("newFormID"), |
| | | "dataRowNum": localStorage.getItem("datarowNum"), |
| | | "token": localStorage.getItem("testToken"),//差旅token 特殊处理 |
| | | "tenantId": localStorage.getItem("testTenantId"), |
| | | "companyId": localStorage.getItem("testCompanyId"), |
| | | "formID": getEnclocal("newFormID"), |
| | | "dataRowNum": getEnclocal("datarowNum"), |
| | | "token": getEnclocal("testToken"),//差旅token 特殊处理 |
| | | "tenantId": getEnclocal("testTenantId"), |
| | | "companyId": getEnclocal("testCompanyId"), |
| | | |
| | | } |
| | | console.log("标记token"); |
| | | |
| | | var requestSingleForm = window.commonAjax("/ubp-api-control/process/inst/finish", ss, "POST", true); |
| | | requestSingleForm.done(function (rs) { |
| | | console.log(rs); |
| | | |
| | | if (rs.resCode == "00000") { |
| | | customBase.alert('S',"审批成功"); |
| | | $('#editableBtn').remove();//审批成功后不能编辑 李伟民 0129 |
| | | $('#editableBtn').remove();//审批成功后不能编辑 0129 |
| | | $("#sssd").click(); |
| | | } else { |
| | | customBase.alert('W',"审批失败"); |
| | |
| | | } |
| | | //2017.11.24 qld 追加预算 |
| | | customBase.budgetAddmoney = function () { |
| | | var id = JSON.parse(localStorage.getItem("tenantID")) |
| | | console.log(id.tenantID); |
| | | var sub = JSON.parse(localStorage.getItem("customItem")); |
| | | var id = getEnclocal("tenantID") |
| | | |
| | | var sub = getEnclocal("customItem"); |
| | | var submit_data = { |
| | | "formId": localStorage.getItem("newFormID"), |
| | | "netformid": localStorage.getItem("netformid"), |
| | | "parentDataRowNum": localStorage.getItem("datarowNum"), |
| | | "dataRowNum": localStorage.getItem("datarowNum"), |
| | | "formId": getEnclocal("newFormID"), |
| | | "netformid": getEnclocal("netformid"), |
| | | "parentDataRowNum": getEnclocal("datarowNum"), |
| | | "dataRowNum": getEnclocal("datarowNum"), |
| | | "tenantID": id.tenantID, |
| | | "formType": "ZJ" |
| | | }; |
| | |
| | | } |
| | | |
| | | customBase.budgetBackmoney = function () { |
| | | var id = JSON.parse(localStorage.getItem("tenantID")) |
| | | console.log(id.tenantID); |
| | | var sub = JSON.parse(localStorage.getItem("customItem")); |
| | | var id = getEnclocal("tenantID") |
| | | |
| | | var sub = getEnclocal("customItem"); |
| | | var submit_data = { |
| | | "formId": localStorage.getItem("newFormID"), |
| | | "netformid": localStorage.getItem("netformid"), |
| | | "parentDataRowNum": localStorage.getItem("datarowNum"), |
| | | "dataRowNum": localStorage.getItem("datarowNum"), |
| | | "formId": getEnclocal("newFormID"), |
| | | "netformid": getEnclocal("netformid"), |
| | | "parentDataRowNum": getEnclocal("datarowNum"), |
| | | "dataRowNum": getEnclocal("datarowNum"), |
| | | "formType": "TH", |
| | | "tenantID": id.tenantID |
| | | }; |
| | |
| | | return true; |
| | | } |
| | | customBase.repayment = function () { |
| | | var id = JSON.parse(localStorage.getItem("tenantID")) |
| | | console.log(id.tenantID); |
| | | var sub = JSON.parse(localStorage.getItem("customItem")); |
| | | console.log(sub); |
| | | var id = getEnclocal("tenantID") |
| | | |
| | | var sub = getEnclocal("customItem"); |
| | | |
| | | var subForm = sub.DATAROWNUM; |
| | | console.log("我是" + subForm) |
| | | |
| | | var submit_data = { |
| | | "formId": localStorage.getItem("newFormID"), |
| | | "netformid": localStorage.getItem("netformid"), |
| | | "parentDataRowNum": localStorage.getItem("datarowNum"), |
| | | "datarowNum": localStorage.getItem("datarowNum"), |
| | | "formId": getEnclocal("newFormID"), |
| | | "netformid": getEnclocal("netformid"), |
| | | "parentDataRowNum": getEnclocal("datarowNum"), |
| | | "datarowNum": getEnclocal("datarowNum"), |
| | | "tenantId": id.tenantID |
| | | }; |
| | | |
| | |
| | | }) |
| | | |
| | | } |
| | | //子表单合计方法 马习同 2017-12-06 |
| | | //子表单合计方法 2017-12-06 |
| | | customShow.subTotle = function (subId) { |
| | | var customItems = customBase.options.customItems; |
| | | var numArr = []; |
| | |
| | | }); |
| | | _.each(subArr, opt => { |
| | | if (opt.type == "number") { |
| | | console.log(opt.id); |
| | | |
| | | numObj[opt.id] = customBase.getItemValue(opt.id, opt.type); |
| | | numArr.push(Number(customBase.getItemValue(opt.id, opt.type))); |
| | | } |
| | | }) |
| | | console.log(numObj); |
| | | |
| | | for (let key in numObj) { |
| | | var opts = []; |
| | | if (_.isArray(numObj[key])) { |
| | | _.each(numObj[key], n => { |
| | | n = Number(n); |
| | | console.log(n); |
| | | |
| | | opts.push(n); |
| | | }) |
| | | numObj[key] = opts; |
| | | } |
| | | console.log(numObj[key]); |
| | | |
| | | } |
| | | console.log(numObj); |
| | | |
| | | //_.sum 求和 |
| | | for (let key in numObj) { |
| | | $("." + key + "totle").val(_.sum(numObj[key])); |
| | | } |
| | | |
| | | } |
| | | //子表单合计方法 马习同 2017-12-07 |
| | | //子表单合计方法 2017-12-07 |
| | | customShow.oneTotle = function () { |
| | | var customItems = customShow.options.customItemShow.item; |
| | | var totleArr = []; |
| | | var numObj = {}; |
| | | var numArr = []; |
| | | _.each(customItems, opt => { |
| | | console.log(opt.tag_Attribute.total) |
| | | |
| | | if (opt.tag_Attribute.total == true) { |
| | | totleArr.push(opt.tag_Id); |
| | | console.log(opt.tag_Id) |
| | | |
| | | } |
| | | }) |
| | | console.log(totleArr); |
| | | |
| | | _.each(totleArr, opt => { |
| | | $("#" + opt + " [type='number']").unbind("change.totle"); |
| | | $("#" + opt + " [type='number']").on("change.totle", function () { |
| | | console.log($(this).attr("id")); |
| | | |
| | | numObj[$(this).attr("id")] = customBase.getItemValue($(this).attr("id"), $(this).attr("type")); |
| | | console.log(_.cloneDeep(numObj)); |
| | | console.log(numObj[key]) |
| | | |
| | | |
| | | |
| | | for (let key in numObj) { |
| | | var opts = []; |
| | | if (_.isArray(numObj[key])) { |
| | | _.each(numObj[key], n => { |
| | | n = Number(n); |
| | | console.log(n); |
| | | |
| | | opts.push(n); |
| | | }) |
| | | numObj[key] = opts; |
| | | } |
| | | console.log(numObj[key]); |
| | | |
| | | } |
| | | |
| | | console.log(numObj); |
| | | |
| | | //_.sum 求和 |
| | | for (let key in numObj) { |
| | | $("." + key + "totle").val(_.sum(numObj[key])); |
| | |
| | | customShow.addTitle = function () { |
| | | _.each($(".customShow .tdContentClass"), opt => { |
| | | // $(opt).attr("title", $(opt).children().children().html()); |
| | | console.log($(opt).html()) |
| | | |
| | | if ($(opt).children().children().attr("type") == "text") { |
| | | $(opt).attr("title", $(opt).children().children().val()); |
| | | } else { |
| | | console.log(_.cloneDeep($(opt).children().children())) |
| | | console.log(opt.innerHTML) |
| | | console.log($(opt).children().children()[0].innerHTML) |
| | | |
| | | |
| | | |
| | | $(opt).attr("title", $(opt).children().children()[0].innerHTML); |
| | | } |
| | | }) |
| | |
| | | // } |
| | | // }else{ |
| | | // if(customBase.options.customItems[fieldKey].parentsubFormNum == '0'){ |
| | | // var businessTypeAuto = window.localStorage.getItem(key); |
| | | // var businessTypeAuto = window.getEnclocal(key); |
| | | // customBase.setItemValue(customBase.options.customItems[fieldKey].id, customBase.options.customItems[fieldKey].type, businessTypeAuto, '', ''); |
| | | // } |
| | | // } |
| | | // } |
| | | // SC.billInfoInit = function(items){//票据信息初始化 李伟民 12-26 |
| | | // SC.billInfoInit = function(items){//票据信息初始化 12-26 |
| | | // var itemKey = _.keys(items); |
| | | // var customItems = customBase.options.customItems; |
| | | // customShow.allbillInfo = []; |
| | | // _.each(itemKey,function(key){ |
| | | // console.log(key); |
| | | // |
| | | // if(customItems[key] != undefined && customItems[key] != '' && customItems[key].type == "subform"){ |
| | | // var billInfos = []; |
| | | // _.each(items[key], function(journey, i){ |
| | |
| | | // } |
| | | // }); |
| | | // } |
| | | // function billInfobind(allbillInfo){//票据信息显示 及 实时验证 李伟民 12-26 |
| | | // function billInfobind(allbillInfo){//票据信息显示 及 实时验证 12-26 |
| | | // _.each(allbillInfo,function(info,k){ |
| | | // var sub_type = customShow.options.customItemShow.item[info.subFormId].tag_Attribute.allcopy; |
| | | |
| | |
| | | // }); |
| | | // }) |
| | | // } |
| | | // function billShow(sub_type,itemKey,bhName,bhVal,num){//票据信息验证绑定 李伟民 12-26 |
| | | // function billShow(sub_type,itemKey,bhName,bhVal,num){//票据信息验证绑定 12-26 |
| | | // var itemId = customBase.options.customItems[itemKey].id; |
| | | // var type = customBase.options.customItems[itemKey].type; |
| | | // if(sub_type){ |