修改生产界面

master
夜笙歌 11 months ago
parent 9825b832fd
commit 61de4f1543

@ -1,6 +1,24 @@
import request from '@/utils/request'
// 开始
export function startProductPlanDetail(query) {
return request({
url: '/mes/api/startProductPlanDetail',
method: 'post',
data: query
})
}
// 完成
export function completeProductPlanDetail(query) {
return request({
url: '/mes/api/completeProductPlanDetail',
method: 'post',
data: query
})
}
// 获取计划
export function getProductPlans(query) {
return request({
url: '/mes/api/getProductPlans',
@ -9,6 +27,16 @@ export function getProductPlans(query) {
})
}
// 获取计划详情
export function getProductPlanDetails(query) {
return request({
url: '/mes/api/getProductPlanDetails',
method: 'get',
params: query
})
}
// 创建
export function insertProductPlanDetails(query) {
return request({
url: '/mes/api/insertProductPlanDetails',

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

@ -10,7 +10,7 @@
:cell-style="{textAlign:'center'}"
:data="tableData"
:header-cell-style="{textAlign:'center'}"
max-height="19.13vw"
:max-height="19.13 * vw"
style="width: 100%"
>
<el-table-column
@ -21,7 +21,7 @@
</el-table-column>
<el-table-column
label="工单编号"
prop="dispatchCode"
prop="planCode"
>
</el-table-column>
<el-table-column
@ -71,7 +71,7 @@
<el-button
size="small"
type="text"
@click="getDetail"
@click="getDetail(scope)"
>
明细
</el-button>
@ -97,7 +97,7 @@
:cell-style="{textAlign:'center'}"
:data="tableData1"
:header-cell-style="{textAlign:'center'}"
max-height="19.13vw"
:max-height="19.13 * vw"
style="width: 100%"
>
@ -108,31 +108,51 @@
>
</el-table-column>
<el-table-column
label="计划编号"
prop="planNumber"
label="工单编号"
prop="planCode"
width="80"
>
</el-table-column>
<el-table-column
label="工单编号"
prop="workOrderNumber"
label="明细编号"
prop="planDetailCode"
>
</el-table-column>
<el-table-column
label="开始时间"
prop="startTime"
width="200"
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="120"
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"
@ -153,13 +173,6 @@
>
退料
</el-button>
<el-button
size="small"
style="color: #f56c6c"
type="text"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
@ -276,7 +289,8 @@ import {
getWarehouses,
applyRawOutstock,
getProductPlans,
insertProductPlanDetails
insertProductPlanDetails,
getProductPlanDetails, startProductPlanDetail, completeProductPlanDetail
} from '@/api/board/firstFloor'
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
@ -287,6 +301,7 @@ export default {
},
data() {
return {
vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
searchMaterialValue: '',
warehouseList: [],
form: {
@ -306,60 +321,16 @@ export default {
},
dialogVisible: false,
addDialogVisible: false,
tableData: [
{
workOrderNumber: '202401221413',
plan: '1000',
practical: '800',
difference: '200',
deliveryTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
plan: '1000',
practical: '800',
difference: '200',
deliveryTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
plan: '1000',
practical: '800',
difference: '200',
deliveryTime: '2024-01-01',
}
],
tableData1: [
{
workOrderNumber: '202401221413',
planNumber: '202401221413-1',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNumber: '202401221413-2',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNumber: '202401221413-3',
startTime: '2024-01-01',
},
],
tableData: [],
tableData1: [],
}
},
mounted() {
getProductPlans().then(e => {
console.log(e)
this.tableData = e.data
})
insertProductPlanDetails({
"planId": 1,
"planAmount": 1,
"materialId": 1,
"materialBomId": 1
}).then(e => {
console.log(e)
getProductPlanDetails({planId: e.data?.[0]?.planId}).then(res => {
this.tableData1 = res.data
})
})
this.$refs.chart2.setData({
tooltip: {
@ -525,21 +496,84 @@ export default {
})
},
methods: {
getDetail() {
if(true){
this.$alert('这是一段内容', '标题名称', {
planExecute(e) {
console.log(e)
if (e.planDetailStatus === '1') {
this.$confirm('是否开始计划', '确认', {
confirmButtonText: '确定',
callback: action => {
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: `action: ${ action }`
message: '已取消'
});
}
});
}else{
})
}
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) {
@ -589,7 +623,6 @@ export default {
})
},
searchMaterial(val) {
console.log(val)
getMaterialBoms({
ancestors: 1,
materialName: val
@ -631,6 +664,7 @@ export default {
.el-table {
background-color: #fff0;
//overflow: auto;
}
.whiteTable {

@ -5,26 +5,30 @@
<div class="chartBox chartBox1">
<div class="title">工单信息</div>
<div class="chart">
<div class="form1">
<el-form label-position="right" label-width="80px" :model="form1">
<div class="form">
<el-form :model="form" label-position="right" label-width="80px" size="mini">
<el-form-item label="明细编号">
<el-input v-model="form.planDetailCode" ></el-input>
</el-form-item>
<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-input v-model="form.region"></el-input>
</el-form-item>
<el-form-item label="物料名称">
<el-input v-model="form1.type"></el-input>
<el-input v-model="form.materialName"></el-input>
</el-form-item>
<el-form-item label="扫码时间">
<el-input v-model="form1.type"></el-input>
<el-input v-model="form.materialId"></el-input>
</el-form-item>
<el-form-item label="产品型号">
<el-input v-model="form1.type"></el-input>
<el-input v-model="form.materialId"></el-input>
</el-form-item>
</el-form>
<div style="text-align: center">
<el-button type="primary">图纸下发</el-button>
<el-button type="success">图纸下发</el-button>
<el-button type="primary">继续</el-button>
</div>
</div>
@ -55,11 +59,14 @@
<div class="chart">
<div class="whiteTable">
<el-table
:data="tableData"
style="width: 100%"
max-height="19.13vw"
ref="table1"
:cell-style="{textAlign:'center'}"
:data="tableData"
:header-cell-style="{textAlign:'center'}"
highlight-current-row
max-height="19.13vw"
style="width: 100%"
@current-change="getOrderInfo"
>
<el-table-column
@ -69,31 +76,40 @@
>
</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="计划"
prop="planAmount"
width="80"
>
</el-table-column>
<el-table-column
prop="realNum"
label="实际"
prop="completeAmount"
width="80"
>
</el-table-column>
<el-table-column
prop="quantityNum"
label="差异"
prop="difference"
width="80"
>
<template slot-scope="scope">
{{ scope.row.planAmount - scope.row.completeAmount }}
</template>
</el-table-column>
<el-table-column
prop="startTime"
label="开始时间"
label="交付时间"
prop="planDeliveryDate"
width="200"
>
</el-table-column>
@ -103,23 +119,26 @@
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
type="text"
v-if="scope.row.completeAmoun === 0"
@click="startProduction(scope.row)"
>
开始
</el-button>
<el-button
type="text"
size="small"
type="text"
@click="nextProduction(scope.row)"
v-if="scope.row.completeAmount < scope.row.planAmount"
>
退库
继续
</el-button>
<el-button
type="text"
size="small"
style="color: #f56c6c"
type="text"
>
删除
退库
</el-button>
</template>
</el-table-column>
@ -150,6 +169,7 @@
<script>
import Chart from '@/components/board/Chart'
import * as echarts from 'echarts'
import {getNewestProductPlanDetail, getProductPlans, startNextProductPlanDetail} from "@/api/board/laserLight";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -159,21 +179,7 @@ export default {
},
data() {
return {
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
},
form1: {
name: '',
region: '',
type: ''
},
form: {},
tableData: [
{
workOrderNumber: '202401221413',
@ -200,321 +206,13 @@ export default {
}
},
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",
},
},
},
],
},
],
getProductPlans().then(e => {
this.tableData = e.data
this.$refs.table1.setCurrentRow(e.data[0]);
this.getInfo(e.data[0])
getNewestProductPlanDetail(e.data[0].planId).then(val=>{
this.form = val.data
})
})
this.$refs.chart2.setData({
tooltip: {
@ -679,7 +377,341 @@ export default {
]
})
},
methods: {}
methods: {
getOrderInfo(e){
this.getInfo(e)
getNewestProductPlanDetail(e.planId).then(val=>{
this.form = val.data
})
},
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,
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 +
"}" +
"\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,
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 +
"}" +
"\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: 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 +
"}" +
"\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 +
"%}" +
"\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",
},
},
},
],
},
],
})
},
startProduction(e){
},
async nextProduction(e){
this.getInfo(e)
const data = await startNextProductPlanDetail({planId:e.planId})
this.form = data.data
},
}
}
</script>
<style lang="less" scoped>
@ -722,6 +754,10 @@ export default {
color: #fff
}
/deep/ .current-row .cell {
color: #000
}
/deep/ .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #fff0;
}
@ -811,7 +847,7 @@ export default {
left: 2%;
}
.form1 {
.form {
position: absolute;
width: 50%;
height: 100%;

Loading…
Cancel
Save