Browse Source

OPC、开放协议添加工位

langfang_wms
liwei 3 years ago
parent
commit
0e7f2196dd
6 changed files with 145 additions and 22 deletions
  1. +9
    -0
      src/api/plant/processData/basicCommunication.js
  2. +9
    -0
      src/api/plant/processData/openProtocol.js
  3. +41
    -9
      src/views/plant/processData/basicCommunication/addOrEdit.vue
  4. +21
    -1
      src/views/plant/processData/basicCommunication/index.vue
  5. +44
    -11
      src/views/plant/processData/openProtocol/addOrEdit.vue
  6. +21
    -1
      src/views/plant/processData/openProtocol/index.vue

+ 9
- 0
src/api/plant/processData/basicCommunication.js View File

@ -45,4 +45,13 @@ export function getOperationList(){
url:'/admin/base/operation/query',
method: 'get'
})
}
// 查询工位所有数据
export function getStationList (params) {
return request({
url: '/admin/base/workplace/query',
method: 'get',
params
})
}

+ 9
- 0
src/api/plant/processData/openProtocol.js View File

@ -47,4 +47,13 @@ export function getOperation (params) {
method: 'get',
params
})
}
// 查询工位所有数据
export function getStationList (params) {
return request({
url: '/admin/base/workplace/query',
method: 'get',
params
})
}

+ 41
- 9
src/views/plant/processData/basicCommunication/addOrEdit.vue View File

@ -15,7 +15,7 @@
class="demo-form-inline"
>
<el-row>
<el-col :span="6">
<el-col :span="8">
<el-form-item label="工艺" prop="OPCBasicComInfo-StepDesc">
<el-select
:disabled="isAddOrEdit == 'edit'"
@ -32,7 +32,8 @@
</el-option>
</el-select> </el-form-item
></el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('OPCBasicComInfo-StepNo')"
prop="OPCBasicComInfo-StepNo"
@ -43,7 +44,7 @@
placeholder="请输入"
></el-input-number> </el-form-item
></el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('OPCBasicComInfo-PO')"
prop="OPCBasicComInfo-PO"
@ -54,7 +55,7 @@
placeholder="请输入"
></el-input-number> </el-form-item
></el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('OPCBasicComInfo-ProjectId')"
prop="OPCBasicComInfo-ProjectId"
@ -65,7 +66,7 @@
placeholder="请输入"
></el-input> </el-form-item
></el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('OPCBasicComInfo-OperationId')"
prop="OPCBasicComInfo-OperationId"
@ -76,7 +77,27 @@
placeholder="请输入"
></el-input-number> </el-form-item
></el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('OPCBasicComInfo-WorkPlaceNr')"
prop="OPCBasicComInfo-WorkPlaceNr"
>
<el-select
:disabled="isAddOrEdit == 'edit'"
v-model="formData['OPCBasicComInfo-WorkPlaceNr']"
placeholder="请选择"
@change="setStep"
>
<el-option
v-for="item in stationList"
:key="item['WorkPlace-WorkPlaceNr']"
:label="item['WorkPlace-Descr']"
:value="item['WorkPlace-WorkPlaceNr']"
>
</el-option>
</el-select> </el-form-item
></el-col>
<el-col :span="8">
<el-form-item
:label="getColumnName('OPCBasicComInfo-BrandName')"
prop="OPCBasicComInfo-BrandName"
@ -86,7 +107,7 @@
placeholder="请输入"
></el-input> </el-form-item
></el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('OPCBasicComInfo-MachineType')"
prop="OPCBasicComInfo-MachineType"
@ -96,7 +117,7 @@
placeholder="请输入"
></el-input> </el-form-item
></el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('OPCBasicComInfo-IpAddress')"
prop="OPCBasicComInfo-IpAddress"
@ -278,7 +299,7 @@
</el-dialog>
</template>
<script>
import {add, edit, getOperationList, getDetails} from '@/api/plant/processData/basicCommunication'
import {add, edit, getOperationList, getDetails, getStationList} from '@/api/plant/processData/basicCommunication'
export default {
props:{
item:{
@ -295,6 +316,9 @@ export default {
'OPCBasicComInfo-PO': [
{ required: true, message: '请选择', trigger: 'blur' }
],
'OPCBasicComInfo-WorkPlaceNr': [
{ required: true, message: '请选择', trigger: 'blur' }
],
'OPCBasicComInfo-StepNo': [
{ required: true, message: '请选择', trigger: 'change' }
],
@ -332,6 +356,7 @@ export default {
}, // OPCComDetailRule
actionTypeList:[], //
DBlockList:[], //DB
stationList:[], //
}
},
methods:{
@ -431,12 +456,19 @@ export default {
this.formData={...this.item,'OPCBasicComInfo-OPCComRuleLi':[]};
}
})
},
//
getStationList(){
getStationList().then(({data=[]})=>{
this.stationList = data;
})
}
},
created(){
this.getOperationList();
this.getActionTypeList();
this.getDBlockList();
this.getStationList();
if(this.item['OPCBasicComInfo-PO'] && this.item['OPCBasicComInfo-StepNo']){
this.getDetails();
}else{


+ 21
- 1
src/views/plant/processData/basicCommunication/index.vue View File

@ -22,6 +22,11 @@
</el-table-column>
<el-table-column prop="OPCBasicComInfo-OperationId" :label="getColumnName('OPCBasicComInfo-OperationId')">
</el-table-column>
<el-table-column prop="OPCBasicComInfo-WorkPlaceNr" :label="getColumnName('OPCBasicComInfo-WorkPlaceNr')">
<template slot-scope="scope">
{{setStationName(scope.row)}}
</template>
</el-table-column>
<el-table-column prop="OPCBasicComInfo-BrandName" :label="getColumnName('OPCBasicComInfo-BrandName')">
</el-table-column>
<el-table-column prop="OPCBasicComInfo-MachineType" :label="getColumnName('OPCBasicComInfo-MachineType')">
@ -47,7 +52,7 @@
</template>
<script>
import AddOrEdit from './addOrEdit.vue';
import {getTableList, delParser} from '@/api/plant/processData/basicCommunication'
import {getTableList, delParser, getStationList} from '@/api/plant/processData/basicCommunication'
export default {
components:{
AddOrEdit
@ -63,6 +68,7 @@ export default {
tableData:[], // table
isAddOrEdit: '', // add-edit-
item:{}, //
stationList:[], //
}
},
methods:{
@ -116,8 +122,22 @@ export default {
this.queryParams.total=count;
this.tableData=records;
})
},
//
getStationList(){
getStationList().then(({data=[]})=>{
this.stationList = data;
})
},
//
setStationName(item){
const data = this.stationList.find(e=>e['WorkPlace-WorkPlaceNr'] == item['OPCBasicComInfo-WorkPlaceNr']);
return data?data['WorkPlace-Descr'] : item['OPCBasicComInfo-WorkPlaceNr']
}
},
created(){
this.getStationList();
},
mounted(){
this.getTableList();
}


+ 44
- 11
src/views/plant/processData/openProtocol/addOrEdit.vue View File

@ -15,7 +15,7 @@
class="demo-form-inline"
>
<el-row>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('TightenWrenchInfo-PO')"
prop="TightenWrenchInfo-PO"
@ -37,7 +37,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('TightenWrenchInfo-StepNo')"
prop="TightenWrenchInfo-StepNo"
@ -49,7 +49,7 @@
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('TightenWrenchInfo-StepDesc')"
prop="TightenWrenchInfo-StepDesc"
@ -61,7 +61,7 @@
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('TightenWrenchInfo-ProjectId')"
prop="TightenWrenchInfo-ProjectId"
@ -72,7 +72,7 @@
placeholder="请输入"
></el-input> </el-form-item
></el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('TightenWrenchInfo-OperationId')"
prop="TightenWrenchInfo-OperationId"
@ -83,7 +83,27 @@
placeholder="请输入"
></el-input-number> </el-form-item
></el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('TightenWrenchInfo-WorkPlaceNr')"
prop="TightenWrenchInfo-WorkPlaceNr"
>
<el-select
:disabled="isAddOrEdit == 'edit'"
v-model="item['TightenWrenchInfo-WorkPlaceNr']"
placeholder="请选择"
@change="setStep"
>
<el-option
v-for="item in stationList"
:key="item['WorkPlace-WorkPlaceNr']"
:label="item['WorkPlace-Descr']"
:value="item['WorkPlace-WorkPlaceNr']"
>
</el-option>
</el-select> </el-form-item
></el-col>
<el-col :span="8">
<el-form-item
:label="getColumnName('TightenWrenchInfo-BrandName')"
prop="TightenWrenchInfo-BrandName"
@ -94,7 +114,7 @@
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('TightenWrenchInfo-MachineType')"
prop="TightenWrenchInfo-MachineType"
@ -105,7 +125,7 @@
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item
:label="getColumnName('TightenWrenchInfo-IpAddress')"
prop="TightenWrenchInfo-IpAddress"
@ -116,7 +136,8 @@
></el-input>
</el-form-item>
</el-col>
<div v-for="(data, index) in item.tightenWrenchRuleInfoLi" :key="index">
<el-col :span="24">
<div v-for="(data, index) in item.tightenWrenchRuleInfoLi" :key="index">
<el-col :span="5">
<el-form-item
:label="getColumnName('TightenWrenchRuleInfo-RuleId')"
@ -191,6 +212,7 @@
>
</el-col>
</div>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
@ -200,7 +222,7 @@
</el-dialog>
</template>
<script>
import {add, edit, getOperation, getTightenwrenchDetail} from '@/api/plant/processData/openProtocol'
import {add, edit, getOperation, getTightenwrenchDetail, getStationList } from '@/api/plant/processData/openProtocol'
export default {
props:{
item:{
@ -237,7 +259,10 @@ export default {
],
'TightenWrenchInfo-OperationId':[
{ required: true, message: '请输入', trigger: 'change' }
]
],
'TightenWrenchInfo-WorkPlaceNr': [
{ required: true, message: '请选择', trigger: 'blur' }
],
},
defaultItem:{
'ruleId':undefined,
@ -247,6 +272,7 @@ export default {
},
operationList:[], //
mainControlActionList:[], //
stationList:[], //
}
},
methods:{
@ -356,10 +382,17 @@ export default {
}
console.log(this.item);
})
},
//
getStationList(){
getStationList().then(({data=[]})=>{
this.stationList = data;
})
}
},
created(){
this.getOperation();
this.getStationList();
this.getStanderOne({ statid: 'MainControlAction' }).then(({data=[]}) => {
this.mainControlActionList=data
})


+ 21
- 1
src/views/plant/processData/openProtocol/index.vue View File

@ -22,6 +22,11 @@
</el-table-column>
<el-table-column prop="TightenWrenchInfo-OperationId" :label="getColumnName('TightenWrenchInfo-OperationId')">
</el-table-column>
<el-table-column prop="TightenWrenchInfo-WorkPlaceNr" :label="getColumnName('TightenWrenchInfo-WorkPlaceNr')">
<template slot-scope="scope">
{{setStationName(scope.row)}}
</template>
</el-table-column>
<el-table-column prop="TightenWrenchInfo-BrandName" :label="getColumnName('TightenWrenchInfo-BrandName')">
</el-table-column>
<el-table-column prop="TightenWrenchInfo-MachineType" :label="getColumnName('TightenWrenchInfo-MachineType')">
@ -47,7 +52,7 @@
</template>
<script>
import AddOrEdit from './addOrEdit.vue';
import {getTableList, delParser} from '@/api/plant/processData/openProtocol'
import {getTableList, delParser, getStationList} from '@/api/plant/processData/openProtocol'
export default {
components:{
AddOrEdit
@ -63,6 +68,7 @@ export default {
tableData:[], // table
isAddOrEdit: '', // add-edit-
item:{}, //
stationList:[], //
}
},
methods:{
@ -115,8 +121,22 @@ export default {
this.queryParams.total=count;
this.tableData=records;
})
},
//
getStationList(){
getStationList().then(({data=[]})=>{
this.stationList = data;
})
},
//
setStationName(item){
const data = this.stationList.find(e=>e['WorkPlace-WorkPlaceNr'] == item['TightenWrenchInfo-WorkPlaceNr']);
return data?data['WorkPlace-Descr'] : item['TightenWrenchInfo-WorkPlaceNr']
}
},
created(){
this.getStationList();
},
mounted(){
this.getTableList();
}


Loading…
Cancel
Save