king
2020-02-04 973dd90ad4fb5061fbc8db0b2cb8ade7217328bf
2020-02-04
15个文件已修改
189 ■■■■■ 已修改文件
src/locales/en-US/comtable.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/comtable.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/actionList/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/actionform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/actionform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/actionform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/formconfig.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/verifycard/billcodeform/index.jsx 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/verifycard/customform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/verifycard/customscript/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/verifycard/index.jsx 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/verifycard/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/verifycard/voucherform/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/comtable.js
@@ -145,7 +145,8 @@
  'header.form.resourceType': '选项来源',
  'header.form.custom': '自定义',
  'header.form.datasource': '数据源',
  'header.form.actionhelp.datasource': '使用系统函数时,请填写数据源。',
  'header.form.tablename': '表名',
  'header.form.actionhelp.tablename': '使用系统函数时,请填写数据源。',
  'header.form.actionhelp.sqlType': '使用系统函数时,请选择类型。',
  'header.form.action.type': '操作类型',
  'header.form.action.insert': '添加',
src/locales/zh-CN/comtable.js
@@ -145,7 +145,8 @@
  'header.form.resourceType': '选项来源',
  'header.form.custom': '自定义',
  'header.form.datasource': '数据源',
  'header.form.actionhelp.datasource': '使用系统函数时,请填写数据源,使用自定义函数时,可忽略。',
  'header.form.tablename': '表名',
  'header.form.actionhelp.tablename': '使用系统函数时,请填写表名,使用自定义函数时,可忽略。',
  'header.form.actionhelp.sqlType': '使用系统函数时,请选择操作类型,使用自定义函数时,可忽略。',
  'header.form.action.type': '操作类型',
  'header.form.action.insert': '添加',
src/tabviews/tableshare/actionList/index.jsx
@@ -226,14 +226,14 @@
        }
        
        // Api.genericInterface(param).then((res) => {
        //   if (res.status) {
        //     this.execSuccess(btn, res)
        //   } else {
        //     this.execError(res, btn)
        //   }
        //   _resolve()
        // })
        Api.genericInterface(param).then((res) => {
          if (res.status) {
            this.execSuccess(btn, res)
          } else {
            this.execError(res, btn)
          }
          _resolve()
        })
      } else if (btn.Ot === 'required' || (btn.Ot === 'requiredOnce' && btn.OpenType === 'pop')) {
        let deffers = data.map(cell => {
          let param = {
src/templates/comtableconfig/actionform/index.jsx
@@ -487,7 +487,7 @@
          if (values.innerFunc === '' && values.sql === '') {
            notification.warning({
              top: 92,
              message: this.props.dict['header.form.actionhelp.datasource'],
              message: this.props.dict['header.form.actionhelp.tablename'],
              duration: 10
            })
          } else if (values.innerFunc === '' && values.sql !== '' && values.sqlType === '') {
src/templates/comtableconfig/index.jsx
@@ -544,6 +544,28 @@
            MenuID: card.originCard.uuid
          }).then(result => {
            if (result.status && result.LongParam) {
              let _LongParam = ''
              // 解析配置,修改模态框标题名称
              if (result.LongParam) {
                try {
                  _LongParam = window.decodeURIComponent(window.atob(result.LongParam))
                  _LongParam = JSON.parse(_LongParam)
                } catch (e) {
                  _LongParam = ''
                }
              }
              if (_LongParam && _LongParam.type === 'Modal') {
                try {
                  _LongParam.setting.title = res.label
                  _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_LongParam)))
                } catch {
                  _LongParam = ''
                }
              } else {
                _LongParam = ''
              }
              let param = {
                func: 'sPC_ButtonParam_AddUpt',
                ParentID: menu.MenuID,
@@ -552,7 +574,7 @@
                Template: 'Modal',
                MenuName: res.label,
                PageParam: JSON.stringify({Template: 'Modal'}),
                LongParam: result.LongParam
                LongParam: _LongParam
              }
              Api.getSystemConfig(param).then(response => {
                if (!response.status) {
@@ -1550,16 +1572,18 @@
      if (oriActions.length === 0) return 'true'
      oriActions.forEach(action => {
        if (!action.prebtn || !action.prebtn.uuid) return
        Api.getSystemConfig({
          func: 'sPC_Get_LongParam',
          MenuID: action.prebtn ? action.prebtn.uuid : ''
          MenuID: action.prebtn.uuid
        }).then(result => {
          if (result.status && result.LongParam) {
            let _LongParam = ''
  
            if (result.LongParam) {
              _LongParam = window.decodeURIComponent(window.atob(result.LongParam))
              try {
                _LongParam = window.decodeURIComponent(window.atob(result.LongParam))
                _LongParam = JSON.parse(_LongParam)
              } catch (e) {
                _LongParam = ''
src/templates/formtabconfig/actionform/index.jsx
@@ -292,7 +292,7 @@
          if (values.innerFunc === '' && values.sql === '') {
            notification.warning({
              top: 92,
              message: this.props.dict['header.form.actionhelp.datasource'],
              message: this.props.dict['header.form.actionhelp.tablename'],
              duration: 10
            })
          } else if (values.innerFunc === '' && values.sql !== '' && values.sqlType === '') {
src/templates/subtableconfig/actionform/index.jsx
@@ -494,7 +494,7 @@
          if (values.innerFunc === '' && values.sql === '') {
            notification.warning({
              top: 92,
              message: this.props.dict['header.form.actionhelp.datasource'],
              message: this.props.dict['header.form.actionhelp.tablename'],
              duration: 10
            })
          } else if (values.innerFunc === '' && values.sql !== '' && values.sqlType === '') {
src/templates/tableshare/formconfig.js
@@ -461,9 +461,9 @@
    {
      type: 'text',
      key: 'sql',
      label: Formdict['header.form.datasource'],
      label: Formdict['header.form.tablename'],
      initVal: card.sql || config.setting.tableName || '',
      tooltip: Formdict['header.form.actionhelp.datasource'],
      tooltip: Formdict['header.form.actionhelp.tablename'],
      required: false
    },
    {
src/templates/tableshare/verifycard/billcodeform/index.jsx
@@ -10,6 +10,7 @@
    floor: PropTypes.any,           // 是否为子表
    dict: PropTypes.object,         // 字典项
    fields: PropTypes.array,        // 表单
    billcodes: PropTypes.array,     // 表单
    columns: PropTypes.array,       // 表单
    modular: PropTypes.array,       // 表单
    modularDetail: PropTypes.array, // 表单
@@ -55,9 +56,11 @@
      }
    }
    let _usedfields = this.props.billcodes.map(item => item.field)
    this.setState({
      modularDetail: _modularDetail,
      funFields: this.props.fields.filter(field => field.type === 'funcvar'),
      funFields: this.props.fields.filter(field => field.type === 'funcvar' && !_usedfields.includes(field.field)),
      billFields: _billFields
    })
  }
@@ -73,6 +76,9 @@
  }
  edit = (record) => {
    let _usedfields = this.props.billcodes.map(item => item.field)
    let _funFields = this.props.fields.filter(field => field.type === 'funcvar' && (!_usedfields.includes(field.field) || field.field === record.field))
    if (record.TypeCharOne === 'Y' || record.TypeCharOne === 'n') {
      let _detail = this.props.modularDetail.filter(item => item.BID === record.ModularCode)
      let _modularDetailCode = ''
@@ -83,25 +89,29 @@
      this.setState({
        type: '2',
        funFields: _funFields,
        editItem: record,
        modularDetail: _detail
      })
      this.props.form.setFieldsValue({
        field: record.field,
        TypeCharOne: record.TypeCharOne,
        ModularCode: record.ModularCode,
        ModularDetailCode: _modularDetailCode,
      }, () => {
        this.props.form.setFieldsValue({
          field: record.field,
          TypeCharOne: record.TypeCharOne,
          ModularCode: record.ModularCode,
          ModularDetailCode: _modularDetailCode,
        })
      })
    } else {
      this.setState({
        type: '1',
        funFields: _funFields,
        editItem: record,
      })
      this.props.form.setFieldsValue({
        field: record.field,
        TypeCharOne: record.TypeCharOne,
        Type: record.Type,
        linkField: record.linkField,
      }, () => {
        this.props.form.setFieldsValue({
          field: record.field,
          TypeCharOne: record.TypeCharOne,
          Type: record.Type,
          linkField: record.linkField,
        })
      })
    }
  }
@@ -170,6 +180,13 @@
        this.props.orderChange(values)
        this.setState({
          editItem: null
        }, () => {
          let _usedfields = this.props.billcodes.map(item => item.field)
          this.setState({
            funFields: this.props.fields.filter(field => field.type === 'funcvar' && !_usedfields.includes(field.field)),
          })
        })
        this.props.form.setFieldsValue({
          field: '',
@@ -195,7 +212,7 @@
    return (
      <Form {...formItemLayout} className="verify-form">
        <Row gutter={24}>
          <Col span={5}>
          <Col span={10}>
            <Form.Item label={'函数变量'}>
              {getFieldDecorator('field', {
                initialValue: '',
@@ -208,7 +225,7 @@
              })(
                <Select>
                  {this.state.funFields.map(option =>
                    <Select.Option id={option.uuid} key={option.uuid} value={option.field}>
                    <Select.Option title={option.label} id={option.uuid} key={option.uuid} value={option.field}>
                      {option.label}
                    </Select.Option>
                  )}
@@ -216,7 +233,7 @@
              )}
            </Form.Item>
          </Col>
          <Col span={5}>
          <Col span={10}>
            <Form.Item label={'类型'}>
              {getFieldDecorator('TypeCharOne', {
                initialValue: 'Lp',
@@ -236,7 +253,12 @@
              )}
            </Form.Item>
          </Col>
          {type === '1' ? <Col span={5}>
          <Col span={4} className="add">
            <Button onClick={this.handleConfirm} type="primary">
              确定
            </Button>
          </Col>
          {type === '1' ? <Col span={10}>
            <Form.Item label={'关联字段'}>
              {getFieldDecorator('linkField', {
                initialValue: '',
@@ -249,7 +271,7 @@
              })(
                <Select>
                  {this.state.billFields.map(option =>
                    <Select.Option id={option.uuid} key={option.uuid} value={option.field}>
                    <Select.Option title={option.label} id={option.uuid} key={option.uuid} value={option.field}>
                      {option.label}
                    </Select.Option>
                  )}
@@ -257,7 +279,7 @@
              )}
            </Form.Item>
          </Col> : null}
          {type === '1' ? <Col span={5}>
          {type === '1' ? <Col span={10}>
            <Form.Item label={'位数'}>
              {getFieldDecorator('Type', {
                initialValue: 4,
@@ -270,7 +292,7 @@
              })(<InputNumber min={1} max={10} precision={0} />)}
            </Form.Item>
          </Col> : null}
          {type === '2' ? <Col span={5}>
          {type === '2' ? <Col span={10}>
            <Form.Item label={'凭证类型'}>
              {getFieldDecorator('ModularCode', {
                initialValue: this.props.modular[0] ? this.props.modular[0].ID : '',
@@ -287,7 +309,7 @@
                  onChange={(value) => {this.voucherChange(value)}}
                >
                  {this.props.modular.map(option =>
                    <Select.Option id={option.ID} key={option.ID} value={option.ID}>
                    <Select.Option title={option.NameNO} id={option.ID} key={option.ID} value={option.ID}>
                      {option.NameNO}
                    </Select.Option>
                  )}
@@ -295,7 +317,7 @@
              )}
            </Form.Item>
          </Col> : null}
          {type === '2' ? <Col span={5}>
          {type === '2' ? <Col span={10}>
            <Form.Item label={'凭证标识'}>
              {getFieldDecorator('ModularDetailCode', {
                initialValue: this.state.modularDetail[0] ? this.state.modularDetail[0].ModularDetailCode : '',
@@ -311,7 +333,7 @@
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                >
                  {this.state.modularDetail.map(option =>
                    <Select.Option id={option.ModularDetailCode} key={option.ModularDetailCode} value={option.ModularDetailCode}>
                    <Select.Option title={option.CodeName} id={option.ModularDetailCode} key={option.ModularDetailCode} value={option.ModularDetailCode}>
                      {option.CodeName}
                    </Select.Option>
                  )}
@@ -319,11 +341,6 @@
              )}
            </Form.Item>
          </Col> : null}
          <Col span={4} className="add">
            <Button onClick={this.handleConfirm} type="primary">
              确定
            </Button>
          </Col>
        </Row>
      </Form>
    )
src/templates/tableshare/verifycard/customform/index.jsx
@@ -74,7 +74,7 @@
                    message: this.props.dict['form.required.input'] + 'sql!'
                  }
                ]
              })(<TextArea rows={2} />)}
              })(<TextArea rows={15} />)}
            </Form.Item>
          </Col>
          <Col span={3} className="add">
src/templates/tableshare/verifycard/customscript/index.jsx
@@ -77,7 +77,7 @@
                    message: this.props.dict['form.required.input'] + 'sql!'
                  }
                ]
              })(<TextArea rows={2} />)}
              })(<TextArea rows={15} />)}
            </Form.Item>
          </Col>
          <Col span={3} className="add">
src/templates/tableshare/verifycard/index.jsx
@@ -126,28 +126,46 @@
      {
        title: '类型',
        dataIndex: 'billType',
        width: '15%',
        width: '10%',
      },
      {
        title: '凭证类型',
        dataIndex: 'ModularCodeName',
        width: '15%'
        width: '13%'
      },
      {
        title: '凭证标识',
        dataIndex: 'ModularDetailCode',
        width: '15%'
        width: '13%'
      },
      {
        title: '关联字段',
        dataIndex: 'linkFieldName',
        width: '15%',
        width: '13%',
        render: (text, record) => (record.linkField ? `${record.linkFieldName || ''}(${record.linkField})` : '')
      },
      {
        title: '位数',
        dataIndex: 'Type',
        width: '10%'
        width: '8%'
      },
      {
        title: '示例',
        dataIndex: 'example',
        width: '13%',
        render: (text, record) => {
          let _text = ''
          if (record.TypeCharOne === 'n') {
            _text = record.ModularDetailCode + Array(record.Type).join('0') + '1'
          } else if (record.TypeCharOne === 'Y') {
            _text = record.ModularDetailCode + moment().format('YYYYMMDD') + Array(record.Type).join('0') + '1'
          } else if (record.TypeCharOne === 'Lp') {
            _text = Array(record.Type).join('0') + '10'
          } else if (record.TypeCharOne === 'BN') {
            _text = moment().format('YYYYMMDD') + Array(record.Type).join('0') + '1'
          }
          return _text
        }
      },
      {
        title: '操作',
@@ -686,6 +704,7 @@
          <BillcodeForm
            floor={this.props.floor}
            fields={fields}
            billcodes={verify.billcodes}
            columns={this.props.columns}
            dict={this.props.dict}
            modular={orderModular}
src/templates/tableshare/verifycard/index.scss
@@ -6,6 +6,9 @@
    min-height: 40vh;
  }
  .verify-form {
    .ant-input-number {
      width: 100%;
    }
    .sql {
      .ant-col-sm-8 {
        width: 10.5%;
src/templates/tableshare/verifycard/voucherform/index.jsx
@@ -152,7 +152,7 @@
    return (
      <Form {...formItemLayout} className="verify-form">
        <Row gutter={24}>
          <Col span={6}>
          <Col span={11}>
            <Form.Item label={'主类型'}>
              {getFieldDecorator('BVoucherType', {
                initialValue: voucherobj.BVoucherType || 'MES',
@@ -172,7 +172,7 @@
              )}
            </Form.Item>
          </Col>
          <Col span={6}>
          <Col span={11}>
            <Form.Item label={'凭证类型'}>
              {getFieldDecorator('VoucherType', {
                initialValue: voucherobj.VoucherType || (this.state.voucher[0] && this.state.voucher[0].ID) || '',
@@ -189,7 +189,7 @@
                  onChange={(value) => {this.voucherSChange(value)}}
                >
                  {this.state.voucher.map(option =>
                    <Select.Option id={option.ID} key={option.ID} value={option.ID}>
                    <Select.Option title={option.NameNO} id={option.ID} key={option.ID} value={option.ID}>
                      {option.NameNO}
                    </Select.Option>
                  )}
@@ -197,7 +197,7 @@
              )}
            </Form.Item>
          </Col>
          <Col span={6}>
          <Col span={11}>
            <Form.Item label={'凭证标识'}>
              {getFieldDecorator('VoucherTypeOne', {
                initialValue: voucherobj.VoucherTypeOne || (this.state.voucherDetail[0] && this.state.voucherDetail[0].ModularDetailCode) || '',
@@ -214,7 +214,7 @@
                  onChange={this.contentChange}
                >
                  {this.state.voucherDetail.map(option =>
                    <Select.Option id={option.ModularDetailCode} key={option.ModularDetailCode} value={option.ModularDetailCode}>
                    <Select.Option title={option.CodeName} id={option.ModularDetailCode} key={option.ModularDetailCode} value={option.ModularDetailCode}>
                      {option.CodeName}
                    </Select.Option>
                  )}
@@ -222,7 +222,7 @@
              )}
            </Form.Item>
          </Col>
          <Col span={6}>
          <Col span={11}>
            <Form.Item label={'关联字段'}>
              {getFieldDecorator('linkField', {
                initialValue: voucherobj.linkField || (columns[0] && columns[0].field) || '',
@@ -239,7 +239,7 @@
                  onChange={this.contentChange}
                >
                  {columns.map((option, index) =>
                    <Select.Option id={index + option.uuid} key={index + option.uuid} value={option.field}>
                    <Select.Option title={option.label} id={index + option.uuid} key={index + option.uuid} value={option.field}>
                      {option.label}
                    </Select.Option>
                  )}
@@ -247,7 +247,7 @@
              )}
            </Form.Item>
          </Col>
          <Col span={6}>
          <Col span={11}>
            <Form.Item label={'是否启用'}>
              <Switch checkedChildren="启" unCheckedChildren="停" checked={voucherobj.enabled} onChange={this.onEnabledChange} />
            </Form.Item>
src/utils/utils.js
@@ -650,7 +650,7 @@
    } else if ((btn.OpenType === 'prompt' || btn.OpenType === 'exec') && btn.sqlType === 'LogicDelete') { // 逻辑删除
      _sql += `update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid where ${primaryKey}=@${primaryKey}`
    } else if ((btn.OpenType === 'prompt' || btn.OpenType === 'exec') && btn.sqlType === 'delete') {      // 物理删除
      _sql += `insert into snote (remark,createuserid) select '删除表:${btn.sql} 数据: ${primaryKey}='+@${primaryKey},@userid delete ${btn.sql} where ${primaryKey}=@${primaryKey}`
      _sql += `insert into snote (remark,createuserid) select '删除表:${btn.sql} 数据: ${primaryKey}='+@${primaryKey},@userid,@username,@fullname delete ${btn.sql} where ${primaryKey}=@${primaryKey}`
    }
    if (verify && verify.scripts && verify.scripts.length > 0) {