king
2023-02-10 253fbcbdd06f6354e857a8e1e47ddf116459df42
2023-02-10
3个文件已修改
4个文件已添加
238 ■■■■ 已修改文件
src/menu/components/share/markcomponent/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/index.jsx 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/resetAttach/index.jsx 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/resetAttach/index.scss 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/resetRemark/index.jsx 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/resetRemark/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/updatetable/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/markcomponent/index.jsx
@@ -265,6 +265,9 @@
      if (item.signType && item.signType[0] === 'icon') {
        item.signType = [item.signType[0] + item.signType[1], item.signType[2], item.signType[3]]
      }
      if (!item.uuid) {
        item.uuid = Utils.getuuid()
      }
      return item
    })
src/tabviews/custom/components/module/voucher/index.jsx
@@ -11,8 +11,9 @@
import './index.scss'
const { confirm } = Modal
const { TextArea } = Input
const VoucherTable = asyncComponent(() => import('./voucherTable'))
const ResetRemark = asyncComponent(() => import('./resetRemark'))
const ResetAttach = asyncComponent(() => import('./resetAttach'))
class VoucherModule extends Component {
  static propTpyes = {
@@ -34,8 +35,8 @@
    book: null,
    username: sessionStorage.getItem('User_Name'),
    remark: '',
    remarkVisible: false,
    attachments: 0,
    attachlist: [],
    title: '',
    orgcode: '',
    orgname: '',
@@ -603,23 +604,7 @@
  }
  triggerprint = () => {
    this.setState({remarkVisible: true})
  }
  remarkSubmit = () => {
    const { config } = this.state
    let node = document.getElementById(config.uuid + 'remark')
    let val = node.value
    if (val && val.length > 512) {
      notification.warning({
        top: 92,
        message: '当前内容超长,备注最多512个字符。',
        duration: 5
      })
      return
    }
    this.setState({remark: val, remarkVisible: false})
  }
  dataChange = (data) => {
@@ -651,7 +636,7 @@
  }
  updateVoucherChar = (val) => {
    const {book} = this.state
    const { book, config } = this.state
    if (!book) return
@@ -674,17 +659,38 @@
        return
      }
      // let typeOptions = res.char || []
      // let charInt = typeOptions[0] ? typeOptions[0].voucher_char_int + 1 : 1
      let typeOptions = res.char || []
      // this.setState({
      //   typeOptions: typeOptions,
      //   charType: typeOptions[0] ? typeOptions[0].voucher_class : '',
      //   charName: typeOptions[0] ? typeOptions[0].voucher_char : '',
      //   charInt: charInt,
      //   orgcode: res.orgcode,
      //   orgname: res.orgname,
      // })
      if (typeOptions.length > 0) {
        let charType = this.state.charType
        let charName = this.state.charName
        let charInt = this.state.charInt
        if (charType && typeOptions.filter(n => n.voucher_class === charType) > 0) {
          typeOptions.forEach(n => {
            if (n.voucher_class === charType) {
              charName = n.voucher_char
              charInt = n.voucher_char_int + 1
            }
          })
        } else {
          charType = typeOptions[0].voucher_class
          charName = typeOptions[0].voucher_char
          charInt = typeOptions[0].voucher_char_int + 1
        }
        this.setState({
          typeOptions: typeOptions,
          charType: charType,
          charName: charName,
          charInt: charInt
        })
      }
      let msg = window.GLOB.CacheVoucher.get(config.uuid) || {}
      msg.currency = res.currency || []
      window.GLOB.CacheVoucher.set(config.uuid, msg)
    })
  }
@@ -696,12 +702,8 @@
  }
  triggerAttach = () => {
  }
  render() {
    const { type, status, loading, config, typeOptions, charType, charInt, data, vouDate, username, remark, remarkVisible, attachments, title } = this.state
    const { type, status, loading, config, typeOptions, charType, charInt, data, vouDate, username, remark, attachments, title, attachlist } = this.state
    return (
      <div className="menu-voucher-wrap" style={config.style}>
@@ -734,24 +736,13 @@
            </div>
            <div className="voucher-affix">
              附单据 <InputNumber precision={0} value={attachments || 0} autoComplete="off" onChange={this.changeAttach}/> 张
              <Button type="link" className="" onClick={this.triggerAttach}>附件</Button>
              <Button type="link" className="" onClick={this.triggerprint}>备注</Button>
              <ResetAttach attachlist={attachlist} onChange={(vals) => this.setState({attachlist: vals})}/>
              <ResetRemark remark={remark} ID={config.uuid + 'remark'} onChange={(val) => this.setState({remark: val})}/>
            </div>
          </div> : null}
          <VoucherTable config={config} loading={loading} data={data} onChange={this.dataChange}/>
        </div>
        <div className="user">制单人:{username}</div>
        <Modal
          title="备注"
          visible={remarkVisible}
          width={700}
          maskClosable={false}
          onOk={this.remarkSubmit}
          onCancel={() => { this.setState({ remarkVisible: false })}}
          destroyOnClose
        >
          <TextArea id={config.uuid + 'remark'} defaultValue={remark} rows={6}/>
        </Modal>
      </div>
    )
  }
src/tabviews/custom/components/module/voucher/resetAttach/index.jsx
New file
@@ -0,0 +1,53 @@
import React, {Component} from 'react'
import { fromJS } from 'immutable'
import { Button, Modal } from 'antd'
import './index.scss'
class ResetAttach extends Component {
  state = {
    visible: false,
    list: ''
  }
  submit = () => {
    this.setState({remark: '', visible: false})
    this.props.onChange()
  }
  trigger = () => {
    const { attachlist } = this.props
    this.setState({visible: true, list: fromJS(attachlist).toJS()})
  }
  render() {
    const { visible } = this.state
    return (
      <>
        <Button type="link" onClick={this.trigger}>附件</Button>
        <Modal
          title="添加附件"
          wrapClassName="voucher-attach-wrap"
          visible={visible}
          width={700}
          maskClosable={false}
          onOk={this.submit}
          onCancel={() => { this.setState({ visible: false })}}
          cancelText=""
          destroyOnClose
        >
          <Button type="link" className="attach-type-btn" onClick={this.trigger}>上传新文件</Button>
          <Button type="link" className="attach-type-btn" onClick={this.trigger}>从会计电子档案选择</Button>
          <div className="attach-selected-list">
          </div>
        </Modal>
      </>
    )
  }
}
export default ResetAttach
src/tabviews/custom/components/module/voucher/resetAttach/index.scss
New file
@@ -0,0 +1,33 @@
.voucher-attach-wrap {
  .ant-modal-body {
    padding: 15px;
    .attach-type-btn {
      border-width: 1px;
      color: var(--mk-sys-color);
      border-color: var(--mk-sys-color);
      margin-right: 15px;
    }
    .attach-selected-list {
      height: 300px;
      overflow-y: auto;
      border: 1px solid #d8d8d8;
      margin-top: 10px;
    }
    .attach-selected-list::-webkit-scrollbar {
      width: 7px;
    }
    .attach-selected-list::-webkit-scrollbar-thumb {
      border-radius: 5px;
      box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13);
      background: rgba(0, 0, 0, 0.13);
    }
    .attach-selected-list::-webkit-scrollbar-track {
      box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
      border-radius: 3px;
      border: 1px solid rgba(0, 0, 0, 0.07);
      background: rgba(0, 0, 0, 0);
    }
  }
}
src/tabviews/custom/components/module/voucher/resetRemark/index.jsx
New file
@@ -0,0 +1,62 @@
import React, {Component} from 'react'
import { Button, Modal, Input, notification } from 'antd'
// import './index.scss'
const { TextArea } = Input
class ResetRemark extends Component {
  state = {
    visible: false,
    remark: ''
  }
  submit = () => {
    const { ID } = this.props
    let node = document.getElementById(ID)
    let val = node.value
    if (val && val.length > 512) {
      notification.warning({
        top: 92,
        message: '当前内容超长,备注最多512个字符。',
        duration: 5
      })
      return
    }
    this.setState({remark: '', visible: false})
    this.props.onChange(val)
  }
  trigger = () => {
    const { remark } = this.props
    this.setState({visible: true, remark: remark})
  }
  render() {
    const { ID } = this.props
    const { visible, remark } = this.state
    return (
      <>
        <Button type="link" onClick={this.trigger}>备注</Button>
        <Modal
          title="备注"
          visible={visible}
          width={700}
          maskClosable={false}
          onOk={this.submit}
          onCancel={() => { this.setState({ visible: false })}}
          destroyOnClose
        >
          <TextArea id={ID} defaultValue={remark} rows={6}/>
        </Modal>
      </>
    )
  }
}
export default ResetRemark
src/tabviews/custom/components/module/voucher/resetRemark/index.scss
src/templates/comtableconfig/updatetable/index.jsx
@@ -813,6 +813,7 @@
          if (m.signType === 'line') {
            lineMarks.push({
              $index: lineMarks.length + 1,
              uuid: Utils.getuuid(),
              field: field,
              color: color,
              contrastValue: m.contrastValue || '',
@@ -822,6 +823,7 @@
          } else {
            _col.marks.push({
              $index: _col.marks.length + 1,
              uuid: Utils.getuuid(),
              field: field,
              color: color,
              contrastValue: m.contrastValue || '',