king
2024-06-21 2bccb9ec7bdefe23292a22bc153463cfa1479a49
src/tabviews/zshare/actionList/funcbutton/index.jsx
@@ -23,6 +23,7 @@
    loading: false,
    disabled: false,
    hidden: false,
    dict: window.GLOB.dict
  }
  UNSAFE_componentWillMount () {
@@ -102,7 +103,7 @@
   */
  actionTrigger = (triggerId, record, type, lid) => {
    const { btn, BID, selectedData, LID } = this.props
    const { loading } = this.state
    const { loading, dict } = this.state
    if (loading) return
    if (triggerId && btn.uuid !== triggerId) return
@@ -112,14 +113,14 @@
    let error = ''
    if (btn.funcType === 'shareLink' && window.GLOB.systemType === 'production' && !btn.shareProUrl) {
      error = '尚未设置正式系统链接地址!'
      error = dict['no_prod_link'] || '尚未设置正式系统链接地址!'
    } else if (btn.funcType === 'refund') {
      if (data.length === 0) {
        error = '请选择行!'
        error = dict['select_row'] || '请选择行!'
      } else if (data.length !== 1) {
        error = '请选择单行数据!'
        error = dict['select_single_row'] || '请选择单行数据!'
      } else if (!data[0].$$uuid) {
        error = '未获取到订单编号!'
        error = dict['no_ordercode'] || '未获取到订单编号!'
      }
    }
@@ -160,7 +161,9 @@
      const that = this
      confirm({
        title: btn.tipTitle || '确定要执行吗?',
        title: btn.tipTitle || dict['exec_sure'] || '确定要执行吗?',
        okText: dict['ok'] || '确定',
        cancelText: dict['cancel'] || '取消',
        onOk() {
          that.execRefund(orderId)
        },
@@ -172,7 +175,7 @@
  execRefund = (orderId) => {
    Api.setRefund(orderId).then(res => {
      if (!res.status) {
        this.execError({ErrCode: 'E', message: '执行失败!', ...res})
        this.execError({ErrCode: 'E', message: window.GLOB.dict['exc_fail'] || '执行失败!', ...res})
      } else {
        this.execSuccess({ErrCode: 'S', ...res})
      }
@@ -243,22 +246,24 @@
        title: btn.shareTip
      })
    } else {
      message.success('已复制到剪切板。')
      message.success(window.GLOB.dict['copied'] || '已复制到剪切板。')
    }
  }
  execSuccess = (res = {}) => {
    const { btn } = this.props
    const { dict } = this.state
    if (res.ErrCode === 'S' || !res.ErrCode) { // 执行成功
      notification.success({
        top: 92,
        message: res.message || '执行成功!',
        message: res.message || dict['exc_success'] || '执行成功!',
        duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2
      })
    } else if (res.ErrCode === 'Y') { // 执行成功
      Modal.success({
        title: res.message || '执行成功!'
        title: res.message || dict['exc_success'] || '执行成功!',
        okText: dict['got_it'] || '知道了'
      })
    } else if (res.ErrCode === '-1') { // 完成后不提示
@@ -275,6 +280,7 @@
  execError = (res) => {
    const { btn } = this.props
    const { dict } = this.state
    if (!['LoginError', 'C', '-2', 'E', 'N', 'F', 'NM'].includes(res.ErrCode)) {
      res.ErrCode = 'E'
@@ -282,23 +288,24 @@
    if (res.ErrCode === 'E') {
      Modal.error({
        title: res.message || '执行失败!',
        title: res.message || dict['exc_fail'] || '执行失败!',
        okText: dict['got_it'] || '知道了'
      })
    } else if (res.ErrCode === 'N') {
      notification.error({
        top: 92,
        message: res.message || '执行失败!',
        message: res.message || dict['exc_fail'] || '执行失败!',
        duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10
      })
    } else if (res.ErrCode === 'F') {
      notification.error({
        className: 'notification-custom-error',
        top: 92,
        message: res.message || '执行失败!',
        message: res.message || dict['exc_fail'] || '执行失败!',
        duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10
      })
    } else if (res.ErrCode === 'NM') {
      message.error(res.message || '执行失败!')
      message.error(res.message || dict['exc_fail'] || '执行失败!')
    }
    
    this.setState({