From 8e3b4c6dede34e8be6ba47a20ecd9a70576675cf Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 13 一月 2025 18:02:33 +0800
Subject: [PATCH] 2025-01-13

---
 src/templates/zshare/verifycard/voucherform/index.jsx |   50 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/src/templates/zshare/verifycard/voucherform/index.jsx b/src/templates/zshare/verifycard/voucherform/index.jsx
index c3c4b5a..f66fd0b 100644
--- a/src/templates/zshare/verifycard/voucherform/index.jsx
+++ b/src/templates/zshare/verifycard/voucherform/index.jsx
@@ -1,7 +1,8 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Form, Row, Col, Select, Switch, notification } from 'antd'
+import { Form, Row, Col, Select, Switch, notification, Modal } from 'antd'
+import { ConsoleSqlOutlined } from '@ant-design/icons'
 // import './index.scss'
 
 class UniqueForm extends Component {
@@ -141,6 +142,50 @@
     })
   }
 
+  voucherSql = () => {
+    let BVoucherType = this.props.form.getFieldValue('BVoucherType')
+    let VoucherTypeOne = this.props.form.getFieldValue('VoucherTypeOne')
+    let linkField = this.props.form.getFieldValue('linkField')
+
+    let _detail = this.state.voucherDetail.filter(item => item.ModularDetailCode === VoucherTypeOne)[0]
+
+    if (!_detail) {
+      notification.warning({
+        top: 92,
+        message: '鍑瘉绫诲瀷鎴栧嚟璇佹爣璇嗕笉瀛樺湪锛�',
+        duration: 5
+      })
+      return
+    }
+
+    let _sql = `/* 鍒涘缓鍑瘉 */
+      exec s_BVoucher_Create
+        @Bill = @${linkField || ''},
+        @BVoucherType ='${BVoucherType}',
+        @VoucherTypeOne ='${VoucherTypeOne}',
+        @VoucherTypeTwo ='${_detail.VoucherTypeTwo}',
+        @Type =${_detail.IDefine1},
+        @UserID=@UserID@,
+        @Username=@Username,
+        @FullName=@FullName,
+        @BVoucher =@BVoucher OUTPUT ,
+        @FIBVoucherDate =@FIBVoucherDate OUTPUT ,
+        @FiYear =@FiYear OUTPUT ,
+        @ErrorCode =@ErrorCode OUTPUT, 
+        @retmsg=@retmsg OUTPUT
+      if @ErrorCode!=''
+        GOTO aaa
+    `
+
+    Modal.info({
+      title: '',
+      width: 500,
+      className: 'sql-example',
+      icon: null,
+      content: _sql.split(/\n\s{6}/ig).map((n, index) => <div key={index} dangerouslySetInnerHTML={{ __html: n.replace(/\s/ig, '&nbsp;') }} style={{whiteSpace: 'nowrap'}}></div>)
+    })
+  }
+
   render() {
     const { getFieldDecorator } = this.props.form
     const { voucherobj } = this.props
@@ -255,8 +300,9 @@
             </Form.Item>
           </Col>
           <Col span={11}>
-            <Form.Item label={'鏄惁鍚敤'}>
+            <Form.Item label="鏄惁鍚敤">
               <Switch checkedChildren="鍚�" unCheckedChildren="鍋�" checked={voucherobj.enabled} onChange={this.onEnabledChange} />
+              {voucherobj.enabled ? <ConsoleSqlOutlined style={{marginLeft: '20px', fontSize: '18px', color: '#1890ff', verticalAlign: 'middle'}} onClick={this.voucherSql}/> : null}
             </Form.Item>
           </Col>
         </Row>

--
Gitblit v1.8.0