king
2023-01-29 99c9aed75c0bf5356e3170b7070ed00d7ba653ca
2023-01-29
25个文件已修改
2个文件已删除
1628 ■■■■■ 已修改文件
src/assets/css/main.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/index.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/group/normal-group/index.jsx 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/module/voucher/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/tabs/tabcomponents/card.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/tabs/tabcomponents/index.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/menushell/card.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/menushell/index.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/tabs/tabcomponents/card.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/tabs/tabcomponents/index.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/mobshell/card.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/mobshell/index.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/menushell/card.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/menushell/index.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/basetable/index.scss 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/assistTable/index.jsx 734 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/assistTable/index.scss 259 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/index.jsx 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/voucherTable/index.jsx 228 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/voucherTable/index.scss 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.scss 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/popview/index.scss 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/fieldscomponent/index.jsx 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/modaleditable/index.jsx 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/modaleditable/index.scss 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/billprint/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/main.scss
@@ -488,4 +488,8 @@
  display: flex;
  flex: auto;
  min-height: 100%;
}
.component-wrap >.ant-col {
  min-height: 0;
}
src/components/header/index.jsx
@@ -225,6 +225,8 @@
  getMenulist = (result) => {
    let thdMenuList = []
    let menulist = []
    let names = new Map()
    let doublenames = new Map()
    result.fst_menu && result.fst_menu.forEach(fst => {
      let fstItem = {
        MenuID: fst.MenuID,
@@ -268,6 +270,7 @@
                ParentId: snd.MenuID,
                MenuID: trd.MenuID,
                MenuName: trd.MenuName,
                menu_name: trd.MenuName,
                ParentNames: [fst.MenuName, snd.MenuName],
                MenuNo: trd.MenuNo,
                EasyCode: trd.EasyCode,
@@ -296,6 +299,12 @@
              trdItem.OpenType = trdItem.OpenType.toLowerCase() // NewPage为打开外部页面地址
              if (names.has(trdItem.menu_name)) {
                doublenames.set(trdItem.menu_name, true)
              } else {
                names.set(trdItem.menu_name, true)
              }
              thdMenuList.push(trdItem)
              return trdItem
@@ -309,6 +318,13 @@
      }
      menulist.push(fstItem)
    })
    thdMenuList = thdMenuList.map(item => {
      if (doublenames.has(item.menu_name)) {
        item.menu_name += '(' + item.ParentNames.join('-') + ')'
      }
      return item
    })
    return { menulist, thdMenuList }
@@ -740,12 +756,12 @@
                        option.MenuNo.toLowerCase().indexOf(searchkey.toLowerCase()) >= 0 ||
                        option.EasyCode.toLowerCase().indexOf(searchkey.toLowerCase()) >= 0
                      ) {
                        return <Menu.Item key={option.MenuID} onClick={() => this.changeVerMenu(option)}>{option.MenuName}</Menu.Item>
                        return <Menu.Item key={option.MenuID} onClick={() => this.changeVerMenu(option)}>{option.menu_name}</Menu.Item>
                      } else {
                        return null
                      }
                    }
                    return <Menu.Item key={option.MenuID} onClick={() => this.changeVerMenu(option)}>{option.MenuName}</Menu.Item>
                    return <Menu.Item key={option.MenuID} onClick={() => this.changeVerMenu(option)}>{option.menu_name}</Menu.Item>
                  })}
                </Menu>
              </div>
src/index.js
@@ -290,6 +290,7 @@
    })
    window.GLOB.CacheMap = new Map()     // 缓存配置信息
    window.GLOB.CacheVoucher = new Map() // 缓存凭证信息
    window.GLOB.UserCacheMap = new Map() // 缓存用户自定义设置
    window.GLOB.CacheData = new Map()    // 存储选中数据
src/menu/components/group/normal-group/index.jsx
@@ -1,8 +1,8 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Popover, Button } from 'antd'
import { EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined, PrinterOutlined } from '@ant-design/icons'
import { Popover, Button, Modal } from 'antd'
import { EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined, PrinterOutlined, UngroupOutlined } from '@ant-design/icons'
import MKEmitter from '@/utils/events.js'
import asyncComponent from '@/utils/asyncComponent'
@@ -11,6 +11,7 @@
import getSettingForm from './options'
import './index.scss'
const { confirm } = Modal
const NormalForm = asyncIconComponent(() => import('@/components/normalform'))
const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader'))
@@ -21,6 +22,7 @@
  static propTpyes = {
    group: PropTypes.object,
    deletecomponent: PropTypes.func,
    unGroup: PropTypes.func,
    updateConfig: PropTypes.func,
  }
@@ -129,6 +131,36 @@
    this.updateComponent(group)
  }
  unGroup = () => {
    const { group } = this.state
    if (group.components.length === 0) return
    const _this = this
    confirm({
      title: '确定释放分组元素吗?',
      content: '',
      onOk() {
        _this.props.unGroup(group.uuid)
        setTimeout(() => {
          _this.updataGroup()
        }, 10)
      },
      onCancel() {}
    })
  }
  updataGroup = () => {
    const { group } = this.props
    if (group.components.length === 0) {
      this.setState({
        group: fromJS(group).toJS()
      })
    }
  }
  render() {
    const { group } = this.state
    let _style = resetStyle(group.style)
@@ -147,6 +179,7 @@
              <EditOutlined style={{color: '#1890ff'}} title="编辑"/>
            </NormalForm>
            <CopyComponent type="tabs" card={group}/>
            <UngroupOutlined title="释放" style={group.components.length > 0 ? {color: '#32c5d2'} : {color: '#eeeeee', cursor: 'not-allowed'}} onClick={this.unGroup}/>
            <PasteComponent insert={this.insert} />
            <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/>
            <DeleteOutlined className="close" title="delete" onClick={() => this.props.deletecomponent(group.uuid)} />
src/menu/components/module/voucher/index.scss
@@ -30,7 +30,7 @@
    }
  }
  .voucher-body {
    padding: 0 15px;
    padding: 0 30px;
    .voucher-code {
      display: inline-block;
      width: 160px;
src/menu/components/tabs/tabcomponents/card.jsx
@@ -29,7 +29,7 @@
const Timeline = asyncComponent(() => import('@/menu/components/timeline/normal-timeline'))
const AntvG6 = asyncComponent(() => import('@/menu/components/chart/antv-G6'))
const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => {
const Card = ({ id, card, moveCard, findCard, delCard, unGroup, updateConfig }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: 'menu', id, originalIndex },
@@ -102,7 +102,7 @@
    } else if (card.type === 'table' && card.subtype === 'editable') {
      return (<EditTable card={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
    } else if (card.type === 'group' && card.subtype === 'normalgroup') {
      return (<NormalGroup group={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
      return (<NormalGroup group={card} updateConfig={updateConfig} unGroup={unGroup} deletecomponent={delCard}/>)
    } else if (card.type === 'editor') {
      return (<BraftEditor card={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
    } else if (card.type === 'code') {
src/menu/components/tabs/tabcomponents/index.jsx
@@ -34,6 +34,25 @@
    handleList({...config, components: cards.map(item => item.uuid === element.uuid ? element : item)})
  }
  const unGroup = (id) => {
    let { card, index } = findCard(`${id}`)
    let components = [...card.components].map(item => {
      if (item.wrap) {
        item.wrap.width = card.width
        item.width = card.width
      } else if (item.plot) {
        item.plot.width = card.width
        item.width = card.width
      }
      return item
    })
    card.components = []
    const _cards = update(cards, { $splice: [[index, 1, card, ...components]] })
    handleList({...config, components: _cards})
  }
  const deleteCard = (id) => {
    const { card } = findCard(id)
@@ -146,6 +165,7 @@
          card={card}
          moveCard={moveCard}
          delCard={deleteCard}
          unGroup={unGroup}
          findCard={findCard}
          updateConfig={updateConfig}
        />
src/menu/menushell/card.jsx
@@ -32,7 +32,7 @@
const Iframe = asyncComponent(() => import('@/menu/components/iframe'))
const AntvG6 = asyncComponent(() => import('@/menu/components/chart/antv-G6'))
const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => {
const Card = ({ id, card, moveCard, findCard, delCard, unGroup, updateConfig }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: 'menu', id, originalIndex },
@@ -105,7 +105,7 @@
    } else if (card.type === 'table' && card.subtype === 'editable') {
      return (<EditTable card={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
    } else if (card.type === 'group' && card.subtype === 'normalgroup') {
      return (<NormalGroup group={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
      return (<NormalGroup group={card} updateConfig={updateConfig} unGroup={unGroup} deletecomponent={delCard}/>)
    } else if (card.type === 'editor') {
      return (<BraftEditor card={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
    } else if (card.type === 'code') {
src/menu/menushell/index.jsx
@@ -36,6 +36,25 @@
    setCards(_cards)
  }
  const unGroup = (id) => {
    let { card, index } = findCard(`${id}`)
    let components = [...card.components].map(item => {
      if (item.wrap) {
        item.wrap.width = card.width
        item.width = card.width
      } else if (item.plot) {
        item.plot.width = card.width
        item.width = card.width
      }
      return item
    })
    card.components = []
    const _cards = update(cards, { $splice: [[index, 1, card, ...components]] })
    handleList({...menu, components: _cards})
  }
  const deleteCard = (id) => {
    const { card } = findCard(id)
@@ -155,6 +174,7 @@
            card={card}
            moveCard={moveCard}
            delCard={deleteCard}
            unGroup={unGroup}
            findCard={findCard}
            updateConfig={updateConfig}
          />
src/mob/components/tabs/tabcomponents/card.jsx
@@ -27,7 +27,7 @@
const CodeSandbox = asyncComponent(() => import('@/menu/components/code/sandbox'))
const Timeline = asyncComponent(() => import('@/menu/components/timeline/normal-timeline'))
const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => {
const Card = ({ id, card, moveCard, findCard, delCard, unGroup, updateConfig }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: 'menu', id, originalIndex },
@@ -98,7 +98,7 @@
    } else if (card.type === 'table' && card.subtype === 'normaltable') {
      return (<NormalTable card={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
    } else if (card.type === 'group' && card.subtype === 'normalgroup') {
      return (<NormalGroup group={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
      return (<NormalGroup group={card} updateConfig={updateConfig} unGroup={unGroup} deletecomponent={delCard}/>)
    } else if (card.type === 'editor') {
      return (<BraftEditor card={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
    } else if (card.type === 'menubar') {
src/mob/components/tabs/tabcomponents/index.jsx
@@ -34,6 +34,25 @@
    handleList({...config, components: cards.map(item => item.uuid === element.uuid ? element : item)})
  }
  const unGroup = (id) => {
    let { card, index } = findCard(`${id}`)
    let components = [...card.components].map(item => {
      if (item.wrap) {
        item.wrap.width = card.width
        item.width = card.width
      } else if (item.plot) {
        item.plot.width = card.width
        item.width = card.width
      }
      return item
    })
    card.components = []
    const _cards = update(cards, { $splice: [[index, 1, card, ...components]] })
    handleList({...config, components: _cards})
  }
  const deleteCard = (id) => {
    const { card } = findCard(id)
@@ -139,6 +158,7 @@
          card={card}
          moveCard={moveCard}
          delCard={deleteCard}
          unGroup={unGroup}
          findCard={findCard}
          updateConfig={updateConfig}
        />
src/mob/mobshell/card.jsx
@@ -33,7 +33,7 @@
const ShareCode = asyncComponent(() => import('@/mob/components/sharecode'))
const Iframe = asyncComponent(() => import('@/menu/components/iframe'))
const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => {
const Card = ({ id, card, moveCard, findCard, delCard, unGroup, updateConfig }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: 'menu', id, originalIndex },
@@ -120,7 +120,7 @@
    } else if (card.type === 'table' && card.subtype === 'normaltable') {
      return (<NormalTable card={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
    } else if (card.type === 'group' && card.subtype === 'normalgroup') {
      return (<NormalGroup group={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
      return (<NormalGroup group={card} updateConfig={updateConfig} unGroup={unGroup} deletecomponent={delCard}/>)
    } else if (card.type === 'code') {
      return (<CodeSandbox card={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
    } else if (card.type === 'editor') {
src/mob/mobshell/index.jsx
@@ -36,6 +36,25 @@
    setCards(_cards)
  }
  const unGroup = (id) => {
    let { card, index } = findCard(`${id}`)
    let components = [...card.components].map(item => {
      if (item.wrap) {
        item.wrap.width = card.width
        item.width = card.width
      } else if (item.plot) {
        item.plot.width = card.width
        item.width = card.width
      }
      return item
    })
    card.components = []
    const _cards = update(cards, { $splice: [[index, 1, card, ...components]] })
    handleList({...menu, components: _cards})
  }
  const deleteCard = (id) => {
    const { card } = findCard(id)
@@ -220,6 +239,7 @@
            card={card}
            moveCard={moveCard}
            delCard={deleteCard}
            unGroup={unGroup}
            findCard={findCard}
            updateConfig={updateConfig}
          />
src/pc/menushell/card.jsx
@@ -32,7 +32,7 @@
const AntvG6 = asyncComponent(() => import('@/menu/components/chart/antv-G6'))
const Iframe = asyncComponent(() => import('@/menu/components/iframe'))
const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => {
const Card = ({ id, card, moveCard, findCard, delCard, unGroup, updateConfig }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: 'menu', id, originalIndex },
@@ -125,7 +125,7 @@
    } else if (card.type === 'table' && card.subtype === 'editable') {
      return (<EditTable card={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
    } else if (card.type === 'group' && card.subtype === 'normalgroup') {
      return (<NormalGroup group={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
      return (<NormalGroup group={card} updateConfig={updateConfig} unGroup={unGroup} deletecomponent={delCard}/>)
    } else if (card.type === 'editor') {
      return (<BraftEditor card={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
    } else if (card.type === 'code') {
src/pc/menushell/index.jsx
@@ -36,6 +36,25 @@
    setCards(_cards)
  }
  const unGroup = (id) => {
    let { card, index } = findCard(`${id}`)
    let components = [...card.components].map(item => {
      if (item.wrap) {
        item.wrap.width = card.width
        item.width = card.width
      } else if (item.plot) {
        item.plot.width = card.width
        item.width = card.width
      }
      return item
    })
    card.components = []
    const _cards = update(cards, { $splice: [[index, 1, card, ...components]] })
    handleList({...menu, components: _cards})
  }
  const deleteCard = (id) => {
    const { card } = findCard(id)
@@ -173,6 +192,7 @@
            card={card}
            moveCard={moveCard}
            delCard={deleteCard}
            unGroup={unGroup}
            findCard={findCard}
            updateConfig={updateConfig}
          />
src/tabviews/basetable/index.scss
@@ -7,10 +7,7 @@
  padding-left: 16px;
  padding-right: 16px;
  background-size: 100%;
  .component-wrap >.ant-col {
    min-height: 0;
  }
  .box404 {
    padding-top: 30px;
  }
src/tabviews/custom/components/module/voucher/assistTable/index.jsx
File was deleted
src/tabviews/custom/components/module/voucher/assistTable/index.scss
File was deleted
src/tabviews/custom/components/module/voucher/index.jsx
@@ -24,7 +24,6 @@
    disableAdd: false,
    disableSave: false,
    typeOptions: [],
    subjects: [],
    charType: '',
    charInt: '',
    vouDate: null,
@@ -45,6 +44,8 @@
    if (BData) {
      BID = BData.$BID || ''
    }
    window.GLOB.CacheVoucher.delete(config.uuid)
    this.setState({
      config: fromJS(config).toJS(),
@@ -100,7 +101,7 @@
  }
  loadData = () => {
    const { book } = this.state
    const { book, config } = this.state
    if (!book) return
@@ -126,8 +127,62 @@
        typeOptions: typeOptions,
        charType: typeOptions[0] ? typeOptions[0].voucher_class : '',
        charInt: typeOptions[0] ? typeOptions[0].voucher_char_int : '',
        subjects: res.subjects || [],
      })
      let names = {}
      let supplier = []
      let customer = []
      let department = []
      let project = []
      let inventory = []
      let employee = []
      let cash_flow = []
      res.sup && res.sup.forEach(item => {
        names[item.sup_type_code] = item.sup_type_name
      })
      res.supplier && res.supplier.forEach(item => {
        supplier.push({value: item.suppliercode, label: item.suppliername})
      })
      res.customer && res.customer.forEach(item => {
        customer.push({value: item.customercode, label: item.customername})
      })
      res.co_pro && res.co_pro.forEach(item => {
        department.push({value: item.co_pro_code, label: item.co_pro_name})
      })
      res.pm && res.pm.forEach(item => {
        project.push({value: item.projectcode, label: item.projectname})
      })
      res.materiel && res.materiel.forEach(item => {
        inventory.push({value: item.productcode, label: item.productname})
      })
      res.workers && res.workers.forEach(item => {
        employee.push({value: item.workercode, label: item.workername})
      })
      res.cash_flow && res.cash_flow.forEach(item => {
        cash_flow.push({value: item.cash_flow_code, label: item.cash_flow_name})
      })
      let message = {
        subjects: res.subjects || [],
        names: names,
        supplier: supplier,
        customer: customer,
        department: department,
        project: project,
        inventory: inventory,
        employee: employee,
        cash_flow: cash_flow,
      }
      window.GLOB.CacheVoucher.set(config.uuid, message)
      setTimeout(() => {
        this.getVoucher()
@@ -162,7 +217,7 @@
  }
  render() {
    const { config, disableSave, disableAdd, typeOptions, charType, charInt, data, vouDate, subjects } = this.state
    const { config, disableSave, disableAdd, typeOptions, charType, charInt, data, vouDate } = this.state
    return (
      <div className="menu-voucher-wrap" style={config.style}>
@@ -192,7 +247,7 @@
              <Button type="link" className="" onClick={this.triggerprint}>备注</Button>
            </div>
          </div>
          <VoucherTable config={config} subjects={subjects} data={data}/>
          <VoucherTable config={config} data={data}/>
        </div> : null}
        {config.wrap.type === 'check' ? <div className="voucher-body">
          <div className="pre-wrap">
src/tabviews/custom/components/module/voucher/voucherTable/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Table, Modal, Input, InputNumber, notification, message, AutoComplete, Select } from 'antd'
import { Table, Modal, Form, Input, InputNumber, notification, message, AutoComplete, Select, Popover, Button } from 'antd'
import { PlusOutlined, CloseOutlined } from '@ant-design/icons'
import Api from '@/api'
@@ -25,14 +25,102 @@
  }
}
class Accounting extends React.Component {
  state = {
    subAccounts: [],
    record: null
  }
  UNSAFE_componentWillMount() {
    const { data, tableId } = this.props
    let subAccounts = data.sup_accounting.split(',')
    let msg = window.GLOB.CacheVoucher.get(tableId) || {}
    let names = msg.names || {}
    subAccounts = subAccounts.map(n => {
      let item = {
        field: n,
        label: names[n] || n,
        initval: data[n] || '',
        options: []
      }
      if (msg[n]) {
        item.options = msg[n]
      }
      return item
    })
    this.setState({subAccounts: subAccounts, record: fromJS(data).toJS()})
  }
  selectChange = (val, item) => {
    this.setState({record: {...this.state.record, [item.field]: val || ''}})
  }
  getFields() {
    const { subAccounts } = this.state
    const fields = []
    subAccounts.forEach((item) => {
      fields.push(
        <Form.Item label={item.label} key={item.field}>
          <Select
            showSearch
            allowClear
            defaultValue={item.initval}
            filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
            onChange={(val) => this.selectChange(val, item)}
          >
            {item.options.map((option, i) =>
              <Select.Option key={i} value={option.value}>{option.label}</Select.Option>
            )}
          </Select>
        </Form.Item>
      )
    })
    return fields
  }
  confirm = () => {
    const { subAccounts, record } = this.state
    let empty = ''
    subAccounts.forEach(item => {
      if (!empty && !record[item.field]) {
        empty = item.label
      }
    })
    if (empty) {
      notification.warning({
        top: 92,
        message: '请选择' + empty,
        duration: 5
      })
    } else {
      this.props.confirm(record)
    }
  }
  render() {
    return <div>
      {this.getFields()}
      <div className="footer">
        <Button onClick={this.props.cancel}>取消</Button>
        <Button onClick={this.confirm}>确定</Button>
      </div>
    </div>
  }
}
class BodyCell extends React.Component {
  state = {
    editing: false,
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props.record), fromJS(nextProps.record)) ||
      nextState.editing !== this.state.editing
    visible: false,
  }
  componentDidMount () {
@@ -121,8 +209,6 @@
    this.setState({editing: false})
    if (col.field === 'subjectscode') return
    if (value !== record[col.field]) {
      let line = {...record, [col.field]: value}
@@ -164,23 +250,73 @@
    MKEmitter.emit('delRecord', col.tableId, record)
  }
  onSelectBlur = () => {
    const { visible } = this.state
    if (visible) return
    this.setState({editing: false})
  }
  onSelectChange = (val, option) => {
    const { col, record } = this.props
    this.setState({editing: false})
    let line = {...record, ...option.props.extra}
    if (record.sup_accounting && !line.sup_accounting) {
      record.sup_accounting.split(',').forEach(item => {
        line[item] = ''
      })
    }
    MKEmitter.emit('changeRecord', col.tableId, line)
    if (line.sup_accounting) {
      setTimeout(() => {
        this.setState({visible: true})
      }, 100)
    } else {
      this.setState({editing: false})
      setTimeout(() => {
        MKEmitter.emit('tdFocus', 'debtor' + record.uuid)
      }, 50)
    }
  }
  confirm = (res) => {
    const { col } = this.props
    MKEmitter.emit('changeRecord', col.tableId, fromJS(res).toJS())
    this.setState({editing: false, visible: false})
    setTimeout(() => {
      MKEmitter.emit('tdFocus', 'debtor' + record.uuid)
      MKEmitter.emit('tdFocus', 'debtor' + res.uuid)
    }, 50)
  }
  cancel = () => {
    const { col } = this.props
    let record = fromJS(this.props.record).toJS()
    record.balance_direction = ''
    record.count_type = ''
    record.foreign_currency_type = ''
    record.mnemonic_code = ''
    record.subjectscode = ''
    record.subjectsname = ''
    record.sup_accounting.split(',').forEach(item => {
      record[item] = ''
    })
    record.sup_accounting = ''
    MKEmitter.emit('changeRecord', col.tableId, record)
    this.setState({editing: false, visible: false})
  }
  render() {
    let { col, record, subjects, className } = this.props
    const { editing } = this.state
    let { col, record, className } = this.props
    const { editing, visible } = this.state
    let children = null
    let colSpan = 1
@@ -218,21 +354,35 @@
        colSpan = 0
      } else {
        if (editing) {
          children = <Select
            showSearch
            defaultValue={record.subjectscode || ''}
            dropdownClassName="edit-table-dropdown"
            id={col.uuid + record.uuid}
            onBlur={this.onBlur}
            filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
            onSelect={this.onSelectChange}
          >
            {subjects.map((item, i) => (<Select.Option key={i} extra={item} value={item.subjectscode}>{item.subjectscode + ' ' + item.subjectsname}</Select.Option>))}
          </Select>
          let msg = window.GLOB.CacheVoucher.get(col.tableId)
          let subjects = msg ? msg.subjects : []
          children = <>
            <Select
              showSearch
              defaultValue={record.subjectscode || ''}
              dropdownClassName="edit-table-dropdown"
              id={col.uuid + record.uuid}
              onBlur={this.onSelectBlur}
              filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
              onSelect={this.onSelectChange}
            >
              {subjects.map((item, i) => (<Select.Option key={i} extra={item} value={item.subjectscode}>{item.subjectscode + ' ' + item.subjectsname}</Select.Option>))}
            </Select>
            <Popover overlayClassName="subject-pop-wrap" placement="bottom" title="辅助核算" visible={visible} content={<Accounting confirm={this.confirm} cancel={this.cancel} tableId={col.tableId} data={record}/>}>
              <span className="pop-anchor"></span>
            </Popover>
          </>
        } else {
          let val = ''
          if (record.subjectscode) {
            val = (record.subjectscode || '') + ' ' + (record.subjectsname || '')
            record.sup_accounting && record.sup_accounting.split(',').forEach(item => {
              if (record[item]) {
                val += '_' + record[item]
              }
            })
          }
          children = <div className="content-wrap" onClick={this.focus}>{val}</div>
        }
@@ -288,7 +438,6 @@
class VoucherTable extends Component {
  static propTpyes = {
    config: PropTypes.object,        // 菜单Id
    subjects: PropTypes.array,       // 会计科目
    BID: PropTypes.any,              // 主表ID
    data: PropTypes.any,             // 表格数据
    total: PropTypes.any,            // 总数
@@ -308,7 +457,7 @@
  }
  UNSAFE_componentWillMount () {
    const { config, subjects, data } = this.props
    const { config, data } = this.props
    let columns = [
      {
@@ -328,7 +477,6 @@
        width: '34%',
        onCell: record => ({
          record,
          subjects,
          col: {uuid: 'subjectscode', field: 'subjectscode', tableId: config.uuid},
        })
      },
@@ -400,33 +548,7 @@
  UNSAFE_componentWillReceiveProps(nextProps) {
    if (!is(fromJS(this.props.data), fromJS(nextProps.data))) {
      this.resetData(fromJS(nextProps.data).toJS())
    } else if (!is(fromJS(this.props.subjects), fromJS(nextProps.subjects))) {
      this.resetSubjects(nextProps.subjects)
    }
  }
  resetSubjects = (subjects) => {
    const { config } = this.props
    let columns = fromJS(this.state.columns).toJS()
    this.setState({
      columns: columns.map(col => {
        if (col.key === 'subjectscode') {
          return {
            title: '会计科目',
            dataIndex: 'subjectscode',
            key: 'subjectscode',
            width: '34%',
            onCell: record => ({
              record,
              subjects,
              col: {uuid: 'subjectscode', field: 'subjectscode', tableId: config.uuid},
            })
          }
        }
        return col
      })
    })
  }
  resetData = (data) => {
src/tabviews/custom/components/module/voucher/voucherTable/index.scss
@@ -229,8 +229,60 @@
      display: inline-block;
    }
  }
  .pop-anchor {
    position: absolute;
    bottom: 0;
    left: 50%;
  }
}
.subject-pop-wrap {
  padding-top: 0px;
  .ant-popover-arrow {
    display: none;
  }
  .ant-popover-content {
    position: relative;
    z-index: 1;
  }
  .ant-form-item {
    display: flex;
    margin-bottom: 15px;
    width: 200px;
    .ant-form-item-label {
      width: 60px;
    }
    .ant-form-item-control-wrapper {
      flex: 1;
      .ant-select {
        width: 100%;
      }
    }
  }
  .ant-popover-inner-content {
    padding-right: 30px;
  }
  .footer {
    text-align: right;
    .ant-btn {
      border: none;
      box-shadow: none;
      margin-right: 15px;
    }
    .ant-btn:last-child {
      color: var(--mk-sys-color);
    }
  }
}
.subject-pop-wrap::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}
.edit-table-dropdown {
  .ant-select-dropdown-menu-item {
    white-space: unset;
src/tabviews/custom/index.scss
@@ -7,10 +7,7 @@
  padding-left: 16px;
  padding-right: 16px;
  background-size: 100%;
  .component-wrap >.ant-col {
    min-height: 0;
  }
  .box404 {
    padding-top: 30px;
  }
src/tabviews/custom/popview/index.scss
@@ -7,10 +7,7 @@
  padding-left: 16px;
  padding-right: 16px;
  background-size: 100%;
  .component-wrap >.ant-col {
    min-height: 0;
  }
  .box404 {
    padding-top: 30px;
  }
src/templates/sharecomponent/fieldscomponent/index.jsx
@@ -169,10 +169,12 @@
      this.props.updatefield(items)
    } else if (type === 'form') {
      let lastItem = config.fields[config.fields.length - 1]
      let firstItem = config.fields[0]
      let span = this.state.appType === 'mob' ? 24 : 12
      if (lastItem && lastItem.span) {
        span = lastItem.span
      let labelwidth = 33.3
      if (firstItem && firstItem.span) {
        span = firstItem.span
        labelwidth = firstItem.labelwidth || 33.3
      }
      selectCards.forEach(item => { // 循环添加新增字段
        let newcard = {
@@ -183,7 +185,7 @@
          type: item.type,
          resourceType: '0',
          span: span,
          labelwidth: 33.3,
          labelwidth: labelwidth,
          options: [],
          dataSource: '',
          decimal: item.decimal,
@@ -195,17 +197,19 @@
        if (item.type === 'text' && item.length >= 256) {
          newcard.type = 'textarea'
          newcard.fieldlength = item.length
          if (lastItem && lastItem.type === newcard.type) {
            newcard.span = lastItem.span
            newcard.labelwidth = lastItem.labelwidth
          } else if (lastItem) {
            newcard.span = 24
            if (lastItem.span === 12) {
              newcard.labelwidth = 16.2
            } else if (lastItem.span === 8) {
              newcard.labelwidth = 10.5
            } else if (lastItem.span === 8) {
              newcard.labelwidth = 7.7
          if (firstItem) {
            if (firstItem.type === newcard.type) {
              newcard.span = firstItem.span
              newcard.labelwidth = firstItem.labelwidth
            } else {
              newcard.span = 24
              if (firstItem.span === 12) {
                newcard.labelwidth = 16.2
              } else if (firstItem.span === 8) {
                newcard.labelwidth = 10.5
              } else if (firstItem.span === 6) {
                newcard.labelwidth = 7.7
              }
            }
          } else {
            newcard.span = 24
src/templates/zshare/modalform/modaleditable/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Table, Input, Popconfirm, Form, Radio, message } from 'antd'
import { Table, Input, Popconfirm, Form, message } from 'antd'
import { ArrowUpOutlined, ArrowDownOutlined, DeleteOutlined, PlusOutlined, SwapOutlined } from '@ant-design/icons'
import { formRule } from '@/utils/option.js'
@@ -140,27 +140,9 @@
    })
  }
  getColumnSearchProps = column => ({
    filterDropdown: () => (
      <div style={{ padding: 8 }}>
        <Radio.Group onChange={(e) => this.changeDatatype(column, e)} value={column.datatype}>
          <Radio style={{display: 'block', height: '30px', lineHeight: '30px'}} value="string">
            字符串
          </Radio>
          <Radio style={{display: 'block', height: '30px', lineHeight: '30px'}} value="number">
            数字
          </Radio>
        </Radio.Group>
      </div>
    ),
    filterIcon: () => (
      <SwapOutlined style={{ color: column.datatype === 'number' ? '#1890ff' : ''}} />
    )
  })
  changeDatatype = (column, e) => {
  changeDatatype = (column) => {
    const { columns, dataSource } = this.state
    let value = e.target.value
    let value = column.datatype !== 'number' ? 'number' : 'string'
    let _data = dataSource.map(item => {
      let val = item[column.dataIndex]
      if (value === 'number') {
@@ -185,7 +167,16 @@
        }
        if (col.dataIndex !== 'operation') {
          col = {...col, ...this.getColumnSearchProps(col)}
          col.title = <div>
            Value
            <Popconfirm
              title={`确定切换为${col.datatype === 'number' ? '文本' : '数值'}吗?`}
              overlayClassName="popover-confirm"
              onConfirm={() => this.changeDatatype(col)
            }>
              <SwapOutlined style={{ color: col.datatype === 'number' ? '#1890ff' : ''}} />
            </Popconfirm>
          </div>
        }
        return col
@@ -376,7 +367,16 @@
    return {
      columns: columns.map(col => {
        if (col.dataIndex !== 'operation') {
          col = {...col, ...this.getColumnSearchProps(col)}
          col.title = <div>
            Value
            <Popconfirm
              title={`确定切换为${col.datatype === 'number' ? '文本' : '数值'}吗?`}
              overlayClassName="popover-confirm"
              onConfirm={() => this.changeDatatype(col)
            }>
              <SwapOutlined style={{ color: col.datatype === 'number' ? '#1890ff' : ''}} />
            </Popconfirm>
          </div>
        }
        return col
      }),
src/templates/zshare/modalform/modaleditable/index.scss
@@ -17,6 +17,15 @@
  }
  .ant-table-thead > tr > th {
    padding: 10px 16px;
    position: relative;
    .anticon-swap {
      position: absolute;
      right: 16px;
      font-size: 14px;
      top: 12px;
      color: #b8b8b8;
    }
  }
  .ant-table-tbody > tr > td {
    padding: 5px 10px;
src/views/billprint/index.jsx
@@ -886,7 +886,7 @@
      <div className="bill-print-wrap" >
        {loadingview && <Spin size="large" />}
        {pages ? <div id="bill-print">
          {pages.map((components, index) => (<div className={'print-page' + (auto ? ' auto' : '')} key={index} style={{...config.style, overflow: 'hidden', boxSizing: 'border-box'}}><Row>{this.getComponents(components)}</Row></div>))}
          {pages.map((components, index) => (<div className={'print-page' + (auto ? ' auto' : '')} key={index} style={{...config.style, overflow: 'hidden', boxSizing: 'border-box'}}><Row className="component-wrap">{this.getComponents(components)}</Row></div>))}
        </div> : null}
        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
        {config && window.GLOB.breakpoint ? <DebugTable /> : null}