修改生产界面

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

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

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

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

Loading…
Cancel
Save