king
2020-11-10 5df578ff69f6b02e821d59a8883bc75d78695a62
src/templates/sharecomponent/actioncomponent/index.jsx
@@ -43,6 +43,7 @@
    actionlist: null,    // 按钮组
    copying: false,      // 按钮复制中
    visible: false,      // 模态框控制
    printTemps: [],      // 单据打印模板
    profVisible: false   // 验证信息模态框
  }
@@ -67,6 +68,54 @@
    } else if (!is(fromJS(nextProps.config.action), fromJS(this.props.config.action)) && !is(fromJS(nextProps.config.action), fromJS(actionlist))) {
      this.setState({actionlist: fromJS(nextProps.config.action).toJS()})
    }
  }
  componentDidMount () {
    this.getBillPrintTemp()
  }
  getBillPrintTemp = () => {
    let _sql = `select PrintTempNO,Images,PrintTempNO+PrintTempName as PN from sPrintTemplate
    where appkey= @appkey@ and Deleted=0  and typechartwo='web_print'
    union select ID,Images,a.PrintTempNO+PrintTempName as PN
    from (select * from sPrintTemplate where appkey= '' and Deleted=0  and typechartwo='web_print') a
    left join (select PrintTempNO from sPrintTemplate where appkey= @appkey@  and Deleted=0 ) b
    on a.PrintTempNO=b.PrintTempNO
    left join (select Srcid from sPrintTemplate_Log where appkey='' and apicode= @appkey@ and Deleted=0 ) c
    on a.ID=c.Srcid where b.PrintTempNO is null and c.Srcid is null`
    let param = {
      func: 'sPC_Get_SelectedList',
      LText: Utils.formatOptions(_sql),
      obj_name: 'data',
      arr_field: 'PN,PrintTempNO,Images'
    }
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
    param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 云端数据验证
    Api.getSystemConfig(param).then(res => {
      if (res.status) {
        let temps = res.data.map(temp => {
          return {
            value: temp.PrintTempNO,
            text: temp.PN
          }
        })
        this.setState({
          printTemps: temps
        })
      } else {
        notification.warning({
          top: 92,
          message: res.message,
          duration: 5
        })
      }
    })
  }
  /**
@@ -154,14 +203,14 @@
        this.setState({
          visible: true,
          card: card,
          formlist: getActionForm(card, functip, this.props.config, this.props.usefulFields, this.props.type, menulist)
          formlist: getActionForm(card, functip, this.props.config, this.props.usefulFields, this.props.type, menulist, this.state.printTemps)
        })
      })
    } else {
      this.setState({
        visible: true,
        card: card,
        formlist: getActionForm(card, functip, this.props.config, this.props.usefulFields, this.props.type, menulist)
        formlist: getActionForm(card, functip, this.props.config, this.props.usefulFields, this.props.type, menulist, this.state.printTemps)
      })
    }
  }
@@ -400,7 +449,7 @@
            Align: 'center',
            IsSort: 'false',
            uuid: Utils.getuuid(),
            label: this.state.dict['model.form.column.action'],
            label: this.state.dict['model.operation'],
            type: 'action',
            style: 'button',
            show: 'horizontal',
@@ -621,7 +670,7 @@
            Align: 'center',
            IsSort: 'false',
            uuid: Utils.getuuid(),
            label: this.state.dict['model.form.column.action'],
            label: this.state.dict['model.operation'],
            type: 'action',
            style: 'button',
            show: 'horizontal',