|
|
@ -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> |