提交merge1.3
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container" v-loading="pageLoading" loading-text="审批中...">
|
||||
<<<<<<< HEAD
|
||||
|
||||
<el-row :gutter="10" class="mb8" v-if="viewStatus">
|
||||
=======
|
||||
<!-- <el-row :gutter="10" class="mb8" v-if="viewStatus">
|
||||
>>>>>>> v1.3
|
||||
<el-col :span="1.5">
|
||||
<el-button v-if="viewStatus != 'view'" plain type="primary" icon="Edit" @click="handelApply"
|
||||
>审批通过</el-button
|
||||
@@ -127,10 +122,7 @@
|
||||
style="width: 150px"
|
||||
:disabled="data.isEdit"
|
||||
>
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<!-- purchase_type -->
|
||||
>>>>>>> v1.3
|
||||
<el-option
|
||||
v-for="supplier in sourceTypeListOptions"
|
||||
:key="supplier.id"
|
||||
@@ -184,10 +176,7 @@
|
||||
style="width: 150px"
|
||||
:disabled="data.isEdit"
|
||||
>
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<!-- purchase_type -->
|
||||
>>>>>>> v1.3
|
||||
<el-option
|
||||
v-for="supplier in purposeTypeListOptions"
|
||||
:key="supplier.id"
|
||||
@@ -539,12 +528,7 @@ import { formatDate, formatDateymd } from '@/utils/index';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import { useStore } from '@/store/store';
|
||||
import useTagsViewStore from '@/store/modules/tagsView';
|
||||
<<<<<<< HEAD
|
||||
import TraceNoDialog from '@/components/OpenHis/TraceNoDialog/index.vue'
|
||||
import { nextTick } from 'vue';
|
||||
=======
|
||||
import TraceNoDialog from '@/components/OpenHis/TraceNoDialog/index.vue';
|
||||
>>>>>>> v1.3
|
||||
const tagsViewStore = useTagsViewStore();
|
||||
const store = useStore();
|
||||
const router = useRouter();
|
||||
@@ -600,16 +584,7 @@ const forms = reactive({
|
||||
});
|
||||
const receiptHeaderForm = reactive({
|
||||
busNo: undefined,
|
||||
<<<<<<< HEAD
|
||||
occurrence_time: formatDate(new Date()),
|
||||
sourceTypeEnum: 16, // 默认药房类型
|
||||
purposeTypeEnum: 16, // 默认药房类型
|
||||
sourceLocationId: '',
|
||||
purposeLocationId: '',
|
||||
medicationType: '',
|
||||
=======
|
||||
occurrenceTime: formatDate(new Date()),
|
||||
>>>>>>> v1.3
|
||||
});
|
||||
|
||||
const data = reactive({
|
||||
@@ -654,25 +629,9 @@ const data = reactive({
|
||||
});
|
||||
|
||||
const { queryParams, rules, tableRules } = toRefs(data);
|
||||
<<<<<<< HEAD
|
||||
const purposeTypeListOptions = ref([]);
|
||||
const sourceTypeListOptions = ref([]);
|
||||
// 立即初始化模拟仓库数据
|
||||
const mockWarehouses = [
|
||||
{ id: '1', name: '药房1号' },
|
||||
{ id: '2', name: '药房2号' },
|
||||
{ id: '3', name: '药房3号' },
|
||||
{ id: '4', name: '中心药房' },
|
||||
{ id: '5', name: '门诊药房' }
|
||||
];
|
||||
// 设置模拟数据到仓库列表选项
|
||||
// 通过onMounted中调用的handleChangeSourceTypeEnum和handleChangePurposeTypeEnum函数动态获取仓库数据
|
||||
const sourceLocationStoreIdListOptions = ref(undefined);
|
||||
=======
|
||||
const purposeTypeListOptions = ref(undefined);
|
||||
const sourceTypeListOptions = ref(undefined);
|
||||
const sourceLocationStoreIdListOptions = ref(undefined);
|
||||
>>>>>>> v1.3
|
||||
const purposeLocationStoreIdListOptions = ref(undefined);
|
||||
const categoryListOptions = ref(undefined);
|
||||
|
||||
@@ -712,143 +671,6 @@ watch(
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 挂载时绑定事件
|
||||
onMounted(() => {
|
||||
document.addEventListener("click", handleClickOutside);
|
||||
// 初始化仓库数据,默认加载药房类型(16)的仓库
|
||||
handleChangeSourceTypeEnum(receiptHeaderForm.sourceTypeEnum, 1);
|
||||
handleChangePurposeTypeEnum(receiptHeaderForm.purposeTypeEnum, 1);
|
||||
});
|
||||
|
||||
// 卸载时移除事件
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener("click", handleClickOutside);
|
||||
});
|
||||
|
||||
function addNewRow() {
|
||||
proxy.$refs["receiptHeaderRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (data.isAdding) {
|
||||
proxy.$message.warning("请先保存当前行后再新增!");
|
||||
return;
|
||||
}
|
||||
const newRow = {
|
||||
id: "",
|
||||
supplyBusNo:"",
|
||||
occurrence_time:"",
|
||||
typeEnum_enumText:"",
|
||||
statusEnum_enumText:"",
|
||||
sourceLocationId:"", // 源仓库
|
||||
purposeLocationId:"", //目的仓库
|
||||
sourceLocationName:"",
|
||||
purposeLocationName:"",
|
||||
approverId_dictText:"",
|
||||
applicantId_dictText:"",
|
||||
approvalTime:"",
|
||||
createTime:"",
|
||||
itemTable: "",
|
||||
itemQuantity: "",
|
||||
itemMaxQuantity:"",
|
||||
itemId: "",
|
||||
unitCode: "",
|
||||
remake: "",
|
||||
supplierId: "",
|
||||
purposeTypeEnum: "",
|
||||
purposeLocationId: null,
|
||||
purposeLocationStoreId: null,
|
||||
practitionerId: "",
|
||||
traceNo: "",
|
||||
invoiceNo: "",
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
price: "",
|
||||
totalPrice: "",
|
||||
objQuantity:"",
|
||||
orgQuantity:"",
|
||||
// sellPrice: "",
|
||||
// minSellPrice: "",
|
||||
// locationInventoryList: [{value:1,label:'药房'},{value:2,label:'仓库'}], // 库房列表
|
||||
unitList: {}, // 单位列表
|
||||
isEditing: true, // 标记当前行是否正在编辑
|
||||
error: false, // 新增 error 字段
|
||||
isSave: false, // 当前行是否保存
|
||||
};
|
||||
form.purchaseinventoryList.push(newRow);
|
||||
data.isAdding = true; // 设置标志位为 true,表示有未保存的
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handleBlur(row, index) {
|
||||
let hasError = false;
|
||||
for (let key in row) {
|
||||
if(!row[key]){
|
||||
if(key=='itemQuantity'||key=='totalSourceQuantity'||key=='totalPurposeQuantity'||key=='price'||key=='totalPrice'){
|
||||
row[key] = 0
|
||||
}else{
|
||||
row[key] = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
if(receiptHeaderForm.medicationType){
|
||||
if(!row.itemTable){
|
||||
if (receiptHeaderForm.medicationType == 1) {
|
||||
row.itemTable = "med_medication_definition";
|
||||
} else {
|
||||
console.log('Unknown warehouse type:', value);
|
||||
row.itemTable = "adm_device_definition";
|
||||
}
|
||||
}
|
||||
}
|
||||
row.sourceLocationId =receiptHeaderForm.sourceLocationId
|
||||
row.sourceLocationStoreId = receiptHeaderForm.sourceLocationStoreId;
|
||||
row.purposeLocationId = receiptHeaderForm.purposeLocationId
|
||||
row.purposeLocationStoreId = receiptHeaderForm.purposeLocationStoreId;
|
||||
row.busNo = receiptHeaderForm.busNo;
|
||||
row.applyTime = formatDate(row.applyTime)
|
||||
row.startTime = formatDateymd(row.startTime)
|
||||
row.endTime = formatDateymd(row.endTime)
|
||||
row.occurrence_time = receiptHeaderForm.occurrence_time;
|
||||
|
||||
let sourceTypeEnum = warehous_type.value.filter(e=>{return e.label==receiptHeaderForm.sourceTypeEnum})
|
||||
|
||||
row.sourceTypeEnum = (sourceTypeEnum&&sourceTypeEnum[0])?sourceTypeEnum[0].value:receiptHeaderForm.sourceTypeEnum
|
||||
let purposeTypeEnum = warehous_type.value.filter(e=>{return e.label==receiptHeaderForm.purposeTypeEnum})
|
||||
|
||||
row.purposeTypeEnum = (purposeTypeEnum&&purposeTypeEnum[0])?purposeTypeEnum[0].value:receiptHeaderForm.purposeTypeEnum
|
||||
|
||||
let sourceLocationId = sourceTypeListOptions.value.filter(e=>{return e.name==receiptHeaderForm.sourceLocationId})
|
||||
row.sourceLocationId = (sourceLocationId&&sourceLocationId[0])?sourceLocationId[0].id:receiptHeaderForm.sourceLocationId
|
||||
|
||||
let purposeLocationId = purposeTypeListOptions.value.filter(e=>{return e.name==receiptHeaderForm.purposeLocationId})
|
||||
row.purposeLocationId = (purposeLocationId&&purposeLocationId[0])?purposeLocationId[0].id:receiptHeaderForm.purposeLocationId
|
||||
|
||||
row.applicantId = userStore.id;
|
||||
}
|
||||
|
||||
// 取消行编辑
|
||||
function cancelEditRow(){
|
||||
const findIndexId = form.purchaseinventoryList.findIndex(e=>e.id==currentRow.value.id)
|
||||
form.purchaseinventoryList[findIndexId] = {}
|
||||
}
|
||||
// 点击行时记录当前行
|
||||
function handleRowClick(row) {
|
||||
// getMedicineList({ itemId: row.itemId,sourceLocationId:row.sourceLocationId,purposeLocationId:row.purposeLocationId }).then((res) => {
|
||||
// });
|
||||
currentRow.value = row;
|
||||
}
|
||||
|
||||
// 监听表格外的点击事件
|
||||
function handleClickOutside(event) {
|
||||
// if (tableRef.value && !tableRef.value.$el.contains(event.target)) {
|
||||
// if (currentRow.value) {
|
||||
// handleSave(currentRow.value);
|
||||
// currentRow.value = null; // 清空当前行
|
||||
// }
|
||||
// }
|
||||
}
|
||||
=======
|
||||
// 监听路由变化
|
||||
watch(
|
||||
() => route.query,
|
||||
@@ -877,7 +699,6 @@ watch(
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
>>>>>>> v1.3
|
||||
|
||||
function handelApply() {
|
||||
pageLoading.value = true;
|
||||
@@ -936,19 +757,6 @@ function handleSubmitApproval() {
|
||||
}
|
||||
|
||||
// 切换仓库类型获取药房/药库列表 目的仓库切换
|
||||
<<<<<<< HEAD
|
||||
function handleChangePurposeTypeEnum(value,type) {
|
||||
console.log('handleChangePurposeTypeEnum called with value:', value, 'type:', type);
|
||||
receiptHeaderForm.purposeLocationId = '';
|
||||
if(value === 16){ // 药房类型
|
||||
getPharmacyList().then(res => {
|
||||
console.log('getPharmacyList response:', res);
|
||||
if (res && res.data) {
|
||||
purposeTypeListOptions.value = res.data;
|
||||
if(!type && res.data.length > 0) {
|
||||
receiptHeaderForm.purposeLocationId = res.data[0].id;
|
||||
}
|
||||
=======
|
||||
function handleChangePurposeTypeEnum(value, type) {
|
||||
if (value == 16) {
|
||||
getPharmacyList().then((res) => {
|
||||
@@ -956,28 +764,16 @@ function handleChangePurposeTypeEnum(value, type) {
|
||||
if (!route.query.supplyBusNo && !type) {
|
||||
receiptHeaderForm.purposeLocationId = '';
|
||||
receiptHeaderForm.purposeLocationId1 = '';
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error fetching pharmacy list:', error);
|
||||
});
|
||||
<<<<<<< HEAD
|
||||
} else if(value === 17){ // 药库类型
|
||||
getDispensaryList().then(res => {
|
||||
console.log('getDispensaryList response:', res);
|
||||
if (res && res.data) {
|
||||
purposeTypeListOptions.value = res.data;
|
||||
if(!type && res.data.length > 0) {
|
||||
receiptHeaderForm.purposeLocationId = res.data[0].id;
|
||||
}
|
||||
=======
|
||||
} else if (value == 11) {
|
||||
getDispensaryList().then((res) => {
|
||||
purposeTypeListOptions.value = res.data;
|
||||
if (!route.query.supplyBusNo && !type) {
|
||||
receiptHeaderForm.purposeLocationId = '';
|
||||
receiptHeaderForm.purposeLocationId1 = '';
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error fetching dispensary list:', error);
|
||||
@@ -986,20 +782,6 @@ function handleChangePurposeTypeEnum(value, type) {
|
||||
purposeTypeListOptions.value = [];
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
// 源仓库切换
|
||||
function handleChangeSourceTypeEnum(value,type) {
|
||||
console.log('handleChangeSourceTypeEnum called with value:', value, 'type:', type);
|
||||
receiptHeaderForm.sourceLocationId = '';
|
||||
if(value === 16){ // 药房类型
|
||||
getPharmacyList().then(res => {
|
||||
console.log('getPharmacyList response:', res);
|
||||
if (res && res.data) {
|
||||
sourceTypeListOptions.value = res.data;
|
||||
if(!type && res.data.length > 0) {
|
||||
receiptHeaderForm.sourceLocationId = res.data[0].id;
|
||||
}
|
||||
=======
|
||||
// 源仓库切换
|
||||
function handleChangeSourceTypeEnum(value, type) {
|
||||
if (value == 16) {
|
||||
@@ -1008,28 +790,16 @@ function handleChangeSourceTypeEnum(value, type) {
|
||||
if (!route.query.supplyBusNo && !type) {
|
||||
receiptHeaderForm.sourceLocationId = '';
|
||||
receiptHeaderForm.sourceLocationId1 = '';
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error fetching pharmacy list:', error);
|
||||
});
|
||||
<<<<<<< HEAD
|
||||
} else if(value === 17){ // 药库类型
|
||||
getDispensaryList().then(res => {
|
||||
console.log('getDispensaryList response:', res);
|
||||
if (res && res.data) {
|
||||
sourceTypeListOptions.value = res.data;
|
||||
if(!type && res.data.length > 0) {
|
||||
receiptHeaderForm.sourceLocationId = res.data[0].id;
|
||||
}
|
||||
=======
|
||||
} else if (value == 11) {
|
||||
getDispensaryList().then((res) => {
|
||||
sourceTypeListOptions.value = res.data;
|
||||
if (!route.query.supplyBusNo && !type) {
|
||||
receiptHeaderForm.sourceLocationId = '';
|
||||
receiptHeaderForm.sourceLocationId1 = '';
|
||||
>>>>>>> v1.3
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error fetching dispensary list:', error);
|
||||
@@ -1440,52 +1210,6 @@ function getTransferProductTypeList() {
|
||||
categoryListOptions.value = response.data.categoryListOptions;
|
||||
});
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
function getBusNoInitList() {
|
||||
if(route.query.supplyBusNo||(forms.purchaseinventoryList&&forms.purchaseinventoryList[0]&&forms.purchaseinventoryList[0].id)){ // 编辑
|
||||
store.clearCurrentDataPLDB()
|
||||
store.clearCurrentDataPLDBAll()
|
||||
receiptHeaderForm.busNo = route.query.supplyBusNo?route.query.supplyBusNo:receiptHeaderForm.busNo
|
||||
viewStatus.value = route.query.view
|
||||
data.isEdit = true;
|
||||
queryParams.value.busNo = receiptHeaderForm.busNo
|
||||
getTransferProductDetail(queryParams.value).then((res) => {
|
||||
form.purchaseinventoryList = res.data.records?res.data.records:res.data
|
||||
receiptHeaderForm.occurrenceTime = res.data.records[0].occurrenceTime ? formatDate(res.data.records[0].occurrenceTime) : new Date()
|
||||
total.value = res.data.total
|
||||
getDetail(1)
|
||||
getAllBatchList(2)
|
||||
})
|
||||
sessionStorage.setItem('busNopl',"")
|
||||
}else{ //新增
|
||||
data.isEdit = false;
|
||||
if(!sessionStorage.getItem('busNopl')){
|
||||
store.clearCurrentDataPLDB()
|
||||
store.clearCurrentDataPLDBAll()
|
||||
getBusNoInit().then((response) => {
|
||||
receiptHeaderForm.busNo = response.data.busNo;
|
||||
sessionStorage.setItem('busNopl', receiptHeaderForm.busNo)
|
||||
})
|
||||
}else{
|
||||
receiptHeaderForm.busNo = sessionStorage.getItem('busNopl')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化函数
|
||||
function initComponent() {
|
||||
console.log('initComponent called');
|
||||
getTransferProductTypeList();
|
||||
getBusNoInitList();
|
||||
|
||||
console.log('组件初始化完成,仓库列表数据已预先设置');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 调用初始化函数
|
||||
initComponent();
|
||||
=======
|
||||
|
||||
getTransferProductTypeList();
|
||||
// 导出
|
||||
@@ -1503,7 +1227,6 @@ function handleExport() {
|
||||
`批量调拨单据明细记录_${proxy.formatDateStr(new Date(), 'YYYY-MM-DD')}.xlsx`
|
||||
);
|
||||
}
|
||||
>>>>>>> v1.3
|
||||
</script>
|
||||
<style scoped>
|
||||
.custom-tree-node {
|
||||
|
||||
Reference in New Issue
Block a user