Commit b8f89662 authored by 赵汉亭's avatar 赵汉亭

月结方式

parent 48188b73
$(document).ready(function () { $(document).ready(function () {
initializateUI();
// loadProcessListGrid();
bindQueryEvent(); // 这里也要复制!!!!!!! bindQueryEvent(); // 这里也要复制!!!!!!!
bindEvent();
}); });
function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3});
}
//绑定selectC--------月结方式复制这里!!! (PS:复制完此页面可以删除了) //绑定selectC--------月结方式复制这里!!! (PS:复制完此页面可以删除了)
function bindQueryEvent() { function bindQueryEvent() {
$('#method').searchbox({ $('#method').searchbox({
type: "monthlySettlementMethod", name: "monthlySettlementMethodApplyCode", type: "monthlySettlementMethod", name: "monthlySettlementMethodApplyCode",
onChange: function (value, data) { onChange: function (value, data) {
$('#method').val(data.method); $('#method').val(data.method);
ajaxRenderDataGoForm(data.method); renderingDictionaries(data);
showTable({methodId:data.methodId});
} }
}); });
} }
function bindEvent() { /**
$("#save").click(function () { * 渲染带数据字典的select
saveData("save"); * @param obj
}) */
$("#submit").click(function () { function renderingDictionaries(obj) {
saveData("submit"); console.log(obj)
}) //获取所有select的id名与对象匹配
$("select").each(function () {
$("#close").click(function () {//关闭 var id = $(this).attr("id");
closeDispatchTabItem(); if (obj.hasOwnProperty(id)) {
})
}
function getCostCenterDetail(CostCenterAction) { var keyValuePairs = new Map();
//采购订单保存时数据不进行必填验证,提交时数据才进行必填验证
var op = {};
var check = true;
if (CostCenterAction == "save") {
check = false;
}
op = {check: check};
var costCenter = $('#submitForm').formToJSON(op);
if (!costCenter) {
return false;
}
return costCenter;
}
function saveData(action) { $('#' + id + ' option').each(function () {
debugger var value = $(this).val();
var CostCenterDetail = getCostCenterDetail("submit"); var text = $(this).text();
if (!CostCenterDetail) { keyValuePairs.set(value, text);
return; });
}
Public.ajax(web_app.name + '/monthlySettlementMethod/saveMonthlySettlementMethod.ajax?code=' + action,CostCenterDetail,
function (data) {
setId(data.id);
Public.successTip("数据保存成功");
// processGridManager.setParm('id', data.id);
// processGridManager.loadData();
}
);
}
function closeDispatchTabItem() { // 获取 对应的文本值
UICtrl.closeCurrentTab(); var selectedValue = obj[id];
} var selectedText = keyValuePairs.get(selectedValue);
function setId(value) { // 将文本值赋值给目标元素
$('#id').val(value); $('#' + id + '_text').val(selectedText);
} $('#' + id).val(selectedValue);
function getId() { console.log("select:" + id+"("+selectedText+":"+selectedValue+")")
return $("#id").val(); }
});
} }
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
from monthly_settlement_method m from monthly_settlement_method m
where status = 1 where status = 1
</sql> </sql>
<field name="月方式" title="月结方式" code="method" width="543"/> <field name="月方式" title="月结方式" code="method" width="543"/>
<field name="月方式Id" title="月结方式id" code="methodId" width="200" type="hidden"/> <field name="月方式Id" title="月结方式id" code="methodId" width="200" type="hidden"/>
<condition column="method" name="method" symbol="like" <condition column="method" name="method" symbol="like"
alias="m" /> alias="m" />
<orderby> sequence asc</orderby> <orderby> sequence asc</orderby>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment