Commit 445ff42e by 吴佳

2021.12.23 wujia update infdid busnavbar

parent ade9ea2b
<template>
<div class="busnavbar">
<div class="busnavbar-items">
<c-button v-for="(item,index) in codeList" v-bind:key="index" @click.native="onNarBtnClick(item.code,index)" :title="item.title" :disabled="item.isDis==='N'">{{item.label}}</c-button>
</div>
</div>
</template>
<script>
import Api from "~/service/Api"
import CodeTable from "~/config/CodeTable"
import Litsel from "~/model/Ditsel"
import CommonProcess from "~/mixin/CommonProcess"
export default {
props:["ownref"],
components:{
},
mixins: [CommonProcess], // 里面包含了Default、Check等的公共处理
data(){
return {
trnName:'ditsel',
model:new Litsel().data,
navcode:[
{code:"",label:"",isDis:"",title:""},
],
}
},
methods:{
//各入口按钮请求
async onNarBtnClick(code,i){
this.model.cfgfil.subtrn1= code
let rtnmsg = await this.executeRule("cfgfil.hotsub1")
console.log("cfgfil.code:" + this.model.cfgfil.subtrn1);
if(rtnmsg.respCode = SUCCESS){
this.$emit("onChoose",code.toLowerCase());
}else{
}
},
},
computed:{
codeList(){
//将model中的数据映射成数组
return this.navcode.map(item=>{
let entireItem = {...item}
//TODO 根据数据判断当前的code,是否可以继续
// entireItem.enable = item.isDis
return entireItem
})
}
},
watch:{
"ownref":async function(n, o){
if(!this.ownref){
console.log("11111")
// onTigger()
return;
}
}
},
mounted(){
this.$nextTick(function(){
this.$on('childmethods',async function(){
//请求按钮数据
this.model.didgrp.rec.ownref = this.ownref
console.log("ownref:" + this.ownref );
let rtnmsg = await this.executeRule("didgrp.rec.ownref")//didgrp_rec_ownref
if(rtnmsg.respCode = SUCCESS){
//重置数组
this.navcode.length = 0
this.model.cfgfil.btnstm = rtnmsg.data.cfgfil_btnstm.rows
//给inr赋值,后面弹窗里面的按钮请求会用到
this.model.didgrp.rec.inr = rtnmsg.data.didgrp_rec_inr
const idx = this.model.cfgfil.btnstm.length
let btnStr = this.model.cfgfil.btnstm
// console.log("btnstmStr:"+btnStr);
for(let i=0; i < idx; i++){
//获取数组中每行的数据
let arr = btnStr[i].split("\t");
let newList = {
code:arr[0],
label:arr[1],
isDis:arr[2],
title:arr[3]
}
//添加到navcode数组中
this.navcode.splice(i,0,newList)
}
}
})
})
}
}
</script>
<style>
.busnavbar-items{
/*TODO完善按钮间隔等样式 */
}
</style>
...@@ -298,7 +298,7 @@ ...@@ -298,7 +298,7 @@
label="操作" label="操作"
width="150px" width="150px"
> >
<template> <template slot-scope="scope">
<c-button <c-button
style="margin-left: 0" style="margin-left: 0"
...@@ -312,7 +312,7 @@ ...@@ -312,7 +312,7 @@
style="margin-left: 0" style="margin-left: 0"
size="small" size="small"
type="primary" type="primary"
@click="getButtons(scope.row['Reference'])"
> >
处理 处理
</c-button> </c-button>
...@@ -325,6 +325,12 @@ ...@@ -325,6 +325,12 @@
</c-col> </c-col>
</el-row> </el-row>
<el-dialog :visible.sync="initdialog" :title="'交易列表'" append-to-body>
<div class="m-list-btns">
<m-busbtn ref="childs" :ownref="ownref" @onChoose="onChoose" >11</m-busbtn>
</div>
</el-dialog>
<!-- <c-col :span="12"> <!-- <c-col :span="12">
<el-form-item label="Own Reference" prop="infcon.seaownref"> <el-form-item label="Own Reference" prop="infcon.seaownref">
<c-input v-model="model.infcon.seaownref" maxlength="16" placeholder="请输入Own Reference"></c-input> <c-input v-model="model.infcon.seaownref" maxlength="16" placeholder="请输入Own Reference"></c-input>
...@@ -516,13 +522,17 @@ import Api from "~/service/Api"; ...@@ -516,13 +522,17 @@ import Api from "~/service/Api";
import CommonProcess from "~/mixin/CommonProcess"; import CommonProcess from "~/mixin/CommonProcess";
import CodeTable from "~/config/CodeTable"; import CodeTable from "~/config/CodeTable";
import Event from "~/model/Infdid/Event"; import Event from "~/model/Infdid/Event";
import BusNavbar from "~/views/Business/Infdid/BusNavbar"
export default { export default {
inject: ["root"], inject: ["root"],
props: ["model", "codes"], props: ["model", "codes"],
mixins: [CommonProcess], mixins: [CommonProcess],
components:{'m-busbtn':BusNavbar},
data() { data() {
return { return {
ownref:"",
initdialog:false,
stmData: { stmData: {
columns: [ columns: [
'1 1 "Reference" 100', '1 1 "Reference" 100',
...@@ -545,7 +555,20 @@ export default { ...@@ -545,7 +555,20 @@ export default {
}, },
}; };
}, },
methods: { ...Event }, methods: { ...Event,
async getButtons(ownref){
this.initdialog = true
this.ownref = ownref
console.log("ownref:" +ownref);
setTimeout(()=>{
this.$refs.childs.$emit("childmethods")
},10)
},
async onChoose(code){
//跳转交易
this.$router.history.push("/business/" + code)
this.initdialog = false
} },
created: function () {}, created: function () {},
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment