|
@ -1,7 +1,6 @@ |
|
|
<template> |
|
|
<template> |
|
|
<!--晟华-包装机工位--> |
|
|
<!--晟华包装码垛机械手--> |
|
|
<div> |
|
|
<div> |
|
|
|
|
|
|
|
|
<el-card class="box-card" shadow="never"> |
|
|
<el-card class="box-card" shadow="never"> |
|
|
<div slot="header" class="clearfix"> |
|
|
<div slot="header" class="clearfix"> |
|
|
<span class="role-span">设备协议:</span> |
|
|
<span class="role-span">设备协议:</span> |
|
@ -85,21 +84,78 @@ |
|
|
|
|
|
|
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<el-form-item label="申请任务"> |
|
|
<el-form-item label="呼叫"> |
|
|
<el-switch v-model="form.apply_task" /> |
|
|
<el-switch v-model="form.apply_task" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<el-form-item label="手动生成任务" label-width="150px"> |
|
|
<el-form-item label="响应" label-width="150px"> |
|
|
<el-switch v-model="form.manual_create_task" /> |
|
|
<el-switch v-model="form.manual_create_task" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
|
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<el-form-item label="申请空盘" prop="device_code"> |
|
|
<el-form-item label="关联设备" prop="device_code"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="form.link_device_code" |
|
|
|
|
|
filterable |
|
|
|
|
|
multiple |
|
|
|
|
|
placeholder="请选择" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in deviceList" |
|
|
|
|
|
:key="item.device_code" |
|
|
|
|
|
:label="item.device_name" |
|
|
|
|
|
:value="item.device_code" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="8"> |
|
|
|
|
|
<el-form-item label="关联三色灯" prop="device_code" label-width="100px"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="form.link_three_lamp" |
|
|
|
|
|
filterable |
|
|
|
|
|
clearable |
|
|
|
|
|
placeholder="请选择" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in deviceList" |
|
|
|
|
|
:key="item.device_code" |
|
|
|
|
|
:label="item.device_name" |
|
|
|
|
|
:value="item.device_code" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="8"> |
|
|
|
|
|
<el-form-item label="是否输入物料" label-width="150px"> |
|
|
|
|
|
<el-switch v-model="form.input_material" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="8"> |
|
|
|
|
|
<el-form-item label="取货设备" prop="device_code"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="form.link_get_station" |
|
|
|
|
|
filterable |
|
|
|
|
|
multiple |
|
|
|
|
|
placeholder="请选择" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in deviceList" |
|
|
|
|
|
:key="item.device_code" |
|
|
|
|
|
:label="item.device_name" |
|
|
|
|
|
:value="item.device_code" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="8"> |
|
|
|
|
|
<el-form-item label="放货设备" prop="device_code"> |
|
|
<el-select |
|
|
<el-select |
|
|
v-model="form.apply_empty" |
|
|
v-model="form.link_put_station" |
|
|
filterable |
|
|
filterable |
|
|
multiple |
|
|
multiple |
|
|
placeholder="请选择" |
|
|
placeholder="请选择" |
|
@ -125,7 +181,7 @@ |
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<el-form-item label="取货"> |
|
|
<el-form-item label="取货"> |
|
|
<el-switch v-model="form.pickup" /> |
|
|
<el-switch v-model="form.is_pickup" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
@ -136,7 +192,67 @@ |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
</el-card> |
|
|
</el-card> |
|
|
|
|
|
<el-card class="box-card" shadow="never"> |
|
|
|
|
|
<div slot="header" class="clearfix"> |
|
|
|
|
|
<span class="role-span">交互相关:</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="crud-opts2" style="margin-bottom: 5px;"> |
|
|
|
|
|
<span class="crud-opts-right2"> |
|
|
|
|
|
<!--左侧插槽--> |
|
|
|
|
|
<slot name="left" /> |
|
|
|
|
|
<el-button |
|
|
|
|
|
slot="left" |
|
|
|
|
|
class="filter-item" |
|
|
|
|
|
type="primary" |
|
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
@click="insertdtl()" |
|
|
|
|
|
> |
|
|
|
|
|
新增一行 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="app-container"> |
|
|
|
|
|
<el-table :data="modeform.tableData" border fit highlight-current-row style="width: 100%;" class="tb-edit"> |
|
|
|
|
|
<el-table-column label="mode" prop="模式" width="180"> |
|
|
|
|
|
<template scope="scope"> |
|
|
|
|
|
<el-input-number value="3" :min="3" v-model="scope.row.mode" size="mini" /> |
|
|
|
|
|
<span v-show="scope.row.edit">{{ scope.row.mode }}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="request" prop="请求方法" width="500"> |
|
|
|
|
|
<template scope="scope"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="scope.row.request" |
|
|
|
|
|
filterable |
|
|
|
|
|
clearable |
|
|
|
|
|
placeholder="请选择" |
|
|
|
|
|
style="width: 450px" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in requestMethodList" |
|
|
|
|
|
:key="item.code" |
|
|
|
|
|
:label="item.name" |
|
|
|
|
|
:value="item.code" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column align="center" label="操作" width="170" > |
|
|
|
|
|
<template scope="scope"> |
|
|
|
|
|
<el-button |
|
|
|
|
|
type="danger" |
|
|
|
|
|
class="filter-item" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
icon="el-icon-delete" |
|
|
|
|
|
@click.native.prevent="deleteRow(scope.$index, modeform.tableData)" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-card> |
|
|
<el-card class="box-card" shadow="never"> |
|
|
<el-card class="box-card" shadow="never"> |
|
|
<div slot="header" class="clearfix"> |
|
|
<div slot="header" class="clearfix"> |
|
|
<span class="role-span">PLC读取字段:</span> |
|
|
<span class="role-span">PLC读取字段:</span> |
|
@ -154,7 +270,12 @@ |
|
|
<el-table-column prop="code" label="别名要求" /> |
|
|
<el-table-column prop="code" label="别名要求" /> |
|
|
<el-table-column prop="db" label="DB块"> |
|
|
<el-table-column prop="db" label="DB块"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-input v-model="data1[scope.$index].db" size="mini" class="edit-input" @input="finishReadEdit(data1[scope.$index])" /> |
|
|
<el-input |
|
|
|
|
|
v-model="data1[scope.$index].db" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
class="edit-input" |
|
|
|
|
|
@input="finishReadEdit(data1[scope.$index])" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="dbr_value"> |
|
|
<el-table-column prop="dbr_value"> |
|
@ -186,7 +307,12 @@ |
|
|
<el-table-column prop="code" label="别名要求" /> |
|
|
<el-table-column prop="code" label="别名要求" /> |
|
|
<el-table-column prop="db" label="DB块"> |
|
|
<el-table-column prop="db" label="DB块"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-input v-model="data2[scope.$index].db" size="mini" class="edit-input" @input="finishWriteEdit(data2[scope.$index])" /> |
|
|
<el-input |
|
|
|
|
|
v-model="data2[scope.$index].db" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
class="edit-input" |
|
|
|
|
|
@input="finishWriteEdit(data2[scope.$index])" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="dbr_value2"> |
|
|
<el-table-column prop="dbr_value2"> |
|
@ -242,7 +368,7 @@ import crud from '@/mixins/crud' |
|
|
import deviceCrud from '@/api/acs/device/device' |
|
|
import deviceCrud from '@/api/acs/device/device' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'LnshPackageSite', |
|
|
name: 'LnshPackagePalletManipulator', |
|
|
mixins: [crud], |
|
|
mixins: [crud], |
|
|
props: { |
|
|
props: { |
|
|
parentForm: { |
|
|
parentForm: { |
|
@ -261,17 +387,72 @@ export default { |
|
|
configLoading: false, |
|
|
configLoading: false, |
|
|
dataOpcservers: [], |
|
|
dataOpcservers: [], |
|
|
dataOpcPlcs: [], |
|
|
dataOpcPlcs: [], |
|
|
|
|
|
deviceList: [], |
|
|
data1: [], |
|
|
data1: [], |
|
|
data2: [], |
|
|
data2: [], |
|
|
|
|
|
requestMethodList: [], |
|
|
|
|
|
modeform: { |
|
|
|
|
|
tableData: [ |
|
|
|
|
|
{ |
|
|
|
|
|
mode: '3', |
|
|
|
|
|
request: 'order_verify' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
mode: '4', |
|
|
|
|
|
request: 'order_finish' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
mode: '5', |
|
|
|
|
|
request: 'apply_put_full_vehicle' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
mode: '6', |
|
|
|
|
|
request: 'apply_put_empty_vehicle' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
mode: '7', |
|
|
|
|
|
request: 'apply_take_empty_vehicle' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
mode: '8', |
|
|
|
|
|
request: 'apply_take_full_vehicle' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
mode: '9', |
|
|
|
|
|
request: 'apply_force_take_full_vehicle' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
mode: '10', |
|
|
|
|
|
request: 'apply_force_take_full_vehicle_in_storage' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
mode: '11', |
|
|
|
|
|
request: 'barcode_success_apply' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
mode: '12', |
|
|
|
|
|
request: 'get_vehicle_info' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
mode: '13', |
|
|
|
|
|
request: 'force_no_package' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
mode: '14', |
|
|
|
|
|
request: 'apply_labelling' |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
form: { |
|
|
form: { |
|
|
inspect_in_stocck: true, |
|
|
inspect_in_stocck: true, |
|
|
ignore_pickup_check: true, |
|
|
ignore_pickup_check: true, |
|
|
ignore_release_check: true, |
|
|
ignore_release_check: true, |
|
|
apply_task: true, |
|
|
apply_task: true, |
|
|
apply_empty: [], |
|
|
link_three_lamp: '', |
|
|
manual_create_task: true, |
|
|
manual_create_task: true, |
|
|
is_pickup: true, |
|
|
is_pickup: true, |
|
|
is_release: true |
|
|
is_release: true, |
|
|
|
|
|
link_device_code: [] |
|
|
}, |
|
|
}, |
|
|
rules: {} |
|
|
rules: {} |
|
|
} |
|
|
} |
|
@ -302,6 +483,13 @@ export default { |
|
|
} |
|
|
} |
|
|
this.data1 = data.rs |
|
|
this.data1 = data.rs |
|
|
this.data2 = data.ws |
|
|
this.data2 = data.ws |
|
|
|
|
|
if (data.modeform) { |
|
|
|
|
|
const arr = Object.keys(data.modeform) |
|
|
|
|
|
// 不为空 |
|
|
|
|
|
if (arr.length > 0) { |
|
|
|
|
|
this.modeform.tableData = data.modeform |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
this.sliceItem() |
|
|
this.sliceItem() |
|
|
}) |
|
|
}) |
|
|
selectPlcList().then(data => { |
|
|
selectPlcList().then(data => { |
|
@ -315,15 +503,26 @@ export default { |
|
|
deviceCrud.selectDeviceList().then(data => { |
|
|
deviceCrud.selectDeviceList().then(data => { |
|
|
this.deviceList = data |
|
|
this.deviceList = data |
|
|
}) |
|
|
}) |
|
|
|
|
|
deviceCrud.selectRequestMethodList().then(data => { |
|
|
|
|
|
this.requestMethodList = data |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
insertdtl() { |
|
|
|
|
|
this.modeform.tableData.push({mode: '', request: '' }) |
|
|
|
|
|
}, |
|
|
|
|
|
deleteRow(index, rows) { |
|
|
|
|
|
debugger |
|
|
|
|
|
rows.splice(index, 1) |
|
|
|
|
|
}, |
|
|
finishReadEdit(data) { |
|
|
finishReadEdit(data) { |
|
|
// 编辑的是code列,并且值包含mode |
|
|
// 编辑的是code列,并且值包含mode |
|
|
if (data.code.indexOf('mode') !== -1) { |
|
|
if (data.code.indexOf('mode') !== -1) { |
|
|
|
|
|
debugger |
|
|
const dbValue = data.db |
|
|
const dbValue = data.db |
|
|
// .之前的字符串 |
|
|
// .之前的字符串 |
|
|
const beforeStr = dbValue.match(/(\S*)\./)[1] |
|
|
// const beforeStr = dbValue.match(/(\S*)\./)[1] |
|
|
// .之后的字符串 |
|
|
// .之后的字符串 |
|
|
const afterStr = dbValue.match(/\.(\S*)/)[1] |
|
|
const afterStr = dbValue.match(/\.(\S*)/)[1] |
|
|
// 取最后数字 |
|
|
// 取最后数字 |
|
@ -332,35 +531,17 @@ export default { |
|
|
if (isNaN(parseInt(endNumber))) { |
|
|
if (isNaN(parseInt(endNumber))) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
for (const val in this.data1) { |
|
|
// for (const val in this.data1) { |
|
|
if (this.data1[val].code.indexOf('heartbeat') !== -1) { |
|
|
// if (this.data1[val].code.indexOf('move') !== -1) { |
|
|
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) - 1) |
|
|
// this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 1) |
|
|
} |
|
|
// } |
|
|
if (this.data1[val].code.indexOf('move') !== -1) { |
|
|
// if (this.data1[val].code.indexOf('error') !== -1) { |
|
|
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 1) |
|
|
// this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 5) |
|
|
} |
|
|
// } |
|
|
if (this.data1[val].code.indexOf('action') !== -1) { |
|
|
// if (this.data1[val].code.indexOf('task') !== -1) { |
|
|
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2) |
|
|
// this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 7) |
|
|
} |
|
|
// } |
|
|
if (this.data1[val].code.indexOf('ioaction') !== -1) { |
|
|
// } |
|
|
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 3) |
|
|
|
|
|
} |
|
|
|
|
|
if (this.data1[val].code.indexOf('error') !== -1) { |
|
|
|
|
|
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 4) |
|
|
|
|
|
} |
|
|
|
|
|
if (this.data1[val].code.indexOf('task') !== -1) { |
|
|
|
|
|
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 5) |
|
|
|
|
|
} |
|
|
|
|
|
if (this.data1[val].code.indexOf('weight') !== -1) { |
|
|
|
|
|
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 9) |
|
|
|
|
|
} |
|
|
|
|
|
if (this.data1[val].code.indexOf('material') !== -1) { |
|
|
|
|
|
this.data1[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 13) + '.50' |
|
|
|
|
|
} |
|
|
|
|
|
if (this.data1[val].code.indexOf('barcode') !== -1) { |
|
|
|
|
|
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 65) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
finishWriteEdit(data) { |
|
|
finishWriteEdit(data) { |
|
@ -368,7 +549,7 @@ export default { |
|
|
if (data.code.indexOf('to_command') !== -1) { |
|
|
if (data.code.indexOf('to_command') !== -1) { |
|
|
const dbValue = data.db |
|
|
const dbValue = data.db |
|
|
// .之前的字符串 |
|
|
// .之前的字符串 |
|
|
const beforeStr = dbValue.match(/(\S*)\./)[1] |
|
|
// const beforeStr = dbValue.match(/(\S*)\./)[1] |
|
|
// .之后的字符串 |
|
|
// .之后的字符串 |
|
|
const afterStr = dbValue.match(/\.(\S*)/)[1] |
|
|
const afterStr = dbValue.match(/\.(\S*)/)[1] |
|
|
// 取最后数字 |
|
|
// 取最后数字 |
|
@ -377,17 +558,14 @@ export default { |
|
|
if (isNaN(parseInt(endNumber))) { |
|
|
if (isNaN(parseInt(endNumber))) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
for (const val in this.data2) { |
|
|
// for (const val in this.data2) { |
|
|
if (this.data2[val].code.indexOf('to_target') !== -1) { |
|
|
// if (this.data2[val].code.indexOf('to_target') !== -1) { |
|
|
this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2) |
|
|
// this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2) |
|
|
} |
|
|
// } |
|
|
if (this.data2[val].code.indexOf('to_task') !== -1) { |
|
|
// if (this.data2[val].code.indexOf('to_task') !== -1) { |
|
|
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 4) |
|
|
// this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 6) |
|
|
} |
|
|
// } |
|
|
if (this.data2[val].code.indexOf('to_is_package') !== -1) { |
|
|
// } |
|
|
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 8) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
changeOpc(val) { |
|
|
changeOpc(val) { |
|
@ -450,7 +628,7 @@ export default { |
|
|
parentForm.is_route = true |
|
|
parentForm.is_route = true |
|
|
parentForm.plc_id = this.plc_id |
|
|
parentForm.plc_id = this.plc_id |
|
|
parentForm.opc_id = this.opc_id |
|
|
parentForm.opc_id = this.opc_id |
|
|
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { |
|
|
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { |
|
|
this.notify('保存成功', 'success') |
|
|
this.notify('保存成功', 'success') |
|
|
this.configLoading = false |
|
|
this.configLoading = false |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|