更新
This commit is contained in:
@@ -992,7 +992,7 @@
|
||||
<!-- 修正处方笺姓名 / 手机号(zyt_tcm_prescription,写入订单日志) -->
|
||||
<el-dialog
|
||||
v-model="patchPatientVisible"
|
||||
title="修正处方姓名与手机号"
|
||||
title="修正姓名、性别与手机号"
|
||||
width="440px"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
@@ -1010,12 +1010,18 @@
|
||||
<el-form-item label="患者姓名" prop="patient_name">
|
||||
<el-input v-model="patchPatientForm.patient_name" maxlength="50" show-word-limit placeholder="处方笺展示姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-radio-group v-model="patchPatientForm.gender">
|
||||
<el-radio :label="1">男</el-radio>
|
||||
<el-radio :label="0">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-input v-model="patchPatientForm.phone" maxlength="20" placeholder="处方笺展示手机号" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<p class="text-xs text-gray-500 -mt-2 mb-2">
|
||||
仅更新处方表 patient_name、phone,不改变审核状态;记录写入业务订单操作日志(有关联订单时可在此订单日志中查看)。
|
||||
仅更新处方表 patient_name、gender、phone,不改变审核状态;记录写入业务订单操作日志(有关联订单时可在此订单日志中查看)。
|
||||
</p>
|
||||
<template #footer>
|
||||
<el-button @click="patchPatientVisible = false">取消</el-button>
|
||||
@@ -1584,16 +1590,20 @@ const patchPatientFormRef = ref<FormInstance>()
|
||||
const patchPatientForm = reactive({
|
||||
id: 0,
|
||||
patient_name: '',
|
||||
gender: 1 as 0 | 1,
|
||||
phone: ''
|
||||
})
|
||||
const patchPatientRules: FormRules = {
|
||||
patient_name: [{ required: true, message: '请输入患者姓名', trigger: 'blur' }],
|
||||
gender: [{ required: true, message: '请选择性别', trigger: 'change' }],
|
||||
phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
function openPatchPatientDialog(row: Record<string, unknown>) {
|
||||
patchPatientForm.id = Number(row.id) || 0
|
||||
patchPatientForm.patient_name = String(row.patient_name ?? '').trim()
|
||||
const g = Number(row.gender)
|
||||
patchPatientForm.gender = g === 0 || g === 1 ? (g as 0 | 1) : 1
|
||||
patchPatientForm.phone = String(row.phone ?? '').trim()
|
||||
patchPatientVisible.value = true
|
||||
}
|
||||
@@ -1601,6 +1611,7 @@ function openPatchPatientDialog(row: Record<string, unknown>) {
|
||||
function resetPatchPatientForm() {
|
||||
patchPatientForm.id = 0
|
||||
patchPatientForm.patient_name = ''
|
||||
patchPatientForm.gender = 1
|
||||
patchPatientForm.phone = ''
|
||||
patchPatientFormRef.value?.clearValidate()
|
||||
}
|
||||
@@ -1618,7 +1629,8 @@ async function submitPatchPatient() {
|
||||
await prescriptionPatchPatient({
|
||||
id: patchPatientForm.id,
|
||||
patient_name: patchPatientForm.patient_name.trim(),
|
||||
phone: patchPatientForm.phone.trim()
|
||||
phone: patchPatientForm.phone.trim(),
|
||||
gender: patchPatientForm.gender
|
||||
})
|
||||
feedback.msgSuccess('已保存')
|
||||
patchPatientVisible.value = false
|
||||
|
||||
@@ -495,7 +495,7 @@
|
||||
>修改单号</el-button>
|
||||
<el-button
|
||||
v-if="canShipRow(row)"
|
||||
v-perms="['tcm.prescriptionOrder/ship']"
|
||||
v-perms="['tcm.prescriptionOrder/ship', 'tcm.prescriptionOrder/submitGancaoRecipel']"
|
||||
type="primary"
|
||||
link
|
||||
@click="openShip(row)"
|
||||
@@ -606,7 +606,7 @@
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="canShipRow(detailData)"
|
||||
v-perms="['tcm.prescriptionOrder/ship']"
|
||||
v-perms="['tcm.prescriptionOrder/ship', 'tcm.prescriptionOrder/submitGancaoRecipel']"
|
||||
type="primary"
|
||||
size="small"
|
||||
plain
|
||||
@@ -1917,6 +1917,15 @@
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-alert
|
||||
v-if="shipForm.ship_mode === 'gancao'"
|
||||
title="甘草药方由甘草侧履约配送,无需填写快递单号。点击下方按钮将提交处方至甘草药管家(与「上传药方」相同)。"
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
class="mb-4"
|
||||
/>
|
||||
<el-alert
|
||||
v-else
|
||||
title="确认后订单状态将变更为「已发货」,请核对快递信息无误。"
|
||||
type="warning"
|
||||
:closable="false"
|
||||
@@ -1930,27 +1939,33 @@
|
||||
<el-radio label="direct">药房直发</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="承运商">
|
||||
<el-select v-model="shipForm.express_company" class="w-full">
|
||||
<el-option label="自动识别" value="auto" />
|
||||
<el-option label="顺丰速运" value="sf" />
|
||||
<el-option label="京东快递" value="jd" />
|
||||
<el-option label="极兔速递" value="jt" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="快递单号">
|
||||
<el-input
|
||||
v-model="shipForm.tracking_number"
|
||||
maxlength="80"
|
||||
placeholder="请输入快递单号"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<template v-if="shipForm.ship_mode === 'direct'">
|
||||
<el-form-item label="承运商">
|
||||
<el-select v-model="shipForm.express_company" class="w-full">
|
||||
<el-option label="自动识别" value="auto" />
|
||||
<el-option label="顺丰速运" value="sf" />
|
||||
<el-option label="京东快递" value="jd" />
|
||||
<el-option label="极兔速递" value="jt" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="快递单号">
|
||||
<el-input
|
||||
v-model="shipForm.tracking_number"
|
||||
maxlength="80"
|
||||
placeholder="请输入快递单号"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="shipVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="shipSaving" @click="submitShip">
|
||||
确认发货
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="shipSaving || (shipForm.ship_mode === 'gancao' && gancaoSubmitId === shipRowId)"
|
||||
@click="submitShip"
|
||||
>
|
||||
{{ shipForm.ship_mode === 'gancao' ? '确认并上传药方' : '确认发货' }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -2589,6 +2604,7 @@ import { getDictData } from '@/api/app'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import feedback from '@/utils/feedback'
|
||||
import { hasPermission } from '@/utils/perm'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import useUserStore from '@/stores/modules/user'
|
||||
@@ -4747,13 +4763,31 @@ const shipForm = reactive({
|
||||
|
||||
function openShip(row: { id: number; express_company?: unknown; tracking_number?: unknown; ship_mode?: unknown }) {
|
||||
shipRowId.value = row.id
|
||||
shipForm.ship_mode = String(row.ship_mode || 'gancao') || 'gancao'
|
||||
const tn = String(row.tracking_number ?? '').trim()
|
||||
const sm = String(row.ship_mode ?? '').trim()
|
||||
if (sm === 'direct' || sm === 'gancao') {
|
||||
shipForm.ship_mode = sm
|
||||
} else if (tn) {
|
||||
// 已填单号时默认走药房直发(如快捷填单号后「确认发货」)
|
||||
shipForm.ship_mode = 'direct'
|
||||
} else {
|
||||
shipForm.ship_mode = 'gancao'
|
||||
}
|
||||
shipForm.express_company = String(row.express_company || 'auto') || 'auto'
|
||||
shipForm.tracking_number = String(row.tracking_number || '')
|
||||
shipVisible.value = true
|
||||
}
|
||||
|
||||
async function submitShip() {
|
||||
if (shipForm.ship_mode !== 'direct') {
|
||||
if (!hasPermission(['tcm.prescriptionOrder/submitGancaoRecipel'])) {
|
||||
feedback.msgError('暂无上传甘草药方权限,请改用「药房直发」并填写快递单号,或联系管理员开通权限')
|
||||
return
|
||||
}
|
||||
shipVisible.value = false
|
||||
await confirmSubmitGancaoRecipel({ id: shipRowId.value })
|
||||
return
|
||||
}
|
||||
if (!shipForm.tracking_number.trim()) {
|
||||
feedback.msgError('请先填写快递单号再确认发货')
|
||||
return
|
||||
@@ -4762,7 +4796,7 @@ async function submitShip() {
|
||||
try {
|
||||
await prescriptionOrderShip({
|
||||
id: shipRowId.value,
|
||||
ship_mode: shipForm.ship_mode === 'direct' ? 'direct' : 'gancao',
|
||||
ship_mode: 'direct',
|
||||
express_company: shipForm.express_company || 'auto',
|
||||
tracking_number: shipForm.tracking_number.trim()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user