|
|
@ -0,0 +1,239 @@ |
|
|
|
<template> |
|
|
|
<el-dialog |
|
|
|
title="配置单据打印规则" |
|
|
|
visible |
|
|
|
width="80%" |
|
|
|
:before-close="handleClose" |
|
|
|
v-loading="loading" |
|
|
|
:close-on-click-modal="false" |
|
|
|
> |
|
|
|
<el-table :data="tableData" style="width: 100%"> |
|
|
|
<el-table-column |
|
|
|
:label="getColumnName('PrintBasicRuleInfo-MainCodeName')" |
|
|
|
prop="PrintBasicRuleInfo-MainCodeName" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
style="width: 100%" |
|
|
|
:min="0" |
|
|
|
v-model="scope.row['PrintBasicRuleInfo-MainCodeName']" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
:label="getColumnName('PrintBasicRuleInfo-TemplateFile')" |
|
|
|
prop="PrintBasicRuleInfo-TemplateFile" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
style="width: 100%" |
|
|
|
v-model="scope.row['PrintBasicRuleInfo-TemplateFile']" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
:label="getColumnName('PrintBasicRuleInfo-TemplateChooseModel')" |
|
|
|
prop="PrintBasicRuleInfo-TemplateChooseModel" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
style="width: 100%" |
|
|
|
v-model="scope.row['PrintBasicRuleInfo-TemplateChooseModel']" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
:label="getColumnName('PrintBasicRuleInfo-DependPO')" |
|
|
|
prop="PrintBasicRuleInfo-DependPO" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input-number |
|
|
|
style="width: 100%" |
|
|
|
v-model="scope.row['PrintBasicRuleInfo-DependPO']" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
:label="getColumnName('PrintBasicRuleInfo-DependStepNo')" |
|
|
|
prop="PrintBasicRuleInfo-DependStepNo" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input-number |
|
|
|
style="width: 100%" |
|
|
|
v-model="scope.row['PrintBasicRuleInfo-DependStepNo']" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
:label="getColumnName('PrintBasicRuleInfo-DependRuleId')" |
|
|
|
prop="PrintBasicRuleInfo-DependRuleId" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input-number |
|
|
|
style="width: 100%" |
|
|
|
v-model="scope.row['PrintBasicRuleInfo-DependRuleId']" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
:label="getColumnName('PrintBasicRuleInfo-DependValue')" |
|
|
|
prop="PrintBasicRuleInfo-DependValue" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
style="width: 100%" |
|
|
|
v-model="scope.row['PrintBasicRuleInfo-DependValue']" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
:label="getColumnName('PrintBasicRuleInfo-Action')" |
|
|
|
prop="PrintBasicRuleInfo-Action" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
style="width: 100%" |
|
|
|
v-model="scope.row['PrintBasicRuleInfo-Action']" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column |
|
|
|
:label="getColumnName('PrintBasicRuleInfo-WhetherCheckContent')" |
|
|
|
prop="PrintBasicRuleInfo-WhetherCheckContent" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select |
|
|
|
v-model="scope.row['PrintBasicRuleInfo-WhetherCheckContent']" |
|
|
|
style="width: 100%" |
|
|
|
placeholder="请选择" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in whetherCheckList" |
|
|
|
:key="item['stdeftab-stdeftyp']" |
|
|
|
:label="item['stdeftab-bez']" |
|
|
|
:value="item['stdeftab-stdeftyp']" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column align="right" width="150"> |
|
|
|
<template slot="header"> |
|
|
|
<el-button type="success" @click="addTableData">新增</el-button> |
|
|
|
</template> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
size="mini" |
|
|
|
type="danger" |
|
|
|
@click="deleteOPCComRule(scope.$index, scope.row)" |
|
|
|
>删除</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="submitForm">确 定</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import {postPrintbasicruleinfo, getWhetherCheckDetails} from '@/api/plant/processData/technology' |
|
|
|
export default { |
|
|
|
props:{ |
|
|
|
item:{ |
|
|
|
default:{} |
|
|
|
}, |
|
|
|
isAddOrEdit:{ |
|
|
|
default:'documentPrinting' |
|
|
|
}, |
|
|
|
}, |
|
|
|
data(){ |
|
|
|
return{ |
|
|
|
loading:false, |
|
|
|
rules: {}, |
|
|
|
defaultItem:{ |
|
|
|
'PrintBasicRuleInfo-MainCodeName': undefined, |
|
|
|
'PrintBasicRuleInfo-TemplateFile': undefined, |
|
|
|
'PrintBasicRuleInfo-TemplateChooseModel': undefined, |
|
|
|
'PrintBasicRuleInfo-DependPO': undefined, |
|
|
|
'PrintBasicRuleInfo-DependStepNo': undefined, |
|
|
|
'PrintBasicRuleInfo-DependRuleId': undefined, |
|
|
|
'PrintBasicRuleInfo-DependValue': undefined, |
|
|
|
'PrintBasicRuleInfo-Action': undefined, |
|
|
|
'PrintBasicRuleInfo-WhetherCheckContent':undefined, |
|
|
|
}, |
|
|
|
tableData:[], |
|
|
|
whetherCheckList:[], |
|
|
|
} |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
// 关闭界面 |
|
|
|
handleClose(){ |
|
|
|
this.$emit('setIsAddOrEdit', '') |
|
|
|
}, |
|
|
|
// 提交表单 |
|
|
|
submitForm() { |
|
|
|
this.add(); |
|
|
|
}, |
|
|
|
// 添加 |
|
|
|
add(){ |
|
|
|
this.loading=true; |
|
|
|
postPrintbasicruleinfo({ |
|
|
|
operationId: this.item['Operation-OperationId'], |
|
|
|
printBaseRuleInfoLi:this.tableData |
|
|
|
}).then(({code, data})=>{ |
|
|
|
this.loading=false; |
|
|
|
if(code==200){ |
|
|
|
this.msgSuccess('添加成功'); |
|
|
|
this.handleClose(); |
|
|
|
} |
|
|
|
}).catch(()=>{ |
|
|
|
this.loading=false; |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 添加列表 |
|
|
|
addTableData(){ |
|
|
|
this.tableData.push(JSON.parse(JSON.stringify(this.defaultItem))); |
|
|
|
}, |
|
|
|
// 删除 |
|
|
|
deleteOPCComRule(index){ |
|
|
|
this.tableData.splice(index, 1) |
|
|
|
}, |
|
|
|
// 获取标准定义 |
|
|
|
getWhetherCheckList(){ |
|
|
|
this.getStanderOne({ statid: 'WhetherCheckContent' }).then(({data=[]}) => { |
|
|
|
this.whetherCheckList=data; |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取详情 |
|
|
|
getWhetherCheckDetails(){ |
|
|
|
getWhetherCheckDetails({operationid:this.item['Operation-OperationId']}).then(({code, data})=>{ |
|
|
|
if(code==200 && data){ |
|
|
|
this.tableData=data; |
|
|
|
}else{ |
|
|
|
this.tableData=[JSON.parse(JSON.stringify(this.defaultItem))]; |
|
|
|
} |
|
|
|
}).catch(()=>{ |
|
|
|
this.tableData=[JSON.parse(JSON.stringify(this.defaultItem))]; |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
created(){ |
|
|
|
this.getWhetherCheckList(); |
|
|
|
|
|
|
|
}, |
|
|
|
mounted(){ |
|
|
|
this.getWhetherCheckDetails(); |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |