king
2023-05-18 e9e8b1c7b481415714fff9a0d83099fd5a7d6ff0
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -144,7 +144,7 @@
      if (data.length > 0) {
        data.forEach(item => {
          let s = item[btn.controlField] !== undefined ? item[btn.controlField] + '' : ''
          if (btn.controlVals.includes(s)) {
          if (btn.controlVals.includes(s) || item.$lock) {
            disabled = true
          }
        })
@@ -601,7 +601,7 @@
            param.LText = sql
            param.$callbacksql = callbacksql
          } else {
            param.LText = getSysDefaultSql(btn, setting, '', param, cell, columns, false, this.moduleParams, Utils.getAllSearchOptions, Utils.getAllSearchOptions) // 数据源
            param.LText = getSysDefaultSql(btn, setting, '', param, cell, columns, false, this.moduleParams, Utils.getAllSearchOptions) // 数据源
            if (btn.output) {
              param.key_back_type = 'Y'
            }
@@ -838,7 +838,7 @@
  getSysDeclareSql = (btn, formdata, data, columns, primaryId, BID = '') => {
    let datavars = {}                 // 声明的变量,表单及显示列
    // 需要声明的变量集
    let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'bid']
    let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'mk_deleted', 'bid']
  
    // sql语句
    let _sql = ''
@@ -964,7 +964,7 @@
      _declarefields = ',' + _declarefields
    }
    _sql = `/* 系统生成 */
        Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50),@ModularDetailCode nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@bid nvarchar(50)${_declarefields}
        Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50),@ModularDetailCode nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@mk_deleted int,@bid nvarchar(50)${_declarefields}
      `
  
    let userName = sessionStorage.getItem('User_Name') || ''
@@ -987,7 +987,7 @@
    // 初始化凭证及用户信息字段
    _sql += `
        /* 凭证及用户信息初始化赋值 */
        select @BVoucher='',@FIBVoucherDate='',@FiYear='',@ErrorCode='',@retmsg='',@UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}', @bid='${BID}', @BillCode='', @ModularDetailCode=''
        select @BVoucher='',@FIBVoucherDate='',@FiYear='',@ErrorCode='',@retmsg='',@UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}', @mk_deleted=1, @bid='${BID}', @BillCode='', @ModularDetailCode=''
        `
  
    // 表单变量赋值
@@ -1061,37 +1061,49 @@
      if (params[0].$unCheckParam) {
        this.checkLoopRequest(params, _resolve)
      } else if (btn.preFunc && params.length === 1) {
        let param = params[0]
        let _param = fromJS(param).toJS()
        _param.func = btn.preFunc
        Api.genericInterface(_param).then(res => {
          if (res.status) {
            if (res.ErrCode !== '-1') {
              param = {...param, ...res}
              delete param.status
              delete param.ErrCode
              delete param.ErrMesg
              delete param.message
              setTimeout(() => {
                Api.genericInterface(param).then(result => {
                  if (!result.status) {
                    notification.warning({
                      top: 92,
                      message: result.message,
                      duration: 5
                    })
                  }
                })
              }, 600)
            }
            this.triggerNote(res) // 消息
            this.execSuccess(res)
          } else {
            this.execError(res)
          }
          _resolve()
        }, () => {
          this.updateStatus()
          _resolve()
        })
      } else if (params.length <= 20 && btn.execType !== 'single') {
        let deffers = params.map((param, i) => {
          return new Promise(resolve => {
            setTimeout(() => {
              let _param = null
              if (btn.preFunc) {
                _param = fromJS(param).toJS()
                param.func = btn.preFunc
              }
              Api.genericInterface(param).then(res => {
                if (btn.preFunc && res.status && res.ErrCode !== '-1') {
                  _param = {..._param, ...res}
                  delete _param.status
                  delete _param.ErrCode
                  delete _param.ErrMesg
                  delete _param.message
                  setTimeout(() => {
                    Api.genericInterface(_param).then(result => {
                      if (!result.status) {
                        notification.warning({
                          top: 92,
                          message: result.message,
                          duration: 5
                        })
                      }
                    })
                  }, 600)
                }
                if (res.status) {
                  this.triggerNote(res) // 消息
                }
@@ -1566,36 +1578,8 @@
      loadingNumber: params.length
    })
    let _param = null
    if (btn.preFunc) {
      _param = fromJS(param).toJS()
      param.func = btn.preFunc
    }
    Api.genericInterface(param).then(res => {
      if (res.status) {
        if (btn.preFunc && res.ErrCode !== '-1') {
          _param = {..._param, ...res}
          delete _param.status
          delete _param.ErrCode
          delete _param.ErrMesg
          delete _param.message
          setTimeout(() => {
            Api.genericInterface(_param).then(result => {
              if (!result.status) {
                notification.warning({
                  top: 92,
                  message: result.message,
                  duration: 5
                })
              }
            })
          }, 600)
        }
        this.triggerNote(res) // 消息
        if (params.length === 0) {
@@ -1742,6 +1726,7 @@
  outerOuterRequest = (params, result, record, _resolve) => {
    const { btn } = this.props
    let outParam = JSON.parse(JSON.stringify(result))
    let ver_token = false
    if (btn.outerFunc) {
      result.func = btn.outerFunc
@@ -1780,6 +1765,7 @@
        } else {
          result.$token = btn.exInterface || ''
        }
        ver_token = true
      } else {
        if (window.GLOB.systemType === 'production' && btn.proInterface) {
          result.rduri = btn.proInterface
@@ -1796,6 +1782,10 @@
    Api.genericInterface(result).then(res => {
      if (!res) return // LoginError时中断请求
      if (ver_token && res.ErrMesg === 'token_error') {
        this.execError(res)
        return
      }
      this.outerCallbackRequest(params, res, record, outParam, _resolve)
    }, () => {
      this.outerCallbackRequest(params, {status: false, message: 500, ErrCode: 'E', ErrMesg: 500}, record, outParam, _resolve)
@@ -2135,7 +2125,7 @@
    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
    Api.genericInterface(param).then(res => {
      // res.data = [{openid: 'o2E7gvoSFvQRG7I8_gZxf4y3ONkQ', send_id: '2223333', first: '您的缴费信息如下', keyword1: '010000000001', keyword2: '2022年07月03日', keyword3: '供暖缴费', keyword4: '20元', keyword5: '成功', remark: '感谢您的使用!'}]
      // res.send_data = [{openid: 'o2E7gvoSFvQRG7I8_gZxf4y3ONkQ', send_id: '245dd33344', first: '您的缴费信息如下', p1: '010000000001', p2: '2022年07月03日', p3: '供暖缴费', p4: '20元', p5: '成功', remark: '感谢您的使用!'}]
      if (!res.status) {
        notification.warning({
          top: 92,
@@ -2143,7 +2133,12 @@
          duration: 5
        })
        return
      } else if (!res.send_data || res.send_data.length === 0) {
      }
      let sends = res.send_data || []
      sends = sends.filter(item => !!item.openid)
      if (sends.length === 0) {
        return
      }
@@ -2167,13 +2162,13 @@
      }
      
      verify.wxNoteKeys.forEach(item => {
        _param.data[item.key] = {value: '', color: item.color}
        _param.data[item.key] = {value: '', color: '#000000'}
      })
      let params = res.send_data.map(item => {
      let params = sends.map(item => {
        let m = fromJS(_param).toJS()
        m.touser = item.openid || ''
        m.touser = item.openid
        if (item.bid && m.miniprogram && m.miniprogram.pagepath.indexOf('MenuId') > -1) {
          m.miniprogram.pagepath = m.miniprogram.pagepath + `&BID=${item.bid}`
        }
@@ -2195,8 +2190,6 @@
        if (!res.oa_access_token) return
  
        params.forEach(n => {
          if (!n.touser) return
          Api.wxNginxRequest(`cgi-bin/message/template/send?access_token=${res.oa_access_token}`, 'post', n).then(re => {
            if (verify.wxNoteCallback === 'true') {
              let _p = {
@@ -2677,6 +2670,16 @@
        _item.type = 'text'
      } else  if (_item.type === 'date') {
        _item.type = item.declareType === 'nvarchar(50)' ? 'text' : 'date'
      } else if (_item.type === 'switch' || _item.type === 'check') {
        if (_readin) {
          _item.value = _item.value === item.openVal ? item.openVal : item.closeVal
        } else {
          if (item.initval === true) {
            _item.value = item.openVal
          } else {
            _item.value = item.closeVal
          }
        }
      } else if (_item.type === 'rate') {
        let count = item.rateCount || 5
        _item.value = parseInt(_item.value)