|
@@ -1110,51 +1110,63 @@ export default {
|
|
|
},
|
|
|
// 添加计划
|
|
|
addPlanInfo(){
|
|
|
- if(this.tableData2.length<=0){
|
|
|
+ if(this.tableData2.length>0){
|
|
|
+ var flag=true;
|
|
|
+ this.tableData2.forEach(item=>{
|
|
|
+ if(!this.isRowFilled(item)){
|
|
|
+ this.$message({
|
|
|
+ message: '请先完善表格数据',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ flag=false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(flag){
|
|
|
+ const datatime=Date.now()+this.machineId;
|
|
|
+ //处理表格数据
|
|
|
+ this.tableData2.forEach(item=>{
|
|
|
+ item.timestampRandomCode=datatime;
|
|
|
+ item.machineId=this.machineId;
|
|
|
+ })
|
|
|
+ //时间戳
|
|
|
+ let data={
|
|
|
+ //机台号
|
|
|
+ machineId: this.machineId,
|
|
|
+ macId:this.macId,
|
|
|
+ timestampRandomCode:datatime,
|
|
|
+ //计划信息
|
|
|
+ detailsOfTheRefuelingPlans: this.tableData2
|
|
|
+ }
|
|
|
+ //添加计划信息
|
|
|
+ addMaterielInfo(data).then(response => {
|
|
|
+ if (response.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: '添加成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.getAmmunitionPlanInfo();
|
|
|
+ //最后把弹窗关掉
|
|
|
+ this.nanInsertDialogTableVisible = false
|
|
|
+ this.beiInsertDialogTableVisible = false
|
|
|
+ //更改订单投产信息的批号,
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: '添加失败',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ this.nanInsertDialogTableVisible = false
|
|
|
+ this.beiInsertDialogTableVisible = false
|
|
|
+ //最后把弹窗关掉
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }else {
|
|
|
this.$message({
|
|
|
message: '请先添加表格数据',
|
|
|
type: 'warning'
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- const datatime=Date.now()+this.machineId;
|
|
|
- //处理表格数据
|
|
|
- this.tableData2.forEach(item=>{
|
|
|
- item.timestampRandomCode=datatime;
|
|
|
- item.machineId=this.machineId;
|
|
|
- })
|
|
|
- //时间戳
|
|
|
- let data={
|
|
|
- //机台号
|
|
|
- machineId: this.machineId,
|
|
|
- macId:this.macId,
|
|
|
- timestampRandomCode:datatime,
|
|
|
- //计划信息
|
|
|
- detailsOfTheRefuelingPlans: this.tableData2
|
|
|
- }
|
|
|
- //添加计划信息
|
|
|
- addMaterielInfo(data).then(response => {
|
|
|
- if (response.code == 200) {
|
|
|
- this.$message({
|
|
|
- message: '添加成功',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- this.getAmmunitionPlanInfo();
|
|
|
- //最后把弹窗关掉
|
|
|
- this.nanInsertDialogTableVisible = false
|
|
|
- this.beiInsertDialogTableVisible = false
|
|
|
- //更改订单投产信息的批号,
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: '添加失败',
|
|
|
- type: 'error'
|
|
|
- });
|
|
|
- this.nanInsertDialogTableVisible = false
|
|
|
- this.beiInsertDialogTableVisible = false
|
|
|
- //最后把弹窗关掉
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
},
|
|
|
// 修改产品计划
|
|
|
handleEditPlan(row) {
|