Pārlūkot izejas kodu

Merge branch 'master' into 'master'

新增药品请领

See merge request lighter/vue-intergration-platform!166
huangshuhua 1 nedēļu atpakaļ
vecāks
revīzija
1384939a4c

+ 20 - 0
src/api/yp-inventory/yp_apply_info.js

@@ -0,0 +1,20 @@
+import request from '../../utils/request'
+
+
+// 查询药房药品请领信息
+export function selectYpApplyData(data) {
+    return request({
+        url: '/ypApply/selectYpApplyData',
+        method: 'post',
+        data
+    })
+}
+
+// 根据单号(drawNo)查询药品请领明细
+export function selectYpApplyDetail(drawNo) {
+    return request({
+        url: '/ypApply/selectYpApplyDetail',
+        method: 'get',
+        params: { drawNo },
+    })
+}

+ 3 - 4
src/views/yp-codg/YpInMatch.vue

@@ -185,7 +185,6 @@ const dateRange = ref([])
 const groupNo = ref('11')
 const groupNoYkData = ref([]);
 const supplyList = ref([]);
-const now = formatDatetime(new Date())
 const start = formatDatetime(shortcuts[0].value[0])
 const end = formatDatetime(shortcuts[0].value[0])
 const editableTabsValue = ref("inMatch")
@@ -214,7 +213,7 @@ const handleCurrentChangeLine = (val) => {
 const queryCodgData = () => {
   if (editableTabsValue.value === "inMatch") {
     queryYpInMatch();
-  } if(editableTabsValue.value === "codgLine"){
+  } else if(editableTabsValue.value === "codgLine"){
     queryYpCodgLine()
   }
 }
@@ -224,7 +223,7 @@ const handleClick = (tab, event) => {
   editableTabsValue.value = tab.props.name;
   if (editableTabsValue.value === "inMatch") {
     queryYpInMatch();
-  } if(editableTabsValue.value === "codgLine"){
+  } else if(editableTabsValue.value === "codgLine"){
     queryYpCodgLine()
   }
 }
@@ -243,7 +242,7 @@ const queryData = ref({
   detlNo: '', // 入库单号(院内)
   reptNo: '', // 传票号(供应批次流水号)
   supplyCode: '', // 供应商编码(院内)
-  groupNo: '', // 库编码(院内)
+  groupNo: '', // 库编码(院内)
   supplyId: '', // 供应商企业信用代码
   manuNo: '', // 生产批次号
   startTime: '',

+ 84 - 0
src/views/yp-inventory/YpApplyDetail.vue

@@ -0,0 +1,84 @@
+<template>
+  <div class="layout_container">
+    <header>
+      <el-select v-model="groupNoYk" placeholder="请选择药库" style="width: 140px; margin-left: 3px">
+        <el-option v-for="item in groupNoYkData" :key="item.value" :label="item.label" :value="item.value">
+        </el-option>
+      </el-select>
+      <el-input v-model.trim="yp" class="w-50 m-2" style="width: 280px" placeholder="请输入药品" clearable>
+      </el-input>
+    </header>
+    <div class="layout_main">
+      <div class="layout_display_flex_y">
+        <div class="layout_flex_1-y">
+          <el-table :data="ypApplyDetail.slice(pageSize * (currentPage - 1), pageSize * currentPage)" border
+                    stripe highlight-current-row height="100%">
+            <el-table-column prop="planSeri" label="序号" width="60" fixed/>
+            <el-table-column prop="chargeCode" label="药品编码" width="100" />
+            <el-table-column prop="chargeName" label="药品名称" width="270"/>
+            <el-table-column prop="manufactoryName" label="厂家" width="240" />
+            <el-table-column prop="specification" label="规格" width="180" />
+            <el-table-column prop="amount" label="请领数量" width="100" />
+            <el-table-column prop="pharmacyStockAmount" label="药房库存" width="100"/>
+            <el-table-column prop="stockAmount" label="药库库存" width="100"/>
+            <el-table-column prop="userTypeCode" label="3天用量" width="100"/>
+            <el-table-column prop="userTypeCode" label="预计可用天数" width="100"/>
+          </el-table>
+        </div>
+        <div>
+          <el-pagination :current-page="currentPage" :page-size="pageSize" :page-sizes="[10, 15, 20, 25]"
+                         :total="ypApplyDetail.length" layout="total, sizes, prev, pager, next, jumper"
+                         style="margin-top: 5px" @size-change="handleSizeChange"
+                         @current-change="handleCurrentChange">
+          </el-pagination>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script setup name="CrbBaseInfo">
+import {nextTick, onMounted, ref, watch} from "vue"
+import {selectGroupNoInfo} from "@/api/yp-dict/yp-comm-dict.js";
+
+const groupNoYk = ref("11")
+const groupNoYkData = ref([])
+const yp = ref("")
+const ypApplyDetail = ref([])
+
+const pageSize = ref(20)
+const currentPage = ref(1)
+const handleSizeChange = (val) => {
+  pageSize.value = val
+}
+const handleCurrentChange = (val) => {
+  currentPage.value = val
+}
+
+const props = defineProps({
+  ypApplyMx: {
+    type: Object,
+    default: {}
+  }
+})
+
+const queryGroupNoInfo = () => {
+  selectGroupNoInfo()
+      .then(res => {
+        groupNoYkData.value = res.ykList
+      })
+      .catch(() => {
+        groupNoYkData.value = []
+      });
+};
+
+onMounted( () => {
+  nextTick(() => {
+    queryGroupNoInfo()
+    console.log(props.ypApplyMx)
+    ypApplyDetail.value = props.ypApplyMx
+  })
+})
+watch(() => props.ypApplyMx, () => {
+  ypApplyDetail.value = props.ypApplyMx
+})
+</script>

+ 203 - 0
src/views/yp-inventory/YpApplyInfo.vue

@@ -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>