king
2022-09-18 0f6153ab337c4ecca5579a79b03f3ba5f831e0c4
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -38,6 +38,7 @@
    formdata: null,
    selines: null,
    btnconfig: null,
    confirmLoading: false,
    loading: false,
    disabled: false,
    hidden: false,
@@ -379,7 +380,7 @@
            param.rduri = window.GLOB.mainSystemApi
          }
    
          Api.getLocalConfig(param).then(result => {
          Api.genericInterface(param).then(result => {
            result.tempId = tempId
            resolve(result)
          })
@@ -825,6 +826,8 @@
      if (window.GLOB.mkHS) {
        if (btn.sysInterface === 'true' && options.cloudServiceApi) {
          res.rduri = options.cloudServiceApi
          res.userid = sessionStorage.getItem('CloudUserID') || ''
          res.LoginUID = sessionStorage.getItem('CloudLoginUID') || ''
        } else if (btn.sysInterface !== 'true') {
          if (window.GLOB.systemType === 'production' && btn.proInterface) {
            res.rduri = btn.proInterface
@@ -840,6 +843,11 @@
            res.rduri = btn.proInterface
          } else {
            res.rduri = btn.interface
          }
          let host = window.GLOB.baseurl.replace(/http(s):\/\//, '')
          if (res.rduri.indexOf(host) === -1 && /\/dostars/.test(res.rduri)) {
            res.$login = true
          }
        }
      }
@@ -938,6 +946,16 @@
        error = '打印模板解析错误!'
      } else {
        let control = []
        let rotate = configParam.rotate || 0
        let offsetTop = 0
        let offsetLeft = 0
        if (rotate === 90) {
          offsetTop = configParam.width - configParam.height
        } else if (rotate === 270) {
          offsetLeft = configParam.height - configParam.width
        }
        configParam.elements.forEach(element => {
          let _field = element.field
@@ -950,11 +968,12 @@
            Type: element.type,
            Value: element.value || '',
            Field: _field,
            Left: element.left,
            Top: element.top,
            Left: element.left + offsetLeft,
            Top: element.top + offsetTop,
            Width: element.width,
            Height: element.height,
            Rotate: element.rotate,
            Rotate: rotate,
            // Rotate: element.rotate,
            BorderSize: element.borderSize / 10,
            BorderColor: element.borderColor,
            Align: element.align,
@@ -1022,6 +1041,12 @@
          control.push(item)
        })
        let down = false
        if (rotate === 90 || rotate === 270) {
          down = true
        }
        _configparam = {
          Version: '',
          Title: configParam.name,
@@ -1029,8 +1054,8 @@
          Description: configParam.remark,
          PrintTempNO: configParam.PrintTempNO,
          PageSetting: {
            Width: configParam.width,
            Height: configParam.height,
            Width: down ? configParam.height : configParam.width,
            Height: down ? configParam.width : configParam.height,
            Left: '0',
            Right: '0',
            Top: '0',
@@ -1160,12 +1185,21 @@
    })
    if (list.length === 0) {
      this.execError({
        ErrCode: 'N',
        message: '未获取到打印信息!',
        ErrMesg: '',
        status: false
      })
      if (btn.verify.emptyTip === 'false') {
        this.execSuccess({
          ErrCode: '-1',
          message: '未获取到打印信息!',
          ErrMesg: '',
          status: true
        })
      } else {
        this.execError({
          ErrCode: 'N',
          message: '未获取到打印信息!',
          ErrMesg: '',
          status: false
        })
      }
      return
    } else if (_errors.length > 0) {
      let lackerror = []
@@ -1319,24 +1353,31 @@
   */
  execSuccess = (res) => {
    const { btn } = this.props
    const { autoMatic } = this.state
    const { autoMatic, btnconfig } = this.state
    if ((res && (res.ErrCode === 'S' || !res.ErrCode)) || autoMatic) { // 执行成功
    if ((res.ErrCode === 'S' || !res.ErrCode) || autoMatic) { // 执行成功
      notification.success({
        top: 92,
        message: res.ErrMesg || this.state.dict['main.action.confirm.success'],
        duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2
      })
    } else if (res && res.ErrCode === 'Y') { // 执行成功
    } else if (res.ErrCode === 'Y') { // 执行成功
      Modal.success({
        title: res.ErrMesg || this.state.dict['main.action.confirm.success']
      })
    } else if (res && res.ErrCode === '-1') { // 完成后不提示
    } else if (res.ErrCode === '-1') { // 完成后不提示
    }
    if (autoMatic || !btnconfig || btnconfig.setting.finish !== 'unclose') {
      this.setState({
        visible: false
      })
    }
    this.setState({
      loading: false
      loading: false,
      confirmLoading: false
    })
    if (autoMatic) {
@@ -1381,7 +1422,8 @@
    }
    
    this.setState({
      loading: false
      loading: false,
      confirmLoading: false
    })
    if (autoMatic) {
@@ -1501,16 +1543,10 @@
   * @description 模态框(表单),确认
   */
  handleOk = () => {
    const { btnconfig, autoMatic } = this.state
    if (!this.formRef) return
    this.formRef.handleConfirm().then(res => {
      if (btnconfig.setting.finish !== 'unclose' || autoMatic) {
        this.setState({
          visible: false
        })
      }
      this.setState({ confirmLoading: true })
      this.triggerPrint(this.state.selines, res)
    })
  }
@@ -1521,7 +1557,8 @@
  handleCancel = () => {
    this.setState({
      loading: false,
      visible: false
      visible: false,
      confirmLoading: false
    })
  }
@@ -1651,6 +1688,7 @@
        getContainer={container}
        wrapClassName='action-modal'
        visible={this.state.visible}
        confirmLoading={this.state.confirmLoading}
        width={width}
        onOk={this.handleOk}
        onCancel={this.handleCancel}