king
2023-12-19 d38c9a99dc9d9450200a6d9e64876d164242177b
src/templates/zshare/verifycard/index.jsx
@@ -18,7 +18,7 @@
import BillcodeForm from './billcodeform'
import VoucherForm from './voucherform'
import asyncComponent from '@/utils/asyncComponent'
import { updateForm } from '@/utils/utils-update.js'
// import { updateForm } from '@/utils/utils-update.js'
import MKEmitter from '@/utils/events.js'
import './index.scss'
@@ -530,6 +530,7 @@
            }>
              <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span>
            </Popconfirm>
            {/* <span className="operation-btn" title="SQL" onClick={() => this.orderSql(record)} style={{color: '#1890ff'}}><ConsoleSqlOutlined /></span> */}
          </div>)
      }
    ]
@@ -657,37 +658,37 @@
      } else if (card.modal && (card.OpenType === 'pop' || !card.OpenType)) {
        _fields = card.modal.fields || []
        resolve(_fields)
      } else if (card.OpenType === 'pop') {
        Api.getCloudConfig({
          func: 'sPC_Get_LongParam',
          MenuID: card.uuid
        }).then(res => {
          if (res.status) {
            let _LongParam = ''
            if (res.LongParam) {
              try {
                _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam)))
              } catch (e) {
                console.warn('Parse Failure')
                _LongParam = ''
              }
            }
      // } else if (card.OpenType === 'pop') {
      //   Api.getCloudConfig({
      //     func: 'sPC_Get_LongParam',
      //     MenuID: card.uuid
      //   }).then(res => {
      //     if (res.status) {
      //       let _LongParam = ''
      //       if (res.LongParam) {
      //         try {
      //           _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam)))
      //         } catch (e) {
      //           console.warn('Parse Failure')
      //           _LongParam = ''
      //         }
      //       }
            
            if (!_LongParam) {
              message.warning('未获取到表单信息,部分验证将无法设置!')
            } else {
              _LongParam = updateForm(_LongParam)
              _fields = _LongParam.fields || []
            }
          } else {
            notification.warning({
              top: 92,
              message: res.message,
              duration: 5
            })
          }
          resolve(_fields)
        })
      //       if (!_LongParam) {
      //         message.warning('未获取到表单信息,部分验证将无法设置!')
      //       } else {
      //         _LongParam = updateForm(_LongParam)
      //         _fields = _LongParam.fields || []
      //       }
      //     } else {
      //       notification.warning({
      //         top: 92,
      //         message: res.message,
      //         duration: 5
      //       })
      //     }
      //     resolve(_fields)
      //   })
      } else {
        resolve(_fields)
      }
@@ -1134,6 +1135,51 @@
    })
  }
  // orderSql = (record) => {
  //   let _ModularDetailCode = ''
  //   let _lpline = ''
  //   if (record.TypeCharOne === 'Lp') {
  //     if (record.linkField.toLowerCase() === 'bid') {
  //       _lpline = `set @ModularDetailCode= 'Lp'+ right('${record.mark || this.props.card.uuid}'+@BID@,48)`
  //     } else {
  //       _lpline = `set @ModularDetailCode= 'Lp'+ right('${record.mark || this.props.card.uuid}'+@${record.linkField.toLowerCase()},48)`
  //     }
  //     _ModularDetailCode = '@ModularDetailCode'
  //   } else if (record.TypeCharOne === 'BN') {
  //     _ModularDetailCode = `'${record.TypeCharOne}'`
  //   } else {
  //     _ModularDetailCode = `'${record.ModularDetailCode}'`
  //   }
  //   let sql = `select @BillCode='', @${record.field}='', @ModularDetailCode=''
  //   ${_lpline}
  //   exec s_get_BillCode
  //     @ModularDetailCode=${_ModularDetailCode},
  //     @Type=${record.Type},
  //     @TypeCharOne='${record.TypeCharOne}',
  //     @TypeCharTwo ='${record.TypeCharTwo}',
  //     @BillCode =@BillCode output,
  //     @ErrorCode =@ErrorCode output,
  //     @retmsg=@retmsg output
  //   if @ErrorCode!=''
  //     goto aaa
  //   set @${record.field}=@BillCode`
  //   Modal.info({
  //     title: '',
  //     width: 500,
  //     icon: null,
  //     content: sql.split(/\n\s{4}/ig).map((n, index) => <div key={index} dangerouslySetInnerHTML={{ __html: n.replace(/\s/ig, '&nbsp;') }} style={{whiteSpace: 'nowrap'}}></div>)
  //   })
  //   // let oInput = document.createElement('input')
  //   // oInput.value = sql
  //   // document.body.appendChild(oInput)
  //   // oInput.select()
  //   // document.execCommand('Copy')
  //   // document.body.removeChild(oInput)
  //   // message.success('复制成功。')
  // }
  uniqueChange = (values) => {
    let verify = fromJS(this.state.verify).toJS()