king
2023-01-28 1b60547cb25f5c0a4371e5be0517adf092f2dc62
2023-01-28
6个文件已修改
221 ■■■■■ 已修改文件
src/menu/components/card/data-card/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/voucherTable/index.jsx 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/voucherTable/index.scss 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/data-card/index.jsx
@@ -491,9 +491,9 @@
      let elements = []
      res.elements && res.elements.forEach(cell => {
        if (cell.datatype === 'dynamic') {
          cell.datatype = 'static'
        }
        // if (cell.datatype === 'dynamic') {
        //   cell.datatype = 'static'
        // }
        if (cell.eleType !== 'button') {
          cell.uuid = Utils.getuuid()
@@ -512,9 +512,9 @@
      if (appType !== 'mob') {
        res.backElements && res.backElements.forEach(cell => {
          if (cell.datatype === 'dynamic') {
            cell.datatype = 'static'
          }
          // if (cell.datatype === 'dynamic') {
          //   cell.datatype = 'static'
          // }
          if (cell.eleType !== 'button') {
            cell.uuid = Utils.getuuid()
src/tabviews/custom/components/module/voucher/index.scss
@@ -20,7 +20,7 @@
    }
  }
  .voucher-body {
    padding: 0 15px;
    padding: 0 30px;
    .voucher-code {
      display: inline-block;
      width: 160px;
src/tabviews/custom/components/module/voucher/voucherTable/index.jsx
@@ -2,6 +2,7 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Table, Modal, Input, InputNumber, notification, message, AutoComplete, Select } from 'antd'
import { PlusOutlined, CloseOutlined } from '@ant-design/icons'
import Api from '@/api'
import Utils from '@/utils/utils.js'
@@ -62,20 +63,30 @@
    this.setState({editing: false})
    let line = {...record}
    if (value !== record[col.field]) {
      let line = {...record, [col.field]: value}
      line[col.field] = value
      if (col.field === 'debtor') {
        line.creditor = ''
        if (isNaN(line.debtor)) {
          line.debtor = ''
        }
      } else {
        line.debtor = ''
        if (isNaN(line.creditor)) {
          line.creditor = ''
        }
      }
      MKEmitter.emit('changeRecord', col.tableId, line)
    }
    setTimeout(() => {
      if (col.field === 'creditor') {
      if (col.field === 'debtor' && (line.debtor || line.debtor === 0)) {
        MKEmitter.emit('nextLine', col, record)
      } else if (col.field === 'creditor') {
        MKEmitter.emit('nextLine', col, record)
      } else {
        let cl = {remark: 'subjectscode', subjectscode: 'debtor', debtor: 'creditor'}
@@ -117,8 +128,14 @@
      if (col.field === 'debtor') {
        line.creditor = ''
        if (isNaN(line.debtor)) {
          line.debtor = ''
        }
      } else {
        line.debtor = ''
        if (isNaN(line.creditor)) {
          line.creditor = ''
        }
      }
      MKEmitter.emit('changeRecord', col.tableId, line)
@@ -133,6 +150,18 @@
    this.setState({value: val}, () => {
      this.onBlur()
    })
  }
  plusLine = () => {
    const { col, record } = this.props
    MKEmitter.emit('plusLine', col.tableId, record)
  }
  delRecord = () => {
    const { col, record } = this.props
    MKEmitter.emit('delRecord', col.tableId, record)
  }
  onSelectChange = (val, option) => {
@@ -155,6 +184,7 @@
    let children = null
    let colSpan = 1
    let extra = null
    if (col.field === 'remark') {
      let val = record.remark || ''
@@ -163,6 +193,8 @@
        children = <div className="content-wrap" style={{lineHeight: '60px'}}>合计: {val}</div>
        colSpan = 2
      } else {
        extra = <PlusOutlined onClick={this.plusLine}/>
        if (editing) {
          let options = ['现金', '发票']
          children = <AutoComplete
@@ -206,40 +238,40 @@
        }
      }
    } else if (col.field === 'debtor') {
      if (editing) {
        children = <InputNumber id={col.uuid + record.uuid} defaultValue={record.debtor} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/>
      } else {
      let val = record.debtor
      let down = false
      let vals = []
      if (typeof(val) === 'number') {
        if (!isNaN(val) && val !== '') {
        if (val < 0) {
          down = true
          val = Math.abs(val)
        }
        vals = (val * 100).toFixed(0).split('').reverse()
      }
      if (editing) {
        children = <InputNumber id={col.uuid + record.uuid} defaultValue={val} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/>
      } else {
        children = <div className={'money-uint' + (down ? ' down' : '')} onClick={this.focus}>
          <span>{vals[10] || ''}</span> <span>{vals[9] || ''}</span> <span>{vals[8] || ''}</span> <span>{vals[7] || ''}</span> <span>{vals[6] || ''}</span> <span>{vals[5] || ''}</span>
          <span>{vals[4] || ''}</span> <span>{vals[3] || ''}</span> <span>{vals[2] || ''}</span> <span>{vals[1] || ''}</span> <span className="last">{vals[0] || ''}</span>
        </div>
      }
    } else if (col.field === 'creditor') {
      extra = <CloseOutlined onClick={this.delRecord}/>
      if (editing) {
        children = <InputNumber id={col.uuid + record.uuid} defaultValue={record.creditor} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/>
      } else {
      let val = record.creditor
      let down = false
      let vals = []
      if (typeof(val) === 'number') {
        if (!isNaN(val) && val !== '') {
        if (val < 0) {
          down = true
          val = Math.abs(val)
        }
        vals = (val * 100).toFixed(0).split('').reverse()
      }
      if (editing) {
        children = <InputNumber id={col.uuid + record.uuid} defaultValue={val} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/>
      } else {
        children = <div className={'money-uint' + (down ? ' down' : '')} onClick={this.focus}>
        <span>{vals[10] || ''}</span> <span>{vals[9] || ''}</span> <span>{vals[8] || ''}</span> <span>{vals[7] || ''}</span> <span>{vals[6] || ''}</span> <span>{vals[5] || ''}</span>
        <span>{vals[4] || ''}</span> <span>{vals[3] || ''}</span> <span>{vals[2] || ''}</span> <span>{vals[1] || ''}</span> <span className="last">{vals[0] || ''}</span>
@@ -249,7 +281,7 @@
    if (!colSpan) return null
    return (<td colSpan={colSpan} className={className}>{children}</td>)
    return (<td colSpan={colSpan} className={className}>{children}{extra}</td>)
  }
}
@@ -347,6 +379,7 @@
  componentDidMount () {
    MKEmitter.addListener('nextLine', this.nextLine)
    MKEmitter.addListener('plusLine', this.plusLine)
    MKEmitter.addListener('delRecord', this.delRecord)
    MKEmitter.addListener('changeRecord', this.changeRecord)
  }
@@ -359,6 +392,7 @@
      return
    }
    MKEmitter.removeListener('nextLine', this.nextLine)
    MKEmitter.removeListener('plusLine', this.plusLine)
    MKEmitter.removeListener('delRecord', this.delRecord)
    MKEmitter.removeListener('changeRecord', this.changeRecord)
  }
@@ -426,13 +460,13 @@
    let creditor = ''
    data.forEach(item => {
      if (typeof(item.debtor) === 'number') {
      if (!isNaN(item.debtor) && item.debtor !== '') {
        if (debtor === '') {
          debtor = 0
        }
        debtor += item.debtor
      } else if (typeof(item.creditor) === 'number') {
      } else if (!isNaN(item.creditor) && item.creditor !== '') {
        if (debtor === '') {
          debtor = 0
        }
@@ -553,17 +587,20 @@
    }
  }
  plusLine = (initEditLine) => {
    const { edData } = this.state
  plusLine = (tid, record) => {
    const { edData, tableId } = this.state
    let item = {...edData[edData.length - 1]}
    if (tid !== tableId) return
    item.key = item.key + 1
    item.$$uuid = '$new'
    let _data = fromJS(edData).toJS()
    let line = {uuid: Utils.getuuid(), index: 0, remark: '', subjectscode: '', subjectsname: '', debtor: '', creditor: ''}
    this.setState({edData: [...edData, item]}, () => {
      MKEmitter.emit('tdFocus', initEditLine.uuid + item.uuid)
    })
    _data.splice(record.index, 0, line)
    this.setState({edData: _data.map((item, index) => {
      item.index = index
      return item
    })})
  }
  delRecord = (id, record) => {
@@ -571,15 +608,20 @@
    if (id !== tableId) return
    let _data = edData.filter(item => item.uuid !== record.uuid)
    let _data = fromJS(edData).toJS().filter(item => item.uuid !== record.uuid)
    _data.pop()
    if (_data.length < 4) {
      for (let i = _data.length - 1; i < 4; i++) {
        _data.push({uuid: Utils.getuuid(), index: i + 1, remark: '', subjectscode: '', subjectsname: '', debtor: '', creditor: ''})
      for (let i = _data.length; i < 4; i++) {
        _data.push({uuid: Utils.getuuid(), index: 0, remark: '', subjectscode: '', subjectsname: '', debtor: '', creditor: ''})
      }
    }
    _data = _data.map((item, index) => {
      item.index = index
      return item
    })
    _data.push(this.getTotalLine(_data))
@@ -606,24 +648,6 @@
    _data.push(this.getTotalLine(_data))
    this.setState({edData: _data})
  }
  addLine = () => {
    const { BID } = this.props
    const { edData } = this.state
    let item = {}
    if (edData.length > 0) {
      item = {...edData[edData.length - 1]}
      item.key = item.key + 1
      item.$$uuid = '$new'
    } else {
      item.key = 0
      item.$$uuid = '$new'
      item.$$BID = BID || ''
    }
    this.setState({edData: [...edData, item]})
  }
  checkData = () => {
src/tabviews/custom/components/module/voucher/voucherTable/index.scss
@@ -175,12 +175,12 @@
      bottom: 0px;
      border: 1px solid #1890ff;
    }
    .anticon {
      color: #ff4d4f;
      position: absolute;
      right: 3px;
      top: calc(50% - 8px);
    }
    // .anticon {
    //   color: #ff4d4f;
    //   position: absolute;
    //   right: 3px;
    //   top: calc(50% - 8px);
    // }
  }
  td.pointer {
    position: relative;
@@ -196,6 +196,39 @@
      right: 0;
    }
  }
  .anticon-plus {
    position: absolute;
    left: 0px;
    height: 60px;
    top: 0px;
    line-height: 60px;
    width: 25px;
    color: #26C281;
    cursor: pointer;
    display: none;
  }
  .anticon-close {
    position: absolute;
    right: 0px;
    height: 60px;
    top: 0px;
    line-height: 60px;
    width: 25px;
    color: #ff4d4f;
    cursor: pointer;
    display: none;
  }
  tr:hover {
    .anticon-plus {
      left: -25px;
      display: inline-block;
    }
    .anticon-close {
      right: -25px;
      display: inline-block;
    }
  }
}
.edit-table-dropdown {
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
@@ -249,7 +249,6 @@
      col.required = col.required || 'true'
      col.type = col.type || 'Nvarchar(50)'
      col.import = col.import || 'true'
      col.required = col.required || 'true'
      if (col.type === 'text' || col.type === 'image') {
        col.type = 'Nvarchar(50)'
@@ -455,6 +454,13 @@
    const { verify } = this.state
    columns = columns.map(col => {
      col.type = col.type || 'Nvarchar(50)'
      if (col.type === 'text' || col.type === 'image') {
        col.type = 'Nvarchar(50)'
      } else if (col.type === 'number') {
        col.type = 'Decimal(18,2)'
      }
      if (/^Nvarchar/ig.test(col.type)) {
        col.limit = col.type.match(/\d+/) ? col.type.match(/\d+/)[0] : '20000'
      } else if (/^Decimal/ig.test(col.type)) {
@@ -466,6 +472,9 @@
        col.limit = ''
      }
      col.required = col.required || 'true'
      col.import = col.import || 'true'
      return col
    })
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
@@ -811,22 +811,37 @@
  changeColumns = (columns) => {
    const { verify } = this.state
    if (columns[0] && !['image', 'text', 'number'].includes(columns[0].type)) {
      columns = columns.map(col => {
        let _cell = {
          uuid: Utils.getuuid(),
          Column: col.Column,
          Text: col.Text,
          Width: 20,
          abs: 'false',
          output: col.output || 'true',
          required: col.required || 'false',
          type: 'text',
      col.type = col.type || 'text'
      col.output = col.output || 'true'
      col.required = col.required || 'false'
      if (!['text', 'image', 'number'].includes(col.type)) {
        if (/^Decimal/ig.test(col.type)) {
          col.type = 'number'
        } else {
          col.type = 'text'
        }
        }
        return _cell
      return col
      })
    }
    // if (columns[0] && !['image', 'text', 'number'].includes(columns[0].type)) {
    //   columns = columns.map(col => {
    //     let _cell = {
    //       uuid: Utils.getuuid(),
    //       Column: col.Column,
    //       Text: col.Text,
    //       Width: 20,
    //       abs: 'false',
    //       output: col.output || 'true',
    //       required: col.required || 'false',
    //       type: 'text',
    //     }
    //     return _cell
    //   })
    // }
    this.setState({verify: {...verify, columns}})
  }