Commit eb9c5f53 authored by wanghang's avatar wanghang

Merge remote-tracking branch 'origin/dev' into dev

parents a270b7d6 b8f89662
$(document).ready(function () {
initializateUI();
// loadProcessListGrid();
bindQueryEvent(); // 这里也要复制!!!!!!!
bindEvent();
});
function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3});
}
//绑定selectC--------月结方式复制这里!!! (PS:复制完此页面可以删除了)
function bindQueryEvent() {
$('#method').searchbox({
type: "monthlySettlementMethod", name: "monthlySettlementMethodApplyCode",
onChange: function (value, data) {
$('#method').val(data.method);
ajaxRenderDataGoForm(data.method);
showTable({methodId:data.methodId});
renderingDictionaries(data);
}
});
}
function bindEvent() {
$("#save").click(function () {
saveData("save");
})
$("#submit").click(function () {
saveData("submit");
})
$("#close").click(function () {//关闭
closeDispatchTabItem();
})
}
/**
* 渲染带数据字典的select
* @param obj
*/
function renderingDictionaries(obj) {
console.log(obj)
//获取所有select的id名与对象匹配
$("select").each(function () {
var id = $(this).attr("id");
if (obj.hasOwnProperty(id)) {
function getCostCenterDetail(CostCenterAction) {
//采购订单保存时数据不进行必填验证,提交时数据才进行必填验证
var op = {};
var check = true;
if (CostCenterAction == "save") {
check = false;
}
op = {check: check};
var costCenter = $('#submitForm').formToJSON(op);
if (!costCenter) {
return false;
}
return costCenter;
}
var keyValuePairs = new Map();
function saveData(action) {
debugger
var CostCenterDetail = getCostCenterDetail("submit");
if (!CostCenterDetail) {
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();
}
);
}
$('#' + id + ' option').each(function () {
var value = $(this).val();
var text = $(this).text();
keyValuePairs.set(value, text);
});
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() {
return $("#id").val();
console.log("select:" + id+"("+selectedText+":"+selectedValue+")")
}
});
}
......@@ -7,8 +7,8 @@
from monthly_settlement_method m
where status = 1
</sql>
<field name="月方式" title="月结方式" code="method" width="543"/>
<field name="月方式Id" title="月结方式id" code="methodId" width="200" type="hidden"/>
<field name="月方式" title="月结方式" code="method" width="543"/>
<field name="月方式Id" title="月结方式id" code="methodId" width="200" type="hidden"/>
<condition column="method" name="method" symbol="like"
alias="m" />
<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