|
|
|
@ -162,9 +162,16 @@ |
|
|
|
<el-form :inline="true" label-position="top" label-width="100px"> |
|
|
|
<el-form-item :label="'主记录'"> |
|
|
|
</el-form-item> |
|
|
|
<span @click="openRoutingMenuModal"> |
|
|
|
<icon-svg name="open-menu" style="height: 20px; width: 20px;"></icon-svg> |
|
|
|
</span> |
|
|
|
<el-dropdown class="customer-dropdown" @command="handleCommand"> |
|
|
|
<el-button type="primary"> |
|
|
|
主菜单<i class="el-icon-arrow-down el-icon--right"></i> |
|
|
|
</el-button> |
|
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
|
<el-dropdown-item class="customer-li" command="分批排产">分批排产</el-dropdown-item> |
|
|
|
<el-dropdown-item class="customer-li" command="重新排产">重新排产</el-dropdown-item> |
|
|
|
</el-dropdown-menu> |
|
|
|
</el-dropdown> |
|
|
|
|
|
|
|
|
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
@ -200,9 +207,6 @@ |
|
|
|
<el-form :inline="true" label-position="top" label-width="100px"> |
|
|
|
<el-form-item :label="'明细记录'"> |
|
|
|
</el-form-item> |
|
|
|
<span @click="openScheduleMenuModal"> |
|
|
|
<icon-svg name="open-menu" style="height: 20px; width: 20px;" ></icon-svg> |
|
|
|
</span> |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
height="135" |
|
|
|
@ -257,19 +261,7 @@ |
|
|
|
|
|
|
|
</comSplitSchedule> |
|
|
|
|
|
|
|
<!-- 分批排产的组件 --> |
|
|
|
<comOpenRoutingMenu ref="comOpenRoutingMenu" :close-on-click-modal="false" |
|
|
|
:visible.sync="showRoutingMenu" |
|
|
|
@initProcessRoutingMenu="initProcessRoutingMenu"> |
|
|
|
|
|
|
|
</comOpenRoutingMenu> |
|
|
|
|
|
|
|
<!-- 分批排产的组件 --> |
|
|
|
<comOpenScheduleMenu ref="comOpenScheduleMenu" :close-on-click-modal="false" |
|
|
|
:visible.sync="showScheduleMenu" |
|
|
|
@initProcessScheduleMenu="initProcessScheduleMenu"> |
|
|
|
|
|
|
|
</comOpenScheduleMenu> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
@ -277,8 +269,6 @@ |
|
|
|
<script> |
|
|
|
import Chooselist from '@/views/modules/common/Chooselist';/*列表组件*/ |
|
|
|
import comSplitSchedule from '@/views/modules/schedule/com_split_schedule';/*分批排产的modal*/ |
|
|
|
import comOpenRoutingMenu from "./com_open_routing_menu";/*工艺路线的菜单页面*/ |
|
|
|
import comOpenScheduleMenu from "./com_open_schedule_menu";/* 派工单的菜单*/ |
|
|
|
import { |
|
|
|
getResourceRestList, |
|
|
|
getShopOrderList, |
|
|
|
@ -1762,8 +1752,6 @@ export default { |
|
|
|
/*组件*/ |
|
|
|
components: { |
|
|
|
Chooselist,/*列表的组件*/ |
|
|
|
comOpenRoutingMenu,/* 工艺路线的菜单页面 */ |
|
|
|
comOpenScheduleMenu,/*派工单的菜单*/ |
|
|
|
comSplitSchedule,/* 分批排产的组件 */ |
|
|
|
}, |
|
|
|
|
|
|
|
@ -1841,46 +1829,32 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/*打开routing操作菜单的页面*/ |
|
|
|
openRoutingMenuModal(){ |
|
|
|
//显示组件 |
|
|
|
this.showRoutingMenu = true; |
|
|
|
//操作组件的方法 |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.comOpenRoutingMenu.init(this.currentRoutingRow); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
/*打开派工单操作菜单的页面*/ |
|
|
|
openScheduleMenuModal(){ |
|
|
|
//显示组件 |
|
|
|
this.showScheduleMenu = true; |
|
|
|
//操作组件的方法 |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.comOpenScheduleMenu.init(this.currentSchedlingRow); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
/*区分不同的菜单 调用不同的方法 调用不同的方法*/ |
|
|
|
initProcessRoutingMenu(menuName){ |
|
|
|
handleCommand(menuName){ |
|
|
|
//区分是哪一个方法调用 |
|
|
|
if('splitSchedule' === menuName){ |
|
|
|
let routingRow = this.currentRoutingRow; |
|
|
|
//首先判断是否选好 |
|
|
|
if(null == routingRow){ |
|
|
|
this.$message.error("请先单击选择行!") |
|
|
|
return false; |
|
|
|
} |
|
|
|
//调用分批排产的方法 |
|
|
|
this.showSplitScheduleFlag = true; |
|
|
|
//调用组件 |
|
|
|
this.$refs.comSplitSchedule.init(this.currentRoutingRow); |
|
|
|
}else if('reSchedule' === menuName){ |
|
|
|
this.initReScheduleWorkOrders(); |
|
|
|
if('分批排产' === menuName){ |
|
|
|
this.openSplitScheduleModal(); |
|
|
|
}else if('重新排产' === menuName){ |
|
|
|
//调用提示的方法 |
|
|
|
this.warnReScheduleConfirm(); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/*打开分批排产*/ |
|
|
|
openSplitScheduleModal(){ |
|
|
|
let routingRow = this.currentRoutingRow; |
|
|
|
//首先判断是否选好 |
|
|
|
if(null == routingRow){ |
|
|
|
this.$message.error("请先单击选择行!") |
|
|
|
return false; |
|
|
|
} |
|
|
|
//调用分批排产的方法 |
|
|
|
this.showSplitScheduleFlag = true; |
|
|
|
//调用组件 |
|
|
|
this.$refs.comSplitSchedule.init(this.currentRoutingRow); |
|
|
|
}, |
|
|
|
|
|
|
|
/*区分不同的菜单 调用不同的方法 调用不同的方法*/ |
|
|
|
initProcessScheduleMenu(menuName){ |
|
|
|
|
|
|
|
@ -1910,7 +1884,7 @@ export default { |
|
|
|
|
|
|
|
/*设置工艺的行*/ |
|
|
|
setCurrentRoutingRow(row, column, event) { |
|
|
|
this.currentRoutingRow = JSON.parse(JSON.stringify(row)); |
|
|
|
this.currentRoutingRow = row; |
|
|
|
}, |
|
|
|
|
|
|
|
/*开始排产的操作*/ |
|
|
|
@ -1925,19 +1899,20 @@ export default { |
|
|
|
return false; |
|
|
|
} |
|
|
|
//赋值排产的数量 |
|
|
|
row.qtyScheduled = row.qtyToSchedule; |
|
|
|
this.pageData.scheduledQty = row.qtyScheduled; |
|
|
|
let scheduledQty = row.qtyToSchedule; |
|
|
|
debugger; |
|
|
|
row.qtyScheduled = scheduledQty; |
|
|
|
row.qtyToSchedule = row.lotSize - row.qtyScheduled; |
|
|
|
this.pageData.scheduledQty = scheduledQty; |
|
|
|
//设置工单和工序 |
|
|
|
this.pageData.orderNo = row.orderNo; |
|
|
|
this.pageData.itemNo = row.itemNo; |
|
|
|
//执行排产的方法 |
|
|
|
this.scheduleWorkOrderOperation(); |
|
|
|
this.scheduleWorkOrderOperation(scheduledQty); |
|
|
|
}, |
|
|
|
|
|
|
|
/*分批排产*/ |
|
|
|
initAddSplitSchedule(scheduledQty){ |
|
|
|
//重置请求的参数 |
|
|
|
this.pageData.scheduledQty = scheduledQty; |
|
|
|
//发送请求 |
|
|
|
//判断排产的加工中心和机台是否为空 |
|
|
|
if(this.pageData.workCenterNo == null || '' == this.pageData.workCenterNo){ |
|
|
|
@ -1948,17 +1923,22 @@ export default { |
|
|
|
this.$message.error('机台不能为空!') |
|
|
|
return false; |
|
|
|
} |
|
|
|
this.currentRoutingRow.qtyScheduled = this.currentRoutingRow.qtyScheduled + parseFloat(scheduledQty); |
|
|
|
this.currentRoutingRow.qtyToSchedule = parseFloat(this.currentRoutingRow.lotSize) - this.currentRoutingRow.qtyScheduled; |
|
|
|
//执行排产的方法 |
|
|
|
this.scheduleWorkOrderOperation(); |
|
|
|
this.scheduleWorkOrderOperation(scheduledQty); |
|
|
|
}, |
|
|
|
|
|
|
|
/*排产生产工单*/ |
|
|
|
scheduleWorkOrderOperation(){ |
|
|
|
scheduleWorkOrderOperation(scheduledQty){ |
|
|
|
//重置请求的参数 |
|
|
|
this.pageData.scheduledQty = scheduledQty; |
|
|
|
scheduleWorkOrder(this.pageData).then(({data}) => { |
|
|
|
if(data.code == 500){ |
|
|
|
this.$message.error(data.msg); |
|
|
|
this.pageData.scheduledQty = 0; |
|
|
|
}else{ |
|
|
|
this.$message.info(data.msg); |
|
|
|
this.$message.success(data.msg); |
|
|
|
//刷新明细的报工页面 |
|
|
|
this.getOrderScheduleList(); |
|
|
|
} |
|
|
|
@ -1998,7 +1978,7 @@ export default { |
|
|
|
if(data.code == 500){ |
|
|
|
this.$message.error(data.msg); |
|
|
|
}else{ |
|
|
|
this.$message.info(data.msg); |
|
|
|
this.$message.success(data.msg); |
|
|
|
//刷新明细的报工页面 |
|
|
|
this.getOrderScheduleList(); |
|
|
|
} |
|
|
|
@ -2033,15 +2013,16 @@ export default { |
|
|
|
if(data.code == 500){ |
|
|
|
this.$message.error(data.msg); |
|
|
|
}else{ |
|
|
|
this.$message.info(data.msg); |
|
|
|
this.$message.success(data.msg); |
|
|
|
//刷新明细的报工页面 |
|
|
|
this.getOrderScheduleList(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
/*重新排产的方法*/ |
|
|
|
initReScheduleWorkOrders(){ |
|
|
|
/*提示取消派工单*/ |
|
|
|
warnReScheduleConfirm(){ |
|
|
|
//判断加工中心和机台 |
|
|
|
//判断排产的加工中心和机台是否为空 |
|
|
|
if(this.pageData.workCenterNo == null || '' == this.pageData.workCenterNo){ |
|
|
|
this.$message.error('加工中心不能为空!') |
|
|
|
@ -2051,11 +2032,24 @@ export default { |
|
|
|
this.$message.error('机台不能为空!') |
|
|
|
return false; |
|
|
|
} |
|
|
|
//提示操作 |
|
|
|
this.$confirm('确实要对排产清单中的未完成派工单进行排产吗?', '提示', { |
|
|
|
confirmButtonText: '确认', |
|
|
|
celButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() =>{ |
|
|
|
//执行创建新卷的操作 |
|
|
|
this.initReScheduleWorkOrders(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
/*重新排产的方法*/ |
|
|
|
initReScheduleWorkOrders(){ |
|
|
|
reScheduleWorkOrders(this.pageData).then(({data}) => { |
|
|
|
if(data.code == 500){ |
|
|
|
this.$message.error(data.msg); |
|
|
|
}else{ |
|
|
|
this.$message.info(data.msg); |
|
|
|
this.$message.success(data.msg); |
|
|
|
//刷新明细的报工页面 |
|
|
|
this.getOrderScheduleList(); |
|
|
|
} |
|
|
|
@ -2162,5 +2156,14 @@ div.customer-el-card-blue { |
|
|
|
background-color: transparent !important; |
|
|
|
} |
|
|
|
|
|
|
|
/*添加主菜单和明细菜单的样式*/ |
|
|
|
.customer-css .customer-dropdown .el-button--primary{ |
|
|
|
padding: 2px; |
|
|
|
font-size: 12px; |
|
|
|
} |
|
|
|
|
|
|
|
.el-dropdown-menu /deep/ li.customer-li{ |
|
|
|
font-size: 10px; |
|
|
|
} |
|
|
|
/*控制上下间距*/ |
|
|
|
</style> |