feat(prescription): 更新处方列表数据结构并优化药品管理界面功能
- 在处方列表中新增总价、剂量和剂量数量字段 - 修复药品审批页面跳转时仓库信息丢失问题 - 扩展药品列表列宽度并启用溢出提示功能 - 为采购单界面添加多种视图状态下的字段禁用逻辑 - 优化采购单仓库位置字段的初始化流程,防止数据丢失
This commit is contained in:
@@ -2144,7 +2144,10 @@ function handleDelete() {
|
||||
adviceType: item.adviceType,
|
||||
statusEnum: item.statusEnum,
|
||||
adviceName: item.adviceName,
|
||||
uniqueKey: item.uniqueKey
|
||||
uniqueKey: item.uniqueKey,
|
||||
totalPrice: item.totalPrice,
|
||||
dose: item.dose,
|
||||
doseQuantity: item.doseQuantity
|
||||
})));
|
||||
|
||||
for (let i = prescriptionList.value.length - 1; i >= 0; i--) {
|
||||
|
||||
@@ -310,6 +310,11 @@ function handelApplys(row, view) {
|
||||
// 采购入库 1
|
||||
getpurchaseInventoryDetail(row.supplyBusNo).then((response) => {
|
||||
let currentData = response.data;
|
||||
// 从明细数据中获取仓库ID并设置到row,确保跳转后仓库字段能正确显示
|
||||
if (currentData && currentData.length > 0 && !row.purposeLocationId) {
|
||||
row.purposeLocationId = currentData[0].purposeLocationId;
|
||||
row.purposeLocationId_dictText = currentData[0].purposeLocationName;
|
||||
}
|
||||
store.setCurrentData({ editRow: row, item: currentData });
|
||||
router.replace({
|
||||
path: '/medicationmanagement/medicationmanagement/purchaseDocument',
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
label="项目名称"
|
||||
align="center"
|
||||
prop="name"
|
||||
width="180"
|
||||
width="250"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="项目类型"
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
clearable
|
||||
filterable
|
||||
style="width: 150px"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
@change="handleMedicationTypeChange"
|
||||
>
|
||||
<el-option
|
||||
@@ -134,6 +135,7 @@
|
||||
placeholder=""
|
||||
clearable
|
||||
style="width: 150px"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
@visible-change="handlePurposeTypeEnumVisibleChange"
|
||||
@change="handleChangeLocationType"
|
||||
>
|
||||
@@ -152,6 +154,7 @@
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
@visible-change="handleHeaderLocationVisibleChange"
|
||||
>
|
||||
<el-option
|
||||
@@ -200,7 +203,7 @@
|
||||
:model="form"
|
||||
:rules="tableRules"
|
||||
ref="formRef"
|
||||
:disabled="viewStatus == 'apply'"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
>
|
||||
<!-- @cell-mouse-enter="handleMouseEnter" -->
|
||||
<!-- v-click-outside-row="handleClickOutside" @row-click="handleRowClick" 点击行以外的部分自动保存 -->
|
||||
@@ -219,8 +222,9 @@
|
||||
align="center"
|
||||
key="name"
|
||||
prop="name"
|
||||
width="200"
|
||||
width="250"
|
||||
fixed
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-form-item
|
||||
@@ -228,7 +232,7 @@
|
||||
:rules="tableRules.name"
|
||||
>
|
||||
<el-input
|
||||
v-if="viewStatus == 'view'"
|
||||
v-if="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
v-model="scope.row.name"
|
||||
placeholder=""
|
||||
disabled
|
||||
@@ -298,7 +302,7 @@
|
||||
>
|
||||
<div class="select_wrapper_div">
|
||||
<el-input
|
||||
:disabled="viewStatus == 'view'"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
v-model="scope.row.itemQuantity"
|
||||
placeholder=""
|
||||
@blur="handleTotalPrice(scope.$index)"
|
||||
@@ -328,7 +332,7 @@
|
||||
placeholder=" "
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
:clearable="false"
|
||||
:disabled="viewStatus == 'view'"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
@change="
|
||||
(value) => handleUnitCodeChange(scope.row, scope.$index, value)
|
||||
"
|
||||
@@ -378,7 +382,7 @@
|
||||
:rules="tableRules.traceNo"
|
||||
>
|
||||
<el-input
|
||||
:disabled="viewStatus == 'view'"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
v-model="scope.row.traceNo"
|
||||
@change="(value) => handleTraceNoInput(value, scope.row)"
|
||||
placeholder=""
|
||||
@@ -403,7 +407,7 @@
|
||||
<el-input
|
||||
v-model="scope.row.packagingLevels"
|
||||
placeholder=""
|
||||
:disabled="viewStatus == 'view'"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -426,7 +430,7 @@
|
||||
placeholder=""
|
||||
@blur="handleTotalPrice(scope.$index)"
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
:disabled="viewStatus == 'view'"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
>
|
||||
<template #suffix>元</template>
|
||||
</el-input>
|
||||
@@ -467,7 +471,7 @@
|
||||
v-model="scope.row.lotNumber"
|
||||
placeholder=""
|
||||
maxlength="100"
|
||||
:disabled="viewStatus == 'view'"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -490,7 +494,7 @@
|
||||
placeholder="选择日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
:disabled="viewStatus == 'view'"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
@change="changeValStart($event, scope.$index)"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -509,7 +513,7 @@
|
||||
:rules="tableRules.endTime"
|
||||
>
|
||||
<el-date-picker
|
||||
:disabled="viewStatus == 'view'"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
v-model="scope.row.endTime"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
@@ -536,7 +540,7 @@
|
||||
v-model="scope.row.invoiceNo"
|
||||
placeholder=""
|
||||
style="text-align: center !important"
|
||||
:disabled="viewStatus == 'view'"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -557,7 +561,7 @@
|
||||
<el-input
|
||||
v-model="scope.row.remake"
|
||||
placeholder=""
|
||||
:disabled="viewStatus == 'view'"
|
||||
:disabled="viewStatus == 'view' || viewStatus == 'apply'"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -1855,13 +1859,19 @@ function edit() {
|
||||
: editData.value.item[0].purposeTypeEnum.toString();
|
||||
receiptHeaderForm.medicationType =
|
||||
editData.value.item[0].itemTable == "med_medication_definition" ? "1" : "2";
|
||||
receiptHeaderForm.headerLocationId = editData.value.editRow?.purposeLocationId || null;
|
||||
// 先保存仓库ID,因为handleChangeLocationType会清空headerLocationId
|
||||
const savedLocationId =
|
||||
editData.value.editRow?.purposeLocationId ||
|
||||
(editData.value.item && editData.value.item.length > 0 ? editData.value.item[0].purposeLocationId : null) ||
|
||||
null;
|
||||
total.value = form.purchaseinventoryList.length;
|
||||
handleChangeLocationType(
|
||||
editData.value.editRow.purposeTypeEnum
|
||||
? editData.value.editRow.purposeTypeEnum.toString()
|
||||
: editData.value.item[0].purposeTypeEnum.toString()
|
||||
);
|
||||
// 在handleChangeLocationType之后再设置仓库ID
|
||||
receiptHeaderForm.headerLocationId = savedLocationId;
|
||||
setTimeout(() => {
|
||||
form.purchaseinventoryList = editData.value.item.map((item) => {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user