提交
This commit is contained in:
1 parent
c137b46939
commit
b6c63591ea
126 files changed
+41593
-22990
No files matched your search
@@ -37,28 +37,13 @@
|
||||
<div class="section-title-left"><h3>基本信息</h3></div>
|
||||
</div>
|
||||
<div class="form-grid form-grid--col4">
|
||||
<el-form-item label="协议号" prop="protocolNo">
|
||||
<el-select
|
||||
v-model="formData.protocolNoId"
|
||||
<el-form-item label="协议号">
|
||||
<el-input
|
||||
:model-value="isEdit ? formData.protocolNo : ''"
|
||||
class="w-full"
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
reserve-keyword
|
||||
:remote-method="remoteSearchProtocolNos"
|
||||
:loading="protocolNoLoading"
|
||||
placeholder="输入协议号检索"
|
||||
@change="onProtocolNoChange"
|
||||
@clear="onProtocolNoClear"
|
||||
>
|
||||
<el-option
|
||||
v-for="p in protocolNoOptions"
|
||||
:key="p.id"
|
||||
:label="protocolNoOptionLabel(p)"
|
||||
:value="p.id"
|
||||
:disabled="isProtocolNoOptionDisabled(p)"
|
||||
/>
|
||||
</el-select>
|
||||
disabled
|
||||
:placeholder="isEdit ? '' : '保存后自动生成'"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="协议状态" prop="protocolStatus">
|
||||
<el-select
|
||||
@@ -1171,7 +1156,6 @@
|
||||
fetchItemUnitList,
|
||||
fetchCollectionRegionList,
|
||||
fetchHospitalList,
|
||||
fetchCollectionProtocolNoList,
|
||||
fetchSampleCodeList,
|
||||
fetchExpressCompanyList,
|
||||
fetchSiteList
|
||||
@@ -1236,8 +1220,6 @@
|
||||
}>
|
||||
>([])
|
||||
const unitOptions = ref<Array<{ id: string; unitName: string; unitCode: string }>>([])
|
||||
const protocolNoOptions = ref<Api.BizCollectionProtocolNo.ProtocolNoItem[]>([])
|
||||
const protocolNoLoading = ref(false)
|
||||
const sampleCodeOptions = ref<Api.BizSampleCode.SampleCodeItem[]>([])
|
||||
const sampleCodeLoading = ref(false)
|
||||
const expressCompanyOptions = ref<Api.ExpressCompany.ExpressCompanyItem[]>([])
|
||||
@@ -1480,7 +1462,6 @@
|
||||
})
|
||||
|
||||
const formRules = {
|
||||
protocolNo: [{ required: true, message: '请输入协议号', trigger: 'blur' }],
|
||||
protocolStatus: [{ required: true, message: '请选择协议状态', trigger: 'change' }]
|
||||
}
|
||||
|
||||
@@ -1539,7 +1520,6 @@
|
||||
salesSnapshot.value = null
|
||||
regionOptions.value = []
|
||||
hospitalOptions.value = []
|
||||
protocolNoOptions.value = []
|
||||
selectedSamples.value = []
|
||||
batchTransportVisible.value = false
|
||||
Object.assign(batchTransport, createEmptyTransport())
|
||||
@@ -1799,27 +1779,9 @@
|
||||
if (prot) {
|
||||
formData.collectorUserId = String(prot.collectorUserId || formData.collectorUserId || '')
|
||||
formData.protocolNo = String(prot.protocolNo || formData.protocolNo || '')
|
||||
formData.protocolNoId = String(prot.protocolNoId || formData.protocolNoId || '')
|
||||
formData.protocolStatus = String(prot.protocolStatus || formData.protocolStatus || 'dsx')
|
||||
formData.registerDate = String(prot.registerDate || formData.registerDate || '')
|
||||
formData.remark = String(prot.remark ?? formData.remark ?? '')
|
||||
if (formData.protocolNoId) {
|
||||
protocolNoOptions.value = [
|
||||
{
|
||||
id: formData.protocolNoId,
|
||||
protocolNo: formData.protocolNo,
|
||||
issued: 0,
|
||||
issuedUserId: '',
|
||||
issuedUserName: '',
|
||||
issuedTime: '',
|
||||
tenantNo: '',
|
||||
orderNum: 0,
|
||||
remark: '',
|
||||
createTime: '',
|
||||
updateTime: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
const pc = bundle.partyCustomer as Record<string, any> | null
|
||||
@@ -1905,27 +1867,9 @@
|
||||
resetForm()
|
||||
|
||||
formData.protocolNo = String(row.protocolNo || '')
|
||||
formData.protocolNoId = String((row as any).protocolNoId || '')
|
||||
formData.protocolStatus = String(row.protocolStatus || 'dsx')
|
||||
formData.registerDate = String(row.registerDate || '')
|
||||
formData.collectorUserId = String(row.collectorUserId || '')
|
||||
if (formData.protocolNoId) {
|
||||
protocolNoOptions.value = [
|
||||
{
|
||||
id: formData.protocolNoId,
|
||||
protocolNo: formData.protocolNo,
|
||||
issued: 0,
|
||||
issuedUserId: '',
|
||||
issuedUserName: '',
|
||||
issuedTime: '',
|
||||
tenantNo: '',
|
||||
orderNum: 0,
|
||||
remark: '',
|
||||
createTime: '',
|
||||
updateTime: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
formData.protocolAttachments = String((row as any).protocolAttachments || '')
|
||||
formData.remark = String(row.remark || '')
|
||||
|
||||
@@ -1982,13 +1926,6 @@
|
||||
async function handleSubmit() {
|
||||
if (!formRef.value) return
|
||||
await formRef.value.validate()
|
||||
if (!isEdit.value && formData.protocolNoId) {
|
||||
const picked = protocolNoOptions.value.find((x) => x.id === formData.protocolNoId)
|
||||
if (picked?.usedInProtocol) {
|
||||
ElMessage.warning(`协议号「${formData.protocolNo}」已被占用,请更换其他协议号`)
|
||||
return
|
||||
}
|
||||
}
|
||||
if (!isEdit.value) {
|
||||
for (const sampleRow of formData.samples) {
|
||||
if (!sampleRow.sampleCodeId) continue
|
||||
@@ -2007,9 +1944,7 @@
|
||||
.map((a) => a.fileUrl)
|
||||
.filter(Boolean)
|
||||
.join(',')
|
||||
const payload = {
|
||||
protocolNo: formData.protocolNo,
|
||||
protocolNoId: formData.protocolNoId || undefined,
|
||||
const payload: Record<string, unknown> = {
|
||||
protocolStatus: formData.protocolStatus,
|
||||
registerDate: formData.registerDate || undefined,
|
||||
collectorUserId: formData.collectorUserId || undefined,
|
||||
@@ -2585,52 +2520,6 @@
|
||||
syncContractAmount()
|
||||
}
|
||||
|
||||
/* ====== 协议号下拉检索 ====== */
|
||||
function protocolNoOptionLabel(p: Api.BizCollectionProtocolNo.ProtocolNoItem) {
|
||||
if (p.usedInProtocol) return `${p.protocolNo}(已占用)`
|
||||
if (p.issued) return `${p.protocolNo}(已下发)`
|
||||
return p.protocolNo
|
||||
}
|
||||
|
||||
function isProtocolNoOptionDisabled(p: Api.BizCollectionProtocolNo.ProtocolNoItem) {
|
||||
if (!p.usedInProtocol) return false
|
||||
return !(isEdit.value && p.id === formData.protocolNoId)
|
||||
}
|
||||
|
||||
async function remoteSearchProtocolNos(query: string) {
|
||||
protocolNoLoading.value = true
|
||||
try {
|
||||
const res = await fetchCollectionProtocolNoList({
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
keyword: query || undefined
|
||||
})
|
||||
protocolNoOptions.value = res.list || []
|
||||
} catch {
|
||||
protocolNoOptions.value = []
|
||||
} finally {
|
||||
protocolNoLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function onProtocolNoChange(val: string | null | undefined) {
|
||||
if (!val) {
|
||||
formData.protocolNo = ''
|
||||
formData.protocolNoId = ''
|
||||
return
|
||||
}
|
||||
const p = protocolNoOptions.value.find((x) => x.id === val)
|
||||
if (p) {
|
||||
formData.protocolNo = p.protocolNo
|
||||
formData.protocolNoId = p.id
|
||||
}
|
||||
}
|
||||
|
||||
function onProtocolNoClear() {
|
||||
formData.protocolNo = ''
|
||||
formData.protocolNoId = ''
|
||||
}
|
||||
|
||||
/* ====== 样本编码选择 ====== */
|
||||
function sampleCodeOptionLabel(sc: Api.BizSampleCode.SampleCodeItem) {
|
||||
if (sc.usedInProtocol) return `${sc.sampleCode}(已占用)`
|
||||
|
||||
Reference in new issue
Block a user