The detailed list field of the oa process form of the PWC makes another field mandatory through text input

//明细表字段通过文本输入内容使另外一个字段必填
jQuery("#detailDiv_0").delegate("input[id^='field10247_']", "change", function(){
    
    //浏览按钮字段联动的单号文本字段
		var num = jQuery(this).parents('tr[_target="datarow"]').eq(0).find('span[name="detailIndexSpan0"]').html();//获取序号
        var indexnum0 = num-1;//下标号
        var _thisValue = this.value;//当前操作字段的值
		var xmcbzx= jQuery(field10486).val();//数据库查询的值,字段属性赋值	doFieldSQL(" select B.cbzx from uf_ProjectInformat A,uf_dlx_cbzx B where A.cbzx=B.id and A.cbzx>'0' group by B.cbzx ")			
		if(xmcbzx.indexOf(_thisValue)>0){
    
    //判断数据库查询的字符串是否包含当前操作字段的值
			console.log(_thisValue + "zz" + xmcbzx);
			setFieldReadOnly('10485_'+indexnum0,false,2)//字段必填
		}		
		jQuery('#field10485_'+indexnum0).val("");//清空必填字段的值
		jQuery('#field10485_'+indexnum0+'span a:first-child').remove();//清空必填字段页面的值
	})
//明细表浏览按钮字段联动另外一个字段
jQuery("#detailDiv_0").delegate("input[id^='field10235_']", "change", function(){
    
    //浏览按钮字段联动的单号文本字段	    
		var num = jQuery(this).parents('tr[_target="datarow"]').eq(0).find('span[name="detailIndexSpan0"]').html();//获取序号
        var indexnum0=num-1;下标号
		var xmdd=jQuery('#field10235_'+indexnum0).val();//浏览按钮
		if(xmdd.length>'0'){
    
    
		jQuery('#field10237_'+indexnum0).val(1);
		}
		else{
    
    
			jQuery('#field10237_'+indexnum0).val(0);
		}
	})

Please leave a message in the comment area and discuss together~~~

If necessary, please contact WeChat: hdygzh2019 At the same time, please explain your intention and make progress together! ! !

Guess you like

Origin blog.csdn.net/Y_6155/article/details/109017961