king
2025-02-06 d1cd5af5adb53e91efdd278328e1b6f8ad834fb5
src/templates/zshare/verifycard/index.jsx
@@ -746,6 +746,10 @@
        _f.writein = _f.writein !== 'false'
        _f.fieldlen = _f.fieldlength || 50
        if (_f.type === 'linkMain' && _f.verifyVal === 'true') {
          _f.$verify = true
        }
        if (_f.type === 'datemonth') {
          _f.type = 'text'
        } else if (_f.type === 'number' || _f.type === 'rate') {
@@ -848,13 +852,19 @@
      colfields: colfields.join(', '),
      uniqueColumns: this.state.uniqueColumns.map(col => {
        if (col.dataIndex === 'field') {
          col.options = unionFields
          col.options = fromJS(unionFields).toJS().map(n => {
            n.label = `${n.label}(${n.field})`
            return n
          })
        }
        return col
      }),
      onceUniqueColumns: this.state.onceUniqueColumns.map(col => {
        if (col.dataIndex === 'field') {
          col.options = _columns
          col.options = fromJS(_columns).toJS().map(n => {
            n.label = `${n.label}(${n.field})`
            return n
          })
        }
        return col
      }),
@@ -1034,8 +1044,19 @@
    formdata = formdata.length ? formdata : null
    let verifyValSql = ''
    // 获取字段键值对
    formdata && formdata.forEach(form => {
      if (form.$verify) {
        verifyValSql += `
        if @${form.field}=${form.type === 'number' ? 0 : `''`}
        begin
          select @errorcode='E',@retmsg='${form.label},关联主表失效'
          goto aaa
        end
        `
      }
      let _key = form.field.toLowerCase()
      if (!_initvars.includes(_key)) {
        _initvars.push(_key)
@@ -1287,22 +1308,21 @@
  
      verify.billcodes.forEach(item => {
        let _key = item.field.toLowerCase()
        let _linkKey = item.linkField ? item.linkField.toLowerCase() : ''
  
        if (!keys.includes(_key)) return // 表单中不含单号生成字段
  
        let _lpline = ''
        if (item.TypeCharOne === 'Lp') {
          if (_linkKey === 'bid' && BID) { // 替换bid
          if (/^BID$/ig.test(item.linkField)) {
            _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@BID@,48)`
          } else {
            _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${_linkKey},48)`
            _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${item.linkField},48)`
          }
        } else if (item.TypeCharOne === 'BN') {
          if (_linkKey === 'bid' && BID) { // 替换bid
          if (/^BID$/ig.test(item.linkField)) {
            _lpline = `set @ModularDetailCode= 'BN'+ right(@BID@,48)`
          } else {
            _lpline = `set @ModularDetailCode= 'BN'+ right(@${_linkKey},48)`
            _lpline = `set @ModularDetailCode= 'BN'+ right(@${item.linkField},48)`
          }
        } else {
          _lpline = `set @ModularDetailCode= right('${item.ModularDetailCode}',50)`
@@ -1423,15 +1443,20 @@
    let hasvoucher = false
  
    // 凭证-显示列中选取,必须选行
    if (verify.voucher && verify.voucher.enabled && btn.Ot !== 'requiredOnce') {
    if (verify.voucher && verify.voucher.enabled) {
      let _voucher = verify.voucher
      let linkField = `@${_voucher.linkField}`
      if (/^BID$/ig.test(_voucher.linkField)) {
        linkField = `'${BID}'`
      }
  
      hasvoucher = true
  
      _sql += `
        /* 创建凭证 */
        exec s_BVoucher_Create
          @Bill = @${_voucher.linkField},
          @Bill = ${linkField},
          @BVoucherType ='${_voucher.BVoucherType}',
          @VoucherTypeOne ='${_voucher.VoucherTypeOne}',
          @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}',
@@ -1695,6 +1720,10 @@
      _sql += _backCustomScript
    }
  
    if (verifyValSql) {
      _sql += verifyValSql
    }
    if (btn.procMode === 'system') {
      _sql += `
        aaa: if @ErrorCode!=''
@@ -1904,7 +1933,7 @@
      let hasvoucher = false
  
      // 凭证-显示列中选取,必须选行
      if (verify.voucher && verify.voucher.enabled && btn.Ot !== 'requiredOnce') {
      if (verify.voucher && verify.voucher.enabled) {
        hasvoucher = true
      }
      if (hasvoucher) {
@@ -1998,7 +2027,8 @@
      _lpline = `set @ModularDetailCode= right('${record.ModularDetailCode}',50)`
    }
    let sql = `select @BillCode='', @${record.field}='', @ModularDetailCode=''
    let sql = `Declare @BillCode nvarchar(50),@ModularDetailCode nvarchar(50)
    select @BillCode='', @${record.field}='', @ModularDetailCode=''
    ${_lpline}
    exec s_get_BillCode
      @ModularDetailCode=@ModularDetailCode,
@@ -2682,14 +2712,14 @@
            <EditTable actions={['edit', 'move', 'del', 'status', 'sql']} data={verify.uniques} columns={card.Ot !== 'requiredOnce' ? uniqueColumns : onceUniqueColumns} onChange={this.changeUniques}/>
          </TabPane> : null}
          {verifyInter === 'system' ? <TabPane tab={
            <span title={card.Ot === 'requiredOnce' ? '多行拼接时不可用' : ''}>
            <span>
              创建凭证
              {verify.voucher && verify.voucher.enabled ? <span className="count-tip">1</span> : null}
            </span>
          } key="voucher" disabled={card.Ot === 'requiredOnce'}>
          } key="voucher">
            <VoucherForm
              voucher={voucher}
              columns={columns}
              columns={unionFields}
              voucherobj={verify.voucher}
              voucherDetail={voucherDetail}
              voucherChange={this.voucherChange}