当前位置:网站首页>JS的遍历和分支判断(2022年6月24日案例)
JS的遍历和分支判断(2022年6月24日案例)
2022-06-25 15:32:00 【Fairy-KunKun】
/*
时间:2022年6月24日
作者:FairyKunKun
*/
var gridData = s_detail1Obj.getData ();
var sum3 = 0;//sum3用来记录单号开头是3的单号的总数
var sum4 = 0;//sum4用来记录单号开头是4的单号的总数
if ( gridData.length > 0 ) { //遍历所有的数据统计所有表单的3、4开头的总数
for ( i = 0 ; i < gridData.length ; i ++ ) {
if ( gridData[ i ].inbb001.substr ( 0 , 1 ) == "3" ) {
//alert(gridData[i].inbb001.substr(0,1));
sum3 ++;
} else {
//alert(gridData[i].inbb001.substr(0,1));
sum4 ++;
}
}
}
if ( sum3 > 0 && sum4 === 0 ) { //如果只有表单开头是3的
document.getElementById ( "sptj001" ).value = "3";
//给目标表框赋值“3”
} else if ( sum4 > 0 && sum3 === 0 ) { //如果只有表单开头是4的
document.getElementById ( "sptj001" ).value = "4";
//给目标表框赋值“4”
} else {
document.getElementById ( "sptj001" ).value = "5";
//其他情况赋值“5”
}
边栏推荐
- [paper notes] semi supervised object detection (ssod)
- Detailed description of crontab command format and summary of common writing methods
- Differences and solutions of redis cache avalanche, cache penetration and cache breakdown
- golang reverse a slice
- Generic - learning notes
- GDB debugging
- 基于深度Q学习的雅达利打砖块游戏博弈
- Kali SSH Remote Login
- Go language template text/template error unexpected EOF
- Talk about the creation process of JVM objects
猜你喜欢

剑指 Offer 10- I. 斐波那契数列

Install Kali extension 1: (kali resolution problem)
![[paper notes] semi supervised object detection (ssod)](/img/18/9fba70e6e4329722d9c6ad51d15724.jpg)
[paper notes] semi supervised object detection (ssod)

CPU over high diagnosis and troubleshooting

QT source code online view

Several relationships of UML

Esp8266 building smart home system

Solution of push code failure in idea

Learning C language today is the first time to learn C language. In college, C linguistics is not good, but I want to make progress, so I found a beep video on the Internet to learn C language

基于深度Q学习的雅达利打砖块游戏博弈
随机推荐
Arthas, a sharp tool for online diagnosis - several important commands
程序员 VS 黑客的思维 | 每日趣闻
Work of the first week
Highly concurrent optimized Lua + openresty+redis +mysql (multi-level cache implementation) + current limit +canal synchronization solution
Semaphore function
Detailed description of crontab command format and summary of common writing methods
Yolov5 Lite: fewer parameters, higher accuracy and faster detection speed
Solve the go project compilation error go mod: no such file or directory
Joseph Ring - formula method (recursive formula)
Reflection - learning notes
到底要不要去外包公司?这篇带你全面了解外包那些坑!
Markdown learning
MySQL modifier l'instruction de champ
Error com mysql. cj. jdbc. exceptions. Communicationsexception: solutions to communications link failure
(1) Introduction
通过客户经理的开户链接开股票账户安全吗?
[paper notes] contextual transformer networks for visual recognition
Differences and solutions of redis cache avalanche, cache penetration and cache breakdown
Kali SSH Remote Login
CPU over high diagnosis and troubleshooting