修改生产界面

master
夜笙歌 7 months ago
parent 5b476e668b
commit d78f6490db

@ -1,13 +1,6 @@
import request from '@/utils/request'
// 获取计划
export function getProductPlans(query) {
return request({
url: '/mes/api/getProductPlans',
method: 'get',
params: query
})
}
// 开始/继续
export function startNextProductPlanDetail(query) {

@ -1,10 +1,155 @@
import request from '@/utils/request'
// 查询设备BOM信息列表
export function listBom(query) {
/**
* 通用
* */
// 获取生产派工计划
export function getProductPlans(query) {
return request({
url: '/mes/api/getProductPlans',
method: 'get',
params: query
})
}
// 完成生产计划明细
export function completeProductPlanDetail(query) {
return request({
url: '/mes/api/completeProductPlanDetail',
method: 'post',
data: query
})
}
export function getStockTotal(query) {
return request({
url: '/wms/api/getStockTotal',
method: 'get',
params: query
})
}
/**
* 14楼装配
* */
// 获取生产计划明细
export function getProductPlanDetails(query) {
return request({
url: '/mes/api/getProductPlanDetails',
method: 'get',
params: query
})
}
// 获取仓库列表
export function getWarehouses(query) {
return request({
url: '/wms/api/getWarehouses',
method: 'get',
params: query
})
}
// 申请领料
export function applyRawOutstock(query) {
return request({
url: '/wms/api/applyRawOutstock',
method: 'post',
data: query
})
}
// 生成生产计划明细
export function insertProductPlanDetails(query) {
return request({
url: '/mes/api/insertProductPlanDetails',
method: 'post',
data: query
})
}
// 开始生产计划明细
export function startProductPlanDetail(query) {
return request({
url: '/mes/api/startProductPlanDetail',
method: 'post',
data: query
})
}
/**
* 4楼折弯5
* */
// 获取最新的生产计划明细
export function getNewestProductPlanDetail(query) {
return request({
url: '/mes/api/getNewestProductPlanDetail/',
method: 'get',
params: query
})
}
// 开始/继续生产派工计划
export function startNextProductPlanDetail(query) {
return request({
url: '/mes/api/startNextProductPlanDetail',
method: 'post',
data: query
})
}
/**
* 4楼激光
* */
// 获取最新的生产计划明细
export function getNewestProductPlanDetailJoinAttach(query) {
return request({
url: '/mes/api/getNewestProductPlanDetailJoinAttach',
method: 'get',
params: query
})
}
// 开始/继续下一生产计划明细
export function startNextProductPlanDetailAttach(query) {
return request({
url: '/dms/bom/list',
url: '/mes/api/startNextProductPlanDetailAttach',
method: 'post',
data: query
})
}
// 获取生产派工图纸列表
export function getPlanDrawings(query) {
return request({
url: '/mes/api/getProductPlanDrawings',
method: 'get',
params: query
})
}
//激光切割工位板材入库
export function addRawInstock(data) {
return request({
url: '/wms/api/addRawInstock',
method: 'post',
data: data
})
}
//激光切割工位板材出库
export function directRawOutstock(data) {
return request({
url: '/wms/api/directRawOutstock',
method: 'post',
data: data
})
}

@ -276,7 +276,7 @@ import {
applyRawOutstock,
getStockTotal,
getWarehouses
} from "@/api/board/fifthFloor";
} from "@/api/board";
const setState = (e) => {
if (e === '1') {

@ -467,7 +467,7 @@ import {
getProductPlans,
insertProductPlanDetails,
getProductPlanDetails, startProductPlanDetail, completeProductPlanDetail
} from '@/api/board/firstFloor'
} from '@/api/board'
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {

@ -214,13 +214,13 @@ import Chart from '@/components/board/Chart'
import * as echarts from 'echarts'
import {
completeProductPlanDetail,
getNewestProductPlanDetail,
getNewestProductPlanDetailJoinAttach,
getProductPlans,
startNextProductPlanDetail,
startNextProductPlanDetailAttach,
getPlanDrawings,
addRawInstock,
directRawOutstock,
} from "@/api/board/laserLight";
} from "@/api/board";
const setState = (e) => {
if (e === '1') {
@ -279,7 +279,7 @@ export default {
this.totalNum1 = Math.ceil(e.total / 5)
this.$refs.table1.setCurrentRow(e.rows[0]);
this.getInfo(e.rows[0])
getNewestProductPlanDetail({planId: e.rows[0].planId}).then(val => {
getNewestProductPlanDetailJoinAttach({planId: e.rows[0].planId}).then(val => {
this.form = val.data || {}
this.form.materialId = e.rows[0]?.materialId
this.form.materialName = e.rows[0]?.materialName
@ -466,7 +466,7 @@ export default {
},
getOrderInfo(e) {
this.getInfo(e)
getNewestProductPlanDetail({planId: e.planId}).then(val => {
getNewestProductPlanDetailJoinAttach({planId: e.planId}).then(val => {
this.form = val.data
this.form.materialId = e.materialId
this.form.materialName = e.materialName
@ -810,11 +810,11 @@ export default {
const dataIndex = this.tableData.indexOf(val)
const lineIndex = this.tableData[dataIndex].drawing.indexOf(e)
this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag',false)
await startNextProductPlanDetail({planId: val.planId, attachId: e.attachId})
await startNextProductPlanDetailAttach({planId: val.planId, attachId: e.attachId})
.catch(() => {
this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag',true)
})
getNewestProductPlanDetail({planId: val.planId}).then(val => {
getNewestProductPlanDetailJoinAttach({planId: val.planId}).then(val => {
this.form = val.data
this.form.materialId = e.materialId
this.form.materialName = e.materialName

@ -6,25 +6,25 @@
<div class="title">工单信息</div>
<div class="chart">
<div class="form1">
<el-form label-position="right" label-width="80px" :model="form1">
<el-form :model="form" label-position="right" label-width="80px">
<el-form-item label="工单编号">
<el-input v-model="form1.name"></el-input>
<el-input v-model="form.planCode"></el-input>
</el-form-item>
<el-form-item label="物料编号">
<el-input v-model="form1.region"></el-input>
<el-form-item label="明细编号">
<el-input v-model="form.planDetailCode"></el-input>
</el-form-item>
<el-form-item label="物料名称">
<el-input v-model="form1.type"></el-input>
<el-form-item label="成品名称">
<el-input v-model="form.materialId"></el-input>
</el-form-item>
<el-form-item label="扫码时间">
<el-input v-model="form1.type"></el-input>
<el-form-item label="成品编号">
<el-input v-model="form.materialName"></el-input>
</el-form-item>
<el-form-item label="产品型号">
<el-input v-model="form1.type"></el-input>
<el-form-item label="状态">
<el-input v-model="form.planDetailStatus"></el-input>
</el-form-item>
</el-form>
<div style="text-align: center">
<el-button type="primary">图纸下发</el-button>
<el-button type="primary" @click="finish()"></el-button>
</div>
</div>
@ -55,12 +55,13 @@
<div class="chart">
<div class="whiteTable">
<el-table
:data="tableData"
style="width: 100%"
max-height="19.13vw"
:cell-style="{textAlign:'center'}"
:data="tableData"
:header-cell-style="{textAlign:'center'}"
:max-height="19.13 * vw"
highlight-current-row
style="width: 100%"
@current-change="tableClick"
>
<el-table-column
label="序号"
@ -69,32 +70,41 @@
>
</el-table-column>
<el-table-column
prop="workOrderNumber"
label="工单编号"
prop="planCode"
>
</el-table-column>
<el-table-column
label="物料名称"
prop="materialName"
width="100"
>
</el-table-column>
<el-table-column
prop="planNum"
label="计划"
width="80"
prop="planAmount"
width="100"
>
</el-table-column>
<el-table-column
prop="realNum"
label="实际"
width="80"
prop="completeAmount"
width="100"
>
</el-table-column>
<el-table-column
prop="quantityNum"
label="差异"
width="80"
prop="difference"
width="100"
>
<template slot-scope="scope">
{{ scope.row.planAmount - scope.row.completeAmount }}
</template>
</el-table-column>
<el-table-column
prop="startTime"
label="开始时间"
width="200"
label="交付时间"
prop="planDeliveryDate"
width="150"
>
</el-table-column>
<el-table-column
@ -102,31 +112,40 @@
width="120"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
>
开始
</el-button>
<el-button
type="text"
size="small"
<!-- <el-button-->
<!-- size="small"-->
<!-- type="text"-->
<!-- >-->
<!-- SOP预览-->
<!-- </el-button>-->
<el-popconfirm
cancel-button-text='否'
confirm-button-text='是'
icon="el-icon-info"
icon-color="red"
title="确定开始计划吗?"
@confirm="startPlan(scope.row)"
>
退库
</el-button>
<el-button
type="text"
size="small"
style="color: #f56c6c"
>
删除
</el-button>
<el-button
slot="reference"
size="small"
type="text">开始
</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<div>
<div class="roundBorder" style="top: 72%;left: 1.2%;">
<el-button :disabled="nowNum1 <= 1" circle icon="el-icon-back" size="mini" @click="pre1"></el-button>
</div>
<div class="roundBorder" style="top: 72%;left: 49%;">
<el-button :disabled="nowNum1 >= totalNum1" circle icon="el-icon-right" size="mini" @click="next1"></el-button>
</div>
</div>
<div class="chartBox chartBox4">
<div class="title">当日产量</div>
@ -149,7 +168,25 @@
<script>
import Chart from '@/components/board/Chart'
import * as echarts from 'echarts'
import {
completeProductPlanDetail,
getNewestProductPlanDetail,
getProductPlanDetails,
getProductPlans,
startNextProductPlanDetail
} from '@/api/board'
const setState = (e) => {
if (e === '1') {
return '未开始'
}
if (e === '2') {
return '已开始'
}
if (e === '3' || e === '9') {
return '已完成'
}
}
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
name: 'Board1',
@ -158,363 +195,14 @@ export default {
},
data() {
return {
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
},
form1: {
name: '',
region: '',
type: ''
},
tableData: [
{
workOrderNumber: '202401221413',
planNum: '1000',
realNum: '800',
quantityNum: '200',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNum: '1000',
realNum: '800',
quantityNum: '200',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNum: '1000',
realNum: '800',
quantityNum: '200',
startTime: '2024-01-01',
},
],
nowNum1: 1,
totalNum1: 0,
form: {},
tableData: [],
vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
}
},
mounted() {
this.$refs.chart1_1.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#aa8e2c",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: 100,
label: {
normal: {
rich: {
a: {
color: "#aa8e2c",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
100 +
"}" +
"\n{b|计划}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#aa8e2c",
shadowColor: "#aa8e2c",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart1_2.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#389af4",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: 100,
label: {
normal: {
rich: {
a: {
color: "#389af4",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
100 +
"}" +
"\n{b|实际}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#389af4",
shadowColor: "#389af4",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart1_3.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#ff0000",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: 100,
label: {
normal: {
rich: {
a: {
color: "#ff0000",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
100 +
"}" +
"\n{b|差异}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#b32b2b",
shadowColor: "#ff0000",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart1_4.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#00ff00",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: 100,
label: {
normal: {
rich: {
a: {
color: "#00ff00",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
100 +
"%}" +
"\n{b|完成率}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#3ac13a",
shadowColor: "#00ff00",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart2.setData({
tooltip: {
trigger: 'axis',
@ -677,8 +365,396 @@ export default {
}
]
})
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
this.tableClick(e.rows[0])
})
},
methods: {}
methods: {
next1() {
this.nowNum1 += 1
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
})
},
pre1() {
this.nowNum1 -= 1
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
})
},
async startPlan(val) {
const data = await startNextProductPlanDetail({planId: val.planId})
if (data.code === 200) {
this.$message({
message: '已开始',
type: 'success'
});
}
this.form = data.data || {}
this.form.materialId = val.materialId
this.form.materialName = val.materialName
this.form.planDetailStatus = setState(data.data.planDetailStatus)
this.getInfo(val)
},
async tableClick(val) {
const {data} = await getNewestProductPlanDetail({planId: val.planId})
this.form = data || {}
this.form.materialId = val.materialId
this.form.materialName = val.materialName
this.form.planDetailStatus = setState(data.planDetailStatus)
this.getInfo(val)
},
getInfo(e) {
this.$refs.chart1_1.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#aa8e2c",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: e.planAmount === 0 ? 0.0001 : e.planAmount,
label: {
normal: {
rich: {
a: {
color: "#aa8e2c",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
(params.data.value === 0.0001 ? 0 : params.data.value) +
"}" +
"\n{b|计划}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#aa8e2c",
shadowColor: "#aa8e2c",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart1_2.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#389af4",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: e.completeAmount === 0 ? 0.0001 : e.completeAmount,
label: {
normal: {
rich: {
a: {
color: "#389af4",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
(params.data.value === 0.0001 ? 0 : params.data.value) +
"}" +
"\n{b|实际}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#389af4",
shadowColor: "#389af4",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart1_3.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#ff0000",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: Math.abs((e.planAmount - e.completeAmount) === 0 ? 0.0001 : (e.planAmount - e.completeAmount)),
label: {
normal: {
rich: {
a: {
color: "#ff0000",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
(params.data.value === 0.0001 ? 0 : params.data.value) +
"}" +
"\n{b|差异}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#b32b2b",
shadowColor: "#ff0000",
shadowBlur: 0,
},
},
},
{
value: 0,
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
this.$refs.chart1_4.setData({
series: [
{
type: "pie",
clockWise: false,
radius: ['60%', '75%'],
itemStyle: {
normal: {
label: {
show: false,
},
labelLine: {
show: false,
},
shadowBlur: 0,
shadowColor: "#00ff00",
},
},
hoverAnimation: false,
center: ["50%", "50%"],
data: [
{
value: ((e.completeAmount / e.planAmount) * 100).toFixed(2),
label: {
normal: {
rich: {
a: {
color: "#00ff00",
align: "center",
fontSize: 1.1 * vw,
fontWeight: "bold",
},
b: {
color: "#fff",
align: "center",
fontSize: 0.9 * vw,
},
},
formatter: function (params) {
return (
"{a|" +
(params.data.value === 0.0001 ? 0 : params.data.value) +
"%}" +
"\n{b|完成率}"
);
},
position: "center",
show: true,
textStyle: {
fontSize: "14",
fontWeight: "normal",
color: "#fff",
},
},
},
itemStyle: {
normal: {
color: "#3ac13a",
shadowColor: "#00ff00",
shadowBlur: 0,
},
},
},
{
value: ((1 - (e.completeAmount / e.planAmount)) * 100).toFixed(2),
name: "invisible",
itemStyle: {
normal: {
color: "#412a4e",
},
emphasis: {
color: "#412a4e",
},
},
},
],
},
],
})
},
async finish() {
this.$confirm('确认计划完成?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const data = await completeProductPlanDetail({
planDetailId: this.form.planDetailId
})
if (data.code === 200) {
this.$message({
message: '已完成',
type: 'success'
});
}
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
this.tableClick(e.rows.find(v => v.planCode === this.form.planCode))
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
}
}
}
</script>
<style lang="less" scoped>
@ -830,4 +906,13 @@ export default {
border-radius: 0;
}
}
.roundBorder {
position: absolute;
transform: translate(-50%, -50%);
}
/deep/ .current-row td .cell {
color: #000 !important;
}
</style>

Loading…
Cancel
Save