From cc20b3cfe18b36c7b0f75937f88679eb031ecc6f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 14 八月 2023 13:41:20 +0800 Subject: [PATCH] 2023-08-14 --- src/templates/zshare/verifycard/baseform/index.jsx | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 47 insertions(+), 2 deletions(-) diff --git a/src/templates/zshare/verifycard/baseform/index.jsx b/src/templates/zshare/verifycard/baseform/index.jsx index 00171d3..1395bea 100644 --- a/src/templates/zshare/verifycard/baseform/index.jsx +++ b/src/templates/zshare/verifycard/baseform/index.jsx @@ -15,6 +15,7 @@ verify: PropTypes.object, unionFields: PropTypes.array, notes: PropTypes.array, + appType: PropTypes.any, onChange: PropTypes.func } @@ -22,6 +23,7 @@ wxTemps: [], selectTemp: null, miniTemps: [], + printTemps: [] } componentDidMount() { @@ -76,6 +78,11 @@ this.resetTemps(wxTemps) } + + let printTemps = sessionStorage.getItem('printTemps') + printTemps = printTemps ? JSON.parse(printTemps) : [] + + this.setState({printTemps}) } resetTemps = (wxTemps) => { @@ -126,6 +133,8 @@ let error = '' if (verify.noteEnable === 'true' && !verify.noteCode) { // 寮�鍚煭淇℃椂锛岄渶瑕佹ā鏉跨紪鐮� error = '寮�鍚煭淇℃椂锛岄渶瑕侀�夋嫨鐭俊妯℃澘锛�' + } else if (verify.printEnable === 'true' && !verify.printTempId) { + error = '浣跨敤鍗曟嵁鎵撳嵃鏃讹紝闇�瑕侀�夋嫨鎵撳嵃妯℃澘锛�' } else if (verify.accountdate === 'true' && !verify.accountfield) { error = '寮�鍚处鏈熸椂锛岄渶瑕侀�夋嫨楠岃瘉鍏徃锛�' } else if (verify.wxNote === 'true') { @@ -148,6 +157,9 @@ if (_verify.noteEnable !== 'true') { _verify.noteCode = '' + } + if (_verify.printEnable !== 'true') { + _verify.printTempId = '' } if (_verify.accountdate !== 'true') { _verify.accountfield = '' @@ -184,6 +196,14 @@ const { verify } = this.props let _verify = {...verify, noteCode: val, noteId: option.props.id} + + this.props.onChange(_verify) + } + + onPrintIdChange = (val) => { + const { verify } = this.props + + let _verify = {...verify, printTempId: val} this.props.onChange(_verify) } @@ -264,8 +284,8 @@ } render() { - const { unionFields, verify, notes, card } = this.props - const { wxTemps, selectTemp } = this.state + const { unionFields, verify, notes, card, appType } = this.props + const { wxTemps, selectTemp, printTemps } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -393,6 +413,31 @@ </Form.Item> </Col> : null} <Col span={24}></Col> + {appType !== 'mob' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="bottomLeft" title="浣跨敤鍗曟嵁鎵撳嵃鏃堕渶閫夋嫨鎵撳嵃妯℃澘锛岃烦杞墦鍗扮晫闈㈡椂ID浼樺厛浠庤繑鍥炲�间腑鑾峰彇锛岃繑鍥炲�兼病鏈夋椂浠庤閲岃幏鍙栥��"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鍗曟嵁鎵撳嵃 + </Tooltip> + }> + <Radio.Group value={verify.printEnable} onChange={(e) => {this.onOptionChange(e.target.value, 'printEnable')}}> + <Radio value="true">寮�鍚�</Radio> + <Radio value="false">涓嶅紑鍚�</Radio> + </Radio.Group> + </Form.Item> + </Col> : null} + {verify.printEnable === 'true' ? <Col span={8}> + <Form.Item label="鎵撳嵃妯℃澘" required> + <Select value={verify.printTempId} onSelect={this.onPrintIdChange}> + {printTemps.map(option => + <Select.Option key={option.value} value={option.value}> + {option.text} + </Select.Option> + )} + </Select> + </Form.Item> + </Col> : null} + <Col span={24}></Col> <Col span={8}> <Form.Item label={ <Tooltip placement="bottomLeft" title={'璇峰湪鏈嶅姟鍣ㄥ畬鎴愬叕浼楀彿閰嶇疆銆�'}> -- Gitblit v1.8.0