king
2021-04-07 f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2
src/templates/zshare/verifycard/index.jsx
@@ -6,7 +6,7 @@
import Api from '@/api'
import Utils from '@/utils/utils.js'
import options from '@/store/options.js'
import UniqueForm from './uniqueform'
import ContrastForm from './contrastform'
import CustomForm from './customform'
@@ -15,6 +15,7 @@
import BillcodeForm from './billcodeform'
import VoucherForm from './voucherform'
import asyncComponent from '@/utils/asyncComponent'
import { updateForm } from '@/utils/utils-update.js'
import './index.scss'
const { TabPane } = Tabs
@@ -473,11 +474,11 @@
          if (record.TypeCharOne === 'n') {
            _text = record.ModularDetailCode + Array(_type).join('0') + '1'
          } else if (record.TypeCharOne === 'Y') {
            _text = record.ModularDetailCode + moment().format('YYYYMMDD') + Array(_type).join('0') + '1'
            _text = record.ModularDetailCode + moment().format('YYMMDD') + Array(_type).join('0') + '1'
          } else if (record.TypeCharOne === 'Lp') {
            _text = Array(_type).join('0') + '10'
          } else if (record.TypeCharOne === 'BN') {
            _text = moment().format('YYYYMMDD') + Array(_type).join('0') + '1'
            _text = moment().format('YYMMDD') + Array(_type).join('0') + '1'
          }
          return _text
        }
@@ -571,13 +572,7 @@
        })
        resolve(_fields)
      } else if (card.modal) {
        if (card.modal.groups && card.modal.groups.length > 0) {
          card.modal.groups.forEach(group => {
            _fields.push(...group.sublist)
          })
        } else {
          _fields = card.modal.fields || []
        }
        resolve(_fields)
      } else if (card.OpenType === 'pop') {
        Api.getSystemConfig({
@@ -598,13 +593,8 @@
            if (!_LongParam) {
              message.warning('未获取到表单信息,部分验证将无法设置!')
            } else {
              if (_LongParam.groups.length > 0) {
                _LongParam.groups.forEach(group => {
                  _fields.push(...group.sublist)
                })
              } else {
              _LongParam = updateForm(_LongParam)
                _fields = _LongParam.fields || []
              }
            }
          } else {
            notification.warning({
@@ -619,9 +609,9 @@
        resolve(_fields)
      }
    }).then(_fields => {
      let _usefulfields = ['BID', 'ID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'UserName', 'FullName', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'ModularDetailCode']
      let _declare = ['@UserName nvarchar(50)', '@FullName nvarchar(50)', '@ErrorCode nvarchar(50)', '@retmsg nvarchar(4000)', '@BillCode nvarchar(50)', '@BVoucher nvarchar(50)', '@FIBVoucherDate nvarchar(50)', '@FiYear nvarchar(50)', '@ModularDetailCode nvarchar(50)']
      let _select = ['@UserName=\'\'', '@FullName=\'\'', '@ErrorCode=\'\'', '@retmsg=\'\'', '@BillCode=\'\'', '@BVoucher=\'\'', '@FIBVoucherDate=\'\'', '@FiYear=\'\'', '@ModularDetailCode=\'\'']
      let _usefulfields = ['BID', 'ID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'UserName', 'FullName', 'login_city', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'ModularDetailCode']
      let _declare = ['@UserName nvarchar(50)', '@FullName nvarchar(50)', '@login_city nvarchar(50)', '@ErrorCode nvarchar(50)', '@retmsg nvarchar(4000)', '@BillCode nvarchar(50)', '@BVoucher nvarchar(50)', '@FIBVoucherDate nvarchar(50)', '@FiYear nvarchar(50)', '@ModularDetailCode nvarchar(50)']
      let _select = ['@UserName=\'\'', '@FullName=\'\'', '@login_city=\'\'', '@ErrorCode=\'\'', '@retmsg=\'\'', '@BillCode=\'\'', '@BVoucher=\'\'', '@FIBVoucherDate=\'\'', '@FiYear=\'\'', '@ModularDetailCode=\'\'']
      let fieldArr = _usefulfields.map(_f => _f.toLowerCase())
      let hasBid = false
@@ -916,7 +906,7 @@
      {
        obj_name: 'modularDetail',
        arr_field: 'ModularDetailCode,CodeName,BID,Type',
        LText: window.btoa(window.encodeURIComponent(`select distinct ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,ModularCode as BID,Type from sModularDetail where Appkey= @Appkey@ and deleted=0 order by ModularDetailCode`))
        LText: window.btoa(window.encodeURIComponent(`select distinct ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,ModularCode as BID,Type from sModularDetail where Appkey= @Appkey@ and deleted=0 order by ModularDetailCode desc`))
      },
      {
        obj_name: 'voucher',
@@ -931,7 +921,7 @@
          select distinct a.ModularDetailCode,a.ModularDetailCode+ModularDetailName as CodeName,ModularCode as BID, VoucherTypeTwo, IDefine1 
          from (select * from sModularDetail where Deleted=0 and VoucherTypeTwo!='' and Appkey='') a
          left join (select distinct ModularDetailCode from sModularDetail where Deleted=0 and VoucherTypeTwo!='' 
          and Appkey=@Appkey@) m on a.ModularDetailCode=m.ModularDetailCode where m.ModularDetailCode is null order by ModularDetailCode`
          and Appkey=@Appkey@) m on a.ModularDetailCode=m.ModularDetailCode where m.ModularDetailCode is null order by ModularDetailCode desc`
        ))
      },
      {
@@ -961,7 +951,13 @@
    mutilparam.secretkey = Utils.encrypt(mutilparam.LText, mutilparam.timestamp)
    mutilparam.open_key = Utils.encryptOpenKey(mutilparam.secretkey, mutilparam.timestamp)
    Api.getCloudCacheConfig(mutilparam).then(res => {
    if (options.cloudServiceApi) { // 云端请求
      mutilparam.rduri = options.cloudServiceApi
      mutilparam.userid = sessionStorage.getItem('CloudUserID') || ''
      mutilparam.LoginUID = sessionStorage.getItem('CloudLoginUID') || ''
    }
    Api.getSystemCacheConfig(mutilparam).then(res => {
      if (res.status) {
        this.setState({
          orderModular: res.modular,
@@ -1321,19 +1317,17 @@
        return
      }
      let _loading = false
      let msg = ''
      if (this.customForm && this.customForm.state.editItem) {
        _loading = true
        msg = '自定义验证'
      } else if (this.customForm && this.customForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.customForm.props.form.getFieldValue('sql'))) {
        msg = '自定义验证'
      } else if (this.orderForm && this.orderForm.state.editItem) {
        _loading = true
        msg = '单号生成'
      } else if (this.scriptsForm && this.scriptsForm.state.editItem) {
        _loading = true
      }
      if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && this.scriptsForm.props.form.getFieldValue('sql') !== ' ') {
        _loading = true
      } else if (this.customForm && this.customForm.props.form.getFieldValue('sql') && this.customForm.props.form.getFieldValue('sql') !== ' ') {
        _loading = true
        msg = '自定义脚本'
      } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) {
        msg = '自定义脚本'
      }
      if (verify.noteEnable === 'true' && !verify.noteCode) { // 开启短信时,需要模板编码
@@ -1342,9 +1336,9 @@
        verify.noteCode = ''
      }
      if (_loading) {
      if (msg) {
        confirm({
          content: `存在未保存项,确定提交吗?`,
          content: msg + '未保存,确定提交吗?',
          onOk() {
            resolve(verify)
          },