| | |
| | | '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': '添加', |
| | |
| | | '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': '添加', |
| | |
| | | } |
| | | |
| | | |
| | | // 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 = { |
| | |
| | | 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 === '') { |
| | |
| | | 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, |
| | |
| | | Template: 'Modal', |
| | | MenuName: res.label, |
| | | PageParam: JSON.stringify({Template: 'Modal'}), |
| | | LongParam: result.LongParam |
| | | LongParam: _LongParam |
| | | } |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (!response.status) { |
| | |
| | | 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 = '' |
| | |
| | | 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 === '') { |
| | |
| | | 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 === '') { |
| | |
| | | { |
| | | 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 |
| | | }, |
| | | { |
| | |
| | | floor: PropTypes.any, // 是否为子表 |
| | | dict: PropTypes.object, // 字典项 |
| | | fields: PropTypes.array, // 表单 |
| | | billcodes: PropTypes.array, // 表单 |
| | | columns: PropTypes.array, // 表单 |
| | | modular: PropTypes.array, // 表单 |
| | | modularDetail: PropTypes.array, // 表单 |
| | |
| | | } |
| | | } |
| | | |
| | | 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 |
| | | }) |
| | | } |
| | |
| | | } |
| | | |
| | | 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 = '' |
| | |
| | | |
| | | 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, |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | |
| | | 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: '', |
| | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form"> |
| | | <Row gutter={24}> |
| | | <Col span={5}> |
| | | <Col span={10}> |
| | | <Form.Item label={'函数变量'}> |
| | | {getFieldDecorator('field', { |
| | | initialValue: '', |
| | |
| | | })( |
| | | <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> |
| | | )} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={5}> |
| | | <Col span={10}> |
| | | <Form.Item label={'类型'}> |
| | | {getFieldDecorator('TypeCharOne', { |
| | | initialValue: 'Lp', |
| | |
| | | )} |
| | | </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: '', |
| | |
| | | })( |
| | | <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> |
| | | )} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {type === '1' ? <Col span={5}> |
| | | {type === '1' ? <Col span={10}> |
| | | <Form.Item label={'位数'}> |
| | | {getFieldDecorator('Type', { |
| | | initialValue: 4, |
| | |
| | | })(<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 : '', |
| | |
| | | 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> |
| | | )} |
| | |
| | | )} |
| | | </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 : '', |
| | |
| | | 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> |
| | | )} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={4} className="add"> |
| | | <Button onClick={this.handleConfirm} type="primary"> |
| | | 确定 |
| | | </Button> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | message: this.props.dict['form.required.input'] + 'sql!' |
| | | } |
| | | ] |
| | | })(<TextArea rows={2} />)} |
| | | })(<TextArea rows={15} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={3} className="add"> |
| | |
| | | message: this.props.dict['form.required.input'] + 'sql!' |
| | | } |
| | | ] |
| | | })(<TextArea rows={2} />)} |
| | | })(<TextArea rows={15} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={3} className="add"> |
| | |
| | | { |
| | | 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: '操作', |
| | |
| | | <BillcodeForm |
| | | floor={this.props.floor} |
| | | fields={fields} |
| | | billcodes={verify.billcodes} |
| | | columns={this.props.columns} |
| | | dict={this.props.dict} |
| | | modular={orderModular} |
| | |
| | | min-height: 40vh; |
| | | } |
| | | .verify-form { |
| | | .ant-input-number { |
| | | width: 100%; |
| | | } |
| | | .sql { |
| | | .ant-col-sm-8 { |
| | | width: 10.5%; |
| | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form"> |
| | | <Row gutter={24}> |
| | | <Col span={6}> |
| | | <Col span={11}> |
| | | <Form.Item label={'主类型'}> |
| | | {getFieldDecorator('BVoucherType', { |
| | | initialValue: voucherobj.BVoucherType || 'MES', |
| | |
| | | )} |
| | | </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) || '', |
| | |
| | | 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> |
| | | )} |
| | |
| | | )} |
| | | </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) || '', |
| | |
| | | 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> |
| | | )} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={6}> |
| | | <Col span={11}> |
| | | <Form.Item label={'关联字段'}> |
| | | {getFieldDecorator('linkField', { |
| | | initialValue: voucherobj.linkField || (columns[0] && columns[0].field) || '', |
| | |
| | | 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> |
| | | )} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={6}> |
| | | <Col span={11}> |
| | | <Form.Item label={'是否启用'}> |
| | | <Switch checkedChildren="启" unCheckedChildren="停" checked={voucherobj.enabled} onChange={this.onEnabledChange} /> |
| | | </Form.Item> |
| | |
| | | } 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) { |