Browse Source

工艺配置数据依赖

langfang_wms
liwei 3 years ago
parent
commit
d422d0ee3f
7 changed files with 465 additions and 8 deletions
  1. +19
    -1
      src/api/plant/operationDefinition.js
  2. +18
    -0
      src/api/plant/processData/technology.js
  3. +1
    -1
      src/views/plant/processData/technology/addOrEdit.vue
  4. +12
    -3
      src/views/plant/processData/technology/index.vue
  5. +188
    -0
      src/views/plant/processData/technology/scanRule.vue
  6. +205
    -0
      src/views/plant/resource/operationDefinition/dataDependency.vue
  7. +22
    -3
      src/views/plant/resource/operationDefinition/index.vue

+ 19
- 1
src/api/plant/operationDefinition.js View File

@ -61,4 +61,22 @@ export function processworkplacelstQuery(params){
method: 'get',
params
})
}
}
// 配置数据依赖
export function postProcessdependon (data) {
return request({
url: '/admin/base/processdependon/insert',
method: 'post',
data
})
}
// 获取已配置数据依赖
export function getProcessdependonDetals(params){
return request({
url: '/admin/base/processdependon/query',
method: 'get',
params
})
}

+ 18
- 0
src/api/plant/processData/technology.js View File

@ -71,4 +71,22 @@ export function getProjectList (params) {
method: 'get',
params
})
}
// 配置工艺扫码规则
export function postScanruleinfo (data) {
return request({
url: '/admin/base/scanruleinfo/insert',
method: 'post',
data
})
}
// 获取已配置扫码规则
export function getScanruleDetails (params) {
return request({
url: '/admin/base/scanruleinfo/query',
method: 'get',
params
})
}

+ 1
- 1
src/views/plant/processData/technology/addOrEdit.vue View File

@ -3,7 +3,7 @@
:title="isAddOrEdit == 'edit' ? '编辑' : '新增'"
visible
width="80%"
v-loading="loading"
v-loading="loading"
:before-close="handleClose"
>
<el-form


+ 12
- 3
src/views/plant/processData/technology/index.vue View File

@ -28,9 +28,10 @@
</el-table-column>
<el-table-column prop="Operation-AttrValue" :label="getColumnName('Operation-AttrValue')">
</el-table-column>
<el-table-column label="操作" width="150" align="center">
<el-table-column label="操作" width="220" align="center">
<template slot-scope="scope">
<el-button size="mini" @click="setItem(scope.row)">编辑</el-button>
<el-button size="mini" @click="setScanRule(scope.row)">配置</el-button>
<el-button size="mini" type="danger" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
@ -42,15 +43,18 @@
:limit.sync="queryParams.pageSize"
@pagination="getTableList"
/>
<AddOrEdit v-if="isAddOrEdit" :isAddOrEdit="isAddOrEdit" :item="item" @setIsAddOrEdit="setIsAddOrEdit" />
<AddOrEdit v-if="isAddOrEdit && isAddOrEdit != 'scanRule'" :isAddOrEdit="isAddOrEdit" :item="item" @setIsAddOrEdit="setIsAddOrEdit" />
<ScanRule v-if="isAddOrEdit=='scanRule'" :isAddOrEdit="isAddOrEdit" :item="item" @setIsAddOrEdit="setIsAddOrEdit" />
</div>
</template>
<script>
import AddOrEdit from './addOrEdit.vue';
import ScanRule from './scanRule.vue';
import {getTableList, delParser} from '@/api/plant/processData/technology'
export default {
components:{
AddOrEdit
AddOrEdit,
ScanRule
},
data(){
return{
@ -79,6 +83,11 @@ export default {
this.item=item;
this.setIsAddOrEdit('edit');
},
//
setScanRule(item){
this.item=item;
this.setIsAddOrEdit('scanRule');
},
//
handleDelete(item){
this.$confirm('是否确认删除当前数据项?', '警告', {


+ 188
- 0
src/views/plant/processData/technology/scanRule.vue View File

@ -0,0 +1,188 @@
<template>
<el-dialog
title="配置扫码规则"
visible
width="80%"
v-loading="loading"
:before-close="handleClose"
>
<el-form
:inline="true"
label-width="150px"
:rules="rules"
ref="formRef"
:model="formData"
class="demo-form-inline"
>
<el-row>
<el-col :span="6">
<el-form-item
:label="getColumnName('ScanRuleInfo-RuleType')"
prop="ScanRuleInfo-RuleType"
>
<el-select
v-model="formData['ScanRuleInfo-RuleType']"
placeholder="请选择"
>
<el-option
v-for="item in ruleTypeList"
:key="item['stdeftab-stdeftyp']"
:label="item['stdeftab-bez']"
:value="item['stdeftab-stdeftyp']"
/>
</el-select> </el-form-item
></el-col>
<el-col :span="6">
<el-form-item
:label="getColumnName('ScanRuleInfo-SRCtrlPara1')"
prop="ScanRuleInfo-SRCtrlPara1"
>
<el-input v-model="formData['ScanRuleInfo-SRCtrlPara1']" />
</el-form-item
></el-col>
<el-col :span="6">
<el-form-item
:label="getColumnName('ScanRuleInfo-SRCtrlPara2')"
prop="ScanRuleInfo-SRCtrlPara2"
>
<el-input v-model="formData['ScanRuleInfo-SRCtrlPara2']" />
</el-form-item
></el-col>
<el-col :span="6">
<el-form-item
:label="getColumnName('ScanRuleInfo-SRCtrlPara3')"
prop="ScanRuleInfo-SRCtrlPara3"
>
<el-input v-model="formData['ScanRuleInfo-SRCtrlPara3']" />
</el-form-item
></el-col>
<el-col :span="6">
<el-form-item
:label="getColumnName('ScanRuleInfo-SRCtrlPara4')"
prop="ScanRuleInfo-SRCtrlPara4"
>
<el-input v-model="formData['ScanRuleInfo-SRCtrlPara4']" />
</el-form-item
></el-col>
<el-col :span="6">
<el-form-item
:label="getColumnName('ScanRuleInfo-SRCtrlPara5')"
prop="ScanRuleInfo-SRCtrlPara5"
>
<el-input v-model="formData['ScanRuleInfo-SRCtrlPara5']" />
</el-form-item
></el-col>
<el-col :span="6">
<el-form-item
:label="getColumnName('ScanRuleInfo-SRCtrlPara6')"
prop="ScanRuleInfo-SRCtrlPara6"
>
<el-input-number v-model="formData['ScanRuleInfo-SRCtrlPara6']" />
</el-form-item
></el-col>
<el-col :span="6">
<el-form-item
:label="getColumnName('ScanRuleInfo-SRCtrlPara7')"
prop="ScanRuleInfo-SRCtrlPara7"
>
<el-input-number v-model="formData['ScanRuleInfo-SRCtrlPara7']" />
</el-form-item
></el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="postScanruleinfo"> </el-button>
</span>
</el-dialog>
</template>
<script>
import {postScanruleinfo, getScanruleDetails } from '@/api/plant/processData/technology'
export default {
props:{
item:{
default:{}
},
isAddOrEdit:{
default:'add'
}
},
data(){
return{
formData:{},
rules:{
'ScanRuleInfo-RuleType': [
{ required: true, message: '请选择', trigger: 'blur' }
],
},
defaultItem:{
"ScanRuleInfo-RuleType": undefined,
"ScanRuleInfo-SRCtrlPara1": undefined,
"ScanRuleInfo-SRCtrlPara2": undefined,
"ScanRuleInfo-SRCtrlPara3": undefined,
"ScanRuleInfo-SRCtrlPara4": undefined,
"ScanRuleInfo-SRCtrlPara5": undefined,
"ScanRuleInfo-SRCtrlPara6": undefined,
"ScanRuleInfo-SRCtrlPara7": undefined
}, //
loading:false,
ruleTypeList:[], // RuleType
}
},
methods:{
//
handleClose(){
this.$emit('setIsAddOrEdit', '')
},
// RuleType
getRuleType(){
this.getStanderOne({ statid: 'ScanRuleInfo-RuleType' }).then(({data=[]}) => {
this.ruleTypeList=data;
})
},
//
postScanruleinfo(){
this.$refs['formRef'].validate((valid) => {
if (valid) {
this.loading=true;
postScanruleinfo({
operationId:this.item['Operation-OperationId'],
scanRuleInfoLi: [this.formData]
}).then(()=>{
this.loading=false;
this.msgSuccess('配置成功');
this.handleClose();
}).catch(()=>{
this.loading=false;
})
} else {
console.log('error submit!!');
return false;
}
});
},
//
getScanruleDetails(){
getScanruleDetails({
operationId: this.item['Operation-OperationId']
}).then(({data=[]})=>{
if(data.length){
this.formData=data[0];
}
}).catch(()=>{
})
}
},
created(){
this.getRuleType();
},
mounted(){
this.getScanruleDetails();
}
}
</script>

+ 205
- 0
src/views/plant/resource/operationDefinition/dataDependency.vue View File

@ -0,0 +1,205 @@
<template>
<el-dialog
title="配置扫码规则"
visible
width="80%"
v-loading="loading"
:before-close="handleClose"
>
<el-table
:data="tableData"
style="width: 100%"
>
<el-table-column
:label="getColumnName('ProcessDependOn-DependOnField')"
prop="ProcessDependOn-DependOnField"
>
<template slot-scope="scope">
<el-input
style="width: 100%"
v-model="scope.row['ProcessDependOn-DependOnField']"
/>
</template>
</el-table-column>
<el-table-column
:label="getColumnName('ProcessDependOn-DependOnValue1')"
prop="ProcessDependOn-DependOnValue1"
>
<template slot-scope="scope">
<el-input-number
style="width: 100%"
v-model="scope.row['ProcessDependOn-DependOnValue1']"
/>
</template>
</el-table-column>
<el-table-column
:label="getColumnName('ProcessDependOn-DependOnValue2')"
prop="ProcessDependOn-DependOnValue2"
>
<template slot-scope="scope">
<el-input
style="width: 100%"
v-model="scope.row['ProcessDependOn-DependOnValue2']"
/>
</template>
</el-table-column>
<el-table-column
:label="getColumnName('ProcessDependOn-CtrlPara1')"
prop="ProcessDependOn-CtrlPara1"
>
<template slot-scope="scope">
<el-input
style="width: 100%"
v-model="scope.row['ProcessDependOn-CtrlPara1']"
/>
</template>
</el-table-column>
<el-table-column
:label="getColumnName('ProcessDependOn-CtrlPara2')"
prop="ProcessDependOn-CtrlPara2"
>
<template slot-scope="scope">
<el-input
style="width: 100%"
v-model="scope.row['ProcessDependOn-CtrlPara2']"
/>
</template>
</el-table-column>
<el-table-column
:label="getColumnName('ProcessDependOn-CtrlPara3')"
prop="ProcessDependOn-CtrlPara3"
>
<template slot-scope="scope">
<el-input
style="width: 100%"
v-model="scope.row['ProcessDependOn-CtrlPara3']"
/>
</template>
</el-table-column>
<el-table-column
:label="getColumnName('ProcessDependOn-CtrlPara4')"
prop="ProcessDependOn-CtrlPara4"
>
<template slot-scope="scope">
<el-input
style="width: 100%"
v-model="scope.row['ProcessDependOn-CtrlPara4']"
/>
</template>
</el-table-column>
<el-table-column
:label="getColumnName('ProcessDependOn-CtrlPara5')"
prop="ProcessDependOn-CtrlPara5"
>
<template slot-scope="scope">
<el-input-number
style="width: 100%"
v-model="scope.row['ProcessDependOn-CtrlPara5']"
/>
</template>
</el-table-column>
<el-table-column
:label="getColumnName('ProcessDependOn-CtrlPara6')"
prop="ProcessDependOn-CtrlPara6"
>
<template slot-scope="scope">
<el-input-number
style="width: 100%"
v-model="scope.row['ProcessDependOn-CtrlPara6']"
/>
</template>
</el-table-column>
<el-table-column align="right" width="80">
<template slot="header">
<el-button type="success" @click="addList">新增</el-button>
</template>
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
@click="deleteList(scope.$index)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="postProcessdependon"> </el-button>
</span>
</el-dialog>
</template>
<script>
import {postProcessdependon, getProcessdependonDetals } from '@/api/plant/operationDefinition'
export default {
props:{
item:{
default:{}
},
isAddOrEdit:{
default:'add'
}
},
data(){
return{
rules:{},
defaultItem:{
"ProcessDependOn-DependOnField": undefined,
"ProcessDependOn-DependOnValue1": undefined,
"ProcessDependOn-DependOnValue2": undefined,
"ProcessDependOn-CtrlPara1": undefined,
"ProcessDependOn-CtrlPara2": undefined,
"ProcessDependOn-CtrlPara3": undefined,
"ProcessDependOn-CtrlPara4": undefined,
"ProcessDependOn-CtrlPara5": undefined,
"ProcessDependOn-CtrlPara6": undefined,
}, //
loading:false,
tableData:[], //
}
},
methods:{
//
addList(){
this.tableData.push({...this.defaultItem})
},
//
deleteList(index){
this.tableData.splice(index, 1);
},
//
handleClose(){
this.$emit('setIsDataDependency', '')
},
//
postProcessdependon(){
this.loading=true;
postProcessdependon({
"po": this.item['Process-PO'],
"workLineId": this.item['Process-WorkLineId'],
processDependOnLi: this.tableData
}).then(()=>{
this.msgSuccess('配置成功');
this.loading=false;
this.handleClose();
}).catch(()=>{
this.loading=false;
})
},
//
getProcessdependonDetals(){
getProcessdependonDetals({
"po": this.item['Process-PO'],
"workLineId": this.item['Process-WorkLineId']
}).then(({data=[]})=>{
this.tableData=data;
})
}
},
created(){
this.getProcessdependonDetals();
}
}
</script>

+ 22
- 3
src/views/plant/resource/operationDefinition/index.vue View File

@ -85,11 +85,14 @@
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="220" align="center">
<el-table-column label="操作" width="340" align="center">
<template slot-scope="scope">
<el-button size="mini" @click="setItem(scope.row)">编辑</el-button>
<el-button size="mini" @click="setIsAssociatedStation(scope.row)"
>配置</el-button
>关联工位</el-button
>
<el-button size="mini" @click="setIsDataDependency(scope.row)"
>数据依赖</el-button
>
<el-button size="mini" type="danger" @click="handleDelete(scope.row)"
>删除</el-button
@ -115,16 +118,23 @@
:item="item"
@setIsAssociatedStation="setIsAssociatedStation"
/>
<DataDependency
v-if="isDataDependency"
:item="item"
@setIsDataDependency="setIsDataDependency"
/>
</div>
</template>
<script>
import AddOrEdit from './addOrEdit.vue';
import DataDependency from './dataDependency.vue';
import AssociatedStation from './associatedStation.vue';
import {getTableList, delParser} from '@/api/plant/operationDefinition'
export default {
components:{
AddOrEdit,
AssociatedStation
AssociatedStation,
DataDependency
},
data(){
return{
@ -139,6 +149,7 @@ export default {
isAddOrEdit: '', // add-edit-
item:{}, //
isAssociatedStation:false, //
isDataDependency: false, //
}
},
methods:{
@ -203,6 +214,14 @@ export default {
if(!this.isAssociatedStation){
this.getTableList();
}
},
//
setIsDataDependency(item){
this.item=item;
this.isDataDependency=!this.isDataDependency
if(!this.isDataDependency){
this.getTableList();
}
}
},
mounted(){


Loading…
Cancel
Save