|
@@ -0,0 +1,180 @@
|
|
|
+<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="warehousingSterileCode" 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>
|
|
|
+ </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>
|
|
|
+</template>
|
|
|
+<script setup name="warehousing">
|
|
|
+import { ref, onMounted, nextTick } from 'vue'
|
|
|
+import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
+import { insertWarehousingSterile, getWarehousingSterileList } from '@/api/lc/sterile.js';
|
|
|
+import searchArea from '@/components/searchArea/index.vue';
|
|
|
+import info from '@/views/sterile/warehousing/info.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)
|
|
|
+
|
|
|
+const init = (params) => {
|
|
|
+ params = {
|
|
|
+ ...params,
|
|
|
+ ...searchForm.value,
|
|
|
+ pageSize: pageSize.value,
|
|
|
+ pageNumber: pageNumber.value
|
|
|
+ }
|
|
|
+ getWarehousingSterileList(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 handleDialogClose = () => {
|
|
|
+ currentEditId.value = ""
|
|
|
+ showDialog.value = false
|
|
|
+}
|
|
|
+
|
|
|
+const approval = (row) => {
|
|
|
+ ElMessageBox.confirm("是否确认审核通过", {
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ dangerouslyUseHTMLString: true
|
|
|
+ }).then(() => {
|
|
|
+ let params = { id: row.id, status: '1' }
|
|
|
+ insertWarehousingSterile(params).then(res => {
|
|
|
+ ElMessage.success('审核成功')
|
|
|
+ init()
|
|
|
+ }).catch(err => {
|
|
|
+ // ElMessage.error(err.message)
|
|
|
+ })
|
|
|
+ }).catch((action) => {
|
|
|
+ if (action === 'cancel') {
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+</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>
|