From 973dd90ad4fb5061fbc8db0b2cb8ade7217328bf Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 04 二月 2020 17:18:37 +0800 Subject: [PATCH] 2020-02-04 --- src/templates/tableshare/verifycard/customform/index.jsx | 2 src/templates/comtableconfig/actionform/index.jsx | 2 src/templates/tableshare/verifycard/voucherform/index.jsx | 16 ++-- src/templates/comtableconfig/index.jsx | 30 ++++++ src/templates/formtabconfig/actionform/index.jsx | 2 src/templates/tableshare/verifycard/index.scss | 3 src/tabviews/tableshare/actionList/index.jsx | 16 ++-- src/locales/zh-CN/comtable.js | 3 src/templates/tableshare/verifycard/customscript/index.jsx | 2 src/templates/tableshare/verifycard/index.jsx | 29 ++++++- src/locales/en-US/comtable.js | 3 src/templates/tableshare/verifycard/billcodeform/index.jsx | 73 +++++++++++------- src/templates/tableshare/formconfig.js | 4 src/utils/utils.js | 2 src/templates/subtableconfig/actionform/index.jsx | 2 15 files changed, 127 insertions(+), 62 deletions(-) diff --git a/src/locales/en-US/comtable.js b/src/locales/en-US/comtable.js index 274e553..dac3c37 100644 --- a/src/locales/en-US/comtable.js +++ b/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': '娣诲姞', diff --git a/src/locales/zh-CN/comtable.js b/src/locales/zh-CN/comtable.js index 99b5bab..e0cad3f 100644 --- a/src/locales/zh-CN/comtable.js +++ b/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': '娣诲姞', diff --git a/src/tabviews/tableshare/actionList/index.jsx b/src/tabviews/tableshare/actionList/index.jsx index f277389..6c52337 100644 --- a/src/tabviews/tableshare/actionList/index.jsx +++ b/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 = { diff --git a/src/templates/comtableconfig/actionform/index.jsx b/src/templates/comtableconfig/actionform/index.jsx index 7ce988f..0dd72db 100644 --- a/src/templates/comtableconfig/actionform/index.jsx +++ b/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 === '') { diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 6718bf5..8d41a7a 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -544,6 +544,28 @@ MenuID: card.originCard.uuid }).then(result => { if (result.status && result.LongParam) { + let _LongParam = '' + + // 瑙f瀽閰嶇疆锛屼慨鏀规ā鎬佹鏍囬鍚嶇О + 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 = '' diff --git a/src/templates/formtabconfig/actionform/index.jsx b/src/templates/formtabconfig/actionform/index.jsx index 48c63df..91772f5 100644 --- a/src/templates/formtabconfig/actionform/index.jsx +++ b/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 === '') { diff --git a/src/templates/subtableconfig/actionform/index.jsx b/src/templates/subtableconfig/actionform/index.jsx index b3918cd..d7abe45 100644 --- a/src/templates/subtableconfig/actionform/index.jsx +++ b/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 === '') { diff --git a/src/templates/tableshare/formconfig.js b/src/templates/tableshare/formconfig.js index 6d4b5b0..8a3bad8 100644 --- a/src/templates/tableshare/formconfig.js +++ b/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 }, { diff --git a/src/templates/tableshare/verifycard/billcodeform/index.jsx b/src/templates/tableshare/verifycard/billcodeform/index.jsx index 07c3a92..2df33e0 100644 --- a/src/templates/tableshare/verifycard/billcodeform/index.jsx +++ b/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> ) diff --git a/src/templates/tableshare/verifycard/customform/index.jsx b/src/templates/tableshare/verifycard/customform/index.jsx index 5571c34..6ac9c2e 100644 --- a/src/templates/tableshare/verifycard/customform/index.jsx +++ b/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"> diff --git a/src/templates/tableshare/verifycard/customscript/index.jsx b/src/templates/tableshare/verifycard/customscript/index.jsx index aa52edc..9928e47 100644 --- a/src/templates/tableshare/verifycard/customscript/index.jsx +++ b/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"> diff --git a/src/templates/tableshare/verifycard/index.jsx b/src/templates/tableshare/verifycard/index.jsx index 70059db..c0bc55c 100644 --- a/src/templates/tableshare/verifycard/index.jsx +++ b/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} diff --git a/src/templates/tableshare/verifycard/index.scss b/src/templates/tableshare/verifycard/index.scss index f34c770..3387069 100644 --- a/src/templates/tableshare/verifycard/index.scss +++ b/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%; diff --git a/src/templates/tableshare/verifycard/voucherform/index.jsx b/src/templates/tableshare/verifycard/voucherform/index.jsx index 7acdb92..7af62dc 100644 --- a/src/templates/tableshare/verifycard/voucherform/index.jsx +++ b/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> diff --git a/src/utils/utils.js b/src/utils/utils.js index 3a83691..c8a9f07 100644 --- a/src/utils/utils.js +++ b/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) { -- Gitblit v1.8.0