Commit 8699b5ea by wangyalan-git

用户管理,文档管理模块,首页

parent b69dc7ab
......@@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="static/favicon.ico" />
<title>万科物资管理平</title>
<title>万科文档库平台管理后</title>
<style>
html,
body,
......@@ -245,7 +245,7 @@
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
<div class="load_title">
正在加载 万科物资管理平台 请耐心等待
正在加载 万科文档库平台管理后台 请耐心等待
</div>
</div>
</div>
......
// 首页
import request from '@/utils/request'
// 万科后台_获取首页统计今日数据
export function getHomeData (params) {
return request({
url: 'vankeStatisticalChart/getHomeData',
method: 'post',
params: params
})
}
// 万科后台_获取首页入库物品类别分布
export function selectInBoundByCategory(data) {
return request({
url: 'vankeStatisticalChart/selectInBoundByCategory',
method: 'post',
data
})
}
// 万科后台_获取首页领取物品类别分布
export function selectOutBoundByCategory(data) {
return request({
url: 'vankeStatisticalChart/selectOutBoundByCategory',
method: 'post',
data
})
}
// 万科后台_获取首页申领人部门分布
export function selectOutBoundByDepartId(data) {
return request({
url: 'vankeStatisticalChart/selectOutBoundByDepartId',
method: 'post',
data
})
}
// 万科后台_获取首页统计出库值和入库值的变化曲线图
export function selectStockByGoodsIdAndTime(data) {
return request({
url: 'vankeStatisticalChart/selectStockByGoodsIdAndTime',
method: 'post',
data
})
}
......@@ -35,130 +35,23 @@ export const constantRouterMap = [
}]
export const asyncRouterMap = [
// 库存模块
// 文档
{
path: '/inv',
path: '/doc',
component: Layout,
redirect: '/inv/stockAdmin',
name: 'inv',
meta: { title: '库存管理', icon: 'sms-subject' },
redirect: '/doc/docList',
name: 'doc',
meta: { title: '文档管理', icon: 'sms-subject' },
children: [{
path: 'stockAdmin',
name: 'stockAdmin',
component: () => import('@/views/inv/stockAdmin'),
meta: { title: '入库管理', icon: 'product-list' },
},
{
path: 'warehouseAdmin',
name: 'warehouseAdmin',
component: () => import('@/views/inv/warehouseAdmin'),
meta: { title: '出库管理', icon: 'product-list' },
},
{
path: 'storeList',
name: 'storeList',
component: () => import('@/views/inv/StoreList'),
meta: { title: '库存清单', icon: 'product-cate' }
},
{
path: 'goodsCategory',
name: 'goodsCategory',
component: () => import('@/views/inv/GoodsCateogory'),
meta: { title: '物品类别', icon: 'product-cate' }
}, {
path: 'depotAdmin',
name: 'depotAdmin',
component: () => import('@/views/inv/DepotAdmin'),
meta: { title: '库房管理', icon: 'product-cate' }
}]
},
// 供应商模块
{
path: '/ssm',
component: Layout,
redirect: '/ssm/supplierShopList',
name: 'ssm',
meta: { title: '供应商', icon: 'sms-subject' },
children: [{
path: 'supplierList',
name: 'supplierList',
component: () => import('@/views/ssm/SupplierList'),
meta: { title: '供应商列表', icon: 'product-list' },
}]
},
// 报表管理
{
path: '/sta',
component: Layout,
redirect: '/sta/inventoryChart',
name: 'sta',
meta: { title: '报表管理', icon: 'sms-subject' },
children: [{
path: 'inventoryChart',
name: 'inventoryChart',
component: () => import('@/views/sta/InventoryChart'),
meta: { title: '库存情况', icon: 'product-list' },
},
{
path: 'recipients',
name: 'recipients',
component: () => import('@/views/sta/Recipients'),
meta: { title: '领用情况', icon: 'product-list' },
}]
},
// 部门管理
{
path: '/dep',
component: Layout,
redirect: '/dep/departmentList',
name: 'dep',
meta: { title: '部门管理', icon: 'sms-subject' },
children: [{
path: 'departmentList',
name: 'departmentList',
component: () => import('@/views/dep/DepartmentList'),
meta: { title: '部门列表', icon: 'product-list' }
}]
},
// 管理员
{
path: '/use',
component: Layout,
redirect: '/use/adminList',
name: 'use',
meta: { title: '用户管理', icon: 'product-list' },
children: [{
path: 'adminList',
name: 'adminList',
component: () => import('@/views/use/AdminList'),
meta: { title: '管理员列表', icon: 'product-list' },
},
{
path: 'userList',
name: 'userList',
component: () => import('@/views/use/UserList'),
meta: { title: '用户列表', icon: 'product-cate' }
}]
},
{
path: '/set',
component: Layout,
redirect: '/set/log',
name: 'set',
meta: { title: '系统设置', icon: 'product-list' },
children: [
{
path: 'log',
name: 'log',
component: () => import('@/views/set/log'),
meta: { title: '操作日志', icon: 'ums-role' },
hidden: false
},
{
path: 'setting',
name: 'setting',
component: () => import('@/views/set/setting'),
meta: { title: '配置管理', icon: 'product-list' },
path: 'docList',
name: 'docList',
component: () => import('@/views/doc/DocList'),
meta: { title: '文档列表', icon: 'product-list' }
},{
path: 'docType',
name: 'docType',
component: () => import('@/views/doc/DocType'),
meta: { title: '文档类型', icon: 'product-list' }
}]
},
// 权限模块
......@@ -169,12 +62,12 @@ export const asyncRouterMap = [
name: 'ums',
meta: { title: '权限', icon: 'ums' },
children: [
// {
// path: 'admin',
// name: 'admin',
// component: () => import('@/views/ums/admin/index'),
// meta: { title: '用户列表', icon: 'ums-admin' }
// },
{
path: 'admin',
name: 'admin',
component: () => import('@/views/ums/admin/index'),
meta: { title: '用户列表', icon: 'ums-admin' }
},
{
path: 'role',
name: 'role',
......
......@@ -6,10 +6,10 @@
<el-form :inline="true"
:model="listQuery"
size="small">
<el-form-item label="物品名称:">
<el-input v-model="listQuery.goodsMame"
<el-form-item label="文档名称:">
<el-input v-model="listQuery.name"
class="input-width"
placeholder="请输入物品名称"></el-input>
placeholder="请输入文档名称"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary"
......@@ -27,6 +27,9 @@
<!-- 表格栏 -->
<el-card class="filter-container mt15"
shadow="never">
<el-row type="flex" class="btn-groups" >
<el-button type="primary" @click="handleImport">上传</el-button>
</el-row>
<div class="table-container">
<el-table :data="list"
v-loading="listLoading"
......@@ -35,39 +38,32 @@
<el-table-column type="selection"
align="center"
width="50"></el-table-column>
<el-table-column label="物品名称"
<el-table-column label="文档名称"
align="center">
<template slot-scope="scope">{{scope.row.goodsName}}</template>
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column label="总数量"
<el-table-column label="文档类型"
align="center">
<template slot-scope="scope">{{scope.row.inboundNum}}</template>
<template slot-scope="scope">{{scope.row.goodsNo}}</template>
</el-table-column>
<el-table-column label="入库人"
<el-table-column label="创建者"
align="center">
<template slot-scope="scope">{{$store.getters.type == 1? scope.row.backInboundName : scope.row.receptInboundName}}
</template>
</el-table-column>
<el-table-column label="入库日期"
align="center">
<template slot-scope="scope">{{scope.row.createtime | formatTime}}</template>
<template slot-scope="scope">{{scope.row.goodsCategoryName}}</template>
</el-table-column>
<el-table-column label="所属库房"
<el-table-column label="发布时间"
align="center">
<template slot-scope="scope">{{scope.row.stockRoomName || '--'}}</template>
<template slot-scope="scope">{{scope.row.createTime | formatTime}}</template>
</el-table-column>
<el-table-column label="操作"
width="220"
align="center">
<template slot-scope="scope">
<el-button size="mini"
type="success"
@click="handleView(scope.row)">查看详情
type="primary"
@click="handleDown(scope.row.id)">下载
</el-button>
<el-button size="mini"
type="primary"
@click="exportEntry(scope.row.id)">生成入库单
type="danger"
@click="handleDelete(scope.row.id)">删除
</el-button>
</template>
</el-table-column>
......@@ -86,34 +82,37 @@
</el-pagination>
</div>
</el-card>
<!-- end -->
<!-- 弹窗 -->
<inventory-details-modal ref="detail"
@ok="getList"></inventory-details-modal>
<!-- end -->
<!-- 弹窗-->
<import-goods-modal ref="importGoods" @ok="getList"></import-goods-modal>
</div>
</template>
<script>
import moment from 'moment'
import { getInboundRecordList } from '@/api/inventory'
import inventoryDetailsModal from './modules/inventoryDetailsModal'
import moment from 'moment/moment'
import { getGoodsList, getGoodsCategoryList, getStockRooms, editGoods } from '@/api/inventory'
import { getSuppliersList } from '@/api/supplier'
import ImportGoodsModal from './modules/importGoodsModal'
// 列表查询参数默认值
const defaultListQuery = {
pageNum: 1,
pageSize: 10,
goodsMame: ''
name: '',
goodsCategoryId: '',
supplierId: '',
stockRoomId: ''
}
export default {
name: 'StockAdmin',
components: { inventoryDetailsModal },
name: 'DocList',
components: {
ImportGoodsModal
},
data() {
return {
listQuery: Object.assign({}, defaultListQuery),
list: [],
total: 0,
listLoading: false,
multipleSelection: [],
multipleSelection: []
}
},
created() {
......@@ -153,10 +152,7 @@ export default {
this.listLoading = true
//请求数据
console.log('listQuery', this.listQuery)
if(this.$store.getters.type == 2){
this.listQuery.stockRoomId = this.$store.getters.stockRoomId
}
getInboundRecordList(this.listQuery).then(res => {
getGoodsList(this.listQuery).then(res => {
this.listLoading = false
this.list = res.data.list
this.total = res.data.total
......@@ -164,10 +160,30 @@ export default {
this.listLoading = false
})
},
// 查看
handleView(id) {
this.$refs.detail.init()
}
// 新增
handleAdd() {
this.$refs.addGoods.add()
},
// 导入
handleImport() {
this.$refs.importGoods.add()
},
handleDown(){
},
// 删除
handleDelete(id){
this.$confirm('是否删除该物品?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
editGoods({id: id,deleteStatus: 0 }).then(res=>{
this.getList()
})
}).catch(() => {
});
},
}
}
</script>
......@@ -186,4 +202,8 @@ export default {
.input-width {
width: 180px;
}
.btn-groups button {
width: 100px;
}
</style>
......@@ -14,7 +14,7 @@
<el-table-column type="selection"
align="center"
width="50"></el-table-column>
<el-table-column label="物品类别"
<el-table-column label="文档类型"
align="center">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
......@@ -46,13 +46,13 @@
</div>
</el-card>
<!-- 弹窗-->
<add-category ref="addCategory" @ok="getList"></add-category>
<add-type ref="addCategory" @ok="getList"></add-type>
</div>
</template>
<script>
import moment from 'moment'
import { getGoodsCategoryList, editGoodsCategory } from '@/api/inventory'
import AddCategory from './modules/addCategory'
import AddType from './modules/addType'
// 列表查询参数默认值
const defaultListQuery = {
pageNum: 1,
......@@ -60,8 +60,8 @@ const defaultListQuery = {
}
export default {
name: 'goodsCategory',
components: {AddCategory},
name: 'docType',
components: {AddType},
data() {
return {
listQuery: Object.assign({}, defaultListQuery),
......@@ -122,7 +122,7 @@ export default {
},
// 删除
handleDelete(id){
this.$confirm('是否删除该物品类别?', '提示', {
this.$confirm('是否删除该文档类型?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
......
......@@ -8,12 +8,12 @@
ref="attributeForm"
v-loading="loading"
label-width="150px">
<el-form-item label="物品类别:"
:rules="[{required: true, trigger: 'blur', message: '请输入物品类别名称'}]"
<el-form-item label="文档类型:"
:rules="[{required: true, trigger: 'blur', message: '请输入文档类型名称'}]"
prop="name">
<el-input size="small"
class="input-width"
placeholder="请输入物品类别名称"
placeholder="请输入文档类型名称"
v-model="model.name"></el-input>
</el-form-item>
</el-form>
......@@ -29,7 +29,7 @@
import { addGoodsCategory } from '@/api/inventory'
// 移动属性
export default {
name: 'addCategory',
name: 'addType',
data () {
return {
visible: false,
......@@ -50,7 +50,7 @@ export default {
},
add(){
this.id = null
this.title="新增物品类别"
this.title="新增文档类型"
this.init()
this.visible= true
},
......
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="500px"
:close-on-click-modal="false">
<div class="scroll-container no-bottom"
ref="scrollContainer">
<el-form :model="modal" ref="modal" label-width="100px">
<el-form-item prop="name"
label="文档名称"
:rules="[{required: true,trigger: 'blur',message: '文档名称不能为空'}]">
<el-input v-model="modal.name" class="input-width"
placeholder="请输入文档名称"></el-input>
</el-form-item>
<el-form-item prop="type"
label="文档类型"
:rules="[{required: true,trigger: 'blur',message: '请选择文档类型'}]">
<el-select v-model="modal.type" class="input-width"
placeholder="请选择文档类型">
<el-option v-for="item in categoryOptions"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="doc"
label="文档"
:rules="[{required: true,trigger: 'blur',message: '请选择文档类型'}]">
<el-upload
class="upload-demo"
:action="actionURL"
:limit="1"
:on-success="afterSuccess"
name='file'>
<el-button size="small" type="primary">选择文档</el-button>
<div slot="tip" class="el-upload__tip">只能上传不超过20MB的文件</div>
</el-upload>
</el-form-item>
</el-form>
</div>
<div slot="footer">
<el-button type="primary"
@click="submit('modal')">确认
</el-button>
<el-button
@click="close">返回
</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
import { getGoodsCategoryList, addGoodList, getStockRooms, getGoodsList } from '@/api/inventory'
import XLSX from 'xlsx'
// 添加编辑属性
export default {
name: 'importGoodsModal',
data() {
return {
actionURL:'',
files: null, //文件列表
visible: false,
title: null,
loading: false,
modal: {},
categoryOptions:[]
}
},
methods: {
// 物品类别
getGoodsCategoryList() {
getGoodsCategoryList().then(res => {
this.categoryOptions = res.data.list
})
},
init() {
this.modal={
name: '',
type: '',
doc: ''
}
this.getGoodsCategoryList()
this.$nextTick(() => {
this.$refs.scrollContainer.scrollTop = 0
})
},
add() {
this.init()
this.title = '上传文件'
this.visible = true
},
close() {
this.visible = false
},
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
addGoodList({ vankeGoodsList: this.modal.tableData }).then(res => {
this.$emit('ok')
this.visible = false
})
} else {
this.$message.warning('请检查必填项是否输入')
}
})
},
afterSuccess(response,file,fileList) {
console.log(response) //返回的是上传之后后台返回的结果
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
.input-width {
width: 300px;
}
.el-upload__tip {
color: #999;
font-size: 10px;
line-height: 23px;
}
</style>
<template> 
<div class="app-container">
<!-- 表格栏 -->
<el-card class="filter-container mt15"
shadow="never">
<el-row type="flex" class="btn-groups">
<el-button type="primary" size="medium" @click="handleAdd">新增</el-button>
</el-row>
<div class="table-container">
<el-table :data="list"
v-loading="listLoading"
@selection-change="handleSelectionChange"
border>
<el-table-column type="selection"
align="center"
width="50"></el-table-column>
<el-table-column label="库房名称"
align="center">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column label="管理员"
align="center">
<template slot-scope="scope">{{scope.row.username}}</template>
</el-table-column>
<el-table-column label="创建时间"
align="center">
<template slot-scope="scope">{{scope.row.createtime | formatTime}}</template>
</el-table-column>
<el-table-column label="操作"
align="center">
<template slot-scope="scope">
<el-button size="mini"
type="danger"
@click="handleDelete(scope.row.id)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 分页栏 -->
<div class="pagination-container">
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[10,30,50]"
:total="total">
</el-pagination>
</div>
</el-card>
<!-- 弹窗-->
<add-depot ref="addDepot" @ok="getList"></add-depot>
</div>
</template>
<script>
import moment from 'moment'
import { getStockRooms, editDepartment } from '@/api/inventory'
import AddDepot from './modules/addDepot'
// 列表查询参数默认值
const defaultListQuery = {
pageNum: 1,
pageSize: 10
}
export default {
name: 'DepotAdmin',
components: { AddDepot },
data() {
return {
listQuery: Object.assign({}, defaultListQuery),
list: [],
total: 0,
listLoading: false,
multipleSelection: [],
}
},
created() {
this.getList()
},
filters: {
formatTime(time) {
if (!time) {
return '--'
}
return moment(time).format('YYYY-MM-DD HH:mm:ss')
}
},
methods: {
handleResetSearch() {
this.listQuery = Object.assign({}, defaultListQuery)
this.getList()
},
handleSearchList() {
this.listQuery.pageNum = 1
this.getList()
},
handleSizeChange(val) {
this.listQuery.pageNum = 1
this.listQuery.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.pageNum = val
this.getList()
},
handleSelectionChange(vals) {
this.multipleSelection = vals
},
//请求数据
getList() {
this.listLoading = true
//请求数据
console.log('listQuery', this.listQuery)
getStockRooms(this.listQuery).then(res => {
this.listLoading = false
this.list = res.data.list
this.total = res.data.total
}).catch(err => {
this.listLoading = false
})
},
// 添加
handleAdd() {
this.$refs.addDepot.add()
},
// 删除
handleDelete(id){
this.$confirm('是否删除该库房?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
editDepartment({id: id,deleteStatus: 0 }).then(res=>{
this.getList()
})
}).catch(() => {
});
}
}
}
</script>
<style scoped>
.app-container {
font-size: 14px;
color: #606266;
padding: 0 15px;
margin-top: 0;
}
.mt15 {
margin-top: 15px;
}
.input-width {
width: 180px;
}
.btn-groups button {
width: 100px;
}
</style>
<template> 
<div class="app-container">
<!-- 搜索栏 -->
<el-card class="filter-container"
shadow="never">
<el-form :inline="true"
:model="listQuery"
size="small">
<el-form-item label="物品名称:">
<el-input v-model="listQuery.name"
class="input-width"
placeholder="请输入物品名称"></el-input>
</el-form-item>
<el-form-item label="物品类别:">
<el-select v-model="listQuery.goodsCategoryId"
class="input-width"
clearable
placeholder="请选择物品类别">
<el-option v-for="item in categoryOptions"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="供应商:">
<el-select v-model="listQuery.supplierId"
class="input-width"
clearable
placeholder="请选择供应商">
<el-option v-for="item in supplierOptions"
:key="item.id"
:label="item.supplierName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<!-- 超级管理员可见-->
<el-form-item label="库房:"
v-if="$store.getters.type == 1">
<el-select v-model="listQuery.stockRoomId"
class="input-width"
clearable
placeholder="请选择库房">
<el-option v-for="item in depotOptions"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="handleSearchList"
icon="el-icon-search"
size="small">搜索
</el-button>
<el-button @click="handleResetSearch"
icon="el-icon-refresh"
size="small">重置
</el-button>
</el-form-item>
</el-form>
</el-card>
<!-- 表格栏 -->
<el-card class="filter-container mt15"
shadow="never">
<el-row type="flex" class="btn-groups" justify="end">
<el-button type="primary" @click="handleAdd">新增</el-button>
<el-button type="success" @click="handleAdd">扫码入库</el-button>
<el-button type="info" @click="handleAdd">扫码出库</el-button>
<el-button type="warning" @click="handleImport">导入</el-button>
</el-row>
<div class="table-container">
<el-table :data="list"
v-loading="listLoading"
@selection-change="handleSelectionChange"
border>
<el-table-column type="selection"
align="center"
width="50"></el-table-column>
<el-table-column label="物品名称"
align="center">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column label="型号"
align="center">
<template slot-scope="scope">{{scope.row.goodsNo}}</template>
</el-table-column>
<el-table-column label="物品类别"
align="center">
<template slot-scope="scope">{{scope.row.goodsCategoryName}}</template>
</el-table-column>
<el-table-column label="数量"
align="center">
<template slot-scope="scope">{{scope.row.goodsNum}}</template>
</el-table-column>
<el-table-column label="价格"
align="center">
<template slot-scope="scope">{{scope.row.prict || 0}}</template>
</el-table-column>
<el-table-column label="供应商"
align="center">
<template slot-scope="scope">{{scope.row.supplierName || '--'}}</template>
</el-table-column>
<el-table-column label="所属库房"
align="center">
<template slot-scope="scope">{{scope.row.stockRoomName || '--'}}</template>
</el-table-column>
<!-- <el-table-column label="操作"-->
<!-- align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button size="mini"-->
<!-- type="danger"-->
<!-- @click="handleDelete(scope.row.id)">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
<!-- 分页栏 -->
<div class="pagination-container">
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[10,30,50]"
:total="total">
</el-pagination>
</div>
</el-card>
<!-- 弹窗-->
<add-goods-modal ref="addGoods" @ok="getList"></add-goods-modal>
<import-goods-modal ref="importGoods" @ok="getList"></import-goods-modal>
</div>
</template>
<script>
import moment from 'moment'
import { getGoodsList,getGoodsCategoryList,getStockRooms, editGoods } from '@/api/inventory'
import {getSuppliersList} from '@/api/supplier'
import AddGoodsModal from './modules/addGoodsModal'
import ImportGoodsModal from './modules/importGoodsModal'
// 列表查询参数默认值
const defaultListQuery = {
pageNum: 1,
pageSize: 10,
name: '',
goodsCategoryId: '',
supplierId: '',
stockRoomId: ''
}
export default {
name: 'StoreList',
components: {
AddGoodsModal,
ImportGoodsModal
},
data() {
return {
listQuery: Object.assign({}, defaultListQuery),
list: [],
total: 0,
listLoading: false,
multipleSelection: [],
categoryOptions: [],
supplierOptions: [],
depotOptions: []
}
},
created() {
this.getList()
this.getGoodsCategoryList()
this.getSuppliersList()
this.getStockRooms()
},
filters: {
formatTime(time) {
if (!time) {
return '--'
}
return moment(time).format('YYYY-MM-DD HH:mm:ss')
}
},
methods: {
handleResetSearch() {
this.listQuery = Object.assign({}, defaultListQuery)
this.getList()
},
handleSearchList() {
this.listQuery.pageNum = 1
this.getList()
},
handleSizeChange(val) {
this.listQuery.pageNum = 1
this.listQuery.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.pageNum = val
this.getList()
},
handleSelectionChange(vals) {
this.multipleSelection = vals
},
// 删除
// handleDelete(id){
// this.$confirm('是否删除该物品?', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// editGoods({id: id,deleteStatus: 0 }).then(res=>{
// this.getList()
// })
// }).catch(() => {
// });
// },
// 物品类别
getGoodsCategoryList(){
getGoodsCategoryList().then(res=>{
this.categoryOptions = res.data.list
})
},
// 供应商
getSuppliersList(){
getSuppliersList().then(res=>{
this.supplierOptions = res.data.list
})
},
// 库房
getStockRooms(){
getStockRooms().then(res=>{
this.depotOptions = res.data.list
})
},
//请求数据
getList() {
this.listLoading = true
//请求数据
console.log('listQuery', this.listQuery)
if(this.$store.getters.type == 2){
this.listQuery.stockRoomId = this.$store.getters.stockRoomId
}
getGoodsList(this.listQuery).then(res => {
this.listLoading = false
this.list = res.data.list
this.total = res.data.total
}).catch(err => {
this.listLoading = false
})
},
// 新增
handleAdd(){
this.$refs.addGoods.add()
},
// 导入
handleImport(){
this.$refs.importGoods.add()
}
}
}
</script>
<style scoped>
.app-container {
font-size: 14px;
color: #606266;
padding: 0 15px;
margin-top: 0;
}
.mt15 {
margin-top: 15px;
}
.input-width {
width: 180px;
}
.btn-groups button{
width: 100px;
}
</style>
<template> 
<div class="app-container">
<!-- 搜索栏 -->
<el-card class="filter-container"
shadow="never">
<el-form :inline="true"
:model="listQuery"
size="small">
<el-form-item label="物品名称:">
<el-input v-model="listQuery.goodsMame"
class="input-width"
placeholder="请输入物品名称"></el-input>
</el-form-item>
<el-form-item label="物品类别:">
<el-select v-model="listQuery.goodsCategoryId"
class="input-width"
clearable
placeholder="请选择物品类别">
<el-option v-for="item in categoryOptions"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="部门:">
<el-select v-model="listQuery.departId"
class="input-width"
clearable
placeholder="请选择部门">
<el-option v-for="item in departmentOptions"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<!-- 超级管理员可见-->
<el-form-item label="库房:" v-if="$store.getters.type == 1">
<el-select v-model="listQuery.stockRoomId"
class="input-width"
clearable
placeholder="请选择库房">
<el-option v-for="item in depotOptions"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="handleSearchList"
icon="el-icon-search"
size="small">搜索
</el-button>
<el-button @click="handleResetSearch"
icon="el-icon-refresh"
size="small">重置
</el-button>
</el-form-item>
</el-form>
</el-card>
<!-- 表格栏 -->
<el-card class="filter-container mt15"
shadow="never">
<div class="table-container">
<el-table :data="list"
v-loading="listLoading"
@selection-change="handleSelectionChange"
border>
<el-table-column type="selection"
align="center"
width="50"></el-table-column>
<el-table-column label="物品名称"
align="center">
<template slot-scope="scope">{{scope.row.goodsName}}</template>
</el-table-column>
<el-table-column label="型号"
align="center">
<template slot-scope="scope">{{scope.row.goodsNo}}</template>
</el-table-column>
<el-table-column label="物品类别"
align="center">
<template slot-scope="scope">{{scope.row.goodsCategoryName}}</template>
</el-table-column>
<el-table-column label="数量"
align="center">
<template slot-scope="scope">{{scope.row.outboundNum}}</template>
</el-table-column>
<el-table-column label="申领人"
align="center">
<template slot-scope="scope">{{$store.getters.type == 1? scope.row.backOutboundName : scope.row.receptOutboundName}}</template>
</el-table-column>
<el-table-column label="所属部门"
align="center">
<template slot-scope="scope">{{scope.row.departmentName || '--'}}</template>
</el-table-column>
<el-table-column label="所属库房"
align="center">
<template slot-scope="scope">{{scope.row.stockRoomName || '--'}}</template>
</el-table-column>
<el-table-column label="出库日期"
align="center">
<template slot-scope="scope">{{scope.row.createtime | formatTime }}</template>
</el-table-column>
</el-table>
</div>
<!-- 分页栏 -->
<div class="pagination-container">
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[10,30,50]"
:total="total">
</el-pagination>
</div>
</el-card>
</div>
</template>
<script>
import moment from 'moment'
import { getOutboundRecordList, getGoodsCategoryList, getStockRooms, getDepartmentList } from '@/api/inventory'
// 列表查询参数默认值
const defaultListQuery = {
pageNum: 1,
pageSize: 10,
goodsCategoryId: '',
stockRoomId: '',
goodsMame: '',
memberName: '',
departId: ''
}
export default {
name: 'WarehouseAdmin',
components: {},
data() {
return {
listQuery: Object.assign({}, defaultListQuery),
list: [],
total: 0,
listLoading: false,
multipleSelection: [],
categoryOptions: [],
depotOptions: [],
departmentOptions: []
}
},
created() {
this.getList()
this.getGoodsCategoryList()
this.getStockRooms()
this.getDepartmentList()
},
filters: {
formatTime(time) {
if (!time) {
return '--'
}
return moment(time).format('YYYY-MM-DD HH:mm:ss')
}
},
methods: {
handleResetSearch() {
this.listQuery = Object.assign({}, defaultListQuery)
this.getList()
},
handleSearchList() {
this.listQuery.pageNum = 1
this.getList()
},
handleSizeChange(val) {
this.listQuery.pageNum = 1
this.listQuery.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.pageNum = val
this.getList()
},
handleSelectionChange(vals) {
this.multipleSelection = vals
},
// 物品类别
getGoodsCategoryList() {
getGoodsCategoryList().then(res => {
this.categoryOptions = res.data.list
})
},
// 库房
getStockRooms() {
getStockRooms().then(res => {
this.depotOptions = res.data.list
})
},
getDepartmentList() {
getDepartmentList().then(res => {
this.departmentOptions = res.data.list
})
},
//请求数据
getList() {
this.listLoading = true
//请求数据
console.log('listQuery', this.listQuery)
if (this.$store.getters.type == 2) {
this.listQuery.stockRoomId = this.$store.getters.stockRoomId
}
getOutboundRecordList(this.listQuery).then(res => {
this.listLoading = false
this.list = res.data.list
this.total = res.data.total
}).catch(err => {
this.listLoading = false
})
}
}
}
</script>
<style scoped>
.app-container {
font-size: 14px;
color: #606266;
padding: 0 15px;
margin-top: 0;
}
.mt15 {
margin-top: 15px;
}
.input-width {
width: 180px;
}
</style>
<template>
<el-dialog :visible.sync="visible"
title="物品详情"
center
width="720px">
<!-- start -->
<div class="scroll-container"
ref="scrollContainer">
<el-table
:data="tableData"
style="width: 100%">
<el-table-column
prop="date"
label="物品名称">
</el-table-column>
<el-table-column
prop="name"
label="型号">
</el-table-column>
<el-table-column
prop="address"
label="物品类别">
</el-table-column>
<el-table-column
prop="address"
label="数量">
</el-table-column>
<el-table-column
prop="address"
label="价格(元)">
</el-table-column>
<el-table-column
prop="address"
label="供应商">
</el-table-column>
</el-table>
</div>
<div slot="footer">
<el-button type="primary"
@click="close">返回
</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
import { addMember,updateMcht } from '@/api/inventory'
// 添加编辑属性
export default {
name: 'inventoryDetailsModal',
data() {
return {
visible: false,
title: null,
loading: false,
tableData: new Array(10).fill({
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
})
// tableData: [{
// date: '2016-05-02',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1518 弄'
// }, {
// date: '2016-05-04',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1517 弄'
// }, {
// date: '2016-05-01',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1519 弄'
// }, {
// date: '2016-05-03',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1516 弄'
// }]
}
},
methods: {
init() {
this.visible = true
this.$nextTick(() => {
this.$refs.scrollContainer.scrollTop = 0
})
},
close() {
this.visible = false
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
</style>
......@@ -6,12 +6,6 @@
<el-form :inline="true"
:model="listQuery"
size="small">
<!-- <el-form-item label="部门:">-->
<!-- <el-cascader v-model="listQuery.departIds"-->
<!-- style="width: 250px;"-->
<!-- :props="{ expandTrigger: 'hover', checkStrictly: true, value: 'id', label: 'departName', children: 'departParamList' }"-->
<!-- :options="allDepartList"></el-cascader>-->
<!-- </el-form-item>-->
<el-form-item label="角色名:">
<el-select v-model="listQuery.roleId"
style="width: 250px;">
......@@ -65,6 +59,17 @@
align="center"
prop="roleName">
</el-table-column>
<el-table-column label="是否启用"
width="140"
align="center">
<template slot-scope="scope">
<el-switch @change="handleStatusChange(scope.$index, scope.row)"
:active-value="1"
:inactive-value="0"
v-model="scope.row.status">
</el-switch>
</template>
</el-table-column>
<!-- <el-table-column label="部门"-->
<!-- align="center"-->
<!-- prop="departName">-->
......@@ -89,10 +94,6 @@
type="danger"
@click="handleDelete(scope.row)">删除
</el-button>
<el-button size="mini"
type="info"
@click="handleLook(scope.row)">日志
</el-button>
</template>
</el-table-column>
</el-table>
......@@ -316,8 +317,25 @@ export default {
})
}
},
handleLook(row) {
this.$router.push({ name: 'log', params: { name: row.username } })
handleStatusChange(index, row) {
this.$confirm('是否要修改该状态?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateStatus(row.id, { status: row.status }).then(response => {
this.$message({
type: 'success',
message: '修改成功!'
})
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消修改'
})
this.getList()
})
},
getList() {
this.listLoading = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment