king
2023-01-31 90fff0ec484bbb3a10248f389cb9c4bddeff93ed
2023-01-31
27个文件已修改
733 ■■■■ 已修改文件
src/assets/css/viewstyle.scss 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/balcony/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/data-card/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/prop-card/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/table-card/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/code/sandbox/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/editor/braft-editor/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/editor/braft-editor/options.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/simple-form/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/step-form/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/tab-form/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/group/normal-group/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/module/voucher/index.jsx 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/module/voucher/index.scss 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/module/voucher/options.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/timeline/normal-timeline/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/tree/antd-tree/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/stylecontroller/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/mobshell/card.jsx 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/components/login/normal-login/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/components/login/normal-login/options.jsx 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/menushell/card.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/index.jsx 237 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/voucherTable/index.jsx 246 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/viewstyle.scss
@@ -26,19 +26,6 @@
          }
        }
      }
      .ant-tabs-nav .ant-tabs-tab-active {
        color: $color6;
      }
      .ant-tabs-nav .ant-tabs-ink-bar {
        background-color: $color6;
      }
      .ant-tabs-nav .ant-tabs-tab:active {
        color: $color7;
      }
      .ant-tabs-nav .ant-tabs-tab:hover {
        color: $color5;
      }
    }
    >.mk-breadview-wrap {
      >.ant-breadcrumb {
@@ -205,6 +192,19 @@
    }
  }
  .ant-tabs-nav .ant-tabs-tab-active {
    color: $color6;
  }
  .ant-tabs-nav .ant-tabs-ink-bar {
    background-color: $color6;
  }
  .ant-tabs-nav .ant-tabs-tab:active {
    color: $color7;
  }
  .ant-tabs-nav .ant-tabs-tab:hover {
    color: $color5;
  }
  // 系统样式修改
  .ant-select-dropdown-menu-item:hover:not(.ant-select-dropdown-menu-item-disabled) {
    background-color: $color1;
@@ -361,6 +361,12 @@
      background-color: $color6;
    }
  }
  .ant-tree li .ant-tree-node-content-wrapper:hover {
    background-color: $color1;
  }
  .ant-tree li .ant-tree-node-content-wrapper.ant-tree-node-selected {
    background-color: $color2;
  }
}
body.hidden-split-line #root { // 去除登录页分割线
src/menu/components/card/balcony/index.jsx
@@ -191,7 +191,7 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (style) => {
src/menu/components/card/cardcellcomponent/index.jsx
@@ -149,6 +149,7 @@
        options = ['margin', 'float']
      } else {
        options.push('width', 'minHeight', 'float')
        _style.minHeight = _style.minHeight || '28px'
      }
      if (element.wrapStyle) {
        _style.float = element.wrapStyle.textAlign || 'left'
src/menu/components/card/data-card/index.jsx
@@ -288,7 +288,7 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', ['background', 'height', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['background', 'height', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (style) => {
src/menu/components/card/prop-card/index.jsx
@@ -304,7 +304,7 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (style) => {
src/menu/components/card/table-card/index.jsx
@@ -254,7 +254,7 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (style) => {
src/menu/components/code/sandbox/index.jsx
@@ -128,7 +128,7 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (style) => {
src/menu/components/editor/braft-editor/index.jsx
@@ -46,7 +46,7 @@
        name: card.name,
        subtype: card.subtype,
        setting: { interType: 'system' },
        wrap: { name: card.name, datatype: 'dynamic', width: card.width || 24, encryption: 'true', minHeight: 100 },
        wrap: { name: card.name, datatype: 'dynamic', width: card.width || 24, encryption: 'true' },
        style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' },
        headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' },
        columns: [],
@@ -128,7 +128,7 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (style) => {
@@ -164,9 +164,6 @@
    const { card } = this.state
    let style = {...card.style}
    if (card.wrap.minHeight) {
      style.minHeight = card.wrap.minHeight
    }
    return (
      <div className="menu-normal-editor-box" style={style} onClick={this.clickComponent} id={card.uuid}>
src/menu/components/editor/braft-editor/options.jsx
@@ -80,16 +80,6 @@
      ]
    },
    {
      type: 'number',
      field: 'minHeight',
      label: '最小高度',
      initval: wrap.minHeight || '',
      min: 0,
      max: 3000,
      precision: 0,
      required: false
    },
    {
      type: 'radio',
      field: 'permission',
      label: '权限验证',
src/menu/components/form/simple-form/index.jsx
@@ -194,7 +194,7 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (style) => {
src/menu/components/form/step-form/index.jsx
@@ -201,7 +201,7 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (style) => {
src/menu/components/form/tab-form/index.jsx
@@ -213,7 +213,7 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (style) => {
src/menu/components/group/normal-group/index.jsx
@@ -72,7 +72,7 @@
  changeStyle = () => {
    const { group } = this.state
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear'], group.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], group.style, this.getStyle)
  }
  getStyle = (style) => {
src/menu/components/module/voucher/index.jsx
@@ -39,7 +39,7 @@
        name: '凭证',
        subtype: card.subtype,
        // setting: { interType: 'system' },
        wrap: { name: '凭证', title: '', width: card.width || 12, type: 'edit' },
        wrap: { name: '凭证', title: '', width: card.width || 12, type: 'createVoucher' },
        style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px', paddingBottom: '20px' },
        headerStyle: {},
        columns: [],
@@ -84,7 +84,7 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (style) => {
@@ -101,7 +101,6 @@
  updateWrap = (res) => {
    let _card = {...this.state.card, wrap: res}
    _card.switchable = res.type !== 'edit'
    this.updateComponent(_card)
  }
@@ -123,31 +122,48 @@
          <ToolOutlined />
        </Popover>
        <div className="voucher-box">
          <div className="voucher-header">
            <Button className="add-background header-btn">新增</Button>
          {card.wrap.type === 'createVoucher' ? <div className="voucher-header">
            <Button className="add-background header-btn">保存并新增</Button>
            <Button className="add-background header-btn">保存</Button>
            <Button className="print-background header-btn">打印</Button>
            <Button className="system-background header-btn">导入</Button>
            <Button className="out-background header-btn">导出</Button>
          </div>
            <Button className="out-background header-btn">更多</Button>
          </div> : null}
          {card.wrap.type === 'checkVoucher' ? <div className="voucher-header">
            <Button className="add-background header-btn">保存</Button>
            <Button className="print-background header-btn">打印</Button>
            <Button className="out-background header-btn">关闭</Button>
          </div> : null}
          <div className="voucher-body">
          <div className="pre-wrap">
            <div className="voucher-code">
              <div>记<DownOutlined/></div>
              <div>1</div>
              号
            </div>
            <div className="voucher-date">
              日期:<div>请选择日期 <CalendarOutlined /></div>
            </div>
            <div className="voucher-affix">
              附单据 <div>2</div> 张
              <Button type="link" className="">附件</Button>
              <Button type="link" className="">备注</Button>
            </div>
            {card.wrap.type === 'createVoucher' || card.wrap.type === 'checkVoucher' ? <div className="pre-wrap">
              <div className="voucher-code">
                <div>记<DownOutlined/></div>
                <div>1</div>
                号
              </div>
              <div className="voucher-date">
                日期:<div>请选择日期 <CalendarOutlined /></div>
              </div>
              <div className="voucher-affix">
                附单据 <div>2</div> 张
                <Button type="link" className="">附件</Button>
                <Button type="link" className="">备注</Button>
              </div>
            </div> : null}
            {card.wrap.type === 'createTemp' || card.wrap.type === 'checkTemp' ? <div className="pre-wrap">
              <div className="temp-code">
                模板名称:
                <div>&nbsp;</div>
              </div>
              <div className="temp-code">
                模板类型:
                <div>日常支出<DownOutlined/></div>
              </div>
              <Button className="out-background header-btn">关闭</Button>
              <Button className="add-background header-btn">保存</Button>
            </div> : null}
            <VoucherTable config={card}/>
            {card.wrap.type === 'createVoucher' || card.wrap.type === 'checkVoucher' ? <div className="user">制单人:</div> : null}
          </div>
          <VoucherTable config={card}/>
        </div>
        </div>
      </div>
    )
src/menu/components/module/voucher/index.scss
@@ -53,6 +53,33 @@
        }
      }
    }
    .temp-code {
      display: inline-block;
      width: 180px;
      margin-right: 15px;
      div {
        display: inline-block;
        min-width: 100px;
        margin-right: 10px;
        margin-left: 10px;
        border: 1px solid #d9d9d9;
        padding: 4px 10px;
        border-radius: 4px;
        .anticon-down {
          position: relative;
          left: 3px;
          color: #c8c8c8;
          font-size: 12px;
          margin-left: 5px;
        }
      }
    }
    .header-btn {
      float: right;
      margin-left: 10px;
    }
    .pre-wrap {
      padding: 10px 0px;
    }
@@ -87,6 +114,9 @@
        border-radius: 4px;
      }
    }
    .user {
      padding-top: 15px;
    }
  }
  .add-background {
src/menu/components/module/voucher/options.jsx
@@ -29,14 +29,16 @@
    //   required: false
    // },
    {
      type: 'radio',
      type: 'select',
      field: 'type',
      label: '类型',
      initval: wrap.type || 'edit',
      initval: wrap.type || 'createVoucher',
      required: true,
      options: [
        {value: 'edit', label: '编辑'},
        {value: 'check', label: '查看'},
        {value: 'createVoucher', label: '新增凭证'},
        {value: 'checkVoucher', label: '查看凭证'},
        {value: 'createTemp', label: '新增模板'},
        {value: 'checkTemp', label: '编辑模板'},
      ]
    },
    {
src/menu/components/table/edit-table/index.jsx
@@ -228,7 +228,7 @@
    style.fontSize = card.wrap.fontSize || 14
    style.fontWeight = card.wrap.fontWeight || 'normal'
    MKEmitter.emit('changeStyle', ['font1', 'background', 'border', 'padding', 'margin', 'shadow', 'clear'], style, this.getStyle)
    MKEmitter.emit('changeStyle', ['font1', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], style, this.getStyle)
  }
  getStyle = (style) => {
src/menu/components/table/normal-table/index.jsx
@@ -280,7 +280,7 @@
    style.fontSize = card.wrap.fontSize || 14
    style.fontWeight = card.wrap.fontWeight || 'normal'
    MKEmitter.emit('changeStyle', ['font1', 'background', 'border', 'padding', 'margin', 'shadow', 'clear'], style, this.getStyle)
    MKEmitter.emit('changeStyle', ['font1', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], style, this.getStyle)
  }
  getStyle = (style) => {
src/menu/components/timeline/normal-timeline/index.jsx
@@ -165,7 +165,7 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (style) => {
src/menu/components/tree/antd-tree/index.jsx
@@ -129,7 +129,7 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (style) => {
src/menu/stylecontroller/index.jsx
@@ -913,7 +913,7 @@
                    label={<ColumnHeightOutlined title="最小高度"/>}
                    labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
                  >
                    <StyleInput defaultValue={card.minHeight || '28px'} options={['px']} onChange={(val) => this.changeNormalStyle(val, 'minHeight')}/>
                    <StyleInput defaultValue={card.minHeight || ''} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'minHeight')}/>
                  </Form.Item>
                </Col>
              </Panel> : null}
src/mob/mobshell/card.jsx
@@ -72,21 +72,21 @@
  }
  let col = 'ant-col-' + (card.width || 24)
  if (card.type === 'login') {
    let height = ''
    if (card.wrap && card.wrap.height) {
      // scaleview
      height = card.wrap.height.replace(/\d+vw/ig, (word) => {
        return parseFloat(word) * (window.GLOB.winWidth || 420) / 100 + 'px'
        // return parseFloat(word) * 350 / 100 + 'px'
      }).replace(/\d+vh/ig, (word) => {
        return parseFloat(word) * (window.GLOB.winHeight || 738) / 100 + 'px'
        // return parseFloat(word) * 615 / 100 + 'px'
      })
    }
  // if (card.type === 'login') {
  //   let height = ''
  //   if (card.wrap && card.wrap.height) {
  //     // scaleview
  //     height = card.wrap.height.replace(/\d+vw/ig, (word) => {
  //       return parseFloat(word) * (window.GLOB.winWidth || 420) / 100 + 'px'
  //       // return parseFloat(word) * 350 / 100 + 'px'
  //     }).replace(/\d+vh/ig, (word) => {
  //       return parseFloat(word) * (window.GLOB.winHeight || 738) / 100 + 'px'
  //       // return parseFloat(word) * 615 / 100 + 'px'
  //     })
  //   }
    
    style.minHeight = height
  }
  //   style.minHeight = height
  // }
  const getCardComponent = () => {
    if (card.type === 'bar' || card.type === 'line') {
src/pc/components/login/normal-login/index.jsx
@@ -71,6 +71,11 @@
      if (_card.wrap.classify === 'signin') {
        active = 'signin'
      }
      if (!_card.style.minHeight && _card.wrap.height) {
        _card.style.minHeight = _card.wrap.height
        delete _card.wrap.height
      }
      this.setState({
        active,
        card: _card
@@ -114,7 +119,7 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', ['width', 'background', 'border', 'padding', 'margin', 'clear'], card.style, this.getStyle)
    MKEmitter.emit('changeStyle', ['width', 'background', 'border', 'padding', 'margin', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (style) => {
src/pc/components/login/normal-login/options.jsx
@@ -70,15 +70,15 @@
    //   precision: 0,
    //   required: false
    // },
    {
      type: 'styleInput',
      field: 'height',
      label: '最小高度',
      initval: wrap.height || '',
      tooltip: '组件占用的最小高度,用于页面布局。',
      required: false,
      options: ['px', 'vh', 'vw', '%']
    },
    // {
    //   type: 'styleInput',
    //   field: 'height',
    //   label: '最小高度',
    //   initval: wrap.height || '',
    //   tooltip: '组件占用的最小高度,用于页面布局。',
    //   required: false,
    //   options: ['px', 'vh', 'vw', '%']
    // },
    // {
    //   type: 'styleInput',
    //   field: 'maxWidth',
src/pc/menushell/card.jsx
@@ -71,21 +71,6 @@
  }
  
  let col = ' ant-col ant-col-' + (card.width || 24)
  if (card.type === 'login') {
    let height = ''
    if (card.wrap && card.wrap.height) {
      // scaleview
      height = card.wrap.height.replace(/\d+vw/ig, (word) => {
        return parseFloat(word) * (window.GLOB.winWidth || 420) / 100 + 'px'
        // return parseFloat(word) * 350 / 100 + 'px'
      }).replace(/\d+vh/ig, (word) => {
        return parseFloat(word) * (window.GLOB.winHeight || 738) / 100 + 'px'
        // return parseFloat(word) * 615 / 100 + 'px'
      })
    }
    style.minHeight = height
  }
  const getCardComponent = () => {
    if (card.type === 'bar' || card.type === 'line') {
src/tabviews/custom/components/module/voucher/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Button, Select, Input, DatePicker, notification } from 'antd'
import { Button, Select, Input, Modal, DatePicker, notification } from 'antd'
import moment from 'moment'
import Api from '@/api'
@@ -9,6 +9,7 @@
import MKEmitter from '@/utils/events.js'
import './index.scss'
const { confirm } = Modal
const VoucherTable = asyncComponent(() => import('./voucherTable'))
class VoucherModule extends Component {
@@ -18,18 +19,18 @@
  state = {
    BID: '',
    type: 'createVoucher',
    config: null,
    loading: false,
    data: [],
    disableAdd: false,
    disableSave: false,
    tbdata: [],
    typeOptions: [],
    charType: '',
    charInt: '',
    vouDate: null,
    book: null,
    username: sessionStorage.getItem('User_Name'),
    change: false
    status: '' // 新建时,empty、change、saved
  }
  UNSAFE_componentWillMount () {
@@ -48,13 +49,16 @@
    }
    window.GLOB.CacheVoucher.delete(config.uuid)
    let type = config.wrap.type || 'createVoucher'
    this.setState({
      config: fromJS(config).toJS(),
      type: type,
      BID: BID || '',
      status: 'empty',
      book: window.GLOB.CacheData.get(config.wrap.supBook) || null
    }, () => {
      this.loadData()
      this.getVoucher()
    })
  }
@@ -97,7 +101,7 @@
    if (!config.wrap.supModule || config.wrap.supModule !== MenuID) return
    if (id !== this.state.BID || id !== '') {
      this.setState({ BID: id, BData: data }, () => {
        this.loadData()
        this.getVoucher()
      })
    }
  }
@@ -185,15 +189,19 @@
      }
      window.GLOB.CacheVoucher.set(config.uuid, message)
      setTimeout(() => {
        this.getVoucher()
      }, 200)
    })
  }
  getVoucher = () => {
    const { BID, type } = this.state
    if (!BID || type === 'createVoucher' || type === 'createTemp') return
    let param = {
      func: 's_get_fcc_voucher',
      BID: BID
    }
    let data = [
      {remark: '提现', subjectscode: '1001', subjectsname: '库存现金', debtor: 124, creditor: ''},
      {remark: '购入固定资产', subjectscode: '1001', subjectsname: '库存现金', debtor: '', creditor: 124},
@@ -201,37 +209,192 @@
      {remark: '提现', subjectscode: '1001', subjectsname: '库存现金', debtor: 34, creditor: '', i: Math.random()},
    ]
    this.setState({
      data: data
    Api.genericInterface(param).then(res => {
      if (!res.status) {
        notification.warning({
          top: 92,
          message: res.message,
          duration: 5
        })
        return
      }
      this.setState({
        data: data,
        tbdata: fromJS(data).toJS()
      })
    })
  }
  triggeradd = () => {
  triggersave = (t) => {
    const { tbdata } = this.state
    let err = ''
    let tip = ''
    let list = []
    tbdata.forEach((line, index) => {
      if (err) return
      if (line.type === 'total') {
        if (line.debtor !== line.creditor) {
          err = '借贷不平衡!'
        }
        return
      }
      let _index = index + 1
      if (!line.remark && !line.subjectscode && !line.debtor && line.debtor !== 0 && !line.creditor && line.creditor !== 0) {
        if (_index === 1) {
          err = '第1行不可为空。'
        }
        return
      }
      if (!line.remark) {
        err = `第${_index}行,摘要不可为空。`
      } else if (!line.subjectscode) {
        err = `第${_index}行,科目不可为空。`
      } else if (!line.debtor && line.debtor !== 0 && !line.creditor && line.creditor !== 0) {
        err = `第${_index}行,请输入金额。`
      } else if (line.debtor === 0 || line.creditor === 0) {
        err = `第${_index}行,金额不能为0。`
      } else if (line.sup_accounting) {
        line.sup_accounting.split(',').forEach(item => {
          if (!line[item]) {
            err = `第${_index}行,请选择辅助核算。`
          }
        })
      }
      if (line.count_type === 'Y' && !err) {
        if (!line.count) {
          tip += `第${_index}行,数量为空或为0!;`
        } else if (line.price) {
          if (line.debtor && line.debtor !== line.count * line.price) {
            tip += `第${_index}行,数量和金额不匹配!;`
          } else if (line.creditor && line.creditor !== line.count * line.price) {
            tip += `第${_index}行,数量和金额不匹配!;`
          }
        }
      }
      list.push(line)
    })
    if (!err && list.length === 0) {
      err = '第1行不可为空。'
    }
    if (err) {
      notification.warning({
        top: 92,
        message: err,
        duration: 5
      })
      return
    }
    if (tip) {
      const _this = this
      confirm({
        content: tip + '确认要保存吗?',
        onOk() {
          _this.voucherSave(list, t)
        },
        onCancel() {}
      })
    } else {
      this.voucherSave(list, t)
    }
  }
  triggersave = () => {
  voucherSave = (list, t) => {
    const { BID, config, charInt, charType, book } = this.state
    if (!book) {
      notification.warning({
        top: 92,
        message: '请选择账套!',
        duration: 5
      })
      return
    }
    let param = {
      func: 's_fcc_voucher_addupt',
      BID: BID,
      voucher_code: '',
      voucher_text: '',
      remark: '',
      account_year_code: '',
      voucher_type: '',
      voucher_type_text: '',
      orgcode: '',
      orgname: '',
      voucher_class: '',
      years: book.years,
      business_type: '',
      voucher_sign: '',
      voucher_char: charType,
      voucher_char_int: charInt,
      account_code: book.account_code || '',
      fibvoucherdate: '',
      UserName: sessionStorage.getItem('User_Name') || '',
      FullName: sessionStorage.getItem('Full_Name') || '',
      sup_data: '',
      subject_data: ''
    }
    Api.genericInterface(param).then(res => {
      if (!res.status) {
        notification.warning({
          top: 92,
          message: res.message,
          duration: 5
        })
        return
      }
      if (t === 'add') {
        this.setState({
          status: 'empty',
          tbdata: [],
          charInt: charInt + 1
        })
        MKEmitter.emit('cleartable', config.uuid)
      } else {
        this.setState({
          status: 'saved'
        })
      }
    })
  }
  triggerprint = () => {
  }
  dataChange = (data) => {
    this.setState({
      status: 'change',
      tbdata: data
    })
  }
  render() {
    const { config, disableSave, disableAdd, typeOptions, charType, charInt, data, vouDate, username } = this.state
    const { type, status, loading, config, typeOptions, charType, charInt, data, vouDate, username } = this.state
    return (
      <div className="menu-voucher-wrap" style={config.style}>
        <div className="voucher-header">
          <Button className="add-background header-btn" disabled={disableAdd} onClick={this.triggeradd}>新增</Button>
          <Button className="add-background header-btn" disabled={disableSave} onClick={this.triggersave}>保存</Button>
          <Button className="print-background header-btn" disabled={disableSave} onClick={this.triggerprint}>打印</Button>
          <Button className="system-background header-btn" disabled={disableSave} onClick={this.triggerprint}>导入</Button>
          <Button className="out-background header-btn" disabled={disableSave} onClick={this.triggerprint}>导出</Button>
        </div>
        {config.wrap.type === 'edit' ? <div className="voucher-body">
          <div className="pre-wrap">
        {type === 'createVoucher' ? <div className="voucher-header">
          <Button className="add-background header-btn" disabled={status === 'empty'} onClick={() => this.triggersave('add')}>保存并新增</Button>
          <Button className="add-background header-btn" disabled={status === 'empty' || status === 'saved'} onClick={() => this.triggersave()}>保存</Button>
          <Button className="print-background header-btn" disabled={status !== 'saved'} onClick={this.triggerprint}>打印</Button>
          <Button className="out-background header-btn" onClick={this.triggerprint}>更多</Button>
        </div> : null}
        <div className="voucher-body">
          {type === 'createVoucher' ? <div className="pre-wrap">
            <div className="voucher-code">
              <Select value={charType} dropdownClassName="mk-vcode-dropdown" onChange={(val, option) => this.setState({charType: val, charInt: option.props.charint})}>
                {typeOptions.map(option =>
@@ -248,25 +411,9 @@
              <Button type="link" className="" onClick={this.triggerprint}>附件</Button>
              <Button type="link" className="" onClick={this.triggerprint}>备注</Button>
            </div>
          </div>
          <VoucherTable config={config} data={data}/>
        </div> : null}
        {config.wrap.type === 'check' ? <div className="voucher-body">
          <div className="pre-wrap">
            <div className="voucher-code">
              记 1 号
            </div>
            <div className="voucher-date">
              日期:2022-02-24
            </div>
            <div className="voucher-affix">
              附单据 2 张
              <Button type="link" className="" onClick={this.triggerprint}>附件</Button>
              <Button type="link" className="" onClick={this.triggerprint}>备注</Button>
            </div>
          </div>
          <VoucherTable config={config} data={data}/>
        </div> : null}
          </div> : null}
          <VoucherTable config={config} loading={loading} data={data} onChange={this.dataChange}/>
        </div>
        <div className="user">制单人:{username}</div>
      </div>
    )
src/tabviews/custom/components/module/voucher/voucherTable/index.jsx
@@ -1,14 +1,11 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Table, Modal, Form, Input, InputNumber, notification, message, AutoComplete, Select, Popover, Button } from 'antd'
import { Table, Form, Input, InputNumber, notification, AutoComplete, Select, Popover, Button } from 'antd'
import { PlusOutlined, CloseOutlined } from '@ant-design/icons'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import MKEmitter from '@/utils/events.js'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import './index.scss'
class BodyRow extends React.Component {
@@ -155,24 +152,29 @@
    this.setState({editing: false})
    let line = {...record}
    line[col.field] = value
    if (value !== record[col.field]) {
      line[col.field] = value
      if (col.field === 'debtor') {
        line.creditor = ''
        if (isNaN(line.debtor)) {
          line.debtor = ''
        }
      } else {
    if (col.field === 'debtor') {
      line.creditor = ''
      if (isNaN(line.debtor)) {
        line.debtor = ''
        if (isNaN(line.creditor)) {
          line.creditor = ''
        }
      }
      MKEmitter.emit('changeRecord', col.tableId, line)
    } else {
      line.debtor = ''
      if (isNaN(line.creditor)) {
        line.creditor = ''
      }
    }
    if (line.count_type === 'Y' && line.count) {
      if (line.debtor) {
        line.price = Math.round(line.debtor / line.count * 10000) / 10000
      } else if (line.creditor) {
        line.price = Math.round(line.creditor / line.count * 10000) / 10000
      }
    }
    MKEmitter.emit('changeRecord', col.tableId, line)
    setTimeout(() => {
      if (col.field === 'debtor' && (line.debtor || line.debtor === 0)) {
@@ -224,6 +226,14 @@
        line.debtor = ''
        if (isNaN(line.creditor)) {
          line.creditor = ''
        }
      }
      if (line.count_type === 'Y' && line.count) {
        if (line.debtor) {
          line.price = Math.round(line.debtor / line.count * 10000) / 10000
        } else if (line.creditor) {
          line.price = Math.round(line.creditor / line.count * 10000) / 10000
        }
      }
@@ -361,6 +371,10 @@
      line.count = 0
    }
    if (line.count && line.price) {
      line.debtor = Math.round(line.count * line.price * 100) / 100
    }
    MKEmitter.emit('changeRecord', col.tableId, line)
    this.setState({counting: false, priceing: true, value: line.price || 0}, () => {
@@ -381,6 +395,10 @@
    if (isNaN(line.count)) {
      line.count = 0
    }
    if (line.count && line.price) {
      line.debtor = Math.round(line.count * line.price * 100) / 100
    }
    
    MKEmitter.emit('changeRecord', col.tableId, line)
  }
@@ -394,6 +412,10 @@
    if (isNaN(line.price)) {
      line.price = 0
    }
    if (line.count && line.price) {
      line.debtor = Math.round(line.count * line.price * 100) / 100
    }
    MKEmitter.emit('changeRecord', col.tableId, line)
@@ -415,6 +437,10 @@
    if (isNaN(line.price)) {
      line.price = 0
    }
    if (line.count && line.price) {
      line.debtor = Math.round(line.count * line.price * 100) / 100
    }
    
    MKEmitter.emit('changeRecord', col.tableId, line)
@@ -542,7 +568,7 @@
      }
    } 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}/>
        children = <InputNumber id={col.uuid + record.uuid} precision={2} defaultValue={record.debtor} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/>
      } else {
        let val = record.debtor
        let down = false
@@ -563,7 +589,7 @@
      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}/>
        children = <InputNumber id={col.uuid + record.uuid} precision={2} defaultValue={record.creditor} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/>
      } else {
        let val = record.creditor
        let down = false
@@ -591,22 +617,16 @@
class VoucherTable extends Component {
  static propTpyes = {
    config: PropTypes.object,        // 菜单Id
    BID: PropTypes.any,              // 主表ID
    data: PropTypes.any,             // 表格数据
    total: PropTypes.any,            // 总数
    loading: PropTypes.bool,         // 表格加载中
    refreshdata: PropTypes.func,     // 表格中排序列、页码的变化时刷新
    onChange: PropTypes.func,        // 表格变动
  }
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    data: [],
    edData: [],
    edColumns: [],
    tableId: '',          // 表格ID
    pageSize: 10,         // 每页数据条数
    columns: null,        // 显示列
    loading: false,
  }
  UNSAFE_componentWillMount () {
@@ -682,6 +702,7 @@
    MKEmitter.addListener('nextLine', this.nextLine)
    MKEmitter.addListener('plusLine', this.plusLine)
    MKEmitter.addListener('delRecord', this.delRecord)
    MKEmitter.addListener('cleartable', this.cleartable)
    MKEmitter.addListener('changeRecord', this.changeRecord)
  }
@@ -695,6 +716,7 @@
    MKEmitter.removeListener('nextLine', this.nextLine)
    MKEmitter.removeListener('plusLine', this.plusLine)
    MKEmitter.removeListener('delRecord', this.delRecord)
    MKEmitter.removeListener('cleartable', this.cleartable)
    MKEmitter.removeListener('changeRecord', this.changeRecord)
  }
@@ -702,6 +724,14 @@
    if (!is(fromJS(this.props.data), fromJS(nextProps.data))) {
      this.resetData(fromJS(nextProps.data).toJS())
    }
  }
  cleartable = (tbid) => {
    const { tableId } = this.state
    if (tbid !== tableId) return
    this.resetData([])
  }
  resetData = (data) => {
@@ -863,6 +893,7 @@
      this.setState({edData: _data}, () => {
        MKEmitter.emit('tdFocus', 'remark' + line.uuid)
      })
      this.props.onChange(_data)
    }
  }
@@ -875,11 +906,13 @@
    let line = {uuid: Utils.getuuid(), index: 0, remark: '', subjectscode: '', subjectsname: '', debtor: '', creditor: ''}
    _data.splice(record.index, 0, line)
    this.setState({edData: _data.map((item, index) => {
    _data = _data.map((item, index) => {
      item.index = index
      return item
    })})
    })
    this.setState({edData: _data})
    this.props.onChange(_data)
  }
  delRecord = (id, record) => {
@@ -905,6 +938,7 @@
    _data.push(this.getTotalLine(_data))
    this.setState({edData: _data})
    this.props.onChange(_data)
  }
  changeRecord = (tableId, record) => {
@@ -927,155 +961,7 @@
    _data.push(this.getTotalLine(_data))
    this.setState({edData: _data})
  }
  checkData = () => {
    const { edData } = this.state
    let err = ''
    let data = fromJS(edData).toJS().map(item => {
      // let line = []
      // fields.forEach(col => {
      //   if (col.editable !== 'true' || item.$deleted) {
      //     if (col.type === 'number') {
      //       item[col.field] = +item[col.field]
      //       if (isNaN(item[col.field])) {
      //         item[col.field] = 0
      //       }
      //     } else {
      //       item[col.field] = item[col.field] !== undefined ? (item[col.field] + '') : ''
      //     }
      //     return
      //   }
      //   if (col.type === 'text') {
      //     let val = item[col.field] !== undefined ? (item[col.field] + '') : ''
      //     if (col.required === 'true' && !val) {
      //       line.push(`${col.label}不可为空`)
      //     }
      //     item[col.field] = val
      //   } else if (col.type === 'number') {
      //     let val = item[col.field]
      //     if (!val && val !== 0) {
      //       line.push(`${col.label}不可为空`)
      //       return
      //     }
      //     val = +val
      //     if (isNaN(val)) {
      //       line.push(`${col.label}数据格式错误`)
      //       return
      //     }
      //     val = +val.toFixed(col.decimal || 0)
      //     if (typeof(col.max) === 'number' && val > col.max) {
      //       line.push(`${col.label}不可大于${col.max}`)
      //     } else if (typeof(col.min) === 'number' && val < col.min) {
      //       line.push(`${col.label}不可小于${col.min}`)
      //     }
      //     item[col.field] = val
      //   }
      // })
      return item
    })
    if (err) {
      notification.warning({
        top: 92,
        message: err,
        duration: 5
      })
    } else {
      this.submit(data)
    }
  }
  submit = (data) => {
    const { BID } = this.props
    let param = {
      // excel_in: result.lines,
      BID: BID || ''
    }
    this.setState({
      loading: true
    })
    param.func = 'submit.innerFunc'
    Api.genericInterface(param).then((res) => {
      if (res.status) {
        this.execSuccess(res)
      } else {
        this.execError(res)
      }
    }, () => {
      this.execError({})
    })
  }
  execSuccess = (res) => {
    const { submit } = this.props
    if (res && res.ErrCode === 'S') { // 执行成功
      notification.success({
        top: 92,
        message: res.ErrMesg || this.state.dict['main.action.confirm.success'],
        duration: submit.stime ? submit.stime : 2
      })
    } else if (res && res.ErrCode === 'Y') { // 执行成功
      Modal.success({
        title: res.ErrMesg || this.state.dict['main.action.confirm.success']
      })
    } else if (res && res.ErrCode === '-1') { // 完成后不提示
    }
    this.setState({
      loading: false
    })
    if (submit.closetab === 'true') {
      MKEmitter.emit('popclose')
    }
    if (submit.execSuccess !== 'never') {
      MKEmitter.emit('refreshByButtonResult', submit.$menuId, submit.execSuccess, submit)
    }
  }
  execError = (res) => {
    const { submit } = this.props
    if (res.ErrCode === 'E') {
      Modal.error({
        title: res.message || res.ErrMesg,
      })
    } else if (res.ErrCode === 'N') {
      notification.error({
        top: 92,
        message: res.message || res.ErrMesg,
        duration: submit.ntime ? submit.ntime : 10
      })
    } else if (res.ErrCode === 'F') {
      notification.error({
        className: 'notification-custom-error',
        top: 92,
        message: res.message || res.ErrMesg,
        duration: submit.ftime ? submit.ftime : 10
      })
    } else if (res.ErrCode === 'NM') {
      message.error(res.message || res.ErrMesg)
    }
    this.setState({
      loading: false
    })
    if (submit.execError !== 'never') {
      MKEmitter.emit('refreshByButtonResult', submit.$menuId, submit.execError, submit)
    }
    this.props.onChange(_data)
  }
  render() {
@@ -1096,7 +982,7 @@
          columns={columns}
          dataSource={edData}
          bordered={true}
          // loading={this.props.loading}
          loading={this.props.loading}
          onRow={(record, index) => {
            return {
              data: record