yeguodong 2 месяцев назад
Родитель
Сommit
65223ca8f7

+ 24 - 0
src/api/lc/sterile.js

@@ -30,4 +30,28 @@ export function getWarehousingSterileList(data) {
         method: 'post',
         data,
     })
+}
+
+export function insertSterilization(data) {
+    return request({
+        url: '/Sterilization/insertSterilization',
+        method: 'post',
+        data,
+    })
+}
+
+export function getSterilizationList(data) {
+    return request({
+        url: '/Sterilization/getSterilizationList',
+        method: 'post',
+        data,
+    })
+}
+
+export function getSterilizationById(id) {
+    return request({
+        url: '/Sterilization/getSterilizationById',
+        method: 'get',
+        params: { id },
+    })
 }

+ 1 - 1
src/utils/request.js

@@ -9,7 +9,7 @@ import { stringify } from "qs";
 import env from "@/utils/setting";
 
 const service = axios.create({
-  baseURL: "http://130.150.161.57:8706",
+  baseURL: env.VITE_BASE_URL,
   withCredentials: true,
   timeout: 0,
   showLoading: true,

+ 230 - 0
src/views/sterile/sterilization/detail.vue

@@ -0,0 +1,230 @@
+<template>
+    <div class="container">
+        <el-descriptions title="用户信息">
+            <el-descriptions-item label="用户名">kooriookami</el-descriptions-item>
+            <el-descriptions-item label="手机号">18100000000</el-descriptions-item>
+            <el-descriptions-item label="居住地">苏州市</el-descriptions-item>
+            <el-descriptions-item label="备注">
+                <el-tag size="small">学校</el-tag>
+            </el-descriptions-item>
+            <el-descriptions-item label="联系地址">江苏省苏州市吴中区吴中大道 1188 号</el-descriptions-item>
+        </el-descriptions>
+
+        <el-table :data="tableData" style="width: 100%" height="500" size="default">
+            <el-table-column prop="sterileCode" label="项目编号" width="80" />
+            <el-table-column prop="sterileName" label="项目名称" />
+            <el-table-column prop="projectSpecifications" label="规格" />
+            <el-table-column prop="potName" label="锅次" />
+            <el-table-column prop="sterileCount" label="数量" />
+            <el-table-column prop="cleanCode" label="清洗条码" />
+            <el-table-column prop="leaveUse" label="剩余使用次数" />
+            <el-table-column prop="maxUse" label="最大使用次数" />
+            <el-table-column fixed="right" label="操作" width="150">
+                <template #default="scope">
+                    <el-button type="danger" size="small" @click="deleteAlias(scope.$index)">
+                        删 除
+                    </el-button>
+                    <!-- <el-button link type="primary" size="small">Edit</el-button> -->
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="confirm-area flex-center-row" style="margin: 20px ;">
+            <el-button type="primary" @click="confirm" size="default">确定</el-button>
+            <el-button @click="cancel" size="default">取消</el-button>
+        </div>
+    </div>
+
+</template>
+<script setup name="WarehousingInfo">
+import { nextTick, onMounted, ref } from 'vue'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { getLcProjectById,getAllLcProjectTypes } from '@/api/lc/project.js';
+import { getSterileList,insertSterilization, getSterilizationById } from "@/api/lc/sterile.js";
+
+const props = defineProps({
+    //子组件接收父组件传递过来的值
+    currentEditId: String,
+})
+//使用父组件传递过来的值
+const { currentEditId } = toRefs(props)
+//父组件的方法
+const emit = defineEmits(["handleDialogClose", "init"])
+onMounted(() => {
+    nextTick(() => {
+        getDisinfectProjects();
+        getProjectTypes()
+        if (currentEditId.value) {
+            init()
+        }
+    })
+});
+
+const selectBatchNum = ref();
+
+const batchNums = ref([]);
+
+const selectUser = ref();
+
+const users = ref([]);
+
+const sterilizationTypes = ref([
+    {
+        id: '0',
+        name: '高压灭菌'
+    },
+    {
+        id: '1',
+        name: '等离子灭菌'
+    },
+    {
+        id: '2',
+        name: '环氧乙烷灭菌'
+    }
+]);
+
+
+const potNos = ref([
+    {
+        id: '1',
+        name: '1号锅'
+    },
+    {
+        id: '2',
+        name: '2号锅'
+    },
+    {
+        id: '3',
+        name: '3号锅'
+    }
+]);
+
+const getPotName = id => {
+    const pot = potNos.value.find(item => item.id === id);
+    return pot ? pot.name : '';
+}
+
+const getSterilizationTypeName = id => {
+    const sterilizationType = sterilizationTypes.value.find(item => item.id === id);
+    return sterilizationType ? sterilizationType.name : '';
+}
+
+const potIndex = ref();
+const cleanCode = ref();
+const sterileCount = ref();
+
+const form = ref({});
+
+const selectDisinfectProject = ref();
+
+const disinfectProjects = ref([]);
+
+let tableData = ref([]);
+
+const getDisinfectProjects = () => {
+    let params = {
+        projectType: "2"
+    }
+    getSterileList(params).then(res => {
+        disinfectProjects.value = res;
+    }).catch(err => {
+
+    })
+};
+
+
+
+const projectTypeOption = ref([])
+
+const init = () => {
+    getSterilizationById(currentEditId.value).then(res => {
+        const rawData = res.sterilizationDetailList;
+
+        tableData.value = rawData.map(item => ({
+            ...item,
+            potName: getPotName(item.potNo),
+            sterilizationTypeName: getSterilizationTypeName(item.sterilizationType)
+        }));
+    }).catch(err => {
+
+    })
+}
+
+const confirm = () => {
+    let params = { ...form.value };
+    params.sterilizationDetailList = tableData.value;
+    insertSterilization(params).then(res => {
+        ElMessage.success(currentEditId.value ? '修改成功' : '新增成功');
+        emit("handleDialogClose");
+        emit("init");
+    }).catch(err => {
+        // ElMessage.error(err.message)
+    });
+}
+
+const cancel = () => {
+    emit("handleDialogClose")
+}
+
+
+
+const getProjectTypes = () => {
+    getAllLcProjectTypes().then(res => {
+        projectTypeOption.value = res
+    }).catch(err => {
+
+    })
+}
+
+const deleteAlias = (index) => {
+    ElMessageBox.confirm("是否删除", {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        tableData.value.splice(index, 1)
+    }).catch((action) => {
+    })
+}
+
+
+
+</script>
+
+<style lang="scss">
+.container {
+    height: 98%;
+    width: 100%;
+
+    .top-area {
+        height: 8%;
+        border-bottom: 1px solid #727070;
+        font-size: 1.2rem;
+    }
+
+    .title-area {
+        font-size: 1.2rem;
+        font-weight: bold;
+    }
+}
+
+
+
+.el-input__icon {
+    cursor: pointer;
+}
+
+.flex-center-row {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+
+.flex-center-column {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+}
+</style>

+ 200 - 0
src/views/sterile/sterilization/index.vue

@@ -0,0 +1,200 @@
+<template>
+    <div class="layout_display_flex_y">
+        <div class="obviousBox" style="margin-bottom: 6px;">
+            <searchArea :searchData="searchData" @submit="searchByForm"></searchArea>
+        </div>
+
+        <div class="layout_display_flex_y" style="height: 85%">
+            <div style="background-color: #fff;padding: 8px">
+                <el-button type="primary" icon="Plus" @click="onAddItem" style="margin-left: 5px">新增</el-button>
+            </div>
+            <el-table :data="tableData" border style="width: 100%" height="100%" stripe highlight-current-row
+                class="ypClassTable normal-size">
+                <el-table-column prop="sterilizationCode" label="入库单号">
+                </el-table-column>
+                <el-table-column prop="createTime" label="制单时间">
+                </el-table-column>
+                <el-table-column prop="userName" label="制单人员">
+                </el-table-column>
+                <el-table-column prop="approvalName" label="审核人">
+                </el-table-column>
+                <el-table-column prop="status" label="状态">
+                    <template v-slot="scope">
+                        <span>{{ scope.row.status == '-1' ? '草稿' : (scope.row.status == '0' ? "未审核" : "已审核") }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column fixed="right" label="操作" min-width="180" width="180" align="center">
+                    <template #default="scope">
+                        <el-button type="primary" size="small" @click="onEditItem(scope.row)">编辑</el-button>
+                        <el-button :type="'success'" size="small"
+                            @click.prevent="approval(scope.row)">
+                            审核通过
+                        </el-button>
+                        <el-button type="primary" size="small" @click="onDetailItem(scope.row)">查看</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+        <div>
+            <el-pagination :current-page="pageNumber" :page-size="pageSize" :page-sizes="[10, 15, 20, 25]"
+                :total="total" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
+                @size-change="handleSizeChange" @current-change="handleCurrentChange">
+            </el-pagination>
+        </div>
+    </div>
+    <el-dialog v-model="showDialog" :close-on-click-modal="false" :close-on-press-escape="false"
+        :title="(currentEditId ? '编辑' : '新增') + '项目'" width="100%" destroy-on-close fullscreen
+        @close="handleDialogClose">
+        <!-- <YpPrintName :ypPrintNameDetail="ypPrintNameDetail" @closeYpPrintNameEditFor="closeYpPrintName" /> -->
+        <info :currentEditId="currentEditId" @handleDialogClose="handleDialogClose" @init="init"></info>
+    </el-dialog>
+
+    <el-dialog v-model="showDetailDialog" :close-on-click-modal="false" :close-on-press-escape="false"
+               title="查看" width="100%" destroy-on-close fullscreen
+               @close="handleDialogClose">
+        <detail :currentEditId="currentEditId" @handleDialogClose="handleDialogClose" @init="init"></detail>
+    </el-dialog>
+</template>
+<script setup name="warehousing">
+import { ref, onMounted, nextTick } from 'vue'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { insertSterilization, getSterilizationList } from '@/api/lc/sterile.js';
+import searchArea from '@/components/searchArea/index.vue';
+import info from '@/views/sterile/sterilization/info.vue';
+import detail from '@/views/sterile/sterilization/detail.vue';
+
+const searchData = ref([
+    {
+        label: '入库单号',
+        key: 'warehousingSterileCode',
+        type: 'input',
+        value: '',
+    }
+])
+const pageSize = ref(10)
+const pageNumber = ref(1)
+const total = ref(0)
+const currentEditId = ref('')
+
+const tableData = ref([])
+const handleSizeChange = (val) => {
+    pageSize.value = val
+    init()
+}
+const handleCurrentChange = (val) => {
+    pageNumber.value = val
+    init()
+}
+
+let showDialog = ref(false);
+let showDetailDialog = ref(false);
+
+const init = (params) => {
+    params = {
+        ...params,
+        ...searchForm.value,
+        pageSize: pageSize.value,
+        pageNumber: pageNumber.value
+    }
+    getSterilizationList(params).then((res) => {
+        total.value = res.total
+        tableData.value = res.records
+    }).catch((err) => {
+        ElMessage.error(err)
+    })
+}
+
+onMounted(() => {
+    nextTick(() => {
+        init()
+    })
+})
+
+const searchForm = ref({})
+//搜索表单方法
+const searchByForm = (form) => {
+    console.log("search", form)
+    searchForm.value = form
+    init()
+}
+
+const onEditItem = (row) => {
+    currentEditId.value = row.id
+    showDialog.value = true
+}
+
+const onDetailItem = (row) => {
+    currentEditId.value = row.id
+    showDetailDialog.value = true
+}
+
+const handleDialogClose = () => {
+    currentEditId.value = ""
+    showDialog.value = false;
+    showDetailDialog.value = false;
+
+}
+
+const approval = (row) => {
+    ElMessageBox.confirm("是否确认审核通过", {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        let params = { id: row.id, status: '1' }
+        insertSterilization(params).then(res => {
+            ElMessage.success('审核成功')
+            init()
+        }).catch(err => {
+            // ElMessage.error(err.message)
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+        }
+    })
+}
+
+const onAddItem = () => {
+    showDialog.value = true
+}
+
+</script>
+<style lang="scss" deep>
+.el-dialog__body {
+    // padding: 0 16px;
+    // height: calc(100% - 25px);
+}
+
+.el-tabs {
+    height: calc(100% - 27px);
+
+    .el-tabs__content {
+        padding: 5px;
+        height: calc(100% - 27px);
+    }
+
+    .el-tab-pane {
+        height: calc(100% - 27px);
+        overflow: auto;
+    }
+
+    .el-table__inner-wrapper {
+        height: calc(100% - 10px) !important;
+    }
+
+}
+
+.el-table .warning-row {
+    --el-table-tr-bg-color: #dd7694;
+}
+
+.search-select-pre {
+    padding: 0 12px;
+    color: var(--el-text-color-regular);
+    background: var(--el-fill-color-light);
+    border-right: 1px solid var(--el-border-color);
+    --el-select-input-padding-left: '0'
+}
+</style>

+ 348 - 0
src/views/sterile/sterilization/info.vue

@@ -0,0 +1,348 @@
+<template>
+    <div class="container">
+        <el-form label-width="127px" size="default">
+            <el-row :gutter="20">
+                <el-col :span="5">
+                    <el-form-item label="项目名称" prop="remark">
+                        <el-select
+                            v-model="selectDisinfectProject"
+                            clearable
+                            collapse-tags
+                            filterable
+                            placeholder="选择项目"
+                            popper-class="custom-header"
+                            :max-collapse-tags="1"
+                            style="width: 240px"
+                        >
+                            <el-option
+                                v-for="item in disinfectProjects"
+                                :key="item.id"
+                                :label="item.sterileName"
+                                :value="item.id"
+                            />
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="5">
+                    <el-form-item label="批号" prop="remark">
+                        <el-select
+                            v-model="selectBatchNum"
+                            clearable
+                            collapse-tags
+                            filterable
+                            placeholder="选择批次"
+                            popper-class="custom-header"
+                            :max-collapse-tags="1"
+                            style="width: 240px"
+                        >
+                            <el-option
+                                v-for="item in batchNums"
+                                :key="item.id"
+                                :label="item.batchNum"
+                                :value="item.id"
+                            />
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="5">
+                    <el-form-item label="灭菌人员" prop="remark">
+                        <el-select
+                            v-model="selectUser"
+                            clearable
+                            collapse-tags
+                            filterable
+                            placeholder="选择人员"
+                            popper-class="custom-header"
+                            :max-collapse-tags="1"
+                            style="width: 240px"
+                        >
+                            <el-option
+                                v-for="item in users"
+                                :key="item.id"
+                                :label="item.name"
+                                :value="item.id"
+                            />
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="5">
+                    <el-form-item label="灭菌方法" prop="remark">
+                        <el-select
+                            v-model="selectSterilizationType"
+                            clearable
+                            popper-class="custom-header"
+                            :max-collapse-tags="1"
+                            style="width: 240px"
+                        >
+                            <el-option
+                                v-for="item in sterilizationTypes"
+                                :key="item.id"
+                                :label="item.name"
+                                :value="item.id"
+                            />
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="5">
+                    <el-form-item label="锅号" prop="remark">
+                        <el-select
+                            v-model="selectPotNo"
+                            clearable
+                            popper-class="custom-header"
+                            :max-collapse-tags="1"
+                            style="width: 240px"
+                        >
+                            <el-option
+                                v-for="item in potNos"
+                                :key="item.id"
+                                :label="item.name"
+                                :value="item.id"
+                            />
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="5">
+                    <el-form-item label="锅次" prop="potIndex">
+                        <el-input v-model="potIndex">
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="5">
+                    <el-form-item label="清洗条码" prop="cleanCode">
+                        <el-input v-model="cleanCode">
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="5">
+                    <el-form-item label="数量" prop="sterileCount">
+                        <el-input v-model="sterileCount">
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="2">
+                    <el-button type="primary" @click="add">新增</el-button>
+                </el-col>
+            </el-row>
+
+        </el-form>
+
+        <el-table :data="tableData" style="width: 100%" height="500" size="default">
+            <el-table-column prop="sterileCode" label="项目编号" width="80" />
+            <el-table-column prop="sterileName" label="项目名称" />
+            <el-table-column prop="projectSpecifications" label="规格" />
+            <el-table-column prop="selectPotNo" label="锅次" />
+            <el-table-column prop="sterileCount" label="数量" />
+            <el-table-column prop="cleanCode" label="清洗条码" />
+            <el-table-column prop="leaveUse" label="剩余使用次数" />
+            <el-table-column prop="maxUse" label="最大使用次数" />
+            <el-table-column fixed="right" label="操作" width="150">
+                <template #default="scope">
+                    <el-button type="danger" size="small" @click="deleteAlias(scope.$index)">
+                        删 除
+                    </el-button>
+                    <!-- <el-button link type="primary" size="small">Edit</el-button> -->
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="confirm-area flex-center-row" style="margin: 20px ;">
+            <el-button type="primary" @click="confirm" size="default">确定</el-button>
+            <el-button @click="cancel" size="default">取消</el-button>
+        </div>
+    </div>
+
+</template>
+<script setup name="WarehousingInfo">
+import { nextTick, onMounted, ref } from 'vue'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { getLcProjectById,getAllLcProjectTypes } from '@/api/lc/project.js';
+import { getSterileList,insertSterilization } from "@/api/lc/sterile.js";
+
+const props = defineProps({
+    //子组件接收父组件传递过来的值
+    currentEditId: String,
+})
+//使用父组件传递过来的值
+const { currentEditId } = toRefs(props)
+//父组件的方法
+const emit = defineEmits(["handleDialogClose", "init"])
+onMounted(() => {
+    nextTick(() => {
+        getDisinfectProjects();
+        getProjectTypes()
+        if (currentEditId.value) {
+            init()
+        }
+    })
+});
+
+const selectBatchNum = ref();
+
+const batchNums = ref([]);
+
+const selectUser = ref();
+
+const users = ref([]);
+
+const selectSterilizationType = ref();
+
+const sterilizationTypes = ref([
+    {
+        id: '0',
+        name: '高压灭菌'
+    },
+    {
+        id: '1',
+        name: '等离子灭菌'
+    },
+    {
+        id: '2',
+        name: '环氧乙烷灭菌'
+    }
+]);
+
+const selectPotNo = ref();
+
+const potNos = ref([
+    {
+        id: '1',
+        name: '1号锅'
+    },
+    {
+        id: '2',
+        name: '2号锅'
+    },
+    {
+        id: '3',
+        name: '3号锅'
+    }
+]);
+
+const potIndex = ref();
+const cleanCode = ref();
+const sterileCount = ref();
+
+const form = ref({});
+
+const selectDisinfectProject = ref();
+
+const disinfectProjects = ref([]);
+
+let tableData = ref([]);
+const add = () => {
+    for(let j = 0;j<disinfectProjects.value.length;j++) {
+        if(selectDisinfectProject.value == disinfectProjects.value[j].id) {
+            disinfectProjects.value[j].sterileCount = sterileCount.value;
+            disinfectProjects.value[j].sterilizationUserCode = selectUser.value;
+            disinfectProjects.value[j].sterilizationType = selectSterilizationType.value;
+            disinfectProjects.value[j].potNo = selectPotNo.value;
+            disinfectProjects.value[j].potIndex = potIndex.value;
+            disinfectProjects.value[j].cleanCode = cleanCode.value;
+            tableData.value.push(disinfectProjects.value[j]);
+        }
+    }
+
+};
+
+const getDisinfectProjects = () => {
+    let params = {
+        projectType: "2"
+    }
+    getSterileList(params).then(res => {
+        disinfectProjects.value = res;
+    }).catch(err => {
+
+    })
+};
+
+
+
+const projectTypeOption = ref([])
+
+const init = () => {
+    getLcProjectById(currentEditId.value).then(res => {
+        form.value = res.data
+        tableData.value = res.data.lcProjectAliasList
+    }).catch(err => {
+
+    })
+}
+
+const confirm = () => {
+    let params = { ...form.value };
+    params.sterilizationDetailList = tableData.value;
+    insertSterilization(params).then(res => {
+        ElMessage.success(currentEditId.value ? '修改成功' : '新增成功');
+        emit("handleDialogClose");
+        emit("init");
+    }).catch(err => {
+        // ElMessage.error(err.message)
+    });
+}
+
+const cancel = () => {
+    emit("handleDialogClose")
+}
+
+
+
+const getProjectTypes = () => {
+    getAllLcProjectTypes().then(res => {
+        projectTypeOption.value = res
+    }).catch(err => {
+
+    })
+}
+
+const deleteAlias = (index) => {
+    ElMessageBox.confirm("是否删除", {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        tableData.value.splice(index, 1)
+    }).catch((action) => {
+    })
+}
+
+
+
+</script>
+
+<style lang="scss">
+.container {
+    height: 98%;
+    width: 100%;
+
+    .top-area {
+        height: 8%;
+        border-bottom: 1px solid #727070;
+        font-size: 1.2rem;
+    }
+
+    .title-area {
+        font-size: 1.2rem;
+        font-weight: bold;
+    }
+}
+
+
+
+.el-input__icon {
+    cursor: pointer;
+}
+
+.flex-center-row {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+
+.flex-center-column {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+}
+</style>

+ 4 - 0
src/views/sterile/warehousing/index.vue

@@ -140,6 +140,10 @@ const approval = (row) => {
     })
 }
 
+const onAddItem = () => {
+    showDialog.value = true
+}
+
 </script>
 <style lang="scss" deep>
 .el-dialog__body {