Commit f4d03b81 by liuxin

BusNavbar修改

parent 76ea812e
<template>
<div class="busnavbar">
<div class="busnavbar-items">
<c-button style="margin-left:7px;" size="medium" type="primary" class="medium_bcs" 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>
<c-button style="margin-left:7px;" size="medium" type="primary" class="medium_bcs" v-for="(item,index) in codeList" v-bind:key="index" @click.native="onNarBtnClick(item.code,item.index)" :title="item.title" :disabled="item.isDis==='N'">{{item.label}}</c-button>
</div>
</div>
</template>
......@@ -31,8 +31,8 @@ export default {
//各入口按钮请求
async onNarBtnClick(code,i){
this.model.cfgfil.subtrn1= code
let rtnmsg = await this.executeRule("cfgfil.hotsub1")
console.log("cfgfil.code:" + this.model.cfgfil.subtrn1);
let rtnmsg = await this.executeRule(`cfgfil.hotsub${i}`)
// console.log("cfgfil.code:" + this.model.cfgfil.subtrn1);
if(rtnmsg.respCode == SUCCESS){
this.navcode = []
this.$emit("onChoose",code.toLowerCase());
......@@ -41,6 +41,15 @@ export default {
}
},
getIndex(module){
for(let i = 1; i <= 12; i++){
var temp = this.model.cfgfil[`subtxt${i}`];
if(module == temp){
return i;
}
}
return 0;
}
},
computed:{
......@@ -48,7 +57,7 @@ export default {
//将model中的数据映射成数组
return this.navcode.map(item=>{
let entireItem = {...item}
this.navcode = [];
// this.navcode = [];
//TODO 根据数据判断当前的code,是否可以继续
// entireItem.enable = item.isDis
return entireItem
......@@ -83,29 +92,41 @@ export default {
//this.model.didgrp.rec.inr = rtnmsg.data.didgrp_rec_inr
const length = this.model.cfgfil.btnstm.rows.length
let btnStr = this.model.cfgfil.btnstm.rows
let j = 0;
let m = 0;
// let j = 0;
// let m = 0;
// const buttonIndex = ['保证金收取','保证金注销','保证金调整','开立信用证','信用证修改','减额修改接受','修改通知行','到单']
const buttonIndex = ['信用证修改','减额修改接受','到单','修改通知行']
for(let i=0; i < length; i++){
// const buttonIndex = ['信用证修改','减额修改接受','到单','修改通知行']
// for(let i=0; i < length; i++){
//获取数组中每行的数据
if(!( btnStr[i].indexOf("保证金") >= 0) && !(btnStr[i].indexOf("开立信用证") >= 0)){
// if(!( btnStr[i].indexOf("保证金") >= 0) && !(btnStr[i].indexOf("开立信用证") >= 0)){
// let arr = btnStr[i].split("\t");
// let newList = {
// code:arr[0],
// label:arr[1],
// isDis:arr[2],
// title:arr[3]
// }
// m++;
// j = buttonIndex.indexOf(arr[1].replace(/(^\s*)|(\s*$)/g, ""));
// if(j<0){
// j = m;
// }
//添加到navcode数组中
// this.navcode.splice(j,0,newList)
// }
// }
for(let i=0; i < length; i++){
let arr = btnStr[i].split("\t");
var index = this.getIndex(arr[1])
let newList = {
code:arr[0],
label:arr[1],
isDis:arr[2],
title:arr[3]
}
m++;
j = buttonIndex.indexOf(arr[1].replace(/(^\s*)|(\s*$)/g, ""));
if(j<0){
j = m;
title:arr[3],
index:index
}
//添加到navcode数组中
this.navcode.splice(j,0,newList)
}
this.navcode.push(newList)
}
......
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