Commit e9cb8c77 by fukai

支持SEQ可选输入

parent f622cba3
import {RegMap} from './TagRegMap'
export function TagV(tag,status,value,tno,mty,t111)
export function isTagValueEmpty(tag,tagValue)
{
let obj = tagValue[0]
let regobj = RegMap[tag]
for(let key in regobj)
{
if(obj[key])
return false
}
return true
}
export function TagV(tag,status,value,tno,mty,t111,seqlist,countMap={})
{
let regobj = RegMap[tag]
let obj = value[0]
let mval = value[1]
//计算状态 status,是否是必填的,要参考所在序列是否是必填,上一层序列计数,来决定当前序列是否必填
if(seqlist && seqlist.length && status == 'M' && isTagValueEmpty(tag,value))
{
let curseq = seqlist[seqlist.length - 1]
let curcnt = countMap[curseq.seqlist] || 0
if(curseq.status == 'O' && curcnt==0)
{
status = 'O'
}
else if(curseq.status == 'M' && curcnt==0)
{
//验证上层是否有计数为O,且上层计数
for(let i = seqlist.length - 2 ; i >=0;i--)
{
let itemseq = seqlist[i]
let itemcnt = countMap[itemseq.seqlist] || 0
if(itemcnt>0)
break
if(itemseq.status == 'O' && itemcnt == 0)
status = 'O'
}
}
}
let errmsg = null
if(value.length == 3)
errmsg = value[2] || {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment