108 库房管理-》领用管理-》领用出库的升级
This commit is contained in:
@@ -125,6 +125,23 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="仓库:" prop="headerLocationId">
|
||||||
|
<el-select
|
||||||
|
v-model="receiptHeaderForm.headerLocationId"
|
||||||
|
placeholder="请选择仓库"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
style="width: 200px"
|
||||||
|
:disabled="data.isEdit"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in purposeTypeListOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-tabs type="border-card">
|
<el-tabs type="border-card">
|
||||||
<el-tab-pane label="领用单据明细">
|
<el-tab-pane label="领用单据明细">
|
||||||
@@ -158,10 +175,23 @@
|
|||||||
>
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
|
||||||
|
<div></div>
|
||||||
|
<el-input
|
||||||
|
v-model="detailSearchKey"
|
||||||
|
placeholder="请输入项目|厂家/产地|产品批号"
|
||||||
|
style="width: 280px;"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<template #prefix>
|
||||||
|
<el-icon><Search /></el-icon>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
<el-form :model="form" :rules="tableRules" ref="formRef">
|
<el-form :model="form" :rules="tableRules" ref="formRef">
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="form.purchaseinventoryList"
|
:data="filteredPurchaseinventoryList"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
@row-click="handleRowClick"
|
@row-click="handleRowClick"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
@@ -241,65 +271,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
|
||||||
label="仓库"
|
|
||||||
align="center"
|
|
||||||
key="sourceLocationId"
|
|
||||||
prop="sourceLocationId"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
width="180"
|
|
||||||
>
|
|
||||||
<template #default="scope">
|
|
||||||
<el-form-item
|
|
||||||
:prop="`purchaseinventoryList.${scope.$index}.sourceLocationId`"
|
|
||||||
:rules="tableRules.sourceLocationId"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
<div class="select_wrapper_div">
|
|
||||||
<el-select
|
|
||||||
:disabled="viewStatus == 'view'"
|
|
||||||
v-model="scope.row.sourceLocationId"
|
|
||||||
placeholder="请选择仓库"
|
|
||||||
:class="{ 'error-border': scope.row.error }"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="(item, index) in purposeTypeListOptions"
|
|
||||||
:key="index"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
@click="handleLocationClick(item, scope.row, scope.$index)"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="货位"
|
|
||||||
align="center"
|
|
||||||
key="locationStoreName"
|
|
||||||
prop="locationStoreName"
|
|
||||||
width="180"
|
|
||||||
>
|
|
||||||
<template #default="scope">
|
|
||||||
<el-form-item
|
|
||||||
:prop="`purchaseinventoryList.${scope.$index}.locationStoreName`"
|
|
||||||
:rules="tableRules.locationStoreName"
|
|
||||||
>
|
|
||||||
<div class="select_wrapper_div">
|
|
||||||
<el-select
|
|
||||||
:disabled="viewStatus == 'view'"
|
|
||||||
v-model="scope.row.locationStoreName"
|
|
||||||
placeholder="请选择货位"
|
|
||||||
:class="{ 'error-border': scope.row.error }"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="单价 " align="center" key="price" prop="price" width="130">
|
<el-table-column label="单价 " align="center" key="price" prop="price" width="130">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
@@ -489,6 +462,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="requisitionManagement">
|
<script setup name="requisitionManagement">
|
||||||
|
import {computed} from 'vue';
|
||||||
import {
|
import {
|
||||||
addTransferProduct,
|
addTransferProduct,
|
||||||
delTransferProduct,
|
delTransferProduct,
|
||||||
@@ -550,10 +524,6 @@ const props = defineProps({
|
|||||||
type: Object,
|
type: Object,
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
purposeTypeListOptions: {
|
|
||||||
type: Object,
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
categoryListOptions: {
|
categoryListOptions: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: false,
|
required: false,
|
||||||
@@ -601,7 +571,6 @@ const data = reactive({
|
|||||||
},
|
},
|
||||||
tableRules: {
|
tableRules: {
|
||||||
name: [{ required: true, message: '项目不能为空', trigger: 'change' }],
|
name: [{ required: true, message: '项目不能为空', trigger: 'change' }],
|
||||||
sourceLocationId: [{ required: true, message: '仓库不能为空', trigger: 'change' }],
|
|
||||||
unitCode: [{ required: true, message: '计量单位不能为空', trigger: 'change' }],
|
unitCode: [{ required: true, message: '计量单位不能为空', trigger: 'change' }],
|
||||||
|
|
||||||
itemQuantity: [{ required: true, message: '领用数量不能为空', trigger: 'blur' }],
|
itemQuantity: [{ required: true, message: '领用数量不能为空', trigger: 'blur' }],
|
||||||
@@ -631,6 +600,20 @@ const tableRef = ref(undefined); // 表格引用
|
|||||||
const currentRow = ref(undefined); // 当前操作的行
|
const currentRow = ref(undefined); // 当前操作的行
|
||||||
const medicineSearchKey = ref('');
|
const medicineSearchKey = ref('');
|
||||||
const itemType = ref('');
|
const itemType = ref('');
|
||||||
|
const detailSearchKey = ref('');
|
||||||
|
|
||||||
|
const filteredPurchaseinventoryList = computed(() => {
|
||||||
|
if (!detailSearchKey.value) {
|
||||||
|
return form.purchaseinventoryList;
|
||||||
|
}
|
||||||
|
const searchKey = detailSearchKey.value.toLowerCase();
|
||||||
|
return form.purchaseinventoryList.filter((item) => {
|
||||||
|
const nameMatch = item.name ? item.name.toLowerCase().includes(searchKey) : false;
|
||||||
|
const manufacturerMatch = item.manufacturerText ? item.manufacturerText.toLowerCase().includes(searchKey) : false;
|
||||||
|
const lotNumberMatch = item.lotNumber ? item.lotNumber.toLowerCase().includes(searchKey) : false;
|
||||||
|
return nameMatch || manufacturerMatch || lotNumberMatch;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => store.currentDataLYCK,
|
() => store.currentDataLYCK,
|
||||||
@@ -649,6 +632,21 @@ watch(
|
|||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => receiptHeaderForm.locationId,
|
||||||
|
(newVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
getPharmacyCabinetList().then((res) => {
|
||||||
|
purposeTypeListOptions.value = res.data;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
purposeTypeListOptions.value = [];
|
||||||
|
receiptHeaderForm.headerLocationId = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => form.purchaseinventoryList,
|
() => form.purchaseinventoryList,
|
||||||
(newVlaue) => {
|
(newVlaue) => {
|
||||||
@@ -683,9 +681,6 @@ function addNewRow() {
|
|||||||
occurrenceTime: '',
|
occurrenceTime: '',
|
||||||
typeEnum_enumText: '',
|
typeEnum_enumText: '',
|
||||||
statusEnum_enumText: '',
|
statusEnum_enumText: '',
|
||||||
// sourceLocationId:"", // 源仓库
|
|
||||||
// purposeLocationId:"", //目的仓库
|
|
||||||
// sourceLocationName:"",
|
|
||||||
purposeLocationName: '',
|
purposeLocationName: '',
|
||||||
approverId_dictText: '',
|
approverId_dictText: '',
|
||||||
applicantId_dictText: '',
|
applicantId_dictText: '',
|
||||||
@@ -705,10 +700,7 @@ function addNewRow() {
|
|||||||
purposeLocationStoreId: '',
|
purposeLocationStoreId: '',
|
||||||
practitionerId: '',
|
practitionerId: '',
|
||||||
practitionerName: '',
|
practitionerName: '',
|
||||||
applicantId: '',
|
|
||||||
traceNo: '',
|
traceNo: '',
|
||||||
traceNo: '',
|
|
||||||
// locationName:"",
|
|
||||||
ybNo: '',
|
ybNo: '',
|
||||||
invoiceNo: '',
|
invoiceNo: '',
|
||||||
startTime: '',
|
startTime: '',
|
||||||
@@ -716,13 +708,11 @@ function addNewRow() {
|
|||||||
price: '',
|
price: '',
|
||||||
totalPrice: '',
|
totalPrice: '',
|
||||||
datailJson: '',
|
datailJson: '',
|
||||||
supplierId: '',
|
|
||||||
totalQuantity: '',
|
totalQuantity: '',
|
||||||
// unitList: {unitCode: "2", unitCode_dictText: "盒", minUnitCode: "1", minUnitCode_dictText: "片"},
|
unitList: {},
|
||||||
unitList: {}, // 单位列表
|
isEditing: true,
|
||||||
isEditing: true, // 标记当前行是否正在编辑
|
error: false,
|
||||||
error: false, // 新增 error 字段
|
isSave: false,
|
||||||
isSave: false, // 当前行是否保存
|
|
||||||
};
|
};
|
||||||
form.purchaseinventoryList.push(newRow);
|
form.purchaseinventoryList.push(newRow);
|
||||||
data.isAdding = true; // 设置标志位为 true,表示有未保存的
|
data.isAdding = true; // 设置标志位为 true,表示有未保存的
|
||||||
@@ -751,14 +741,16 @@ function handleBlur(row, index) {
|
|||||||
row.busNo = receiptHeaderForm.busNo;
|
row.busNo = receiptHeaderForm.busNo;
|
||||||
row.occurrenceTime = receiptHeaderForm.occurrenceTime;
|
row.occurrenceTime = receiptHeaderForm.occurrenceTime;
|
||||||
|
|
||||||
// 领用仓库
|
// 领用仓库(从表头获取)
|
||||||
|
if (receiptHeaderForm.headerLocationId) {
|
||||||
let sourceLocation = purposeTypeListOptions.value.filter((e) => {
|
let sourceLocation = purposeTypeListOptions.value.filter((e) => {
|
||||||
return e.id == row.sourceLocationId;
|
return e.id == receiptHeaderForm.headerLocationId;
|
||||||
});
|
});
|
||||||
|
if (sourceLocation && sourceLocation.length > 0) {
|
||||||
row.sourceLocationId = sourceLocation[0].id;
|
row.sourceLocationId = sourceLocation[0].id;
|
||||||
|
|
||||||
row.sourceTypeEnum = sourceLocation[0].formEnum;
|
row.sourceTypeEnum = sourceLocation[0].formEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 领用部门
|
// 领用部门
|
||||||
let purposeLocation = issueDepartmentDto.value.filter((e) => {
|
let purposeLocation = issueDepartmentDto.value.filter((e) => {
|
||||||
@@ -795,6 +787,10 @@ function getTransferProductDetails() {
|
|||||||
form.purchaseinventoryList[index].statusMaxvalue = false;
|
form.purchaseinventoryList[index].statusMaxvalue = false;
|
||||||
e.volume = e.totalVolume;
|
e.volume = e.totalVolume;
|
||||||
e.name = e.itemName;
|
e.name = e.itemName;
|
||||||
|
if (e.sourceLocationId) {
|
||||||
|
// 源仓库(领用仓库)
|
||||||
|
receiptHeaderForm.headerLocationId = e.sourceLocationId;
|
||||||
|
}
|
||||||
if (e.purposeLocationId) {
|
if (e.purposeLocationId) {
|
||||||
//目的仓库
|
//目的仓库
|
||||||
receiptHeaderForm.locationId = e.purposeLocationId;
|
receiptHeaderForm.locationId = e.purposeLocationId;
|
||||||
|
|||||||
Reference in New Issue
Block a user