1. 诊所管理
This commit is contained in:
@@ -135,6 +135,11 @@ export function erpSyncText(v) {
|
||||
return '未同步'
|
||||
}
|
||||
|
||||
export function prescriptionStatusText(status) {
|
||||
const m = { 0: '待审核', 1: '已审核', 2: '已驳回', 3: '已过期' }
|
||||
return m[status] != null ? m[status] : '-'
|
||||
}
|
||||
|
||||
export function freeShippingText(v) {
|
||||
if (v === 1) return '包邮'
|
||||
return '不包邮'
|
||||
@@ -238,6 +243,7 @@ export function mapOrderProductItem(p, prescriptionType) {
|
||||
: '×' + (p.number != null ? p.number : 0)
|
||||
const isTcm = prescriptionType === 1
|
||||
return {
|
||||
id: p.id,
|
||||
drugName: p.drug_name || drug.drug_name || '药品',
|
||||
drugNumber: drug.drug_number || '',
|
||||
imageUrl: resolveDrugImage(p.drug_image || drug.image),
|
||||
@@ -276,6 +282,9 @@ export function mapOrderDetailDisplay(info) {
|
||||
if (!info || !info.id) return {}
|
||||
const freeShip = info.is_free_shipping === 1 || info.free_ship === 1
|
||||
const canView = !!(info.p_id && info.order_type !== 2 && info.order_type !== 3)
|
||||
const presStatus = info.prescription && info.prescription.status != null
|
||||
? info.prescription.status
|
||||
: null
|
||||
return {
|
||||
orderTypeText: orderTypeText(info.order_type),
|
||||
marketPrice: formatMoney(info.market_price),
|
||||
@@ -284,6 +293,7 @@ export function mapOrderDetailDisplay(info) {
|
||||
showPrescription: mapOrderPrescription(info),
|
||||
prescriptionId: info.p_id,
|
||||
canViewPrescription: canView,
|
||||
prescriptionStatusText: canView && presStatus != null ? prescriptionStatusText(presStatus) : '',
|
||||
statusText: orderStatusText(info.status),
|
||||
prescriptionTypeText: prescriptionTypeText(info.prescription_type),
|
||||
deliveryText: deliveryMethodText(info.delivery_method),
|
||||
@@ -398,16 +408,20 @@ export function warehouseStatusText(status) {
|
||||
return '-'
|
||||
}
|
||||
|
||||
export function mapWarehouseRow(item) {
|
||||
export function mapWarehouseRow(item, warehouseType = 'store') {
|
||||
if (!item) return {}
|
||||
const drug = item.drug || {}
|
||||
const storeDrug = drug.drug_store_drug || {}
|
||||
const suggestPrice = storeDrug.price != null ? storeDrug.price : drug.price
|
||||
const isPlatform = warehouseType === 'platform'
|
||||
const supplyRaw = isPlatform
|
||||
? (item.market_price ?? item.buy_price)
|
||||
: (item.buy_price ?? item.market_price)
|
||||
return {
|
||||
id: item.id,
|
||||
drugName: drug.drug_name || '-',
|
||||
imageUrl: resolveDrugImage(drug.image),
|
||||
buyPrice: formatMoney(item.buy_price),
|
||||
buyPrice: formatMoney(supplyRaw),
|
||||
price: formatMoney(item.price),
|
||||
suggestPrice: formatMoney(suggestPrice),
|
||||
stock: item.stock != null ? item.stock : '-',
|
||||
|
||||
Reference in New Issue
Block a user