修改生产界面

master
夜笙歌 8 months ago
parent 6f6f1ba38f
commit aeb62e758a

@ -14,7 +14,7 @@ export function getProductPlans(query) {
// 开始/继续
export function startNextProductPlanDetail(query) {
return request({
url: '/mes/api/startNextProductPlanDetail',
url: '/mes/api/startNextProductPlanDetailAttach',
method: 'post',
data: query
})
@ -23,7 +23,7 @@ export function startNextProductPlanDetail(query) {
// 获取信息
export function getNewestProductPlanDetail(query) {
return request({
url: '/mes/api/getNewestProductPlanDetail/',
url: '/mes/api/getNewestProductPlanDetailJoinAttach',
method: 'get',
params: query
})
@ -32,7 +32,7 @@ export function getNewestProductPlanDetail(query) {
// 完成
export function completeProductPlanDetail(query) {
return request({
url: '/mes/api/completeProductPlanDetail',
url: '/mes/api/completeProductPlanDetailAttach',
method: 'post',
data: query
})

@ -19,6 +19,9 @@
<el-form-item label="物料名称">
<el-input v-model="form.materialName"></el-input>
</el-form-item>
<el-form-item label="图纸名称">
<el-input v-model="form.attachName"></el-input>
</el-form-item>
<el-form-item label="状态">
<el-input v-model="form.planDetailStatus"></el-input>
</el-form-item>
@ -30,7 +33,6 @@
<!-- </el-form-item>-->
</el-form>
<div style="text-align: center">
<el-button type="success">图纸下发</el-button>
<el-button type="primary" @click="accomplishPlan"></el-button>
</div>
</div>
@ -68,6 +70,8 @@
:header-cell-style="{textAlign:'center'}"
:max-height="19.13 *vw"
highlight-current-row
row-key="planId"
:expand-row-keys="drawingList"
lazy
style="width: 100%"
@current-change="getOrderInfo"
@ -75,10 +79,25 @@
>
<el-table-column type="expand">
<template slot-scope="props">
<div v-for="i in drawingList">
<div v-for="i in props.row.drawing">
<div style="display: inline-block;width: 50%;text-align: center;color:#000">{{ i.attachName }}</div>
<div style="display: inline-block;width: 50%;text-align: center">
<el-button type="text">开始</el-button>
<!-- v-if="i.completeAmount === 0"-->
<el-popconfirm
cancel-button-text='否'
confirm-button-text='是'
icon="el-icon-info"
icon-color="red"
title="确定开始计划吗?"
@confirm="startNextProduction(props.row,i)"
>
<el-button
:disabled="i.dispatchFlag"
slot="reference"
size="small"
type="text">开始
</el-button>
</el-popconfirm>
</div>
</div>
</template>
@ -101,24 +120,27 @@
>
</el-table-column>
<el-table-column
label="计划"
label="计划图纸"
prop="planAmount"
width="80"
>
<template slot-scope="scope">
{{ (scope.row.attachId || '').split(',').length }}
</template>
</el-table-column>
<el-table-column
label="实际"
label="实际图纸"
prop="completeAmount"
width="80"
>
</el-table-column>
<el-table-column
label="差异"
label="差异图纸"
prop="difference"
width="80"
>
<template slot-scope="scope">
{{ scope.row.planAmount - scope.row.completeAmount }}
{{ (scope.row.attachId || '').split(',').length - scope.row.completeAmount }}
</template>
</el-table-column>
<el-table-column
@ -132,38 +154,6 @@
width="120"
>
<template slot-scope="scope">
<el-popconfirm
v-if="scope.row.completeAmount === 0"
cancel-button-text='否'
confirm-button-text='是'
icon="el-icon-info"
icon-color="red"
title="确定开始计划吗?"
@confirm="startNextProduction(scope.row)"
>
<el-button
slot="reference"
size="small"
type="text">开始
</el-button>
</el-popconfirm>
<el-popconfirm
v-if="scope.row.completeAmount !== 0 && scope.row.completeAmount < scope.row.planAmount"
cancel-button-text='否'
confirm-button-text='是'
icon="el-icon-info"
icon-color="red"
title="确定继续计划吗?"
@confirm="startNextProduction(scope.row)"
>
<el-button
slot="reference"
size="small"
type="text">继续
</el-button>
</el-popconfirm>
<el-button
size="small"
style="margin-left: 4px"
@ -177,7 +167,6 @@
</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>
@ -228,7 +217,8 @@ import {
getNewestProductPlanDetail,
getProductPlans,
startNextProductPlanDetail,
getPlanDrawings
getPlanDrawings,
completeProductPlanDetailAttach
} from "@/api/board/laserLight";
const setState = (e) => {
@ -273,9 +263,9 @@ export default {
this.$refs.table1.setCurrentRow(e.rows[0]);
this.getInfo(e.rows[0])
getNewestProductPlanDetail({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
this.form = val.data || {}
this.form.materialId = e.rows[0]?.materialId
this.form.materialName = e.rows[0]?.materialName
this.form.planDetailStatus = setState(val.data.planDetailStatus)
})
})
@ -467,23 +457,15 @@ export default {
})
},
async expandChange(e, rows) {
console.log('rows',rows)
if (rows.length === 0) return
if (rows.length > 1) {
this.$refs.table1.toggleRowExpansion(rows[0], false)
}
this.drawingList = [e.planId]
const data = await getPlanDrawings({planId: e.planId, attachId: e.attachId})
console.log(data)
this.tableData = this.tableData.map(v=>{
if(v.planId === e.planId){
this.$set(this.tableData,this.tableData.indexOf(e),{...e,drawing:data?.data.map((v,i)=>{
return {
...v,
children:data?.data || []
}
}else{
return v
planId: e.planId + '-' + i
}
})
}) || []})
},
//
getInfo(e) {
@ -509,7 +491,7 @@ export default {
center: ["50%", "50%"],
data: [
{
value: e.planAmount === 0 ? 0.0001 : e.planAmount,
value: (e.attachId || '').split(',').length === 0 ? 0.0001 : (e.attachId || '').split(',').length,
label: {
normal: {
rich: {
@ -667,7 +649,7 @@ export default {
center: ["50%", "50%"],
data: [
{
value: (e.planAmount - e.completeAmount) === 0 ? 0.0001 : (e.planAmount - e.completeAmount),
value: Math.abs(((e.attachId || '').split(',').length - e.completeAmount) === 0 ? 0.0001 : ((e.attachId || '').split(',').length - e.completeAmount)),
label: {
normal: {
rich: {
@ -746,7 +728,7 @@ export default {
center: ["50%", "50%"],
data: [
{
value: ((e.completeAmount / e.planAmount) * 100).toFixed(2),
value: ((e.completeAmount / (e.attachId || '').split(',').length) * 100).toFixed(2),
label: {
normal: {
rich: {
@ -788,7 +770,7 @@ export default {
},
},
{
value: ((1 - (e.completeAmount / e.planAmount)) * 100).toFixed(2),
value: ((1 - (e.completeAmount / (e.attachId || '').split(',').length)) * 100).toFixed(2),
name: "invisible",
itemStyle: {
normal: {
@ -805,12 +787,19 @@ export default {
})
},
//
async startNextProduction(e) {
const data = await startNextProductPlanDetail({planId: e.planId})
async startNextProduction(val,e) {
const data = await startNextProductPlanDetail({planId: val.planId,attachId:e.attachId})
this.form = data.data
this.form.materialId = e.materialId
this.form.materialName = e.materialName
this.form.materialId = val.materialId
this.form.materialName = val.materialName
this.form.planDetailStatus = setState(data.data.planDetailStatus)
const data1 = await getPlanDrawings({planId: val.planId, attachId: val.attachId})
this.$set(this.tableData,this.tableData.indexOf(val),{...val,drawing:data1?.data.map((v,i)=>{
return {
...v,
planId: val.planId + '-' + i
}
}) || []})
},
//
accomplishPlan() {
@ -820,7 +809,8 @@ export default {
type: 'success'
}).then(() => {
completeProductPlanDetail({
planDetailId: this.form.planDetailId
planDetailId: this.form.planDetailId,
attachId: this.form.attachId
})
.then(() => {
this.$message({

@ -121,6 +121,11 @@ export default {
{
floor: 4,
processId: 43,
route: '/board/assemble'
},
{
floor: 4,
processId: 44,
route: '/board/weld'
},
{

Loading…
Cancel
Save