当前位置:网站首页>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”
}
边栏推荐
- 通过客户经理的开户链接开股票账户安全吗?
- Learning to Measure Changes: Fully Convolutional Siamese Metric Networks for Scene Change Detection
- (1) Introduction
- Basic syntax and common commands of R language
- [paper notes] contextual transformer networks for visual recognition
- Software packaging and deployment
- How to download and install Weka package
- Several relationships of UML
- Data preprocessing - normalization and standardization
- Markdown learning
猜你喜欢

Brief object memory layout
![[paper notes] overview of case segmentation](/img/93/57ad42e0c058b7d5fd1b4066678707.jpg)
[paper notes] overview of case segmentation

Why do I need message idempotence?
![[paper notes] rethinking and improving relative position encoding for vision transformer](/img/6b/8b1c192e0ce715789465fa9ccaabfc.jpg)
[paper notes] rethinking and improving relative position encoding for vision transformer
How to convert a recorded DOM to a video file

CPU over high diagnosis and troubleshooting
![[paper notes] mcunetv2: memory efficient patch based influence for tiny deep learning](/img/4b/f446bd37057237c0ba4c7b4e38e74f.jpg)
[paper notes] mcunetv2: memory efficient patch based influence for tiny deep learning

Agent and classloader

How to download and install Weka package

MySQL performance optimization - index optimization
随机推荐
QT article outline
解决Visio和office365安装兼容问题
程序员 VS 黑客的思维 | 每日趣闻
剑指 Offer 04. 二维数组中的查找
[paper notes] rethinking and improving relative position encoding for vision transformer
Simulating Sir disease transmission model with netlogo
剑指 Offer 03. 数组中重复的数字
Statistical analysis - data level description of descriptive statistics
Yolov4 coco pre train Darknet weight file
在打新债开户证券安全吗,需要什么准备
在国信金太阳开股票账户安全吗?
0703 interface automation - MySQL database connection, encapsulation, adding database verification in use cases
[paper notes] poly yolo: higher speed, more precise detection and instance segmentation for yolov3
[C language] implementation of magic square array (the most complete)
Kali SSH Remote Login
MySQL transaction characteristics and implementation principle
Summary of four parameter adjustment methods for machine learning
Work of the first week
Es data synchronization mode
Sword finger offer 07 Rebuild binary tree