|
|
@ -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 // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
this.refreshProTable = false // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
this.refreshWorkerTable = false // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
this.refreshWorkerTable = false // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
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>
|
|
|
|