Browse Source

添加优惠按钮

yanqiliang 1 month ago
parent
commit
edd67babba

+ 33 - 1
src/pages/workstation/component/CMOrderSave.jsx

@@ -13,6 +13,7 @@ import Moment from 'moment';
 import AddHeabTemplate from './AddHeabTemplate'; // 添加模板
 import AddHeabSetMeal from './AddHeabSetMeal'; // 添加套餐
 import PublicModalQueryTable from 'pages/common/PublicModalQueryTable';
+import PatientAdmOrderCharges from 'pages/Cashier/Report/PatientAdmOrderCharges';
 import { Util } from 'tools/index';
 import { base64Encode, SOFE_SignPKCS7Message } from '../../../tools/sccmPlugin';
 
@@ -108,6 +109,7 @@ class CMOrderSave extends React.Component {
 			diagTabData: [], // 诊断tab数据
 			diagActive: '1', // 当前诊断
 			isExistRecord: 'Y', // 病历录入标志
+			discountShow: false,
 		};
 		this.columns = [
 			{
@@ -1954,6 +1956,15 @@ class CMOrderSave extends React.Component {
 		})
 	};
 
+	discountOnClick = () => {
+		this.setState({ discountShow: true });
+		this.discountChild && this.discountChild.medicalInformation(this.state.recordData?.admID);
+	}
+
+	closeDiscountModal = () => {
+		this.setState({ discountShow: false });
+	}
+
 	// 获取医嘱套餐相关数据
 	loadLocPersonMsg = async () => {
 		try {
@@ -2244,7 +2255,7 @@ class CMOrderSave extends React.Component {
 		const { tableData, selectData, departmentInformation, comPrincipleID, dose, orderSetDetailData, visible, listData, zoomSpan, quotePage, quoteTotal, minQty, maxQty, activeKey, authRangeID, packageData, packageMsg,
 			decoctMethodID, medDesc, rowData, doseUnitID, quoteData, top, left, modalData, settlementType, modalDetailListData, recipeListRowId, packageExpandedKeys, packageAutoExpandParent,
 			numSelectData, radioValue, treeData, radioData, detailRowData, visibleCrad, handleStatus, addStatus, messageError, totalWidth, columns, user, titleData, herbalFormID,
-			inoperable, decoctMethod, diagTabData, diagActive, isExistRecord
+			inoperable, decoctMethod, diagTabData, diagActive, isExistRecord, discountShow
 		} = this.state;
 		const { getFieldDecorator } = this.props.form;
 		let param = {
@@ -2578,6 +2589,10 @@ class CMOrderSave extends React.Component {
 											<Icon className='doctor-save-splice' />
 											<span>{this.setMessage("CMOrderSavesave", "descripts")}</span>
 										</li>
+										<Divider type="vertical" />
+										<li className='color333' onClick={this.discountOnClick}>
+											<span>优惠</span>
+										</li>
 									</ul>
 								</div>
 								<Form className="form-flex">
@@ -2911,6 +2926,23 @@ class CMOrderSave extends React.Component {
 					</div>
 				</Modal>
 				<AddHeabTemplate onRef={this.handleTemplate} />
+				<Modal
+					title="优惠折扣"
+					className='discount-modal'
+					visible={discountShow}
+					onCancel={this.closeDiscountModal}
+					footer={false}
+				>
+					<PatientAdmOrderCharges
+						admID={this.state.recordData?.admID}
+						patID={this.state.recordData?.patID}
+						applyflag={selectData?.discountFlag === 'Y' ? 'N' : 'Y'}
+						selectData={{ discountSubCatID: selectData?.discountSubCatID }}
+						userInfo={titleData}
+						onRef={ref => this.discountChild = ref}
+						closeModal={this.closeDiscountModal}
+					/>
+				</Modal>
 				<AddHeabSetMeal onRef={this.handleSetMeal} />
 
 				{/* 处方确认 */}

+ 6 - 6
src/pages/workstation/component/DoctorAdviceStepPage.jsx

@@ -9637,12 +9637,12 @@ class DoctorAdviceStepPage extends React.Component {
 												<Divider type="vertical" />
 												<Button type='primary' size='small' disabled={Util.isEmpty(this.state.ids)} onClick={this.handleSynchronization.bind(this)}>同步时间</Button>
 												<Button type='primary' size='small' style={{ marginLeft: '8px' }} disabled={Util.isEmpty(this.state.ids)} onClick={this.handleSynchronization.bind(this, 'NewTime')}>更新时间</Button>
-												{/*{this.props.patStatus == '1' ? '' : (*/}
-												{/*	<>*/}
-												{/*		<Divider type="vertical" />*/}
-												{/*		<Button size="small" style={{ background: '#ff3399', color: '#fff' }} onClick={this.discountOnClick}>优惠</Button>*/}
-												{/*	</>*/}
-												{/*)}*/}
+								{this.props.patStatus == '1' ? '' : (
+									<>
+										<Divider type="vertical" />
+										<Button size="small" style={{ background: '#ff3399', color: '#fff' }} onClick={this.discountOnClick}>优惠</Button>
+									</>
+								)}
 												{this.props.patStatus != '1' && orderPrint === 'Y' ? (
 													<>
 														<Divider type="vertical" />