king
2020-03-30 461e4fff4b51d067671244eec63b097cd9012b6e
src/tabviews/zshare/actionList/index.jsx
@@ -78,7 +78,7 @@
      notification.warning({
        top: 92,
        message: '需要上级主键值!',
        duration: 10
        duration: 5
      })
      return
    }
@@ -95,7 +95,7 @@
      notification.warning({
        top: 92,
        message: this.props.dict['main.action.confirm.selectline'],
        duration: 10
        duration: 5
      })
      return
    } else if (item.Ot === 'requiredSgl' && data.length !== 1) {
@@ -103,7 +103,7 @@
      notification.warning({
        top: 92,
        message: this.props.dict['main.action.confirm.selectSingleLine'],
        duration: 10
        duration: 5
      })
      return
    } else if (item.Ot !== 'notRequired' && !setting.primaryKey) {
@@ -111,7 +111,7 @@
      notification.warning({
        top: 92,
        message: '未设置主键!',
        duration: 10
        duration: 5
      })
      return
    }
@@ -154,7 +154,7 @@
        notification.warning({
          top: 92,
          message: '导出按钮配置错误!',
          duration: 10
          duration: 5
        })
        return
      }
@@ -173,7 +173,7 @@
        notification.warning({
          top: 92,
          message: 'excel导入验证信息未设置!',
          duration: 10
          duration: 5
        })
      }
    } else if (item.OpenType === 'popview' && this.props.type !== 'subtab') {
@@ -182,7 +182,7 @@
      notification.warning({
        top: 92,
        message: '弹窗页面不支持此设置!',
        duration: 10
        duration: 5
      })
    } else if (item.OpenType === 'innerpage') {
      let Id = data[0][setting.primaryKey]
@@ -196,7 +196,7 @@
        notification.warning({
          top: 92,
          message: '页面类型设置错误!',
          duration: 10
          duration: 5
        })
      }
    } else if (item.OpenType === 'outerpage') {
@@ -245,7 +245,7 @@
      notification.warning({
        top: 92,
        message: '完善中。。。',
        duration: 10
        duration: 5
      })
    }
  }
@@ -267,7 +267,7 @@
      notification.warning({
        top: 92,
        message: '请完善打印验证信息!',
        duration: 15
        duration: 5
      })
      return
    }
@@ -393,6 +393,12 @@
  execCustomPrint = (item, printlist, formdata) => {
    this.setState({loadingUuid: ''})
    this.execSuccess(item, {
      ErrCode: '-1',
      message: '',
      ErrMesg: '',
      status: true
    })
    try {
      // eslint-disable-next-line
@@ -400,11 +406,19 @@
      func(printlist, formdata, item.verify, notification)
    } catch (e) {
      console.warn(e)
      notification.warning({
        top: 92,
        message: '自定义函数执行错误!',
        duration: 10
      })
      try {
        // eslint-disable-next-line
        let evalfunc = eval('(true && function (data, form, printer, notification) {' + item.verify.printFunc + '})')
        evalfunc(printlist, formdata, item.verify, notification)
      } catch (error) {
        console.warn(error)
        notification.warning({
          top: 92,
          message: '自定义函数执行错误!',
          duration: 5
        })
      }
    }
  }
@@ -583,7 +597,6 @@
    }).then(response => {
      if (!response) return
      response = {"status":true,"message":"","ErrCode":"","ErrMesg":"","CpCode":"YTO","InsideBill":"202003261727348572C0D0C2C0E444FD0B42A","PrintData":"{\"data\":{\"CpCode\":\"YTO\",\"WayBillCode\":\"YT2045589280491\",\"InsideBill\":\"19042003260002\",\"RecvInfo\":\"张先生  137147852  \\r\\n河北省保定市竞秀区001\",\"SendInfo\":\"宝时得科技(中国)有限公司  0512-65152888-5147  \\r\\n宝时得科技(中国)有限公司(B区)苏州工业园区东旺路18号\",\"BigShot\":\"176保定\",\"GatherCenterCode\":\"311911\",\"GatherCenterName\":\"\",\"CustomData\":\"wu800*2\\\\r\\\\n\",\"Pin\":\"\"},\"templateURL\":\"http://css.positecgroup.com/template/yto.srt\",\"ectype\":\"jdpop\"}","CustomData":""}
      if (response.status) {
        _list.push(response)
@@ -844,12 +857,13 @@
    })
    if (list.length === 0) {
      notification.warning({
        top: 92,
        message: '未获取到打印信息!',
        duration: 10
      })
      this.setState({loadingUuid: ''})
      this.execError({
        ErrCode: 'N',
        message: '未获取到打印信息!',
        ErrMesg: '',
        status: false
      }, item)
      return
    } else if (_errors.length > 0) {
      let lackerror = []
@@ -873,12 +887,13 @@
        msg.push(emptyerror.join(' ; '))
      }
      notification.warning({
        top: 92,
        message: msg.join(' ; ') + ' !',
        duration: 10
      })
      this.setState({loadingUuid: ''})
      this.execError({
        ErrCode: 'N',
        message: msg.join(' ; ') + ' !',
        ErrMesg: '',
        status: false
      }, item)
      return
    }
@@ -900,10 +915,11 @@
        })
        this.setState({loadingUuid: ''})
        notification.success({
          top: 92,
          message: '打印请求已发出。',
          duration: 2
        this.execSuccess(item, {
          ErrCode: 'S',
          message: '',
          ErrMesg: '打印请求已发出。',
          status: true
        })
      }
    }
@@ -922,10 +938,11 @@
        })
        this.setState({loadingUuid: ''})
        notification.success({
          top: 92,
          message: '打印请求已发出。',
          duration: 2
        this.execSuccess(item, {
          ErrCode: 'S',
          message: '',
          ErrMesg: '打印请求已发出。',
          status: true
        })
      }
    }
@@ -937,12 +954,14 @@
        try {
          data = JSON.parse(event.data)
        } catch {
          notification.warning({
            top: 92,
            message: event.data,
            duration: 10
          })
          this.setState({loadingUuid: ''})
          this.execError({
            ErrCode: 'N',
            message: event.data,
            ErrMesg: '',
            status: false
          }, item)
          data = ''
        }
      }
@@ -956,28 +975,31 @@
        })
        this.setState({loadingUuid: ''})
        notification.success({
          top: 92,
          message: '打印请求已发出。',
          duration: 2
        this.execSuccess(item, {
          ErrCode: 'S',
          message: '',
          ErrMesg: '打印请求已发出。',
          status: true
        })
      } else if (data && data.message && !data.status) {
        notification.warning({
          top: 92,
          message: data.message,
          duration: 10
        })
        this.setState({loadingUuid: ''})
        this.execError({
          ErrCode: 'N',
          message: data.message,
          ErrMesg: '',
          status: false
        }, item)
      }
    }
    socket.onerror = () => {
      notification.warning({
        top: 92,
        message: '无法连接到:' + item.verify.linkUrl,
        duration: 10
      })
      this.setState({loadingUuid: ''})
      this.execError({
        ErrCode: 'N',
        message: '无法连接到:' + item.verify.linkUrl,
        ErrMesg: '',
        status: false
      }, item)
    }
  }
@@ -1068,7 +1090,7 @@
          notification.warning({
            top: 92,
            message: '使用创建凭证函数,需要选择行!',
            duration: 10
            duration: 5
          })
          return
        }
@@ -1534,7 +1556,7 @@
    notification.warning({
      top: 92,
      message: this.props.dict['main.action.settingerror'],
      duration: 10
      duration: 5
    })
  }
@@ -1572,7 +1594,7 @@
          notification.warning({
            top: 92,
            message: res.message,
            duration: 10
            duration: 5
          })
          this.setState({
            execAction: null,
@@ -1583,7 +1605,7 @@
          notification.warning({
            top: 92,
            message: '未获取到按钮配置信息!',
            duration: 10
            duration: 5
          })
          this.setState({
            execAction: null,
@@ -1733,7 +1755,7 @@
        notification.warning({
          top: 92,
          message: error.message,
          duration: 10
          duration: 5
        })
      }
@@ -1757,19 +1779,19 @@
        notification.warning({
          top: 92,
          message: '工作表《' + btn.verify.sheet + '》不存在!',
          duration: 10
          duration: 5
        })
      } else if (errors === 'empty') {
        notification.warning({
          top: 92,
          message: '工作表《' + btn.verify.sheet + '》为空!',
          duration: 10
          duration: 5
        })
      } else if (errors === 'headerError') {
        notification.warning({
          top: 92,
          message: '工作表《' + btn.verify.sheet + '》表头设置错误!',
          duration: 10
          duration: 5
        })
      }
      
@@ -1780,7 +1802,7 @@
      notification.warning({
        top: 92,
        message: '未获取到工作表《' + btn.verify.sheet + '》数据!',
        duration: 10
        duration: 5
      })
      return
    }
@@ -1790,7 +1812,7 @@
      notification.warning({
        top: 92,
        message: result.errors,
        duration: 10
        duration: 5
      })
      return
    }