You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aixinChina/ecodey 加入的代码.txt

80 lines
2.2 KiB
Plaintext

// 获取指定日期汇率
jQuery(document).ready(function(){
//选择下拉框触发的事件
WfForm.bindDetailFieldChangeEvent("field11006,field32516", function(id,rowIndex,value){
// console.log("WfForm.bindDetailFieldChangeEvent--",id,rowIndex,value);
var code=WfForm.getSelectShowName("field11006_"+rowIndex);
var date=WfForm.getFieldValue("field32516_"+rowIndex);
// console.log(code)
// console.log(date)
checkMain(rowIndex,code,date);
});
WfForm.bindDetailFieldChangeEvent("field19674,field32535", function(id,rowIndex,value){
// console.log("WfForm.bindDetailFieldChangeEvent--",id,rowIndex,value);
var code=WfForm.getSelectShowName("field32535_"+rowIndex);
var date=WfForm.getFieldValue("field19674_"+rowIndex);
checkMain2(rowIndex,code,date);
});
//
function checkMain(rowIndex,code,date){
if(code&&date){
$.ajax({
type:"post",
url:"/api/workflow/aixinspan/rate",
data:{"code":code,"date":date},
dataType:"json",
success:function(req){
// console.log("------------ajax---------------")
// console.log(req.code)
if(req.code==1){
//给字段赋值
WfForm.changeFieldValue("field32517_"+rowIndex, {value:req.data});
}else{
window.top.Dialog.alert(req.msg)
//给字段赋值
WfForm.changeFieldValue("field32517_"+rowIndex, {value:""});
}
}
});
}
}
function checkMain2(rowIndex,code,date){
if(code&&date){
$.ajax({
type:"post",
url:"/api/workflow/aixinspan/rate",
data:{"code":code,"date":date},
dataType:"json",
success:function(req){
// console.log("------------ajax---------------")
// console.log(req.code)
if(req.code==1){
//给字段赋值
WfForm.changeFieldValue("field32536_"+rowIndex, {value:req.data});
}else{
window.top.Dialog.alert(req.msg)
//给字段赋值
WfForm.changeFieldValue("field32536_"+rowIndex, {value:""});
}
}
});
}
}
});