Browse Source

Merge branch 'langfang-develop' of http://101.201.121.115:3000/leo/LAPP_GAAS_GFrame_WEBFRONT into langfang-test

langfang-test
liwei 3 years ago
parent
commit
bb7c313be4
3 changed files with 283 additions and 4 deletions
  1. +18
    -0
      src/api/plant/processData/technology.js
  2. +242
    -0
      src/views/plant/processData/technology/documentPrinting.vue
  3. +23
    -4
      src/views/plant/processData/technology/index.vue

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

@ -115,4 +115,22 @@ export function getGuideruleDetails (params) {
method: 'get',
params
})
}
// 配置单据打印
export function postPrintbasicruleinfo(data){
return request({
url:`/admin/base/printbasicruleinfo/save`,
method: 'post',
data
})
}
// 获取已配置单据打印
export function getWhetherCheckDetails(params){
return request({
url:`/admin/base/printbasicruleinfo/query`,
method: 'get',
params
})
}

+ 242
- 0
src/views/plant/processData/technology/documentPrinting.vue View File

@ -0,0 +1,242 @@
<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.map(e=>{
e['stdeftab-stdeftyp']=Number(e['stdeftab-stdeftyp']);
return e;
});
})
},
//
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>

+ 23
- 4
src/views/plant/processData/technology/index.vue View File

@ -137,23 +137,29 @@
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="400" align="center" fixed="right">
<el-table-column label="操作" width="270" align="right" fixed="right">
<template slot-scope="scope">
<el-button size="mini" @click="setItem(scope.row)">编辑</el-button>
<!-- <el-button size="mini" v-if="scope.row['Operation-StepType'] == 'OPC通讯'" @click="setOPCCommunication(scope.row)">配置OPC通讯</el-button> -->
<!-- <el-button size="mini" v-if="scope.row['Operation-StepType'] == '开放协议'" @click="setOpenProtocol(scope.row)">配置开放协议</el-button> -->
<el-button
size="mini"
:disabled="scope.row['Operation-StepType'] != '指导操作'"
v-if="scope.row['Operation-StepType'] == '指导操作'"
@click="setOperationGuide(scope.row)"
>配置操作指导</el-button
>
<el-button
size="mini"
:disabled="scope.row['Operation-StepType'] != '扫码校验'"
v-else-if="scope.row['Operation-StepType'] == '扫码校验'"
@click="setScanRule(scope.row)"
>配置扫码规则</el-button
>
<el-button
size="mini"
v-else-if="scope.row['Operation-StepType'] == '单据打印'"
@click="setDocumentPrinting(scope.row)"
>配置打印规则</el-button
>
<el-button size="mini" type="danger" @click="handleDelete(scope.row)"
>删除</el-button
>
@ -197,6 +203,12 @@
:item="item"
@setIsAddOrEdit="setIsAddOrEdit"
/>
<DocumentPrinting
v-if="isAddOrEdit == 'documentPrinting'"
:isAddOrEdit="isAddOrEdit"
:item="item"
@setIsAddOrEdit="setIsAddOrEdit"
/>
</div>
</template>
<script>
@ -205,6 +217,7 @@ import ScanRule from './scanRule.vue';
import OperationGuide from './operationGuide.vue';
import OPCCommunication from './OPCCommunication.vue';
import OpenProtocol from './openProtocol.vue';
import DocumentPrinting from './documentPrinting.vue'
import {getTableList, delParser, getAttribute, getWorkLineList, getAttributeValue, getProjectList} from '@/api/plant/processData/technology'
export default {
components:{
@ -212,7 +225,8 @@ export default {
ScanRule,
OperationGuide,
OPCCommunication,
OpenProtocol
OpenProtocol,
DocumentPrinting
},
data(){
return{
@ -275,6 +289,11 @@ export default {
this.item=item;
this.setIsAddOrEdit('openProtocol');
},
//
setDocumentPrinting(item){
this.item=item;
this.setIsAddOrEdit('documentPrinting');
},
//
handleDelete(item){
this.$confirm('是否确认删除当前数据项?', '警告', {


Loading…
Cancel
Save