You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

741 lines
18 KiB
Vue

1 year ago
<template>
<div class="app-container">
<div class="headTitle">京源环保生产管理系统</div>
1 year ago
<div class="chartBox chartBox1">
<div class="title">派工信息</div>
1 year ago
<div class="chart">
<div class="whiteTable">
<el-table
:cell-style="{textAlign:'center'}"
:data="tableData"
:header-cell-style="{textAlign:'center'}"
:max-height="19.13 * vw"
style="width: 100%"
>
<el-table-column
label="序号"
type="index"
width="50"
>
</el-table-column>
<el-table-column
label="工单编号"
prop="planCode"
>
</el-table-column>
<el-table-column
label="物料名称"
prop="materialName"
width="100"
>
</el-table-column>
<el-table-column
label="计划"
prop="planAmount"
width="100"
>
</el-table-column>
<el-table-column
label="实际"
prop="completeAmount"
width="100"
>
</el-table-column>
<el-table-column
label="差异"
prop="difference"
width="100"
>
<template slot-scope="scope">
{{ scope.row.planAmount - scope.row.completeAmount }}
</template>
</el-table-column>
<el-table-column
label="交付时间"
prop="planDeliveryDate"
width="150"
>
</el-table-column>
<el-table-column
label="操作"
width="120"
>
<template slot-scope="scope">
<el-button
size="small"
type="text"
>
条码打印
</el-button>
<el-button
size="small"
type="text"
@click="getDetail(scope)"
>
明细
</el-button>
</template>
</el-table-column>
</el-table>
</div>
1 year ago
</div>
</div>
<div class="chartBox chartBox2">
<div class="title">库存统计</div>
<div class="chart">
<Chart ref="chart2"></Chart>
</div>
</div>
<div class="chartBox chartBox3">
<div class="title">计划明细</div>
<div class="chart">
<div class="whiteTable">
<el-table
:cell-style="{textAlign:'center'}"
:data="tableData1"
:header-cell-style="{textAlign:'center'}"
:max-height="19.13 * vw"
style="width: 100%"
>
<el-table-column
label="序号"
type="index"
width="50"
>
</el-table-column>
<el-table-column
label="工单编号"
prop="planCode"
width="80"
>
</el-table-column>
<el-table-column
label="明细编号"
prop="planDetailCode"
>
</el-table-column>
<el-table-column
label="开始时间"
prop="realBeginTime"
width="150"
>
</el-table-column>
<el-table-column
label="结束时间"
prop="realEndTime"
width="150"
>
</el-table-column>
<el-table-column
label="状态"
prop="createTime"
width="80"
>
<template slot-scope="scope">
<el-tag v-if="scope.row.planDetailStatus==='1'" size="small"></el-tag>
<el-tag v-if="scope.row.planDetailStatus==='2'" size="small" type="info"></el-tag>
<el-tag v-if="scope.row.planDetailStatus==='3'" size="small" type="success"></el-tag>
</template>
</el-table-column>
<el-table-column
label="操作"
width="160"
>
<template slot-scope="scope">
<el-button
v-if="scope.row.planDetailStatus !== '3'"
size="small"
type="text"
@click="planExecute(scope.row)"
>
{{ scope.row.planDetailStatus === '1' ? '开始' : '完成' }}
</el-button>
<el-button
size="small"
type="text"
@click="getMaterials(scope) "
>
领料
</el-button>
<el-button
size="small"
type="text"
>
扫描
</el-button>
<el-button
size="small"
type="text"
>
退料
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<div class="chartBox chartBox4">
<div class="title">当日产量</div>
<div class="chart">
<Chart ref="chart4"></Chart>
</div>
</div>
<div class="bottom">
<el-row>
<el-button type="primary">首页</el-button>
<el-button type="success">键盘</el-button>
<el-button type="info">最小化</el-button>
<el-button type="danger">退出</el-button>
</el-row>
</div>
<el-dialog
:visible.sync="dialogVisible"
title="领料"
width="40%">
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="生产计划">
<el-input v-model="form.planCode"></el-input>
</el-form-item>
<el-form-item v-show="false" label="成品">
<el-input v-model="form.productId"></el-input>
</el-form-item>
<el-form-item v-show="false" label="领料类型">
<el-select v-model="form.taskType" placeholder="请选择领料类型">
<el-option label="类型一" value="shanghai"></el-option>
<el-option label="类型二" value="beijing"></el-option>
</el-select>
</el-form-item>
<el-form-item label="领料仓库">
<el-select v-model="form.warehouseId" placeholder="请选择领料仓库" @change="form.wmsRawOutstockDetailList =[]">
<el-option v-for="item in warehouseList" :key="item.warehouseId" :label="item.warehouseName"
:value="item.warehouseId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="领料原因">
<el-input v-model="form.applyReason" type="textarea"></el-input>
</el-form-item>
</el-form>
<el-table
:cell-style="{textAlign:'center'}"
:data="form.wmsRawOutstockDetailList"
:header-cell-style="{textAlign:'center'}"
max-height="19.13vw"
style="width: 100%"
>
<el-table-column
label="物料编号"
prop="materialId"
>
</el-table-column>
<el-table-column
label="物料名称"
prop="materialName"
>
</el-table-column>
<el-table-column
label="领取数量"
prop="planAmount"
width="120"
>
<template slot-scope="scope">
<el-input-number
v-model="scope.row.quantityAcquired"
controls-position="right"
style="width: 100%"
>
</el-input-number>
</template>
</el-table-column>
<el-table-column
label="操作"
width="160"
>
<template slot="header" slot-scope="scope">
<el-input
v-model="searchMaterialValue"
placeholder="输入物料名称搜索"
size="mini"
@change="searchMaterial"/>
</template>
<template slot-scope="scope">
<el-button
size="small"
type="text"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 12px">
<el-button type="primary" @click="receiveMaterial"></el-button>
</div>
</el-dialog>
1 year ago
</div>
</template>
<script>
import Chart from '@/components/board/Chart'
1 year ago
import * as echarts from 'echarts'
import {
getMaterialBoms,
getWarehouses,
applyRawOutstock,
getProductPlans,
insertProductPlanDetails,
getProductPlanDetails, startProductPlanDetail, completeProductPlanDetail
} from '@/api/board/firstFloor'
1 year ago
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
name: 'Board1',
1 year ago
components: {
Chart
},
data() {
return {
vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
searchMaterialValue: '',
warehouseList: [],
form: {
warehouseId: '',
planCode: '',
applyReason: '',
productId: '' || 2,
planDetailCode: '' || 1,
taskType: '1',
wmsRawOutstockDetailList: []
},
form2: {
materialId: '',
materialName: '',
planAmount: '',
quantityAcquired: 0,
},
dialogVisible: false,
addDialogVisible: false,
tableData: [],
tableData1: [],
}
1 year ago
},
mounted() {
getProductPlans().then(e => {
this.tableData = e.data
getProductPlanDetails({planId: e.data?.[0]?.planId}).then(res => {
this.tableData1 = res.data
})
})
this.$refs.chart2.setData({
1 year ago
tooltip: {
trigger: 'axis',
1 year ago
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
1 year ago
},
grid: {
left: '0',
right: '4%',
bottom: '0',
1 year ago
top: 20,
containLabel: true
1 year ago
},
xAxis: {
type: 'category',
1 year ago
data: [1, 2, 3, 4, 5, 6],
axisLine: {
lineStyle: {
color: 'white'
}
1 year ago
},
axisLabel: {
// interval: 0,
// rotate: 40,
textStyle: {
fontFamily: 'Microsoft YaHei'
}
}
},
yAxis: {
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: 'white'
}
},
splitLine: {
show: false
},
axisLabel: {}
},
series: [
{
name: '数量',
label: {
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 0.75 * vw
}
}
1 year ago
},
type: 'bar',
barWidth: '30%',
barMaxWidth: 50,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#39ffff'
},
{
offset: 1,
color: '#5affa6'
}
])
}
},
data: [1, 2, 3, 4, 5, 6]
}
]
})
this.$refs.chart4.setData({
tooltip: {
trigger: 'axis',
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
left: '0',
right: '4%',
bottom: '0',
top: 20,
containLabel: true
},
xAxis: {
type: 'category',
data: [1, 2, 3, 4, 5, 6],
axisLine: {
lineStyle: {
color: 'white'
}
1 year ago
},
axisLabel: {
// interval: 0,
// rotate: 40,
textStyle: {
fontFamily: 'Microsoft YaHei'
}
}
1 year ago
},
yAxis: {
type: 'value',
1 year ago
axisLine: {
show: false,
lineStyle: {
color: 'white'
}
1 year ago
},
splitLine: {
show: false
1 year ago
},
axisLabel: {}
1 year ago
},
series: [
{
name: '数量',
label: {
normal: {
show: true,
position: 'top',
1 year ago
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 0.75 * vw
}
}
1 year ago
},
type: 'bar',
barWidth: '30%',
1 year ago
barMaxWidth: 50,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#39ffff'
1 year ago
},
{
offset: 1,
color: '#5affa6'
}
])
}
1 year ago
},
data: [1, 2, 3, 4, 5, 6]
}
]
1 year ago
})
},
methods: {
planExecute(e) {
console.log(e)
if (e.planDetailStatus === '1') {
this.$confirm('是否开始计划', '确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success'
}).then(() => {
startProductPlanDetail({
planDetailId: e.planDetailId
})
.finally(() => {
this.getDetail({row: {planId: e.planId}})
getProductPlans().then(e => {
this.tableData = e.data
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
})
}
if (e.planDetailStatus === '2') {
this.$confirm('是否完成计划', '确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success'
}).then(() => {
completeProductPlanDetail({
planDetailId: e.planDetailId
})
.finally(() => {
this.getDetail({row: {planId: e.planId}})
getProductPlans().then(e => {
this.tableData = e.data
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
})
}
},
getDetail(e) {
getProductPlanDetails({planId: e.row.planId}).then(res => {
if (res.data.length === 0) {
this.$confirm('是否生成计划明细', '确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success'
}).then(() => {
insertProductPlanDetails({
"planId": e.row.planId,
}).then(val => {
this.tableData1 = val.data
this.$message({
type: 'info',
message: `生成完成`
});
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
})
} else {
this.tableData1 = res.data
}
})
},
getMaterials(val) {
this.searchMaterialValue = ''
this.dialogVisible = true
this.form = {
warehouseId: '',
planCode: val.row.planNumber,
productId: '' || 2,
planDetailCode: '' || 1,
applyReason: '',
taskType: '1',
wmsRawOutstockDetailList: []
}
getWarehouses({
warehouseFloor: 1
}).then(e => {
this.warehouseList = e.data
this.form.warehouseId = e.data[0]?.warehouseId
})
getMaterialBoms({
ancestors: 1,
}).then(e => {
this.form.wmsRawOutstockDetailList = e.data.map(r => {
return {
materialId: r.materialId,
materialName: r.materialName,
planAmount: 0,
}
})
})
},
addMaterialRequisition() {
this.addDialogVisible = false
this.form.wmsRawOutstockDetailList.push(this.form2)
},
receiveMaterial() {
applyRawOutstock(this.form).then(e => {
console.log(e)
if (e.code === 200) {
this.dialogVisible = false
this.$message({
message: '领料完成',
type: 'success'
});
}
})
},
searchMaterial(val) {
getMaterialBoms({
ancestors: 1,
materialName: val
}).then(e => {
this.form.wmsRawOutstockDetailList = e.data.map(r => {
return {
materialId: r.materialId,
materialName: r.materialName,
planAmount: 0,
}
})
})
}
}
}
1 year ago
</script>
<style lang="less" scoped>
.app-container {
background-image: url("../../../assets/board/bg.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.headTitle {
position: absolute;
top: 5%;
left: 50%;
transform: translate(-50%, -100%);
font-size: 1.5vw;
color: #d6eaed;
letter-spacing: 10px;
}
.el-table {
background-color: #fff0;
//overflow: auto;
}
.whiteTable {
/deep/ .el-table .el-table__header-wrapper th {
background-color: #fff0;
}
/deep/ .el-table tr {
background-color: #fff0;
}
/deep/ .el-table .cell {
color: #fff
}
/deep/ .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #fff0;
}
}
.chartBox {
background-image: url("../../../assets/board/box.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
width: 46%;
height: 23.34vw;
.title {
position: absolute;
top: 8%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 1.2vw;
color: #ccc;
}
.chart {
position: absolute;
top: 16%;
left: 1%;
width: 98%;
height: 82%;
}
}
1 year ago
.chartBox1 {
top: 10%;
left: 2%;
}
.chartBox2 {
top: 10%;
right: 2%;
}
.chartBox3 {
top: 53%;
left: 2%;
}
.chartBox4 {
top: 53%;
right: 2%;
}
.bottom {
1 year ago
position: absolute;
bottom: 1.5%;
left: 2%;
1 year ago
}
</style>