king
2024-05-17 684867142a6aa39011da24b734ce17de54407884
2024-05-17
4个文件已修改
179 ■■■■■ 已修改文件
src/menu/components/module/invoice/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/invoice/index.jsx 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/invoice/index.scss 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/invoice/invoiceTable/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/module/invoice/index.jsx
@@ -158,6 +158,10 @@
        ['优惠政策类型', 'vat_special_management'],
        ['征税项目', 'tax_item'],
        ['计税方法', 'tax_method'],
        ['发票号码', 'invoice_no'],
        ['发票代码', 'invoice_code'],
        ['开票日期', 'invoice_date'],
        ['只读(true)', 'read_only'],
      ]
      cols.forEach((cell, index) => {
src/tabviews/custom/components/module/invoice/index.jsx
@@ -54,7 +54,12 @@
    tax_type: '',
    reqfields: [],
    requireds: [],
    timestamp: new Date().getTime() + ''
    invoice_no: '',
    invoice_code: '',
    invoice_date: '',
    read_only: false,
    invoice_type_name: '',
    timestamp: ''
  }
  UNSAFE_componentWillMount () {
@@ -341,6 +346,17 @@
        }
      })
      let invoice_type_name = ''
      if (line.read_only === 'true') {
        let types = book.invoice_type || []
        types.forEach(item => {
          if (item.value === line.invoice_type) {
            invoice_type_name = item.label
          }
        })
        invoice_type_name = invoice_type_name || line.invoice_type
      }
      this.setState({
        ID: line[config.setting.primaryKey] || Utils.getguid(),
        io: line.io,
@@ -366,6 +382,11 @@
        reviewer: line.reviewer,
        drawer: line.drawer,
        details: details,
        invoice_no: line.invoice_no,
        invoice_code: line.invoice_code,
        invoice_date: line.read_only === 'true' ? line.invoice_date : '',
        read_only: line.read_only === 'true',
        invoice_type_name: invoice_type_name,
        oriDetails: fromJS(details).toJS(),
        timestamp: new Date().getTime() + '',
        loading: false
@@ -1033,15 +1054,112 @@
  // }
  render() {
    const { config, book, loading, invTypes, reqfields, saveType, date, timestamp, invoice_type, from_to_name, from_to_tax_no, from_to_addr, from_to_tel, from_to_bank_name, from_to_account_no, from_to_mob, from_to_email, orgname, tax_no, addr, tel, bank_name, account_no, remark, reviewer, drawer, payee, details, visible, tax_type } = this.state
    const { config, book, loading, invTypes, reqfields, saveType, date, timestamp, invoice_type, from_to_name, from_to_tax_no, from_to_addr, from_to_tel, from_to_bank_name, from_to_account_no, from_to_mob, from_to_email, orgname, tax_no, addr, tel, bank_name, account_no, remark, reviewer, drawer, payee, details, visible, tax_type, invoice_no, invoice_code, invoice_date, read_only, invoice_type_name } = this.state
    if (!book || (config.wrap.datatype === 'dynamic' && !tax_no)) {
    if (!book || (config.wrap.datatype === 'dynamic' && !timestamp)) {
      return <div className="menu-invoice-wrap" style={config.style}>
        <div className="loading-mask">
          <div className="ant-spin-blur"></div>
          <Spin />
        </div>
      </div>
    }
    if (read_only) {
      return (
        <div className="menu-invoice-wrap read_only" style={config.style}>
          {loading ?
            <div className="loading-mask">
              <div className="ant-spin-blur"></div>
              <Spin />
            </div> : null
          }
          <div className="inv-action">
            {config.wrap.backBtn === 'show' ? <Button className="mk-back" onClick={this.goback}><LeftOutlined />返回</Button> : null}
          </div>
          <div className="inv-header">
            <div className="inv-type">{invoice_type_name}</div>
            <div className="inv-msg">
              {invoice_no ? <div>发票号码:{invoice_no}</div> : null}
              {invoice_code ? <div>发票代码:{invoice_code}</div> : null}
              {invoice_date ? <div>开票日期:{invoice_date}</div> : null}
            </div>
          </div>
          <div className="inv-body">
            <div className="inv-main-content">
              <div className="inv-buyer">
                <div className="inv-label">购买方</div>
                <div className="inv-content">
                  <Form.Item className="mk-name" label={<>名<span></span>称</>}>
                    {from_to_name}
                  </Form.Item>
                  <Form.Item label="纳税人识别号">
                    {from_to_tax_no}
                  </Form.Item>
                  <Form.Item label={<>地<span></span>址<span></span>、<span></span>电<span></span>话</>}>
                    {from_to_addr + ' ' + from_to_tel}
                  </Form.Item>
                  <Form.Item label="开户行及账号">
                    {from_to_bank_name + ' ' + from_to_account_no}
                  </Form.Item>
                </div>
              </div>
              <div className="inv-notice">
                <div className="inv-label">通知到</div>
                <div className="inv-content">
                  <Form.Item label={<>手<span></span>机<span></span>号</>}>
                    {from_to_mob}
                  </Form.Item>
                  <Form.Item label={<>邮<span></span>箱</>}>
                    {from_to_email}
                  </Form.Item>
                </div>
              </div>
            </div>
            <div className="inv-details">
              <InvoiceTable data={details} timestamp={timestamp} read_only={true} config={config.detail} tax_type={tax_type} onChange={(details) => this.setState({details})}/>
            </div>
            <div className="inv-main-content">
              <div className="inv-buyer">
                <div className="inv-label">销售方</div>
                <div className="inv-content">
                  <Form.Item label={<>名<span></span>称</>}>
                    {orgname}
                  </Form.Item>
                  <Form.Item label="纳税人识别号">
                    {tax_no}
                  </Form.Item>
                  <Form.Item label={<>地<span></span>址<span></span>、<span></span>电<span></span>话</>}>
                    {addr + ' ' + tel}
                  </Form.Item>
                  <Form.Item label="开户行及账号">
                    {bank_name + ' ' + account_no}
                  </Form.Item>
                </div>
              </div>
              <div className="inv-notice">
                <div className="inv-label">备注</div>
                <div className="inv-content" style={{paddingTop: '30px'}}>
                  <Form.Item label="">
                    {remark}
                  </Form.Item>
                </div>
              </div>
            </div>
          </div>
          <div className="inv-tail">
            <Form.Item label="收款人">
              {payee}
            </Form.Item>
            <Form.Item label="复核人">
              {reviewer}
            </Form.Item>
            <Form.Item label="开票人">
              {drawer}
            </Form.Item>
          </div>
        </div>
      )
    }
    return (
@@ -1105,7 +1223,7 @@
            </div>
          </div>
          <div className="inv-details">
            <InvoiceTable data={details} timestamp={timestamp} config={config.detail} tax_type={tax_type} onChange={(details) => this.setState({details})}/>
            <InvoiceTable data={details} timestamp={timestamp} read_only={false} config={config.detail} tax_type={tax_type} onChange={(details) => this.setState({details})}/>
          </div>
          <div className="inv-main-content">
            <div className="inv-buyer">
src/tabviews/custom/components/module/invoice/index.scss
@@ -49,6 +49,38 @@
    position: relative;
    height: 70px;
    margin-right: 30px;
    .inv-type {
      width: 390px;
      display: inline-block;
      position: relative;
      font-size: 25px;
      text-align: center;
      font-family: kaiti;
      color: var(--inv-color, #13509c);
    }
    .inv-type::before, .inv-type::after {
      content: '';
      display: block;
      width: 100%;
      position: absolute;
      border-top: var(--inv-color, #13509c) 1px solid;
      border-bottom: var(--inv-color, #13509c) 1px solid;
      height: 1px;
    }
    .inv-type::before {
      bottom: -10px;
    }
    .inv-type::after {
      bottom: -15px;
    }
    .inv-msg {
      position: absolute;
      right: 100px;
      top: 0px;
      font-size: 13px;
      text-align: left;
      color: var(--inv-color, #13509c);
    }
    .ant-select {
      width: 390px;
      border: none;
@@ -273,6 +305,17 @@
    }
  }
}
.menu-invoice-wrap.read_only {
  .ant-form-item-children {
    color: rgba(0, 0, 0, 0.85);
  }
  .ant-input-suffix, .ant-form-extra, .anticon-ellipsis {
    display: none;
  }
  .plus-line, .del-line {
    display: none!important;
  }
}
.inv-table {
  .ant-table .ant-table-tbody {
    td {
src/tabviews/custom/components/module/invoice/invoiceTable/index.jsx
@@ -132,6 +132,7 @@
  static propTpyes = {
    config: PropTypes.object,
    timestamp: PropTypes.string,
    read_only: PropTypes.any,
    data: PropTypes.any,
    onChange: PropTypes.func
  }
@@ -348,7 +349,12 @@
  }
  checkLine = (uuid, key, e) => {
    const { read_only } = this.props
    e && e.stopPropagation()
    if (read_only) return
    this.setState({editKey: uuid, key: key || ''}, () => {
      if (key === 'productname') {
        this.setState({visible: true})