fix: 读空指针异常解决阻塞问题

This commit is contained in:
2024-07-24 09:01:30 +08:00
parent 4a6c1c7af4
commit fd9eef0191
27 changed files with 867 additions and 738 deletions

View File

@@ -256,20 +256,13 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
}
});
}
} catch (Exception var17) {
var17.printStackTrace();
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
}
//申请空托盘出库
if (mode == 8 && !requireSucess) {
if (container_type == 0) {
message = "托盘类型为空";
}else {
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode);
}
}
}
@@ -332,6 +325,19 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
break;
}
}
} catch (Exception var17) {
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code+ "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
message = "读取信号值时出现异常:" + var17.getMessage();
var17.printStackTrace();
}
last_heartbeat = heartbeat;
last_mode = mode;
last_move = move;

View File

@@ -139,7 +139,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}
@@ -152,7 +152,7 @@ public class ItemProtocol {
} else {
return value;
}
return "0";
return value;
}
public int[] getOpcArrayValue(String protocol) {

View File

@@ -242,10 +242,11 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code+ "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol))
.content(this.device_code+ "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
message = "读取信号值时出现异常:" + var17.getMessage();
var17.printStackTrace();
}

View File

@@ -150,7 +150,7 @@ public class ItemProtocol {
} else {
return value;
}
return "0";
return value;
}

View File

@@ -192,16 +192,11 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
requireSucess = false;
}
if (move != 0 && task > 0) {
if (null!=inst) {
if (null != inst) {
inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code();
}
update_instruction_status();
}
} catch (Exception var17) {
var17.printStackTrace();
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
}
if (move != last_move && move == 0 && last_move == 1) {
requireSucess = false;
@@ -232,7 +227,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
if (move == 1 && !requireSucess) {
if (StrUtil.isEmpty(material_barcode)) {
message = "条码为空";
}else {
} else {
applyAgvTask();
}
@@ -266,6 +261,19 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
break;
}
}
} catch (Exception var17) {
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
message = "读取信号值时出现异常:" + var17.getMessage();
var17.printStackTrace();
}
last_mode = mode;
last_move = move;
last_carrier_direction = carrier_direction;
@@ -390,7 +398,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
this.writing(list);
logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:" + jo);
requireSucess = true;
}else {
} else {
message = "申请AGV任务报错,参数,接口返回:" + jo;
this.iserror = true;
}
@@ -426,6 +434,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
itemMap.put(to_command, command);
this.control(itemMap);
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();

View File

@@ -142,7 +142,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}
@@ -153,7 +153,7 @@ public class ItemProtocol {
} else {
return value;
}
return "";
return value;
}
public static List<ItemDto> getReadableItemDtos() {

View File

@@ -200,13 +200,6 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
if (move != 0 && task > 0) {
update_instruction_status();
}
} catch (Exception var17) {
var17.printStackTrace();
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
}
if (move != last_move && move==0 && last_move==1) {
requireSucess = false;
clearWrite();
@@ -299,6 +292,21 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
break;
}
}
} catch (Exception var17) {
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
message = "读取信号值时出现异常:" + var17.getMessage();
var17.printStackTrace();
}
last_mode = mode;
last_move = move;
last_carrier_direction = carrier_direction;

View File

@@ -194,7 +194,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}
@@ -205,7 +205,7 @@ public class ItemProtocol {
} else {
return value;
}
return "0";
return value;
}
public static List<ItemDto> getReadableItemDtos() {

View File

@@ -198,14 +198,6 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
if (move != 0 && task > 0) {
update_instruction_status();
}
} catch (Exception var17) {
var17.printStackTrace();
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
}
if (move != last_move && move == 0 && last_move == 1) {
requireSucess = false;
clearWrite();
@@ -293,6 +285,22 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
}
}
} catch (Exception var17) {
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
message = "读取信号值时出现异常:" + var17.getMessage();
var17.printStackTrace();
}
last_mode = mode;
last_move = move;
last_action = action;

View File

@@ -112,7 +112,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}
public String getOpcStringValue(String protocol) {
@@ -123,7 +123,7 @@ public class ItemProtocol {
} else {
return value;
}
return "0";
return value;
}
public static List<ItemDto> getReadableItemDtos() {

View File

@@ -243,15 +243,6 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode + "复位请求标记:" + requireSucess);
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
}
if (mode == -99){
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("PLC断连需重启程序")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
throw new BadRequestException("PLC断连需重启程序");
}
if (move != last_move && move == 0 && last_move == 1) {
@@ -287,11 +278,6 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
update_instruction_status();
}
} catch (Exception e) {
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace()));
}
if (mode == 0) {
this.setIsonline(false);
//有报警
@@ -386,6 +372,19 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
}
}
} catch (Exception e) {
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
message = "读取信号值时出现异常:" + e.getMessage();
e.printStackTrace();
}
last_mode = mode;
last_move = move;
last_action = action;

View File

@@ -166,7 +166,7 @@ public class ItemProtocol {
} else {
return value;
}
return "0";
return value;
}
public int getOpcIntegerValue(String protocol) {
@@ -178,7 +178,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return -99;
return value;
}
@@ -191,7 +191,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}

View File

@@ -178,7 +178,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}
@@ -189,7 +189,7 @@ public class ItemProtocol {
} else {
return value;
}
return "0";
return value;
}
public static List<ItemDto> getReadableItemDtos() {

View File

@@ -178,12 +178,6 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
to_target = this.itemProtocol.getTo_target();
to_task = this.itemProtocol.getTo_task();
heartbeat = this.itemProtocol.getHeartbeat();
} catch (Exception e) {
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace()));
}
if (mode != last_mode) {
requireSucess = false;
@@ -217,6 +211,19 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
}
}
} catch (Exception e) {
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
message = "读取信号值时出现异常:" + e.getMessage();
e.printStackTrace();
}

View File

@@ -194,12 +194,6 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
updateInstrction();
}
} catch (Exception e) {
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace()));
}
if (mode == 0) {
this.setIsonline(false);
message = "universal_off-line";
@@ -247,6 +241,19 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
}
} catch (Exception e) {
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
message = "读取信号值时出现异常:" + e.getMessage();
e.printStackTrace();
}
last_mode = mode;
last_move = move;
last_action = action;

View File

@@ -199,7 +199,7 @@ public class ItemProtocol {
} else {
return value;
}
return "0";
return value;
}
public float getOpcFloatValue(String protocol) {
@@ -211,7 +211,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}

View File

@@ -164,17 +164,6 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
updateInstructionStatus();
}
} catch (Exception e) {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("读取信号值时出现异常" + this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.device_code + "." + Arrays.toString(e.getStackTrace()))
.build();
logDto.setLog_level(2);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
if (mode == 0) {
this.setIsonline(false);
message = "universal_off-line";
@@ -222,6 +211,21 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
}
} catch (Exception e) {
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
message = "读取信号值时出现异常:" + e.getMessage();
e.printStackTrace();
}
last_mode =mode;
last_action = action;

View File

@@ -199,7 +199,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}
public String getOpcStringValue(String protocol) {
@@ -209,7 +209,7 @@ public class ItemProtocol {
} else {
return value;
}
return "0";
return value;
}
public static List<ItemDto> getReadableItemDtos() {

View File

@@ -173,7 +173,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}
public int getOpcIntegerValue(String protocol) {
@@ -184,7 +184,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}
public static List<ItemDto> getReadableItemDtos() {

View File

@@ -177,13 +177,6 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
updateInstructionStatus();
}
} catch (Exception e) {
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace()));
}
if (mode == 0) {
this.setIsonline(false);
message = "universal_off-line";
@@ -231,6 +224,21 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
}
} catch (Exception e) {
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
message = "读取信号值时出现异常:" + e.getMessage();
e.printStackTrace();
}
last_mode = mode;
last_move = move;
last_action = action;

View File

@@ -81,7 +81,7 @@ ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}
public String getOpcStringValue(String protocol) {
@@ -91,7 +91,7 @@ ItemProtocol {
} else {
return value;
}
return "0";
return value;
}
public static List<ItemDto> getReadableItemDtos() {

View File

@@ -163,14 +163,6 @@ public class StandardManipulatoDeviceDriver extends AbstractOpcDeviceDriver impl
if (mode != last_mode) {
requireSucess = false;
}
} catch (Exception var17) {
var17.printStackTrace();
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
}
if (mode == 0) {
this.setIsonline(false);
message = "universal_off-line";
@@ -189,6 +181,21 @@ public class StandardManipulatoDeviceDriver extends AbstractOpcDeviceDriver impl
}
} catch (Exception var17) {
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
message = "读取信号值时出现异常:" + var17.getMessage();
var17.printStackTrace();
}
last_mode = mode;
last_move = move;
last_action = action;

View File

@@ -182,7 +182,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}
public float getOpcFloatValue(String protocol) {
@@ -194,7 +194,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}

View File

@@ -172,14 +172,6 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
}
updateInstructionStatus();
}
} catch (Exception var17) {
var17.printStackTrace();
// feedMessage = var17.getMessage();
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
}
if (mode == 0) {
this.setIsonline(false);
//有报警
@@ -224,6 +216,21 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
}
}
} catch (Exception var17) {
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
message = "读取信号值时出现异常:" + var17.getMessage();
var17.printStackTrace();
}
last_mode = mode;
last_move = move;
last_action = action;

View File

@@ -177,7 +177,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}
public float getOpcFloatValue(String protocol) {
@@ -189,7 +189,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return value;
}

View File

@@ -210,13 +210,6 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi
Integer actionType = ActionTypeEnum.IN_FINISHING.getCode();
creatAGV(actionType, action);
}
} catch (Exception var17) {
var17.printStackTrace();
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
}
if (mode == 0) {
this.setIsonline(false);
message = "universal_off-line";
@@ -264,6 +257,21 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi
}
}
} catch (Exception var17) {
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
message = "读取信号值时出现异常:" + var17.getMessage();
var17.printStackTrace();
}
last_mode = mode;
last_move = move;
last_action = action;

View File

@@ -7,7 +7,7 @@
<div class="crud-opts2" style="margin-bottom: 5px;">
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<slot name="left"/>
<el-button
slot="left"
class="filter-item"
@@ -23,7 +23,7 @@
</div>
<div class="app-container">
<el-table :data="modeform.plans" border fit highlight-current-row style="width: 100%;" class="tb-edit">
<el-table-column label="任务类型" prop="type" width="180">
<el-table-column label="任务类型" prop="type" width="250">
<template scope="scope">
<el-select
v-model="scope.row.type"
@@ -40,7 +40,7 @@
</el-select>
</template>
</el-table-column>
<el-table-column label="指令起点" prop="from" width="180">
<el-table-column label="指令起点" prop="from" width="250">
<template scope="scope">
<el-select
v-model="scope.row.from"
@@ -57,7 +57,7 @@
</el-select>
</template>
</el-table-column>
<el-table-column label="指令终点" prop="to" width="180">
<el-table-column label="指令终点" prop="to" width="250">
<template scope="scope">
<el-select
v-model="scope.row.to"
@@ -74,15 +74,29 @@
</el-select>
</template>
</el-table-column>
<el-table-column label="数量" prop="quantity" width="180">
<el-table-column label="数量" prop="quantity" width="250">
<template scope="scope">
<el-input-number v-model="scope.row.quantity" value="0" :min="0" size="mini" />
<el-input-number v-model="scope.row.quantity" value="0" :min="0" size="mini"/>
<span v-show="scope.row.edit">{{ scope.row.quantity }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="170">
<el-table-column align="center" label="顺序" width="300" fixed="right">
<template scope="scope">
<el-button
type="primary"
icon="el-icon-top"
@click="moveUp(scope.$index)"
>
上移
</el-button>
<el-button
type="primary"
icon="el-icon-top"
@click="moveDown(scope.$index)"
>
下移
</el-button>
<el-button
type="danger"
class="filter-item"
@@ -97,7 +111,7 @@
</el-card>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span" />
<span class="role-span"/>
<el-button
:loading="false"
icon="el-icon-check"
@@ -129,9 +143,16 @@ import crud from '@/mixins/crud'
import deviceCrud from '@/api/acs/device/device'
import crudCustomPolicy from '@/api/acs/device/customPolicy'
import CRUD from '@crud/crud'
import * as constants from 'constants'
import index from '@/views/system/build/tinymce/example/Index.vue'
export default {
name: 'CustomPolicyType',
computed: {
index() {
return index
}
},
mixins: [crud],
props: {
parentForm: {
@@ -140,11 +161,20 @@ export default {
}
},
cruds() {
return CRUD({ title: '自定义策略', url: 'api/customPolicy', idField: 'id', sort: 'id,desc', crudMethod: { ...crudCustomPolicy }})
return CRUD({
title: '自定义策略',
url: 'api/customPolicy',
idField: 'id',
sort: 'id,desc',
crudMethod: { ...crudCustomPolicy }
})
},
data() {
return {
requestMethodList: [{ code: 1, name: '上架' }, { code: 2, name: '下架' }, { code: 3, name: '摆渡' }],
requestMethodList: [{ code: 1, name: '出库(起点货架终点输送线)' }, {
code: 2,
name: '入库(起点输送线终点货位)'
}, { code: 3, name: '移库(起点终点为货位)' }],
key_code: this.$route.query.key_code,
id: this.$route.query.id,
deviceList: [],
@@ -174,6 +204,26 @@ export default {
})
},
methods: {
moveUp(index) {
if (index > 0) {
const upDate = this.modeform.plans[index - 1]
this.modeform.plans.splice(index - 1, 1)
this.modeform.plans.splice(index, 0, upDate)
} else {
this.$message.error('已经是第一条,不可上移')
}
},
moveDown(index) {
if ((index + 1) === this.modeform.plans.length) {
this.$message.error('已经是最后一条,不可下移')
} else {
console.log(index)
const downDate = this.modeform.plans[index + 1]
this.modeform.plans.splice(index + 1, 1)
this.modeform.plans.splice(index, 0, downDate)
}
},
insertdtl() {
this.modeform.plans.push({ quantity: '', type: '' })
},