Commit fea76448 authored by tyn's avatar tyn

merge

parent 6ecde536
...@@ -3,11 +3,13 @@ ...@@ -3,11 +3,13 @@
<!-- tab列表 --> <!-- tab列表 -->
<div class="dsk-tab-items-container"> <div class="dsk-tab-items-container">
<div class="dsk-tab-items-container-inner"> <div class="dsk-tab-items-container-inner">
<div class="dsk-tab-item" v-for="item of tabs" :key="item.id" :class="{'tab-current' : item.value == currentValue}"> <div class="dsk-tab-item" v-for="item of tabs" :key="item.id"
<div class="dsk-tab-item-name" @click="tabChoose(item)">{{item.name}}</div> :class="{'tab-current' : item.value == currentValue,'tab-is-disabled' : item.disabled || comDisabled}">
<div class="dsk-tab-item-name" @click="item.disabled || comDisabled ? '' : tabChoose(item)">{{item.name}}</div>
</div> </div>
<!-- 下滑条 --> <!-- 下滑条 -->
<div class="dsk-tab-sliding-bar" v-if="tabs.length" :style="{width : `${silidingBarWidth}px`,transform : `translateX(${silidingBarLeft}px)`}"> <div class="dsk-tab-sliding-bar" v-if="tabs.length && this.showTabsSlidingbar && !comDisabled"
:style="{width : `${silidingBarWidth}px`,transform : `translateX(${silidingBarLeft}px)`}">
</div> </div>
</div> </div>
</div> </div>
...@@ -25,6 +27,10 @@ export default { ...@@ -25,6 +27,10 @@ export default {
required: true, required: true,
type: Array, type: Array,
default: () => [] default: () => []
},
disabled: {
type: Boolean,
default: false
} }
}, },
watch: { watch: {
...@@ -32,6 +38,12 @@ export default { ...@@ -32,6 +38,12 @@ export default {
handler(newValue) { handler(newValue) {
this.initSlidingBar(); this.initSlidingBar();
} }
},
// 全部禁用不显示滚动条
disabled: {
handler(newValue) {
this.comDisabled = newValue ? true : false;
}
} }
}, },
model: { model: {
...@@ -41,7 +53,8 @@ export default { ...@@ -41,7 +53,8 @@ export default {
data() { data() {
return { return {
silidingBarLeft: 0, silidingBarLeft: 0,
silidingBarWidth: 0 silidingBarWidth: 0,
comDisabled: this.disabled ? true : false
}; };
}, },
//可访问data属性 //可访问data属性
...@@ -50,7 +63,13 @@ export default { ...@@ -50,7 +63,13 @@ export default {
}, },
//计算集 //计算集
computed: { computed: {
showTabsSlidingbar() {
const current = this.tabs.find(item => item.value == this.currentValue);
if (current) {
return current.disabled ? false : true;
}
return false;
}
}, },
//方法集 //方法集
methods: { methods: {
...@@ -124,6 +143,13 @@ export default { ...@@ -124,6 +143,13 @@ export default {
font-weight: bold; font-weight: bold;
} }
} }
&.tab-is-disabled {
.dsk-tab-item-name {
color: #eee;
cursor: not-allowed;
}
}
} }
.dsk-tab-sliding-bar { .dsk-tab-sliding-bar {
......
...@@ -252,10 +252,11 @@ export default { ...@@ -252,10 +252,11 @@ export default {
methods: { methods: {
async getactualMonths() { async getactualMonths() {
try { try {
const formData = new FormData(); const params = {
formData.append("projectId", this.comProjectId); projectId: this.comProjectId,
formData.append("id", this.id); id: this.id
let data = await getActualMonthsApi(formData); };
let data = await getActualMonthsApi(params);
data.forEach(item => { data.forEach(item => {
item.value = item; item.value = item;
item.label = item.substring(1, 4) + '-' + item.substring(5, 6); item.label = item.substring(1, 4) + '-' + item.substring(5, 6);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="project-cost-ledger-detail-inner"> <div class="project-cost-ledger-detail-inner">
<project-detail-header :current="current" :breadCrumbTree="createProjectBreadCrumbTree"></project-detail-header> <project-detail-header :current="current" :breadCrumbTree="createProjectBreadCrumbTree"></project-detail-header>
<!-- tab切换栏 --> <!-- tab切换栏 -->
<dsk-tab-toggle v-model="current" :tabs="toggleTabs" @tabToggle="tabToggle"></dsk-tab-toggle> <dsk-tab-toggle v-model="current" :tabs="toggleTabs" @tabToggle="tabToggle" :disabled="tabsDisabled"></dsk-tab-toggle>
<!-- tab切换组件容器 --> <!-- tab切换组件容器 -->
<div class="project-cost-ledger-detail-module"> <div class="project-cost-ledger-detail-module">
<!-- 放入组件 v-if current == ‘xxxx’ 详情变量 this.detailInfo 需要深度监听--> <!-- 放入组件 v-if current == ‘xxxx’ 详情变量 this.detailInfo 需要深度监听-->
...@@ -70,6 +70,7 @@ export default { ...@@ -70,6 +70,7 @@ export default {
cbStage: 0, cbStage: 0,
cbType: 1 cbType: 1
}, },
tabsDisabled: false,
toggleTabs: [ toggleTabs: [
{ {
value: "basicEngineeringInformation", value: "basicEngineeringInformation",
...@@ -161,6 +162,7 @@ export default { ...@@ -161,6 +162,7 @@ export default {
}, },
async getProjectQuery() { async getProjectQuery() {
try { try {
this.tabsDisabled = true;
const { query } = this.$route; const { query } = this.$route;
// if (!query.projectId) return this.$message.error("缺少项目id"); // if (!query.projectId) return this.$message.error("缺少项目id");
this.projectId = query.projectId; this.projectId = query.projectId;
...@@ -172,6 +174,7 @@ export default { ...@@ -172,6 +174,7 @@ export default {
// 默认命中工程项目信息 // 默认命中工程项目信息
this.current = "basicEngineeringInformation"; this.current = "basicEngineeringInformation";
}; };
this.tabsDisabled = false;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
......
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