1. 特色方功能迭代
This commit is contained in:
@@ -106,7 +106,8 @@
|
||||
<transfer-mode-modal v-model="showTransferModeModal" @select="onTransferModeSelect" />
|
||||
<transfer-patient-drawer
|
||||
ref="photoTransferDrawer"
|
||||
v-model="showPhotoTransferDrawer"
|
||||
:value="showPhotoTransferDrawer"
|
||||
@input="onPhotoTransferDrawerInput"
|
||||
:photo-mode="true"
|
||||
:submitting="photoSubmitting"
|
||||
@confirm="handlePhotoTransferConfirm"
|
||||
@@ -212,24 +213,49 @@ export default {
|
||||
/** 选择传方方式 */
|
||||
onTransferModeSelect(mode) {
|
||||
if (mode === 'photo') {
|
||||
this.showPhotoTransferDrawer = true
|
||||
// 先重置再打开,避免跨分包组件 input 事件未解包时父级状态卡在 true
|
||||
this.showPhotoTransferDrawer = false
|
||||
this.$nextTick(() => {
|
||||
this.showPhotoTransferDrawer = true
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/subPackages/sub_workbench/prescription_v2/index?salesperson_transfer=1&initial_category=1',
|
||||
})
|
||||
},
|
||||
/** 解包跨分包原生组件 emit 的参数(微信会包在 detail.__args__ 里) */
|
||||
unwrapComponentEventPayload(payload) {
|
||||
if (payload?.detail?.__args__) return payload.detail.__args__[0]
|
||||
if (Array.isArray(payload?.__args__)) return payload.__args__[0]
|
||||
return payload
|
||||
},
|
||||
/** 拍照传方抽屉显隐同步(替代 v-model,避免原生事件包装导致状态不同步) */
|
||||
onPhotoTransferDrawerInput(val) {
|
||||
this.showPhotoTransferDrawer = !!this.unwrapComponentEventPayload(val)
|
||||
},
|
||||
/** 构造拍照传方提交参数(显式字段,避免事件对象被误展开) */
|
||||
buildPhotoTransferPayload(patientData) {
|
||||
const data = this.unwrapComponentEventPayload(patientData) || {}
|
||||
return {
|
||||
patient_name: data.patient_name,
|
||||
patient_mobile: data.patient_mobile,
|
||||
patient_address: data.patient_address,
|
||||
prescription_images: data.prescription_images || [],
|
||||
remark: data.remark || '',
|
||||
transfer_mode: 2,
|
||||
drugs: [],
|
||||
clinical_diagnose: '',
|
||||
doctor_order: '',
|
||||
}
|
||||
},
|
||||
/** 拍照传方:抽屉确认后直接提交 */
|
||||
async handlePhotoTransferConfirm(patientData) {
|
||||
this.photoSubmitting = true
|
||||
try {
|
||||
const wrap = await createClinicSalespersonTransferPrescription({
|
||||
...patientData,
|
||||
transfer_mode: 2,
|
||||
drugs: [],
|
||||
clinical_diagnose: '',
|
||||
doctor_order: '',
|
||||
})
|
||||
const wrap = await createClinicSalespersonTransferPrescription(
|
||||
this.buildPhotoTransferPayload(patientData)
|
||||
)
|
||||
if (wrap && wrap.ok) {
|
||||
this.showPhotoTransferDrawer = false
|
||||
if (this.$refs.photoTransferDrawer && this.$refs.photoTransferDrawer.resetForm) {
|
||||
|
||||
Reference in New Issue
Block a user