|
@@ -0,0 +1,203 @@
|
|
|
+<template>
|
|
|
+ <div class="layout_container">
|
|
|
+ <header>
|
|
|
+ <el-input v-model.trim="inDocuNo" class="w-50 m-2" style="width: 280px" placeholder="请输入单号" clearable>
|
|
|
+ <template #prepend>单号</template>
|
|
|
+ </el-input>
|
|
|
+ <el-select v-model="groupNoYf" placeholder="请选择药房" style="width: 140px; margin-left: 3px" @change="queryItem">
|
|
|
+ <el-option v-for="item in groupNoYfData" :key="item.value" :label="item.label" :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select v-model="groupNoYk" placeholder="请选择药库" style="width: 140px; margin-left: 3px" @change="queryItem">
|
|
|
+ <el-option v-for="item in groupNoYkData" :key="item.value" :label="item.label" :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select v-model="retFlag" placeholder="请选择审核状态" style="width: 140px; margin-left: 3px" @change="queryItem">
|
|
|
+ <el-option v-for="item in retOptions" :key="item.value" :label="item.label" :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期" :clearable="false"
|
|
|
+ end-placeholder="结束日期" :shortcuts="shortcuts" style="width: 300px; margin-left: 3px">
|
|
|
+ </el-date-picker>
|
|
|
+ <el-divider direction="vertical" />
|
|
|
+ <el-button type="primary" icon="Search" @click="queryBaseInfo" style="margin-left: 5px">查询</el-button>
|
|
|
+ </header>
|
|
|
+ <div class="layout_main">
|
|
|
+ <el-tabs class="el-tabs__fill" v-model="editableTabsValue" type="border-card" @tab-click="handleClick">
|
|
|
+ <el-tab-pane key="ypApply" label="药品请领" name="ypApply">
|
|
|
+ <div class="layout_display_flex_y">
|
|
|
+ <div class="layout_flex_1-y">
|
|
|
+ <el-table :data="ypApplyData.slice(pageSize * (currentPage - 1), pageSize * currentPage)" border
|
|
|
+ stripe highlight-current-row height="100%">
|
|
|
+ <el-table-column type="index" label="序号" width="50" fixed/>
|
|
|
+ <el-table-column prop="drawNo" label="单号" width="160" />
|
|
|
+ <el-table-column prop="planDate" label="请领日期" width="240"/>
|
|
|
+ <el-table-column prop="drawerName" label="请领人" width="160" />
|
|
|
+ <el-table-column prop="statusFlag" label="状态" width="120">
|
|
|
+ <template #default="scope">
|
|
|
+ <span class="status" v-if="scope.row.statusFlag === '1' ">已确认</span>
|
|
|
+ <span v-else>未确认</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="groupNamePharmacy" label="药房名称" width="160" />
|
|
|
+ <el-table-column prop="groupName" label="药库名称" width="160"/>
|
|
|
+ <el-table-column fixed="right" label="操作" min-width="120" width="120" center>
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="primary" size="small" @click="queryYpApplyDetail(scope.row)">查看请领单明细</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-pagination :current-page="currentPage" :page-size="pageSize" :page-sizes="[10, 15, 20, 25]"
|
|
|
+ :total="ypApplyData.length" layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ style="margin-top: 5px" @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-dialog v-model="showYpApplyMx" :close-on-click-modal="false" :close-on-press-escape="false" :title="ypApplyTitle"
|
|
|
+ class="yp-edit-dialog" top="4vh" width="80%" height="80%" destroy-on-close>
|
|
|
+ <YpApplyDetail :ypApplyMx="ypApplyDetail" />
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+<script setup name="YpApplyInfo">
|
|
|
+import {nextTick, onMounted, ref} from "vue";
|
|
|
+import {shortcuts} from "@/data/shortcuts.js";
|
|
|
+import {formatDate, getDateRangeFormatDate} from "@/utils/date.js";
|
|
|
+import {selectGroupNoInfo} from "@/api/yp-dict/yp-comm-dict.js";
|
|
|
+import {ElMessage} from "element-plus";
|
|
|
+import {selectYpApplyData, selectYpApplyDetail} from "@/api/yp-inventory/yp_apply_info.js";
|
|
|
+import YpApplyDetail from "@/views/yp-inventory/YpApplyDetail.vue";
|
|
|
+
|
|
|
+const inDocuNo = ref('')
|
|
|
+const retFlag = ref('2')
|
|
|
+const start = formatDate(shortcuts[0].value[0]);
|
|
|
+const end = formatDate(shortcuts[0].value[0]);
|
|
|
+const dateRange = ref([]);
|
|
|
+const editableTabsValue = ref("ypApply")
|
|
|
+const ypApplyData = ref([])
|
|
|
+const groupNoYf = ref('71')
|
|
|
+const groupNoYfData = ref([])
|
|
|
+const groupNoYk = ref("11")
|
|
|
+const groupNoYkData = ref([])
|
|
|
+
|
|
|
+const pageSize = ref(20)
|
|
|
+const currentPage = ref(1)
|
|
|
+const handleSizeChange = (val) => {
|
|
|
+ pageSize.value = val
|
|
|
+}
|
|
|
+const handleCurrentChange = (val) => {
|
|
|
+ currentPage.value = val
|
|
|
+}
|
|
|
+
|
|
|
+const queryData = ref({
|
|
|
+ startTime: "",
|
|
|
+ endTime: "",
|
|
|
+ drawNo: "",
|
|
|
+ groupNo: "",
|
|
|
+ groupYk: "",
|
|
|
+ statusFlag: "",
|
|
|
+});
|
|
|
+
|
|
|
+const retOptions = [
|
|
|
+ { value: "1", label: "未确认" },
|
|
|
+ { value: "2", label: "已确认" },
|
|
|
+];
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ nextTick(() => {
|
|
|
+ queryData.value.startTime = start;
|
|
|
+ queryData.value.endTime = end + " 23:59:59";
|
|
|
+ dateRange.value = [start, end];
|
|
|
+ queryGroupNoInfo()
|
|
|
+ queryYpApplyData()
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
+const queryGroupNoInfo = () => {
|
|
|
+ selectGroupNoInfo()
|
|
|
+ .then(res => {
|
|
|
+ groupNoYfData.value = res.yfList
|
|
|
+ groupNoYkData.value = res.ykList
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ groupNoYfData.value = []
|
|
|
+ groupNoYkData.value = []
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const handleClick = (tab, event) => {
|
|
|
+ // 查询哪个tab页面
|
|
|
+ editableTabsValue.value = tab.props.name;
|
|
|
+ if (editableTabsValue.value === "ypApply") {
|
|
|
+ queryYpApplyData()
|
|
|
+ } if(editableTabsValue.value === "baseDept"){
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const queryBaseInfo = () => {
|
|
|
+ if (editableTabsValue.value === "ypApply") {
|
|
|
+ queryYpApplyData()
|
|
|
+ } if(editableTabsValue.value === "baseDept"){
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const queryYpApplyData = () => {
|
|
|
+ if (dateRange.value) {
|
|
|
+ let dateS = getDateRangeFormatDate(dateRange.value);
|
|
|
+ queryData.value.startTime = dateS.startTime;
|
|
|
+ queryData.value.endTime = dateS.endTime;
|
|
|
+ } else {
|
|
|
+ queryData.value.startTime = start;
|
|
|
+ queryData.value.endTime = end;
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "默认查询本月的数据",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ queryData.value.drawNo = inDocuNo.value
|
|
|
+ queryData.value.groupNo = groupNoYf.value
|
|
|
+ queryData.value.groupYk = groupNoYk.value
|
|
|
+ queryData.value.statusFlag = retFlag.value
|
|
|
+ selectYpApplyData(queryData.value)
|
|
|
+ .then(res => {
|
|
|
+ console.log(res)
|
|
|
+ ypApplyData.value = res
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ ypApplyData.value = []
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 动态查询
|
|
|
+const queryItem = () => {
|
|
|
+ if (editableTabsValue.value === "ypApply") {
|
|
|
+ queryYpApplyData()
|
|
|
+ } else if (editableTabsValue.value === "ypPurchase") {
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 查询明细
|
|
|
+const showYpApplyMx = ref(false)
|
|
|
+const ypApplyTitle = ref('')
|
|
|
+const ypApplyDetail = ref([])
|
|
|
+const queryYpApplyDetail = (row) => {
|
|
|
+ console.log(row)
|
|
|
+ selectYpApplyDetail(row.drawNo).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ ypApplyTitle.value = '药品请领【查询】'
|
|
|
+ ypApplyDetail.value = res
|
|
|
+ showYpApplyMx.value = true
|
|
|
+ })
|
|
|
+}
|
|
|
+</script>
|