king
2023-08-10 ac1d52c46ff9019fcc93cf3d5e7ab17cf850824e
src/utils/utils.js
@@ -216,12 +216,6 @@
  //   value = window.atob(value)
  //   value = value.replace('minKe', '')
  //   value = window.decodeURIComponent(window.atob(value))
  //   // 外联数据库替换
  //   if (window.GLOB.externalDatabase !== null && window.GLOB.externalDatabase) {
  //     value = value.replace(window.GLOB.externalDatabase, '@db@')
  //   }
  //   value = value.replace(/ mpercent /ig, '%')
    
  //   // 替换关键字
@@ -230,7 +224,7 @@
  //     value = value.replace(reg, ' ' + item.key + ' ')
  //   })
  //   // value = value.replace(/\n/ig, ' \n ')
  //   value = value.replace(/ \n /ig, '\n')
  //   return value
  // }
@@ -341,6 +335,8 @@
          item.initval = [moment().startOf('week').format(format), moment().endOf('week').format(format)].join(',')
        } else if (item.initval === 'month') {
          item.initval = [moment().startOf('month').format(format), moment().endOf('month').format(format)].join(',')
        } else if (item.initval === 'lastMonth') {
          item.initval = [moment().subtract(1, 'months').startOf('month').format(format), moment().subtract(1, 'months').endOf('month').format(format)].join(',')
        } else if (item.initval) {
          try {
            let _initval = JSON.parse(item.initval)
@@ -902,11 +898,6 @@
  let address = sessionStorage.getItem('address') || ''
  let _sheet = item.sheet
  if (sessionStorage.getItem('isEditState') === 'true') {
    userName = sessionStorage.getItem('CloudUserName') || ''
    fullName = sessionStorage.getItem('CloudFullName') || ''
  }
  if (window.GLOB.externalDatabase !== null) {
    _sheet = _sheet.replace(/@db@/ig, window.GLOB.externalDatabase)
  }
@@ -992,7 +983,7 @@
          val = val.replace(/'/ig, '"')
        }
        val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
        val = val.replace(/(^\s+$)|\t+|\v+/ig, '')
        if (!val && col.required === 'true') {            // 必填校验
          errors.push(_position + '内容不可为空')
@@ -1027,7 +1018,7 @@
            val = moment('19000101', 'YYYYMMDD').add(Math.floor(val - 2), 'days').format('YYYY-MM-DD')
          }
        } else if (typeof(val) === 'string') {
          val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
          val = val.replace(/(^\s+$)|\t+|\v+/ig, '')
          if (!val && col.required === 'true') {           // 时间必填校验
            errors.push(_position + '内容不可为空')
          } else if (val && !/^[1-9][0-9]{3}/.test(val)) { // 时间正则校验
@@ -1211,11 +1202,6 @@
  let _sheet = btn.sheet
  let BID = data[0].$$BID || ''
  if (sessionStorage.getItem('isEditState') === 'true') {
    userName = sessionStorage.getItem('CloudUserName') || ''
    fullName = sessionStorage.getItem('CloudFullName') || ''
  }
  if (window.GLOB.externalDatabase !== null) {
    _sheet = _sheet.replace(/@db@/ig, window.GLOB.externalDatabase)
@@ -1603,11 +1589,6 @@
  let city = sessionStorage.getItem('city') || ''
  let district = sessionStorage.getItem('district') || ''
  let address = sessionStorage.getItem('address') || ''
  if (sessionStorage.getItem('isEditState') === 'true') {
    userName = sessionStorage.getItem('CloudUserName') || ''
    fullName = sessionStorage.getItem('CloudFullName') || ''
  }
  // 初始化凭证及用户信息字段
  _sql += `