更新仓库管理

This commit is contained in:
朱文强 2023-11-04 16:40:16 +08:00
parent 5521f07c18
commit 0deb38647e
110 changed files with 17806 additions and 0 deletions

View File

@ -0,0 +1,75 @@
/*
* @Author: zwq
* @Date: 2023-11-02 14:21:18
* @LastEditors: zwq
* @LastEditTime: 2023-11-02 14:34:29
* @Description:
*/
import request from '@/utils/request'
// 创建仓库
export function createWarehouse(data) {
return request({
url: '/extend/warehouse/create',
method: 'post',
data: data
})
}
// 更新仓库
export function updateWarehouse(data) {
return request({
url: '/extend/warehouse/update',
method: 'put',
data: data
})
}
// 删除仓库
export function deleteWarehouse(id) {
return request({
url: '/extend/warehouse/delete?id=' + id,
method: 'delete'
})
}
// 获得仓库
export function getWarehouse(id) {
return request({
url: '/extend/warehouse/get?id=' + id,
method: 'get'
})
}
// 获得仓库列表
export function getWarehouseList() {
return request({
url: '/extend/warehouse/listAll',
method: 'get'
})
}
// 获得仓库code
export function getCode() {
return request({
url: '/extend/warehouse/getCode',
method: 'get'
})
}
// 获得仓库分页
export function getWarehousePage(query) {
return request({
url: '/extend/warehouse/page',
method: 'get',
params: query
})
}
// 导出仓库 Excel
export function exportWarehouseExcel(query) {
return request({
url: '/extend/warehouse/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,76 @@
/*
* @Author: zwq
* @Date: 2023-11-02 16:20:15
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 15:26:05
* @Description:
*/
import request from '@/utils/request'
// 创建物品
export function createWarehouseGoods(data) {
return request({
url: '/extend/warehouse-goods/create',
method: 'post',
data: data
})
}
// 更新物品
export function updateWarehouseGoods(data) {
return request({
url: '/extend/warehouse-goods/update',
method: 'put',
data: data
})
}
// 删除物品
export function deleteWarehouseGoods(id) {
return request({
url: '/extend/warehouse-goods/delete?id=' + id,
method: 'delete'
})
}
// 获得物品
export function getWarehouseGoods(id) {
return request({
url: '/extend/warehouse-goods/get?id=' + id,
method: 'get'
})
}
// 获得物品列表
export function getListByType(id) {
return request({
url: '/extend/warehouse-goods/getListByType?type=' + id,
method: 'get'
})
}
// 获得物品分页
export function getWarehouseGoodsPage(data) {
return request({
url: '/extend/warehouse-goods/page',
method: 'POST',
data: data
})
}
// 获得code
export function getCode() {
return request({
url: '/extend/warehouse-goods/getCode',
method: 'get'
})
}
// 导出物品 Excel
export function exportWarehouseGoodsExcel(query) {
return request({
url: '/extend/warehouse-goods/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,97 @@
/*
* @Author: zwq
* @Date: 2023-11-02 14:31:42
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:56:10
* @Description:
*/
import request from '@/utils/request'
// 创建库位
export function createWarehouseLocation(data) {
return request({
url: '/extend/warehouse-location/create',
method: 'post',
data: data
})
}
// 更新库位
export function updateWarehouseLocation(data) {
return request({
url: '/extend/warehouse-location/update',
method: 'put',
data: data
})
}
// 删除库位
export function deleteWarehouseLocation(id) {
return request({
url: '/extend/warehouse-location/delete?id=' + id,
method: 'delete'
})
}
// 获得库位
export function getWarehouseLocation(id) {
return request({
url: '/extend/warehouse-location/get?id=' + id,
method: 'get'
})
}
// 获得库位列表(通过仓库id)
export function listByWarehouse(id) {
return request({
url: '/extend/warehouse-location/listByWarehouse?warehouseId=' + id,
method: 'get'
})
}
// 获得库位列表(All)
export function listAll() {
return request({
url: '/extend/warehouse-location/listAll',
method: 'get'
})
}
// 获得库位code
export function getCode() {
return request({
url: '/extend/warehouse-location/getCode',
method: 'get'
})
}
// 获得库位分页
export function getWarehouseLocationPage(data) {
return request({
url: '/extend/warehouse-location/page',
method: 'POST',
data: data
})
}
// 获得库存总览数据
export function getOverview(data) {
return request({
url: '/extend/warehouse-monitoring/getOverview',
method: 'POST',
data: data
})
}
// 获得库位占用率数据
export function getRate(data) {
return request({
url: '/extend/warehouse-monitoring/getRate',
method: 'POST',
data: data
})
}
// 导出库位 Excel
export function exportWarehouseLocationExcel(query) {
return request({
url: '/extend/warehouse-location/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,83 @@
import request from '@/utils/request'
// 创建出入库-无库位-入库
export function createWarehouseRealtime(data) {
return request({
url: '/extend/warehouse-realtime/create',
method: 'post',
data: data
})
}
// 创建出入库-无库位-出库
export function outWarehouseRealtime(data) {
return request({
url: '/extend/warehouse-realtime/out',
method: 'post',
data: data
})
}
// 更新出入库-无库位
export function updateWarehouseRealtime(data) {
return request({
url: '/extend/warehouse-realtime/update',
method: 'put',
data: data
})
}
// 删除出入库-无库位
export function deleteWarehouseRealtime(id) {
return request({
url: '/extend/warehouse-realtime/delete?id=' + id,
method: 'delete'
})
}
// 获得出入库-无库位
export function getWarehouseRealtime(id) {
return request({
url: '/extend/warehouse-realtime/get?id=' + id,
method: 'get'
})
}
// 获得出入库-无库位-展开详情
export function getWarehouseRealtimeDet(id) {
return request({
url: '/extend/warehouse-realtime/getDet?id=' + id,
method: 'get'
})
}
// 获得出入库-无库位-批次列表
export function getBatchList(id) {
return request({
url: '/extend/warehouse-realtime/getBatchList?id=' + id,
method: 'get'
})
}
// 获得出入库-无库位分页
export function getWarehouseRealtimePage(data) {
return request({
url: '/extend/warehouse-realtime/page',
method: 'post',
data: data
})
}
// 获得出入库-无库位-历史分页
export function getWarehouseRealtimeHisPage(data) {
return request({
url: '/extend/warehouse-his/page',
method: 'post',
data: data
})
}
// 导出出入库-无库位 Excel
export function exportWarehouseRealtimeExcel(query) {
return request({
url: '/extend/warehouse-realtime/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,85 @@
import request from '@/utils/request'
// 创建出入库-有库位
export function createWarehouseRealtimeLocation(data) {
return request({
url: '/extend/warehouse-realtime-location/create',
method: 'post',
data: data
})
}
// 更新出入库-有库位
export function updateWarehouseRealtimeLocation(data) {
return request({
url: '/extend/warehouse-realtime-location/update',
method: 'put',
data: data
})
}
// 出入库-有库位 > 出库操作
export function outWarehouseRealtimeLocation(data) {
return request({
url: '/extend/warehouse-realtime-location/out',
method: 'post',
data: data
})
}
// 出入库-有库位 > 入库操作
export function inWarehouseRealtimeLocation(data) {
return request({
url: '/extend/warehouse-realtime-location/in',
method: 'post',
data: data
})
}
// 删除出入库-有库位
export function deleteWarehouseRealtimeLocation(id) {
return request({
url: '/extend/warehouse-realtime-location/delete?id=' + id,
method: 'delete'
})
}
// 获得出入库-有库位
export function getWarehouseRealtimeLocation(id) {
return request({
url: '/extend/warehouse-realtime-location/get?id=' + id,
method: 'get'
})
}
// 获得出入库历史-有库位详情列表
export function getWarehouseLocationHisDet(id) {
return request({
url: '/extend/warehouse-location-his-det/list?hisId=' + id,
method: 'get'
})
}
// 获得出入库-有库位分页
export function getWarehouseRealtimeLocationPage(data) {
return request({
url: '/extend/warehouse-realtime-location/page',
method: 'post',
data: data
})
}
// 获得出入库历史-有库位分页
export function getWarehouseLocationHisPage(data) {
return request({
url: '/extend/warehouse-location-his/page',
method: 'post',
data: data
})
}
// 导出出入库-有库位 Excel
export function exportWarehouseRealtimeLocationExcel(query) {
return request({
url: '/extend/warehouse-realtime-location/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,196 @@
<template>
<div :class="className" :style="{ height: height, width: width }" />
</template>
<script>
import * as echarts from 'echarts';
require('echarts/theme/macarons'); // echarts theme
import resize from '@/utils/chartMixins/resize';
const animationDuration = 1000;
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart',
},
title: {
type: String,
default: '',
},
width: {
type: String,
default: '100%',
},
height: {
type: String,
default: '300px',
},
histogram: {
type: Array,
default: () => [],
},
},
data() {
return {
chart: null,
};
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
var nameArr = [];
var valueArr = [];
var dayArr = [];
if (this.histogram.length > 0) {
this.histogram.forEach((item) => {
nameArr.push(item.goodsName);
valueArr.push(item.num);
dayArr.push(item.day);
});
}
this.chart = echarts.init(this.$el, 'macarons');
this.chart.setOption({
title: {
text: this.title
? '{space|}{tip|}{space|}{value|' + this.title + '}'
: '',
left: '0%',
top: '0%',
textStyle: {
rich: {
tip: {
width: 4,
height: 18,
backgroundColor: '#0B58FF',
marginRight: 6,
},
space: {
width: 8,
},
value: {
fontSize: 16,
fontWeight: 'bold',
color: 'black',
},
},
},
},
color: ['#288AFF', '#8EF0AB', '#FFDC94'],
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow', // 线'line' | 'shadow'
},
},
grid: [
{
containLabel: true,
top: 40,
left: '2%',
right: '2%',
bottom: '3%',
bottom: '55%',
},
{
containLabel: true,
top: 40,
left: '2%',
right: '2%',
bottom: '3%',
top: '55%',
},
],
xAxis: [
{
type: 'category',
data: nameArr,
gridIndex: 0,
axisTick: {
alignWithLabel: true,
},
axisLabel: {
color: '#979797',
},
axisLine: {
lineStyle: {
color: '#979797',
},
},
},
{
type: 'category',
data: nameArr,
gridIndex: 1,
axisTick: {
alignWithLabel: true,
},
axisLabel: {
color: '#979797',
},
axisLine: {
lineStyle: {
color: '#979797',
},
},
},
],
yAxis: [
{
gridIndex: 0,
axisTick: {
show: false,
},
splitArea: {
show: false,
},
axisLabel: {
color: '#979797',
},
},
{
gridIndex: 1,
axisTick: {
show: false,
},
splitArea: {
show: false,
},
axisLabel: {
color: '#979797',
},
},
],
series: [
{
name: '数量',
type: 'bar',
barWidth: '20',
data: valueArr,
animationDuration,
},
{
name: '天数',
type: 'bar',
barWidth: '20',
data: dayArr,
animationDuration,
xAxisIndex: 1,
yAxisIndex: 1,
},
],
});
},
},
};
</script>

View File

@ -0,0 +1,173 @@
<template>
<div :class="className" :style="{ height: height, width: width }" />
</template>
<script>
import * as echarts from 'echarts';
require('echarts/theme/macarons'); // echarts theme
import resize from '@/utils/chartMixins/resize';
const animationDuration = 1000;
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart',
},
title: {
type: String,
default: 'chart',
},
width: {
type: String,
default: '100%',
},
height: {
type: String,
default: '250px',
},
pieData: {
type: Array,
default: () => [],
},
},
data() {
return {
chart: null,
};
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons');
let totalNumber = 0;
this.pieData.forEach((i) => {
i.value = i.num;
i.name = i.status;
totalNumber += i.num;
});
this.chart.setOption({
title: {
zlevel: 2, //
text: '总数',
subtext: totalNumber,
top: '42%', //
left: '50%', //
textAlign: 'center', //
textStyle: {
color: 'rgba(203, 195, 195, 1)',
},
subtextStyle: {
fontSize: 20,
},
},
tooltip: {
trigger: 'item',
show: true, //
formatter: '产品: {b}<br/>数量: {c}<br/>占比: {d}%',
},
legend: {
orient: 'vartical',
bottom: 0,
left: 'right',
icon: 'circle',
itemGap: 16, //
textStyle: {
//
fontSize: 24, // legend
color: '#828282',
rich: {
oneone: {
width: 50,
color: '#000000',
fontSize: 12,
fontWeight: 'bolder',
},
twotwo: {
width: 35,
color: '#333',
fontSize: 12,
},
threethree: {
width: 20,
color: '#959595',
fontSize: 12,
},
},
},
formatter: (name) => {
var target = this.pieData.find((item) => {
return item.name === name;
}).num;
var v = ((target / totalNumber) * 100).toFixed(2);
return `{oneone|${name}} {twotwo|${target}个} {threethree|${v}%}`;
},
},
// legend: {
// bottom: '0%',
// left: 'center',
// },
grid: {
top: 40,
left: '0%',
right: '2%',
bottom: '3%',
containLabel: true,
},
series: [
{
name: 'pie',
type: 'pie',
radius: ['55%', '80%'],
bottom: '20%',
avoidLabelOverlap: true, // 线
itemStyle: {
borderRadius: 10,
borderColor: '#fff',
borderWidth: 2,
},
label: {
normal: {
show: true,
position: 'outside', // inside
formatter: '{b}', // {a}{b}{c}{d}{d}value
textStyle: {
// 线
align: 'right',
baseline: 'middle',
fontFamily: '微软雅黑',
fontSize: 12,
fontWeight: 'bolder',
color: '#333',
},
},
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold',
},
},
labelLine: {
show: true,
length: 17,
length2: 57,
},
data: this.pieData,
},
],
});
},
},
};
</script>

View File

@ -0,0 +1,96 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:32:13
* @Description:
-->
<template>
<el-row :gutter="10" class="chart-container">
<el-col :span="14">
<div class="chart-card">
<barChart
ref="barChart"
height="500px"
title="库存总览"
v-if="overviewList.length"
:histogram="overviewList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
<el-col :span="10">
<div class="chart-card">
<pieChart
ref="pieChart"
height="600px"
v-if="rateList.length"
:pie-data="rateList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
</el-row>
</template>
<script>
import barChart from '../../chart/BarChart.vue';
import pieChart from '../../chart/PieChart.vue';
import {
getOverview,
getRate,
} from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
urlOptions: {
allURL: getOverview,
rateURL: getRate
},
overviewList: [],
rateList: []
};
},
components: {
barChart,
pieChart
},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
const data = {
storageType : 2
}
this.urlOptions.allURL(data).then((response) => {
this.overviewList = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
this.urlOptions.rateURL(data).then((response) => {
this.rateList = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
});
},
},
};
</script>
<style scoped>
.chart-container {
min-height: calc(100vh - 120px - 8px);
background-color: #f0f2f7;
}
.chart-card {
min-height: calc(100vh - 120px - 8px);
background-color: #fff;
padding: 16px;
border-radius: 8px;
}
</style>

View File

@ -0,0 +1,156 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:56:25
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-input
v-model="dataForm.spec"
clearable
placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择单位">
<el-option
v-for="item in urlOptions.dictList.dict0"
:key="item.id"
:label="item.label"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number
v-model="dataForm.dailyUse"
clearable
placeholder="请输入单日消耗量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime">
<el-input-number
v-model="dataForm.allowTime"
clearable
placeholder="请输入允许留存时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="enabled" label="是否可用">
<el-select
v-model="dataForm.enabled"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择是否可用">
<el-option
v-for="item in isorno"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseGoods,
updateWarehouseGoods,
getWarehouseGoods,
getCode,
} from '@/api/warehouse/warehouseGoods';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
getDictList: true,
codeURL: getCode,
createURL: createWarehouseGoods,
updateURL: updateWarehouseGoods,
infoURL: getWarehouseGoods,
},
nameList: ['unit_dict'],
dataForm: {
id: undefined,
code: '',
name: '',
spec: '',
unit: '',
dailyUse: 0,
allowTime: 0,
enabled: 1,
remark: '',
},
dataRule: {
code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' },
],
},
isorno: [
{
id: 0,
name: '不可用',
},
{
id: 1,
name: '可用',
},
],
};
},
methods: {},
};
</script>

View File

@ -0,0 +1,183 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import codeFilter from '../../mixins/code-filter';
import {
deleteWarehouseGoods,
getWarehouseGoodsPage,
} from "@/api/warehouse/warehouseGoods";
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'name',
label: '名称',
},
{
prop: 'code',
label: '编码',
},
{
prop: 'spec',
label: '规格',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
},
{
prop: 'dailyUse',
label: '单日消耗量',
},
{
prop: 'enabled',
label: '是否可用',
filter: codeFilter('deactivate'),
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseGoodsPage,
deleteURL: deleteWarehouseGoods,
},
tableProps,
listQuery:{
storageType:2
},
tableBtn: [
this.$auth.hasPermi(`end-material:warehouse-goods:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`end-material:warehouse-goods:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('end-material:warehouse-goods:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,192 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeHisPage,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '物品名称',
},
{
prop: 'code',
label: '物品编码',
},
{
prop: 'spec',
label: '物品规格',
},
{
prop: 'num',
label: '出入库数量',
},
{
prop: 'goodsBatch',
label: '物品批次',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'operateTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'operator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeHisPage,
},
listQuery: {
storageType: 2,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`end-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.operateStatus = val.status;
this.listQuery.operateTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,82 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 16:20:19
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseLocationHisDet } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'batchCode',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseLocationHisDet(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,223 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseLocationHisPage,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'createTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'creator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseLocationHisPage,
},
listQuery: {
storageType: 2,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`end-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.operateStatus = val.status;
this.listQuery.createTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,221 @@
<!--
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:46:59
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
<el-divider class="divider"></el-divider>
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
</div>
</div>
</div>
</template>
<script>
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
wareData: {
one: [],
two: [],
there: [],
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
formConfig: [
{
type: 'button',
btnName: '刷新',
name: 'search',
color: 'primary',
},
],
};
},
components: {},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
(this.wareData = {
one: [],
two: [],
there: [],
four: [],
}),
listAll(1).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style lang="scss" scoped>
.mainbody {
display: flex;
gap: 70px;
flex-direction: column;
}
.flex-warp {
flex-wrap: nowrap;
}
.dashboard-layout-item {
width: 100px;
text-align: center;
height: 32px;
box-shadow: 0px 3px 6px 0px rgba(166, 174, 190, 0.8);
border-radius: 2px 4px 4px 2px;
margin: 0 3px 8px 0;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.dashboard-layout-item-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
position: absolute;
top: 10px;
left: 3px;
}
.p-name {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 15px;
}
&:hover {
cursor: pointer;
z-index: 10;
transform: scale(1.3) translateZ(0);
}
&:nth-child(2n) {
margin-right: 30px;
}
&:first-child {
margin-left: 50px;
}
&:last-child {
margin-right: 30px;
}
}
.el-divider--horizontal {
margin: 10px 0;
}
.el-divider {
background-color: black;
}
.tips {
position: absolute;
top: 22px;
right: 120px;
}
</style>

View File

@ -0,0 +1,202 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:32:54
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="仓库名称" prop="warehouseName">
<el-input
v-model="dataForm.warehouseName"
readonly
placeholder="请输入仓库名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品名称" prop="goodsId">
<el-select
v-model="dataForm.goodsId"
filterable
clearable
:disabled="dataForm.id ? true : false"
:style="{ width: '100%' }"
@change="setGoodInfo"
placeholder="请选择物品名称">
<el-option
v-for="item in goodsArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品编码" prop="code">
<el-input
v-model="dataForm.code"
readonly
placeholder="请输入物品编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品规格" prop="spec">
<el-input
v-model="dataForm.spec"
readonly
placeholder="请输入物品规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品批次" prop="goodsBatch">
<el-input
v-if="!dataForm.id ? true : false"
v-model="dataForm.goodsBatch"
clearable
placeholder="请输入物品批次" />
<el-select
v-else
v-model="dataForm.goodsBatch"
filterable
clearable
@change="setBatchInfo"
placeholder="请选择物品名称">
<el-option
v-for="(item, index) in Batch"
:key="index"
:label="item.goodsBatch"
:value="item.goodsBatch"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入库数量" prop="numDet">
<el-input-number
v-model="dataForm.numDet"
clearable
:min="0"
:max="max?max:9999999"
placeholder="请输入入库数量" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseRealtime,
outWarehouseRealtime,
getWarehouseRealtime,
getWarehouseRealtimeDet,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
import { mapGetters } from 'vuex';
export default {
mixins: [basicAdd],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getOption: true,
createURL: createWarehouseRealtime,
updateURL: outWarehouseRealtime,
infoURL: getWarehouseRealtime,
},
dataForm: {
id: undefined,
warehouseName: '',
warehouseId: '',
goodsId: '',
code: '',
spec: '',
goodsBatch: '',
numDet: '',
operator: '',
},
goodsArr: [],
Batch: [],
max: 0,
dataRule: {
goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' },
],
goodsBatch: [
{
required: true,
message: '物品批次不能为空,若无请填写无',
trigger: 'blur',
},
],
numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' },
],
},
};
},
created() {},
methods: {
getArr() {
this.dataForm.operator = this.nickname
getListByType(2).then((response) => {
this.goodsArr = response.data;
});
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 2) {
this.dataForm.warehouseName = item.name;
this.dataForm.warehouseId = item.id;
}
});
});
},
setGoodInfo() {
this.goodsArr.forEach((item) => {
if (item.id === this.dataForm.goodsId) {
this.dataForm.code = item.code;
this.dataForm.spec = item.spec;
}
});
},
setBatchInfo(){
this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet
}
});
},
outWare(data) {
this.getArr();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
this.dataForm.realTimeId = data.id;
this.dataForm.id = data.id;
this.dataForm.goodsId = data.goodsId;
this.dataForm.code = data.code;
this.dataForm.spec = data.spec;
getWarehouseRealtimeDet(data.id).then((res) => {
this.Batch = res.data;
});
// this.urlOptions.infoURL(data.id).then((response) => {
// this.dataForm = response.data;
// });
});
},
},
};
</script>

View File

@ -0,0 +1,193 @@
<!--
* @Author: zwq
* @Date: 2023-11-03 16:37:06
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:33:02
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-table
:data="tableData"
:header-cell-style="{
background: '#F2F4F9',
color: '#606266',
}"
border
v-loading="dataListLoading"
style="width: 100%"
ref="dataList">
<el-table-column type="expand">
<template slot-scope="scope">
<product :warehouse-id="scope.row.id"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名称" />
<el-table-column prop="name" label="物品名称" />
<el-table-column prop="code" label="物品编码" />
<el-table-column prop="spec" label="物品规格" />
<el-table-column prop="num" label="数量" />
<el-table-column prop="operator" label="操作人" />
<el-table-column prop="latestInTime" label="最新入库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestInTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="latestOutTime" label="最新出库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="handleClick({ data: scope.row, type: 'out' })"
v-hasPermi="['end-material:warehouse-realtime:update']">
出库
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import product from './product-mini';
import basicPage from '../../mixins/basic-page';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import AddOrUpdate from './add-or-updata';
import { getWarehouseRealtimePage } from '@/api/warehouse/warehouseRealtime';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimePage,
},
tableData: [],
listQuery: {
storageType: 2,
},
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'datePicker',
label: '最新入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'datePicker',
label: '最新出库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime1',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('end-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
product,
AddOrUpdate,
},
created() {
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.latestInTime = val.searchTime?val.searchTime:null;
this.listQuery.latestOutTime = val.searchTime1?val.searchTime1:null;
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '入库';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
default:
console.log(val);
}
},
otherMethods(val){
this.addOrUpdateVisible = true;
this.addOrEditTitle = "出库";
this.$nextTick(() => {
this.$refs.addOrUpdate.outWare(val.data);
});
}
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,71 @@
<!--
* @Author: zwq
* @Date: 2023-08-24 14:47:58
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 10:31:56
* @Description:
-->
<template>
<div>
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
max-height="200"
:table-data="tableData" />
</div>
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeDet } from '@/api/warehouse/warehouseRealtime';
const tableProps = [
{
prop: 'goodsBatch',
label: '产品批次',
},
{
prop: 'numDet',
label: '批次数量',
},
{
prop: 'createTime',
label: '入库时间',
filter: parseTime,
},
];
export default {
props: {
warehouseId: {
type: String,
default: '',
},
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeDet
},
tableProps,
tableData: [],
dataListLoading: false,
};
},
components: {
},
created() {},
mounted() {
this.getDataList()
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.warehouseId).then(response => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,93 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:51:33
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'inTime',
label: '入库时间',
align: 'center',
filter: parseTime,
},
{
prop: 'leftTime',
label: '剩余留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseRealtimeLocation(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,122 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
新增产品
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="产品" prop="productInfo">
<el-select
v-model="dataForm.productInfo"
style="width: 100%"
filterable
value-key="id"
placeholder="请选择产品">
<el-option
v-for="item in productArr"
:key="item.id"
:label="item.name"
:value="item" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
getListByType
} from "@/api/warehouse/warehouseGoods";
export default {
data() {
return {
visible: false,
dataForm: {
index: -1,
productInfo: '',
},
productArr: [],
dataRule: {
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(index) {
if (index >= 0) {
this.dataForm.index = index;
}
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
getListByType(2).then((response) => {
this.productArr = response.data;
});
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.dataForm.productInfo.goodsId = this.dataForm.productInfo.id
this.dataForm.productInfo.remark = ''
//
if (this.dataForm.index >= 0) {
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
return;
}
//
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,317 @@
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:destroy-on-close="true"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">库位信息</small-title>
<div class="content">
<div class="visual-part">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
label-position="top"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="库位名称" prop="name">
<el-input
v-model="dataForm.name"
disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="托盘编码" prop="palletCode">
<el-input
v-model="dataForm.palletCode"
@input="$forceUpdate()"
placeholder="请输入托盘编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品信息
<!-- <el-alert
title="产品信息新增和修改后,需点击最下方保存按钮确定修改"
type="warning"
show-icon></el-alert> -->
</small-title>
<div class="attr-list">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="addButtonShow"
@emitButtonClick="addNew"
@emitFun="inputChange"
:height="400"
:table-data="productAttributeList">
<method-btn
slot="handleBtn"
:width="70"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
</div>
</div>
</div>
<div style="position: absolute; bottom: 24px; right: 24px">
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
<span>
<el-button type="primary" @click="dataFormSubmit()">入库</el-button>
</span>
</div>
<product-attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="addList" />
</el-drawer>
</template>
<script>
import productAttrAdd from './attr-add';
import inputArea from '../../mixins/inputArea';
import SmallTitle from './SmallTitle';
import { inWarehouseRealtimeLocation,
getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableBtn = [
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'num',
label: '数量',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'remark',
label: '备注',
align: 'center',
subcomponent: inputArea,
width: 100,
},
];
export default {
components: { productAttrAdd, SmallTitle },
data() {
return {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
productAttributeList: [],
addButtonShow: '新增',
operator: '',
dataForm: {
id: null,
name: '',
palletCode: '',
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataRule: {
// palletCode: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
},
};
},
methods: {
initData() {
this.productAttributeList.splice(0);
},
init(val,nickname) {
this.operator = nickname
this.dataForm.id = val.id;
this.dataForm.name = val.name;
this.dataForm.palletCode = val.palletCode;
this.initData();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
//
this.getList();
}
});
},
getList() {
//
getWarehouseRealtimeLocation(this.dataForm.id).then((response) => {
this.productAttributeList = response.data;
});
},
inputChange(data) {
switch (data.sType) {
case 1:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data[data.prop];
break;
case 2:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data.string ? data.string.split('+')[0] : '';
this.productAttributeList[data._pageIndex - 1][data.prop + 'Name'] =
data.string ? data.string.split('+')[1] : '';
break;
default:
console.log(val);
}
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
this.productAttributeList.splice(raw.data._pageIndex - 1, 1);
})
.catch(() => {});
} else {
this.addNew(raw.data._pageIndex);
}
},
//
dataFormSubmit() {
this.productAttributeList.forEach((item) => {
item.id = '';
});
const data = {
realtimeLocationId : this.dataForm.id,
palletCode : this.dataForm.palletCode,
operator : this.operator,
goodsInfos: this.productAttributeList
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
inWarehouseRealtimeLocation(data).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
}
});
},
// /
addNew(index) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(index);
});
},
addList(data) {
this.productAttributeList.push(data.productInfo);
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
this.initData();
},
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-form-item {
margin: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 10px;
}
.drawer >>> .content {
padding: 0 24px 30px;
display: flex;
flex-direction: column;
height: 100%;
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
</style>

View File

@ -0,0 +1,279 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<drawer
v-if="drawerVisible"
ref="drawerRef"
@refreshDataList="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import Drawer from './drawer';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeLocationPage,
outWarehouseRealtimeLocation,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
import { mapGetters } from 'vuex';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'status',
label: '库位状态',
filter: publicFormatter('AreaDetStatus'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'inTime',
label: '入库时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeLocationPage,
outURL: outWarehouseRealtimeLocation,
},
listQuery: {
storageType: 2,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
? {
type: 'out',
btnName: '出库',
}
: undefined,
this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
? {
type: 'in',
btnName: '入库',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '库位状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
Drawer,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'AreaDetStatus',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.status = val.status;
this.listQuery.inTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'out') {
this.$confirm(
`确定对${'[名称=' + val.data.name + ']'}执行出库操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
const data = {
realtimeLocationId: val.data.id,
operator: this.nickname,
};
this.urlOptions.outURL(data).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => {});
} else if (val.type === 'in') {
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs.drawerRef.init(val.data, this.nickname);
});
} else if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,121 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2023-11-02 15:33:39
* @Description:
*/
import { listData } from "@/api/system/dict/data";
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
createURL: '',
updateURL: '',
infoURL: '',
codeURL: '',
getOption: false, //是否加载获取下拉框方法
isGetCode: false, //是否加载获取code方法
getDictList: false, //是否加载获取数据字典方法
optionArrUrl: [], //需要获取下拉框的方法数组
optionArr: {}, //需要获取下拉框的方法数组的返回结果
dictList: {}, //需要获取数据字典的方法数组的返回结果
},
visible: false,
setData: false
}
},
created() {
},
activated() {
},
methods: {
init(id) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
if (this.urlOptions.getDictList) {
this.getDict()
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data;
if (this.setData) {
this.setDataForm()
}
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
getCode() {
this.urlOptions.codeURL()
.then(({ data: res }) => {
this.dataForm.code = res;
})
.catch(() => {});
},
getArr() {
const params = {
pageSize: 100,
pageNo: 1,
}
this.urlOptions.optionArrUrl.forEach((item, index) => {
item(params).then(({ data: res }) => {
this.$set(this.urlOptions.optionArr, `arr${index}`, res.list)
})
.catch(() => {
});
});
},
/** 查询字典数据列表 */
getDict() {
this.nameList.forEach((item,index)=>{
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: item,
}
listData(queryParams).then(response => {
this.$set(this.urlOptions.dictList, `dict${index}`, response.data.list)
});
})
},
// 表单提交
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
// 修改的提交
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
// 添加的提交
this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
formClear() {
if (this.$refs.dataForm!==undefined) {
this.$refs.dataForm.resetFields();
}
}
}
}

View File

@ -0,0 +1,170 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 16:06:21
* @Description:
*/
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
getDataListURL: '',
deleteURL: '',
statusUrl: '',
exportURL: ''
},
tableData: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 1,
},
exportLoading: false,
dataListLoading: false,
addOrEditTitle: '',
addOrUpdateVisible: false,
addOrUpdate:'addOrUpdate'
}
},
created() {
},
mounted() {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.dataListLoading = false;
});
},
// 每页数
sizeChangeHandle(val) {
this.listQuery.pageSize = val;
this.listQuery.pageNo = 1;
this.getDataList();
},
// 当前页
currentChangeHandle(val) {
this.listQuery.pageNo = val;
this.getDataList();
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
cancel(id) {
this.$refs["popover-" + id].showPopper = false;
},
//改变状态
changeStatus(id) {
this.$http
.post(this.urlOptions.statusUrl, { id })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$refs["popover-" + id].showPopper = false;
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.getDataList();
},
});
})
.catch(() => { });
},
//tableBtn点击
handleClick(val) {
if (val.type === "edit") {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "编辑";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
} else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
} else if (val.type === "change") {
this.changeStatus(val.data.id)
} else {
this.otherMethods(val)
}
},
// 删除
deleteHandle(id, name, index) {
this.$confirm(`确定对${name ? '[名称=' + name + ']' : '[序号=' + index + ']'}进行删除操作?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
},
//search-bar点击
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.xm1 = val.xm1;
this.listQuery.xm2 = val.xm2;
this.listQuery.pageNo = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
handleCancel() {
this.$refs[this.addOrUpdate].formClear()
this.addOrUpdateVisible = false
this.addOrEditTitle = ''
this.addOrUpdate = 'addOrUpdate'
},
handleConfirm() {
this.$refs[this.addOrUpdate].dataFormSubmit()
},
successSubmit() {
this.handleCancel()
this.getDataList()
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '报表.xls');
this.exportLoading = false;
}).catch(() => { });
}
}
}

View File

@ -0,0 +1,73 @@
/*
* @Date: 2020-12-29 16:49:28
* @LastEditors: zwq
* @LastEditTime: 2023-10-24 16:30:25
* @FilePath: \basic-admin\src\filters\basicData\index.js
* @Description:
*/
const table = {
lineStatus: {
1: '生产中',
2: '停止',
3: '未知',
},
deactivate: {
1: '启用',
0: '停用',
},
wareType: {
1: '缓存',
2: '活动',
3: '其它',
},
}
// 日期格式化
export function parseTime(time, pattern) {
if (arguments.length === 0 || !time) {
return null
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),'');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value]
}
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
export default function (dictTable) {
return function (val) {
return table?.[dictTable]?.[val]
}
}

View File

@ -0,0 +1,46 @@
<!--
* @Author: zwq
* @Date: 2023-09-22 15:36:40
* @LastEditors: zwq
* @LastEditTime: 2023-09-26 15:59:57
* @Description:
-->
<template>
<div class="tableInner">
<el-input v-model="list[itemProp]" @blur="changeInput" />
</div>
</template>
<script>
export default {
name: "InputArea",
props: {
injectData: {
type: Object,
default: () => ({}),
},
itemProp: {
type: String,
},
},
data() {
return {
list: this.injectData,
};
},
methods: {
changeInput() {
this.list.sType = 1
this.$emit("emitData", this.list,1);
},
},
};
</script>
<style scoped>
.tableInner >>> .el-input__inner {
color: #409EFF;
border: 1px rgb(232, 231, 231) solid;
padding: 0;
text-align: center;
height: 30px;
}
</style>

View File

@ -0,0 +1,59 @@
<template>
<div class="tableInner">
<el-select v-model="list[itemProp]" @change="changeInput">
<el-option
v-for="item in QArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
</template>
<script>
export default {
name: 'InputArea',
props: {
injectData: {
type: Object,
default: () => ({}),
},
itemProp: {
type: String,
},
},
data() {
return {
list: this.injectData,
QArr: [
{
name: 'A',
id: 0,
},
{
name: 'B',
id: 1,
},
{
name: 'C',
id: 2,
},
],
};
},
methods: {
changeInput() {
this.list.sType = 1;
this.$emit('emitData', this.list);
},
},
};
</script>
<style scoped>
.tableInner >>> .el-input__inner {
color: #409EFF;
border: 1px rgb(232, 231, 231) solid;
padding: 0;
text-align: center;
height: 30px;
}
</style>

View File

@ -0,0 +1,96 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:11:36
* @Description:
-->
<template>
<el-row :gutter="10" class="chart-container">
<el-col :span="14">
<div class="chart-card">
<barChart
ref="barChart"
height="500px"
title="库存总览"
v-if="overviewList.length"
:histogram="overviewList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
<el-col :span="10">
<div class="chart-card">
<pieChart
ref="pieChart"
height="600px"
v-if="rateList.length"
:pie-data="rateList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
</el-row>
</template>
<script>
import barChart from '../../chart/BarChart.vue';
import pieChart from '../../chart/PieChart.vue';
import {
getOverview,
getRate,
} from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
urlOptions: {
allURL: getOverview,
rateURL: getRate
},
overviewList: [],
rateList: []
};
},
components: {
barChart,
pieChart
},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
const data = {
storageType : 5
}
this.urlOptions.allURL(data).then((response) => {
this.overviewList = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
this.urlOptions.rateURL(data).then((response) => {
this.rateList = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
});
},
},
};
</script>
<style scoped>
.chart-container {
min-height: calc(100vh - 120px - 8px);
background-color: #f0f2f7;
}
.chart-card {
min-height: calc(100vh - 120px - 8px);
background-color: #fff;
padding: 16px;
border-radius: 8px;
}
</style>

View File

@ -0,0 +1,156 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:56:25
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-input
v-model="dataForm.spec"
clearable
placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择单位">
<el-option
v-for="item in urlOptions.dictList.dict0"
:key="item.id"
:label="item.label"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number
v-model="dataForm.dailyUse"
clearable
placeholder="请输入单日消耗量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime">
<el-input-number
v-model="dataForm.allowTime"
clearable
placeholder="请输入允许留存时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="enabled" label="是否可用">
<el-select
v-model="dataForm.enabled"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择是否可用">
<el-option
v-for="item in isorno"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseGoods,
updateWarehouseGoods,
getWarehouseGoods,
getCode,
} from '@/api/warehouse/warehouseGoods';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
getDictList: true,
codeURL: getCode,
createURL: createWarehouseGoods,
updateURL: updateWarehouseGoods,
infoURL: getWarehouseGoods,
},
nameList: ['unit_dict'],
dataForm: {
id: undefined,
code: '',
name: '',
spec: '',
unit: '',
dailyUse: 0,
allowTime: 0,
enabled: 1,
remark: '',
},
dataRule: {
code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' },
],
},
isorno: [
{
id: 0,
name: '不可用',
},
{
id: 1,
name: '可用',
},
],
};
},
methods: {},
};
</script>

View File

@ -0,0 +1,183 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import codeFilter from '../../mixins/code-filter';
import {
deleteWarehouseGoods,
getWarehouseGoodsPage,
} from "@/api/warehouse/warehouseGoods";
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'name',
label: '名称',
},
{
prop: 'code',
label: '编码',
},
{
prop: 'spec',
label: '规格',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
},
{
prop: 'dailyUse',
label: '单日消耗量',
},
{
prop: 'enabled',
label: '是否可用',
filter: codeFilter('deactivate'),
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseGoodsPage,
deleteURL: deleteWarehouseGoods,
},
tableProps,
listQuery:{
storageType:5
},
tableBtn: [
this.$auth.hasPermi(`out-material:warehouse-goods:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`out-material:warehouse-goods:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('out-material:warehouse-goods:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,192 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeHisPage,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '物品名称',
},
{
prop: 'code',
label: '物品编码',
},
{
prop: 'spec',
label: '物品规格',
},
{
prop: 'num',
label: '出入库数量',
},
{
prop: 'goodsBatch',
label: '物品批次',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'operateTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'operator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeHisPage,
},
listQuery: {
storageType: 5,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`out-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.operateStatus = val.status;
this.listQuery.operateTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,82 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 16:20:19
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseLocationHisDet } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'batchCode',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseLocationHisDet(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,223 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseLocationHisPage,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'createTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'creator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseLocationHisPage,
},
listQuery: {
storageType: 5,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`out-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.operateStatus = val.status;
this.listQuery.createTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,221 @@
<!--
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:46:59
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
<el-divider class="divider"></el-divider>
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
</div>
</div>
</div>
</template>
<script>
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
wareData: {
one: [],
two: [],
there: [],
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
formConfig: [
{
type: 'button',
btnName: '刷新',
name: 'search',
color: 'primary',
},
],
};
},
components: {},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
(this.wareData = {
one: [],
two: [],
there: [],
four: [],
}),
listAll(1).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style lang="scss" scoped>
.mainbody {
display: flex;
gap: 70px;
flex-direction: column;
}
.flex-warp {
flex-wrap: nowrap;
}
.dashboard-layout-item {
width: 100px;
text-align: center;
height: 32px;
box-shadow: 0px 3px 6px 0px rgba(166, 174, 190, 0.8);
border-radius: 2px 4px 4px 2px;
margin: 0 3px 8px 0;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.dashboard-layout-item-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
position: absolute;
top: 10px;
left: 3px;
}
.p-name {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 15px;
}
&:hover {
cursor: pointer;
z-index: 10;
transform: scale(1.3) translateZ(0);
}
&:nth-child(2n) {
margin-right: 30px;
}
&:first-child {
margin-left: 50px;
}
&:last-child {
margin-right: 30px;
}
}
.el-divider--horizontal {
margin: 10px 0;
}
.el-divider {
background-color: black;
}
.tips {
position: absolute;
top: 22px;
right: 120px;
}
</style>

View File

@ -0,0 +1,202 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:24:41
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="仓库名称" prop="warehouseName">
<el-input
v-model="dataForm.warehouseName"
readonly
placeholder="请输入仓库名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品名称" prop="goodsId">
<el-select
v-model="dataForm.goodsId"
filterable
clearable
:disabled="dataForm.id ? true : false"
:style="{ width: '100%' }"
@change="setGoodInfo"
placeholder="请选择物品名称">
<el-option
v-for="item in goodsArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品编码" prop="code">
<el-input
v-model="dataForm.code"
readonly
placeholder="请输入物品编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品规格" prop="spec">
<el-input
v-model="dataForm.spec"
readonly
placeholder="请输入物品规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品批次" prop="goodsBatch">
<el-input
v-if="!dataForm.id ? true : false"
v-model="dataForm.goodsBatch"
clearable
placeholder="请输入物品批次" />
<el-select
v-else
v-model="dataForm.goodsBatch"
filterable
clearable
@change="setBatchInfo"
placeholder="请选择物品名称">
<el-option
v-for="(item, index) in Batch"
:key="index"
:label="item.goodsBatch"
:value="item.goodsBatch"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入库数量" prop="numDet">
<el-input-number
v-model="dataForm.numDet"
clearable
:min="0"
:max="max?max:9999999"
placeholder="请输入入库数量" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseRealtime,
outWarehouseRealtime,
getWarehouseRealtime,
getWarehouseRealtimeDet,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
import { mapGetters } from 'vuex';
export default {
mixins: [basicAdd],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getOption: true,
createURL: createWarehouseRealtime,
updateURL: outWarehouseRealtime,
infoURL: getWarehouseRealtime,
},
dataForm: {
id: undefined,
warehouseName: '',
warehouseId: '',
goodsId: '',
code: '',
spec: '',
goodsBatch: '',
numDet: '',
operator: '',
},
goodsArr: [],
Batch: [],
max: 0,
dataRule: {
goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' },
],
goodsBatch: [
{
required: true,
message: '物品批次不能为空,若无请填写无',
trigger: 'blur',
},
],
numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' },
],
},
};
},
created() {},
methods: {
getArr() {
this.dataForm.operator = this.nickname
getListByType(5).then((response) => {
this.goodsArr = response.data;
});
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 5) {
this.dataForm.warehouseName = item.name;
this.dataForm.warehouseId = item.id;
}
});
});
},
setGoodInfo() {
this.goodsArr.forEach((item) => {
if (item.id === this.dataForm.goodsId) {
this.dataForm.code = item.code;
this.dataForm.spec = item.spec;
}
});
},
setBatchInfo(){
this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet
}
});
},
outWare(data) {
this.getArr();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
this.dataForm.realTimeId = data.id;
this.dataForm.id = data.id;
this.dataForm.goodsId = data.goodsId;
this.dataForm.code = data.code;
this.dataForm.spec = data.spec;
getWarehouseRealtimeDet(data.id).then((res) => {
this.Batch = res.data;
});
// this.urlOptions.infoURL(data.id).then((response) => {
// this.dataForm = response.data;
// });
});
},
},
};
</script>

View File

@ -0,0 +1,193 @@
<!--
* @Author: zwq
* @Date: 2023-11-03 16:37:06
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:14:09
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-table
:data="tableData"
:header-cell-style="{
background: '#F2F4F9',
color: '#606266',
}"
border
v-loading="dataListLoading"
style="width: 100%"
ref="dataList">
<el-table-column type="expand">
<template slot-scope="scope">
<product :warehouse-id="scope.row.id"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名称" />
<el-table-column prop="name" label="物品名称" />
<el-table-column prop="code" label="物品编码" />
<el-table-column prop="spec" label="物品规格" />
<el-table-column prop="num" label="数量" />
<el-table-column prop="operator" label="操作人" />
<el-table-column prop="latestInTime" label="最新入库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestInTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="latestOutTime" label="最新出库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="handleClick({ data: scope.row, type: 'out' })"
v-hasPermi="['out-material:warehouse-realtime:update']">
出库
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import product from './product-mini';
import basicPage from '../../mixins/basic-page';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import AddOrUpdate from './add-or-updata';
import { getWarehouseRealtimePage } from '@/api/warehouse/warehouseRealtime';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimePage,
},
tableData: [],
listQuery: {
storageType: 5,
},
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'datePicker',
label: '最新入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'datePicker',
label: '最新出库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime1',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('out-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
product,
AddOrUpdate,
},
created() {
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.latestInTime = val.searchTime?val.searchTime:null;
this.listQuery.latestOutTime = val.searchTime1?val.searchTime1:null;
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '入库';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
default:
console.log(val);
}
},
otherMethods(val){
this.addOrUpdateVisible = true;
this.addOrEditTitle = "出库";
this.$nextTick(() => {
this.$refs.addOrUpdate.outWare(val.data);
});
}
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,71 @@
<!--
* @Author: zwq
* @Date: 2023-08-24 14:47:58
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 10:31:56
* @Description:
-->
<template>
<div>
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
max-height="200"
:table-data="tableData" />
</div>
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeDet } from '@/api/warehouse/warehouseRealtime';
const tableProps = [
{
prop: 'goodsBatch',
label: '产品批次',
},
{
prop: 'numDet',
label: '批次数量',
},
{
prop: 'createTime',
label: '入库时间',
filter: parseTime,
},
];
export default {
props: {
warehouseId: {
type: String,
default: '',
},
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeDet
},
tableProps,
tableData: [],
dataListLoading: false,
};
},
components: {
},
created() {},
mounted() {
this.getDataList()
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.warehouseId).then(response => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,93 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:51:33
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'inTime',
label: '入库时间',
align: 'center',
filter: parseTime,
},
{
prop: 'leftTime',
label: '剩余留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseRealtimeLocation(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,122 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
新增产品
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="产品" prop="productInfo">
<el-select
v-model="dataForm.productInfo"
style="width: 100%"
filterable
value-key="id"
placeholder="请选择产品">
<el-option
v-for="item in productArr"
:key="item.id"
:label="item.name"
:value="item" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
getListByType
} from "@/api/warehouse/warehouseGoods";
export default {
data() {
return {
visible: false,
dataForm: {
index: -1,
productInfo: '',
},
productArr: [],
dataRule: {
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(index) {
if (index >= 0) {
this.dataForm.index = index;
}
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
getListByType(5).then((response) => {
this.productArr = response.data;
});
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.dataForm.productInfo.goodsId = this.dataForm.productInfo.id
this.dataForm.productInfo.remark = ''
//
if (this.dataForm.index >= 0) {
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
return;
}
//
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,317 @@
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:destroy-on-close="true"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">库位信息</small-title>
<div class="content">
<div class="visual-part">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
label-position="top"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="库位名称" prop="name">
<el-input
v-model="dataForm.name"
disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="托盘编码" prop="palletCode">
<el-input
v-model="dataForm.palletCode"
@input="$forceUpdate()"
placeholder="请输入托盘编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品信息
<!-- <el-alert
title="产品信息新增和修改后,需点击最下方保存按钮确定修改"
type="warning"
show-icon></el-alert> -->
</small-title>
<div class="attr-list">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="addButtonShow"
@emitButtonClick="addNew"
@emitFun="inputChange"
:height="400"
:table-data="productAttributeList">
<method-btn
slot="handleBtn"
:width="70"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
</div>
</div>
</div>
<div style="position: absolute; bottom: 24px; right: 24px">
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
<span>
<el-button type="primary" @click="dataFormSubmit()">入库</el-button>
</span>
</div>
<product-attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="addList" />
</el-drawer>
</template>
<script>
import productAttrAdd from './attr-add';
import inputArea from '../../mixins/inputArea';
import SmallTitle from './SmallTitle';
import { inWarehouseRealtimeLocation,
getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableBtn = [
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'num',
label: '数量',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'remark',
label: '备注',
align: 'center',
subcomponent: inputArea,
width: 100,
},
];
export default {
components: { productAttrAdd, SmallTitle },
data() {
return {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
productAttributeList: [],
addButtonShow: '新增',
operator: '',
dataForm: {
id: null,
name: '',
palletCode: '',
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataRule: {
// palletCode: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
},
};
},
methods: {
initData() {
this.productAttributeList.splice(0);
},
init(val,nickname) {
this.operator = nickname
this.dataForm.id = val.id;
this.dataForm.name = val.name;
this.dataForm.palletCode = val.palletCode;
this.initData();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
//
this.getList();
}
});
},
getList() {
//
getWarehouseRealtimeLocation(this.dataForm.id).then((response) => {
this.productAttributeList = response.data;
});
},
inputChange(data) {
switch (data.sType) {
case 1:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data[data.prop];
break;
case 2:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data.string ? data.string.split('+')[0] : '';
this.productAttributeList[data._pageIndex - 1][data.prop + 'Name'] =
data.string ? data.string.split('+')[1] : '';
break;
default:
console.log(val);
}
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
this.productAttributeList.splice(raw.data._pageIndex - 1, 1);
})
.catch(() => {});
} else {
this.addNew(raw.data._pageIndex);
}
},
//
dataFormSubmit() {
this.productAttributeList.forEach((item) => {
item.id = '';
});
const data = {
realtimeLocationId : this.dataForm.id,
palletCode : this.dataForm.palletCode,
operator : this.operator,
goodsInfos: this.productAttributeList
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
inWarehouseRealtimeLocation(data).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
}
});
},
// /
addNew(index) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(index);
});
},
addList(data) {
this.productAttributeList.push(data.productInfo);
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
this.initData();
},
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-form-item {
margin: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 10px;
}
.drawer >>> .content {
padding: 0 24px 30px;
display: flex;
flex-direction: column;
height: 100%;
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
</style>

View File

@ -0,0 +1,279 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<drawer
v-if="drawerVisible"
ref="drawerRef"
@refreshDataList="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import Drawer from './drawer';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeLocationPage,
outWarehouseRealtimeLocation,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
import { mapGetters } from 'vuex';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'status',
label: '库位状态',
filter: publicFormatter('AreaDetStatus'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'inTime',
label: '入库时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeLocationPage,
outURL: outWarehouseRealtimeLocation,
},
listQuery: {
storageType: 5,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
? {
type: 'out',
btnName: '出库',
}
: undefined,
this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
? {
type: 'in',
btnName: '入库',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '库位状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
Drawer,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'AreaDetStatus',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.status = val.status;
this.listQuery.inTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'out') {
this.$confirm(
`确定对${'[名称=' + val.data.name + ']'}执行出库操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
const data = {
realtimeLocationId: val.data.id,
operator: this.nickname,
};
this.urlOptions.outURL(data).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => {});
} else if (val.type === 'in') {
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs.drawerRef.init(val.data, this.nickname);
});
} else if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,96 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:06:10
* @Description:
-->
<template>
<el-row :gutter="10" class="chart-container">
<el-col :span="14">
<div class="chart-card">
<barChart
ref="barChart"
height="500px"
title="库存总览"
v-if="overviewList.length"
:histogram="overviewList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
<el-col :span="10">
<div class="chart-card">
<pieChart
ref="pieChart"
height="600px"
v-if="rateList.length"
:pie-data="rateList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
</el-row>
</template>
<script>
import barChart from '../../chart/BarChart.vue';
import pieChart from '../../chart/PieChart.vue';
import {
getOverview,
getRate,
} from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
urlOptions: {
allURL: getOverview,
rateURL: getRate
},
overviewList: [],
rateList: []
};
},
components: {
barChart,
pieChart
},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
const data = {
storageType : 3
}
this.urlOptions.allURL(data).then((response) => {
this.overviewList = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
this.urlOptions.rateURL(data).then((response) => {
this.rateList = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
});
},
},
};
</script>
<style scoped>
.chart-container {
min-height: calc(100vh - 120px - 8px);
background-color: #f0f2f7;
}
.chart-card {
min-height: calc(100vh - 120px - 8px);
background-color: #fff;
padding: 16px;
border-radius: 8px;
}
</style>

View File

@ -0,0 +1,156 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:56:25
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-input
v-model="dataForm.spec"
clearable
placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择单位">
<el-option
v-for="item in urlOptions.dictList.dict0"
:key="item.id"
:label="item.label"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number
v-model="dataForm.dailyUse"
clearable
placeholder="请输入单日消耗量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime">
<el-input-number
v-model="dataForm.allowTime"
clearable
placeholder="请输入允许留存时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="enabled" label="是否可用">
<el-select
v-model="dataForm.enabled"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择是否可用">
<el-option
v-for="item in isorno"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseGoods,
updateWarehouseGoods,
getWarehouseGoods,
getCode,
} from '@/api/warehouse/warehouseGoods';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
getDictList: true,
codeURL: getCode,
createURL: createWarehouseGoods,
updateURL: updateWarehouseGoods,
infoURL: getWarehouseGoods,
},
nameList: ['unit_dict'],
dataForm: {
id: undefined,
code: '',
name: '',
spec: '',
unit: '',
dailyUse: 0,
allowTime: 0,
enabled: 1,
remark: '',
},
dataRule: {
code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' },
],
},
isorno: [
{
id: 0,
name: '不可用',
},
{
id: 1,
name: '可用',
},
],
};
},
methods: {},
};
</script>

View File

@ -0,0 +1,183 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import codeFilter from '../../mixins/code-filter';
import {
deleteWarehouseGoods,
getWarehouseGoodsPage,
} from "@/api/warehouse/warehouseGoods";
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'name',
label: '名称',
},
{
prop: 'code',
label: '编码',
},
{
prop: 'spec',
label: '规格',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
},
{
prop: 'dailyUse',
label: '单日消耗量',
},
{
prop: 'enabled',
label: '是否可用',
filter: codeFilter('deactivate'),
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseGoodsPage,
deleteURL: deleteWarehouseGoods,
},
tableProps,
listQuery:{
storageType:3
},
tableBtn: [
this.$auth.hasPermi(`pack-material:warehouse-goods:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`pack-material:warehouse-goods:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('pack-material:warehouse-goods:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,192 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeHisPage,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '物品名称',
},
{
prop: 'code',
label: '物品编码',
},
{
prop: 'spec',
label: '物品规格',
},
{
prop: 'num',
label: '出入库数量',
},
{
prop: 'goodsBatch',
label: '物品批次',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'operateTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'operator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeHisPage,
},
listQuery: {
storageType: 3,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`pack-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.operateStatus = val.status;
this.listQuery.operateTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,82 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 16:20:19
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseLocationHisDet } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'batchCode',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseLocationHisDet(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,223 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseLocationHisPage,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'createTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'creator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseLocationHisPage,
},
listQuery: {
storageType: 3,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`pack-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(3).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.operateStatus = val.status;
this.listQuery.createTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,221 @@
<!--
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:46:59
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
<el-divider class="divider"></el-divider>
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
</div>
</div>
</div>
</template>
<script>
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
wareData: {
one: [],
two: [],
there: [],
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
formConfig: [
{
type: 'button',
btnName: '刷新',
name: 'search',
color: 'primary',
},
],
};
},
components: {},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
(this.wareData = {
one: [],
two: [],
there: [],
four: [],
}),
listAll(1).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style lang="scss" scoped>
.mainbody {
display: flex;
gap: 70px;
flex-direction: column;
}
.flex-warp {
flex-wrap: nowrap;
}
.dashboard-layout-item {
width: 100px;
text-align: center;
height: 32px;
box-shadow: 0px 3px 6px 0px rgba(166, 174, 190, 0.8);
border-radius: 2px 4px 4px 2px;
margin: 0 3px 8px 0;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.dashboard-layout-item-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
position: absolute;
top: 10px;
left: 3px;
}
.p-name {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 15px;
}
&:hover {
cursor: pointer;
z-index: 10;
transform: scale(1.3) translateZ(0);
}
&:nth-child(2n) {
margin-right: 30px;
}
&:first-child {
margin-left: 50px;
}
&:last-child {
margin-right: 30px;
}
}
.el-divider--horizontal {
margin: 10px 0;
}
.el-divider {
background-color: black;
}
.tips {
position: absolute;
top: 22px;
right: 120px;
}
</style>

View File

@ -0,0 +1,202 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:17:39
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="仓库名称" prop="warehouseName">
<el-input
v-model="dataForm.warehouseName"
readonly
placeholder="请输入仓库名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品名称" prop="goodsId">
<el-select
v-model="dataForm.goodsId"
filterable
clearable
:disabled="dataForm.id ? true : false"
:style="{ width: '100%' }"
@change="setGoodInfo"
placeholder="请选择物品名称">
<el-option
v-for="item in goodsArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品编码" prop="code">
<el-input
v-model="dataForm.code"
readonly
placeholder="请输入物品编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品规格" prop="spec">
<el-input
v-model="dataForm.spec"
readonly
placeholder="请输入物品规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品批次" prop="goodsBatch">
<el-input
v-if="!dataForm.id ? true : false"
v-model="dataForm.goodsBatch"
clearable
placeholder="请输入物品批次" />
<el-select
v-else
v-model="dataForm.goodsBatch"
filterable
clearable
@change="setBatchInfo"
placeholder="请选择物品名称">
<el-option
v-for="(item, index) in Batch"
:key="index"
:label="item.goodsBatch"
:value="item.goodsBatch"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入库数量" prop="numDet">
<el-input-number
v-model="dataForm.numDet"
clearable
:min="0"
:max="max?max:9999999"
placeholder="请输入入库数量" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseRealtime,
outWarehouseRealtime,
getWarehouseRealtime,
getWarehouseRealtimeDet,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
import { mapGetters } from 'vuex';
export default {
mixins: [basicAdd],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getOption: true,
createURL: createWarehouseRealtime,
updateURL: outWarehouseRealtime,
infoURL: getWarehouseRealtime,
},
dataForm: {
id: undefined,
warehouseName: '',
warehouseId: '',
goodsId: '',
code: '',
spec: '',
goodsBatch: '',
numDet: '',
operator: '',
},
goodsArr: [],
Batch: [],
max: 0,
dataRule: {
goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' },
],
goodsBatch: [
{
required: true,
message: '物品批次不能为空,若无请填写无',
trigger: 'blur',
},
],
numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' },
],
},
};
},
created() {},
methods: {
getArr() {
this.dataForm.operator = this.nickname
getListByType(3).then((response) => {
this.goodsArr = response.data;
});
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 3) {
this.dataForm.warehouseName = item.name;
this.dataForm.warehouseId = item.id;
}
});
});
},
setGoodInfo() {
this.goodsArr.forEach((item) => {
if (item.id === this.dataForm.goodsId) {
this.dataForm.code = item.code;
this.dataForm.spec = item.spec;
}
});
},
setBatchInfo(){
this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet
}
});
},
outWare(data) {
this.getArr();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
this.dataForm.realTimeId = data.id;
this.dataForm.id = data.id;
this.dataForm.goodsId = data.goodsId;
this.dataForm.code = data.code;
this.dataForm.spec = data.spec;
getWarehouseRealtimeDet(data.id).then((res) => {
this.Batch = res.data;
});
// this.urlOptions.infoURL(data.id).then((response) => {
// this.dataForm = response.data;
// });
});
},
},
};
</script>

View File

@ -0,0 +1,193 @@
<!--
* @Author: zwq
* @Date: 2023-11-03 16:37:06
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:01:58
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-table
:data="tableData"
:header-cell-style="{
background: '#F2F4F9',
color: '#606266',
}"
border
v-loading="dataListLoading"
style="width: 100%"
ref="dataList">
<el-table-column type="expand">
<template slot-scope="scope">
<product :warehouse-id="scope.row.id"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名称" />
<el-table-column prop="name" label="物品名称" />
<el-table-column prop="code" label="物品编码" />
<el-table-column prop="spec" label="物品规格" />
<el-table-column prop="num" label="数量" />
<el-table-column prop="operator" label="操作人" />
<el-table-column prop="latestInTime" label="最新入库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestInTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="latestOutTime" label="最新出库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="handleClick({ data: scope.row, type: 'out' })"
v-hasPermi="['pack-material:warehouse-realtime:update']">
出库
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import product from './product-mini';
import basicPage from '../../mixins/basic-page';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import AddOrUpdate from './add-or-updata';
import { getWarehouseRealtimePage } from '@/api/warehouse/warehouseRealtime';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimePage,
},
tableData: [],
listQuery: {
storageType: 3,
},
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'datePicker',
label: '最新入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'datePicker',
label: '最新出库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime1',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('pack-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
product,
AddOrUpdate,
},
created() {
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.latestInTime = val.searchTime?val.searchTime:null;
this.listQuery.latestOutTime = val.searchTime1?val.searchTime1:null;
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '入库';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
default:
console.log(val);
}
},
otherMethods(val){
this.addOrUpdateVisible = true;
this.addOrEditTitle = "出库";
this.$nextTick(() => {
this.$refs.addOrUpdate.outWare(val.data);
});
}
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,71 @@
<!--
* @Author: zwq
* @Date: 2023-08-24 14:47:58
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 10:31:56
* @Description:
-->
<template>
<div>
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
max-height="200"
:table-data="tableData" />
</div>
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeDet } from '@/api/warehouse/warehouseRealtime';
const tableProps = [
{
prop: 'goodsBatch',
label: '产品批次',
},
{
prop: 'numDet',
label: '批次数量',
},
{
prop: 'createTime',
label: '入库时间',
filter: parseTime,
},
];
export default {
props: {
warehouseId: {
type: String,
default: '',
},
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeDet
},
tableProps,
tableData: [],
dataListLoading: false,
};
},
components: {
},
created() {},
mounted() {
this.getDataList()
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.warehouseId).then(response => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,93 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:51:33
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'inTime',
label: '入库时间',
align: 'center',
filter: parseTime,
},
{
prop: 'leftTime',
label: '剩余留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseRealtimeLocation(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,122 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
新增产品
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="产品" prop="productInfo">
<el-select
v-model="dataForm.productInfo"
style="width: 100%"
filterable
value-key="id"
placeholder="请选择产品">
<el-option
v-for="item in productArr"
:key="item.id"
:label="item.name"
:value="item" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
getListByType
} from "@/api/warehouse/warehouseGoods";
export default {
data() {
return {
visible: false,
dataForm: {
index: -1,
productInfo: '',
},
productArr: [],
dataRule: {
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(index) {
if (index >= 0) {
this.dataForm.index = index;
}
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
getListByType(3).then((response) => {
this.productArr = response.data;
});
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.dataForm.productInfo.goodsId = this.dataForm.productInfo.id
this.dataForm.productInfo.remark = ''
//
if (this.dataForm.index >= 0) {
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
return;
}
//
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,317 @@
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:destroy-on-close="true"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">库位信息</small-title>
<div class="content">
<div class="visual-part">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
label-position="top"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="库位名称" prop="name">
<el-input
v-model="dataForm.name"
disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="托盘编码" prop="palletCode">
<el-input
v-model="dataForm.palletCode"
@input="$forceUpdate()"
placeholder="请输入托盘编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品信息
<!-- <el-alert
title="产品信息新增和修改后,需点击最下方保存按钮确定修改"
type="warning"
show-icon></el-alert> -->
</small-title>
<div class="attr-list">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="addButtonShow"
@emitButtonClick="addNew"
@emitFun="inputChange"
:height="400"
:table-data="productAttributeList">
<method-btn
slot="handleBtn"
:width="70"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
</div>
</div>
</div>
<div style="position: absolute; bottom: 24px; right: 24px">
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
<span>
<el-button type="primary" @click="dataFormSubmit()">入库</el-button>
</span>
</div>
<product-attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="addList" />
</el-drawer>
</template>
<script>
import productAttrAdd from './attr-add';
import inputArea from '../../mixins/inputArea';
import SmallTitle from './SmallTitle';
import { inWarehouseRealtimeLocation,
getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableBtn = [
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'num',
label: '数量',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'remark',
label: '备注',
align: 'center',
subcomponent: inputArea,
width: 100,
},
];
export default {
components: { productAttrAdd, SmallTitle },
data() {
return {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
productAttributeList: [],
addButtonShow: '新增',
operator: '',
dataForm: {
id: null,
name: '',
palletCode: '',
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataRule: {
// palletCode: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
},
};
},
methods: {
initData() {
this.productAttributeList.splice(0);
},
init(val,nickname) {
this.operator = nickname
this.dataForm.id = val.id;
this.dataForm.name = val.name;
this.dataForm.palletCode = val.palletCode;
this.initData();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
//
this.getList();
}
});
},
getList() {
//
getWarehouseRealtimeLocation(this.dataForm.id).then((response) => {
this.productAttributeList = response.data;
});
},
inputChange(data) {
switch (data.sType) {
case 1:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data[data.prop];
break;
case 2:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data.string ? data.string.split('+')[0] : '';
this.productAttributeList[data._pageIndex - 1][data.prop + 'Name'] =
data.string ? data.string.split('+')[1] : '';
break;
default:
console.log(val);
}
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
this.productAttributeList.splice(raw.data._pageIndex - 1, 1);
})
.catch(() => {});
} else {
this.addNew(raw.data._pageIndex);
}
},
//
dataFormSubmit() {
this.productAttributeList.forEach((item) => {
item.id = '';
});
const data = {
realtimeLocationId : this.dataForm.id,
palletCode : this.dataForm.palletCode,
operator : this.operator,
goodsInfos: this.productAttributeList
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
inWarehouseRealtimeLocation(data).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
}
});
},
// /
addNew(index) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(index);
});
},
addList(data) {
this.productAttributeList.push(data.productInfo);
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
this.initData();
},
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-form-item {
margin: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 10px;
}
.drawer >>> .content {
padding: 0 24px 30px;
display: flex;
flex-direction: column;
height: 100%;
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
</style>

View File

@ -0,0 +1,279 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<drawer
v-if="drawerVisible"
ref="drawerRef"
@refreshDataList="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import Drawer from './drawer';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeLocationPage,
outWarehouseRealtimeLocation,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
import { mapGetters } from 'vuex';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'status',
label: '库位状态',
filter: publicFormatter('AreaDetStatus'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'inTime',
label: '入库时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeLocationPage,
outURL: outWarehouseRealtimeLocation,
},
listQuery: {
storageType: 3,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
? {
type: 'out',
btnName: '出库',
}
: undefined,
this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
? {
type: 'in',
btnName: '入库',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '库位状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
Drawer,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'AreaDetStatus',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(3).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.status = val.status;
this.listQuery.inTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'out') {
this.$confirm(
`确定对${'[名称=' + val.data.name + ']'}执行出库操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
const data = {
realtimeLocationId: val.data.id,
operator: this.nickname,
};
this.urlOptions.outURL(data).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => {});
} else if (val.type === 'in') {
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs.drawerRef.init(val.data, this.nickname);
});
} else if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,96 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:24:11
* @Description:
-->
<template>
<el-row :gutter="10" class="chart-container">
<el-col :span="14">
<div class="chart-card">
<barChart
ref="barChart"
height="500px"
title="库存总览"
v-if="overviewList.length"
:histogram="overviewList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
<el-col :span="10">
<div class="chart-card">
<pieChart
ref="pieChart"
height="600px"
v-if="rateList.length"
:pie-data="rateList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
</el-row>
</template>
<script>
import barChart from '../../chart/BarChart.vue';
import pieChart from '../../chart/PieChart.vue';
import {
getOverview,
getRate,
} from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
urlOptions: {
allURL: getOverview,
rateURL: getRate
},
overviewList: [],
rateList: []
};
},
components: {
barChart,
pieChart
},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
const data = {
storageType : 4
}
this.urlOptions.allURL(data).then((response) => {
this.overviewList = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
this.urlOptions.rateURL(data).then((response) => {
this.rateList = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
});
},
},
};
</script>
<style scoped>
.chart-container {
min-height: calc(100vh - 120px - 8px);
background-color: #f0f2f7;
}
.chart-card {
min-height: calc(100vh - 120px - 8px);
background-color: #fff;
padding: 16px;
border-radius: 8px;
}
</style>

View File

@ -0,0 +1,156 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:56:25
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-input
v-model="dataForm.spec"
clearable
placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择单位">
<el-option
v-for="item in urlOptions.dictList.dict0"
:key="item.id"
:label="item.label"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number
v-model="dataForm.dailyUse"
clearable
placeholder="请输入单日消耗量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime">
<el-input-number
v-model="dataForm.allowTime"
clearable
placeholder="请输入允许留存时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="enabled" label="是否可用">
<el-select
v-model="dataForm.enabled"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择是否可用">
<el-option
v-for="item in isorno"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseGoods,
updateWarehouseGoods,
getWarehouseGoods,
getCode,
} from '@/api/warehouse/warehouseGoods';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
getDictList: true,
codeURL: getCode,
createURL: createWarehouseGoods,
updateURL: updateWarehouseGoods,
infoURL: getWarehouseGoods,
},
nameList: ['unit_dict'],
dataForm: {
id: undefined,
code: '',
name: '',
spec: '',
unit: '',
dailyUse: 0,
allowTime: 0,
enabled: 1,
remark: '',
},
dataRule: {
code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' },
],
},
isorno: [
{
id: 0,
name: '不可用',
},
{
id: 1,
name: '可用',
},
],
};
},
methods: {},
};
</script>

View File

@ -0,0 +1,183 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import codeFilter from '../../mixins/code-filter';
import {
deleteWarehouseGoods,
getWarehouseGoodsPage,
} from "@/api/warehouse/warehouseGoods";
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'name',
label: '名称',
},
{
prop: 'code',
label: '编码',
},
{
prop: 'spec',
label: '规格',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
},
{
prop: 'dailyUse',
label: '单日消耗量',
},
{
prop: 'enabled',
label: '是否可用',
filter: codeFilter('deactivate'),
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseGoodsPage,
deleteURL: deleteWarehouseGoods,
},
tableProps,
listQuery:{
storageType:4
},
tableBtn: [
this.$auth.hasPermi(`part-material:warehouse-goods:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`part-material:warehouse-goods:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('part-material:warehouse-goods:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,192 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeHisPage,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '物品名称',
},
{
prop: 'code',
label: '物品编码',
},
{
prop: 'spec',
label: '物品规格',
},
{
prop: 'num',
label: '出入库数量',
},
{
prop: 'goodsBatch',
label: '物品批次',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'operateTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'operator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeHisPage,
},
listQuery: {
storageType: 4,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`part-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.operateStatus = val.status;
this.listQuery.operateTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,82 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 16:20:19
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseLocationHisDet } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'batchCode',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseLocationHisDet(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,223 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseLocationHisPage,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'createTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'creator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseLocationHisPage,
},
listQuery: {
storageType: 4,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`part-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.operateStatus = val.status;
this.listQuery.createTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,221 @@
<!--
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:46:59
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
<el-divider class="divider"></el-divider>
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
</div>
</div>
</div>
</template>
<script>
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
wareData: {
one: [],
two: [],
there: [],
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
formConfig: [
{
type: 'button',
btnName: '刷新',
name: 'search',
color: 'primary',
},
],
};
},
components: {},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
(this.wareData = {
one: [],
two: [],
there: [],
four: [],
}),
listAll(1).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style lang="scss" scoped>
.mainbody {
display: flex;
gap: 70px;
flex-direction: column;
}
.flex-warp {
flex-wrap: nowrap;
}
.dashboard-layout-item {
width: 100px;
text-align: center;
height: 32px;
box-shadow: 0px 3px 6px 0px rgba(166, 174, 190, 0.8);
border-radius: 2px 4px 4px 2px;
margin: 0 3px 8px 0;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.dashboard-layout-item-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
position: absolute;
top: 10px;
left: 3px;
}
.p-name {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 15px;
}
&:hover {
cursor: pointer;
z-index: 10;
transform: scale(1.3) translateZ(0);
}
&:nth-child(2n) {
margin-right: 30px;
}
&:first-child {
margin-left: 50px;
}
&:last-child {
margin-right: 30px;
}
}
.el-divider--horizontal {
margin: 10px 0;
}
.el-divider {
background-color: black;
}
.tips {
position: absolute;
top: 22px;
right: 120px;
}
</style>

View File

@ -0,0 +1,202 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:24:26
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="仓库名称" prop="warehouseName">
<el-input
v-model="dataForm.warehouseName"
readonly
placeholder="请输入仓库名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品名称" prop="goodsId">
<el-select
v-model="dataForm.goodsId"
filterable
clearable
:disabled="dataForm.id ? true : false"
:style="{ width: '100%' }"
@change="setGoodInfo"
placeholder="请选择物品名称">
<el-option
v-for="item in goodsArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品编码" prop="code">
<el-input
v-model="dataForm.code"
readonly
placeholder="请输入物品编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品规格" prop="spec">
<el-input
v-model="dataForm.spec"
readonly
placeholder="请输入物品规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品批次" prop="goodsBatch">
<el-input
v-if="!dataForm.id ? true : false"
v-model="dataForm.goodsBatch"
clearable
placeholder="请输入物品批次" />
<el-select
v-else
v-model="dataForm.goodsBatch"
filterable
clearable
@change="setBatchInfo"
placeholder="请选择物品名称">
<el-option
v-for="(item, index) in Batch"
:key="index"
:label="item.goodsBatch"
:value="item.goodsBatch"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入库数量" prop="numDet">
<el-input-number
v-model="dataForm.numDet"
clearable
:min="0"
:max="max?max:9999999"
placeholder="请输入入库数量" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseRealtime,
outWarehouseRealtime,
getWarehouseRealtime,
getWarehouseRealtimeDet,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
import { mapGetters } from 'vuex';
export default {
mixins: [basicAdd],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getOption: true,
createURL: createWarehouseRealtime,
updateURL: outWarehouseRealtime,
infoURL: getWarehouseRealtime,
},
dataForm: {
id: undefined,
warehouseName: '',
warehouseId: '',
goodsId: '',
code: '',
spec: '',
goodsBatch: '',
numDet: '',
operator: '',
},
goodsArr: [],
Batch: [],
max: 0,
dataRule: {
goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' },
],
goodsBatch: [
{
required: true,
message: '物品批次不能为空,若无请填写无',
trigger: 'blur',
},
],
numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' },
],
},
};
},
created() {},
methods: {
getArr() {
this.dataForm.operator = this.nickname
getListByType(4).then((response) => {
this.goodsArr = response.data;
});
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 4) {
this.dataForm.warehouseName = item.name;
this.dataForm.warehouseId = item.id;
}
});
});
},
setGoodInfo() {
this.goodsArr.forEach((item) => {
if (item.id === this.dataForm.goodsId) {
this.dataForm.code = item.code;
this.dataForm.spec = item.spec;
}
});
},
setBatchInfo(){
this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet
}
});
},
outWare(data) {
this.getArr();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
this.dataForm.realTimeId = data.id;
this.dataForm.id = data.id;
this.dataForm.goodsId = data.goodsId;
this.dataForm.code = data.code;
this.dataForm.spec = data.spec;
getWarehouseRealtimeDet(data.id).then((res) => {
this.Batch = res.data;
});
// this.urlOptions.infoURL(data.id).then((response) => {
// this.dataForm = response.data;
// });
});
},
},
};
</script>

View File

@ -0,0 +1,193 @@
<!--
* @Author: zwq
* @Date: 2023-11-03 16:37:06
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:24:57
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-table
:data="tableData"
:header-cell-style="{
background: '#F2F4F9',
color: '#606266',
}"
border
v-loading="dataListLoading"
style="width: 100%"
ref="dataList">
<el-table-column type="expand">
<template slot-scope="scope">
<product :warehouse-id="scope.row.id"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名称" />
<el-table-column prop="name" label="物品名称" />
<el-table-column prop="code" label="物品编码" />
<el-table-column prop="spec" label="物品规格" />
<el-table-column prop="num" label="数量" />
<el-table-column prop="operator" label="操作人" />
<el-table-column prop="latestInTime" label="最新入库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestInTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="latestOutTime" label="最新出库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="handleClick({ data: scope.row, type: 'out' })"
v-hasPermi="['part-material:warehouse-realtime:update']">
出库
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import product from './product-mini';
import basicPage from '../../mixins/basic-page';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import AddOrUpdate from './add-or-updata';
import { getWarehouseRealtimePage } from '@/api/warehouse/warehouseRealtime';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimePage,
},
tableData: [],
listQuery: {
storageType: 4,
},
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'datePicker',
label: '最新入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'datePicker',
label: '最新出库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime1',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('part-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
product,
AddOrUpdate,
},
created() {
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.latestInTime = val.searchTime?val.searchTime:null;
this.listQuery.latestOutTime = val.searchTime1?val.searchTime1:null;
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '入库';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
default:
console.log(val);
}
},
otherMethods(val){
this.addOrUpdateVisible = true;
this.addOrEditTitle = "出库";
this.$nextTick(() => {
this.$refs.addOrUpdate.outWare(val.data);
});
}
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,71 @@
<!--
* @Author: zwq
* @Date: 2023-08-24 14:47:58
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 10:31:56
* @Description:
-->
<template>
<div>
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
max-height="200"
:table-data="tableData" />
</div>
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeDet } from '@/api/warehouse/warehouseRealtime';
const tableProps = [
{
prop: 'goodsBatch',
label: '产品批次',
},
{
prop: 'numDet',
label: '批次数量',
},
{
prop: 'createTime',
label: '入库时间',
filter: parseTime,
},
];
export default {
props: {
warehouseId: {
type: String,
default: '',
},
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeDet
},
tableProps,
tableData: [],
dataListLoading: false,
};
},
components: {
},
created() {},
mounted() {
this.getDataList()
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.warehouseId).then(response => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,93 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:51:33
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'inTime',
label: '入库时间',
align: 'center',
filter: parseTime,
},
{
prop: 'leftTime',
label: '剩余留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseRealtimeLocation(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,122 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
新增产品
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="产品" prop="productInfo">
<el-select
v-model="dataForm.productInfo"
style="width: 100%"
filterable
value-key="id"
placeholder="请选择产品">
<el-option
v-for="item in productArr"
:key="item.id"
:label="item.name"
:value="item" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
getListByType
} from "@/api/warehouse/warehouseGoods";
export default {
data() {
return {
visible: false,
dataForm: {
index: -1,
productInfo: '',
},
productArr: [],
dataRule: {
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(index) {
if (index >= 0) {
this.dataForm.index = index;
}
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
getListByType(4).then((response) => {
this.productArr = response.data;
});
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.dataForm.productInfo.goodsId = this.dataForm.productInfo.id
this.dataForm.productInfo.remark = ''
//
if (this.dataForm.index >= 0) {
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
return;
}
//
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,317 @@
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:destroy-on-close="true"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">库位信息</small-title>
<div class="content">
<div class="visual-part">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
label-position="top"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="库位名称" prop="name">
<el-input
v-model="dataForm.name"
disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="托盘编码" prop="palletCode">
<el-input
v-model="dataForm.palletCode"
@input="$forceUpdate()"
placeholder="请输入托盘编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品信息
<!-- <el-alert
title="产品信息新增和修改后,需点击最下方保存按钮确定修改"
type="warning"
show-icon></el-alert> -->
</small-title>
<div class="attr-list">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="addButtonShow"
@emitButtonClick="addNew"
@emitFun="inputChange"
:height="400"
:table-data="productAttributeList">
<method-btn
slot="handleBtn"
:width="70"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
</div>
</div>
</div>
<div style="position: absolute; bottom: 24px; right: 24px">
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
<span>
<el-button type="primary" @click="dataFormSubmit()">入库</el-button>
</span>
</div>
<product-attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="addList" />
</el-drawer>
</template>
<script>
import productAttrAdd from './attr-add';
import inputArea from '../../mixins/inputArea';
import SmallTitle from './SmallTitle';
import { inWarehouseRealtimeLocation,
getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableBtn = [
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'num',
label: '数量',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'remark',
label: '备注',
align: 'center',
subcomponent: inputArea,
width: 100,
},
];
export default {
components: { productAttrAdd, SmallTitle },
data() {
return {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
productAttributeList: [],
addButtonShow: '新增',
operator: '',
dataForm: {
id: null,
name: '',
palletCode: '',
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataRule: {
// palletCode: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
},
};
},
methods: {
initData() {
this.productAttributeList.splice(0);
},
init(val,nickname) {
this.operator = nickname
this.dataForm.id = val.id;
this.dataForm.name = val.name;
this.dataForm.palletCode = val.palletCode;
this.initData();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
//
this.getList();
}
});
},
getList() {
//
getWarehouseRealtimeLocation(this.dataForm.id).then((response) => {
this.productAttributeList = response.data;
});
},
inputChange(data) {
switch (data.sType) {
case 1:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data[data.prop];
break;
case 2:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data.string ? data.string.split('+')[0] : '';
this.productAttributeList[data._pageIndex - 1][data.prop + 'Name'] =
data.string ? data.string.split('+')[1] : '';
break;
default:
console.log(val);
}
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
this.productAttributeList.splice(raw.data._pageIndex - 1, 1);
})
.catch(() => {});
} else {
this.addNew(raw.data._pageIndex);
}
},
//
dataFormSubmit() {
this.productAttributeList.forEach((item) => {
item.id = '';
});
const data = {
realtimeLocationId : this.dataForm.id,
palletCode : this.dataForm.palletCode,
operator : this.operator,
goodsInfos: this.productAttributeList
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
inWarehouseRealtimeLocation(data).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
}
});
},
// /
addNew(index) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(index);
});
},
addList(data) {
this.productAttributeList.push(data.productInfo);
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
this.initData();
},
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-form-item {
margin: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 10px;
}
.drawer >>> .content {
padding: 0 24px 30px;
display: flex;
flex-direction: column;
height: 100%;
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
</style>

View File

@ -0,0 +1,279 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<drawer
v-if="drawerVisible"
ref="drawerRef"
@refreshDataList="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import Drawer from './drawer';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeLocationPage,
outWarehouseRealtimeLocation,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
import { mapGetters } from 'vuex';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'status',
label: '库位状态',
filter: publicFormatter('AreaDetStatus'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'inTime',
label: '入库时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeLocationPage,
outURL: outWarehouseRealtimeLocation,
},
listQuery: {
storageType: 4,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
? {
type: 'out',
btnName: '出库',
}
: undefined,
this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
? {
type: 'in',
btnName: '入库',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '库位状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
Drawer,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'AreaDetStatus',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.status = val.status;
this.listQuery.inTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'out') {
this.$confirm(
`确定对${'[名称=' + val.data.name + ']'}执行出库操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
const data = {
realtimeLocationId: val.data.id,
operator: this.nickname,
};
this.urlOptions.outURL(data).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => {});
} else if (val.type === 'in') {
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs.drawerRef.init(val.data, this.nickname);
});
} else if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,96 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 15:18:38
* @Description:
-->
<template>
<el-row :gutter="10" class="chart-container">
<el-col :span="14">
<div class="chart-card">
<barChart
ref="barChart"
height="500px"
title="库存总览"
v-if="overviewList.length"
:histogram="overviewList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
<el-col :span="10">
<div class="chart-card">
<pieChart
ref="pieChart"
height="600px"
v-if="rateList.length"
:pie-data="rateList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
</el-row>
</template>
<script>
import barChart from '../../chart/BarChart.vue';
import pieChart from '../../chart/PieChart.vue';
import {
getOverview,
getRate,
} from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
urlOptions: {
allURL: getOverview,
rateURL: getRate
},
overviewList: [],
rateList: []
};
},
components: {
barChart,
pieChart
},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
const data = {
storageType : 1
}
this.urlOptions.allURL(data).then((response) => {
this.overviewList = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
this.urlOptions.rateURL(data).then((response) => {
this.rateList = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
});
},
},
};
</script>
<style scoped>
.chart-container {
min-height: calc(100vh - 120px - 8px);
background-color: #f0f2f7;
}
.chart-card {
min-height: calc(100vh - 120px - 8px);
background-color: #fff;
padding: 16px;
border-radius: 8px;
}
</style>

View File

@ -0,0 +1,156 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:56:25
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-input
v-model="dataForm.spec"
clearable
placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择单位">
<el-option
v-for="item in urlOptions.dictList.dict0"
:key="item.id"
:label="item.label"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number
v-model="dataForm.dailyUse"
clearable
placeholder="请输入单日消耗量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime">
<el-input-number
v-model="dataForm.allowTime"
clearable
placeholder="请输入允许留存时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="enabled" label="是否可用">
<el-select
v-model="dataForm.enabled"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择是否可用">
<el-option
v-for="item in isorno"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseGoods,
updateWarehouseGoods,
getWarehouseGoods,
getCode,
} from '@/api/warehouse/warehouseGoods';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
getDictList: true,
codeURL: getCode,
createURL: createWarehouseGoods,
updateURL: updateWarehouseGoods,
infoURL: getWarehouseGoods,
},
nameList: ['unit_dict'],
dataForm: {
id: undefined,
code: '',
name: '',
spec: '',
unit: '',
dailyUse: 0,
allowTime: 0,
enabled: 1,
remark: '',
},
dataRule: {
code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' },
],
},
isorno: [
{
id: 0,
name: '不可用',
},
{
id: 1,
name: '可用',
},
],
};
},
methods: {},
};
</script>

View File

@ -0,0 +1,183 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import codeFilter from '../../mixins/code-filter';
import {
deleteWarehouseGoods,
getWarehouseGoodsPage,
} from "@/api/warehouse/warehouseGoods";
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'name',
label: '名称',
},
{
prop: 'code',
label: '编码',
},
{
prop: 'spec',
label: '规格',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
},
{
prop: 'dailyUse',
label: '单日消耗量',
},
{
prop: 'enabled',
label: '是否可用',
filter: codeFilter('deactivate'),
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseGoodsPage,
deleteURL: deleteWarehouseGoods,
},
tableProps,
listQuery:{
storageType:1
},
tableBtn: [
this.$auth.hasPermi(`raw-material:warehouse-goods:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`raw-material:warehouse-goods:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('raw-material:warehouse-goods:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,192 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeHisPage,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '物品名称',
},
{
prop: 'code',
label: '物品编码',
},
{
prop: 'spec',
label: '物品规格',
},
{
prop: 'num',
label: '出入库数量',
},
{
prop: 'goodsBatch',
label: '物品批次',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'operateTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'operator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeHisPage,
},
listQuery: {
storageType: 1,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`raw-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
getListByType(1).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.operateStatus = val.status;
this.listQuery.operateTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,82 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 16:20:19
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseLocationHisDet } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'batchCode',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseLocationHisDet(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,223 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseLocationHisPage,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'createTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'creator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseLocationHisPage,
},
listQuery: {
storageType: 1,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`raw-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(1).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.operateStatus = val.status;
this.listQuery.createTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,221 @@
<!--
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:46:59
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
<el-divider class="divider"></el-divider>
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
</div>
</div>
</div>
</template>
<script>
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
wareData: {
one: [],
two: [],
there: [],
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
formConfig: [
{
type: 'button',
btnName: '刷新',
name: 'search',
color: 'primary',
},
],
};
},
components: {},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
(this.wareData = {
one: [],
two: [],
there: [],
four: [],
}),
listAll(1).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style lang="scss" scoped>
.mainbody {
display: flex;
gap: 70px;
flex-direction: column;
}
.flex-warp {
flex-wrap: nowrap;
}
.dashboard-layout-item {
width: 100px;
text-align: center;
height: 32px;
box-shadow: 0px 3px 6px 0px rgba(166, 174, 190, 0.8);
border-radius: 2px 4px 4px 2px;
margin: 0 3px 8px 0;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.dashboard-layout-item-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
position: absolute;
top: 10px;
left: 3px;
}
.p-name {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 15px;
}
&:hover {
cursor: pointer;
z-index: 10;
transform: scale(1.3) translateZ(0);
}
&:nth-child(2n) {
margin-right: 30px;
}
&:first-child {
margin-left: 50px;
}
&:last-child {
margin-right: 30px;
}
}
.el-divider--horizontal {
margin: 10px 0;
}
.el-divider {
background-color: black;
}
.tips {
position: absolute;
top: 22px;
right: 120px;
}
</style>

View File

@ -0,0 +1,202 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:17:39
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="仓库名称" prop="warehouseName">
<el-input
v-model="dataForm.warehouseName"
readonly
placeholder="请输入仓库名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品名称" prop="goodsId">
<el-select
v-model="dataForm.goodsId"
filterable
clearable
:disabled="dataForm.id ? true : false"
:style="{ width: '100%' }"
@change="setGoodInfo"
placeholder="请选择物品名称">
<el-option
v-for="item in goodsArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品编码" prop="code">
<el-input
v-model="dataForm.code"
readonly
placeholder="请输入物品编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品规格" prop="spec">
<el-input
v-model="dataForm.spec"
readonly
placeholder="请输入物品规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品批次" prop="goodsBatch">
<el-input
v-if="!dataForm.id ? true : false"
v-model="dataForm.goodsBatch"
clearable
placeholder="请输入物品批次" />
<el-select
v-else
v-model="dataForm.goodsBatch"
filterable
clearable
@change="setBatchInfo"
placeholder="请选择物品名称">
<el-option
v-for="(item, index) in Batch"
:key="index"
:label="item.goodsBatch"
:value="item.goodsBatch"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入库数量" prop="numDet">
<el-input-number
v-model="dataForm.numDet"
clearable
:min="0"
:max="max?max:9999999"
placeholder="请输入入库数量" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseRealtime,
outWarehouseRealtime,
getWarehouseRealtime,
getWarehouseRealtimeDet,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
import { mapGetters } from 'vuex';
export default {
mixins: [basicAdd],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getOption: true,
createURL: createWarehouseRealtime,
updateURL: outWarehouseRealtime,
infoURL: getWarehouseRealtime,
},
dataForm: {
id: undefined,
warehouseName: '',
warehouseId: '',
goodsId: '',
code: '',
spec: '',
goodsBatch: '',
numDet: '',
operator: '',
},
goodsArr: [],
Batch: [],
max: 0,
dataRule: {
goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' },
],
goodsBatch: [
{
required: true,
message: '物品批次不能为空,若无请填写无',
trigger: 'blur',
},
],
numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' },
],
},
};
},
created() {},
methods: {
getArr() {
this.dataForm.operator = this.nickname
getListByType(1).then((response) => {
this.goodsArr = response.data;
});
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 1) {
this.dataForm.warehouseName = item.name;
this.dataForm.warehouseId = item.id;
}
});
});
},
setGoodInfo() {
this.goodsArr.forEach((item) => {
if (item.id === this.dataForm.goodsId) {
this.dataForm.code = item.code;
this.dataForm.spec = item.spec;
}
});
},
setBatchInfo(){
this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet
}
});
},
outWare(data) {
this.getArr();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
this.dataForm.realTimeId = data.id;
this.dataForm.id = data.id;
this.dataForm.goodsId = data.goodsId;
this.dataForm.code = data.code;
this.dataForm.spec = data.spec;
getWarehouseRealtimeDet(data.id).then((res) => {
this.Batch = res.data;
});
// this.urlOptions.infoURL(data.id).then((response) => {
// this.dataForm = response.data;
// });
});
},
},
};
</script>

View File

@ -0,0 +1,193 @@
<!--
* @Author: zwq
* @Date: 2023-11-03 16:37:06
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:13:47
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-table
:data="tableData"
:header-cell-style="{
background: '#F2F4F9',
color: '#606266',
}"
border
v-loading="dataListLoading"
style="width: 100%"
ref="dataList">
<el-table-column type="expand">
<template slot-scope="scope">
<product :warehouse-id="scope.row.id"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名称" />
<el-table-column prop="name" label="物品名称" />
<el-table-column prop="code" label="物品编码" />
<el-table-column prop="spec" label="物品规格" />
<el-table-column prop="num" label="数量" />
<el-table-column prop="operator" label="操作人" />
<el-table-column prop="latestInTime" label="最新入库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestInTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="latestOutTime" label="最新出库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="handleClick({ data: scope.row, type: 'out' })"
v-hasPermi="['raw-material:warehouse-realtime:update']">
出库
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import product from './product-mini';
import basicPage from '../../mixins/basic-page';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import AddOrUpdate from './add-or-updata';
import { getWarehouseRealtimePage } from '@/api/warehouse/warehouseRealtime';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimePage,
},
tableData: [],
listQuery: {
storageType: 1,
},
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'datePicker',
label: '最新入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'datePicker',
label: '最新出库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime1',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('raw-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
product,
AddOrUpdate,
},
created() {
getListByType(1).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.latestInTime = val.searchTime?val.searchTime:null;
this.listQuery.latestOutTime = val.searchTime1?val.searchTime1:null;
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '入库';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
default:
console.log(val);
}
},
otherMethods(val){
this.addOrUpdateVisible = true;
this.addOrEditTitle = "出库";
this.$nextTick(() => {
this.$refs.addOrUpdate.outWare(val.data);
});
}
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,71 @@
<!--
* @Author: zwq
* @Date: 2023-08-24 14:47:58
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 10:31:56
* @Description:
-->
<template>
<div>
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
max-height="200"
:table-data="tableData" />
</div>
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeDet } from '@/api/warehouse/warehouseRealtime';
const tableProps = [
{
prop: 'goodsBatch',
label: '产品批次',
},
{
prop: 'numDet',
label: '批次数量',
},
{
prop: 'createTime',
label: '入库时间',
filter: parseTime,
},
];
export default {
props: {
warehouseId: {
type: String,
default: '',
},
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeDet
},
tableProps,
tableData: [],
dataListLoading: false,
};
},
components: {
},
created() {},
mounted() {
this.getDataList()
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.warehouseId).then(response => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,93 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:51:33
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'inTime',
label: '入库时间',
align: 'center',
filter: parseTime,
},
{
prop: 'leftTime',
label: '剩余留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseRealtimeLocation(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,122 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
新增产品
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="产品" prop="productInfo">
<el-select
v-model="dataForm.productInfo"
style="width: 100%"
filterable
value-key="id"
placeholder="请选择产品">
<el-option
v-for="item in productArr"
:key="item.id"
:label="item.name"
:value="item" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
getListByType
} from "@/api/warehouse/warehouseGoods";
export default {
data() {
return {
visible: false,
dataForm: {
index: -1,
productInfo: '',
},
productArr: [],
dataRule: {
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(index) {
if (index >= 0) {
this.dataForm.index = index;
}
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
getListByType(1).then((response) => {
this.productArr = response.data;
});
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.dataForm.productInfo.goodsId = this.dataForm.productInfo.id
this.dataForm.productInfo.remark = ''
//
if (this.dataForm.index >= 0) {
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
return;
}
//
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,317 @@
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:destroy-on-close="true"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">库位信息</small-title>
<div class="content">
<div class="visual-part">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
label-position="top"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="库位名称" prop="name">
<el-input
v-model="dataForm.name"
disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="托盘编码" prop="palletCode">
<el-input
v-model="dataForm.palletCode"
@input="$forceUpdate()"
placeholder="请输入托盘编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品信息
<!-- <el-alert
title="产品信息新增和修改后,需点击最下方保存按钮确定修改"
type="warning"
show-icon></el-alert> -->
</small-title>
<div class="attr-list">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="addButtonShow"
@emitButtonClick="addNew"
@emitFun="inputChange"
:height="400"
:table-data="productAttributeList">
<method-btn
slot="handleBtn"
:width="70"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
</div>
</div>
</div>
<div style="position: absolute; bottom: 24px; right: 24px">
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
<span>
<el-button type="primary" @click="dataFormSubmit()">入库</el-button>
</span>
</div>
<product-attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="addList" />
</el-drawer>
</template>
<script>
import productAttrAdd from './attr-add';
import inputArea from '../../mixins/inputArea';
import SmallTitle from './SmallTitle';
import { inWarehouseRealtimeLocation,
getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableBtn = [
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'num',
label: '数量',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'remark',
label: '备注',
align: 'center',
subcomponent: inputArea,
width: 100,
},
];
export default {
components: { productAttrAdd, SmallTitle },
data() {
return {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
productAttributeList: [],
addButtonShow: '新增',
operator: '',
dataForm: {
id: null,
name: '',
palletCode: '',
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataRule: {
// palletCode: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
},
};
},
methods: {
initData() {
this.productAttributeList.splice(0);
},
init(val,nickname) {
this.operator = nickname
this.dataForm.id = val.id;
this.dataForm.name = val.name;
this.dataForm.palletCode = val.palletCode;
this.initData();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
//
this.getList();
}
});
},
getList() {
//
getWarehouseRealtimeLocation(this.dataForm.id).then((response) => {
this.productAttributeList = response.data;
});
},
inputChange(data) {
switch (data.sType) {
case 1:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data[data.prop];
break;
case 2:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data.string ? data.string.split('+')[0] : '';
this.productAttributeList[data._pageIndex - 1][data.prop + 'Name'] =
data.string ? data.string.split('+')[1] : '';
break;
default:
console.log(val);
}
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
this.productAttributeList.splice(raw.data._pageIndex - 1, 1);
})
.catch(() => {});
} else {
this.addNew(raw.data._pageIndex);
}
},
//
dataFormSubmit() {
this.productAttributeList.forEach((item) => {
item.id = '';
});
const data = {
realtimeLocationId : this.dataForm.id,
palletCode : this.dataForm.palletCode,
operator : this.operator,
goodsInfos: this.productAttributeList
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
inWarehouseRealtimeLocation(data).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
}
});
},
// /
addNew(index) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(index);
});
},
addList(data) {
this.productAttributeList.push(data.productInfo);
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
this.initData();
},
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-form-item {
margin: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 10px;
}
.drawer >>> .content {
padding: 0 24px 30px;
display: flex;
flex-direction: column;
height: 100%;
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
</style>

View File

@ -0,0 +1,279 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<drawer
v-if="drawerVisible"
ref="drawerRef"
@refreshDataList="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import Drawer from './drawer';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeLocationPage,
outWarehouseRealtimeLocation,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
import { mapGetters } from 'vuex';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'status',
label: '库位状态',
filter: publicFormatter('AreaDetStatus'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'inTime',
label: '入库时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeLocationPage,
outURL: outWarehouseRealtimeLocation,
},
listQuery: {
storageType: 1,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`)
? {
type: 'out',
btnName: '出库',
}
: undefined,
this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`)
? {
type: 'in',
btnName: '入库',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '库位状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
Drawer,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'AreaDetStatus',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(1).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.status = val.status;
this.listQuery.inTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'out') {
this.$confirm(
`确定对${'[名称=' + val.data.name + ']'}执行出库操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
const data = {
realtimeLocationId: val.data.id,
operator: this.nickname,
};
this.urlOptions.outURL(data).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => {});
} else if (val.type === 'in') {
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs.drawerRef.init(val.data, this.nickname);
});
} else if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,272 @@
<!-- 仓库信息 -->
<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="code">
<el-input v-model="queryParams.code" placeholder="请输入编码" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="仓库类型 1.有库位 2.无库位" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择仓库类型 1.有库位 2.无库位" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="仓库物料类型" prop="storageType">
<el-select v-model="queryParams.storageType" placeholder="请选择仓库物料类型" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="queryParams.enabled" placeholder="请输入启用状态:0 、停用1、启用" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="queryParams.version" placeholder="请输入版本号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" 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-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">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['extend:warehouse:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['extend:warehouse:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="编码" align="center" prop="code" />
<el-table-column label="名称" align="center" prop="name" />
<el-table-column label="仓库类型 1.有库位 2.无库位" align="center" prop="type" />
<el-table-column label="仓库物料类型" align="center" prop="storageType" />
<el-table-column label="启用状态:0 、停用1、启用" align="center" prop="enabled" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['extend:warehouse:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['extend:warehouse:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="编码" prop="code">
<el-input v-model="form.code" placeholder="请输入编码" />
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="仓库类型 1.有库位 2.无库位" prop="type">
<el-select v-model="form.type" placeholder="请选择仓库类型 1.有库位 2.无库位">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="仓库物料类型" prop="storageType">
<el-select v-model="form.storageType" placeholder="请选择仓库物料类型">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="form.enabled" placeholder="请输入启用状态:0 、停用1、启用" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" placeholder="请输入版本号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createWarehouse, updateWarehouse, deleteWarehouse, getWarehouse, getWarehousePage, exportWarehouseExcel } from "./warehouse";
export default {
name: "Warehouse",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
code: null,
name: null,
type: null,
storageType: null,
enabled: null,
remark: null,
version: null,
createTime: [],
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getWarehousePage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
code: undefined,
name: undefined,
type: undefined,
storageType: undefined,
enabled: undefined,
remark: undefined,
version: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加仓库";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getWarehouse(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改仓库";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateWarehouse(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createWarehouse(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除仓库编号为"' + id + '"的数据项?').then(function() {
return deleteWarehouse(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有仓库数据项?').then(() => {
this.exportLoading = true;
return exportWarehouseExcel(params);
}).then(response => {
this.$download.excel(response, '仓库.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建仓库
export function createWarehouse(data) {
return request({
url: '/extend/warehouse/create',
method: 'post',
data: data
})
}
// 更新仓库
export function updateWarehouse(data) {
return request({
url: '/extend/warehouse/update',
method: 'put',
data: data
})
}
// 删除仓库
export function deleteWarehouse(id) {
return request({
url: '/extend/warehouse/delete?id=' + id,
method: 'delete'
})
}
// 获得仓库
export function getWarehouse(id) {
return request({
url: '/extend/warehouse/get?id=' + id,
method: 'get'
})
}
// 获得仓库分页
export function getWarehousePage(query) {
return request({
url: '/extend/warehouse/page',
method: 'get',
params: query
})
}
// 导出仓库 Excel
export function exportWarehouseExcel(query) {
return request({
url: '/extend/warehouse/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,297 @@
<!-- 物品信息管理 -->
<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="物品类型 1 原料" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择物品类型 1 原料" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="编码" prop="code">
<el-input v-model="queryParams.code" placeholder="请输入编码" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="规格" prop="spec">
<el-input v-model="queryParams.spec" placeholder="请输入规格" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="单位(字典)" prop="unit">
<el-input v-model="queryParams.unit" placeholder="请输入单位(字典)" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="单日消耗量" prop="dailyUse">
<el-input v-model="queryParams.dailyUse" placeholder="请输入单日消耗量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="允许留存时间" prop="allowTime">
<el-date-picker v-model="queryParams.allowTime" 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-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="queryParams.enabled" placeholder="请输入启用状态:0 、停用1、启用" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="queryParams.version" placeholder="请输入版本号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" 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-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">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['extend:warehouse-goods:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['extend:warehouse-goods:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="物品类型 1 原料" align="center" prop="type" />
<el-table-column label="编码" align="center" prop="code" />
<el-table-column label="名称" align="center" prop="name" />
<el-table-column label="规格" align="center" prop="spec" />
<el-table-column label="单位(字典)" align="center" prop="unit" />
<el-table-column label="单日消耗量" align="center" prop="dailyUse" />
<el-table-column label="允许留存时间" align="center" prop="allowTime" />
<el-table-column label="启用状态:0 、停用1、启用" align="center" prop="enabled" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['extend:warehouse-goods:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['extend:warehouse-goods:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="物品类型 1 原料" prop="type">
<el-select v-model="form.type" placeholder="请选择物品类型 1 原料">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="编码" prop="code">
<el-input v-model="form.code" placeholder="请输入编码" />
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="规格" prop="spec">
<el-input v-model="form.spec" placeholder="请输入规格" />
</el-form-item>
<el-form-item label="单位(字典)" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位(字典)" />
</el-form-item>
<el-form-item label="单日消耗量" prop="dailyUse">
<el-input v-model="form.dailyUse" placeholder="请输入单日消耗量" />
</el-form-item>
<el-form-item label="允许留存时间" prop="allowTime">
<el-date-picker clearable v-model="form.allowTime" type="date" value-format="timestamp" placeholder="选择允许留存时间" />
</el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="form.enabled" placeholder="请输入启用状态:0 、停用1、启用" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" placeholder="请输入版本号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createWarehouseGoods, updateWarehouseGoods, deleteWarehouseGoods, getWarehouseGoods, getWarehouseGoodsPage, exportWarehouseGoodsExcel } from "./warehouseGoods";
export default {
name: "WarehouseGoods",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
type: null,
code: null,
name: null,
spec: null,
unit: null,
dailyUse: null,
allowTime: [],
enabled: null,
remark: null,
version: null,
createTime: [],
},
//
form: {},
//
rules: {
type: [{ required: true, message: "物品类型 1 原料不能为空", trigger: "change" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getWarehouseGoodsPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
type: undefined,
code: undefined,
name: undefined,
spec: undefined,
unit: undefined,
dailyUse: undefined,
allowTime: undefined,
enabled: undefined,
remark: undefined,
version: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加物品";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getWarehouseGoods(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改物品";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateWarehouseGoods(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createWarehouseGoods(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除物品编号为"' + id + '"的数据项?').then(function() {
return deleteWarehouseGoods(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有物品数据项?').then(() => {
this.exportLoading = true;
return exportWarehouseGoodsExcel(params);
}).then(response => {
this.$download.excel(response, '物品.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建物品
export function createWarehouseGoods(data) {
return request({
url: '/extend/warehouse-goods/create',
method: 'post',
data: data
})
}
// 更新物品
export function updateWarehouseGoods(data) {
return request({
url: '/extend/warehouse-goods/update',
method: 'put',
data: data
})
}
// 删除物品
export function deleteWarehouseGoods(id) {
return request({
url: '/extend/warehouse-goods/delete?id=' + id,
method: 'delete'
})
}
// 获得物品
export function getWarehouseGoods(id) {
return request({
url: '/extend/warehouse-goods/get?id=' + id,
method: 'get'
})
}
// 获得物品分页
export function getWarehouseGoodsPage(query) {
return request({
url: '/extend/warehouse-goods/page',
method: 'get',
params: query
})
}
// 导出物品 Excel
export function exportWarehouseGoodsExcel(query) {
return request({
url: '/extend/warehouse-goods/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,310 @@
<!-- 出入库历史记录-无库位 -->
<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="仓库id" prop="warehouseId">
<el-input v-model="queryParams.warehouseId" placeholder="请输入仓库id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="仓库物料类型" prop="storageType">
<el-select v-model="queryParams.storageType" placeholder="请选择仓库物料类型" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="物品id关联物品表" prop="goodsId">
<el-input v-model="queryParams.goodsId" placeholder="请输入物品id关联物品表" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="数量" prop="num">
<el-input v-model="queryParams.num" placeholder="请输入数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="物品批次" prop="goodsBatch">
<el-input v-model="queryParams.goodsBatch" placeholder="请输入物品批次" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="操作状态 1 入库 2 出库" prop="operateStatus">
<el-select v-model="queryParams.operateStatus" placeholder="请选择操作状态 1 入库 2 出库" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="操作人" prop="operator">
<el-input v-model="queryParams.operator" placeholder="请输入操作人" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="操作时间" prop="operateTime">
<el-date-picker v-model="queryParams.operateTime" 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-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="queryParams.enabled" placeholder="请输入启用状态:0 、停用1、启用" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="queryParams.version" placeholder="请输入版本号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" 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-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">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['extend:warehouse-his:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['extend:warehouse-his:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="仓库id" align="center" prop="warehouseId" />
<el-table-column label="仓库物料类型" align="center" prop="storageType" />
<el-table-column label="物品id关联物品表" align="center" prop="goodsId" />
<el-table-column label="数量" align="center" prop="num" />
<el-table-column label="物品批次" align="center" prop="goodsBatch" />
<el-table-column label="操作状态 1 入库 2 出库" align="center" prop="operateStatus" />
<el-table-column label="操作人" align="center" prop="operator" />
<el-table-column label="操作时间" align="center" prop="operateTime" />
<el-table-column label="启用状态:0 、停用1、启用" align="center" prop="enabled" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['extend:warehouse-his:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['extend:warehouse-his:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="仓库id" prop="warehouseId">
<el-input v-model="form.warehouseId" placeholder="请输入仓库id" />
</el-form-item>
<el-form-item label="仓库物料类型" prop="storageType">
<el-select v-model="form.storageType" placeholder="请选择仓库物料类型">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="物品id关联物品表" prop="goodsId">
<el-input v-model="form.goodsId" placeholder="请输入物品id关联物品表" />
</el-form-item>
<el-form-item label="数量" prop="num">
<el-input v-model="form.num" placeholder="请输入数量" />
</el-form-item>
<el-form-item label="物品批次" prop="goodsBatch">
<el-input v-model="form.goodsBatch" placeholder="请输入物品批次" />
</el-form-item>
<el-form-item label="操作状态 1 入库 2 出库" prop="operateStatus">
<el-radio-group v-model="form.operateStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="操作人" prop="operator">
<el-input v-model="form.operator" placeholder="请输入操作人" />
</el-form-item>
<el-form-item label="操作时间" prop="operateTime">
<el-date-picker clearable v-model="form.operateTime" type="date" value-format="timestamp" placeholder="选择操作时间" />
</el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="form.enabled" placeholder="请输入启用状态:0 、停用1、启用" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" placeholder="请输入版本号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createWarehouseHis, updateWarehouseHis, deleteWarehouseHis, getWarehouseHis, getWarehouseHisPage, exportWarehouseHisExcel } from "./warehouseHis";
export default {
name: "WarehouseHis",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
// ()
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
warehouseId: null,
storageType: null,
goodsId: null,
num: null,
goodsBatch: null,
operateStatus: null,
operator: null,
operateTime: [],
enabled: null,
remark: null,
version: null,
createTime: [],
},
//
form: {},
//
rules: {
warehouseId: [{ required: true, message: "仓库id不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getWarehouseHisPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
warehouseId: undefined,
storageType: undefined,
goodsId: undefined,
num: undefined,
goodsBatch: undefined,
operateStatus: undefined,
operator: undefined,
operateTime: undefined,
enabled: undefined,
remark: undefined,
version: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加出入库历史(无库位)";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getWarehouseHis(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改出入库历史(无库位)";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateWarehouseHis(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createWarehouseHis(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除出入库历史(无库位)编号为"' + id + '"的数据项?').then(function() {
return deleteWarehouseHis(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有出入库历史(无库位)数据项?').then(() => {
this.exportLoading = true;
return exportWarehouseHisExcel(params);
}).then(response => {
this.$download.excel(response, '出入库历史(无库位).xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建出入库历史(无库位)
export function createWarehouseHis(data) {
return request({
url: '/extend/warehouse-his/create',
method: 'post',
data: data
})
}
// 更新出入库历史(无库位)
export function updateWarehouseHis(data) {
return request({
url: '/extend/warehouse-his/update',
method: 'put',
data: data
})
}
// 删除出入库历史(无库位)
export function deleteWarehouseHis(id) {
return request({
url: '/extend/warehouse-his/delete?id=' + id,
method: 'delete'
})
}
// 获得出入库历史(无库位)
export function getWarehouseHis(id) {
return request({
url: '/extend/warehouse-his/get?id=' + id,
method: 'get'
})
}
// 获得出入库历史(无库位)分页
export function getWarehouseHisPage(query) {
return request({
url: '/extend/warehouse-his/page',
method: 'get',
params: query
})
}
// 导出出入库历史(无库位) Excel
export function exportWarehouseHisExcel(query) {
return request({
url: '/extend/warehouse-his/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,309 @@
<!-- 库位管理 -->
<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="仓库id" prop="warehouseId">
<el-input v-model="queryParams.warehouseId" placeholder="请输入仓库id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="编码" prop="code">
<el-input v-model="queryParams.code" placeholder="请输入编码" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="排" prop="arrange">
<el-input v-model="queryParams.arrange" placeholder="请输入排" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="列" prop="col">
<el-input v-model="queryParams.col" placeholder="请输入列" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="层" prop="layer">
<el-input v-model="queryParams.layer" placeholder="请输入层" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="库位类型 1.缓存 2.活动 3.其它" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择库位类型 1.缓存 2.活动 3.其它" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="queryParams.enabled" placeholder="请输入启用状态:0 、停用1、启用" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="库位状态:0 、可用1、占用-待入库 2、占用-有货 3、占用-待出库" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择库位状态:0 、可用1、占用-待入库 2、占用-有货 3、占用-待出库" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="queryParams.version" placeholder="请输入版本号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" 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-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">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['extend:warehouse-location:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['extend:warehouse-location:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="仓库id" align="center" prop="warehouseId" />
<el-table-column label="编码" align="center" prop="code" />
<el-table-column label="名称" align="center" prop="name" />
<el-table-column label="排" align="center" prop="arrange" />
<el-table-column label="列" align="center" prop="col" />
<el-table-column label="层" align="center" prop="layer" />
<el-table-column label="库位类型 1.缓存 2.活动 3.其它" align="center" prop="type" />
<el-table-column label="启用状态:0 、停用1、启用" align="center" prop="enabled" />
<el-table-column label="库位状态:0 、可用1、占用-待入库 2、占用-有货 3、占用-待出库" align="center" prop="status" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['extend:warehouse-location:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['extend:warehouse-location:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="仓库id" prop="warehouseId">
<el-input v-model="form.warehouseId" placeholder="请输入仓库id" />
</el-form-item>
<el-form-item label="编码" prop="code">
<el-input v-model="form.code" placeholder="请输入编码" />
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="排" prop="arrange">
<el-input v-model="form.arrange" placeholder="请输入排" />
</el-form-item>
<el-form-item label="列" prop="col">
<el-input v-model="form.col" placeholder="请输入列" />
</el-form-item>
<el-form-item label="层" prop="layer">
<el-input v-model="form.layer" placeholder="请输入层" />
</el-form-item>
<el-form-item label="库位类型 1.缓存 2.活动 3.其它" prop="type">
<el-select v-model="form.type" placeholder="请选择库位类型 1.缓存 2.活动 3.其它">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="form.enabled" placeholder="请输入启用状态:0 、停用1、启用" />
</el-form-item>
<el-form-item label="库位状态:0 、可用1、占用-待入库 2、占用-有货 3、占用-待出库" prop="status">
<el-radio-group v-model="form.status">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" placeholder="请输入版本号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createWarehouseLocation, updateWarehouseLocation, deleteWarehouseLocation, getWarehouseLocation, getWarehouseLocationPage, exportWarehouseLocationExcel } from "./warehouseLocation";
export default {
name: "WarehouseLocation",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
warehouseId: null,
code: null,
name: null,
arrange: null,
col: null,
layer: null,
type: null,
enabled: null,
status: null,
remark: null,
version: null,
createTime: [],
},
//
form: {},
//
rules: {
warehouseId: [{ required: true, message: "仓库id不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getWarehouseLocationPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
warehouseId: undefined,
code: undefined,
name: undefined,
arrange: undefined,
col: undefined,
layer: undefined,
type: undefined,
enabled: undefined,
status: undefined,
remark: undefined,
version: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加库位";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getWarehouseLocation(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改库位";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateWarehouseLocation(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createWarehouseLocation(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除库位编号为"' + id + '"的数据项?').then(function() {
return deleteWarehouseLocation(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有库位数据项?').then(() => {
this.exportLoading = true;
return exportWarehouseLocationExcel(params);
}).then(response => {
this.$download.excel(response, '库位.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建库位
export function createWarehouseLocation(data) {
return request({
url: '/extend/warehouse-location/create',
method: 'post',
data: data
})
}
// 更新库位
export function updateWarehouseLocation(data) {
return request({
url: '/extend/warehouse-location/update',
method: 'put',
data: data
})
}
// 删除库位
export function deleteWarehouseLocation(id) {
return request({
url: '/extend/warehouse-location/delete?id=' + id,
method: 'delete'
})
}
// 获得库位
export function getWarehouseLocation(id) {
return request({
url: '/extend/warehouse-location/get?id=' + id,
method: 'get'
})
}
// 获得库位分页
export function getWarehouseLocationPage(query) {
return request({
url: '/extend/warehouse-location/page',
method: 'get',
params: query
})
}
// 导出库位 Excel
export function exportWarehouseLocationExcel(query) {
return request({
url: '/extend/warehouse-location/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,260 @@
<!-- 出入库历史记录-有库位 -->
<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="库位id" prop="locationId">
<el-input v-model="queryParams.locationId" placeholder="请输入库位id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="托盘编码" prop="palletCode">
<el-input v-model="queryParams.palletCode" placeholder="请输入托盘编码" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="操作状态 1 入库 2 出库" prop="operateStatus">
<el-select v-model="queryParams.operateStatus" placeholder="请选择操作状态 1 入库 2 出库" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="queryParams.enabled" placeholder="请输入启用状态:0 、停用1、启用" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="queryParams.version" placeholder="请输入版本号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间(即操作时间)" prop="createTime">
<el-date-picker v-model="queryParams.createTime" 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-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">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['extend:warehouse-location-his:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['extend:warehouse-location-his:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="库位id" align="center" prop="locationId" />
<el-table-column label="托盘编码" align="center" prop="palletCode" />
<el-table-column label="操作状态 1 入库 2 出库" align="center" prop="operateStatus" />
<el-table-column label="启用状态:0 、停用1、启用" align="center" prop="enabled" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="创建时间(即操作时间)" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['extend:warehouse-location-his:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['extend:warehouse-location-his:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="库位id" prop="locationId">
<el-input v-model="form.locationId" placeholder="请输入库位id" />
</el-form-item>
<el-form-item label="托盘编码" prop="palletCode">
<el-input v-model="form.palletCode" placeholder="请输入托盘编码" />
</el-form-item>
<el-form-item label="操作状态 1 入库 2 出库" prop="operateStatus">
<el-radio-group v-model="form.operateStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="form.enabled" placeholder="请输入启用状态:0 、停用1、启用" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" placeholder="请输入版本号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createWarehouseLocationHis, updateWarehouseLocationHis, deleteWarehouseLocationHis, getWarehouseLocationHis, getWarehouseLocationHisPage, exportWarehouseLocationHisExcel } from "./warehouseLocationHis";
export default {
name: "WarehouseLocationHis",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
// ()
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
locationId: null,
palletCode: null,
operateStatus: null,
enabled: null,
remark: null,
version: null,
createTime: [],
},
//
form: {},
//
rules: {
locationId: [{ required: true, message: "库位id不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getWarehouseLocationHisPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
locationId: undefined,
palletCode: undefined,
operateStatus: undefined,
enabled: undefined,
remark: undefined,
version: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加出入库历史(有库位)";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getWarehouseLocationHis(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改出入库历史(有库位)";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateWarehouseLocationHis(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createWarehouseLocationHis(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除出入库历史(有库位)编号为"' + id + '"的数据项?').then(function() {
return deleteWarehouseLocationHis(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有出入库历史(有库位)数据项?').then(() => {
this.exportLoading = true;
return exportWarehouseLocationHisExcel(params);
}).then(response => {
this.$download.excel(response, '出入库历史(有库位).xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建出入库历史(有库位)
export function createWarehouseLocationHis(data) {
return request({
url: '/extend/warehouse-location-his/create',
method: 'post',
data: data
})
}
// 更新出入库历史(有库位)
export function updateWarehouseLocationHis(data) {
return request({
url: '/extend/warehouse-location-his/update',
method: 'put',
data: data
})
}
// 删除出入库历史(有库位)
export function deleteWarehouseLocationHis(id) {
return request({
url: '/extend/warehouse-location-his/delete?id=' + id,
method: 'delete'
})
}
// 获得出入库历史(有库位)
export function getWarehouseLocationHis(id) {
return request({
url: '/extend/warehouse-location-his/get?id=' + id,
method: 'get'
})
}
// 获得出入库历史(有库位)分页
export function getWarehouseLocationHisPage(query) {
return request({
url: '/extend/warehouse-location-his/page',
method: 'get',
params: query
})
}
// 导出出入库历史(有库位) Excel
export function exportWarehouseLocationHisExcel(query) {
return request({
url: '/extend/warehouse-location-his/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,255 @@
<!-- 出入库历史(有库位)详情管理 -->
<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="物品id关联物品表" prop="goodsId">
<el-input v-model="queryParams.goodsId" placeholder="请输入物品id关联物品表" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="数量" prop="num">
<el-input v-model="queryParams.num" placeholder="请输入数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="queryParams.enabled" placeholder="请输入启用状态:0 、停用1、启用" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="queryParams.version" placeholder="请输入版本号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间(即操作时间)" prop="createTime">
<el-date-picker v-model="queryParams.createTime" 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-form-item>
<el-form-item label="出入库历史表id" prop="hisId">
<el-input v-model="queryParams.hisId" placeholder="请输入出入库历史表id" clearable @keyup.enter.native="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">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['extend:warehouse-location-his-det:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['extend:warehouse-location-his-det:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="物品id关联物品表" align="center" prop="goodsId" />
<el-table-column label="数量" align="center" prop="num" />
<el-table-column label="启用状态:0 、停用1、启用" align="center" prop="enabled" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="创建时间(即操作时间)" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="出入库历史表id" align="center" prop="hisId" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['extend:warehouse-location-his-det:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['extend:warehouse-location-his-det:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="物品id关联物品表" prop="goodsId">
<el-input v-model="form.goodsId" placeholder="请输入物品id关联物品表" />
</el-form-item>
<el-form-item label="数量" prop="num">
<el-input v-model="form.num" placeholder="请输入数量" />
</el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="form.enabled" placeholder="请输入启用状态:0 、停用1、启用" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" placeholder="请输入版本号" />
</el-form-item>
<el-form-item label="出入库历史表id" prop="hisId">
<el-input v-model="form.hisId" placeholder="请输入出入库历史表id" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createWarehouseLocationHisDet, updateWarehouseLocationHisDet, deleteWarehouseLocationHisDet, getWarehouseLocationHisDet, getWarehouseLocationHisDetPage, exportWarehouseLocationHisDetExcel } from "./warehouseLocationHisDet";
export default {
name: "WarehouseLocationHisDet",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
// ()
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
goodsId: null,
num: null,
enabled: null,
remark: null,
version: null,
createTime: [],
hisId: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getWarehouseLocationHisDetPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
goodsId: undefined,
num: undefined,
enabled: undefined,
remark: undefined,
version: undefined,
hisId: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加出入库历史(有库位)详情";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getWarehouseLocationHisDet(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改出入库历史(有库位)详情";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateWarehouseLocationHisDet(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createWarehouseLocationHisDet(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除出入库历史(有库位)详情编号为"' + id + '"的数据项?').then(function() {
return deleteWarehouseLocationHisDet(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有出入库历史(有库位)详情数据项?').then(() => {
this.exportLoading = true;
return exportWarehouseLocationHisDetExcel(params);
}).then(response => {
this.$download.excel(response, '出入库历史(有库位)详情.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建出入库历史(有库位)详情
export function createWarehouseLocationHisDet(data) {
return request({
url: '/extend/warehouse-location-his-det/create',
method: 'post',
data: data
})
}
// 更新出入库历史(有库位)详情
export function updateWarehouseLocationHisDet(data) {
return request({
url: '/extend/warehouse-location-his-det/update',
method: 'put',
data: data
})
}
// 删除出入库历史(有库位)详情
export function deleteWarehouseLocationHisDet(id) {
return request({
url: '/extend/warehouse-location-his-det/delete?id=' + id,
method: 'delete'
})
}
// 获得出入库历史(有库位)详情
export function getWarehouseLocationHisDet(id) {
return request({
url: '/extend/warehouse-location-his-det/get?id=' + id,
method: 'get'
})
}
// 获得出入库历史(有库位)详情分页
export function getWarehouseLocationHisDetPage(query) {
return request({
url: '/extend/warehouse-location-his-det/page',
method: 'get',
params: query
})
}
// 导出出入库历史(有库位)详情 Excel
export function exportWarehouseLocationHisDetExcel(query) {
return request({
url: '/extend/warehouse-location-his-det/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,297 @@
<!-- 出入库管理-无库位 -->
<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="仓库id" prop="warehouseId">
<el-input v-model="queryParams.warehouseId" placeholder="请输入仓库id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="仓库物品类型" prop="storageType">
<el-select v-model="queryParams.storageType" placeholder="请选择仓库物品类型" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="物品id关联物品表" prop="goodsId">
<el-input v-model="queryParams.goodsId" placeholder="请输入物品id关联物品表" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="数量" prop="num">
<el-input v-model="queryParams.num" placeholder="请输入数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="最新入库时间" prop="latestInTime">
<el-date-picker v-model="queryParams.latestInTime" 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-form-item>
<el-form-item label="最新出库时间" prop="latestOutTime">
<el-date-picker v-model="queryParams.latestOutTime" 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-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="queryParams.enabled" placeholder="请输入启用状态:0 、停用1、启用" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="queryParams.version" placeholder="请输入版本号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" 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-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">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['extend:warehouse-realtime:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['extend:warehouse-realtime:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="仓库id" align="center" prop="warehouseId" />
<el-table-column label="仓库物品类型" align="center" prop="storageType" />
<el-table-column label="物品id关联物品表" align="center" prop="goodsId" />
<el-table-column label="数量" align="center" prop="num" />
<el-table-column label="最新入库时间" align="center" prop="latestInTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestInTime) }}</span>
</template>
</el-table-column>
<el-table-column label="最新出库时间" align="center" prop="latestOutTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template>
</el-table-column>
<el-table-column label="启用状态:0 、停用1、启用" align="center" prop="enabled" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['extend:warehouse-realtime:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['extend:warehouse-realtime:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="仓库id" prop="warehouseId">
<el-input v-model="form.warehouseId" placeholder="请输入仓库id" />
</el-form-item>
<el-form-item label="仓库物品类型" prop="storageType">
<el-select v-model="form.storageType" placeholder="请选择仓库物品类型">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="物品id关联物品表" prop="goodsId">
<el-input v-model="form.goodsId" placeholder="请输入物品id关联物品表" />
</el-form-item>
<el-form-item label="数量" prop="num">
<el-input v-model="form.num" placeholder="请输入数量" />
</el-form-item>
<el-form-item label="最新入库时间" prop="latestInTime">
<el-date-picker clearable v-model="form.latestInTime" type="date" value-format="timestamp" placeholder="选择最新入库时间" />
</el-form-item>
<el-form-item label="最新出库时间" prop="latestOutTime">
<el-date-picker clearable v-model="form.latestOutTime" type="date" value-format="timestamp" placeholder="选择最新出库时间" />
</el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="form.enabled" placeholder="请输入启用状态:0 、停用1、启用" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" placeholder="请输入版本号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createWarehouseRealtime, updateWarehouseRealtime, deleteWarehouseRealtime, getWarehouseRealtime, getWarehouseRealtimePage, exportWarehouseRealtimeExcel } from "./warehouseRealtime";
export default {
name: "WarehouseRealtime",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
// -
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
warehouseId: null,
storageType: null,
goodsId: null,
num: null,
latestInTime: [],
latestOutTime: [],
enabled: null,
remark: null,
version: null,
createTime: [],
},
//
form: {},
//
rules: {
warehouseId: [{ required: true, message: "仓库id不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getWarehouseRealtimePage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
warehouseId: undefined,
storageType: undefined,
goodsId: undefined,
num: undefined,
latestInTime: undefined,
latestOutTime: undefined,
enabled: undefined,
remark: undefined,
version: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加出入库-无库位";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getWarehouseRealtime(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改出入库-无库位";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateWarehouseRealtime(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createWarehouseRealtime(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除出入库-无库位编号为"' + id + '"的数据项?').then(function() {
return deleteWarehouseRealtime(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有出入库-无库位数据项?').then(() => {
this.exportLoading = true;
return exportWarehouseRealtimeExcel(params);
}).then(response => {
this.$download.excel(response, '出入库-无库位.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

Some files were not shown because too many files have changed in this diff Show More