king
2023-01-30 e469a34f26637e177854b960bbd35c900ce0daff
2023-01-30
9个文件已修改
277 ■■■■■ 已修改文件
src/menu/components/share/actioncomponent/actionform/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/voucherTable/index.jsx 170 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/voucherTable/index.scss 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/exceloutbutton/index.jsx 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/actionform/index.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -17,7 +17,7 @@
  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden'],
  exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'hidden'],
  excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'width', 'hidden'],
  excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'pagination', 'search', 'width', 'hidden'],
  excelOut: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'pagination', 'search', 'width', 'hidden'],
  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'width', 'display', 'ratio', 'syncComponent', 'clickouter', 'maskStyle', 'closeButton', 'hidden'],
  tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width', 'hidden'],
  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'],
@@ -328,6 +328,7 @@
      }
    } else if (openType === 'excelOut') {
      reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom')
      reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredOnce'].includes(op.value))
      if (this.record.intertype === 'outer') {
        shows.push('innerFunc', 'sysInterface', 'outerFunc')
@@ -352,6 +353,9 @@
      }
      if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') {
        shows.push('resetPageIndex')
      }
      if (this.record.Ot !== 'notRequired' && this.record.Ot !== 'requiredOnce') {
        this.record.Ot = 'notRequired'
      }
    } else if (openType === 'popview') {
      reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
@@ -466,7 +470,7 @@
    }
    
    if (appType === 'mob') {
      if (Ot !== 'notRequired') {
      if (Ot !== 'notRequired' && openType !== 'excelOut') {
        shows.push('control')
        reOptions.control = [
          { value: '', text: '无' },
@@ -481,7 +485,7 @@
        }
      }
    } else {
      if (Ot !== 'notRequired') {
      if (Ot !== 'notRequired' && openType !== 'excelOut') {
        reOptions.control = [
          { value: '', text: '无' },
          { value: 'disabled', text: '禁用' },
@@ -566,6 +570,7 @@
        _fieldval.label = '导出Excel'
        _fieldval.class = 'dgreen'
        _fieldval.execSuccess = 'never'
        _fieldval.Ot = 'notRequired'
        this.record.Ot = 'notRequired'
        this.record.label = '导出Excel'
        this.record.class = 'dgreen'
@@ -930,7 +935,7 @@
              values.icon = 'scan'
            }
          } else if (values.OpenType === 'excelOut') {
            values.Ot = 'notRequired'
            values.Ot = values.Ot || 'notRequired'
          } else if (['pop', 'prompt', 'exec'].includes(values.OpenType) && values.verify) {
            if ((values.Ot === 'requiredOnce' || card.Ot === 'requiredOnce') && card.Ot !== values.Ot) {
              values.verify.uniques = []
src/tabviews/custom/components/module/voucher/index.jsx
@@ -27,7 +27,9 @@
    charType: '',
    charInt: '',
    vouDate: null,
    book: null
    book: null,
    username: sessionStorage.getItem('User_Name'),
    change: false
  }
  UNSAFE_componentWillMount () {
@@ -196,7 +198,7 @@
      {remark: '提现', subjectscode: '1001', subjectsname: '库存现金', debtor: 124, creditor: ''},
      {remark: '购入固定资产', subjectscode: '1001', subjectsname: '库存现金', debtor: '', creditor: 124},
      {remark: '转结销售成本', subjectscode: '1001', subjectsname: '库存现金', debtor: -524, creditor: ''},
      {remark: '提现', subjectscode: '1001', subjectsname: '库存现金', debtor: 34, creditor: ''},
      {remark: '提现', subjectscode: '1001', subjectsname: '库存现金', debtor: 34, creditor: '', i: Math.random()},
    ]
    this.setState({
@@ -217,7 +219,7 @@
  }
  render() {
    const { config, disableSave, disableAdd, typeOptions, charType, charInt, data, vouDate } = this.state
    const { config, disableSave, disableAdd, typeOptions, charType, charInt, data, vouDate, username } = this.state
    return (
      <div className="menu-voucher-wrap" style={config.style}>
@@ -265,6 +267,7 @@
          </div>
          <VoucherTable config={config} data={data}/>
        </div> : null}
        <div className="user">制单人:{username}</div>
      </div>
    )
  }
src/tabviews/custom/components/module/voucher/index.scss
@@ -73,6 +73,9 @@
    border-color: var(--mk-sys-color);
    color: #ffffff;
  }
  .user {
    padding: 15px 30px 0px;
  }
}
.mk-vcode-dropdown {
src/tabviews/custom/components/module/voucher/voucherTable/index.jsx
@@ -122,6 +122,8 @@
  state = {
    editing: false,
    visible: false,
    counting: false,
    priceing: false
  }
  componentDidMount () {
@@ -276,8 +278,13 @@
      setTimeout(() => {
        this.setState({visible: true})
      }, 100)
    } else if (line.count_type === 'Y') {
      this.setState({counting: true, value: line.count || 0}, () => {
        let node = document.getElementById(col.uuid + record.uuid + 'count')
        node && node.select()
      })
    } else {
      this.setState({editing: false})
      this.setState({editing: false, visible: false, counting: false, priceing: false})
      setTimeout(() => {
        MKEmitter.emit('tdFocus', 'debtor' + record.uuid)
      }, 50)
@@ -290,9 +297,17 @@
    MKEmitter.emit('changeRecord', col.tableId, fromJS(res).toJS())
    this.setState({editing: false, visible: false})
    setTimeout(() => {
      MKEmitter.emit('tdFocus', 'debtor' + res.uuid)
    }, 50)
    if (res.count_type === 'Y') {
      this.setState({counting: true, value: res.count || 0}, () => {
        let node = document.getElementById(col.uuid + res.uuid + 'count')
        node && node.select()
      })
    } else {
      setTimeout(() => {
        MKEmitter.emit('tdFocus', 'debtor' + res.uuid)
      }, 50)
    }
  }
  cancel = () => {
@@ -315,9 +330,99 @@
    this.setState({editing: false, visible: false})
  }
  editCount = (e) => {
    const { col, record } = this.props
    e.stopPropagation()
    this.setState({counting: true, value: record.count || 0}, () => {
      let node = document.getElementById(col.uuid + record.uuid + 'count')
      node && node.select()
    })
  }
  editPrice = (e) => {
    const { col, record } = this.props
    e.stopPropagation()
    this.setState({priceing: true, value: record.price || 0}, () => {
      let node = document.getElementById(col.uuid + record.uuid + 'price')
      node && node.select()
    })
  }
  countPress = () => {
    const { col, record } = this.props
    const { value } = this.state
    let line = {...record}
    line.count = value || 0
    if (isNaN(line.count)) {
      line.count = 0
    }
    MKEmitter.emit('changeRecord', col.tableId, line)
    this.setState({counting: false, priceing: true, value: line.price || 0}, () => {
      let node = document.getElementById(col.uuid + record.uuid + 'price')
      node && node.select()
    })
  }
  countBlur = () => {
    const { col, record } = this.props
    const { value } = this.state
    this.setState({counting: false})
    let line = {...record}
    line.count = value || 0
    if (isNaN(line.count)) {
      line.count = 0
    }
    MKEmitter.emit('changeRecord', col.tableId, line)
  }
  pricePress = () => {
    const { col, record } = this.props
    const { value } = this.state
    let line = {...record}
    line.price = value || 0
    if (isNaN(line.price)) {
      line.price = 0
    }
    MKEmitter.emit('changeRecord', col.tableId, line)
    this.setState({priceing: false})
    setTimeout(() => {
      MKEmitter.emit('tdFocus', 'debtor' + record.uuid)
    }, 50)
  }
  priceBlur = () => {
    const { col, record } = this.props
    const { value } = this.state
    this.setState({priceing: false})
    let line = {...record}
    line.price = value || 0
    if (isNaN(line.price)) {
      line.price = 0
    }
    MKEmitter.emit('changeRecord', col.tableId, line)
  }
  render() {
    let { col, record, className } = this.props
    const { editing, visible } = this.state
    const { editing, visible, counting, priceing } = this.state
    let children = null
    let colSpan = 1
@@ -385,7 +490,54 @@
              }
            })
          }
          children = <div className="content-wrap" onClick={this.focus}>{val}</div>
          if (record.count_type === 'Y') {
            if (counting) {
              children = <div className="content-wrap" onClick={this.focus}>
                <div>{val}</div>
                <div className="count-wrap">
                  <span style={{marginRight: '5px'}}>
                    <span>数量:</span>
                    <span><InputNumber className="inner-input" id={col.uuid + record.uuid + 'count'} defaultValue={record.count || 0} onChange={(val) => this.onChange(val)} onPressEnter={this.countPress} onBlur={this.countBlur}/></span>
                  </span>
                  <span onClick={this.editPrice}>
                    <span>单价:</span>
                    <span>{record.price || 0}</span>
                  </span>
                </div>
              </div>
            } else if (priceing) {
              children = <div className="content-wrap" onClick={this.focus}>
                <div>{val}</div>
                <div className="count-wrap">
                  <span style={{marginRight: '5px'}} onClick={this.editCount}>
                    <span>数量:</span>
                    <span>{record.count || 0}</span>
                  </span>
                  <span>
                    <span>单价:</span>
                    <span><InputNumber className="inner-input" id={col.uuid + record.uuid + 'price'} defaultValue={record.price || 0} onChange={(val) => this.onChange(val)} onPressEnter={this.pricePress} onBlur={this.priceBlur}/></span>
                  </span>
                </div>
              </div>
            } else {
              children = <div className="content-wrap" onClick={this.focus}>
                <div>{val}</div>
                <div className="count-wrap">
                  <span style={{marginRight: '5px'}} onClick={this.editCount}>
                    <span>数量:</span>
                    <span>{record.count || 0}</span>
                  </span>
                  <span onClick={this.editPrice}>
                    <span>单价:</span>
                    <span>{record.price || 0}</span>
                  </span>
                </div>
              </div>
            }
          } else {
            children = <div className="content-wrap" onClick={this.focus}>{val}</div>
          }
        }
      }
    } else if (col.field === 'debtor') {
@@ -557,7 +709,11 @@
    data.push(this.getTotalLine(data))
    this.setState({
      edData: data
      edData: []
    }, () => {
      this.setState({
        edData: data
      })
    })
  }
src/tabviews/custom/components/module/voucher/voucherTable/index.scss
@@ -94,6 +94,10 @@
          height: 100%;
          font-size: 13px;
          font-weight: bold;
          .count-wrap {
            text-align: right;
          }
        }
        .money-uint {
          height: 100%;
@@ -129,7 +133,7 @@
    border-radius: 0;
    resize: none;
  }
  .ant-input-number {
  .ant-input-number:not(.inner-input) {
    height: 60px;
    border-radius: 0;
    
@@ -141,6 +145,21 @@
      height: 60px;
    }
  }
  .ant-input-number.inner-input {
    display: inline-block;
    width: 40px;
    border-radius: 0;
    height: 24px;
    .ant-input-number-handler-wrap {
      display: none;
    }
    .ant-input-number-input {
      border-radius: 0;
      height: 22px;
      padding: 0 5px;
    }
  }
  .ant-select {
    padding: 0px;
    position: absolute;
src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -18,6 +18,7 @@
  static propTpyes = {
    BID: PropTypes.string,            // 主表ID
    BData: PropTypes.any,             // 主表数据
    selectedData: PropTypes.any,      // 子表中选择数据
    btn: PropTypes.object,            // 按钮
    setting: PropTypes.any,           // 页面通用设置
    updateStatus: PropTypes.func,     // 按钮状态更新
@@ -776,6 +777,7 @@
   * @description 获取用户自定义存储过程传参
   */
  getExcelCustomParam = (orderBy, search, pagination = false, pageIndex = 1, pageSize = 100) => {
    const { btn, selectedData } = this.props
    let _search = Utils.formatCustomMainSearch(search)
    let param = {
@@ -786,6 +788,13 @@
    // 数据管理权限
    if (sessionStorage.getItem('dataM') === 'true') {
      param.dataM = 'Y'
    }
    if (btn.Ot === 'requiredOnce' && selectedData && selectedData.length > 0) {
      let primaryId = selectedData.map(d => d.$$uuid || '').filter(Boolean).join(',')
      if (primaryId) {
        param.ID = primaryId
      }
    }
    if (this.props.BID) {
@@ -804,17 +813,19 @@
   * @description 获取默认存储过程请求参数
   */
  getExcelDefaultParam = (arr_field, orderBy, search, pagination = false, pageIndex = 1, pageSize = 100) => {
    const { setting, btn } = this.props
    const { setting, btn, selectedData, BID } = this.props
    let defaultSql = setting.execute || setting.default || 'true'
    let customScript = setting.customScript || ''
    let _dataresource = setting.dataresource || ''
    let queryType = setting.queryType
    let primaryKey = setting.primaryKey || 'ID'
    if (btn.verify.dataType === 'custom') {
      defaultSql = btn.verify.defaultSql || 'true'
      _dataresource = btn.verify.dataresource || ''
      queryType = btn.verify.queryType
      primaryKey = btn.verify.primaryKey || 'ID'
      if (/\s/.test(_dataresource)) {
        _dataresource = '(' + _dataresource + ') tb'
@@ -857,8 +868,8 @@
      param.dataM = 'Y'
    }
    if (this.props.BID) {
      param.BID = this.props.BID
    if (BID) {
      param.BID = BID
    }
    let userName = sessionStorage.getItem('User_Name') || ''
@@ -914,6 +925,16 @@
      _search = ''
    }
    let primaryId = ''
    if (btn.Ot === 'requiredOnce' && selectedData && selectedData.length > 0) {
      primaryId = selectedData.map(d => d.$$uuid || '').filter(Boolean).join(',')
      if (_search && primaryId) {
        _search += ` and ${primaryKey} in (select ID from  dbo.SplitComma('${primaryId}'))`
      } else if (primaryId) {
        _search = `where ${primaryKey} in (select ID from  dbo.SplitComma('${primaryId}'))`
      }
    }
    let LText = ''
    if (defaultSql !== 'false' && !pagination) {
@@ -949,6 +970,21 @@
      `
    }
    LText = LText.replace(/@ID@/ig, `'${primaryId || ''}'`)
    param.custom_script = param.custom_script.replace(/@ID@/ig, `'${primaryId || ''}'`)
    LText = LText.replace(/@BID@/ig, `'${BID}'`)
    param.custom_script = param.custom_script.replace(/@BID@/ig, `'${BID}'`)
    LText = LText.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`)
    param.custom_script = param.custom_script.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`)
    LText = LText.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
    param.custom_script = param.custom_script.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
    LText = LText.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
    param.custom_script = param.custom_script.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
    LText = LText.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    param.custom_script = param.custom_script.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    LText = LText.replace(/@typename@/ig, `'admin'`)
    param.custom_script = param.custom_script.replace(/@typename@/ig, `'admin'`)
    // 测试系统打印查询语句
    if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) {
      param.custom_script && console.info(`${LText ? '' : '/*不执行默认sql*/\n'}${param.custom_script}`)
src/tabviews/zshare/actionList/index.jsx
@@ -94,6 +94,7 @@
            btn={item}
            BData={BData}
            setting={setting}
            selectedData={selectedData}
          />
        )
      } else if (item.OpenType === 'popview') {
src/templates/sharecomponent/actioncomponent/actionform/index.jsx
@@ -18,7 +18,7 @@
  prompt: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'openmenu', 'output', 'tipTitle', 'hidden'],
  exec: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'openmenu', 'output', 'hidden'],
  excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'hidden'],
  excelOut: ['label', 'OpenType', 'intertype', 'icon', 'class', 'execSuccess', 'execError', 'pagination', 'search', 'hidden'],
  excelOut: ['label', 'Ot', 'OpenType', 'intertype', 'icon', 'class', 'execSuccess', 'execError', 'pagination', 'search', 'hidden'],
  popview: ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose', 'display', 'ratio', 'clickouter', 'hidden'],
  tab: ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'linkmenu', 'hidden'],
  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class', 'position', 'hidden'],
@@ -232,6 +232,7 @@
      }
    } else if (openType === 'excelOut') {
      reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom')
      reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredOnce'].includes(op.value))
      if (this.record.intertype === 'outer') {
        shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc')
@@ -249,6 +250,9 @@
      } else if (this.record.intertype === 'inner') {
        shows.push('innerFunc')
        reRequired.innerFunc = true
      }
      if (this.record.Ot !== 'notRequired' && this.record.Ot !== 'requiredOnce') {
        this.record.Ot = 'notRequired'
      }
    } else if (openType === 'popview') {
      reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
@@ -317,7 +321,7 @@
      reOptions.Ot = requireOptions.filter(op => op.value === 'requiredSgl')
    }
    
    if (Ot !== 'notRequired') {
    if (Ot !== 'notRequired' && openType !== 'excelOut') {
      reOptions.control = [
        { value: '', text: '无' },
        { value: 'disabled', text: '禁用' },
@@ -387,6 +391,7 @@
        _fieldval.label = '导出Excel'
        _fieldval.class = 'dgreen'
        _fieldval.execSuccess = 'never'
        _fieldval.Ot = 'notRequired'
        this.record.Ot = 'notRequired'
        this.record.label = '导出Excel'
        this.record.class = 'dgreen'
@@ -683,7 +688,7 @@
          values.position = values.position || 'toolbar'
          if (values.OpenType === 'excelOut') {
            values.Ot = 'notRequired'
            values.Ot = values.Ot || 'notRequired'
          } else if (values.OpenType === 'popview' && !values.linkTab) { // 没有关联标签(新建时),创建新标签Id
            values.linkTab = Utils.getuuid()
          } else if (['pop', 'prompt', 'exec'].includes(values.OpenType) && values.verify) {
src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx
@@ -199,6 +199,13 @@
              </Form.Item>
            </Col> : null}
            {dataType === 'custom' && defaultSql === 'true' ? <Col className="short-label" span={8}>
              <Form.Item label="主键">
                {getFieldDecorator('primaryKey', {
                  initialValue: setting.primaryKey || 'ID',
                })(<Input placeholder={''} autoComplete="off" />)}
              </Form.Item>
            </Col> : null}
            {dataType === 'custom' && defaultSql === 'true' ? <Col className="short-label" span={8}>
              <Form.Item label="排序方式">
                {getFieldDecorator('order', {
                  initialValue: setting.order || '',