This commit is contained in:
2023-09-08 15:38:33 +08:00
commit b4ffb20ba8
790 changed files with 98659 additions and 0 deletions

View File

@@ -0,0 +1,133 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-09-05 14:52:47
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-row :gutter="20">
<el-col :span="23">
<barChart
title="柱状图分析"
ref="barChart"
height="500px"
:histogram="tableData" />
</el-col>
</el-row>
</div>
</template>
<script>
import basicPage from '../mixins/basic-page';
import barChart from '../chart/BarChart.vue';
import { getHistogram } from '@/api/asrs/warehouseStorehouseStorage';
import { getGoodSpecificationPage } from '@/api/asrs/goodSpecification';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getHistogram,
},
listQuery: {
warehouseId: '',
goodName: '',
startTime: '',
endTime: '',
},
formConfig: [
{
type: 'select',
label: '产品',
selectOptions: [],
labelField: 'goodSpecificationName',
valueField: 'goodSpecificationName',
param: 'name',
filterable: true,
},
{
type: 'datePicker',
label: '时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
barChart,
},
created() {
this.getArr();
},
methods: {
// 获取数据列表
getDataList() {
if (this.listQuery.goodName) {
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
}
},
getArr() {
const params = { pageSize: 100, pageNo: 1, total: 1 };
getGoodSpecificationPage(params).then((response) => {
this.formConfig[0].selectOptions = response.data.list;
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
if (val.name) {
this.listQuery.goodName = val.name;
if (val.searchTime) {
this.listQuery.startTime = val.searchTime
? val.searchTime[0]
: '';
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : '';
this.getDataList();
} else {
this.$modal.msgWarning('请选择时间');
}
} else {
this.$modal.msgWarning('请选择产品');
}
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
warehouseId: this.aId,
goodName: '',
startTime: '',
endTime: '',
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@@ -0,0 +1,134 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-09-05 14:52:57
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-row :gutter="20">
<el-col :span="23">
<barChart
title="柱状图分析"
ref="barChart"
height="500px"
:histogram="tableData" />
</el-col>
</el-row>
</div>
</template>
<script>
import basicPage from '../mixins/basic-page';
import barChart from '../chart/BarChart.vue';
import { getHistogram } from '@/api/asrs/warehouseStorehouseStorage';
import { getGoodSpecificationPage } from '@/api/asrs/goodSpecification';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getHistogram,
},
listQuery: {
warehouseId: '',
goodName: '',
startTime: '',
endTime: '',
},
formConfig: [
{
type: 'select',
label: '产品',
selectOptions: [],
labelField: 'goodSpecificationName',
valueField: 'goodSpecificationName',
param: 'name',
filterable: true,
},
{
type: 'datePicker',
label: '时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
barChart,
},
created() {
this.listQuery.warehouseId = this.bId;
this.getArr();
},
methods: {
// 获取数据列表
getDataList() {
if (this.listQuery.goodName) {
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
}
},
getArr() {
const params = { pageSize: 100, pageNo: 1, total: 1 };
getGoodSpecificationPage(params).then((response) => {
this.formConfig[0].selectOptions = response.data.list;
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
if (val.name) {
this.listQuery.goodName = val.name;
if (val.searchTime) {
this.listQuery.startTime = val.searchTime
? val.searchTime[0]
: '';
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : '';
this.getDataList();
} else {
this.$modal.msgWarning('请选择时间');
}
} else {
this.$modal.msgWarning('请选择产品');
}
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
warehouseId: this.bId,
goodName: '',
startTime: '',
endTime: '',
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@@ -0,0 +1,112 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-09-05 14:52:33
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-row :gutter="20">
<el-col :span="23">
<pieChart
title="饼状图分析"
ref="pieChart"
height="500px"
:total-number="tableData.totalNumber"
:pie-data="tableData.list" />
</el-col>
</el-row>
</div>
</template>
<script>
import basicPage from '../mixins/basic-page';
import pieChart from '../chart/PieChart.vue';
import { getPieChart } from '@/api/asrs/warehouseStorehouseStorage';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getPieChart,
},
listQuery: {
warehouseId: '',
startTime: '',
endTime: '',
},
formConfig: [
{
type: 'datePicker',
label: '时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
pieChart,
},
created() {
},
methods: {
// 获取数据列表
getDataList() {
if (this.listQuery.startTime) {
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
});
}
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
if (val.searchTime) {
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : '';
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : '';
this.getDataList();
} else {
this.$modal.msgWarning('请选择时间');
}
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {};
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,113 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-09-06 14:44:21
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-row :gutter="20">
<el-col :span="23">
<pieChart
title="饼状图分析"
ref="pieChart"
height="500px"
:total-number="tableData.totalNumber"
:pie-data="tableData.list" />
</el-col>
</el-row>
</div>
</template>
<script>
import basicPage from '../mixins/basic-page';
import pieChart from '../chart/PieChart.vue';
import { getPieChart } from '@/api/asrs/warehouseStorehouseStorage';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getPieChart,
},
listQuery: {
warehouseId: '',
startTime: '',
endTime: '',
},
formConfig: [
{
type: 'datePicker',
label: '时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
pieChart,
},
created() {
this.listQuery.warehouseId = this.bId;
},
methods: {
// 获取数据列表
getDataList() {
if (this.listQuery.startTime) {
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
});
}
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
if (val.searchTime) {
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : '';
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : '';
this.getDataList();
} else {
this.$modal.msgWarning('请选择时间');
}
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {};
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,124 @@
<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">
</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 { getAgvLogPage } from '@/api/oth/agvLog';
const tableProps = [
{
prop: 'reqInterface',
label: '请求接口',
align: 'center',
},
{
prop: 'reqParameter',
label: '请求参数',
align: 'center',
},
{
prop: 'createDate',
label: '时间',
align: 'center',
filter: parseTime,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getAgvLogPage,
},
tableProps,
tableData: [],
formConfig: [
{
type: 'input',
label: '请求接口',
placeholder: '请求接口',
param: 'code',
},
{
type: 'input',
label: '请求参数',
placeholder: '请求参数',
param: 'name',
},
{
type: 'datePicker',
label: '订单出货日期',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: 'button',
btnName: '重置',
name: 'reset',
},
],
};
},
components: {},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.reqInterface = val.code;
this.listQuery.reqParameter = val.name;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : '';
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : '';
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@@ -0,0 +1,137 @@
<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 '../mixins/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: '300px',
},
allData: {
type: Object,
default: () => ({}),
},
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 = [];
if (this.histogram.length > 0) {
this.histogram.forEach((item) => {
nameArr.push(item.time);
valueArr.push(item.number);
});
} else {
for (let i in this.allData) {
nameArr.push(i);
valueArr.push(this.allData[i]);
}
}
this.chart = echarts.init(this.$el, 'macarons');
this.chart.setOption({
title: {
text: '{space|}{tip|}{space|}{value|' + this.title + '}',
left: '0%',
top: '0%',
textStyle: {
rich: {
tip: {
width: 4,
height: 16,
backgroundColor: '#1FC495',
marginRight: 6,
},
space: {
width: 8,
},
value: {
fontSize: 16,
fontWeight: 'bold',
},
},
},
},
tooltip: {
trigger: 'axis',
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: 'shadow', // 默认为直线,可选为:'line' | 'shadow'
},
},
grid: {
top: 40,
left: '2%',
right: '2%',
bottom: '3%',
containLabel: true,
},
xAxis: [
{
type: 'category',
data: nameArr,
axisTick: {
alignWithLabel: true,
},
},
],
yAxis: [
{
type: 'value',
axisTick: {
show: false,
},
},
],
series: [
{
name: 'pageA',
type: 'bar',
stack: 'vistors',
barWidth: '60%',
data: valueArr,
animationDuration,
},
],
});
},
},
};
</script>

View File

@@ -0,0 +1,185 @@
<!--
* @Author: zwq
* @Date: 2023-06-01 10:47:42
* @LastEditors: zwq
* @LastEditTime: 2023-08-31 16:23:08
* @Description:
-->
<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 '../mixins/resize';
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart',
},
title: {
type: String,
default: 'chart',
},
width: {
type: String,
default: '100%',
},
height: {
type: String,
default: '300px',
},
occupancyData: {
type: Number,
default: 0,
},
},
name: 'echarts',
data() {
return {
echart: '',
};
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons');
this.chart.setOption({
title: {
text: '{space|}{tip|}{space|}{value|' + this.title + '}',
left: '0%',
top: '2%',
textStyle: {
rich: {
tip: {
width: 4,
height: 16,
backgroundColor: '#1FC495',
marginRight: 6,
},
space: {
width: 8,
},
value: {
fontSize: 16,
fontWeight: 'bold',
},
},
},
},
series: [
{
type: 'gauge',
startAngle: 180,
endAngle: 0,
min: 0,
max: 100,
splitNumber: 5,
itemStyle: {
color: '#47E282',
shadowColor: 'rgba(0,138,255,0.45)',
shadowBlur: 10,
shadowOffsetX: 2,
shadowOffsetY: 2,
},
pointer: {
itemStyle: {
color: 'auto',
},
},
axisLine: {
roundCap: true,
lineStyle: {
width: 16,
},
},
axisTick: {
distance: 5,
splitNumber: 2,
lineStyle: {
width: 2,
color: '#999',
},
},
splitLine: {
distance: 6,
length: 14,
lineStyle: {
width: 4,
color: '#999',
},
},
axisLabel: {
distance: -55,
color: '#999',
fontSize: 15,
},
title: {
show: false,
},
detail: {
backgroundColor: '#fff',
width: '80%',
lineHeight: 15,
height: 15,
offsetCenter: [0, '20%'],
valueAnimation: true,
formatter: function (value) {
return '{side| }{value|' + value + '}{unit|%}{side1| }';
},
rich: {
value: {
fontSize: 18,
color: '#1FC495',
padding: [0, 0, 0, 16],
},
side: {
width: 35,
height: 5,
backgroundColor: '#fff',
opacity: 0.5,
shadowColor: '#43E084',
shadowOffsetX: 10,
},
side1: {
width: 35,
height: 5,
backgroundColor: '#fff',
opacity: 0.5,
shadowColor: '#43E084',
shadowOffsetX: -10,
},
unit: {
fontSize: 12,
color: '#999',
padding: [0, 16, 0, 0],
},
},
},
data: [
{
value: this.occupancyData * 100,
},
],
radius: '90%',
center: ['50%', '70%'],
},
],
});
},
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,165 @@
<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 '../mixins/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: '300px',
},
pieData: {
type: Array,
default: () => [],
},
totalNumber: {
type: Number,
default: 0,
},
},
data() {
return {
chart: null,
};
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons');
this.pieData.forEach((i) => {
i.value = i.number;
});
this.chart.setOption({
title: {
zlevel: 2, // 控制圆环图中间的字的层级
text: '总数',
subtext: this.totalNumber,
top: '38%', // 控制位置
left: '50%', // 控制位置
textAlign: 'center', // 让文字居中
textStyle: {
color: 'rgba(203, 195, 195, 1)',
},
subtextStyle: {
fontSize: 20,
},
},
tooltip: {
trigger: 'item',
show: true, // 控制鼠标悬浮是否显示数据
},
legend: {
orient: 'vartical',
top: 'center',
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;
}).number;
var v = ((target / this.totalNumber) * 100).toFixed(2);
return `{oneone|${name}} {twotwo|${target}个} {threethree|${v}%}`;
},
},
grid: {
top: 40,
left: '2%',
right: '2%',
bottom: '3%',
containLabel: true,
},
series: [
{
name: 'pie',
type: 'pie',
radius: ['55%', '80%'],
avoidLabelOverlap: true, // 防止牵引线堆叠挤在一块
itemStyle: {
borderRadius: 10,
borderColor: '#fff',
borderWidth: 2,
},
label: {
normal: {
show: true,
position: 'outside', // 另有参数inside可以让数据在圆环上
formatter: '{d}%', //模板变量有 {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: false,
},
data: this.pieData,
},
],
});
},
},
};
</script>

View File

@@ -0,0 +1,84 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-08-31 16:35:40
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px">
<el-form-item label="产品编码" prop="goodSpecificationCode">
<el-input
v-model="dataForm.goodSpecificationCode"
clearable
placeholder="请输入产品编码" />
</el-form-item>
<el-form-item label="产品名称" prop="goodSpecificationName">
<el-input
v-model="dataForm.goodSpecificationName"
clearable
placeholder="请输入产品名称" />
</el-form-item>
<el-form-item label="需要熟化时间" prop="cureTime">
<el-input-number
v-model="dataForm.cureTime"
controls-position="right"
:min="0"></el-input-number>
</el-form-item>
<el-form-item label="是否需要熟化" prop="cure">
<el-switch
v-model="dataForm.cure"
:active-value="1"
:inactive-value="0"></el-switch>
</el-form-item>
<el-form-item label="是否启用" prop="deactivate">
<el-switch
v-model="dataForm.deactivate"
:active-value="1"
:inactive-value="0"></el-switch>
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../mixins/basic-add';
import { createGoodSpecification, updateGoodSpecification, getGoodSpecification, getCode } from "@/api/asrs/goodSpecification";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
codeName: 'goodSpecificationCode',
createURL: createGoodSpecification,
updateURL: updateGoodSpecification,
infoURL: getGoodSpecification,
},
dataForm: {
id: undefined,
goodSpecificationCode: undefined,
goodSpecificationName: undefined,
cureTime: undefined,
cure: undefined,
deactivate: undefined,
},
dataRule: {
goodSpecificationCode: [
{ required: true, message: '产品编码不能为空', trigger: 'blur' },
],
goodSpecificationName: [
{ required: true, message: '产品名称不能为空', trigger: 'blur' },
],
},
};
},
methods: {},
};
</script>

View File

@@ -0,0 +1,178 @@
<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="120"
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="70%">
<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 codeFilter from '../mixins/code-filter';
import { deleteGoodSpecification, getGoodSpecificationPage } from "@/api/asrs/goodSpecification";
const tableProps = [
{
prop: 'goodSpecificationCode',
label: '产品编码',
align: 'center',
},
{
prop: 'goodSpecificationName',
label: '产品名称',
align: 'center',
},
{
prop: 'cure',
label: '是否需要熟化',
align: 'center',
filter: codeFilter('cure'),
},
{
prop: 'cureTime',
label: '需要熟化时间(小时)',
align: 'center',
},
{
prop: 'deactivate',
label: '是否启用',
align: 'center',
filter: codeFilter('deactivate'),
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getGoodSpecificationPage,
deleteURL: deleteGoodSpecification,
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`asrs:good-specification:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`asrs:good-specification:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '产品编码',
placeholder: '产品编码',
param: 'code',
},
{
type: 'input',
label: '产品名称',
placeholder: '产品名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('asrs:good-specification:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodSpecificationName = val.name;
this.listQuery.goodSpecificationCode = val.code;
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,181 @@
<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="120"
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="70%">
<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 codeFilter from '../mixins/code-filter';
import { deleteGoodSpecification, getGoodSpecificationPage } from "@/api/asrs/goodSpecification";
const tableProps = [
{
prop: 'goodSpecificationCode',
label: '产品编码',
align: 'center',
},
{
prop: 'goodSpecificationName',
label: '产品名称',
align: 'center',
},
{
prop: 'cure',
label: '是否需要熟化',
align: 'center',
filter: codeFilter('cure'),
},
{
prop: 'cureTime',
label: '需要熟化时间(小时)',
align: 'center',
},
{
prop: 'deactivate',
label: '是否启用',
align: 'center',
filter: codeFilter('deactivate'),
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getGoodSpecificationPage,
deleteURL: deleteGoodSpecification,
},
tableProps,
bPage: true,
tableBtn: [
this.$auth.hasPermi(`asrs:good-specification:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`asrs:good-specification:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '产品编码',
placeholder: '产品编码',
param: 'code',
},
{
type: 'input',
label: '产品名称',
placeholder: '产品名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('asrs:good-specification:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
},
created() {
this.listQuery.warehouseId = this.bId;
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodSpecificationName = val.name;
this.listQuery.goodSpecificationCode = val.code;
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,159 @@
<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">
</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 { getHeavenlyEyeLogPage } from '@/api/oth/heavenlyEyeLog';
const tableProps = [
{
prop: 'reqInterface',
label: '请求接口',
align: 'center',
},
{
prop: 'reqParameter',
label: '请求参数',
align: 'center',
},
{
prop: 'errorCode',
label: '返回编码',
align: 'center',
},
{
prop: 'cmd',
label: '返回请求接口',
align: 'center',
},
{
prop: 'msgId',
label: '返回msgId',
align: 'center',
},
{
prop: 'retStatus',
label: '返回状态',
align: 'center',
},
{
prop: 'fastName',
label: '返回指定区域',
align: 'center',
},
{
prop: 'areaName',
label: '返回复合区域',
align: 'center',
},
{
prop: 'list',
label: '返回集合',
align: 'center',
},
{
prop: 'createDate',
label: '时间',
align: 'center',
filter: parseTime,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getHeavenlyEyeLogPage,
},
tableProps,
tableData: [],
formConfig: [
{
type: 'input',
label: '请求接口',
placeholder: '请求接口',
param: 'code',
},
{
type: 'input',
label: '请求参数',
placeholder: '请求参数',
param: 'name',
},
{
type: 'datePicker',
label: '订单出货日期',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: 'button',
btnName: '重置',
name: 'reset',
},
],
};
},
components: {},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.reqInterface = val.code;
this.listQuery.reqParameter = val.name;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : '';
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : '';
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@@ -0,0 +1,71 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-09-05 13:50:38
* @Description:
-->
<template>
<div class="app-container">
<el-row :gutter="20">
<el-col :span="10">
<gaugeChart
ref="gaugeChart"
title="仓库占用率"
height="500px"
:occupancy-data="occupancyData" />
</el-col>
<el-col :span="14">
<barChart
ref="barChart"
height="500px"
title="库存总览"
:all-data="allData" />
</el-col>
</el-row>
</div>
</template>
<script>
import basicPage from '../mixins/basic-page';
import barChart from '../chart/BarChart.vue';
import gaugeChart from '../chart/GaugeChart.vue';
import { getOccupancy } from '@/api/asrs/warehouseStorehouse';
import { inventoryOverview } from '@/api/asrs/warehouseStorehouseGoodsSpecification';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
occupancyURL: getOccupancy,
allURL: inventoryOverview,
},
occupancyData: 0,
allData: {},
};
},
components: {
barChart,
gaugeChart,
},
created() {},
methods: {
// 获取数据列表
getDataList() {
this.urlOptions.occupancyURL(this.aId).then((response) => {
this.occupancyData = response.data;
this.$nextTick(() => {
this.$refs.gaugeChart.initChart();
});
});
this.urlOptions.allURL(this.aId).then((response) => {
this.allData = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
},
},
};
</script>

View File

@@ -0,0 +1,73 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-09-05 14:51:54
* @Description:
-->
<template>
<div class="app-container">
<el-row :gutter="20">
<el-col :span="10">
<gaugeChart
ref="gaugeChart"
title="仓库占用率"
height="500px"
:occupancy-data="occupancyData" />
</el-col>
<el-col :span="14">
<barChart
ref="barChart"
height="500px"
title="库存总览"
:all-data="allData" />
</el-col>
</el-row>
</div>
</template>
<script>
import basicPage from '../mixins/basic-page';
import barChart from '../chart/BarChart.vue';
import gaugeChart from '../chart/GaugeChart.vue';
import { getOccupancy } from '@/api/asrs/warehouseStorehouse';
import { inventoryOverview } from '@/api/asrs/warehouseStorehouseGoodsSpecification';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
occupancyURL: getOccupancy,
allURL: inventoryOverview,
},
occupancyData: 0,
allData: {},
};
},
components: {
barChart,
gaugeChart,
},
created() {
this.listQuery.warehouseId = this.bId;
},
methods: {
// 获取数据列表
getDataList() {
this.urlOptions.occupancyURL(this.bId).then((response) => {
this.occupancyData = response.data;
this.$nextTick(() => {
this.$refs.gaugeChart.initChart();
});
});
this.urlOptions.allURL(this.bId).then((response) => {
this.allData = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
},
},
};
</script>

View File

@@ -0,0 +1,226 @@
<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="120"
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 codeFilter from '../mixins/code-filter';
import { getMainTaskPage } from '@/api/oth/mainTask';
const tableProps = [
{
prop: 'mainTaskCode',
label: '任务编码',
align: 'center',
},
{
prop: 'mainTaskType',
label: '任务类型',
align: 'center',
filter: codeFilter('mainTaskType'),
},
{
prop: 'stacker',
label: '堆垛机',
align: 'center',
},
{
prop: 'agv',
label: 'agv',
align: 'center',
},
{
prop: 'mainTaskState',
label: '状态',
align: 'center',
filter: codeFilter('mainTaskState'),
},
{
prop: 'taskSource',
label: '任务来源',
align: 'center',
filter: codeFilter('taskSource'),
},
{
prop: 'createTime',
label: '创建时间',
align: 'center',
filter: parseTime,
},
];
const mainTaskType = [
{
name: '一次分切',
id: 1,
},
{
name: '二次分切',
id: 2,
},
{
name: '一次分拣',
id: 3,
},
{
name: '二次分拣',
id: 4,
},
];
const mainTaskState = [
{
name: '开始',
id: 0,
},
{
name: '已发送agv',
id: 1,
},
{
name: 'agv运行中',
id: 2,
},
{
name: '已发送堆垛机',
id: 3,
},
{
name: '堆垛机运行中',
id: 4,
},
{
name: '完成',
id: 5,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getMainTaskPage,
},
tableProps,
tableBtn: [
true
? {
type: 'cancle',
btnName: '取消',
}
: undefined,
].filter((v) => v),
tableData: [],
formConfig: [
{
type: 'input',
label: '任务编码',
placeholder: '任务编码',
param: 'code',
},
{
type: 'select',
label: '任务类型',
selectOptions: mainTaskType,
param: 'taskType',
defaultSelect: '',
filterable: true,
},
{
type: 'select',
label: '状态',
selectOptions: mainTaskState,
param: 'status',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: 'agv',
placeholder: 'agv',
param: 'agv',
},
{
type: 'datePicker',
label: '选择日期',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: 'button',
btnName: '重置',
name: 'reset',
},
],
};
},
components: {},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.mainTaskCode = val.code;
this.listQuery.mainTaskType = val.taskType;
this.listQuery.mainTaskState = val.status;
this.listQuery.agv = val.agv;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : '';
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : '';
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@@ -0,0 +1,224 @@
<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">
</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 codeFilter from '../mixins/code-filter';
import { getMainTaskHistoryPage } from '@/api/oth/mainTaskHistory';
const tableProps = [
{
prop: 'mainTaskCode',
label: '任务编码',
align: 'center',
},
{
prop: 'mainTaskType',
label: '任务类型',
align: 'center',
filter: codeFilter('mainTaskType'),
},
{
prop: 'stacker',
label: '堆垛机',
align: 'center',
},
{
prop: 'agv',
label: 'agv',
align: 'center',
},
{
prop: 'mainTaskState',
label: '状态',
align: 'center',
filter: codeFilter('mainTaskState'),
},
{
prop: 'taskSource',
label: '任务来源',
align: 'center',
filter: codeFilter('taskSource'),
},
{
prop: 'createTime',
label: '创建时间',
align: 'center',
filter: parseTime,
},
{
prop: 'cancellation',
label: '是否取消',
align: 'center',
filter: codeFilter('cancellation'),
},
];
const mainTaskType = [
{
name: '一次分切',
id: 1,
},
{
name: '二次分切',
id: 2,
},
{
name: '一次分拣',
id: 3,
},
{
name: '二次分拣',
id: 4,
},
];
const mainTaskState = [
{
name: '开始',
id: 0,
},
{
name: '已发送agv',
id: 1,
},
{
name: 'agv运行中',
id: 2,
},
{
name: '已发送堆垛机',
id: 3,
},
{
name: '堆垛机运行中',
id: 4,
},
{
name: '完成',
id: 5,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getMainTaskHistoryPage,
},
tableProps,
tableData: [],
formConfig: [
{
type: 'input',
label: '任务编码',
placeholder: '任务编码',
param: 'code',
},
{
type: 'select',
label: '任务类型',
selectOptions: mainTaskType,
param: 'taskType',
defaultSelect: '',
filterable: true,
},
{
type: 'select',
label: '状态',
selectOptions: mainTaskState,
param: 'status',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '堆垛机',
placeholder: '堆垛机',
param: 'stacker',
},
{
type: 'input',
label: 'agv',
placeholder: 'agv',
param: 'agv',
},
{
type: 'datePicker',
label: '选择日期',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: 'button',
btnName: '重置',
name: 'reset',
},
],
};
},
components: {},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.mainTaskCode = val.code;
this.listQuery.mainTaskType = val.taskType;
this.listQuery.mainTaskState = val.status;
this.listQuery.stacker = val.stacker;
this.listQuery.agv = val.agv;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : '';
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : '';
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@@ -0,0 +1,124 @@
<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">
</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 { getMesLogPage } from '@/api/oth/mesLog';
const tableProps = [
{
prop: 'reqInterface',
label: '请求接口',
align: 'center',
},
{
prop: 'reqParameter',
label: '请求参数',
align: 'center',
},
{
prop: 'createDate',
label: '时间',
align: 'center',
filter: parseTime,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getMesLogPage,
},
tableProps,
tableData: [],
formConfig: [
{
type: 'input',
label: '请求接口',
placeholder: '请求接口',
param: 'code',
},
{
type: 'input',
label: '请求参数',
placeholder: '请求参数',
param: 'name',
},
{
type: 'datePicker',
label: '订单出货日期',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: 'button',
btnName: '重置',
name: 'reset',
},
],
};
},
components: {},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.reqInterface = val.code;
this.listQuery.reqParameter = val.name;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : '';
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : '';
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@@ -0,0 +1,111 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2023-09-05 15:10:13
* @Description:
*/
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
createURL: '',
updateURL: '',
infoURL: '',
codeURL: '',
getOption: false,
isGetCode: false,
optionArrUrl: [],
optionArr: {}
},
aId: '1696803324030865409',
bId: '1698950657556340737',
visible: false,
setData: false
}
},
created() {
},
activated() {
},
methods: {
init(id,bPage) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
if(bPage){
this.dataForm.warehouseId = this.bId;
}else{
this.dataForm.warehouseId = this.bId;
}
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 }) => {
if (this.urlOptions.codeName) {
this.dataForm[this.urlOptions.codeName] = res;
} else {
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(() => {
});
});
},
// 表单提交
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() {
this.$refs.dataForm.resetFields()
}
}
}

View File

@@ -0,0 +1,172 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2023-09-05 15:10:24
* @Description:
*/
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
getDataListURL: '',
deleteURL: '',
statusUrl: '',
exportURL: ''
},
aId: '1696803324030865409',
bId: '1698950657556340737',
tableData: [],
listQuery: {
warehouseId:'1696803324030865409',
pageSize: 10,
pageNo: 1,
total: 1,
},
exportLoading: false,
dataListLoading: false,
addOrEditTitle: '',
addOrUpdateVisible: false,
bPage: false
}
},
created() {
},
mounted() {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list;
this.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,this.bPage);
});
},
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,this.bPage);
});
} 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.addOrUpdate.formClear()
this.addOrUpdateVisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.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,98 @@
/*
* @Date: 2020-12-29 16:49:28
* @LastEditors: zwq
* @LastEditTime: 2023-09-07 14:10:53
* @FilePath: \basic-admin\src\filters\basicData\index.js
* @Description:
*/
const table = {
cure: {
1: '需要',
0: '不需要',
},
deactivate: {
1: '启用',
0: '停用',
},
isOrno:{
1: '是',
0: '否',
},
quality:{
2: 'C',
1: 'B',
0: 'A',
},
mainTaskType:{
1: '一次分切',
2: '二次分切',
3: '一次分拣',
4: '二次分拣',
},
mainTaskState:{
0: '开始',
1: '已发送agv',
2: 'agv运行中',
3: '已发送堆垛机',
4: '堆垛机运行中',
5: '完成',
},
taskSource: {
1: 'mes下发',
2: 'wms手动',
},
cancellation: {
1: '否',
2: '是',
},
}
// 日期格式化
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,56 @@
import { debounce } from '@/utils'
export default {
data() {
return {
$_sidebarElm: null,
$_resizeHandler: null
}
},
mounted() {
this.initListener()
},
activated() {
if (!this.$_resizeHandler) {
// avoid duplication init
this.initListener()
}
// when keep-alive chart activated, auto resize
this.resize()
},
beforeDestroy() {
this.destroyListener()
},
deactivated() {
this.destroyListener()
},
methods: {
// use $_ for mixins properties
// https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
$_sidebarResizeHandler(e) {
if (e.propertyName === 'width') {
this.$_resizeHandler()
}
},
initListener() {
this.$_resizeHandler = debounce(() => {
this.resize()
}, 100)
window.addEventListener('resize', this.$_resizeHandler)
this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
},
destroyListener() {
window.removeEventListener('resize', this.$_resizeHandler)
this.$_resizeHandler = null
this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
},
resize() {
const { chart } = this
chart && chart.resize()
}
}
}

View File

@@ -0,0 +1,119 @@
<!--
* @Author: zwq
* @Date: 2023-08-24 14:47:58
* @LastEditors: zwq
* @LastEditTime: 2023-09-04 14:38:44
* @Description:
-->
<template>
<div class="app-container">
<base-table
v-loading="dataListLoading"
:table-props="propType===1?
[...tableProps,...tableProps2]:propType===2?
[...tableProps,...tableProps1,...tableProps2]:tableProps"
max-height="200"
:table-data="tableData" />
</div>
</template>
<script>
import basicPage from './mixins/basic-page';
import { parseTime } from './mixins/code-filter';
import codeFilter from './mixins/code-filter';
import {
getWarehouseStorehouseGoodsSpecificationPage,
} from '@/api/asrs/warehouseStorehouseGoodsSpecification';
import {
getWarehouseStorehouseStorageGoodsSpecificationPage,
} from '@/api/asrs/warehouseStorehouseStorageGoodsSpecification';
import { number } from 'echarts';
const tableProps = [
{
prop: 'goodSpecificationName',
label: '产品名',
align: 'center',
},
{
prop: 'goodSpecificationCode',
label: '产品编码',
align: 'center',
},
{
prop: 'goodSpecificationName1',
label: '产品规格',
align: 'center',
},
{
prop: 'quality',
label: '品质',
align: 'center',
filter: codeFilter('quality'),
},
];
const tableProps1 = [
{
prop: 'number',
label: '数量',
align: 'center',
},
]
const tableProps2 = [
{
prop: 'cureTime',
label: '需要熟化时间(小时)',
align: 'center',
},
{
prop: 'alreadyCureTime',
label: '已熟化时间(小时)',
align: 'center',
},
{
prop: 'createTime',
label: '入库时间',
align: 'center',
filter: parseTime,
},
]
export default {
mixins: [basicPage],
props: {
propType: {
type: Number,
default: 1,
},
warehouseId: {
type: String,
default: '',
},
},
data() {
return {
urlOptions: {
getDataListURL: this.propType!==3?getWarehouseStorehouseGoodsSpecificationPage:getWarehouseStorehouseStorageGoodsSpecificationPage,
},
tableProps,
tableProps1,
tableProps2,
tableData: [],
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
warehouseStorehouseId:this.warehouseId,
warehouseStorehouseStorageId:this.warehouseId,
},
};
},
components: {
},
created() {},
methods: {
},
};
</script>

View File

@@ -0,0 +1,64 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-08-31 16:32:17
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-form-item label="仓库编码" prop="warehouseCode">
<el-input
v-model="dataForm.warehouseCode"
clearable
placeholder="请输入仓库编码" />
</el-form-item>
<el-form-item label="仓库名称" prop="warehouseName">
<el-input
v-model="dataForm.warehouseName"
clearable
placeholder="请输入仓库名称" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../mixins/basic-add';
import { createWarehouse, updateWarehouse, getWarehouse, getCode } from "@/api/asrs/warehouse";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
codeName: 'warehouseCode',
createURL: createWarehouse,
updateURL: updateWarehouse,
infoURL: getWarehouse,
},
dataForm: {
id: undefined,
warehouseCode: undefined,
warehouseName: undefined,
remark: undefined,
},
dataRule: {
warehouseCode: [{ required: true, message: "仓库编码不能为空", trigger: "blur" }],
warehouseName: [{ required: true, message: "仓库名称不能为空", trigger: "blur" }],
}
};
},
methods: {
},
};
</script>

View File

@@ -0,0 +1,169 @@
<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="120"
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="70%">
<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 {
deleteWarehouse,
getWarehousePage,
} from '@/api/asrs/warehouse';
const tableProps = [
{
prop: 'warehouseCode',
label: '仓库编码',
align: 'center',
},
{
prop: 'warehouseName',
label: '仓库名称',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehousePage,
deleteURL: deleteWarehouse,
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`asrs:warehouse:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`asrs:warehouse:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '仓库编码',
placeholder: '仓库编码',
param: 'code',
},
{
type: 'input',
label: '仓库名称',
placeholder: '仓库名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('asrs:warehouse:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.warehouseName = val.name;
this.listQuery.warehouseCode = val.code;
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,171 @@
<!--
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-08-31 14:36:15
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="mainbody">
<div v-for="a in 3" :key="a">
<el-row type="flex" justify="space-around">
<el-col :span="5" v-for="i in 4" :key="i">
<el-row type="flex" justify="space-between">
<el-col :span="12" v-for="j in 2" :key="j">
<div
class="dashboard-layout-item"
v-for="z in 2"
:key="z"
style="background: #ffd781; float: left">
<div
class="dashboard-layout-item-cricle"
style="background: #16dc09" />
{{ i + '+' + j + '+' + z }}
</div>
</el-col>
</el-row>
<el-row type="flex" justify="space-between">
<el-col :span="12" v-for="j in 2" :key="j">
<div
class="dashboard-layout-item"
v-for="z in 2"
:key="z"
style="background: #ffd781; float: left">
<div
class="dashboard-layout-item-cricle"
style="background: #16dc09" />
{{ i + '+' + j + '+' + z }}
</div>
</el-col>
</el-row>
</el-col>
</el-row>
<el-divider class="divider"></el-divider>
<el-row type="flex" justify="space-around">
<el-col :span="5" v-for="i in 4" :key="i">
<el-row type="flex" justify="space-between">
<el-col :span="12" v-for="j in 2" :key="j">
<div
class="dashboard-layout-item"
v-for="z in 2"
:key="z"
style="background: #ffd781; float: left">
<div
class="dashboard-layout-item-cricle"
style="background: #16dc09" />
{{ i + '+' + j + '+' + z }}
</div>
</el-col>
</el-row>
<el-row type="flex" justify="space-between">
<el-col :span="12" v-for="j in 2" :key="j">
<div
class="dashboard-layout-item"
v-for="z in 2"
:key="z"
style="background: #ffd781; float: left">
<div
class="dashboard-layout-item-cricle"
style="background: #16dc09" />
{{ i + '+' + j + '+' + z }}
</div>
</el-col>
</el-row>
</el-col>
</el-row>
</div>
</div>
</div>
</template>
<script>
import basicPage from '../mixins/basic-page';
import { getWarehouseStorehousePage } from '@/api/asrs/warehouseStorehouse';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseStorehousePage,
},
listQuery: {
wareLayer: 1,
},
formConfig: [
{
type: 'select',
label: '选择层',
selectOptions: [
{ id: 1, name: '1' },
{ id: 2, name: '2' },
{ id: 3, name: '3' },
{ id: 4, name: '4' },
],
param: 'value',
filterable: true,
defaultSelect: 1,
clearable: false,
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.wareLayer = val.value;
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style lang="scss" scoped>
.mainbody{
display: flex;
gap: 50px;
flex-direction: column;
}
.dashboard-layout-item {
width: 80px;
text-align: center;
height: 32px;
box-shadow: 0px 3px 6px 0px rgba(166, 174, 190, 0.8);
border-radius: 2px 4px 4px 2px;
margin-bottom: 8px;
display: flex;
align-items: center;
justify-content: center;
.dashboard-layout-item-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
margin-right: 6px;
}
}
.el-divider--horizontal {
margin: 10px 0;
}
.el-divider{
background-color: black;
}
</style>

View File

@@ -0,0 +1,173 @@
<!--
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-09-05 14:53:46
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="mainbody">
<div v-for="a in 3" :key="a">
<el-row type="flex" justify="space-around">
<el-col :span="5" v-for="i in 4" :key="i">
<el-row type="flex" justify="space-between">
<el-col :span="12" v-for="j in 2" :key="j">
<div
class="dashboard-layout-item"
v-for="z in 2"
:key="z"
style="background: #ffd781; float: left">
<div
class="dashboard-layout-item-cricle"
style="background: #16dc09" />
{{ i + '+' + j + '+' + z }}
</div>
</el-col>
</el-row>
<el-row type="flex" justify="space-between">
<el-col :span="12" v-for="j in 2" :key="j">
<div
class="dashboard-layout-item"
v-for="z in 2"
:key="z"
style="background: #ffd781; float: left">
<div
class="dashboard-layout-item-cricle"
style="background: #16dc09" />
{{ i + '+' + j + '+' + z }}
</div>
</el-col>
</el-row>
</el-col>
</el-row>
<el-divider class="divider"></el-divider>
<el-row type="flex" justify="space-around">
<el-col :span="5" v-for="i in 4" :key="i">
<el-row type="flex" justify="space-between">
<el-col :span="12" v-for="j in 2" :key="j">
<div
class="dashboard-layout-item"
v-for="z in 2"
:key="z"
style="background: #ffd781; float: left">
<div
class="dashboard-layout-item-cricle"
style="background: #16dc09" />
{{ i + '+' + j + '+' + z }}
</div>
</el-col>
</el-row>
<el-row type="flex" justify="space-between">
<el-col :span="12" v-for="j in 2" :key="j">
<div
class="dashboard-layout-item"
v-for="z in 2"
:key="z"
style="background: #ffd781; float: left">
<div
class="dashboard-layout-item-cricle"
style="background: #16dc09" />
{{ i + '+' + j + '+' + z }}
</div>
</el-col>
</el-row>
</el-col>
</el-row>
</div>
</div>
</div>
</template>
<script>
import basicPage from '../mixins/basic-page';
import { getWarehouseStorehousePage } from '@/api/asrs/warehouseStorehouse';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseStorehousePage,
},
listQuery: {
wareLayer: 1,
},
formConfig: [
{
type: 'select',
label: '选择层',
selectOptions: [
{ id: 1, name: '1' },
{ id: 2, name: '2' },
{ id: 3, name: '3' },
{ id: 4, name: '4' },
],
param: 'value',
filterable: true,
defaultSelect: 1,
clearable: false,
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {},
created() {
this.listQuery.warehouseId = this.bId;
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.wareLayer = val.value;
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style lang="scss" scoped>
.mainbody{
display: flex;
gap: 50px;
flex-direction: column;
}
.dashboard-layout-item {
width: 80px;
text-align: center;
height: 32px;
box-shadow: 0px 3px 6px 0px rgba(166, 174, 190, 0.8);
border-radius: 2px 4px 4px 2px;
margin-bottom: 8px;
display: flex;
align-items: center;
justify-content: center;
.dashboard-layout-item-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
margin-right: 6px;
}
}
.el-divider--horizontal {
margin: 10px 0;
}
.el-divider{
background-color: black;
}
</style>

View File

@@ -0,0 +1,209 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-08-31 16:37:37
* @Description:
-->
<template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
size="medium"
label-width="120px">
<el-col :span="8">
<el-form-item label="仓库" prop="warehouseInfo">
<el-select
v-model="dataForm.warehouseInfo"
placeholder="请输入仓库"
filterable
clearable
@change="setWarehouseInfo"
:style="{ width: '100%' }">
<el-option
v-for="item in urlOptions.optionArr.arr0"
:key="item.id"
:label="item.warehouseName"
:value="item.id+'-'+item.warehouseName+'-'+item.warehouseCode"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="库位名称" prop="warehouseStorehouseName">
<el-input
v-model="dataForm.warehouseStorehouseName"
placeholder="请输入库位名称"
clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label=" 库位编码" prop="warehouseStorehouseCode">
<el-input
v-model="dataForm.warehouseStorehouseCode"
placeholder="请输入 库位编码"
clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="排" prop="wareRow">
<el-input
v-model="dataForm.wareRow"
placeholder="请输入排"
clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="列" prop="wareColumn">
<el-input
v-model="dataForm.wareColumn"
placeholder="请输入列"
clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="层" prop="wareLayer">
<el-input
v-model="dataForm.wareLayer"
placeholder="请输入层"
clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否启用" prop="deactivate">
<el-switch
v-model="dataForm.deactivate"
:active-value="1"
:inactive-value="0"></el-switch>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否缓存库位" prop="cacheLocation">
<el-switch
v-model="dataForm.cacheLocation"
:active-value="1"
:inactive-value="0"></el-switch>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="notes">
<el-input
v-model="dataForm.notes"
placeholder="请输入备注"
clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
</el-form>
</template>
<script>
import basicAdd from '../mixins/basic-add';
import {
createWarehouseStorehouse,
updateWarehouseStorehouse,
getWarehouseStorehouse,
getCode,
} from '@/api/asrs/warehouseStorehouse';
import {
getWarehousePage,
} from '@/api/asrs/warehouse';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
codeName: 'warehouseStorehouseCode',
getOption: true,
optionArrUrl: [getWarehousePage],
createURL: createWarehouseStorehouse,
updateURL: updateWarehouseStorehouse,
infoURL: getWarehouseStorehouse,
},
setData: true,
dataForm: {
id: undefined,
warehouseInfo: undefined,
warehouseId: undefined,
warehouseName: undefined,
warehouseCode: undefined,
warehouseStorehouseName: undefined,
warehouseStorehouseCode: undefined,
wareRow: undefined,
wareColumn: undefined,
wareLayer: undefined,
deactivate: false,
cacheLocation: false,
notes: undefined,
},
dataRule: {
warehouseInfo: [
{
required: true,
message: '请输入仓库',
trigger: 'change',
},
],
warehouseStorehouseName: [
{
required: true,
message: '请输入库位名称',
trigger: 'blur',
},
],
warehouseStorehouseCode: [
{
required: true,
message: '请输入 库位编码',
trigger: 'blur',
},
],
wareRow: [
{
required: true,
message: '请输入排',
trigger: 'blur',
},
],
wareColumn: [
{
required: true,
message: '请输入列',
trigger: 'blur',
},
],
wareLayer: [
{
required: true,
message: '请输入层',
trigger: 'blur',
},
],
notes: [],
},
};
},
methods: {
setDataForm(){
this.dataForm.warehouseInfo = this.dataForm.warehouseId+'-'+this.dataForm.warehouseName+'-'+this.dataForm.warehouseCode
},
setWarehouseInfo(val){
if(val){
this.dataForm.warehouseId = val.split('-')[0]
this.dataForm.warehouseName = val.split('-')[1]
this.dataForm.warehouseCode = val.split('-')[2]
}
}
},
};
</script>

View File

@@ -0,0 +1,203 @@
<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="120"
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="70%">
<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 codeFilter from '../mixins/code-filter';
import { deleteWarehouseStorehouse, getWarehouseStorehousePage, } from "@/api/asrs/warehouseStorehouse";
const tableProps = [
{
prop: 'warehouseCode',
label: '仓库编码',
align: 'center',
},
{
prop: 'warehouseName',
label: '仓库名称',
align: 'center',
},
{
prop: 'warehouseStorehouseCode',
label: '库位编码',
align: 'center',
},
{
prop: 'warehouseStorehouseName',
label: '库位名称',
align: 'center',
},
{
prop: 'wareRow',
label: '排',
align: 'center',
},
{
prop: 'wareColumn',
label: '列',
align: 'center',
},
{
prop: 'wareLayer',
label: '层',
align: 'center',
},
{
prop: 'cacheLocation',
label: '是否缓存库位',
align: 'center',
filter: codeFilter('isOrno'),
},
{
prop: 'deactivate',
label: '是否停用',
align: 'center',
filter: codeFilter('deactivate'),
},
{
prop: 'notes',
label: '备注',
align: 'center',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseStorehousePage,
deleteURL: deleteWarehouseStorehouse,
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`asrs:warehouse-storehouse:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`asrs:warehouse-storehouse:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '库位编码',
placeholder: '库位编码',
param: 'code',
},
{
type: 'input',
label: '库位名称',
placeholder: '库位名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('asrs:warehouse-storehouse:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.warehouseStorehouseName = val.name;
this.listQuery.warehouseStorehouseCode = val.code;
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,206 @@
<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="120"
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="70%">
<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 codeFilter from '../mixins/code-filter';
import { deleteWarehouseStorehouse, getWarehouseStorehousePage, } from "@/api/asrs/warehouseStorehouse";
const tableProps = [
{
prop: 'warehouseCode',
label: '仓库编码',
align: 'center',
},
{
prop: 'warehouseName',
label: '仓库名称',
align: 'center',
},
{
prop: 'warehouseStorehouseCode',
label: '库位编码',
align: 'center',
},
{
prop: 'warehouseStorehouseName',
label: '库位名称',
align: 'center',
},
{
prop: 'wareRow',
label: '排',
align: 'center',
},
{
prop: 'wareColumn',
label: '列',
align: 'center',
},
{
prop: 'wareLayer',
label: '层',
align: 'center',
},
{
prop: 'cacheLocation',
label: '是否缓存库位',
align: 'center',
filter: codeFilter('isOrno'),
},
{
prop: 'deactivate',
label: '是否停用',
align: 'center',
filter: codeFilter('deactivate'),
},
{
prop: 'notes',
label: '备注',
align: 'center',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseStorehousePage,
deleteURL: deleteWarehouseStorehouse,
},
tableProps,
bPage: true,
tableBtn: [
this.$auth.hasPermi(`asrs:warehouse-storehouse:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`asrs:warehouse-storehouse:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '库位编码',
placeholder: '库位编码',
param: 'code',
},
{
type: 'input',
label: '库位名称',
placeholder: '库位名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('asrs:warehouse-storehouse:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
},
created() {
this.listQuery.warehouseId = this.bId;
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.warehouseStorehouseName = val.name;
this.listQuery.warehouseStorehouseCode = val.code;
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,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,371 @@
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
: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="code">
<el-input
v-model="dataForm.code"
readonly
:disabled="isdetail"
placeholder="请输入仓库编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="仓库名" prop="name">
<el-input
v-model="dataForm.name"
readonly
:disabled="isdetail"
placeholder="请输入仓库名" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="工序" prop="processId">
<el-select
v-model="dataForm.processId"
style="width: 100%"
:disabled="isdetail"
placeholder="请选择工序">
<el-option
v-for="item in processArr"
:key="item.id"
:label="item.name"
:value="item.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品信息
</small-title>
<div class="attr-list">
<base-table
:table-props="
propType === 1 ? [...tableProps, ...tableProps1] : tableProps
"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="addButtonShow"
@emitButtonClick="addNew"
:table-data="productAttributeList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
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>
<el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button>
<span v-if="!isdetail">
<el-button type="primary" @click="dataFormSubmit()">保存</el-button>
<!-- <el-button
v-if="dataForm.id && !isdetail"
type="primary"
@click="addNew()">
添加属性
</el-button> -->
</span>
</div>
<product-attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:warehouse-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import {
updateProduct,
} from '@/api/core/base/product';
import {
getWarehouseStorehouseGoodsSpecificationPage,
deleteWarehouseStorehouseGoodsSpecification,
} from '@/api/asrs/warehouseStorehouseGoodsSpecification';
import productAttrAdd from './attr-add';
import { parseTime } from '../mixins/code-filter';
import codeFilter from '../mixins/code-filter';
import SmallTitle from './SmallTitle';
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'goodSpecificationName',
label: '产品名',
},
{
prop: 'goodSpecificationCode',
label: '产品编码',
},
{
prop: 'goodSpecificationName1',
label: '产品规格',
align: 'center',
},
{
prop: 'quality',
label: '品质',
align: 'center',
filter: codeFilter('quality'),
},
{
prop: 'cureTime',
label: '需要熟化时间(小时)',
align: 'center',
},
];
const tableProps1 = [
{
prop: 'number',
label: '数量',
align: 'center',
},
];
const processArr = [
{
name: '开始',
id: 0,
},
{
name: '一次分切后',
id: 1,
},
{
name: '一次分拣后',
id: 2,
},
{
name: '二次分切后',
id: 3,
},
{
name: '二次分拣后',
id: 4,
},
];
export default {
components: { productAttrAdd, SmallTitle },
props: {
propType: {
type: Number,
default: 0,
},
},
data() {
return {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
tableProps1,
productAttributeList: [],
addButtonShow: '新增',
processArr,
dataForm: {
id: null,
name: '',
code: '',
processId: '',
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataRule: {
// name: [
// {
// required: true,
// message: '产品名称不能为空',
// trigger: 'blur',
// },
// ],
},
isdetail: false,
};
},
methods: {
initData() {
this.productAttributeList.splice(0);
},
init(val, isdetail) {
console.log(val)
this.dataForm.name = val.warehouseName
this.dataForm.code = val.warehouseCode
this.dataForm.processId = val.process
let id = val.id
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || null;
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
// 获取产品详情
// 获取产品的属性列表
this.getList();
}
});
},
getList() {
// 获取产品的属性列表
const params = {
pageSize: 100,
pageNo: 1,
warehouseStorehouseId: this.dataForm.id,
};
getWarehouseStorehouseGoodsSpecificationPage(params).then((response) => {
this.productAttributeList = response.data.list;
this.listQuery.total = response.data.total;
});
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteWarehouseStorehouseGoodsSpecification(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
// 修改的提交
if (this.dataForm.id) {
updateProduct(this.dataForm).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
}
});
},
goEdit() {
this.isdetail = false;
},
// 新增 / 修改
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
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-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 30px;
}
.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,134 @@
<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">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="产品" prop="productId">
<el-select
v-model="dataForm.productId"
style="width: 100%"
@change="setProduct"
placeholder="请选择产品">
<el-option
v-for="item in productArr"
:key="item.id"
:label="item.goodSpecificationName"
:value="item.id" />
</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 { createWarehouseStorehouseGoodsSpecification } from '@/api/asrs/warehouseStorehouseGoodsSpecification';
import { getGoodSpecificationPage } from '@/api/asrs/goodSpecification';
export default {
props: {
warehouseId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: 0,
productId: '',
value: '',
},
productArr: [],
dataRule: {
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(id) {
this.dataForm.id = id || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
const params = {
pageSize: 100,
pageNo: 1,
};
getGoodSpecificationPage(params).then((response) => {
this.productArr = response.data.list;
});
});
},
setProduct(val) {
let data = this.productArr.find((item) => {
return (item.id === val);
});
const { id, ...newData } = data;
this.dataForm.value = newData;
this.dataForm.value.goodSpecificationId = id;
},
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
// 添加的提交
createWarehouseStorehouseGoodsSpecification({
...this.dataForm.value,
warehouseStorehouseId: this.warehouseId,
}).then((response) => {
this.$modal.msgSuccess('添加成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</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,242 @@
<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>
<el-table-column prop="warehouseCode" label="仓库编码"></el-table-column>
<el-table-column
prop="warehouseStorehouseName"
label="库位名"></el-table-column>
<el-table-column
prop="warehouseStorehouseCode"
label="库位编码"></el-table-column>
<el-table-column prop="trayCode" label="托盘编码"></el-table-column>
<el-table-column prop="process" label="工序">
<template slot-scope="scope">
<span>
{{ scope.row.process>=0 ? processArr[scope.row.process].name : '' }}
</span>
</template>
</el-table-column>
<el-table-column prop="cacheLocation" label="缓存库位">
<template slot-scope="scope">
<span>{{ scope.row.cacheLocation === 0 ? '否' : '是' }}</span>
</template>
</el-table-column>
<el-table-column prop="warehouseStorehouseState" label="仓库状态">
<template slot-scope="scope">
<span>
{{
scope.row.warehouseStorehouseState>=0
? warehouseStorehouseState[scope.row.warehouseStorehouseState]
.name
: ''
}}
</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="handleClick({ data: {id:scope.row}, type: 'edit' })"
v-hasPermi="[
'asrs:warehouse-storehouse-goods-specification:update',
]">
编辑
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList" />
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import product from '../product-mini';
import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import { getWarehouseStorehousePage, } from "@/api/asrs/warehouseStorehouse";
const processArr = [
{
name: '开始',
id: 0,
},
{
name: '一次分切后',
id: 1,
},
{
name: '一次分拣后',
id: 2,
},
{
name: '二次分切后',
id: 3,
},
{
name: '二次分拣后',
id: 4,
},
];
const warehouseStorehouseState = [
{
name: '空',
id: 0,
},
{
name: '锁定',
id: 1,
},
{
name: '满',
id: 2,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseStorehousePage,
},
tableData: [],
processArr,
warehouseStorehouseState,
formConfig: [
{
type: 'input',
label: '库位名',
placeholder: '库位名',
param: 'name',
},
{
type: 'input',
label: '库位编码',
placeholder: '库位编码',
param: 'code',
},
{
type: 'input',
label: '产品名',
placeholder: '产品名',
param: 'pname',
},
{
type: 'input',
label: '产品编码',
placeholder: '产品编码',
param: 'pcode',
},
{
type: 'select',
label: '工序',
selectOptions: processArr,
param: 'processId',
defaultSelect: '',
filterable: true,
},
{
type: 'select',
label: '库位状态',
selectOptions: warehouseStorehouseState,
param: 'warehouseStorehouseStateId',
defaultSelect: '',
filterable: true,
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
product,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.warehouseStorehouseName = val.name;
this.listQuery.warehouseStorehouseCode = val.code;
this.listQuery.goodName = val.pname;
this.listQuery.goodCode = val.pcode;
this.listQuery.process = val.processId;
this.listQuery.warehouseStorehouseState = val.warehouseStorehouseStateId;
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>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@@ -0,0 +1,245 @@
<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>
<el-table-column prop="warehouseCode" label="仓库编码"></el-table-column>
<el-table-column
prop="warehouseStorehouseName"
label="库位名"></el-table-column>
<el-table-column
prop="warehouseStorehouseCode"
label="库位编码"></el-table-column>
<el-table-column prop="trayCode" label="托盘编码"></el-table-column>
<el-table-column prop="process" label="工序">
<template slot-scope="scope">
<span>
{{ scope.row.process>=0 ? processArr[scope.row.process].name : '' }}
</span>
</template>
</el-table-column>
<el-table-column prop="cacheLocation" label="缓存库位">
<template slot-scope="scope">
<span>{{ scope.row.cacheLocation === 0 ? '否' : '是' }}</span>
</template>
</el-table-column>
<el-table-column prop="warehouseStorehouseState" label="仓库状态">
<template slot-scope="scope">
<span>
{{
scope.row.warehouseStorehouseState>=0
? warehouseStorehouseState[scope.row.warehouseStorehouseState]
.name
: ''
}}
</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="handleClick({ data: {id:scope.row}, type: 'edit' })"
v-hasPermi="[
'asrs:warehouse-storehouse-goods-specification:update',
]">
编辑
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList" />
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import product from '../product-mini';
import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import { getWarehouseStorehousePage, } from "@/api/asrs/warehouseStorehouse";
const processArr = [
{
name: '开始',
id: 0,
},
{
name: '一次分切后',
id: 1,
},
{
name: '一次分拣后',
id: 2,
},
{
name: '二次分切后',
id: 3,
},
{
name: '二次分拣后',
id: 4,
},
];
const warehouseStorehouseState = [
{
name: '空',
id: 0,
},
{
name: '锁定',
id: 1,
},
{
name: '满',
id: 2,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseStorehousePage,
},
tableData: [],
processArr,
warehouseStorehouseState,
bPage: true,
formConfig: [
{
type: 'input',
label: '库位名',
placeholder: '库位名',
param: 'name',
},
{
type: 'input',
label: '库位编码',
placeholder: '库位编码',
param: 'code',
},
{
type: 'input',
label: '产品名',
placeholder: '产品名',
param: 'pname',
},
{
type: 'input',
label: '产品编码',
placeholder: '产品编码',
param: 'pcode',
},
{
type: 'select',
label: '工序',
selectOptions: processArr,
param: 'processId',
defaultSelect: '',
filterable: true,
},
{
type: 'select',
label: '库位状态',
selectOptions: warehouseStorehouseState,
param: 'warehouseStorehouseStateId',
defaultSelect: '',
filterable: true,
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
product,
},
created() {
this.listQuery.warehouseId = this.bId;
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.warehouseStorehouseName = val.name;
this.listQuery.warehouseStorehouseCode = val.code;
this.listQuery.goodName = val.pname;
this.listQuery.goodCode = val.pcode;
this.listQuery.process = val.processId;
this.listQuery.warehouseStorehouseState = val.warehouseStorehouseStateId;
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>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

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,375 @@
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
: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="code">
<el-input
v-model="dataForm.code"
readonly
:disabled="isdetail"
placeholder="请输入仓库编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="仓库名" prop="name">
<el-input
v-model="dataForm.name"
readonly
:disabled="isdetail"
placeholder="请输入仓库名" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="工序" prop="processId">
<el-select
v-model="dataForm.processId"
style="width: 100%"
:disabled="isdetail"
placeholder="请选择工序">
<el-option
v-for="item in processArr"
:key="item.id"
:label="item.name"
:value="item.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品信息
</small-title>
<div class="attr-list">
<base-table
:table-props="
propType === 1 ? [...tableProps, ...tableProps1] : tableProps
"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="addButtonShow"
@emitButtonClick="addNew"
:table-data="productAttributeList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
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>
<el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button>
<span v-if="!isdetail">
<el-button type="primary" @click="dataFormSubmit()">保存</el-button>
<!-- <el-button
v-if="dataForm.id && !isdetail"
type="primary"
@click="addNew()">
添加属性
</el-button> -->
</span>
</div>
<product-attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:warehouse-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import {
updateProduct,
} from '@/api/core/base/product';
import {
getWarehouseStorehouseGoodsSpecificationPage,
deleteWarehouseStorehouseGoodsSpecification,
} from '@/api/asrs/warehouseStorehouseGoodsSpecification';
import productAttrAdd from './attr-add';
import { parseTime } from '../mixins/code-filter';
import codeFilter from '../mixins/code-filter';
import SmallTitle from './SmallTitle';
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'goodSpecificationName',
label: '产品名',
},
{
prop: 'goodSpecificationCode',
label: '产品编码',
},
{
prop: 'goodSpecificationName1',
label: '产品规格',
align: 'center',
},
{
prop: 'number',
label: '数量',
align: 'center',
},
{
prop: 'quality',
label: '品质',
align: 'center',
filter: codeFilter('quality'),
},
{
prop: 'cureTime',
label: '需要熟化时间(小时)',
align: 'center',
},
];
const tableProps1 = [
{
prop: 'number',
label: '数量',
align: 'center',
},
];
const processArr = [
{
name: '开始',
id: 0,
},
{
name: '一次分切后',
id: 1,
},
{
name: '一次分拣后',
id: 2,
},
{
name: '二次分切后',
id: 3,
},
{
name: '二次分拣后',
id: 4,
},
];
export default {
components: { productAttrAdd, SmallTitle },
props: {
propType: {
type: Number,
default: 0,
},
},
data() {
return {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
tableProps1,
productAttributeList: [],
addButtonShow: '新增',
processArr,
dataForm: {
id: null,
name: '',
code: '',
processId: '',
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataRule: {
// name: [
// {
// required: true,
// message: '产品名称不能为空',
// trigger: 'blur',
// },
// ],
},
isdetail: false,
};
},
methods: {
initData() {
this.productAttributeList.splice(0);
},
init(val, isdetail) {
this.dataForm.name = val.warehouseName
this.dataForm.code = val.warehouseCode
this.dataForm.processId = val.process
let id = val.id
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || null;
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
// 获取产品详情
// 获取产品的属性列表
this.getList();
}
});
},
getList() {
// 获取产品的属性列表
const params = {
pageSize: 100,
pageNo: 1,
warehouseStorehouseId: this.dataForm.id,
};
getWarehouseStorehouseGoodsSpecificationPage(params).then((response) => {
this.productAttributeList = response.data.list;
this.listQuery.total = response.data.total;
});
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteWarehouseStorehouseGoodsSpecification(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
// 修改的提交
if (this.dataForm.id) {
updateProduct(this.dataForm).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
}
});
},
goEdit() {
this.isdetail = false;
},
// 新增 / 修改
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
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-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 30px;
}
.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,134 @@
<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">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="产品" prop="productId">
<el-select
v-model="dataForm.productId"
style="width: 100%"
@change="setProduct"
placeholder="请选择产品">
<el-option
v-for="item in productArr"
:key="item.id"
:label="item.goodSpecificationName"
:value="item.id" />
</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 { createWarehouseStorehouseGoodsSpecification } from '@/api/asrs/warehouseStorehouseGoodsSpecification';
import { getGoodSpecificationPage } from '@/api/asrs/goodSpecification';
export default {
props: {
warehouseId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: 0,
productId: '',
value: '',
},
productArr: [],
dataRule: {
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(id) {
this.dataForm.id = id || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
const params = {
pageSize: 100,
pageNo: 1,
};
getGoodSpecificationPage(params).then((response) => {
this.productArr = response.data.list;
});
});
},
setProduct(val) {
let data = this.productArr.find((item) => {
return (item.id === val);
});
const { id, ...newData } = data;
this.dataForm.value = newData;
this.dataForm.value.goodSpecificationId = id;
},
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
// 添加的提交
createWarehouseStorehouseGoodsSpecification({
...this.dataForm.value,
warehouseStorehouseId: this.warehouseId,
}).then((response) => {
this.$modal.msgSuccess('添加成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</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,307 @@
<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" :prop-type="2"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名"></el-table-column>
<el-table-column prop="warehouseCode" label="仓库编码"></el-table-column>
<el-table-column
prop="warehouseStorehouseName"
label="库位名"></el-table-column>
<el-table-column
prop="warehouseStorehouseCode"
label="库位编码"></el-table-column>
<el-table-column prop="trayCode" label="托盘编码"></el-table-column>
<el-table-column prop="process" label="工序">
<template slot-scope="scope">
<span>
{{
scope.row.process >= 0 ? processArr[scope.row.process].name : ''
}}
</span>
</template>
</el-table-column>
<el-table-column prop="cacheLocation" label="缓存库位">
<template slot-scope="scope">
<span>{{ scope.row.cacheLocation === 0 ? '否' : '是' }}</span>
</template>
</el-table-column>
<el-table-column prop="warehouseStorehouseState" label="仓库状态">
<template slot-scope="scope">
<span>
{{
scope.row.warehouseStorehouseState >= 0
? warehouseStorehouseState[scope.row.warehouseStorehouseState]
.name
: ''
}}
</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template v-slot="scope">
<el-button
size="mini"
v-if="scope.row.warehouseStorehouseState === 0"
type="text"
@click="handleClick({ data: { id: scope.row }, type: 'in' })"
v-hasPermi="['asrs:warehouse-storehouse-storage:update']">
入库
</el-button>
<el-button
size="mini"
v-else-if="scope.row.warehouseStorehouseState === 1"
type="text"
@click="handleClick({ data: scope.row, type: 'out' })"
v-hasPermi="['asrs:warehouse-storehouse-storage:update']">
出库
</el-button>
<el-button
size="mini"
v-else-if="scope.row.warehouseStorehouseState === 2"
type="text"
@click="handleClick({ data: scope.row, type: 'move' })"
v-hasPermi="['asrs:warehouse-storehouse-storage:update']">
移库
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<add-or-update
v-if="drawerVisible"
ref="drawerRef"
:prop-type="2"
@refreshDataList="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<out-or-move
ref="addOrUpdate"
@refreshDataList="successSubmit"></out-or-move>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import outOrMove from './out-or-move';
import product from '../product-mini';
import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import { getWarehouseStorehousePage } from '@/api/asrs/warehouseStorehouse';
const processArr = [
{
name: '开始',
id: 0,
},
{
name: '一次分切后',
id: 1,
},
{
name: '一次分拣后',
id: 2,
},
{
name: '二次分切后',
id: 3,
},
{
name: '二次分拣后',
id: 4,
},
];
const warehouseStorehouseState = [
{
name: '空',
id: 0,
},
{
name: '锁定',
id: 1,
},
{
name: '满',
id: 2,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseStorehousePage,
},
tableData: [],
processArr,
drawerVisible: false,
warehouseStorehouseState,
formConfig: [
{
type: 'input',
label: '库位名',
placeholder: '库位名',
param: 'name',
},
{
type: 'input',
label: '库位编码',
placeholder: '库位编码',
param: 'code',
},
{
type: 'input',
label: '产品名',
placeholder: '产品名',
param: 'pname',
},
{
type: 'input',
label: '产品编码',
placeholder: '产品编码',
param: 'pcode',
},
{
type: 'select',
label: '工序',
selectOptions: processArr,
param: 'processId',
defaultSelect: '',
filterable: true,
},
{
type: 'select',
label: '库位状态',
selectOptions: warehouseStorehouseState,
param: 'warehouseStorehouseStateId',
defaultSelect: '',
filterable: true,
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: 'button',
btnName: '重置',
name: 'reset',
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
product,
outOrMove,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.warehouseStorehouseName = val.name;
this.listQuery.warehouseStorehouseCode = val.code;
this.listQuery.goodName = val.pname;
this.listQuery.goodCode = val.pcode;
this.listQuery.process = val.processId;
this.listQuery.warehouseStorehouseState =
val.warehouseStorehouseStateId;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs.drawerRef.init(id);
});
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'out') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '出库';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, 0);
});
} else if (val.type === 'move') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '移库';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, 1);
});
} else if (val.type === 'in') {
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs.drawerRef.init(val.data.id);
});
} else {
console.log(11);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@@ -0,0 +1,310 @@
<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" :prop-type="2"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名"></el-table-column>
<el-table-column prop="warehouseCode" label="仓库编码"></el-table-column>
<el-table-column
prop="warehouseStorehouseName"
label="库位名"></el-table-column>
<el-table-column
prop="warehouseStorehouseCode"
label="库位编码"></el-table-column>
<el-table-column prop="trayCode" label="托盘编码"></el-table-column>
<el-table-column prop="process" label="工序">
<template slot-scope="scope">
<span>
{{
scope.row.process >= 0 ? processArr[scope.row.process].name : ''
}}
</span>
</template>
</el-table-column>
<el-table-column prop="cacheLocation" label="缓存库位">
<template slot-scope="scope">
<span>{{ scope.row.cacheLocation === 0 ? '否' : '是' }}</span>
</template>
</el-table-column>
<el-table-column prop="warehouseStorehouseState" label="仓库状态">
<template slot-scope="scope">
<span>
{{
scope.row.warehouseStorehouseState >= 0
? warehouseStorehouseState[scope.row.warehouseStorehouseState]
.name
: ''
}}
</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template v-slot="scope">
<el-button
size="mini"
v-if="scope.row.warehouseStorehouseState === 0"
type="text"
@click="handleClick({ data: { id: scope.row }, type: 'in' })"
v-hasPermi="['asrs:warehouse-storehouse-storage:update']">
入库
</el-button>
<el-button
size="mini"
v-else-if="scope.row.warehouseStorehouseState === 1"
type="text"
@click="handleClick({ data: scope.row, type: 'out' })"
v-hasPermi="['asrs:warehouse-storehouse-storage:update']">
出库
</el-button>
<el-button
size="mini"
v-else-if="scope.row.warehouseStorehouseState === 2"
type="text"
@click="handleClick({ data: scope.row, type: 'move' })"
v-hasPermi="['asrs:warehouse-storehouse-storage:update']">
移库
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<add-or-update
v-if="drawerVisible"
ref="drawerRef"
:prop-type="2"
@refreshDataList="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<out-or-move
ref="addOrUpdate"
@refreshDataList="successSubmit"></out-or-move>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import outOrMove from './out-or-move';
import product from '../product-mini';
import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import { getWarehouseStorehousePage } from '@/api/asrs/warehouseStorehouse';
const processArr = [
{
name: '开始',
id: 0,
},
{
name: '一次分切后',
id: 1,
},
{
name: '一次分拣后',
id: 2,
},
{
name: '二次分切后',
id: 3,
},
{
name: '二次分拣后',
id: 4,
},
];
const warehouseStorehouseState = [
{
name: '空',
id: 0,
},
{
name: '锁定',
id: 1,
},
{
name: '满',
id: 2,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseStorehousePage,
},
tableData: [],
processArr,
drawerVisible: false,
bPage: true,
warehouseStorehouseState,
formConfig: [
{
type: 'input',
label: '库位名',
placeholder: '库位名',
param: 'name',
},
{
type: 'input',
label: '库位编码',
placeholder: '库位编码',
param: 'code',
},
{
type: 'input',
label: '产品名',
placeholder: '产品名',
param: 'pname',
},
{
type: 'input',
label: '产品编码',
placeholder: '产品编码',
param: 'pcode',
},
{
type: 'select',
label: '工序',
selectOptions: processArr,
param: 'processId',
defaultSelect: '',
filterable: true,
},
{
type: 'select',
label: '库位状态',
selectOptions: warehouseStorehouseState,
param: 'warehouseStorehouseStateId',
defaultSelect: '',
filterable: true,
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: 'button',
btnName: '重置',
name: 'reset',
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
product,
outOrMove,
},
created() {
this.listQuery.warehouseId = this.bId;
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.warehouseStorehouseName = val.name;
this.listQuery.warehouseStorehouseCode = val.code;
this.listQuery.goodName = val.pname;
this.listQuery.goodCode = val.pcode;
this.listQuery.process = val.processId;
this.listQuery.warehouseStorehouseState =
val.warehouseStorehouseStateId;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs.drawerRef.init(id);
});
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'out') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '出库';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, 0);
});
} else if (val.type === 'move') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '移库';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, 1);
});
} else if (val.type === 'in') {
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs.drawerRef.init(val.data.id);
});
} else {
console.log(11);
}
},
},
};
</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-09-04 15:47:46
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="150px">
<el-form-item :label="type?'选择移库位置':'选择出库到货位置'" prop="targetId">
<el-select
v-model="dataForm.targetId"
style="width: 100%"
placeholder="请选择位置">
<el-option
v-for="item in potArr"
:key="item.id"
:label="item.warehouseName"
:value="item.id" />
</el-select>
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../mixins/basic-add';
import { getWarehouseStorehousePage,moveStorehouse } from "@/api/asrs/warehouseStorehouse";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
},
dataForm: {
sourceId: undefined,
targetId: undefined,
},
potArr: [],
type: 0,
dataRule: {
targetId: [{ required: true, message: "位置不能为空", trigger: "blur" }],
}
};
},
methods: {
init(id,type) {
this.dataForm.sourceId = id || "";
this.type = type
this.visible = true;
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
const params = {
pageSize: 100,
pageNo: 1,
};
getWarehouseStorehousePage(params).then((response) => {
this.potArr = response.data.list;
});
});
},
// 表单提交
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
moveStorehouse(this.dataForm.sourceId,this.dataForm.targetId).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
},
};
</script>

View File

@@ -0,0 +1,192 @@
<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" :prop-type="3"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名"></el-table-column>
<el-table-column prop="warehouseCode" label="仓库编码"></el-table-column>
<el-table-column
prop="warehouseStorehouseName"
label="库位名"></el-table-column>
<el-table-column
prop="warehouseStorehouseCode"
label="库位编码"></el-table-column>
<el-table-column prop="trayCode" label="托盘编码"></el-table-column>
<el-table-column prop="createDate" label="出入库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createDate) }}</span>
</template>
</el-table-column>
<el-table-column
prop="warehouseStorehouseStorageState"
label="出入库状态">
<template slot-scope="scope">
<span>
{{
scope.row.warehouseStorehouseStorageState >= 0
? warehouseStorehouseStorageState[
scope.row.warehouseStorehouseStorageState
].name
: ''
}}
</span>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import product from '../product-mini';
import basicPage from '../mixins/basic-page';
import { getWarehouseStorehouseStoragePage } from '@/api/asrs/warehouseStorehouseStorage';
const warehouseStorehouseStorageState = [
{
name: '入库',
id: 0,
},
{
name: '出库',
id: 1,
},
{
name: '移库',
id: 2,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseStorehouseStoragePage,
},
tableData: [],
warehouseStorehouseStorageState,
formConfig: [
{
type: 'input',
label: '仓库名',
placeholder: '仓库名',
param: 'name',
},
{
type: 'input',
label: '库位编码',
placeholder: '库位编码',
param: 'kcode',
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'tcode',
},
{
type: 'select',
label: '库位状态',
selectOptions: warehouseStorehouseStorageState,
param: 'warehouseStorehouseStateId',
defaultSelect: '',
filterable: true,
},
{
type: 'datePicker',
label: '出入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
product,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.warehouseStorehouseName = val.name;
this.listQuery.warehouseStorehouseCode = val.kcode;
this.listQuery.trayCode = val.tcode;
this.listQuery.warehouseStorehouseStorageState =
val.warehouseStorehouseStorageStateId;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : '';
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : '';
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>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@@ -0,0 +1,191 @@
<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" :prop-type="3"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名"></el-table-column>
<el-table-column prop="warehouseCode" label="仓库编码"></el-table-column>
<el-table-column
prop="warehouseStorehouseName"
label="库位名"></el-table-column>
<el-table-column
prop="warehouseStorehouseCode"
label="库位编码"></el-table-column>
<el-table-column prop="trayCode" label="托盘编码"></el-table-column>
<el-table-column prop="createDate" label="出入库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createDate) }}</span>
</template>
</el-table-column>
<el-table-column
prop="warehouseStorehouseStorageState"
label="出入库状态">
<template slot-scope="scope">
<span>
{{
scope.row.warehouseStorehouseStorageState >= 0
? warehouseStorehouseStorageState[
scope.row.warehouseStorehouseStorageState
].name
: ''
}}
</span>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import product from '../product-mini';
import basicPage from '../mixins/basic-page';
import { getWarehouseStorehouseStoragePage, } from "@/api/asrs/warehouseStorehouseStorage";
const warehouseStorehouseStorageState = [
{
name: '入库',
id: 0,
},
{
name: '出库',
id: 1,
},
{
name: '移库',
id: 2,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseStorehouseStoragePage,
},
tableData: [],
warehouseStorehouseStorageState,
formConfig: [
{
type: 'input',
label: '仓库名',
placeholder: '仓库名',
param: 'name',
},
{
type: 'input',
label: '库位编码',
placeholder: '库位编码',
param: 'kcode',
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'tcode',
},
{
type: 'select',
label: '库位状态',
selectOptions: warehouseStorehouseStorageState,
param: 'warehouseStorehouseStateId',
defaultSelect: '',
filterable: true,
},
{
type: 'datePicker',
label: '出入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime2',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
product,
},
created() {
this.listQuery.warehouseId = this.bId;
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.warehouseStorehouseName = val.name;
this.listQuery.warehouseStorehouseCode = val.kcode;
this.listQuery.trayCode = val.tcode;
this.listQuery.warehouseStorehouseStorageState = val.warehouseStorehouseStorageStateId;
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>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>