提交 b3094227 编写于 作者: doc_wei's avatar doc_wei

动态表单工具类修改

上级 d965443c
...@@ -41,7 +41,7 @@ var dsFormUtil = { ...@@ -41,7 +41,7 @@ var dsFormUtil = {
* *
* @param id dom对象的id * @param id dom对象的id
*/ */
initDsFormChooseBtn: function(id, initData){ initDsFormChooseBtn: function(id, initData) {
var btnId = id + 'Btn'; var btnId = id + 'Btn';
$("#" + id).attr(dsFormUtil.dsFormDataKey, JSON.stringify(initData)); $("#" + id).attr(dsFormUtil.dsFormDataKey, JSON.stringify(initData));
dsFormUtil.initData(id, btnId); dsFormUtil.initData(id, btnId);
...@@ -60,7 +60,7 @@ var dsFormUtil = { ...@@ -60,7 +60,7 @@ var dsFormUtil = {
* @param id box的id * @param id box的id
* @param btnId 按钮id * @param btnId 按钮id
*/ */
initData: function(id, btnId){ initData: function(id, btnId) {
var btnHtml = getDataUseHandlebars(dsFormUtil.dsFormBtnTemplate, {btnId: btnId}); var btnHtml = getDataUseHandlebars(dsFormUtil.dsFormBtnTemplate, {btnId: btnId});
var str = ""; var str = "";
var dsFormChooseList = JSON.parse($("#" + id).attr(dsFormUtil.dsFormDataKey)); var dsFormChooseList = JSON.parse($("#" + id).attr(dsFormUtil.dsFormDataKey));
...@@ -77,7 +77,7 @@ var dsFormUtil = { ...@@ -77,7 +77,7 @@ var dsFormUtil = {
* @param id box的id * @param id box的id
* @returns {*[]} * @returns {*[]}
*/ */
getJSONDsFormListByBoxId: function (id){ getJSONDsFormListByBoxId: function (id) {
return [].concat(JSON.parse($("#" + id).attr(dsFormUtil.dsFormDataKey))); return [].concat(JSON.parse($("#" + id).attr(dsFormUtil.dsFormDataKey)));
}, },
...@@ -87,7 +87,7 @@ var dsFormUtil = { ...@@ -87,7 +87,7 @@ var dsFormUtil = {
* @param domId 要加载的dom对象的id * @param domId 要加载的dom对象的id
* @param parentId 父id * @param parentId 父id
*/ */
loadDsFormPageTypeByPId: function (domId, parentId){ loadDsFormPageTypeByPId: function (domId, parentId) {
showGrid({ showGrid({
id: domId, id: domId,
url: flowableBasePath + "dsformpagetype006", url: flowableBasePath + "dsformpagetype006",
...@@ -108,7 +108,7 @@ var dsFormUtil = { ...@@ -108,7 +108,7 @@ var dsFormUtil = {
* @param showBoxId 要追加的boxid后面 * @param showBoxId 要追加的boxid后面
* @param code 动态表单-----业务逻辑表单关联表中的code * @param code 动态表单-----业务逻辑表单关联表中的code
*/ */
loadPageByCode: function(showBoxId, code, dsFormObjectRelationId){ loadPageByCode: function(showBoxId, code, dsFormObjectRelationId) {
var params = { var params = {
dsFormObjectRelationCode: isNull(code) ? "" : code, dsFormObjectRelationCode: isNull(code) ? "" : code,
dsFormObjectRelationId: isNull(dsFormObjectRelationId) ? "" : dsFormObjectRelationId dsFormObjectRelationId: isNull(dsFormObjectRelationId) ? "" : dsFormObjectRelationId
...@@ -118,7 +118,7 @@ var dsFormUtil = { ...@@ -118,7 +118,7 @@ var dsFormUtil = {
}, async: false}); }, async: false});
}, },
loadDsFormItem: function(showBoxId, json){ loadDsFormItem: function(showBoxId, json) {
$.each(json.rows, function(j, bean){ $.each(json.rows, function(j, bean){
var customBoxId = bean.id; var customBoxId = bean.id;
$("#" + showBoxId).append(getDataUseHandlebars(dsFormUtil.customDsFormBox, bean)); $("#" + showBoxId).append(getDataUseHandlebars(dsFormUtil.customDsFormBox, bean));
...@@ -190,7 +190,7 @@ var dsFormUtil = { ...@@ -190,7 +190,7 @@ var dsFormUtil = {
/** /**
* 获取保存的数据 * 获取保存的数据
*/ */
savePageData: function (showBoxId, objectId){ savePageData: function (showBoxId, objectId) {
var result = {}; var result = {};
$.each($("#" + showBoxId + " .ds-form-page"), function (i, item) { $.each($("#" + showBoxId + " .ds-form-page"), function (i, item) {
var _item = $(item); var _item = $(item);
...@@ -286,7 +286,7 @@ var dsFormUtil = { ...@@ -286,7 +286,7 @@ var dsFormUtil = {
* @param showBoxId要追加的boxid后面 * @param showBoxId要追加的boxid后面
* @param objectId 绑定的objectId * @param objectId 绑定的objectId
*/ */
loadPageShowDetailsByObjectId: function(showBoxId, objectId){ loadPageShowDetailsByObjectId: function(showBoxId, objectId) {
AjaxPostUtil.request({url: flowableBasePath + "dsformpage015", params: {objectId: objectId}, method: "GET", type: 'json', callback: function(json) { AjaxPostUtil.request({url: flowableBasePath + "dsformpage015", params: {objectId: objectId}, method: "GET", type: 'json', callback: function(json) {
$.each(json.rows, function(j, bean) { $.each(json.rows, function(j, bean) {
var customBoxId = bean.id; var customBoxId = bean.id;
...@@ -296,7 +296,7 @@ var dsFormUtil = { ...@@ -296,7 +296,7 @@ var dsFormUtil = {
}, async: false}); }, async: false});
}, },
initSequenceDataDetails: function (customBoxId, rows){ initSequenceDataDetails: function (customBoxId, rows) {
$.each(rows, function (i, item) { $.each(rows, function (i, item) {
var jsonStr = { var jsonStr = {
bean: item bean: item
...@@ -339,7 +339,7 @@ var dsFormUtil = { ...@@ -339,7 +339,7 @@ var dsFormUtil = {
* @param callback 回调函数 * @param callback 回调函数
*/ */
dsFormObjectRelationChoose: {}, // 已经选择的单据类型 dsFormObjectRelationChoose: {}, // 已经选择的单据类型
openDsFormObjectRelationChooseByFirstTypeCodeChoosePage: function (firstTypeCode, callback){ openDsFormObjectRelationChooseByFirstTypeCodeChoosePage: function (firstTypeCode, callback) {
_openNewWindows({ _openNewWindows({
url: "../../tpl/dsFormObjectRelation/dsFormObjectRelationChooseByFirstTypeCode.html?firstTypeCode=" + firstTypeCode, url: "../../tpl/dsFormObjectRelation/dsFormObjectRelationChooseByFirstTypeCode.html?firstTypeCode=" + firstTypeCode,
title: "单据类型", title: "单据类型",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册