更新
This commit is contained in:
@@ -495,7 +495,7 @@
|
||||
>修改单号</el-button>
|
||||
<el-button
|
||||
v-if="canShipRow(row)"
|
||||
v-perms="['tcm.prescriptionOrder/ship', 'tcm.prescriptionOrder/submitGancaoRecipel']"
|
||||
v-perms="['tcm.prescriptionOrder/ship']"
|
||||
type="primary"
|
||||
link
|
||||
@click="openShip(row)"
|
||||
@@ -606,7 +606,7 @@
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="canShipRow(detailData)"
|
||||
v-perms="['tcm.prescriptionOrder/ship', 'tcm.prescriptionOrder/submitGancaoRecipel']"
|
||||
v-perms="['tcm.prescriptionOrder/ship']"
|
||||
type="primary"
|
||||
size="small"
|
||||
plain
|
||||
@@ -1917,15 +1917,6 @@
|
||||
: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"
|
||||
@@ -1935,37 +1926,31 @@
|
||||
<el-form v-loading="shipSaving" label-width="90px" class="pr-2" @submit.prevent="submitShip">
|
||||
<el-form-item label="发货方式">
|
||||
<el-radio-group v-model="shipForm.ship_mode">
|
||||
<el-radio label="gancao">甘草药方发</el-radio>
|
||||
<el-radio label="direct">药房直发</el-radio>
|
||||
<el-radio label="gancao">甘草药房直发</el-radio>
|
||||
<el-radio label="direct">洛阳药房直发</el-radio>
|
||||
</el-radio-group>
|
||||
</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-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>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="shipVisible = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="shipSaving || (shipForm.ship_mode === 'gancao' && gancaoSubmitId === shipRowId)"
|
||||
@click="submitShip"
|
||||
>
|
||||
{{ shipForm.ship_mode === 'gancao' ? '确认并上传药方' : '确认发货' }}
|
||||
<el-button type="primary" :loading="shipSaving" @click="submitShip">
|
||||
确认发货
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -2604,7 +2589,6 @@ 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'
|
||||
@@ -4763,31 +4747,13 @@ const shipForm = reactive({
|
||||
|
||||
function openShip(row: { id: number; express_company?: unknown; tracking_number?: unknown; ship_mode?: unknown }) {
|
||||
shipRowId.value = row.id
|
||||
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.ship_mode = String(row.ship_mode || 'gancao') || '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
|
||||
@@ -4796,7 +4762,7 @@ async function submitShip() {
|
||||
try {
|
||||
await prescriptionOrderShip({
|
||||
id: shipRowId.value,
|
||||
ship_mode: 'direct',
|
||||
ship_mode: shipForm.ship_mode === 'direct' ? 'direct' : 'gancao',
|
||||
express_company: shipForm.express_company || 'auto',
|
||||
tracking_number: shipForm.tracking_number.trim()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user