多层订单功能大调整

master
zhaoxiaolin 9 months ago
parent d7061c5c3d
commit c097f54fd3

@ -195,7 +195,7 @@ export function getBatchList(workorderCode) {
}); });
} }
// 查询报工详细列表 // 查询报工详细列表废弃改为--->2.0查询各级报工详细列表
export function getReportList(query) { export function getReportList(query) {
return request({ return request({
url: '/mes/reportWork/getReportList', 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) { export function getCKList(data) {
return request({ return request({

@ -33,7 +33,7 @@ export function getWorkBatchList(data){
}) })
} }
// 通过子工单查询订单信息和工单信息 // 通工单查询订单信息和工单信息
export function getOrderAndWork(data) { export function getOrderAndWork(data) {
return request({ return request({
url: '/plan/pro/workorder/getOrderAndWorkInfo', 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) { export function getWorkorder(workorderId) {
return request({ return request({

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

@ -113,7 +113,8 @@
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
@selection-change="handleAutoSplitSelection" @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" <el-table-column width="150" label="订单号" align="center" prop="orderCode"
:formatter="orderCodeFormate" :formatter="orderCodeFormate"
/> />
@ -685,7 +686,9 @@ export default {
methods: { methods: {
// //
productCodeFormate(row, column, cellValue){ productCodeFormate(row, column, cellValue){
if(cellValue !=null){
return cellValue.slice(7,18); // return cellValue.slice(7,18); //
}
}, },
// //
orderCodeFormate(row, column, cellValue){ orderCodeFormate(row, column, cellValue){
@ -1387,6 +1390,14 @@ export default {
this.openAutoSplit = true; this.openAutoSplit = true;
this.autoSplitLoading = false; 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> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="workorderList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="workorderList" @selection-change="handleSelectionChange"
<el-table-column type="selection" align="center"> row-key="workorderCode"
lazy
</el-table-column> :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 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 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 label="产品ID" align="center" prop="productId" v-if="false"/>
<el-table-column width="130" label="子产品编码" align="center" prop="productCode" <el-table-column label="父级工单" align="center" prop="parentOrder" v-if="false"/>
:formatter="productCodeFormate"
/> <el-table-column width="180" label="工单编号" align="center" prop="workorderCode"/>
<el-table-column width="300" label="子产品名称" align="center" prop="productName" :show-overflow-tooltip="true"/> <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 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"> <el-table-column label="子单批次信息" width="300" align="center" prop="batchInfo">
<template slot-scope="scope"> <template slot-scope="scope">
@ -208,8 +201,9 @@
</template> </template>
</el-table-column>--> </el-table-column>-->
<el-table-column width="120" label="派工数量" align="center" prop="quantitySplit"/> <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="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 --> <!-- show-overflow-tooltip -->
<el-table-column width="300" label="产线设备" align="center" > <el-table-column width="300" label="产线设备" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
@ -636,7 +630,7 @@
<script> <script>
import { import {
getWorkOrders, getWorkOrders,
listWorkorder, listWorkorder,listWorkorderLevel0,getNextLevelWorkOrderList,
delWorkorder, delWorkorder,
downWorkorder, downWorkorder,
getOrderAndWork,getProSortNo, getOrderAndWork,getProSortNo,
@ -739,6 +733,7 @@ export default {
workorderList: [], workorderList: [],
// //
title: "", title: "",
titleM:"",
// //
open: false, open: false,
openM:false, openM:false,
@ -826,7 +821,9 @@ export default {
methods: { methods: {
// //
productCodeFormate(row, column, cellValue){ productCodeFormate(row, column, cellValue){
if(cellValue !=null){
return cellValue.slice(7,18); // return cellValue.slice(7,18); //
}
}, },
// //
orderCodeFormate(row, column, cellValue){ orderCodeFormate(row, column, cellValue){
@ -877,13 +874,12 @@ export default {
// - // -
handleUpdateDown(row) { handleUpdateDown(row) {
var statusesArray = this.statuses; var statusesArray = this.statuses;
/**
for (var i = 0; i < statusesArray.length; i++) { for (var i = 0; i < statusesArray.length; i++) {
if (statusesArray[i] == 'w1') {// if (statusesArray[i] != 'w0') {//
this.$modal.msgError("已经下达的订单不允许操作"); this.$modal.msgError("已经下达的订单不允许操作");
return return
} }
}**/ }
this.loading = true; this.loading = true;
let _this = this; let _this = this;
const workorderIds = row.workorderCode || this.codes; const workorderIds = row.workorderCode || this.codes;
@ -964,6 +960,7 @@ export default {
// //
this.proLoading = true // true this.proLoading = true // true
this.workerLoading = true // true this.workerLoading = true // true
getOrderAndWork(this.selectWork).then(response => { getOrderAndWork(this.selectWork).then(response => {
this.splitData.push(response.data.workOrder) this.splitData.push(response.data.workOrder)
this.productData.push(response.data.order) this.productData.push(response.data.order)
@ -1395,13 +1392,13 @@ export default {
// - // -
getList() { getList() {
this.loading = true; this.loading = true;
this.queryParams.endFlag = '1';// this.queryParams.parentOrder = '0';//
if (this.queryParams.productDateArray != null) { if (this.queryParams.productDateArray != null) {
this.queryParams.productDateStart = moment(this.queryParams.productDateArray[0]).format('YYYY-MM-DD'); this.queryParams.productDateStart = moment(this.queryParams.productDateArray[0]).format('YYYY-MM-DD');
this.queryParams.productDateEnd = moment(this.queryParams.productDateArray[1]).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.workorderList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -1464,15 +1461,7 @@ export default {
// //
this.splitForm.prodType = this.splitData[0].prodType 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.refreshProTable = false // refreshProTablefalse
this.refreshWorkerTable = false // refreshProTablefalse this.refreshWorkerTable = false // refreshProTablefalse
this.$nextTick(() => { this.$nextTick(() => {
@ -1503,22 +1492,6 @@ export default {
}else{ }else{
this.splitForm.productDate = new Date(); 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'){ if (this.productData[0],prototype != 'white'){
@ -1528,6 +1501,7 @@ export default {
// //
function setAtrr1(order, work) { function setAtrr1(order, work) {
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit); order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
order.atrr1 = work.quantitySplit; order.atrr1 = work.quantitySplit;
@ -1535,9 +1509,7 @@ export default {
setAtrr1(order.children[0], work.children[0]); setAtrr1(order.children[0], work.children[0]);
} }
} }
setAtrr1(this.productData[0], this.splitData[0]); setAtrr1(this.productData[0], this.splitData[0]);
} }
}) })
@ -1734,7 +1706,33 @@ export default {
this.splitForm.materialName = this.materielBP[0].productDescZh; this.splitForm.materialName = this.materielBP[0].productDescZh;
this.innerBPVisible = false; 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> </script>

Loading…
Cancel
Save