Commit 64b1e41d by zhangtw

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	ruoyi-admin-vue/src/api/inventory/inventory.js
#	ruoyi-admin-vue/src/views/inventory/materials/index.vue
parents a014954c 9c092a1d
......@@ -26,15 +26,6 @@ export function addInventory(data) {
})
}
// 批量新增库存
export function batchAddInventory(data){
return request({
url: '/inventory/inventory/batchAdd',
method: 'post',
data: data
})
}
// 修改库存
export function updateInventory(data) {
return request({
......@@ -51,3 +42,20 @@ export function delInventory(id) {
method: 'delete'
})
}
// 批量删除库存
export function delInventoryByIds(ids) {
return request({
url: '/inventory/inventory/' + ids,
method: 'delete'
})
}
// 根据物料ID查询库存
export function listInventoryByMaterialId(materialId) {
return request({
url: '/inventory/inventory/listByMaterialId',
method: 'get',
params: { materialId: materialId }
})
}
......@@ -89,4 +89,21 @@
> .el-submenu__title
.el-submenu__icon-arrow {
display: none;
}
/* 全局修复,确保所有 el-select 在表单中宽度为 100% */
.page-wrapper-search .el-select {
width: 100%;
}
.page-wrapper-search .el-form-item__content .el-select {
width: 100%;
}
.page-wrapper-search .el-form-item__content .el-date-editor {
width: 100%;
}
.page-wrapper-search .el-form-item {
display: flex;
}
.page-wrapper-search .el-form-item__content {
flex: 1;
}
\ No newline at end of file
......@@ -4,7 +4,9 @@
**/
/* theme color */
$--color-primary: #1890ff;
// $--color-primary: #1890ff;
$--color-primary: #356CEF;
$--color-success: #13ce66;
$--color-warning: #ffba00;
$--color-danger: #ff4949;
......
......@@ -122,6 +122,58 @@ aside {
//main-container全局样式
.app-container {
padding: 20px;
padding-top: 10px;
flex: 1;
border-radius: 4px;
box-sizing: border-box;
// box-shadow: 2px 2px 4px rgba(30, 92, 235, 0.1);
// margin: 10px;
// background-color: #fff;
display: flex;
flex-direction: column;
min-height: 200px;
}
.page-container {
padding: 20px;
flex: 1;
border-radius: 4px;
box-sizing: border-box;
box-shadow: 2px 2px 4px rgba(30, 92, 235, 0.1);
background-color: #fff;
display: flex;
flex-direction: column;
min-height: 200px;
}
.page-container-noback{
display: flex;
flex-direction: column;
flex: 1;
border-radius: 4px;
box-sizing: border-box;
display: flex;
flex-direction: column;
min-height: 200px;
}
.flex-container{
display: flex;
border-radius: 4px;
}
.shadow {
box-shadow: 2px 2px 4px rgba(30, 92, 235, 0.1);
}
.flex1{
flex: 1;
overflow: hidden;
}
.card-container {
background-color: #fff;
border-radius: 4px;
box-sizing: border-box;
}
.table-container{
flex: 1;
min-height: 200px;
}
.components-container {
......
......@@ -186,7 +186,7 @@
.el-card__header {
padding: 14px 15px 7px;
min-height: 40px;
height: 40px;
}
.el-card__body {
......
......@@ -5,6 +5,8 @@
transition: margin-left .28s;
margin-left: $base-sidebar-width;
position: relative;
display: flex;
flex-direction: column;
}
.sidebarHide {
......@@ -74,6 +76,7 @@
overflow: hidden !important;
text-overflow: ellipsis !important;
white-space: nowrap !important;
}
// menu hover
......@@ -86,6 +89,7 @@
& .theme-dark .is-active > .el-submenu__title {
color: $base-menu-color-active !important;
}
& .nest-menu .el-submenu>.el-submenu__title,
......@@ -224,4 +228,113 @@
border-radius: 20px;
}
}
.theme-dark{
.el-submenu__title {
i{
color: #fff;
}
}
}
}
.theme-dark {
.el-submenu__title {
i {
color: #fff !important;
}
// 或者更具体地选择箭头图标
.el-icon-arrow-down,
.el-icon-arrow-up {
color: #fff !important;
}
}
.svg-icon {
color: #fff !important;
}
span {
color: #fff !important;
}
}
.el-menu {
// 鼠标悬浮在菜单项上的样式
.el-menu-item:hover,
.el-submenu__title:hover {
position: relative;
&::after {
content: '';
position: absolute;
top: 5%;
bottom: 5%;
left: 5%;
right: 5%;
background-color: rgba(255,255,255,0.15);
border-radius: 6px;
transition: all 0.3s ease;
pointer-events: none;
}
}
// 选中的子菜单项样式
.el-menu-item.is-active {
position: relative;
&::after {
content: '';
position: absolute;
top: 5%;
bottom: 5%;
left: 5%;
right: 5%;
background-color: rgba(255,255,255,0.15);
border-radius: 6px;
transition: all 0.3s ease;
pointer-events: none;
}
}
// 打开的父级菜单样式
.el-submenu.is-opened {
> .el-submenu__title {
position: relative;
&::after {
content: '';
position: absolute;
top: 5%;
bottom: 5%;
left: 5%;
right: 5%;
background-color: rgba(255,255,255,0.15);
border-radius: 6px;
transition: all 0.3s ease;
pointer-events: none;
}
}
}
// 选中的父级菜单样式(如果有的话)
.el-submenu.is-active {
> .el-submenu__title {
position: relative;
&::after {
content: '';
position: absolute;
top: 5%;
bottom: 5%;
left: 5%;
right: 5%;
background-color: rgba(255,255,255,0.15);
border-radius: 6px;
transition: all 0.3s ease;
pointer-events: none;
}
}
}
}
\ No newline at end of file
:root {
--container-pd: 10px;
--shadow: 2px 2px 4px rgba(30, 92, 235, 0.1); // 阴影
}
// base color
$blue:#324157;
$light-blue:#3A71A8;
......@@ -9,17 +13,17 @@ $yellow:#FEC171;
$panGreen: #30B08F;
// 默认菜单主题风格
$base-menu-color:#bfcbd9;
$base-menu-color:#fff;
$base-menu-color-active:#f4f4f5;
$base-menu-background:#304156;
$base-menu-background:#356cec;
$base-logo-title-color: #ffffff;
$base-menu-light-color:rgba(0,0,0,.70);
$base-menu-light-background:#ffffff;
$base-logo-light-title-color: #001529;
$base-sub-menu-background:#1f2d3d;
$base-sub-menu-hover:#001528;
$base-sub-menu-background:#356cec;
$base-sub-menu-hover:#2f61d4;
// 自定义暗色菜单风格
/**
......
<template>
<div class="page-title">
<div
class="page-title-container">
<div class="left-part">
<el-button
v-if="back"
icon="el-icon-back"
class="page-back-logo"
type="text"
size="large"
@click="handlePageBack"
/>
<div class="title">
<slot>{{ titleStr }}</slot>
</div>
</div>
<div class="right-part">
<slot name="buttons" />
</div>
</div>
</div>
</template>
<script>
export default {
name: 'PageTitle',
props: {
back: {
type: Boolean,
default: false
},
title: {
type: String,
default: ''
}
},
data() {
return {
settingsStore: null,
appStore: null,
route: null
}
},
computed: {
titleStr() {
return this.title || String(this.route?.meta?.title || '')
},
},
mounted() {
// 模拟 Vue 3 的 store 和 route
this.initStores()
},
methods: {
initStores() {
// 这里需要根据您的实际 store 结构进行调整
// 假设您有类似 Vuex store 的结构
try {
this.settingsStore = this.$store?.state?.settings || {}
this.appStore = this.$store?.state?.app || {}
this.route = this.$route || {}
} catch (error) {
console.warn('Store or route not available, using default values')
this.settingsStore = {}
this.appStore = {}
this.route = {}
}
},
handlePageBack() {
this.$emit('back')
}
}
}
</script>
<style lang="scss" scoped>
.page-title {
margin-bottom: 10px;
.page-title-container {
height: 48px;
padding: 0 20px;
display: flex;
justify-content: space-between;
border-radius: 4px;
background: rgba(255, 255, 255, 1);
box-shadow: 2px 2px 4px rgba(30, 92, 235, 0.1);
align-items: center;
.left-part {
font-size: 16px;
color: rgb(46, 46, 46);
}
}
}
</style>
\ No newline at end of file
<script>
const XS = 0
const SM = 768
const MD = 992
const LG = 1200
const XL = 1920
export default {
name: 'PageWrapperSearch',
emits: ['update:advanced', 'search', 'reset'],
components: {
ElRow: () => import('element-ui/lib/row'),
ElCol: () => import('element-ui/lib/col'),
ElForm: () => import('element-ui/lib/form'),
ElFormItem: () => import('element-ui/lib/form-item'),
ElIcon: () => import('element-ui/lib/icon'),
ElButton: () => import('element-ui/lib/button')
},
props: {
xs: {
type: Number,
default: 24
},
sm: {
type: Number,
default: 24
},
md: {
type: Number,
default: 12
},
lg: {
type: Number,
default: 8
},
xl: {
type: Number,
default: 6
},
labelWidth: [Number, String]
},
data() {
return {
observer: null,
ElFormRef: null,
max: 0,
isAdvanced: true,
isFold: true, // 默认折叠状态
labelWidthValue: '',
inputEvents: [],
screenWidth: 1920
}
},
computed: {
gutter() {
return (24 / this.max % 24) || 0
},
// 计算每行最多能显示的列数
maxItemsPerRow() {
return Math.floor(24 / this.currentColWidth)
},
// 获取当前屏幕尺寸对应的列宽
currentColWidth() {
if (this.screenWidth >= XL) return this.xl
if (this.screenWidth >= LG) return this.lg
if (this.screenWidth >= MD) return this.md
if (this.screenWidth >= SM) return this.sm
return this.xs
},
// 是否显示折叠按钮
shouldShowFoldButton() {
const formItems = this.extractFormItems(this.$slots.default || [])
return formItems.length > this.maxItemsPerRow - 1
},
// 折叠状态下每行最多显示的表单项数量(包括按钮列)
maxVisibleItemsWhenFold() {
return Math.max(1, this.maxItemsPerRow - 1) // 减去按钮列
},
// 是否需要将按钮放在单独一行
shouldWrapButtons() {
return !this.isFold && this.shouldShowFoldButton
}
},
mounted() {
this.screenWidth = document.documentElement.clientWidth
this.observer = new ResizeObserver((entries) => {
if (entries[0].contentRect.width > 0) {
this.initSize()
}
})
if (this.ElFormRef?.$el) {
this.observer.observe(this.ElFormRef.$el)
}
this.initSize()
window.addEventListener('resize', this.handleResize)
},
beforeDestroy() {
if (this.observer) {
this.observer.disconnect()
if (this.ElFormRef?.$el) {
this.observer.unobserve(this.ElFormRef.$el)
}
}
window.removeEventListener('resize', this.handleResize)
},
methods: {
handleResize() {
this.screenWidth = document.documentElement.clientWidth
this.initSize()
},
initSize() {
this.max = 24 / this.currentColWidth
this.resetLabelWidth()
},
resetLabelWidth() {
this.labelWidthValue = ''
this.$nextTick().then(() => {
const formItemLabels = this.ElFormRef?.$el ? this.ElFormRef.$el.querySelectorAll('.el-form-item__label') : []
const arr = []
formItemLabels.forEach(item => {
arr.push(item.offsetWidth)
})
const max = Math.max.apply(null, arr)
this.labelWidthValue = String(max + 16)
})
},
toggleFold() {
this.isFold = !this.isFold
this.labelWidthValue = ''
this.resetLabelWidth()
},
// 判断是否应该隐藏表单项
shouldHideItem(index) {
if (!this.isFold) return false
return index >= this.maxVisibleItemsWhenFold
},
// 更可靠的 el-form-item 检测方法
isFormItemNode(node) {
if (!node) return false
if (node.componentOptions && node.componentOptions.tag === 'el-form-item') {
return true
}
if (node.data && node.data.attrs) {
const attrs = node.data.attrs
if (attrs.label || attrs.prop) {
return true
}
}
if (node.data && node.data.staticClass) {
if (node.data.staticClass.includes('el-form-item')) {
return true
}
}
return false
},
// 递归查找所有表单项
extractFormItems(nodes, result = []) {
if (!nodes || !Array.isArray(nodes)) return result
nodes.forEach(node => {
if (!node) return
if (this.isFormItemNode(node)) {
result.push(node)
} else if (node.children) {
this.extractFormItems(node.children, result)
} else if (node.componentOptions && node.componentOptions.children) {
this.extractFormItems(node.componentOptions.children, result)
}
})
return result
}
},
render() {
// 提取所有 el-form-item
const defaultSlots = this.$slots.default || []
const formItems = this.extractFormItems(defaultSlots)
// 渲染表单项
const formItemCols = formItems.map((item, index) => {
const isHidden = this.shouldHideItem(index)
return (
<el-col
class={{ 'hidden': isHidden }}
key={`formitem-${index}`}
xs={24}
sm={this.sm}
md={this.md}
lg={this.lg}
xl={this.xl}
>
{item}
</el-col>
)
})
// 渲染按钮
const buttons = (
<div class="buttons-space">
<el-button
plain={true}
on-click={() => {
this.$emit('reset', this.ElFormRef)
}}
>
重置
</el-button>
<el-button
type="primary"
on-click={() => {
this.$emit('search')
}}
>
查询
</el-button>
{this.shouldShowFoldButton ? (
<div
class="advanced"
on-click={this.toggleFold}
>
<span>{this.isFold ? '展开' : '收起'}</span>
<i class={`el-icon-arrow-${this.isFold ? 'down' : 'up'} advanced-icon`}></i>
</div>
) : null}
</div>
)
// 按钮列
const buttonsCol = (
<el-col
class="ElColButtons"
xs={24}
sm={this.sm}
md={this.md}
lg={this.lg}
xl={this.xl}
style={this.shouldWrapButtons ? 'margin-top: 18px;' : ''}
>
{this.$slots.buttons ? this.$slots.buttons : buttons}
</el-col>
)
return (
<el-form
{...{ attrs: this.$attrs }}
label-width={this.labelWidth || this.labelWidthValue}
label-position="right"
ref="ElFormRef"
class="page-wrapper-search"
>
{/* 第一行:表单项 */}
<el-row gutter={this.gutter}>
{formItemCols}
{/* 折叠状态:按钮列与表单项在同一行 */}
{!this.shouldWrapButtons && buttonsCol}
</el-row>
{/* 展开状态:按钮列在第二行 */}
{this.shouldWrapButtons && (
<el-row gutter={this.gutter} style="margin-top: 0;display: flex;justify-content: flex-end;">
{buttonsCol}
</el-row>
)}
</el-form>
)
}
}
</script>
<style lang="scss" scoped>
.page-wrapper-search {
position: relative;
background: white;
padding: 16px;
}
:deep(.el-form-item) {
margin-bottom: 18px;
.el-form-item__label {
color: #606266;
font-weight: normal;
}
.el-form-item__content {
> div {
width: 100%;
}
.el-input,
.el-select,
.el-date-editor {
width: 100%;
.el-input__inner {
border-radius: 4px;
border: 1px solid #DCDFE6;
&:focus {
border-color: #356CEF;
}
}
}
.el-select .el-input__inner {
cursor: pointer;
}
}
}
.advanced {
display: inline-flex;
align-items: center;
color: #356CEF;
font-size: 14px;
white-space: nowrap;
cursor: pointer;
margin-left: 10px;
vertical-align: middle;
&:hover {
color: #1257f7;
}
&-icon {
margin-left: 4px;
}
}
.buttons-space {
display: flex;
justify-content: flex-end;
align-items: center;
width: 100%;
gap: 12px;
.el-button {
border-radius: 4px;
font-size: 14px;
padding: 10px 20px;
height: 32px;
line-height: 1;
display: flex;
align-items: center;
justify-self: center;
&.is-plain {
border-color: #DCDFE6;
color: #606266;
&:hover {
border-color: #356CEF;
color: #356CEF;
background-color: #ecf5ff;
}
}
&.el-button--primary {
background-color: #356CEF;
border-color: #356CEF;
&:hover {
background-color: #1257f7;
border-color: #1257f7;
}
}
}
}
.ElColButtons {
:deep(.el-form-item__content) {
display: flex;
justify-content: flex-end;
align-items: center;
height: 40px;
}
}
.hidden {
display: none !important;
}
@media (max-width: 768px) {
.page-wrapper-search {
padding: 12px;
}
.ElColButtons {
:deep(.el-form-item__content) {
justify-content: flex-start;
height: auto;
}
}
.buttons-space {
justify-content: flex-start;
flex-direction: column;
align-items: flex-start;
gap: 8px;
.el-button, .advanced {
width: 100%;
justify-content: center;
}
}
}
</style>
\ No newline at end of file
......@@ -47,17 +47,25 @@ export default {
<style lang="scss" scoped>
.app-main {
/* 50= navbar 50 */
min-height: calc(100vh - 50px);
// min-height: calc(100vh - 50px);
width: 100%;
position: relative;
overflow: hidden;
flex: 1;
display: flex;
flex-direction: column;
background-color: #F3F5FB;
}
.fixed-header + .app-main {
overflow-y: auto;
scrollbar-gutter: auto;
height: calc(100vh - 50px);
min-height: 0px;
// height: calc(100vh - 50px);
// min-height: 0px;
flex: 1;
display: flex;
flex-direction: column;
background-color: #F3F5FB;
}
.app-main:has(.copyright) {
......@@ -71,12 +79,16 @@ export default {
.hasTagsView {
.app-main {
/* 84 = navbar + tags-view = 50 + 34 */
min-height: calc(100vh - 84px);
// min-height: calc(100vh - 84px);
flex: 1;
display: flex;
flex-direction: column;
background-color: #F3F5FB;
}
.fixed-header + .app-main {
margin-top: 84px;
height: calc(100vh - 84px);
// height: calc(100vh - 84px);
min-height: 0px;
}
}
......
......@@ -36,6 +36,10 @@ import DictTag from '@/components/DictTag'
// 字典数据组件
import DictData from '@/components/DictData'
import PageWrapperSearch from '@/components/Search/PageWrapperSearch.vue'
import PageTitle from '@/components/PageTitle/index.vue'
// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
......@@ -55,6 +59,8 @@ Vue.component('Editor', Editor)
Vue.component('FileUpload', FileUpload)
Vue.component('ImageUpload', ImageUpload)
Vue.component('ImagePreview', ImagePreview)
Vue.component('PageWrapperSearch', PageWrapperSearch)
Vue.component('PageTitle', PageTitle)
Vue.use(directive)
Vue.use(plugins)
......
<template>
<div class="material-select-component">
<el-dialog :title="title" :visible.sync="visible" width="900px" append-to-body>
<!-- 左右分栏布局 -->
<div class="split-layout">
<!-- 左侧分类树 -->
<div class="left-panel">
<TreeComponent
ref="treeComponent"
:tree-data="categoryTreeData"
:tree-props="treeProps"
:node-key="nodeKey"
:show-search="true"
search-placeholder="请输入分类名称"
:default-expand-all="true"
:highlight-current="true"
:loading="loadingTree"
@node-click="handleCategoryChange"
>
<!-- 自定义节点内容插槽 -->
<template #node-content="{ node, data }">
<span class="custom-tree-node">
<span>{{ node.label }}</span>
</span>
</template>
</TreeComponent>
</div>
<!-- 右侧物料列表 -->
<div class="right-panel">
<!-- 物料列表 -->
<el-table v-loading="loading" :data="materialsList" @selection-change="handleSelectionChange" :scroll-x="true">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" align="center" />
<el-table-column label="物料编码" align="center" prop="materialCode" />
<el-table-column label="物料名称" align="center" prop="materialName" />
<el-table-column label="SAP物料号" align="center" prop="sapNo" />
<el-table-column label="规格型号" align="center" prop="specification" />
<el-table-column label="计量单位" align="center" prop="materialUnit" />
</el-table>
<!-- 分页 -->
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</div>
<!-- 底部按钮 -->
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="confirmSelection">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listMaterials } from "@/api/inventory/materials"
import { listMaterials_category } from "@/api/inventory/materials_category"
import Pagination from "@/components/Pagination"
import TreeComponent from './treeComponent.vue'
export default {
name: "MaterialSelectComponent",
components: {
Pagination,
TreeComponent
},
props: {
// 对话框标题
title: {
type: String,
default: "选择物料"
},
// 是否显示对话框
visible: {
type: Boolean,
default: false
}
},
data() {
return {
// 树相关数据
categoryTreeData: [],
treeProps: {
children: 'children',
label: 'label',
value: 'sid'
},
nodeKey: 'sid',
loadingTree: false,
// 分类映射
categoryMap: {},
// 选中的分类
selectedCategory: null,
// 加载状态
loading: false,
// 总条数
total: 0,
// 物料列表
materialsList: [],
// 选中的物料
selectedMaterials: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
categoryCode: null
}
}
},
watch: {
// 监听对话框显示状态,当显示时加载物料列表和分类树
visible(newVal) {
if (newVal) {
this.getCategoryTreeData()
this.getList()
}
}
},
methods: {
/** 获取分类树数据 */
async getCategoryTreeData() {
this.loadingTree = true
try {
// 调用物料分类列表API获取所有分类
const response = await listMaterials_category({
pageNum: 1,
pageSize: 1000 // 获取足够多的数据
})
if (response.rows && response.rows.length > 0) {
// 过滤掉已禁用的分类
const activeCategories = response.rows.filter(item =>
item.isUsed !== 0 && item.isUsed !== '0'
)
// 构建树形结构
this.categoryTreeData = this.buildTreeData(activeCategories)
// 构建分类映射
this.buildCategoryMap(activeCategories)
}
} catch (error) {
console.error('获取分类树数据失败:', error)
} finally {
this.loadingTree = false
}
},
/** 构建树形结构 */
buildTreeData(list, parentId = null) {
const result = list
.filter(item => {
if (parentId === null) {
// 根节点:parentId为null、0或空
return !item.parentId || item.parentId === 0 || item.parentId === '0'
} else {
// 子节点:parentId匹配
return item.parentId == parentId
}
})
.map(item => {
const children = this.buildTreeData(list, item.id)
return {
...item,
sid: String(item.id),
label: item.categoryName,
children: children.length > 0 ? children : undefined
}
})
return result
},
/** 构建分类映射 */
buildCategoryMap(categories) {
this.categoryMap = {}
categories.forEach(item => {
this.categoryMap[item.id] = item.categoryName
})
},
/** 处理分类选择变化 */
handleCategoryChange(data) {
this.selectedCategory = data
// 更新查询参数,按选中的分类筛选物料
this.queryParams.categoryCode = data ? data.categoryCode : null
this.queryParams.pageNum = 1
this.getList()
},
/** 获取物料列表 */
async getList() {
this.loading = true
try {
const response = await listMaterials(this.queryParams)
this.materialsList = response.rows
this.total = response.total
} catch (error) {
console.error('获取物料列表失败:', error)
} finally {
this.loading = false
}
},
/** 处理选择变化 */
handleSelectionChange(selection) {
this.selectedMaterials = selection
},
/** 确认选择 */
confirmSelection() {
// 提取选中物料的uuid和名称,用逗号隔开
const uuids = this.selectedMaterials
.map(item => item.uuid || item.id) // 兼容uuid和id字段
.join(',')
const names = this.selectedMaterials
.map(item => item.materialName) // 提取物料名称
.join(',')
// 触发选择确认事件,将选中的uuid和名称传递给父组件
this.$emit('selection-confirm', uuids, names)
// 关闭对话框
this.$emit('update:visible', false)
},
/** 取消选择 */
cancel() {
// 清空选择
this.selectedMaterials = []
this.selectedCategory = null
this.queryParams.categoryCode = null
// 触发取消事件
this.$emit('selection-cancel')
// 关闭对话框
this.$emit('update:visible', false)
}
}
}
</script>
<style scoped>
.material-select-component {
.dialog-footer {
text-align: right;
}
.split-layout {
display: flex;
height: 500px;
gap: 10px;
.left-panel {
width: 250px;
border: 1px solid #e4e7ed;
border-radius: 4px;
overflow: hidden;
.tree-container {
height: 100%;
}
}
.right-panel {
flex: 1;
display: flex;
flex-direction: column;
.el-table {
flex: 1;
overflow: auto;
}
.pagination {
margin-top: 10px;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="tree-container" :style="containerStyle">
<!-- 搜索框 -->
<div class="tree-header" v-if="showSearch">
<el-input
v-model="searchText"
:placeholder="searchPlaceholder"
clearable
size="small"
prefix-icon="el-icon-search"
@input="handleSearch"
style="width: 100%; margin-bottom: 10px;"
/>
</div>
<!-- 树组件 -->
<div class="tree-body" :style="treeBodyStyle">
<el-tree
v-if="treeData && treeData.length > 0"
ref="treeRef"
:data="filteredTreeData"
:props="treeProps"
:node-key="nodeKey"
:default-expand-all="defaultExpandAll"
:expand-on-click-node="expandOnClickNode"
:highlight-current="highlightCurrent"
:filter-node-method="filterNodeMethod"
:empty-text="emptyText"
:style="treeStyle"
@node-click="handleNodeClick"
@node-expand="handleNodeExpand"
@node-collapse="handleNodeCollapse"
@current-change="handleCurrentChange"
>
<!-- 自定义节点内容插槽 -->
<template #default="{ node, data }">
<slot name="node-content" :node="node" :data="data">
<span class="custom-tree-node">
<span>{{ node.label }}</span>
</span>
</slot>
</template>
</el-tree>
<!-- 空状态 -->
<div v-else class="tree-empty">
<slot name="empty">
<div style="padding: 20px; text-align: center; color: #999;">
{{ loading ? '加载中...' : '暂无数据' }}
</div>
</slot>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'TreeComponent',
props: {
// 树数据
treeData: {
type: Array,
default: () => []
},
// 树配置
treeProps: {
type: Object,
default: () => ({
children: 'children',
label: 'label',
value: 'sid'
})
},
// 节点key
nodeKey: {
type: String,
default: 'sid'
},
// 是否显示搜索框
showSearch: {
type: Boolean,
default: true
},
// 搜索框占位符
searchPlaceholder: {
type: String,
default: '请输入搜索内容'
},
// 是否默认展开所有节点
defaultExpandAll: {
type: Boolean,
default: true
},
// 是否点击节点时展开
expandOnClickNode: {
type: Boolean,
default: false
},
// 是否高亮当前选中节点
highlightCurrent: {
type: Boolean,
default: true
},
// 容器样式
containerStyle: {
type: Object,
default: () => ({
height: '100%',
padding: '10px'
})
},
// 树容器样式
treeBodyStyle: {
type: Object,
default: () => ({
height: 'calc(100% - 50px)',
overflow: 'auto'
})
},
// 树样式
treeStyle: {
type: Object,
default: () => ({})
},
// 空状态文本
emptyText: {
type: String,
default: '暂无数据'
},
// 加载状态
loading: {
type: Boolean,
default: false
},
// 初始选中的节点key
defaultSelectedKey: {
type: [String, Number],
default: null
}
},
data() {
return {
searchText: '',
filteredTreeData: [],
selectedNode: null
}
},
watch: {
treeData: {
immediate: true,
handler(newData) {
this.filteredTreeData = newData
this.$nextTick(() => {
if (this.defaultSelectedKey && this.$refs.treeRef) {
this.$refs.treeRef.setCurrentKey(this.defaultSelectedKey)
}
})
}
},
defaultSelectedKey: {
immediate: true,
handler(newKey) {
if (newKey && this.$refs.treeRef) {
this.$refs.treeRef.setCurrentKey(newKey)
}
}
}
},
methods: {
/**
* 过滤节点方法
*/
filterNodeMethod(value, data, node) {
if (!value) return true
const label = data[this.treeProps.label] || ''
return label.toLowerCase().includes(value.toLowerCase())
},
/**
* 处理搜索
*/
handleSearch(value) {
this.$refs.treeRef.filter(value)
},
/**
* 节点点击事件
*/
handleNodeClick(data, node, component) {
this.selectedNode = { data, node, component }
this.$emit('node-click', data, node, component)
},
/**
* 节点展开事件
*/
handleNodeExpand(data, node, component) {
this.$emit('node-expand', data, node, component)
},
/**
* 节点折叠事件
*/
handleNodeCollapse(data, node, component) {
this.$emit('node-collapse', data, node, component)
},
/**
* 当前节点变化事件
*/
handleCurrentChange(data, node) {
this.$emit('current-change', data, node)
},
/**
* 重置树结构
*/
resetTree() {
// 修复:使用正确的 ref 名称 treeRef
if (this.$refs.treeRef) {
this.$refs.treeRef.setCurrentKey(null);
this.searchText = '';
this.$refs.treeRef.filter(''); // 清空搜索
}
},
/**
* 设置当前选中的节点
*/
setCurrentNode(node) {
this.$refs.treeRef.setCurrentNode(node)
},
/**
* 设置当前选中的节点key
*/
setCurrentKey(key) {
this.$refs.treeRef.setCurrentKey(key)
},
/**
* 获取当前选中的节点
*/
getCurrentNode() {
return this.$refs.treeRef.getCurrentNode()
},
/**
* 获取当前选中的节点key
*/
getCurrentKey() {
return this.$refs.treeRef.getCurrentKey()
},
/**
* 展开指定节点
*/
expandNode(node) {
this.$refs.treeRef.expandNode(node)
},
/**
* 折叠指定节点
*/
collapseNode(node) {
this.$refs.treeRef.collapseNode(node)
},
/**
* 展开所有节点
*/
expandAll() {
this.$refs.treeRef.expandAll()
},
/**
* 折叠所有节点
*/
collapseAll() {
this.$refs.treeRef.collapseAll()
},
/**
* 更新节点数据
*/
updateKeyChildren(key, data) {
this.$refs.treeRef.updateKeyChildren(key, data)
},
/**
* 获取节点信息
*/
getNode(key) {
return this.$refs.treeRef.getNode(key)
},
/**
* 移除节点
*/
remove(key) {
this.$refs.treeRef.remove(key)
},
/**
* 追加节点数据
*/
append(data, parentNode) {
this.$refs.treeRef.append(data, parentNode)
},
/**
* 插入节点数据
*/
insertBefore(data, refNode) {
this.$refs.treeRef.insertBefore(data, refNode)
},
/**
* 插入节点数据后
*/
insertAfter(data, refNode) {
this.$refs.treeRef.insertAfter(data, refNode)
}
}
}
</script>
<style scoped>
.tree-container {
height: 100%;
display: flex;
flex-direction: column;
}
.tree-header {
flex-shrink: 0;
}
.tree-body {
flex: 1;
overflow: auto;
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
.tree-empty {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
color: #999;
}
</style>
\ No newline at end of file
<template>
<div class="app-container" style="overflow: hidden;">
<splitpanes class="default-theme" style="height: 100%;">
<!-- 树结构:左侧面板 -->
<pane size="16" style="height: 100%; overflow: auto;">
<TreeComponent
:tree-data="categoryOptions"
:tree-props="defaultProps"
:node-key="nodeKey"
:show-search="true"
search-placeholder="请输入分类名称"
:default-expand-all="true"
:highlight-current="true"
:loading="loadingTree"
@node-click="handleTreeClick"
style="height: 100%;"
/>
</pane>
<!-- 物料分类管理:右侧面板 -->
<pane size="84" style="height: 100%; overflow: auto;">
<div style="padding: 10px; height: 100%; display: flex; flex-direction: column;">
<!-- 搜索表单 -->
<el-form
<div class="app-container">
<PageTitle>
<template #buttons>
<el-button
type="primary"
plain
size="medium"
icon="el-icon-plus"
@click="handleAdd"
v-hasPermi="['inventory:materials_category:add']"
>新增</el-button>
<el-button
type="info"
plain
size="medium"
icon="el-icon-sort"
@click="toggleExpandAll"
>展开/折叠</el-button>
<el-button
type="warning"
plain
size="medium"
icon="el-icon-download"
@click="handleExport"
v-hasPermi="['inventory:materials_category:export']"
>导出</el-button>
</template>
</PageTitle>
<div class="page-container-noback flex1">
<div class="flex-container flex1" style="min-height: 200px;overflow: hidden;">
<div class="card-container shadow" style="overflow: auto;min-width: 16%;">
<TreeComponent
:tree-data="categoryOptions"
:tree-props="defaultProps"
:node-key="nodeKey"
:show-search="true"
search-placeholder="请输入分类名称"
:default-expand-all="true"
:highlight-current="true"
:loading="loadingTree"
@node-click="handleTreeClick"
style="height: 100%;"
/>
</div>
<div class="card-container shadow flex1 right-card flex-container" style="flex-direction: column;padding: 20px;min-height: 200px;">
<page-wrapper-search
:model="queryParams"
ref="queryRef"
:inline="true"
v-show="showSearch"
label-width="128px"
style="margin-bottom: 10px;"
ref="queryForm"
size="small"
@search="handleQuery"
@reset="resetQuery"
>
<el-form-item label="物料分类编码" prop="categoryCode">
<el-form-item label="物料分类编码" prop="categoryCode">
<el-input
v-model="queryParams.categoryCode"
placeholder="请输入物料分类编码"
......@@ -45,70 +73,15 @@
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作按钮 -->
<el-row :gutter="10" class="mb8" style="margin-bottom: 10px;">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
@click="handleAdd"
v-hasPermi="['inventory:materials_category:add']"
>新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['inventory:materials_category:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['inventory:materials_category:remove']"
>删除</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-sort"
@click="toggleExpandAll"
>展开/折叠</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
@click="handleExport"
v-hasPermi="['inventory:materials_category:export']"
>导出</el-button>
</el-col>
<right-toolbar v-model="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</page-wrapper-search>
<!-- 树形数据表格 -->
<div style="flex: 1; overflow: auto;">
<div style="flex: 1;min-height: 200px;">
<el-table
ref="treeTable"
v-loading="loading"
:data="currentTreeNodeData"
height="100%"
row-key="id"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
......@@ -118,21 +91,22 @@
label="物料分类名称"
align="center"
prop="categoryName"
min-width="200"
fixed="left"
/>
<el-table-column label="物料分类编码" align="center" prop="categoryCode" width="200" />
<el-table-column label="排序" align="center" prop="sortNo" width="100" />
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
<el-table-column label="物料分类编码" align="center" prop="categoryCode" />
<el-table-column label="排序" align="center" prop="sortNo" width="80" />
<el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="修改时间" align="center" prop="updateTime" width="200">
<el-table-column label="修改时间" align="center" prop="updateTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
......@@ -162,9 +136,13 @@
</el-table-column>
</el-table>
</div>
</div>
</pane>
</splitpanes>
</div>
</div>
<!-- 添加/修改对话框 -->
<el-dialog
......@@ -485,7 +463,7 @@ export default {
/** 重置搜索条件 */
resetQuery() {
this.$refs["queryRef"].resetFields();
// this.$refs["queryRef"].resetFields();
this.queryParams = {
pageNum: 1,
pageSize: 1000,
......@@ -641,17 +619,8 @@ export default {
}
</script>
<style scoped>
.app-container {
height: 100%;
}
.mb8 {
margin-bottom: 8px;
}
.el-table {
max-height: 100%;
overflow-y: auto;
<style lang="scss" scoped>
.right-card {
margin-left: var(--container-pd);
}
</style>
\ No newline at end of file
<template>
<div class="app-container">
<el-row :gutter="10">
<el-col :span="24" class="card-box">
<el-card>
<div slot="header"><span><i class="el-icon-monitor"></i> 基本信息</span></div>
<div class="el-table el-table--enable-row-hover el-table--medium">
<table cellspacing="0" style="width: 100%">
<tbody>
<tr>
<td class="el-table__cell is-leaf"><div class="cell">Redis版本</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_version }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">运行模式</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_mode == "standalone" ? "单机" : "集群" }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">端口</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.tcp_port }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">客户端数</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.connected_clients }}</div></td>
</tr>
<tr>
<td class="el-table__cell is-leaf"><div class="cell">运行时间(天)</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.uptime_in_days }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">使用内存</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.used_memory_human }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">使用CPU</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ parseFloat(cache.info.used_cpu_user_children).toFixed(2) }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">内存配置</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.maxmemory_human }}</div></td>
</tr>
<tr>
<td class="el-table__cell is-leaf"><div class="cell">AOF是否开启</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.aof_enabled == "0" ? "否" : "是" }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">RDB是否成功</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.rdb_last_bgsave_status }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">Key数量</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.dbSize">{{ cache.dbSize }} </div></td>
<td class="el-table__cell is-leaf"><div class="cell">网络入口/出口</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.instantaneous_input_kbps }}kps/{{cache.info.instantaneous_output_kbps}}kps</div></td>
</tr>
</tbody>
</table>
</div>
</el-card>
</el-col>
<div class="page-container-noback flex1">
<el-row :gutter="10" >
<el-col :span="24" class="card-box">
<el-card>
<div slot="header"><span><i class="el-icon-monitor"></i> 基本信息</span></div>
<div class="el-table el-table--enable-row-hover el-table--medium">
<table cellspacing="0" style="width: 100%">
<tbody>
<tr>
<td class="el-table__cell is-leaf"><div class="cell">Redis版本</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_version }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">运行模式</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_mode == "standalone" ? "单机" : "集群" }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">端口</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.tcp_port }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">客户端数</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.connected_clients }}</div></td>
</tr>
<tr>
<td class="el-table__cell is-leaf"><div class="cell">运行时间(天)</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.uptime_in_days }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">使用内存</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.used_memory_human }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">使用CPU</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ parseFloat(cache.info.used_cpu_user_children).toFixed(2) }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">内存配置</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.maxmemory_human }}</div></td>
</tr>
<tr>
<td class="el-table__cell is-leaf"><div class="cell">AOF是否开启</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.aof_enabled == "0" ? "否" : "是" }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">RDB是否成功</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.rdb_last_bgsave_status }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">Key数量</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.dbSize">{{ cache.dbSize }} </div></td>
<td class="el-table__cell is-leaf"><div class="cell">网络入口/出口</div></td>
<td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.instantaneous_input_kbps }}kps/{{cache.info.instantaneous_output_kbps}}kps</div></td>
</tr>
</tbody>
</table>
</div>
</el-card>
</el-col>
<el-col :span="12" class="card-box">
<el-card>
<div slot="header"><span><i class="el-icon-pie-chart"></i> 命令统计</span></div>
<div class="el-table el-table--enable-row-hover el-table--medium">
<div ref="commandstats" style="height: 420px" />
</div>
</el-card>
</el-col>
</el-row>
<el-row :gutter="10" style="flex: 1;">
<el-col :span="12" class="card-box" style="height: 100%;">
<el-card style="height: 100%;">
<div slot="header"><span><i class="el-icon-pie-chart"></i> 命令统计</span></div>
<div class="el-table el-table--enable-row-hover el-table--medium">
<div ref="commandstats" style="height: 420px" />
</div>
</el-card>
</el-col>
<el-col :span="12" class="card-box">
<el-card>
<div slot="header"><span><i class="el-icon-odometer"></i> 内存信息</span></div>
<div class="el-table el-table--enable-row-hover el-table--medium">
<div ref="usedmemory" style="height: 420px" />
</div>
</el-card>
</el-col>
</el-row>
<el-col :span="12" class="card-box" style="height: 100%;">
<el-card style="height: 100%;">
<div slot="header"><span><i class="el-icon-odometer"></i> 内存信息</span></div>
<div class="el-table el-table--enable-row-hover el-table--medium">
<div ref="usedmemory" style="height: 420px" />
</div>
</el-card>
</el-col>
</el-row>
</div>
</div>
</template>
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="登录地址" prop="ipaddr">
<el-input
v-model="queryParams.ipaddr"
placeholder="请输入登录地址"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="登录状态"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.sys_common_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="登录时间">
<el-date-picker
v-model="dateRange"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<PageTitle>
<template #buttons>
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
size="medium"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['monitor:logininfor:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
size="medium"
@click="handleClean"
v-hasPermi="['monitor:logininfor:remove']"
>清空</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-unlock"
size="mini"
size="medium"
:disabled="single"
@click="handleUnlock"
v-hasPermi="['monitor:logininfor:unlock']"
>解锁</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
size="medium"
@click="handleExport"
v-hasPermi="['monitor:logininfor:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
</PageTitle>
<div class="page-container">
<page-wrapper-search
:model="queryParams"
ref="queryForm"
size="small"
@search="handleQuery"
@reset="resetQuery"
>
<el-form-item label="登录地址" prop="ipaddr">
<el-input
v-model="queryParams.ipaddr"
placeholder="请输入登录地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="登录状态"
clearable
>
<el-option
v-for="dict in dict.type.sys_common_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="登录时间">
<el-date-picker
v-model="dateRange"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
></el-date-picker>
</el-form-item>
</page-wrapper-search>
<div class="table-container">
<el-table ref="tables" v-loading="loading" :data="list" height="100%" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column type="selection" width="55" align="center" fixed/>
<el-table-column label="访问编号" align="center" prop="infoId" />
<el-table-column label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
<el-table-column label="登录地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
<el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
<el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" />
<el-table-column label="操作系统" align="center" prop="os" />
<el-table-column label="登录状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="操作信息" align="center" prop="msg" :show-overflow-tooltip="true" />
<el-table-column label="登录日期" align="center" prop="loginTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180" fixed="right">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.loginTime) }}</span>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="访问编号" align="center" prop="infoId" />
<el-table-column label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
<el-table-column label="登录地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
<el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
<el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" />
<el-table-column label="操作系统" align="center" prop="os" />
<el-table-column label="登录状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="操作信息" align="center" prop="msg" :show-overflow-tooltip="true" />
<el-table-column label="登录日期" align="center" prop="loginTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.loginTime) }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
......@@ -189,7 +199,9 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.resetForm("queryForm")
this.queryParams.ipaddr = undefined
this.queryParams.userName = undefined
this.queryParams.status = undefined
this.queryParams.pageNum = 1
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
},
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="登录地址" prop="ipaddr">
<el-input
v-model="queryParams.ipaddr"
placeholder="请输入登录地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
<PageTitle>
</PageTitle>
</el-form>
<el-table
v-loading="loading"
:data="list.slice((pageNum-1)*pageSize,pageNum*pageSize)"
style="width: 100%;"
>
<el-table-column label="序号" type="index" align="center">
<template slot-scope="scope">
<span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="会话编号" align="center" prop="tokenId" :show-overflow-tooltip="true" />
<el-table-column label="登录名称" align="center" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="部门名称" align="center" prop="deptName" />
<el-table-column label="主机" align="center" prop="ipaddr" :show-overflow-tooltip="true" />
<el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
<el-table-column label="浏览器" align="center" prop="browser" />
<el-table-column label="操作系统" align="center" prop="os" />
<el-table-column label="登录时间" align="center" prop="loginTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.loginTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleForceLogout(scope.row)"
v-hasPermi="['monitor:online:forceLogout']"
>强退</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-container">
<page-wrapper-search
:model="queryParams"
ref="queryForm"
size="small"
@search="handleQuery"
@reset="resetQuery"
>
<el-form-item label="登录地址" prop="ipaddr">
<el-input
v-model="queryParams.ipaddr"
placeholder="请输入登录地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</page-wrapper-search>
<div class="table-container">
<el-table
v-loading="loading"
:data="list.slice((pageNum-1)*pageSize,pageNum*pageSize)"
height="100%"
style="width: 100%;"
>
<el-table-column label="序号" type="index" align="center" fixed>
<template slot-scope="scope">
<span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="会话编号" align="center" prop="tokenId" :show-overflow-tooltip="true" />
<el-table-column label="登录名称" align="center" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="部门名称" align="center" prop="deptName" />
<el-table-column label="主机" align="center" prop="ipaddr" :show-overflow-tooltip="true" />
<el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
<el-table-column label="浏览器" align="center" prop="browser" />
<el-table-column label="操作系统" align="center" prop="os" />
<el-table-column label="登录时间" align="center" prop="loginTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.loginTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleForceLogout(scope.row)"
v-hasPermi="['monitor:online:forceLogout']"
>强退</el-button>
</template>
</el-table-column>
</el-table>
</div>
<pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" />
</div>
<pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" />
</div>
</template>
......@@ -104,7 +122,8 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.queryParams.ipaddr = undefined
this.queryParams.userName = undefined
this.handleQuery()
},
/** 强退按钮操作 */
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="部门名称" prop="deptName">
<el-input
v-model="queryParams.deptName"
placeholder="请输入部门名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="部门状态" clearable>
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<PageTitle>
<template #buttons>
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
size="medium"
@click="handleAdd"
v-hasPermi="['system:dept:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-sort"
size="mini"
size="medium"
@click="toggleExpandAll"
>展开/折叠</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
</PageTitle>
<div class="page-container">
<el-table
v-if="refreshTable"
v-loading="loading"
:data="deptList"
row-key="deptId"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dept:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['system:dept:add']"
>新增</el-button>
<el-button
v-if="scope.row.parentId != 0"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dept:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<page-wrapper-search
:model="queryParams"
ref="queryForm"
size="small"
@search="handleQuery"
@reset="resetQuery"
>
<el-form-item label="部门名称" prop="deptName">
<el-input
v-model="queryParams.deptName"
placeholder="请输入部门名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="部门状态" clearable>
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</page-wrapper-search>
<div class="table-container">
<el-table
v-if="refreshTable"
v-loading="loading"
:data="deptList"
height="100%"
row-key="deptId"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column prop="deptName" label="部门名称" width="260" fixed></el-table-column>
<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dept:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['system:dept:add']"
>新增</el-button>
<el-button
v-if="scope.row.parentId != 0"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dept:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<!-- 添加或修改部门对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
......@@ -267,7 +275,8 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.queryParams.deptName = ''
this.queryParams.status = ''
this.handleQuery()
},
/** 新增按钮操作 */
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="菜单名称" prop="menuName">
<el-input
v-model="queryParams.menuName"
placeholder="请输入菜单名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="菜单状态" clearable>
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<PageTitle>
<template #buttons>
<el-button
type="primary"
plain
......@@ -35,8 +11,7 @@
@click="handleAdd"
v-hasPermi="['system:menu:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
......@@ -44,63 +19,105 @@
size="mini"
@click="toggleExpandAll"
>展开/折叠</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
</PageTitle>
<div class="page-container">
<page-wrapper-search
:model="queryParams"
ref="queryForm"
size="small"
@search="handleQuery"
@reset="resetQuery"
>
<el-form-item label="菜单名称" prop="menuName">
<el-input
v-model="queryParams.menuName"
placeholder="请输入菜单名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="菜单状态" clearable>
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</page-wrapper-search>
<div class="table-container">
<el-table
v-if="refreshTable"
v-loading="loading"
:data="menuList"
height="100%"
row-key="menuId"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160" fixed></el-table-column>
<el-table-column prop="icon" label="图标" align="center" width="100">
<template slot-scope="scope">
<svg-icon :icon-class="scope.row.icon" />
</template>
</el-table-column>
<el-table-column prop="orderNum" label="排序" width="100"></el-table-column>
<el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true" width="200"></el-table-column>
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true" width="200"></el-table-column>
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:menu:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['system:menu:add']"
>新增</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:menu:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<el-table
v-if="refreshTable"
v-loading="loading"
:data="menuList"
row-key="menuId"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
<el-table-column prop="icon" label="图标" align="center" width="100">
<template slot-scope="scope">
<svg-icon :icon-class="scope.row.icon" />
</template>
</el-table-column>
<el-table-column prop="orderNum" label="排序" width="60"></el-table-column>
<el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="status" label="状态" width="80">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:menu:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['system:menu:add']"
>新增</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:menu:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改菜单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>
......@@ -410,7 +427,8 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.queryParams.menuName = ''
this.queryParams.status = ''
this.handleQuery()
},
/** 新增按钮操作 */
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="公告标题" prop="noticeTitle">
<el-input
v-model="queryParams.noticeTitle"
placeholder="请输入公告标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="操作人员" prop="createBy">
<el-input
v-model="queryParams.createBy"
placeholder="请输入操作人员"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="类型" prop="noticeType">
<el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable>
<el-option
v-for="dict in dict.type.sys_notice_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<PageTitle>
<template #buttons>
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
size="medium"
@click="handleAdd"
v-hasPermi="['system:notice:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
size="medium"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:notice:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
size="medium"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:notice:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
</PageTitle>
<div class="page-container">
<el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
<el-table-column
label="公告标题"
align="center"
prop="noticeTitle"
:show-overflow-tooltip="true"
/>
<el-table-column label="公告类型" align="center" prop="noticeType" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_notice_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建者" align="center" prop="createBy" width="100" />
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:notice:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:notice:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<page-wrapper-search
:model="queryParams"
ref="queryForm"
size="small"
@search="handleQuery"
@reset="resetQuery"
>
<el-form-item label="公告标题" prop="noticeTitle">
<el-input
v-model="queryParams.noticeTitle"
placeholder="请输入公告标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="操作人员" prop="createBy">
<el-input
v-model="queryParams.createBy"
placeholder="请输入操作人员"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="类型" prop="noticeType">
<el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable>
<el-option
v-for="dict in dict.type.sys_notice_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</page-wrapper-search>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div class="table-container">
<el-table v-loading="loading" :data="noticeList" height="100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed/>
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
<el-table-column
label="公告标题"
align="center"
prop="noticeTitle"
:show-overflow-tooltip="true"
/>
<el-table-column label="公告类型" align="center" prop="noticeType" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_notice_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建者" align="center" prop="createBy" width="100" />
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:notice:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:notice:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<!-- 添加或修改公告对话框 -->
<el-dialog :title="title" :visible.sync="open" width="780px" append-to-body>
......@@ -252,7 +257,9 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.queryParams.noticeTitle = ''
this.queryParams.createBy = ''
this.queryParams.noticeType = ''
this.handleQuery()
},
// 多选框选中数据
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="岗位编码" prop="postCode">
<el-input
v-model="queryParams.postCode"
placeholder="请输入岗位编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="岗位名称" prop="postName">
<el-input
v-model="queryParams.postName"
placeholder="请输入岗位名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="岗位状态" clearable>
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<PageTitle>
<template #buttons>
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
size="medium"
@click="handleAdd"
v-hasPermi="['system:post:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
size="medium"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:post:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
size="medium"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:post:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
size="medium"
@click="handleExport"
v-hasPermi="['system:post:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
</PageTitle>
<div class="page-container">
<page-wrapper-search
:model="queryParams"
ref="queryForm"
size="small"
@search="handleQuery"
@reset="resetQuery"
>
<el-form-item label="岗位编码" prop="postCode">
<el-input
v-model="queryParams.postCode"
placeholder="请输入岗位编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="岗位名称" prop="postName">
<el-input
v-model="queryParams.postName"
placeholder="请输入岗位名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="岗位状态" clearable>
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</page-wrapper-search>
<div class="table-container">
<el-table v-loading="loading" :data="postList" height="100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed/>
<el-table-column label="岗位编号" align="center" prop="postId" />
<el-table-column label="岗位编码" align="center" prop="postCode" />
<el-table-column label="岗位名称" align="center" prop="postName" />
<el-table-column label="岗位排序" align="center" prop="postSort" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:post:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:post:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="岗位编号" align="center" prop="postId" />
<el-table-column label="岗位编码" align="center" prop="postCode" />
<el-table-column label="岗位名称" align="center" prop="postName" />
<el-table-column label="岗位排序" align="center" prop="postSort" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:post:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:post:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改岗位对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
......@@ -243,7 +258,9 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.queryParams.postCode = ''
this.queryParams.postName = ''
this.queryParams.status = ''
this.handleQuery()
},
// 多选框选中数据
......
<template>
<div class="app-container">
<el-row :gutter="20">
<splitpanes :horizontal="this.$store.getters.device === 'mobile'" class="default-theme">
<!--部门数据-->
<pane size="16">
<PageTitle>
<template #buttons>
<el-button type="primary" plain icon="el-icon-plus" size="medium" @click="handleAdd" v-hasPermi="['system:user:add']">新增</el-button>
<el-button type="success" plain icon="el-icon-edit" size="medium" :disabled="single" @click="handleUpdate" v-hasPermi="['system:user:edit']">修改</el-button>
<el-button type="danger" plain icon="el-icon-delete" size="medium" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:user:remove']">删除</el-button>
<el-button type="info" plain icon="el-icon-upload2" size="medium" @click="handleImport" v-hasPermi="['system:user:import']">导入</el-button>
<el-button type="warning" plain icon="el-icon-download" size="medium" @click="handleExport" v-hasPermi="['system:user:export']">导出</el-button>
</template>
</PageTitle>
<div class="page-container-noback flex1">
<div class="flex-container flex1" style="min-height: 200px;overflow: hidden;">
<div class="card-container shadow left-card" style="overflow: auto;min-width: 16%;">
<el-col>
<div class="head-container">
<el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search" style="margin-bottom: 20px" />
......@@ -21,51 +35,35 @@
@node-click="handleNodeClick" />
</div>
</el-col>
</pane>
<!--用户数据-->
<pane size="84">
<el-col>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户名称" prop="userName">
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="手机号码" prop="phonenumber">
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="用户状态" clearable style="width: 240px">
<el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="card-container shadow flex1 right-card flex-container" style="flex-direction: column;padding: 20px;min-height: 200px;">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:user:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:user:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['system:user:import']">导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:user:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<page-wrapper-search
:model="queryParams"
ref="queryForm"
size="small"
@search="handleQuery"
@reset="resetQuery"
>
<el-form-item label="用户名称" prop="userName">
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="手机号码" prop="phonenumber">
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="用户状态" clearable style="width: 240px">
<el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
</page-wrapper-search>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<!-- 树形数据表格 -->
<div style="flex: 1;min-height: 200px;">
<el-table v-loading="loading" :data="userList" height="100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns.userId.visible" />
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns.userName.visible" :show-overflow-tooltip="true" />
......@@ -96,12 +94,12 @@
</template>
</el-table-column>
</el-table>
</div>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
</el-col>
</pane>
</splitpanes>
</el-row>
</div>
</div>
</div>
<!-- 添加或修改用户配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
......@@ -420,10 +418,10 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.resetForm("queryForm")
this.queryParams.deptId = undefined
this.$refs.tree.setCurrentKey(null)
this.queryParams.userName = ''
this.queryParams.phonenumber = ''
this.queryParams.status = ''
this.queryParams.pageNum = 1
this.handleQuery()
},
// 多选框选中数据
......@@ -564,4 +562,13 @@ export default {
}
}
}
</script>
\ No newline at end of file
</script>
<style lang="scss" scoped>
.right-card {
margin-left: var(--container-pd);
}
.left-card {
padding: var(--container-pd);
}
</style>
\ No newline at end of file
......@@ -47,7 +47,17 @@ public class InventoryController extends BaseController
List<Inventory> list = inventoryService.selectInventoryList(inventory);
return getDataTable(list);
}
/**
* 查询库存列表
*/
@PreAuthorize("@ss.hasPermi('inventory:inventory:list')")
@GetMapping("/listByMaterialId")
public TableDataInfo listByMaterialId(String materialId)
{
startPage();
List<Inventory> list = inventoryService.listByMatreialId(materialId);
return getDataTable(list);
}
/**
* 导出库存列表
*/
......
......@@ -17,7 +17,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.inventory.domain.OutboundOrderItems;
import com.ruoyi.inventory.domain.OutboundOrderItemsInventory;
import com.ruoyi.inventory.service.IOutboundOrderItemsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
......@@ -43,7 +43,7 @@ public class OutboundOrderItemsController extends BaseController
public TableDataInfo list(OutboundOrderItems outboundOrderItems)
{
startPage();
List<OutboundOrderItemsInventory> list = outboundOrderItemsService.selectOutboundOrderItemsList(outboundOrderItems);
List<OutboundOrderItems> list = outboundOrderItemsService.selectOutboundOrderItemsList(outboundOrderItems);
return getDataTable(list);
}
......@@ -55,8 +55,8 @@ public class OutboundOrderItemsController extends BaseController
@PostMapping("/export")
public void export(HttpServletResponse response, OutboundOrderItems outboundOrderItems)
{
List<OutboundOrderItemsInventory> list = outboundOrderItemsService.selectOutboundOrderItemsList(outboundOrderItems);
ExcelUtil<OutboundOrderItemsInventory> util = new ExcelUtil<OutboundOrderItemsInventory>(OutboundOrderItemsInventory.class);
List<OutboundOrderItems> list = outboundOrderItemsService.selectOutboundOrderItemsList(outboundOrderItems);
ExcelUtil<OutboundOrderItems> util = new ExcelUtil<OutboundOrderItems>(OutboundOrderItems.class);
util.exportExcel(response, list, "出库单明细数据");
}
......
package com.ruoyi.inventory.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 出库单明细库存DTO对象 outbound_order_items_inventory
*
* @author ruoyi
* @date 2025-12-03
*/
public class OutboundOrderItemsInventory
{
private static final long serialVersionUID = 1L;
/** 出库单明细 */
private OutboundOrderItems outboundOrderItems;
/** 库存信息 */
private Inventory inventory;
public OutboundOrderItems getOutboundOrderItems()
{
return outboundOrderItems;
}
public void setOutboundOrderItems(OutboundOrderItems outboundOrderItems)
{
this.outboundOrderItems = outboundOrderItems;
}
public Inventory getInventory()
{
return inventory;
}
public void setInventory(Inventory inventory)
{
this.inventory = inventory;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("outboundOrderItems", getOutboundOrderItems())
.append("inventory", getInventory())
.toString();
}
}
\ No newline at end of file
......@@ -19,7 +19,7 @@ public class OutboundOrderLog extends BaseEntity
private String id;
/** 货物ID */
@Excel(name = "货物ID")
@Excel(name = "出货单号ID")
private String orderId;
/** 货物ID */
......
package com.ruoyi.inventory.mapper;
import java.util.List;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.inventory.domain.Inventory;
/**
......@@ -65,4 +67,6 @@ public interface InventoryMapper
* @return 结果
*/
public int deleteInventoryByIds(String[] ids);
public List<Inventory> listByMatreialId(String materialId);
}
......@@ -19,6 +19,13 @@ public interface MaterialsCategoryMapper
*/
public MaterialsCategory selectMaterialsCategoryById(String id);
/**
* 查询物料分类
*
* @param id 物料分类主键
* @return 物料分类
*/
public MaterialsCategory selectMaterialsCategoryByMaterialsCode(String id);
/**
* 查询物料分类列表
*
* @param materialsCategory 物料分类
......
......@@ -23,6 +23,14 @@ public interface MaterialsMapper
public Materials selectMaterialsById(String id);
/**
* 查询物料
*
* @param id 物料主键
* @return 物料
*/
public Materials selectMaterialsByMaterialsCode(String id);
/**
* 查询物料列表
*
* @param materials 物料
......
package com.ruoyi.inventory.service;
import java.util.List;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.inventory.domain.Inventory;
/**
......@@ -67,4 +69,6 @@ public interface IInventoryService
* @return 结果
*/
public int deleteInventoryById(String id);
public List<Inventory> listByMatreialId(String materialId);
}
......@@ -2,7 +2,7 @@ package com.ruoyi.inventory.service;
import java.util.List;
import com.ruoyi.inventory.domain.OutboundOrderItems;
import com.ruoyi.inventory.domain.OutboundOrderItemsInventory;
import com.ruoyi.inventory.domain.OutboundOrderItems;
/**
* 出库单明细Service接口
......@@ -10,7 +10,7 @@ import com.ruoyi.inventory.domain.OutboundOrderItemsInventory;
* @author ruoyi
* @date 2025-12-03
*/
public interface IOutboundOrderItemsService
public interface IOutboundOrderItemsService
{
/**
* 查询出库单明细
......@@ -18,7 +18,7 @@ public interface IOutboundOrderItemsService
* @param id 出库单明细主键
* @return 出库单明细
*/
public OutboundOrderItemsInventory selectOutboundOrderItemsById(String id);
public OutboundOrderItems selectOutboundOrderItemsById(String id);
/**
* 查询出库单明细列表
......@@ -26,7 +26,7 @@ public interface IOutboundOrderItemsService
* @param outboundOrderItems 出库单明细
* @return 出库单明细集合
*/
public List<OutboundOrderItemsInventory> selectOutboundOrderItemsList(OutboundOrderItems outboundOrderItems);
public List<OutboundOrderItems> selectOutboundOrderItemsList(OutboundOrderItems outboundOrderItems);
/**
* 新增出库单明细
......
......@@ -35,6 +35,8 @@ public interface IOutboundOrderLogService
*/
public int insertOutboundOrderLog(OutboundOrderLog outboundOrderLog);
Long selectLockedQuantity(OutboundOrderLog outboundOrderLog);
/**
* 修改出库明细子(仅用于锁定数量统计)
*
......
......@@ -27,7 +27,6 @@ public class InboundOrderItemsServiceImpl implements IInboundOrderItemsService
{
@Autowired
private InboundOrderItemsMapper inboundOrderItemsMapper;
/**
* 查询入库单明细
*
......@@ -67,6 +66,7 @@ public class InboundOrderItemsServiceImpl implements IInboundOrderItemsService
public int insertInboundOrderItems(InboundOrderItems inboundOrderItems)
{
inboundOrderItems.setCreateTime(DateUtils.getNowDate());
return inboundOrderItemsMapper.insertInboundOrderItems(inboundOrderItems);
}
......
......@@ -98,6 +98,8 @@ public class InventoryServiceImpl implements IInventoryService
return inventoryMapper.updateInventory(inventory);
}
/**
* 批量删除库存
*
......@@ -121,4 +123,9 @@ public class InventoryServiceImpl implements IInventoryService
{
return inventoryMapper.deleteInventoryById(id);
}
@Override
public List<Inventory> listByMatreialId(String materialId) {
return inventoryMapper.listByMatreialId(materialId);
}
}
......@@ -4,7 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.inventory.domain.Inventory;
import com.ruoyi.inventory.domain.OutboundOrderItemsInventory;
import com.ruoyi.inventory.domain.OutboundOrderLog;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -26,6 +26,9 @@ public class OutboundOrderItemsServiceImpl implements IOutboundOrderItemsService
@Autowired
private InventoryServiceImpl inventoryService;
@Autowired
private OutboundOrderLogServiceImpl outboundOrderLogService;
/**
* 查询出库单明细
*
......@@ -33,16 +36,9 @@ public class OutboundOrderItemsServiceImpl implements IOutboundOrderItemsService
* @return 出库单明细
*/
@Override
public OutboundOrderItemsInventory selectOutboundOrderItemsById(String id)
public OutboundOrderItems selectOutboundOrderItemsById(String id)
{
OutboundOrderItems outboundOrderItems = outboundOrderItemsMapper.selectOutboundOrderItemsById(id);
Inventory inventory = new Inventory();
BeanUtils.copyProperties(outboundOrderItems, inventory);
Inventory inventory1 = inventoryService.selectInventory(inventory);
OutboundOrderItemsInventory outboundOrderItemsInventory = new OutboundOrderItemsInventory();
outboundOrderItemsInventory.setOutboundOrderItems(outboundOrderItems);
outboundOrderItemsInventory.setInventory(inventory1);
return outboundOrderItemsInventory;
return outboundOrderItemsMapper.selectOutboundOrderItemsById(id);
}
/**
......@@ -52,26 +48,15 @@ public class OutboundOrderItemsServiceImpl implements IOutboundOrderItemsService
* @return 出库单明细
*/
@Override
public List<OutboundOrderItemsInventory> selectOutboundOrderItemsList(OutboundOrderItems outboundOrderItems)
public List<OutboundOrderItems> selectOutboundOrderItemsList(OutboundOrderItems outboundOrderItems)
{
List<OutboundOrderItems> itemsList = outboundOrderItemsMapper.selectOutboundOrderItemsList(outboundOrderItems);
List<OutboundOrderItemsInventory> resultList = new ArrayList<>();
for (OutboundOrderItems item : itemsList) {
Inventory inventory = new Inventory();
BeanUtils.copyProperties(item, inventory);
Inventory inventory1 = inventoryService.selectInventory(inventory);
OutboundOrderItemsInventory outboundOrderItemsInventory = new OutboundOrderItemsInventory();
outboundOrderItemsInventory.setOutboundOrderItems(item);
outboundOrderItemsInventory.setInventory(inventory1);
resultList.add(outboundOrderItemsInventory);
}
return resultList;
return outboundOrderItemsMapper.selectOutboundOrderItemsList(outboundOrderItems);
}
/**
* 新增出库单明细
*
* @param outboundOrderItems 出库单明细
* @param outboundOrderItemsInventory 出库单明细库存DTO
* @return 结果
*/
@Override
......@@ -84,7 +69,7 @@ public class OutboundOrderItemsServiceImpl implements IOutboundOrderItemsService
/**
* 修改出库单明细
*
* @param outboundOrderItems 出库单明细
* @param outboundOrderItemsInventory 出库单明细库存DTO
* @return 结果
*/
@Override
......
......@@ -54,7 +54,10 @@ public class OutboundOrderLogServiceImpl implements IOutboundOrderLogService
{
return outboundOrderLogMapper.insertOutboundOrderLog(outboundOrderLog);
}
@Override
public Long selectLockedQuantity(OutboundOrderLog outboundOrderLog){
return outboundOrderLogMapper.selectLockedQuantity(outboundOrderLog);
}
/**
* 修改出库明细子(仅用于锁定数量统计)
*
......
......@@ -120,15 +120,13 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
String id = outboundOrders.getId();
if (StringUtils.isNotNull(outboundOrderItemsList))
{
List<OutboundOrderItems> list = new ArrayList<OutboundOrderItems>();
for (OutboundOrderItems outboundOrderItems : outboundOrderItemsList)
{
outboundOrderItems.setOrderId(id);
list.add(outboundOrderItems);
}
if (list.size() > 0)
if (outboundOrderItemsList.size() > 0)
{
outboundOrdersMapper.batchOutboundOrderItems(list);
outboundOrdersMapper.batchOutboundOrderItems(outboundOrderItemsList);
}
}
}
......
......@@ -2,6 +2,7 @@ package com.ruoyi.inventory.service.impl;
import java.util.List;
import com.ruoyi.common.core.domain.entity.Materials;
import com.ruoyi.common.core.domain.entity.MaterialsCategory;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
......@@ -9,6 +10,7 @@ import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.uuid.UUID;
import com.ruoyi.inventory.domain.StorageLocationsCategory;
import com.ruoyi.inventory.mapper.MaterialsCategoryMapper;
import com.ruoyi.inventory.mapper.MaterialsMapper;
import com.ruoyi.inventory.mapper.StorageLocationsCategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -30,7 +32,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
@Autowired
private StorageLocationsCategoryMapper storageLocationsCategoryMapper;
@Autowired
private MaterialsCategoryMapper materialsCategoryMapper;
private MaterialsMapper materialsMapper;
/**
* 查询库位
......@@ -69,9 +71,10 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
if (storageLocations2.getAllowedCategoryIds() != null && !storageLocations2.getAllowedCategoryIds().isEmpty()){
String[] AllowedCategoryIds = storageLocations2.getAllowedCategoryIds().split(",");
for (String AllowedCategoryId : AllowedCategoryIds) {
MaterialsCategory materialsCategory = materialsCategoryMapper.selectMaterialsCategoryById(AllowedCategoryId);
if (materialsCategory != null && materialsCategory.getCategoryName() != null) {
String categoryName = materialsCategory.getCategoryName().trim(); // 去除首尾空格
Materials materials = materialsMapper.selectMaterialsByMaterialsCode(AllowedCategoryId);
if (materials != null && materials.getMaterialName() != null) {
String categoryName = materials.getMaterialName().trim(); // 去除首尾空格
if (AllowedCategoryName != "") {
AllowedCategoryName += ",";
}
......@@ -110,8 +113,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocationsCategory.setCategoryId(categoryId);
storageLocationsCategory.setCreateTime(DateUtils.getNowDate());
storageLocationsCategory.setCreateUserCode(String.valueOf(SecurityUtils.getUserId()));
MaterialsCategory materialsCategory = materialsCategoryMapper.selectMaterialsCategoryById(categoryId);
storageLocationsCategory.setCategoryName(materialsCategory.getCategoryName());
Materials materials = materialsMapper.selectMaterialsByMaterialsCode(categoryId);
storageLocationsCategory.setCategoryName(materials.getMaterialName());
storageLocationsCategoryMapper.insertStorageLocationsCategory(storageLocationsCategory);
}
}
......@@ -146,8 +149,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocationsCategory.setCategoryId(categoryId);
storageLocationsCategory.setUpdateTime(DateUtils.getNowDate());
storageLocationsCategory.setUpdateUserCode(String.valueOf(SecurityUtils.getUserId()));
MaterialsCategory materialsCategory = materialsCategoryMapper.selectMaterialsCategoryById(categoryId);
storageLocationsCategory.setCategoryName(materialsCategory.getCategoryName());
Materials materials = materialsMapper.selectMaterialsByMaterialsCode(categoryId);
storageLocationsCategory.setCategoryName(materials.getMaterialName());
storageLocationsCategoryMapper.insertStorageLocationsCategory(storageLocationsCategory);
}
}
......
......@@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectInboundOrdersList" parameterType="InboundOrders" resultMap="InboundOrdersResult">
<include refid="selectInboundOrdersVo"/>
<where>
<if test="id != null and id != ''"> and id = #{id}</if>
<if test="id != null and Id != ''"> and id = #{Id}</if>
<if test="systemNo != null and systemNo != ''"> and system_no = #{systemNo}</if>
<if test="orderTypeId != null and orderTypeId != ''"> and order_type_id = #{orderTypeId}</if>
<if test="batchId != null and batchId != ''"> and batch_id = #{batchId}</if>
......
......@@ -90,7 +90,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectInventoryVo"/>
where id = #{id}
</select>
<select id="listByMatreialId" parameterType="String" resultMap="InventoryResult">
<include refid="selectInventoryVo"/>
where material_id = #{materialId}
</select>
<insert id="insertInventory" parameterType="Inventory">
insert into inventory
<trim prefix="(" suffix=")" suffixOverrides=",">
......
......@@ -40,7 +40,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
order by sort_no asc
</select>
<insert id="insertMaterialsCategory" parameterType="MaterialsCategory">
insert into materials_category
<trim prefix="(" suffix=")" suffixOverrides=",">
......
......@@ -76,6 +76,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
order by sort_no asc
</select>
<select id="selectMaterialsByMaterialsCode" parameterType="String" resultMap="MaterialsResult">
<include refid="selectMaterialsVo"/>
where material_code = #{id}
order by sort_no asc
</select>
<select id="selectMaterialsByCategory" parameterType="String" resultMap="MaterialsResult">
<include refid="selectMaterialsVo"/>
where category_code = #{id}
......
......@@ -37,13 +37,9 @@
select ifnull(sum(actual_quantity), 0)
from outbound_order_log
<where>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="materialId != null and materialId != ''"> and material_id = #{materialId}</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
<if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
<if test="actualQuantity != null "> and actual_quantity = #{actualQuantity}</if>
<if test="itemStatus != null "> and item_status = #{itemStatus}</if>
<if test="isUsed != null "> and is_used = #{isUsed}</if>
</where>
</select>
......
......@@ -91,8 +91,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectOutboundOrderItemsList" parameterType="String" resultMap="OutboundOrderItemsResult">
select id, order_id, material_id, batch_id, warehouse_id, location_id, planned_quantity, actual_quantity, planned_packages, actual_packages, divisor, label_color, voucher_number, unit_price, item_status, received_at, received_by, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code
from outbound_order_items
select id, order_id, material_id, batch_code, warehouse_id, location_id, planned_quantity, actual_quantity, divisor, label_color, voucher_number, item_status, shipped_at, shipped_by, remark, is_used, sort_no, create_time, create_user_code, update_time, update_user_code
from outbound_order_items
where order_id = #{id}
</select>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论