king
2025-05-13 1779677cece5864b62a65df4b01a4a69496e149a
src/tabviews/custom/components/module/voucher/index.jsx
@@ -38,6 +38,7 @@
    remark: '',
    attachments: 0,
    vouAduited: false,
    vouReadOnly: false,
    attachlist: [],
    oriAttachs: [],
    tempTypes: [],
@@ -353,7 +354,8 @@
          attachlist: files,
          vouDate: res.fibvoucherdate ? moment(res.fibvoucherdate, 'YYYY-MM-DD') : null,
          charType: res.voucher_class || 'keeping',
          vouAduited: res.voucher_status === 'true',
          vouAduited: res.voucher_status === 'true' || res.read_only === 'true',
          vouReadOnly: res.read_only === 'true',
          charName: res.voucher_char,
          charInt: res.voucher_char_int,
          // orgcode: res.orgcode,
@@ -490,11 +492,11 @@
    }
    if (tip) {
      const _this = this
      const that = this
      confirm({
        content: tip + '确认要保存吗?',
        onOk() {
          _this.voucherSave(list, t)
          that.voucherSave(list, t)
        },
        onCancel() {}
      })
@@ -565,7 +567,7 @@
    let sup_data = []
    let voucherMap = new Map()
    let supMap = new Map()
    let extract = localStorage.getItem(window.GLOB.host + '_voucher_extract')
    let extract = localStorage.getItem(window.GLOB.sysSign + '_voucher_extract')
    extract = extract ? JSON.parse(extract) : []
    data.forEach(item => {
@@ -619,7 +621,7 @@
      if (extract.length > 20) {
        extract.length = 20
      }
      localStorage.setItem(window.GLOB.host + '_voucher_extract', JSON.stringify(extract))
      localStorage.setItem(window.GLOB.sysSign + '_voucher_extract', JSON.stringify(extract))
    }
    voucherMap.forEach(item => {
@@ -698,7 +700,7 @@
      }
      if (tabId) {
        MKEmitter.emit('reloadMenuView', tabId, 'table')
        MKEmitter.emit('reloadMenuView', tabId)
      }
    })
  }
@@ -951,7 +953,7 @@
      }
      if (tabId) {
        MKEmitter.emit('reloadMenuView', tabId, 'table')
        MKEmitter.emit('reloadMenuView', tabId)
      }
    })
  }
@@ -1189,8 +1191,10 @@
            return
          }
    
          Modal.success({
            title: '已经通过审核'
          notification.success({
            top: 92,
            message: '已经通过审核',
            duration: 2
          })
          that.getVoucher()
@@ -1236,9 +1240,11 @@
            })
            return
          }
          Modal.success({
            title: '审核已取消'
          notification.success({
            top: 92,
            message: '审核已取消',
            duration: 2
          })
          that.getVoucher()
@@ -1249,22 +1255,24 @@
  }
  render() {
    const { type, status, loading, config, orgcode, typeOptions, tempTypes, charType, charInt, data, vouDate, username, remark, attachments, title, attachlist, tempTypeClass, vouAduited } = this.state
    const { type, status, loading, config, orgcode, typeOptions, tempTypes, charType, charInt, data, vouDate, username, remark, attachments, title, attachlist, tempTypeClass, vouAduited, vouReadOnly, voucherCode } = this.state
    if (type === 'checkVoucher') {
      return (
        <div className="menu-voucher-wrap" style={config.style}>
          <div className="voucher-header" style={{padding: `10px ${config.wrap.space || 0}px`}}>
            {!vouAduited ?<Button disabled={status === 'empty' || status === 'saved'} onClick={() => this.triggersave()}>保存</Button> : null}
            {!vouAduited ? <Button disabled={status === 'empty' || status === 'saved'} onClick={() => this.triggersave()}>保存</Button> : null}
            {/* <PrintVoucher ID={config.uuid + 'print'} data={data} orgname={orgname} vouDate={vouDate} charName={charName} charInt={charInt} attachments={attachments} disabled={status !== 'saved'}/> */}
            <Button disabled={status !== 'saved'} onClick={this.triggerPrint}>打印</Button>
            {vouAduited ?
              <Button onClick={this.triggerUnAduit}>取消审核</Button> :
              <Button onClick={this.triggerAduit}>审核</Button>}
            {vouAduited && !vouReadOnly ? <Button onClick={this.triggerUnAduit}>取消审核</Button> : null}
            {!vouAduited && !vouReadOnly ? <Button onClick={this.triggerAduit}>审核</Button> : null}
            <Button onClick={this.triggerclose}>关闭</Button>
          </div>
          <div className="voucher-body" style={{padding: `0px ${config.wrap.space || 0}px`}}>
            <div className="pre-wrap">
              <div className="voucher-number">
                凭证号:{voucherCode}
              </div>
              <div className="voucher-code">
                <Select value={charType} disabled={vouAduited} dropdownClassName="mk-vcode-dropdown" onChange={(val, option) => this.setState({status: 'change', charType: val, charName: option.props.charname, charInt: option.props.charint})}>
                  {typeOptions.map(option =>
@@ -1277,7 +1285,7 @@
                日期:<DatePicker value={vouDate} disabled={vouAduited} onChange={this.changeVouDate}/>
              </div>
              <div className="voucher-text">
                <Input value={title} placeholder="凭证文本" disabled={vouAduited} autoComplete="off" onChange={(e) => this.setState({status: 'change', title: e.target.value})}/>
                <Input value={title} placeholder={vouAduited ? '' : '凭证文本'} disabled={vouAduited} autoComplete="off" onChange={(e) => this.setState({status: 'change', title: e.target.value})}/>
              </div>
              <div className="voucher-affix">
                附单据 <InputNumber precision={0} disabled={vouAduited} value={attachments || 0} autoComplete="off" onChange={this.changeAttach}/> 张