1. 特色方功能迭代
This commit is contained in:
9
.cursor/rules/Code-Standards.mdc
Normal file
9
.cursor/rules/Code-Standards.mdc
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
description:
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
|
|
||||||
|
1. 写代码的时候要补充详细的中文注释(每个方法是干嘛的,为什么要这样写),如果是工作区,则所有项目都适用该规则
|
||||||
|
2. 注意不要生成太多的空行,上一部分代码和下一部分代码中间的空行不要大于2行
|
||||||
|
3. 有封装好的方法、组件需要复用,不要重复造轮子
|
||||||
|
4. 小程序端的抽屉全部需要用page-container来防止用户意外退出页面
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -115,3 +115,4 @@ dist
|
|||||||
.yarn/install-state.gz
|
.yarn/install-state.gz
|
||||||
.pnp.*
|
.pnp.*
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
/.cursor/skills/
|
||||||
|
|||||||
@@ -9,15 +9,15 @@
|
|||||||
<view class="modern-pill-group">
|
<view class="modern-pill-group">
|
||||||
<view
|
<view
|
||||||
class="modern-pill"
|
class="modern-pill"
|
||||||
:class="{ active: localConfig.ruleType === 1 }"
|
:class="{ active: localConfig.ruleType === 1, disabled: disabled }"
|
||||||
@click="handleRuleTypeChange(1)"
|
@click="!disabled && handleRuleTypeChange(1)"
|
||||||
>
|
>
|
||||||
自制剂
|
自制剂
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="modern-pill"
|
class="modern-pill"
|
||||||
:class="{ active: localConfig.ruleType === 2 }"
|
:class="{ active: localConfig.ruleType === 2, disabled: disabled }"
|
||||||
@click="handleRuleTypeChange(2)"
|
@click="!disabled && handleRuleTypeChange(2)"
|
||||||
>
|
>
|
||||||
委托调剂
|
委托调剂
|
||||||
</view>
|
</view>
|
||||||
@@ -36,8 +36,8 @@
|
|||||||
v-for="item in packageMethodList"
|
v-for="item in packageMethodList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
class="modern-pill outline"
|
class="modern-pill outline"
|
||||||
:class="{ active: localConfig.packageMethodId === item.id }"
|
:class="{ active: localConfig.packageMethodId === item.id, disabled: disabled }"
|
||||||
@click="handlePackageMethodTagClick(item)"
|
@click="!disabled && handlePackageMethodTagClick(item)"
|
||||||
>
|
>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</view>
|
</view>
|
||||||
@@ -56,8 +56,8 @@
|
|||||||
v-for="item in processRuleList"
|
v-for="item in processRuleList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
class="modern-pill outline"
|
class="modern-pill outline"
|
||||||
:class="{ active: localConfig.processRuleId === item.id }"
|
:class="{ active: localConfig.processRuleId === item.id, disabled: disabled }"
|
||||||
@click="handleProcessRuleTagClick(item)"
|
@click="!disabled && handleProcessRuleTagClick(item)"
|
||||||
>
|
>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</view>
|
</view>
|
||||||
@@ -73,8 +73,8 @@
|
|||||||
v-for="item in childProcessRuleList"
|
v-for="item in childProcessRuleList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
class="modern-pill outline"
|
class="modern-pill outline"
|
||||||
:class="{ active: localConfig.childProcessRuleId === item.id }"
|
:class="{ active: localConfig.childProcessRuleId === item.id, disabled: disabled }"
|
||||||
@click="handleChildProcessRuleTagClick(item)"
|
@click="!disabled && handleChildProcessRuleTagClick(item)"
|
||||||
>
|
>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</view>
|
</view>
|
||||||
@@ -90,8 +90,8 @@
|
|||||||
v-for="item in processRuleNoteList"
|
v-for="item in processRuleNoteList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
class="modern-pill outline"
|
class="modern-pill outline"
|
||||||
:class="{ active: localConfig.processRuleNoteId === item.id }"
|
:class="{ active: localConfig.processRuleNoteId === item.id, disabled: disabled }"
|
||||||
@click="handleProcessRuleNoteTagClick(item)"
|
@click="!disabled && handleProcessRuleNoteTagClick(item)"
|
||||||
>
|
>
|
||||||
{{ item.note || item.name }}
|
{{ item.note || item.name }}
|
||||||
</view>
|
</view>
|
||||||
@@ -108,6 +108,7 @@
|
|||||||
<view class="item-content flex-row flex-ali-center">
|
<view class="item-content flex-row flex-ali-center">
|
||||||
<u-number-box
|
<u-number-box
|
||||||
v-model="localConfig.dosage"
|
v-model="localConfig.dosage"
|
||||||
|
:disabled="disabled"
|
||||||
:min="1"
|
:min="1"
|
||||||
:input-width="80"
|
:input-width="80"
|
||||||
:input-height="60"
|
:input-height="60"
|
||||||
@@ -124,6 +125,7 @@
|
|||||||
<view class="item-content flex-row flex-ali-center">
|
<view class="item-content flex-row flex-ali-center">
|
||||||
<u-number-box
|
<u-number-box
|
||||||
v-model="localConfig.dayDosage"
|
v-model="localConfig.dayDosage"
|
||||||
|
:disabled="disabled"
|
||||||
:min="1"
|
:min="1"
|
||||||
:input-width="80"
|
:input-width="80"
|
||||||
:input-height="60"
|
:input-height="60"
|
||||||
@@ -176,6 +178,13 @@ export default {
|
|||||||
processRuleNoteList: {
|
processRuleNoteList: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => []
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 特色方锁定后禁止修改配置
|
||||||
|
*/
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -368,5 +377,10 @@ export default {
|
|||||||
border-color: #00A88A;
|
border-color: #00A88A;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<view class="safe-area-inset-bottom page-bg">
|
<view class="safe-area-inset-bottom page-bg">
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<page-container
|
<page-container
|
||||||
:show="pageBackGuardShow"
|
:if="pageBackGuardShow"
|
||||||
:overlay="false"
|
:overlay="false"
|
||||||
@leave="onPageBackGuardLeave"
|
@leave="onPageBackGuardLeave"
|
||||||
/>
|
/>
|
||||||
@@ -54,6 +54,9 @@
|
|||||||
<view class="fs-24 color-sub">
|
<view class="fs-24 color-sub">
|
||||||
剂量:{{ specialPrescriptionRecord.dose_count }} 剂
|
剂量:{{ specialPrescriptionRecord.dose_count }} 剂
|
||||||
</view>
|
</view>
|
||||||
|
<view class="fs-24 color-sub">
|
||||||
|
规格:{{ specialPrescriptionPurchaseLabel }}
|
||||||
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<u-tag
|
<u-tag
|
||||||
v-if="Number(specialPrescriptionRecord.status) === 0"
|
v-if="Number(specialPrescriptionRecord.status) === 0"
|
||||||
@@ -181,7 +184,7 @@
|
|||||||
:ripple="true">
|
:ripple="true">
|
||||||
常用方
|
常用方
|
||||||
</u-button>
|
</u-button>
|
||||||
<view class="m-l-16">
|
<view v-if="!isSpecialPrescriptionCartLocked" class="m-l-16">
|
||||||
<u-button
|
<u-button
|
||||||
:throttle-time="0"
|
:throttle-time="0"
|
||||||
shape="circle"
|
shape="circle"
|
||||||
@@ -220,10 +223,10 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 内敛的卡片操作区 -->
|
<!-- 内敛的卡片操作区 -->
|
||||||
<view class="card-actions flex-row flex-jus-sp flex-ali-center">
|
<view class="card-actions flex-row flex-jus-sp flex-ali-center">
|
||||||
<view class="action-btn-text danger" @click="handleRemoveDrug(index)">
|
<view v-if="!isSpecialPrescriptionCartLocked" class="action-btn-text danger" @click="handleRemoveDrug(index)">
|
||||||
<u-icon name="trash" size="28"></u-icon> 删除
|
<u-icon name="trash" size="28"></u-icon> 删除
|
||||||
</view>
|
</view>
|
||||||
<view class="action-btn-ghost primary" @click="handleEditWesternDrug(item, index)">
|
<view v-if="!isSpecialPrescriptionCartLocked" class="action-btn-ghost primary" @click="handleEditWesternDrug(item, index)">
|
||||||
调整用量
|
调整用量
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -236,7 +239,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<u-input v-model="medicalAdvice" placeholder="请输入医嘱注意事项..." :custom-style="entrustStyle" />
|
<u-input v-model="medicalAdvice" placeholder="请输入医嘱注意事项..." :custom-style="entrustStyle" />
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row flex-jus-center m-t-64" v-if="currentDrugs.length === 0">
|
<view class="flex-row flex-jus-center m-t-64" v-if="currentDrugs.length === 0 && !isSpecialPrescriptionCartLocked">
|
||||||
<d-empty @click="handleOpenWesternMedicineModal"></d-empty>
|
<d-empty @click="handleOpenWesternMedicineModal"></d-empty>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -260,7 +263,7 @@
|
|||||||
:ripple="true">
|
:ripple="true">
|
||||||
常用方
|
常用方
|
||||||
</u-button>
|
</u-button>
|
||||||
<view class="m-l-16">
|
<view v-if="!isSpecialPrescriptionCartLocked" class="m-l-16">
|
||||||
<u-button
|
<u-button
|
||||||
:throttle-time="0"
|
:throttle-time="0"
|
||||||
:custom-style="{ backgroundColor:'#6ACDBB',color:'#fff', border: 'none' }"
|
:custom-style="{ backgroundColor:'#6ACDBB',color:'#fff', border: 'none' }"
|
||||||
@@ -278,8 +281,15 @@
|
|||||||
<view class="flex-row flex-jus-sp flex-ali-center m-b-24">
|
<view class="flex-row flex-jus-sp flex-ali-center m-b-24">
|
||||||
<text class="fs-28 font-bold color-title">药材清单 (共{{currentDrugs.length}}味)</text>
|
<text class="fs-28 font-bold color-title">药材清单 (共{{currentDrugs.length}}味)</text>
|
||||||
<view class="flex-row">
|
<view class="flex-row">
|
||||||
<text class="fs-26 color-primary m-r-32" @click="handleOpenChineseMedicineModal">修改剂量</text>
|
<template v-if="!isSpecialPrescriptionCartLocked">
|
||||||
<text class="fs-26 color-danger" @click="handleRemoveAllDrugs">清空</text>
|
<text class="fs-26 color-primary m-r-32" @click="handleOpenChineseMedicineModal">修改剂量</text>
|
||||||
|
<text class="fs-26 color-danger" @click="handleRemoveAllDrugs">清空</text>
|
||||||
|
</template>
|
||||||
|
<text
|
||||||
|
v-else
|
||||||
|
class="fs-26 color-danger"
|
||||||
|
@click="handleClearPrescriptionCart"
|
||||||
|
>清空药方</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -289,7 +299,7 @@
|
|||||||
v-for="(it, tcmIndex) in currentDrugs"
|
v-for="(it, tcmIndex) in currentDrugs"
|
||||||
:key="tcmTagKey(it, tcmIndex)"
|
:key="tcmTagKey(it, tcmIndex)"
|
||||||
:data-idx="tcmIndex"
|
:data-idx="tcmIndex"
|
||||||
@longpress.stop="onTcmTagLongPress">
|
@longpress.stop="!isSpecialPrescriptionCartLocked && onTcmTagLongPress">
|
||||||
<text class="tcm-name">{{it.drug_name || it.name}}</text>
|
<text class="tcm-name">{{it.drug_name || it.name}}</text>
|
||||||
<text class="tcm-weight">{{String(it.number)}}{{it.unit ? it.unit.name : 'g'}}</text>
|
<text class="tcm-weight">{{String(it.number)}}{{it.unit ? it.unit.name : 'g'}}</text>
|
||||||
<text
|
<text
|
||||||
@@ -300,7 +310,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="flex-row flex-jus-center m-t-64" v-else>
|
<view class="flex-row flex-jus-center m-t-64" v-else-if="!isSpecialPrescriptionCartLocked">
|
||||||
<d-empty @click="handleOpenChineseMedicineModal"></d-empty>
|
<d-empty @click="handleOpenChineseMedicineModal"></d-empty>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -313,7 +323,7 @@
|
|||||||
<text class="fs-28 text-gray m-l-8">产品/器械</text>
|
<text class="fs-28 text-gray m-l-8">产品/器械</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row m-l-163" style="height: 50rpx;">
|
<view class="flex-row m-l-163" style="height: 50rpx;">
|
||||||
<view class="m-l-16">
|
<view v-if="!isSpecialPrescriptionCartLocked" class="m-l-16">
|
||||||
<u-button
|
<u-button
|
||||||
:throttle-time="0"
|
:throttle-time="0"
|
||||||
:custom-style="{ backgroundColor:'#6ACDBB',color:'#fff', border: 'none' }"
|
:custom-style="{ backgroundColor:'#6ACDBB',color:'#fff', border: 'none' }"
|
||||||
@@ -353,7 +363,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="card-actions flex-row flex-jus-end">
|
<view class="card-actions flex-row flex-jus-end">
|
||||||
<view class="action-btn-text danger" @click="handleRemoveDrug(index)">
|
<view v-if="!isSpecialPrescriptionCartLocked" class="action-btn-text danger" @click="handleRemoveDrug(index)">
|
||||||
<u-icon name="trash" size="28"></u-icon> 删除
|
<u-icon name="trash" size="28"></u-icon> 删除
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -375,15 +385,20 @@
|
|||||||
<view class="flex-col white p-32 radius-12 mx-32 m-t-24" v-if="activeCategory === 1 && currentDrugs.length > 0">
|
<view class="flex-col white p-32 radius-12 mx-32 m-t-24" v-if="activeCategory === 1 && currentDrugs.length > 0">
|
||||||
<view class="flex-jus-sp flex-row flex-ali-center">
|
<view class="flex-jus-sp flex-row flex-ali-center">
|
||||||
<d-text text="医嘱补充" color="#333" className="font-bold"></d-text>
|
<d-text text="医嘱补充" color="#333" className="font-bold"></d-text>
|
||||||
<d-text @click="handleOpenDoctorOrderModal" text="选择常用医嘱" color="#6ACDBB"></d-text>
|
<d-text @click="handleOpenDoctorOrderModal" text="选择常用医嘱" color="#6ACDBB" />
|
||||||
</view>
|
</view>
|
||||||
<u-input v-model="medicalAdvice" placeholder="请输入服药注意事项..." :custom-style="entrustStyle" />
|
<u-input
|
||||||
|
v-model="medicalAdvice"
|
||||||
|
placeholder="请输入服药注意事项..."
|
||||||
|
:custom-style="entrustStyle"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 中药配置区域 -->
|
<!-- 中药配置区域 -->
|
||||||
<view class="white radius-12 p-32 mx-32 m-t-24" v-if="activeCategory === 1">
|
<view class="white radius-12 p-32 mx-32 m-t-24" v-if="activeCategory === 1">
|
||||||
<ChineseMedicineConfig
|
<ChineseMedicineConfig
|
||||||
:config="chineseConfig"
|
:config="chineseConfig"
|
||||||
|
:disabled="isSpecialPrescriptionCartLocked"
|
||||||
:processRuleList="processRuleList"
|
:processRuleList="processRuleList"
|
||||||
:childProcessRuleList="childProcessRuleList"
|
:childProcessRuleList="childProcessRuleList"
|
||||||
:processRuleNoteList="processRuleNoteList"
|
:processRuleNoteList="processRuleNoteList"
|
||||||
@@ -463,7 +478,12 @@
|
|||||||
|
|
||||||
<!-- 底部操作栏 -->
|
<!-- 底部操作栏 -->
|
||||||
<view class="bottom flex-jus-sp flex-ali-center safe-area-inset-bottom">
|
<view class="bottom flex-jus-sp flex-ali-center safe-area-inset-bottom">
|
||||||
<view v-if="!isSalespersonTransferMode && !isCommonPrescription && supportsCommonPrescriptionTemplate" @click="handleSaveAsCommonPrescription" class="btnText">另存常用方</view>
|
<view
|
||||||
|
v-if="!isSalespersonTransferMode && !isCommonPrescription && supportsCommonPrescriptionTemplate"
|
||||||
|
class="flex-row flex-ali-center"
|
||||||
|
>
|
||||||
|
<view @click="handleSaveAsCommonPrescription" class="btnText">另存常用方</view>
|
||||||
|
</view>
|
||||||
<u-button
|
<u-button
|
||||||
:throttle-time="0"
|
:throttle-time="0"
|
||||||
@click="handleSendPrescription"
|
@click="handleSendPrescription"
|
||||||
@@ -472,7 +492,7 @@
|
|||||||
backgroundColor: isSubmitting ? '#A5DCD2' : '#6ACDBB',
|
backgroundColor: isSubmitting ? '#A5DCD2' : '#6ACDBB',
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
height: '86rpx',
|
height: '86rpx',
|
||||||
width: (isSalespersonTransferMode || isCommonPrescription || !supportsCommonPrescriptionTemplate) ? '686rpx' : '448rpx'
|
width: bottomSendBtnWidth
|
||||||
}"
|
}"
|
||||||
:disabled="isSubmitting">
|
:disabled="isSubmitting">
|
||||||
{{ isCommonPrescription ? '保存常用方' : (isSalespersonTransferMode ? '提交传方' : '发送处方') }}
|
{{ isCommonPrescription ? '保存常用方' : (isSalespersonTransferMode ? '提交传方' : '发送处方') }}
|
||||||
@@ -624,6 +644,10 @@ import {
|
|||||||
import {
|
import {
|
||||||
pickSpecialPrescriptionRecord,
|
pickSpecialPrescriptionRecord,
|
||||||
applySpecialPrescriptionPayload,
|
applySpecialPrescriptionPayload,
|
||||||
|
resolveSpecialPrescriptionPurchaseLabel,
|
||||||
|
clearAppliedSpecialPrescription,
|
||||||
|
isSpecialPrescriptionCartLocked,
|
||||||
|
guardSpecialPrescriptionCartEdit,
|
||||||
} from './utils/specialPrescription.js';
|
} from './utils/specialPrescription.js';
|
||||||
|
|
||||||
const PENDING_RX_FROM_CHAT = 'xk_pending_rx_from_chat';
|
const PENDING_RX_FROM_CHAT = 'xk_pending_rx_from_chat';
|
||||||
@@ -733,6 +757,11 @@ export default {
|
|||||||
specialPrescriptionRecord: null,
|
specialPrescriptionRecord: null,
|
||||||
applyingSpecialPrescription: false,
|
applyingSpecialPrescription: false,
|
||||||
pendingImportSpecial: false,
|
pendingImportSpecial: false,
|
||||||
|
/** 医生已导入的特色方 ID,仅 >0 时提交走特色方计价 */
|
||||||
|
appliedSpecialPrescriptionId: 0,
|
||||||
|
appliedSpecialPrescriptionFreeShipping: false,
|
||||||
|
/** 特色方 apply 返回的套餐/贴数总价,用于底部合计 */
|
||||||
|
appliedSpecialPrescriptionExpectedTotal: null,
|
||||||
|
|
||||||
/** 在线复诊中药:术语表(HTTP 拉取,内存缓存) */
|
/** 在线复诊中药:术语表(HTTP 拉取,内存缓存) */
|
||||||
traditionalTcmData: null,
|
traditionalTcmData: null,
|
||||||
@@ -795,7 +824,9 @@ export default {
|
|||||||
return Number(this.registerStoreInfo?.allow_insurance_category ?? 0) === 1;
|
return Number(this.registerStoreInfo?.allow_insurance_category ?? 0) === 1;
|
||||||
},
|
},
|
||||||
canPreSendPriceAdjust() {
|
canPreSendPriceAdjust() {
|
||||||
return Number(this.enableOrderPricePercentAdjust) === 1 && this.currentDrugs.length > 0;
|
return Number(this.enableOrderPricePercentAdjust) === 1
|
||||||
|
&& this.currentDrugs.length > 0
|
||||||
|
&& !this.isSpecialPrescriptionCartLocked;
|
||||||
},
|
},
|
||||||
preSendDiscountLabel() {
|
preSendDiscountLabel() {
|
||||||
return formatPriceDiscountLabel(this.priceDiscount);
|
return formatPriceDiscountLabel(this.priceDiscount);
|
||||||
@@ -825,6 +856,13 @@ export default {
|
|||||||
return PrescriptionCalculator.calculateProcessingFee(processRule, this.chineseConfig.dosage, totalDrugQuantity);
|
return PrescriptionCalculator.calculateProcessingFee(processRule, this.chineseConfig.dosage, totalDrugQuantity);
|
||||||
},
|
},
|
||||||
totalPrice() {
|
totalPrice() {
|
||||||
|
const expected = this.appliedSpecialPrescriptionExpectedTotal;
|
||||||
|
if (expected != null && !Number.isNaN(Number(expected)) && Number(expected) > 0) {
|
||||||
|
const base = parseFloat(expected);
|
||||||
|
const fee = parseFloat(this.treatmentPrice || 0);
|
||||||
|
const process = this.activeCategory === 1 ? parseFloat(this.processingFee || 0) : 0;
|
||||||
|
return (base + fee + process).toFixed(2);
|
||||||
|
}
|
||||||
const total = PrescriptionCalculator.calculateTotalPrice({
|
const total = PrescriptionCalculator.calculateTotalPrice({
|
||||||
category: this.activeCategory,
|
category: this.activeCategory,
|
||||||
drugs: this.currentDrugs,
|
drugs: this.currentDrugs,
|
||||||
@@ -863,6 +901,24 @@ export default {
|
|||||||
hasSpecialPrescriptionRecord() {
|
hasSpecialPrescriptionRecord() {
|
||||||
return !!this.specialPrescriptionRecord;
|
return !!this.specialPrescriptionRecord;
|
||||||
},
|
},
|
||||||
|
/** 导入卡片:SKU 名或单剂 */
|
||||||
|
specialPrescriptionPurchaseLabel() {
|
||||||
|
return resolveSpecialPrescriptionPurchaseLabel(this.specialPrescriptionRecord);
|
||||||
|
},
|
||||||
|
/** 已导入特色方时锁定药方不可编辑 */
|
||||||
|
isSpecialPrescriptionCartLocked() {
|
||||||
|
return isSpecialPrescriptionCartLocked(this);
|
||||||
|
},
|
||||||
|
/** 底部发送按钮宽度(左侧仅「另存常用方」时需留出空间) */
|
||||||
|
bottomSendBtnWidth() {
|
||||||
|
if (this.isSalespersonTransferMode || this.isCommonPrescription) {
|
||||||
|
return '686rpx';
|
||||||
|
}
|
||||||
|
if (this.supportsCommonPrescriptionTemplate) {
|
||||||
|
return '400rpx';
|
||||||
|
}
|
||||||
|
return '686rpx';
|
||||||
|
},
|
||||||
navbarTitle() {
|
navbarTitle() {
|
||||||
if (this.isSalespersonTransferMode) {
|
if (this.isSalespersonTransferMode) {
|
||||||
return '传方';
|
return '传方';
|
||||||
@@ -1241,9 +1297,11 @@ export default {
|
|||||||
uni.showToast({ title: discount === 100 ? '已清除浮动' : '调价成功', icon: 'none' });
|
uni.showToast({ title: discount === 100 ? '已清除浮动' : '调价成功', icon: 'none' });
|
||||||
},
|
},
|
||||||
clearPreSendPriceDiscount() {
|
clearPreSendPriceDiscount() {
|
||||||
|
if (guardSpecialPrescriptionCartEdit(this)) return;
|
||||||
this.applyPreSendPriceDiscount(100);
|
this.applyPreSendPriceDiscount(100);
|
||||||
},
|
},
|
||||||
openPreSendOrderPriceAdjust() {
|
openPreSendOrderPriceAdjust() {
|
||||||
|
if (guardSpecialPrescriptionCartEdit(this)) return;
|
||||||
if (!this.canPreSendPriceAdjust) return;
|
if (!this.canPreSendPriceAdjust) return;
|
||||||
this.currentDrugs = this.snapshotDrugOrigins(this.currentDrugs);
|
this.currentDrugs = this.snapshotDrugOrigins(this.currentDrugs);
|
||||||
this.priceAdjustVisible = true;
|
this.priceAdjustVisible = true;
|
||||||
@@ -1394,7 +1452,9 @@ export default {
|
|||||||
console.error('获取诊所信息失败:', error);
|
console.error('获取诊所信息失败:', error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleOpenDiagnosisModal() { this.showDiagnosisModal = true; },
|
handleOpenDiagnosisModal() {
|
||||||
|
this.showDiagnosisModal = true;
|
||||||
|
},
|
||||||
async ensureTraditionalTcmData() {
|
async ensureTraditionalTcmData() {
|
||||||
if (this.traditionalTcmData) return this.traditionalTcmData;
|
if (this.traditionalTcmData) return this.traditionalTcmData;
|
||||||
if (this.traditionalTcmLoadPromise) return this.traditionalTcmLoadPromise;
|
if (this.traditionalTcmLoadPromise) return this.traditionalTcmLoadPromise;
|
||||||
@@ -1448,7 +1508,9 @@ export default {
|
|||||||
this.diagnosisText = this.diagnoses.map(item => item.name).join(',');
|
this.diagnosisText = this.diagnoses.map(item => item.name).join(',');
|
||||||
this.saveToLocalStorage();
|
this.saveToLocalStorage();
|
||||||
},
|
},
|
||||||
handleOpenDoctorOrderModal() { this.showDoctorOrderModal = true; },
|
handleOpenDoctorOrderModal() {
|
||||||
|
this.showDoctorOrderModal = true;
|
||||||
|
},
|
||||||
handleDoctorOrderConfirm(doctorOrderText) {
|
handleDoctorOrderConfirm(doctorOrderText) {
|
||||||
this.medicalAdvice = doctorOrderText;
|
this.medicalAdvice = doctorOrderText;
|
||||||
this.saveToLocalStorage();
|
this.saveToLocalStorage();
|
||||||
@@ -1463,6 +1525,13 @@ export default {
|
|||||||
applySpecialPrescriptionPayload(this, data);
|
applySpecialPrescriptionPayload(this, data);
|
||||||
await this.loadRegisterOrderType();
|
await this.loadRegisterOrderType();
|
||||||
this.$toast(`已导入特色方:${data.special_prescription_name || ''}`);
|
this.$toast(`已导入特色方:${data.special_prescription_name || ''}`);
|
||||||
|
if (data.price_hint) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '价格提示',
|
||||||
|
content: data.price_hint,
|
||||||
|
showCancel: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('导入特色方失败:', error);
|
console.error('导入特色方失败:', error);
|
||||||
this.$toast('导入特色方失败,请稍后重试');
|
this.$toast('导入特色方失败,请稍后重试');
|
||||||
@@ -1472,6 +1541,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async handleSelectCommonPrescription(item) {
|
async handleSelectCommonPrescription(item) {
|
||||||
try {
|
try {
|
||||||
|
clearAppliedSpecialPrescription(this);
|
||||||
const payload = item && item.apply_payload;
|
const payload = item && item.apply_payload;
|
||||||
if (!payload || !Array.isArray(payload.drugs)) {
|
if (!payload || !Array.isArray(payload.drugs)) {
|
||||||
this.$toast('常用方数据异常');
|
this.$toast('常用方数据异常');
|
||||||
@@ -1636,10 +1706,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleOpenWesternMedicineModal() {
|
handleOpenWesternMedicineModal() {
|
||||||
|
if (guardSpecialPrescriptionCartEdit(this)) return;
|
||||||
this.westernModalInitialKeyword = '';
|
this.westernModalInitialKeyword = '';
|
||||||
this.showWesternMedicineModal = true;
|
this.showWesternMedicineModal = true;
|
||||||
},
|
},
|
||||||
handleSelectWesternDrug(drug) {
|
handleSelectWesternDrug(drug) {
|
||||||
|
if (guardSpecialPrescriptionCartEdit(this)) return;
|
||||||
if (PrescriptionValidator.isDrugExists(this.currentDrugs, drug)) {
|
if (PrescriptionValidator.isDrugExists(this.currentDrugs, drug)) {
|
||||||
this.$toast('该药品已在列表中');
|
this.$toast('该药品已在列表中');
|
||||||
return;
|
return;
|
||||||
@@ -1671,6 +1743,7 @@ export default {
|
|||||||
this.$toast(`已添加 ${newDrug.drug_name}`);
|
this.$toast(`已添加 ${newDrug.drug_name}`);
|
||||||
},
|
},
|
||||||
handleOpenChineseMedicineModal() {
|
handleOpenChineseMedicineModal() {
|
||||||
|
if (guardSpecialPrescriptionCartEdit(this)) return;
|
||||||
this.chineseModalInitialKeyword = '';
|
this.chineseModalInitialKeyword = '';
|
||||||
this.showChineseMedicineModal = true;
|
this.showChineseMedicineModal = true;
|
||||||
},
|
},
|
||||||
@@ -1684,6 +1757,7 @@ export default {
|
|||||||
* 中药标签长按菜单(小程序 showActionSheet 回调里勿依赖闭包 item,用 dataset.idx + currentDrugs)
|
* 中药标签长按菜单(小程序 showActionSheet 回调里勿依赖闭包 item,用 dataset.idx + currentDrugs)
|
||||||
*/
|
*/
|
||||||
onTcmTagLongPress(e) {
|
onTcmTagLongPress(e) {
|
||||||
|
if (guardSpecialPrescriptionCartEdit(this)) return;
|
||||||
const raw = e && e.currentTarget && e.currentTarget.dataset ? e.currentTarget.dataset.idx : undefined;
|
const raw = e && e.currentTarget && e.currentTarget.dataset ? e.currentTarget.dataset.idx : undefined;
|
||||||
const idx = raw === undefined || raw === '' ? NaN : Number(raw);
|
const idx = raw === undefined || raw === '' ? NaN : Number(raw);
|
||||||
if (Number.isNaN(idx) || idx < 0 || idx >= this.currentDrugs.length) return;
|
if (Number.isNaN(idx) || idx < 0 || idx >= this.currentDrugs.length) return;
|
||||||
@@ -1702,6 +1776,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleSelectChineseDrug(drugs) {
|
handleSelectChineseDrug(drugs) {
|
||||||
|
if (guardSpecialPrescriptionCartEdit(this)) return;
|
||||||
this.currentDrugs = applyRatioToDrugs(
|
this.currentDrugs = applyRatioToDrugs(
|
||||||
this.snapshotDrugOrigins(drugs || []),
|
this.snapshotDrugOrigins(drugs || []),
|
||||||
this.priceDiscount,
|
this.priceDiscount,
|
||||||
@@ -1709,8 +1784,12 @@ export default {
|
|||||||
);
|
);
|
||||||
this.saveToLocalStorage();
|
this.saveToLocalStorage();
|
||||||
},
|
},
|
||||||
handleOpenSimpleProductModal() { this.showSimpleProductModal = true; },
|
handleOpenSimpleProductModal() {
|
||||||
|
if (guardSpecialPrescriptionCartEdit(this)) return;
|
||||||
|
this.showSimpleProductModal = true;
|
||||||
|
},
|
||||||
handleSelectSimpleProduct(product) {
|
handleSelectSimpleProduct(product) {
|
||||||
|
if (guardSpecialPrescriptionCartEdit(this)) return;
|
||||||
if (PrescriptionValidator.isDrugExists(this.currentDrugs, product)) {
|
if (PrescriptionValidator.isDrugExists(this.currentDrugs, product)) {
|
||||||
this.$toast('该产品已在列表中');
|
this.$toast('该产品已在列表中');
|
||||||
return;
|
return;
|
||||||
@@ -1731,6 +1810,7 @@ export default {
|
|||||||
this.$toast(`已添加 ${newProduct.drug_name}`);
|
this.$toast(`已添加 ${newProduct.drug_name}`);
|
||||||
},
|
},
|
||||||
handleEditWesternDrug(drug, index) {
|
handleEditWesternDrug(drug, index) {
|
||||||
|
if (guardSpecialPrescriptionCartEdit(this)) return;
|
||||||
this.editingDrug = JSON.parse(JSON.stringify(drug));
|
this.editingDrug = JSON.parse(JSON.stringify(drug));
|
||||||
this.editingDrugIndex = index;
|
this.editingDrugIndex = index;
|
||||||
this.showWesternUsageModal = true;
|
this.showWesternUsageModal = true;
|
||||||
@@ -1754,6 +1834,7 @@ export default {
|
|||||||
this.editingDrugIndex = -1;
|
this.editingDrugIndex = -1;
|
||||||
},
|
},
|
||||||
handleRemoveDrug(index) {
|
handleRemoveDrug(index) {
|
||||||
|
if (guardSpecialPrescriptionCartEdit(this)) return;
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '移除药品',
|
title: '移除药品',
|
||||||
content: '确定要从处方中移除该药品吗?',
|
content: '确定要从处方中移除该药品吗?',
|
||||||
@@ -1787,6 +1868,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleRemoveAllDrugs() {
|
handleRemoveAllDrugs() {
|
||||||
|
if (guardSpecialPrescriptionCartEdit(this)) return;
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '清空药材',
|
title: '清空药材',
|
||||||
content: '确定要清空所有中药材吗?',
|
content: '确定要清空所有中药材吗?',
|
||||||
@@ -1800,6 +1882,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async handleUpdateChineseConfig(config) {
|
async handleUpdateChineseConfig(config) {
|
||||||
|
if (guardSpecialPrescriptionCartEdit(this)) return;
|
||||||
const oldRuleType = this.chineseConfig.ruleType;
|
const oldRuleType = this.chineseConfig.ruleType;
|
||||||
const oldProcessRuleId = this.chineseConfig.processRuleId;
|
const oldProcessRuleId = this.chineseConfig.processRuleId;
|
||||||
const oldChildProcessRuleId = this.chineseConfig.childProcessRuleId;
|
const oldChildProcessRuleId = this.chineseConfig.childProcessRuleId;
|
||||||
@@ -2158,6 +2241,7 @@ export default {
|
|||||||
patient: patientData, drugs: drugsData, diagnosis: clinical_diagnose, medicalAdvice: this.medicalAdvice, total: parseFloat(this.totalPrice), category: this.feeCategory, drug_type: 2, register_id: parseInt(this.registerId), treatment_price: parseFloat(this.treatmentPrice || 0), prescription_type: this.activeCategory, doctor_second_sign: doctorSecondSignValue, send_mode: finalSendMode, custom_store_id: finalSendMode === 1 ? finalStoreId : null,
|
patient: patientData, drugs: drugsData, diagnosis: clinical_diagnose, medicalAdvice: this.medicalAdvice, total: parseFloat(this.totalPrice), category: this.feeCategory, drug_type: 2, register_id: parseInt(this.registerId), treatment_price: parseFloat(this.treatmentPrice || 0), prescription_type: this.activeCategory, doctor_second_sign: doctorSecondSignValue, send_mode: finalSendMode, custom_store_id: finalSendMode === 1 ? finalStoreId : null,
|
||||||
salesperson_transfer_prescription_id: this.salespersonTransferPrescriptionId || undefined,
|
salesperson_transfer_prescription_id: this.salespersonTransferPrescriptionId || undefined,
|
||||||
price_discount: this.priceDiscount,
|
price_discount: this.priceDiscount,
|
||||||
|
special_prescription_id: Number(this.appliedSpecialPrescriptionId) || 0,
|
||||||
};
|
};
|
||||||
if (this.activeCategory === 1) {
|
if (this.activeCategory === 1) {
|
||||||
params.package_method_id = this.chineseConfig.packageMethodId || null; params.process_rule_id = this.chineseConfig.processRuleId || null; params.process_rule_note_id = this.chineseConfig.processRuleNoteId || null; params.child_process_rule_id = this.chineseConfig.childProcessRuleId || null; params.process_rule_type = this.chineseConfig.ruleType || 1; params.processing_fee = this.processingFee; params.dosage = this.chineseConfig.dosage || 7; params.day_dosage = this.chineseConfig.dayDosage || 2;
|
params.package_method_id = this.chineseConfig.packageMethodId || null; params.process_rule_id = this.chineseConfig.processRuleId || null; params.process_rule_note_id = this.chineseConfig.processRuleNoteId || null; params.child_process_rule_id = this.chineseConfig.childProcessRuleId || null; params.process_rule_type = this.chineseConfig.ruleType || 1; params.processing_fee = this.processingFee; params.dosage = this.chineseConfig.dosage || 7; params.day_dosage = this.chineseConfig.dayDosage || 2;
|
||||||
@@ -2235,6 +2319,33 @@ export default {
|
|||||||
this.onlineTcmDiseasesId = null;
|
this.onlineTcmDiseasesId = null;
|
||||||
this.onlineTcmMethodId = null;
|
this.onlineTcmMethodId = null;
|
||||||
this.onlineTcmSyndromeId = null;
|
this.onlineTcmSyndromeId = null;
|
||||||
|
clearAppliedSpecialPrescription(this);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 清空药方(含特色方导入状态),与 PC 接诊「清空药方」一致
|
||||||
|
*/
|
||||||
|
handleClearPrescriptionCart() {
|
||||||
|
const hasContent = this.currentDrugs.length > 0
|
||||||
|
|| this.diagnoses.length > 0
|
||||||
|
|| !!(this.diagnosisText && String(this.diagnosisText).trim())
|
||||||
|
|| !!(this.medicalAdvice && String(this.medicalAdvice).trim())
|
||||||
|
|| Number(this.appliedSpecialPrescriptionId) > 0;
|
||||||
|
if (!hasContent) {
|
||||||
|
this.$toast('当前无药方内容');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.showModal({
|
||||||
|
title: '清空药方',
|
||||||
|
content: '确定清空当前药方吗?特色方将需重新导入。',
|
||||||
|
confirmColor: '#FC3636',
|
||||||
|
success: ({ confirm }) => {
|
||||||
|
if (!confirm) return;
|
||||||
|
this.clearPrescriptionData();
|
||||||
|
this.saveToLocalStorage();
|
||||||
|
PrescriptionStorage.clearAllPrescriptionData(this.registerId);
|
||||||
|
this.$toast('已清空药方');
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
handleSaveAsCommonPrescription() {
|
handleSaveAsCommonPrescription() {
|
||||||
if (this.currentDrugs.length === 0) { this.$toast('请先添加药品后再保存为常用方'); return; }
|
if (this.currentDrugs.length === 0) { this.$toast('请先添加药品后再保存为常用方'); return; }
|
||||||
@@ -2657,4 +2768,7 @@ export default {
|
|||||||
padding: 0 32rpx;
|
padding: 0 32rpx;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
.btnText--danger {
|
||||||
|
color: #FC3636;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -12,6 +12,54 @@ export function pickSpecialPrescriptionRecord(data) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入卡片规格文案:SKU 套餐名或单剂
|
||||||
|
* @param record {{ sku_id?, sku_name? }|null}
|
||||||
|
*/
|
||||||
|
export function resolveSpecialPrescriptionPurchaseLabel(record) {
|
||||||
|
if (!record) return ''
|
||||||
|
return Number(record.sku_id) > 0
|
||||||
|
? (record.sku_name || 'SKU套餐')
|
||||||
|
: '单剂'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已导入特色方并锁定药方编辑
|
||||||
|
* @param page 处方页实例
|
||||||
|
*/
|
||||||
|
export function isSpecialPrescriptionCartLocked(page) {
|
||||||
|
if (!page) return false
|
||||||
|
return Number(page.appliedSpecialPrescriptionId) > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 特色方锁定提示文案 */
|
||||||
|
export const SP_CART_LOCK_MSG = '特色方药方不可修改,请先清空药方'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特色方锁定中则 toast 并返回 true
|
||||||
|
* @param page 处方页实例
|
||||||
|
*/
|
||||||
|
export function guardSpecialPrescriptionCartEdit(page) {
|
||||||
|
if (!isSpecialPrescriptionCartLocked(page)) return false
|
||||||
|
if (page.$toast) {
|
||||||
|
page.$toast(SP_CART_LOCK_MSG)
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: SP_CART_LOCK_MSG, icon: 'none' })
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空「已导入特色方」状态(普通开方/常用方时调用)
|
||||||
|
* @param page 处方页实例
|
||||||
|
*/
|
||||||
|
export function clearAppliedSpecialPrescription(page) {
|
||||||
|
if (!page) return
|
||||||
|
page.appliedSpecialPrescriptionId = 0
|
||||||
|
page.appliedSpecialPrescriptionExpectedTotal = null
|
||||||
|
page.appliedSpecialPrescriptionFreeShipping = false
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将 apply 接口返回的数据写入处方页 state
|
* 将 apply 接口返回的数据写入处方页 state
|
||||||
*/
|
*/
|
||||||
@@ -42,13 +90,18 @@ export function applySpecialPrescriptionPayload(page, data) {
|
|||||||
dayDosage: data.day_dosage ?? 2,
|
dayDosage: data.day_dosage ?? 2,
|
||||||
packageMethodId: data.package_method_id ?? 2,
|
packageMethodId: data.package_method_id ?? 2,
|
||||||
};
|
};
|
||||||
if (data.clinical_diagnose) {
|
if (data.clinical_diagnose !== undefined && data.clinical_diagnose !== null) {
|
||||||
page.diagnosisText = data.clinical_diagnose;
|
page.diagnosisText = data.clinical_diagnose;
|
||||||
const names = String(data.clinical_diagnose).split(',').filter(Boolean);
|
const names = String(data.clinical_diagnose).split(',').filter(Boolean);
|
||||||
page.diagnoses = names.map((name, index) => ({ id: `temp_${index}`, name }));
|
page.diagnoses = names.map((name, index) => ({ id: `temp_${index}`, name }));
|
||||||
}
|
}
|
||||||
if (data.doctor_order) {
|
if (data.doctor_order !== undefined && data.doctor_order !== null) {
|
||||||
page.medicalAdvice = data.doctor_order;
|
page.medicalAdvice = data.doctor_order;
|
||||||
}
|
}
|
||||||
|
page.appliedSpecialPrescriptionId = data.special_prescription_id || 0;
|
||||||
|
page.appliedSpecialPrescriptionFreeShipping = Number(data.is_free_shipping) === 1;
|
||||||
|
page.appliedSpecialPrescriptionExpectedTotal = data.expected_total_price != null
|
||||||
|
? parseFloat(data.expected_total_price)
|
||||||
|
: null;
|
||||||
page.saveToLocalStorage();
|
page.saveToLocalStorage();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,10 @@
|
|||||||
<text class="info-label">剂量</text>
|
<text class="info-label">剂量</text>
|
||||||
<text class="info-value">{{ infoList.special_prescription_patient_record.dose_count }} 剂</text>
|
<text class="info-value">{{ infoList.special_prescription_patient_record.dose_count }} 剂</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="info-row" style="border-bottom: none; padding: 8rpx 0 0;">
|
||||||
|
<text class="info-label">规格</text>
|
||||||
|
<text class="info-value">{{ specialPrescriptionPurchaseLabel }}</text>
|
||||||
|
</view>
|
||||||
<view class="-8">
|
<view class="-8">
|
||||||
<u-tag
|
<u-tag
|
||||||
v-if="Number(infoList.special_prescription_patient_record.status) === 0"
|
v-if="Number(infoList.special_prescription_patient_record.status) === 0"
|
||||||
@@ -249,7 +253,7 @@ import {
|
|||||||
receptionApi,
|
receptionApi,
|
||||||
endOfDiagnosisApi
|
endOfDiagnosisApi
|
||||||
} from '@/api/reception.js'
|
} from '@/api/reception.js'
|
||||||
import { pickSpecialPrescriptionRecord } from '@/subPackages/sub_workbench/prescription_v2/utils/specialPrescription.js'
|
import { pickSpecialPrescriptionRecord, resolveSpecialPrescriptionPurchaseLabel } from '@/subPackages/sub_workbench/prescription_v2/utils/specialPrescription.js'
|
||||||
|
|
||||||
function emptyHealthInquiry() {
|
function emptyHealthInquiry() {
|
||||||
return {
|
return {
|
||||||
@@ -316,7 +320,12 @@ export default {
|
|||||||
rxLoadingMore: false
|
rxLoadingMore: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {
|
||||||
|
/** 特色方卡片规格:SKU 名或单剂 */
|
||||||
|
specialPrescriptionPurchaseLabel() {
|
||||||
|
return resolveSpecialPrescriptionPurchaseLabel(this.infoList?.special_prescription_patient_record)
|
||||||
|
},
|
||||||
|
},
|
||||||
onLoad(op) {
|
onLoad(op) {
|
||||||
this.id = op["id"]
|
this.id = op["id"]
|
||||||
this.re_id = op['re_id']
|
this.re_id = op['re_id']
|
||||||
@@ -479,24 +488,55 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 拼装开方页 URL
|
||||||
|
* @param {number|string} registerId 挂号 ID
|
||||||
|
* @param {number|string} patientId 就诊人 ID
|
||||||
|
* @param {boolean} importSpecial 是否自动导入特色方
|
||||||
|
*/
|
||||||
|
buildPrescriptionV2Url(registerId, patientId, importSpecial = false) {
|
||||||
|
let url = `/subPackages/sub_workbench/prescription_v2/index?register_id=${registerId}`;
|
||||||
|
if (patientId) {
|
||||||
|
url += `&patient_id=${patientId}`;
|
||||||
|
}
|
||||||
|
if (importSpecial) {
|
||||||
|
url += '&import_special=1';
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 延迟跳转开方页(接诊成功后统一入口)
|
||||||
|
*/
|
||||||
|
navigateToPrescriptionV2(registerId, patientId, importSpecial = false) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$go(this.buildPrescriptionV2Url(registerId, patientId, importSpecial));
|
||||||
|
}, 800);
|
||||||
|
},
|
||||||
// 接诊
|
// 接诊
|
||||||
accept(e, pid) {
|
accept(registerId, patientId) {
|
||||||
receptionApi(e).then((res) => {
|
// 接诊前缓存特色方记录,避免 getList 异步刷新导致判断丢失
|
||||||
if (this.apiOk(res)) {
|
const hasSp = !!this.infoList?.special_prescription_patient_record;
|
||||||
this.$toast('已接诊');
|
receptionApi(registerId).then((res) => {
|
||||||
this.getList()
|
if (!this.apiOk(res)) {
|
||||||
if (infoList.special_prescription_patient_record) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
let url = `/subPackages/sub_workbench/prescription_v2/index?register_id=${e}`;
|
|
||||||
if (pid) url += `&patient_id=${pid}`;
|
|
||||||
this.$go(url);
|
|
||||||
}, 800)
|
|
||||||
} else {
|
|
||||||
this.$toast(this.apiMsg(res));
|
this.$toast(this.apiMsg(res));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
})
|
this.$toast('已接诊');
|
||||||
|
this.getList();
|
||||||
|
if (!hasSp) {
|
||||||
|
this.navigateToPrescriptionV2(registerId, patientId, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.showModal({
|
||||||
|
title: '导入特色方',
|
||||||
|
content: '该患者已选择特色方,是否立即导入?',
|
||||||
|
confirmColor: '#00A88A',
|
||||||
|
cancelColor: '#8A92A3',
|
||||||
|
success: (modalRes) => {
|
||||||
|
this.navigateToPrescriptionV2(registerId, patientId, !!modalRes.confirm);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 结束问诊
|
// 结束问诊
|
||||||
acceptEnds(e) {
|
acceptEnds(e) {
|
||||||
@@ -540,7 +580,7 @@ export default {
|
|||||||
goToPrescriptionV2() {
|
goToPrescriptionV2() {
|
||||||
const registerId = this.infoList.id;
|
const registerId = this.infoList.id;
|
||||||
const patientId = this.infoList.user_patient_id;
|
const patientId = this.infoList.user_patient_id;
|
||||||
this.$go(`/subPackages/sub_workbench/prescription_v2/index?register_id=${registerId}&patient_id=${patientId}`);
|
this.$go(this.buildPrescriptionV2Url(registerId, patientId, false));
|
||||||
},
|
},
|
||||||
goImportSpecialPrescription() {
|
goImportSpecialPrescription() {
|
||||||
const registerId = this.infoList.id;
|
const registerId = this.infoList.id;
|
||||||
@@ -549,11 +589,7 @@ export default {
|
|||||||
this.$toast('挂号信息无效');
|
this.$toast('挂号信息无效');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let url = `/subPackages/sub_workbench/prescription_v2/index?register_id=${registerId}&import_special=1`;
|
this.$go(this.buildPrescriptionV2Url(registerId, patientId, true));
|
||||||
if (patientId) {
|
|
||||||
url += `&patient_id=${patientId}`;
|
|
||||||
}
|
|
||||||
this.$go(url);
|
|
||||||
},
|
},
|
||||||
goToReusePrescription(prescriptionId) {
|
goToReusePrescription(prescriptionId) {
|
||||||
const registerId = this.infoList.id;
|
const registerId = this.infoList.id;
|
||||||
|
|||||||
Reference in New Issue
Block a user