当前位置:网站首页>Traversal and branch judgment of JS (case on June 24, 2022)
Traversal and branch judgment of JS (case on June 24, 2022)
2022-06-25 15:40:00 【Fairy-KunKun】
/*
Time :2022 year 6 month 24 Japan
author :FairyKunKun
*/
var gridData = s_detail1Obj.getData ();
var sum3 = 0;//sum3 It is used to record that the document number starts with 3 The total number of the order No
var sum4 = 0;//sum4 It is used to record that the document number starts with 4 The total number of the order No
if ( gridData.length > 0 ) { // Traverse all data and count all forms 3、4 Total at the beginning
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 ) { // If only the form starts with 3 Of
document.getElementById ( "sptj001" ).value = "3";
// Assign a value to the target table box “3”
} else if ( sum4 > 0 && sum3 === 0 ) { // If only the form starts with 4 Of
document.getElementById ( "sptj001" ).value = "4";
// Assign a value to the target table box “4”
} else {
document.getElementById ( "sptj001" ).value = "5";
// In other cases “5”
}
边栏推荐
- 通俗讲跨域
- Globally unique key generation strategy - implementation principle of the sender
- [golang] leetcode intermediate - find the first and last position of an element in a sorted array & Merge interval
- Is Guoxin golden sun reliable? Is it legal? Is it safe to open a stock account?
- [paper notes] overview of case segmentation
- Pytorch distributed test pit summary
- [paper notes] street view change detection with deconvolutional networks
- How to convert a recorded DOM to a video file
- 剑指 Offer 03. 数组中重复的数字
- Go language modifies / removes multiple line breaks in strings
猜你喜欢

Agent and classloader

Several common optimization methods

Several relationships of UML

Sword finger offer 06 Print linked list from end to end
Cloning and importing DOM nodes

Brief object memory layout

Globally unique key generation strategy - implementation principle of the sender

Differences and solutions of redis cache avalanche, cache penetration and cache breakdown

Image segmentation based on deep learning: network structure design

剑指 Offer 03. 数组中重复的数字
随机推荐
google_ Breakpad crash detection
到底要不要去外包公司?这篇带你全面了解外包那些坑!
appium服务的启动与关闭踩坑记录
Arthas, a sharp tool for online diagnosis - several important commands
JSON module dictionary and string conversion
Client development (electron) system level API usage 2
Yolov5 Lite: fewer parameters, higher accuracy and faster detection speed
Solve valueerror: invalid literal for int() with base 10
Paddlepaddle paper reproduction course biggan learning experience
Afterword of Parl intensive learning 7-day punch in camp
股票开户用什么app最安全?知道的给说一下吧
Generic - learning notes
解决Visio和office365安装兼容问题
Source code analysis of nine routing strategies for distributed task scheduling platform XXL job
什么是oa
Desktop development (Tauri) opens the first chapter
剑指 Offer 07. 重建二叉树
Is it safe to open an account for new bonds? What preparations are needed
JS的遍历和分支判断(2022年6月24日案例)
Kali modify IP address