多层订单功能大调整

master
zhaoxiaolin 7 months ago
parent d7061c5c3d
commit c097f54fd3

@ -195,7 +195,7 @@ export function getBatchList(workorderCode) {
});
}
// 查询报工详细列表
// 查询报工详细列表废弃改为--->2.0查询各级报工详细列表
export function getReportList(query) {
return request({
url: '/mes/reportWork/getReportList',
@ -204,6 +204,15 @@ export function getReportList(query) {
});
}
// 2.0查询各级报工详细列表
export function getAllLevelReportList(query) {
return request({
url: '/mes/reportWork/getAllLevelReportList',
method: 'get',
params: query
});
}
// 查询报工详细列表
export function getCKList(data) {
return request({

@ -33,7 +33,7 @@ export function getWorkBatchList(data){
})
}
// 通过子工单查询订单信息和工单信息
// 通工单查询订单信息和工单信息
export function getOrderAndWork(data) {
return request({
url: '/plan/pro/workorder/getOrderAndWorkInfo',
@ -51,6 +51,23 @@ export function listWorkorder(query) {
});
}
// 查询生产工单列表--顶级母
export function listWorkorderLevel0(query) {
return request({
url: '/plan/pro/workorder/listLevel0',
method: 'get',
params: query
});
}
// 查询生产工单列表--下一级
export function getNextLevelWorkOrderList(parentOrder) {
return request({
url: '/plan/pro/workorder/getNextLevelWorkOrderList/' + parentOrder,
method: 'get'
});
}
// 查询生产工单详细
export function getWorkorder(workorderId) {
return request({

@ -94,6 +94,7 @@
v-hasPermi="['mes:reportWork:remove']"
>删除</el-button>
</el-col>
-->
<el-col :span="1.5">
<el-button
type="success"
@ -103,8 +104,8 @@
:disabled="single"
@click="handleReportHz"
v-hasPermi="['mes:reportWork:report']"
>报工详情</el-button>
</el-col>-->
>报工信息维护</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
@ -459,11 +460,16 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 报工详情 -->
<!-- 报工信息详情 -->
<el-dialog :title="titleReport" :visible.sync="openReport" width="1200px">
<el-tabs v-model="activeName" >
<el-tab-pane label="母工单报工信息" name="pOrder">
<el-table v-loading="loading" :data="pOrderTableList" ref="myPOrderTable" @selection-change="pReportSelection"
<el-tabs v-model="activeNameR">
<el-tab-pane
v-for="(item, index) in libTabs"
:key="index"
:label="item.title"
:name="item.libId"
>
<el-table v-loading="loading" :data="item.libList" ref="myPOrderTable" @selection-change="pReportSelection"
:summary-method="getSummaries"
show-summary
>
@ -491,35 +497,6 @@
<el-table-column label="创建时间" align="center" prop="createTime" width="150"/>
</el-table>
</el-tab-pane>
<el-tab-pane label="子工单报工信息" name="sOrder">
<el-table v-loading="loading" :data="sOrderTableList" ref="mySOrderTable" @selection-change="sReportSelection"
:summary-method="getSummaries"
show-summary
>
<el-table-column width="50" align="center" type="selection"/>
<el-table-column label="id" align="center" prop="id" v-if="false"/>
<el-table-column label="工单编码" width="150" align="left" prop="workorderCode" :show-overflow-tooltip="true" />
<el-table-column label="报工单号" width="150" align="left" prop="reportCode" :show-overflow-tooltip="true" />
<el-table-column label="批次" width="250" align="left" prop="batch" :show-overflow-tooltip="true" />
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="报工数量" width="100" align="left" prop="quantityFeedback" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.quantityFeedback" @change="handleEdit(scope.$index,scope.row)"></el-input>
</template>
</el-table-column>
<el-table-column label="工时数" align="center" prop="workTime">
<template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.workTime" @change="handleEdit(scope.$index,scope.row)"></el-input>
</template>
</el-table-column>
<el-table-column label="用人数" align="center" prop="useMan">
<template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.useMan" @change="handleEdit(scope.$index,scope.row)"></el-input>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="150"/>
</el-table>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType =='view'"></el-button>
@ -753,7 +730,8 @@
<script>
import { listReportWork, getReportWork, delReportWork, addReportWork, getWorkcenterList,
updateReportWork,reportSap,getBatchList,reportSapCancel,
getReportList,getReportSAPList,submitReportPS,submitReportPSSAP,getCKList,
getAllLevelReportList,
getReportSAPList,submitReportPS,submitReportPSSAP,getCKList,
getPutInOrderList
} from "@/api/mes/reportWork";
import { getConsumeList,submitConsumePS,submitReportInfo,getBomList} from "@/api/mes/reportWorkConsume";
@ -786,6 +764,7 @@ export default {
consumeTotal:0,
//
reportWorkList: [],
libTabs:[],
pOrderTableList: [],
sOrderTableList: [],
pConsumeTableList: [],
@ -794,6 +773,7 @@ export default {
sBomTableList: [],
activeName0: 'first',
activeName: 'pOrder',
activeNameR: 'order1',
activeName2: 'pConsume',
selectedWarehouse:'0004',
warehouseList: [],
@ -1069,6 +1049,7 @@ export default {
endReport:'0'
};
this.resetForm("form");
this.libTabs = [];
this.pOrderTableList = [];
this.sOrderTableList = [];
this.pReportRows = [];
@ -1244,6 +1225,9 @@ export default {
this.reset();
let sr = row;
if(sr.workorderCode==undefined){
sr = this.selectRow[0]
}
if(sr.uploadStatus =='1'){
this.optType = 'view'
@ -1252,21 +1236,13 @@ export default {
}
this.queryParams.workorderCode = sr.workorderCode;
//
this.queryParams.parentOrder = '0';
getReportList(this.queryParams).then(response => {
this.pOrderTableList = response;
this.openReport = true;
this.titleReport = "工单报工详情";
});
//
this.queryParams.parentOrder = sr.workorderCode;
getReportList(this.queryParams).then(response => {
this.sOrderTableList = response;
//
getAllLevelReportList(this.queryParams).then(response => {
this.queryParams.workorderCode = '';
this.openReport = true;
this.titleReport = "工单报工详情";
this.queryParams.workorderCode = '';
this.libTabs= response;
});
},
handleEdit(index, row) {
@ -1274,14 +1250,12 @@ export default {
},
//
pReportSelection(selection) {
this.pReportRows = selection
},
sReportSelection(selection) {
this.sReportRows = selection
this.pReportRows = this.pReportRows.concat(selection)
},
submitReport() {
this.reportRows = this.pReportRows.concat(this.sReportRows)
this.reportRows = this.pReportRows;
debugger
/**
if ( this.reportRows==0) {
this.$modal.msgError(`请选择数据`);
return false;
@ -1291,6 +1265,7 @@ export default {
this.openReport = false;
this.getList();
});
**/
},
submitReportSAP() {
this.reportRows = this.pReportRows.concat(this.sReportRows)

@ -113,7 +113,8 @@
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
@selection-change="handleAutoSplitSelection"
>
<el-table-column type="selection" width="30"></el-table-column>
<el-table-column type="selection" width="30" :selectable="selectable">
</el-table-column>
<el-table-column width="150" label="订单号" align="center" prop="orderCode"
:formatter="orderCodeFormate"
/>
@ -685,7 +686,9 @@ export default {
methods: {
//
productCodeFormate(row, column, cellValue){
return cellValue.slice(7,18); //
if(cellValue !=null){
return cellValue.slice(7,18); //
}
},
//
orderCodeFormate(row, column, cellValue){
@ -1387,6 +1390,14 @@ export default {
this.openAutoSplit = true;
this.autoSplitLoading = false;
},
//
selectable(row, index) {
if (row.parentOrder == 0) {
return true;
} else {
return false;
}
}
}
}

@ -176,31 +176,24 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="workorderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center">
</el-table-column>
<el-table v-loading="loading" :data="workorderList" @selection-change="handleSelectionChange"
row-key="workorderCode"
lazy
:load="treeLoad"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column type="selection" align="center" :selectable="selectable"></el-table-column>
<el-table-column label="工单ID" align="center" prop="workorderId" v-if="false"/>
<el-table-column width="130" label="母订单新编码" align="center" prop="pworkorderCodeSap"
:formatter="orderCodeFormate"
/>
<el-table-column width="130" label="母产品编码" align="center" prop="pproductCode" :formatter="productCodeFormate"/>
<el-table-column width="300" label="母产品名称" align="center" prop="pproductName" :show-overflow-tooltip="true"/>
<el-table-column width="130" label="子工单编号" align="center" prop="workorderCode"/>
<el-table-column label="订单id" align="center" prop="orderId" v-if="false"/>
<el-table-column width="130" label="子订单旧编码" align="center" prop="orderCode"
:formatter="orderCodeFormate"
/>
<el-table-column width="130" label="子订单新编码" align="center" prop="workorderCodeSap"
:formatter="orderCodeFormate"
/>
<el-table-column label="产品ID" align="center" prop="productId" v-if="false"/>
<el-table-column width="130" label="子产品编码" align="center" prop="productCode"
:formatter="productCodeFormate"
/>
<el-table-column width="300" label="子产品名称" align="center" prop="productName" :show-overflow-tooltip="true"/>
<el-table-column label="父级工单" align="center" prop="parentOrder" v-if="false"/>
<el-table-column width="180" label="工单编号" align="center" prop="workorderCode"/>
<el-table-column width="130" label="订单新编码" align="center" prop="workorderCodeSap" :formatter="orderCodeFormate"/>
<el-table-column width="130" label="订单旧编码" align="center" prop="orderCode" :formatter="orderCodeFormate"/>
<el-table-column width="130" label="产品编码" align="center" prop="productCode" :formatter="productCodeFormate"/>
<el-table-column width="300" label="产品名称" align="center" prop="productName" :show-overflow-tooltip="true"/>
<el-table-column label="规格型号" align="center" prop="productSpc" v-if="false"/>
<el-table-column width="50" label="单位" align="center" prop="unit"/>
<!--
<el-table-column label="子单批次信息" width="300" align="center" prop="batchInfo">
<template slot-scope="scope">
@ -208,8 +201,9 @@
</template>
</el-table-column>-->
<el-table-column width="120" label="派工数量" align="center" prop="quantitySplit"/>
<el-table-column width="50" label="单位" align="center" prop="unit"/>
<el-table-column width="150" label="工艺编码" align="center" prop="routeCode"/>
<el-table-column width="200" label="工艺名称" align="center" prop="routeName" />
<el-table-column width="200" label="工艺名称" align="center" prop="routeName" :show-overflow-tooltip="true"/>
<!-- show-overflow-tooltip -->
<el-table-column width="300" label="产线设备" align="center" >
<template slot-scope="scope">
@ -636,7 +630,7 @@
<script>
import {
getWorkOrders,
listWorkorder,
listWorkorder,listWorkorderLevel0,getNextLevelWorkOrderList,
delWorkorder,
downWorkorder,
getOrderAndWork,getProSortNo,
@ -739,6 +733,7 @@ export default {
workorderList: [],
//
title: "",
titleM:"",
//
open: false,
openM:false,
@ -826,7 +821,9 @@ export default {
methods: {
//
productCodeFormate(row, column, cellValue){
return cellValue.slice(7,18); //
if(cellValue !=null){
return cellValue.slice(7,18); //
}
},
//
orderCodeFormate(row, column, cellValue){
@ -877,13 +874,12 @@ export default {
// -
handleUpdateDown(row) {
var statusesArray = this.statuses;
/**
for (var i = 0; i < statusesArray.length; i++) {
if (statusesArray[i] == 'w1') {//
if (statusesArray[i] != 'w0') {//
this.$modal.msgError("已经下达的订单不允许操作");
return
}
}**/
}
this.loading = true;
let _this = this;
const workorderIds = row.workorderCode || this.codes;
@ -964,6 +960,7 @@ export default {
//
this.proLoading = true // true
this.workerLoading = true // true
getOrderAndWork(this.selectWork).then(response => {
this.splitData.push(response.data.workOrder)
this.productData.push(response.data.order)
@ -1395,13 +1392,13 @@ export default {
// -
getList() {
this.loading = true;
this.queryParams.endFlag = '1';//
this.queryParams.parentOrder = '0';//
if (this.queryParams.productDateArray != null) {
this.queryParams.productDateStart = moment(this.queryParams.productDateArray[0]).format('YYYY-MM-DD');
this.queryParams.productDateEnd = moment(this.queryParams.productDateArray[1]).format('YYYY-MM-DD');
}
listWorkorder(this.queryParams).then(response => {
//
listWorkorderLevel0(this.queryParams).then(response => {
this.workorderList = response.rows;
this.total = response.total;
this.loading = false;
@ -1461,18 +1458,10 @@ export default {
getOrderAndWork(this.selectWork).then(response => {
this.splitData.push(response.data.workOrder)
this.productData.push(response.data.order)
//
this.splitForm.prodType = this.splitData[0].prodType
if(this.productData[0].prodType == 'white') {
this.checkType = true
this.splitForm.materialName = this.splitData[0].materialName
this.splitForm.materialCode = this.splitData[0].materialCode
}else {
this.checkType = false
}
this.checkType = false
this.refreshProTable = false // refreshProTablefalse
this.refreshWorkerTable = false // refreshProTablefalse
this.$nextTick(() => {
@ -1503,22 +1492,6 @@ export default {
}else{
this.splitForm.productDate = new Date();
}
//
if (this.productData[0].prodType == 'white'){
//
function setAtrr1(order, work) {
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
order.atrr1 = work.quantitySplit;
if (order.children !== undefined && work.children !== undefined) {
setAtrr1(order.children[0], work);
}
}
setAtrr1(this.productData[0], this.splitData[0]);
}
//
if (this.productData[0],prototype != 'white'){
@ -1528,6 +1501,7 @@ export default {
//
function setAtrr1(order, work) {
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
order.atrr1 = work.quantitySplit;
@ -1535,9 +1509,7 @@ export default {
setAtrr1(order.children[0], work.children[0]);
}
}
setAtrr1(this.productData[0], this.splitData[0]);
}
})
@ -1734,7 +1706,33 @@ export default {
this.splitForm.materialName = this.materielBP[0].productDescZh;
this.innerBPVisible = false;
}
},
//
selectable(row, index) {
if (row.parentOrder == 0) {
return true;
} else {
return false;
}
},
//
treeLoad(tree, treeNode, resolve) {
setTimeout(() => {
getNextLevelWorkOrderList(tree.workorderCode).then((data) => {
return resolve(data);
});
}, 222);
},
// @expand-change="getOpenNextLevel"
//
//getOpenNextLevel(row, column, event) {
// alert("1755getOpenNextLevel")
// getNextLevelWorkOrderList(tree.workorderCode).then((data) => {
// return resolve(data);
// });
//}
}
};
</script>

Loading…
Cancel
Save