``` refactor(db): 移除SQL语句中的public schema前缀
This commit is contained in:
@@ -103,239 +103,6 @@
|
||||
']'
|
||||
}}
|
||||
</span>
|
||||
|
||||
<!-- 可滚动的内容区域 -->
|
||||
<div
|
||||
class="prescription-scroll-container"
|
||||
style="
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
max-height: calc(100vh - 300px);
|
||||
width: 100%;
|
||||
"
|
||||
>
|
||||
<!-- 循环显示所有西药方 -->
|
||||
<div
|
||||
v-for="(prescription, pIndex) in westernPrescriptions"
|
||||
:key="prescription.id"
|
||||
style="
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
min-width: fit-content;
|
||||
"
|
||||
>
|
||||
<!-- 西药方标题栏 -->
|
||||
<div
|
||||
class="prescription-header"
|
||||
style="
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #f5f7fa;
|
||||
padding: 10px 12px;
|
||||
border-radius: 4px;
|
||||
min-height: 40px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
"
|
||||
>
|
||||
<span
|
||||
style="font-weight: 600; font-size: 14px; color: #409eff; flex: 0 0 auto"
|
||||
>{{ prescription.name }}</span
|
||||
>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="handleClosePrescription(prescription.id)"
|
||||
style="flex: 0 0 auto; margin-left: 10px"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 西药方操作区 -->
|
||||
<div
|
||||
style="
|
||||
margin-bottom: 5px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
"
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleAddPrescription(prescription.id)"
|
||||
:disabled="false"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleSaveBatch(prescription.id)"
|
||||
:disabled="false"
|
||||
>
|
||||
保存
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleSave(prescription.id)"
|
||||
:disabled="false"
|
||||
>
|
||||
签发
|
||||
</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
@click="handleSingOut(prescription.id)"
|
||||
:disabled="false"
|
||||
>
|
||||
撤回
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="proxy.$refs.orderFroupRef.handleOpen()"
|
||||
:disabled="false"
|
||||
>
|
||||
组套
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
:disabled="false"
|
||||
@click="proxy.$refs.prescriptionHistoryRef.handleOpen()"
|
||||
>
|
||||
历史
|
||||
</el-button>
|
||||
<el-button
|
||||
type="default"
|
||||
@click="combination(prescription.id)"
|
||||
:disabled="false"
|
||||
>
|
||||
组合
|
||||
</el-button>
|
||||
<el-button type="default" @click="split(prescription.id)" :disabled="false">
|
||||
拆组
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
@click="handleDelete(prescription.id)"
|
||||
:disabled="false"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<el-button type="primary" @click="refresh(prescription.id)" :disabled="false">
|
||||
刷新
|
||||
</el-button>
|
||||
<span class="descriptions-item-label"> 诊断: </span>
|
||||
<el-select
|
||||
v-model="prescription.conditionDefinitionId"
|
||||
placeholder="诊断"
|
||||
style="width: 180px"
|
||||
@change="
|
||||
handleDiagnosisChange(prescription.conditionDefinitionId, prescription.id)
|
||||
"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in diagnosisList"
|
||||
:key="item.conditionId"
|
||||
:label="item.name"
|
||||
:value="item.definitionId"
|
||||
/>
|
||||
</el-select>
|
||||
<span class="descriptions-item-label"> 费用性质: </span>
|
||||
<el-select
|
||||
v-model="prescription.accountId"
|
||||
placeholder="费用性质"
|
||||
style="width: 180px"
|
||||
@change="
|
||||
(value) => {
|
||||
accountId = value;
|
||||
}
|
||||
"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in contractList"
|
||||
:key="item.accountId"
|
||||
:label="item.contractName"
|
||||
:value="item.accountId"
|
||||
/>
|
||||
</el-select>
|
||||
<span class="descriptions-item-label">
|
||||
合计金额:{{ getPrescriptionTotalAmount(prescription.id) }}元
|
||||
</span>
|
||||
</div>
|
||||
<el-table
|
||||
max-height="400"
|
||||
:ref="'prescriptionRef' + pIndex"
|
||||
:data="allPrescriptionsData[prescription.id] || []"
|
||||
row-key="uniqueKey"
|
||||
border
|
||||
@cell-click="
|
||||
(row, column, cell, event) =>
|
||||
clickRow(row, column, cell, event, prescription.id)
|
||||
"
|
||||
@row-dblclick="(row, event) => clickRowDb(row, event, prescription.id)"
|
||||
v-loading="loading"
|
||||
:expand-row-keys="prescription.expandOrder || []"
|
||||
style="width: 100%; min-width: 100%"
|
||||
>
|
||||
<el-table-column type="expand" width="1" style="width: 0">
|
||||
<template #default="scope">
|
||||
<el-form
|
||||
:model="scope.row"
|
||||
:rules="rowRules"
|
||||
:ref="'formRef_' + prescription.id + '_' + scope.$index"
|
||||
>
|
||||
<div
|
||||
class="expend_div"
|
||||
style="padding: 16px; background: #f8f9fa; border-radius: 8px"
|
||||
>
|
||||
<template v-if="scope.row.adviceType == 1">
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
gap: 16px;
|
||||
"
|
||||
>
|
||||
<span class="medicine-title">
|
||||
{{
|
||||
scope.row.adviceName +
|
||||
" " +
|
||||
scope.row.volume +
|
||||
" [" +
|
||||
Number(scope.row.unitPrice).toFixed(2) +
|
||||
" 元" +
|
||||
"/" +
|
||||
scope.row.unitCode_dictText +
|
||||
"]"
|
||||
}}
|
||||
</span>
|
||||
|
||||
<!-- <el-form-item prop="conditionDefinitionId">
|
||||
<el-select
|
||||
v-model="scope.row.conditionDefinitionId"
|
||||
style="width: 180px; margin: 0 20px"
|
||||
placeholder="诊断"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in diagnosisList"
|
||||
:key="item.conditionId"
|
||||
:label="item.name"
|
||||
:value="item.definitionId"
|
||||
@click="handleDiagnosisChange(item, scope.row)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item prop="lotNumber" label="药房:">
|
||||
<el-select
|
||||
v-model="scope.row.inventoryId"
|
||||
@@ -556,12 +323,13 @@
|
||||
@input="calculateTotalPrice(scope.row, scope.$index)"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-select
|
||||
v-model="scope.row.unitCode"
|
||||
style="width: 70px; margin-right: 20px"
|
||||
placeholder=" "
|
||||
@change="calculateTotalAmount(scope.row, scope.$index)"
|
||||
>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="scope.row.unitCode"
|
||||
style="width: 70px; margin-right: 20px"
|
||||
placeholder=" "
|
||||
@change="calculateTotalAmount(scope.row, scope.$index)"
|
||||
>
|
||||
<template v-for="item in scope.row.unitCodeList" :key="item.value">
|
||||
<el-option
|
||||
v-if="checkUnit(item, scope.row)"
|
||||
@@ -574,7 +342,7 @@
|
||||
} else {
|
||||
scope.row.unitPrice = scope.row.unitTempPrice;
|
||||
}
|
||||
"
|
||||
}"
|
||||
@input="convertValues(scope.row, scope.$index)"
|
||||
@keyup.enter.prevent="
|
||||
handleEnter(
|
||||
@@ -585,7 +353,9 @@
|
||||
)
|
||||
"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 剂量单位 -->
|
||||
<el-select
|
||||
v-model="scope.row.unitCode"
|
||||
@@ -868,84 +638,65 @@
|
||||
"]"
|
||||
}}
|
||||
</span>
|
||||
|
||||
<!-- <el-form-item prop="conditionDefinitionId">
|
||||
<el-select
|
||||
v-model="scope.row.inventoryId"
|
||||
style="width: 180px; margin-right: 20px"
|
||||
placeholder="药房"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in scope.row.stockList"
|
||||
:key="item.inventoryId"
|
||||
:value="item.inventoryId"
|
||||
:label="
|
||||
item.locationName +
|
||||
' ' +
|
||||
' 库存:' +
|
||||
stockFormat(scope.row.partPercent, scope.row.unitCodeList, item.quantity)
|
||||
"
|
||||
@click="handleNumberClick(item, scope.$index, scope.row)"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item
|
||||
label="数量:"
|
||||
prop="quantity"
|
||||
class="required-field"
|
||||
data-prop="quantity"
|
||||
>
|
||||
<el-input-number
|
||||
placeholder="数量"
|
||||
v-model="scope.row.quantity"
|
||||
style="width: 70px"
|
||||
controls-position="right"
|
||||
:controls="false"
|
||||
:ref="(el) => (inputRefs.quantity = el)"
|
||||
@keyup.enter.prevent="handleEnter('quantity', scope.row, scope.$index)"
|
||||
@input="calculateTotalAmount(scope.row, scope.$index)"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-select
|
||||
v-model="scope.row.unitCode"
|
||||
style="width: 70px; margin-right: 20px"
|
||||
placeholder=" "
|
||||
@change="calculateTotalAmount(scope.row, scope.$index)"
|
||||
>
|
||||
<template v-for="item in scope.row.unitCodeList" :key="item.value">
|
||||
<el-option
|
||||
v-if="item.type != unitMap['dose']"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
@click="
|
||||
() => {
|
||||
scope.row.unitCode_dictText = item.label;
|
||||
}
|
||||
"
|
||||
@keyup.enter.prevent="
|
||||
handleEnter(
|
||||
'executeNum',
|
||||
scope.row,
|
||||
scope.$index,
|
||||
prescription.id
|
||||
)
|
||||
"
|
||||
style="width: 70px; margin-right: 20px"
|
||||
<el-form-item
|
||||
label="数量:"
|
||||
prop="quantity"
|
||||
class="required-field"
|
||||
data-prop="quantity"
|
||||
>
|
||||
<el-input-number
|
||||
placeholder="数量"
|
||||
v-model="scope.row.quantity"
|
||||
style="width: 70px"
|
||||
controls-position="right"
|
||||
:controls="false"
|
||||
:ref="(el) => (inputRefs.quantity = el)"
|
||||
@keyup.enter.prevent="handleEnter('quantity', scope.row, scope.$index)"
|
||||
@input="calculateTotalAmount(scope.row, scope.$index)"
|
||||
/>
|
||||
</template>
|
||||
</el-select>
|
||||
<span class="total-amount">
|
||||
总金额:{{
|
||||
scope.row.totalPrice
|
||||
? Number(scope.row.totalPrice).toFixed(2) + ' 元'
|
||||
: '0.00 元'
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
<el-button type="primary" @click="handleSaveSign(scope.row, scope.$index)">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="scope.row.unitCode"
|
||||
style="width: 70px; margin-right: 20px"
|
||||
placeholder=" "
|
||||
@change="calculateTotalAmount(scope.row, scope.$index)"
|
||||
>
|
||||
<template v-for="item in scope.row.unitCodeList" :key="item.value">
|
||||
<el-option
|
||||
v-if="item.type != unitMap['dose']"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
@click="
|
||||
() => {
|
||||
scope.row.unitCode_dictText = item.label;
|
||||
}
|
||||
"
|
||||
@keyup.enter.prevent="
|
||||
handleEnter(
|
||||
'executeNum',
|
||||
scope.row,
|
||||
scope.$index,
|
||||
prescription.id
|
||||
)
|
||||
"
|
||||
style="width: 70px; margin-right: 20px"
|
||||
/>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<span class="total-amount">
|
||||
总金额:{{
|
||||
scope.row.totalPrice
|
||||
? Number(scope.row.totalPrice).toFixed(2) + ' 元'
|
||||
: '0.00 元'
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
<el-button type="primary" @click="handleSaveSign(scope.row, scope.$index, prescription.id)">
|
||||
确定
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div style="display: flex; align-items: center; margin-bottom: 16px; gap: 16px">
|
||||
<span style="font-size: 16px; font-weight: 600">
|
||||
@@ -1002,9 +753,7 @@
|
||||
: '0.00 元'
|
||||
}}
|
||||
</span>
|
||||
<span style="font-size: 16px; font-weight: 600">
|
||||
<!-- 金额: {{ scope.row.priceList[0].price }} -->
|
||||
</span>
|
||||
<!-- 金额: {{ scope.row.priceList[0].price }} -->
|
||||
</div>
|
||||
<el-button type="primary" @click="handleSaveSign(scope.row, scope.$index)">
|
||||
确定
|
||||
@@ -2425,63 +2174,6 @@ function handleSkinTest(selectRows) {
|
||||
);
|
||||
}
|
||||
|
||||
// 处理自动带出的诊疗或者耗材
|
||||
function handleOrderBindInfo(bindIdInfo) {
|
||||
const adviceDefinitionIds = bindIdInfo.map((row) => row.orderDefinitionId);
|
||||
getAdviceBaseInfo({ adviceDefinitionIdParamList: adviceDefinitionIds.join(',') }).then((res) => {
|
||||
const list = res.data.records.map((item) => {
|
||||
const info = bindIdInfo.find((k) => k.orderDefinitionId == item.adviceDefinitionId);
|
||||
return {
|
||||
...item,
|
||||
quantity: info.quantity,
|
||||
unitCode: info.unitCode,
|
||||
};
|
||||
});
|
||||
|
||||
list?.forEach((item) => {
|
||||
rowIndex.value = prescriptionList.value.length;
|
||||
setValue(item);
|
||||
|
||||
// 创建新的处方项目
|
||||
const newRow = {
|
||||
...prescriptionList.value[rowIndex.value],
|
||||
uniqueKey: nextId.value++,
|
||||
patientId: props.patientInfo.patientId,
|
||||
encounterId: props.patientInfo.encounterId,
|
||||
accountId: accountId.value,
|
||||
quantity: item.quantity,
|
||||
methodCode: item.methodCode,
|
||||
rateCode: item.rateCode,
|
||||
dispensePerDuration: item.dispensePerDuration,
|
||||
dose: item.dose,
|
||||
doseQuantity: item.doseQuantity,
|
||||
executeNum: 1,
|
||||
unitCode: item.unitCode,
|
||||
unitCode_dictText: item.unitCodeName || '',
|
||||
statusEnum: 1,
|
||||
dbOpType: prescriptionList.value[rowIndex.value].requestId ? '2' : '1',
|
||||
conditionId: conditionId.value,
|
||||
conditionDefinitionId: conditionDefinitionId.value,
|
||||
encounterDiagnosisId: encounterDiagnosisId.value,
|
||||
};
|
||||
|
||||
// 计算价格和总量
|
||||
const unitInfo = unitCodeList.value.find((k) => k.value == item.unitCode);
|
||||
if (unitInfo && unitInfo.type == 'minUnit') {
|
||||
newRow.price = newRow.minUnitPrice;
|
||||
newRow.totalPrice = (item.quantity * newRow.minUnitPrice).toFixed(6);
|
||||
newRow.minUnitQuantity = item.quantity;
|
||||
} else {
|
||||
newRow.price = newRow.unitPrice;
|
||||
newRow.totalPrice = (item.quantity * newRow.unitPrice).toFixed(6);
|
||||
newRow.minUnitQuantity = item.quantity * item.partPercent;
|
||||
}
|
||||
|
||||
newRow.contentJson = JSON.stringify(newRow);
|
||||
prescriptionList.value[rowIndex.value] = newRow;
|
||||
});
|
||||
});
|
||||
}
|
||||
// 单行处方保存
|
||||
function handleSaveSign(row, index, prescriptionId) {
|
||||
// 如果传入了处方ID,先切换到该处方
|
||||
|
||||
Reference in New Issue
Block a user