fix: 协议子资源单事务保存,并补齐样本编码/OA/质检等近期能力
锁定缴费校验失败时整单回滚,避免样本半成功落库;前端禁止删除锁定缴费样本,改码走更正编码。同步落地样本更正、采集微信通知、OA提及未读、细胞产品套餐与相关迁移文档。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
19bc66ba45
commit
5dad1bb0e3
142 files changed
+95584
-65717
No files matched your search
@@ -528,23 +528,29 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!isEdit" class="cell-product-toolbar">
|
||||
<div class="cell-product-toolbar">
|
||||
<div class="section-subtitle">细胞产品</div>
|
||||
<el-button type="primary" :disabled="!canAddCellProduct" @click="addSaleProductLine">
|
||||
<el-button
|
||||
v-if="!isEdit"
|
||||
type="primary"
|
||||
:disabled="!canAddCellProduct"
|
||||
@click="addSaleProductLine"
|
||||
>
|
||||
<el-icon><Plus /></el-icon>
|
||||
添加产品
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-if="!isEdit"
|
||||
:data="saleProductLines"
|
||||
stripe
|
||||
class="cell-product-table"
|
||||
style="width: 100%"
|
||||
empty-text="暂无交付计划"
|
||||
>
|
||||
<el-table-column label="细胞产品" min-width="180">
|
||||
<template #default="{ row, $index }">
|
||||
<el-select
|
||||
v-if="!isEdit"
|
||||
v-model="row.priceId"
|
||||
filterable
|
||||
clearable
|
||||
@@ -559,28 +565,55 @@
|
||||
:value="p.priceId"
|
||||
/>
|
||||
</el-select>
|
||||
<span v-else>{{
|
||||
formatSaleProductDisplay(row) || '—'
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格" min-width="100">
|
||||
<template #default="{ row }">{{ row.specText || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品包装" min-width="140">
|
||||
<template #default="{ row }">
|
||||
<el-select
|
||||
v-if="!isEdit"
|
||||
v-model="row.packageId"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="选择包装"
|
||||
class="cell-product-table__control"
|
||||
@change="onSalePackageSelect(row, $event)"
|
||||
>
|
||||
<el-option
|
||||
v-for="pkg in packageOptions"
|
||||
:key="pkg.id"
|
||||
:label="pkg.packageName"
|
||||
:value="pkg.id"
|
||||
/>
|
||||
</el-select>
|
||||
<span v-else>{{ row.packageText || '—' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参考单价(元)" min-width="120" align="right">
|
||||
<template #default="{ row }">{{ formatMoneyDisplay(row.agreementPrice, 2) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实际单价(元)" min-width="130">
|
||||
<template #default="{ row }">
|
||||
<DecimalInput
|
||||
v-if="!isEdit"
|
||||
v-model="row.actualPrice"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
style="width: 100%"
|
||||
@change="syncSaleLineAmount(row)"
|
||||
/>
|
||||
<span v-else>{{ formatMoneyDisplay(row.actualPrice, 2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="份数" min-width="90">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-if="!isEdit"
|
||||
v-model="row.quantity"
|
||||
:min="1"
|
||||
:max="9999"
|
||||
@@ -588,30 +621,35 @@
|
||||
style="width: 100%"
|
||||
@change="syncSaleLineAmount(row)"
|
||||
/>
|
||||
<span v-else>{{ row.quantity ?? '—' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="bizConfig.pickupTimeLabel" min-width="180">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker
|
||||
v-if="!isEdit"
|
||||
v-model="row.pickupTime"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="请选择交付时间"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<span v-else>{{ row.pickupTime || '—' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额(元)" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<DecimalInput
|
||||
v-if="!isEdit"
|
||||
v-model="row.amount"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<span v-else>{{ formatMoneyDisplay(row.amount, 2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="80" align="center">
|
||||
<el-table-column v-if="!isEdit" label="操作" min-width="80" align="center">
|
||||
<template #default="{ $index }">
|
||||
<el-button link type="danger" @click="removeSaleProductLine($index)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
@@ -1195,6 +1233,7 @@
|
||||
fetchChannelAgreements,
|
||||
fetchChannelAgreementPrices,
|
||||
fetchCellProductPriceList,
|
||||
fetchCellProductPackageList,
|
||||
fetchDictDataOptions,
|
||||
fetchCustomerList,
|
||||
fetchCreateCustomer
|
||||
@@ -1290,6 +1329,8 @@
|
||||
projectName: string
|
||||
cellTypeName: string
|
||||
specText: string
|
||||
packageId: string
|
||||
packageText: string
|
||||
agreementPrice: number
|
||||
actualPrice: number
|
||||
quantity: number
|
||||
@@ -1299,6 +1340,7 @@
|
||||
|
||||
let saleLineSeq = 0
|
||||
const saleProductLines = ref<SaleProductLine[]>([])
|
||||
const packageOptions = ref<Api.CellProductPackage.CellProductPackageItem[]>([])
|
||||
|
||||
const formRules = reactive({
|
||||
applicationName: [{ required: true, message: '请输入申请单名称', trigger: 'blur' }],
|
||||
@@ -1538,6 +1580,21 @@
|
||||
return !!selectedServiceOrder.value && agreementPriceOptions.value.length > 0
|
||||
})
|
||||
|
||||
const loadPackageOptions = async () => {
|
||||
try {
|
||||
const res: any = await fetchCellProductPackageList({ page: 1, pageSize: 100 })
|
||||
packageOptions.value = res?.list || []
|
||||
} catch {
|
||||
packageOptions.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const onSalePackageSelect = (line: SaleProductLine, packageId: string) => {
|
||||
const pkg = packageOptions.value.find((p) => p.id === packageId)
|
||||
line.packageId = packageId || ''
|
||||
line.packageText = pkg?.packageName || ''
|
||||
}
|
||||
|
||||
const addSaleProductLine = () => {
|
||||
saleProductLines.value.push({
|
||||
_localId: ++saleLineSeq,
|
||||
@@ -1546,6 +1603,8 @@
|
||||
projectName: '',
|
||||
cellTypeName: '',
|
||||
specText: '',
|
||||
packageId: '',
|
||||
packageText: '',
|
||||
agreementPrice: 0,
|
||||
actualPrice: 0,
|
||||
quantity: 1,
|
||||
@@ -2677,6 +2736,13 @@
|
||||
return `${name}(${cellType}、${spec}、¥${price})`
|
||||
}
|
||||
|
||||
const formatSaleProductDisplay = (row: SaleProductLine) => {
|
||||
const name = row.projectName || row.projectCode || ''
|
||||
const cellType = row.cellTypeName || ''
|
||||
if (name && cellType) return `${name}(${cellType})`
|
||||
return name || cellType
|
||||
}
|
||||
|
||||
// ── 弹窗打开 ───────────────────────────────────────────────────────────
|
||||
const handleOpen = () => {
|
||||
resetForm()
|
||||
@@ -2686,6 +2752,9 @@
|
||||
if (isClinical.value || isBasicExperiment.value) {
|
||||
loadClinicalCellProductPrices()
|
||||
}
|
||||
if (isBasicExperiment.value) {
|
||||
loadPackageOptions()
|
||||
}
|
||||
if (isBasicExperiment.value && !isEdit.value) {
|
||||
addSaleProductLine()
|
||||
}
|
||||
@@ -2878,6 +2947,8 @@
|
||||
projectName: cp.projectName || '',
|
||||
cellTypeName: cp.cellTypeName || s.cellType || '',
|
||||
specText: cp.specText || s.specText || '',
|
||||
packageId: cp.packageId || s.packageId || '',
|
||||
packageText: cp.packageText || s.packageText || '',
|
||||
agreementPrice: cp.agreementPrice ?? 0,
|
||||
actualPrice: cp.actualPrice ?? 0,
|
||||
quantity: cp.quantity || 1,
|
||||
@@ -2922,6 +2993,10 @@
|
||||
ElMessage.warning(`第 ${i + 1} 行请选择细胞产品`)
|
||||
return
|
||||
}
|
||||
if (!line.packageId) {
|
||||
ElMessage.warning(`第 ${i + 1} 行请选择产品包装`)
|
||||
return
|
||||
}
|
||||
if (!line.pickupTime) {
|
||||
ElMessage.warning(`第 ${i + 1} 行请填写提货时间`)
|
||||
return
|
||||
@@ -3030,6 +3105,8 @@
|
||||
projectName: line.projectName,
|
||||
cellTypeName: line.cellTypeName,
|
||||
specText: line.specText,
|
||||
packageId: line.packageId,
|
||||
packageText: line.packageText,
|
||||
agreementPrice: line.agreementPrice,
|
||||
actualPrice: line.actualPrice,
|
||||
quantity: line.quantity || 1,
|
||||
|
||||
Reference in new issue
Block a user