From 3fd84886a15713ece1ba34954f49fd1e075ef7be Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期三, 19 四月 2023 17:38:48 +0800
Subject: [PATCH] 改变称重监听,增加发运详情,修复电子提煤单错误
---
pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue | 232 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 223 insertions(+), 9 deletions(-)
diff --git a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
index 4f89ef6..1da3993 100644
--- a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
+++ b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
@@ -4,7 +4,7 @@
<view class="content-statistics">
<view class="content-text">鍙戣繍缁熻</view>
<view class="content-text">鍏眥{ totalLength }}杞�</view>
- <view class="content-text">鍏眥{ totalTon }}鍚�</view>
+ <view class="content-text">鍏眥{ totalTon.toFixed(2) }}鍚�</view>
</view>
</view>
<view class="collapse-main">
@@ -15,7 +15,17 @@
<view class="condition-name">鐓ょ锛�</view>
<view class="filter-name">
<view class="filter-button" v-for="(item, index) in coalList" :key="index" @click="filterCondition(0, index, item.condition)">
- <u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
+ <u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < coalShow"></u-button>
+ </view>
+ <view class="toggle-button">
+ <u-button
+ shape="circle"
+ :text="coalShow < coalTotal ? '鏌ョ湅鏇村' : '鏀惰捣'"
+ type="primary"
+ size="small"
+ @click="toggle(0)"
+ v-if="coalTotal > 3"
+ ></u-button>
</view>
</view>
</view>
@@ -25,6 +35,16 @@
<view class="filter-button" v-for="(item, index) in typeList" :key="index" @click="filterCondition(1, index, item.condition)">
<u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
</view>
+ <view class="toggle-button">
+ <u-button
+ shape="circle"
+ :text="typeShow < typeTotal ? '鏌ョ湅鏇村' : '鏀惰捣'"
+ type="primary"
+ size="small"
+ @click="toggle(1)"
+ v-if="typeTotal > 3"
+ ></u-button>
+ </view>
</view>
</view>
<view class="filter-body">
@@ -32,6 +52,16 @@
<view class="filter-name">
<view class="filter-button" v-for="(item, index) in customerList" :key="index" @click="filterCondition(2, index, item.condition)">
<u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
+ </view>
+ <view class="toggle-button">
+ <u-button
+ shape="circle"
+ :text="customerShow < customerTotal ? '鏌ョ湅鏇村' : '鏀惰捣'"
+ type="primary"
+ size="small"
+ @click="toggle(2)"
+ v-if="customerTotal > 3"
+ ></u-button>
</view>
</view>
</view>
@@ -41,6 +71,16 @@
<view class="filter-button" v-for="(item, index) in forwarderList" :key="index" @click="filterCondition(3, index, item.condition)">
<u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
</view>
+ <view class="toggle-button">
+ <u-button
+ shape="circle"
+ :text="forwarderShow < forwarderTotal ? '鏌ョ湅鏇村' : '鏀惰捣'"
+ type="primary"
+ size="small"
+ @click="toggle(3)"
+ v-if="forwarderTotal > 3"
+ ></u-button>
+ </view>
</view>
</view>
<view class="filter-body" v-if="roleType != 3">
@@ -49,6 +89,16 @@
<view class="filter-button" v-for="(item, index) in fleetList" :key="index" @click="filterCondition(4, index, item.condition)">
<u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
</view>
+ <view class="toggle-button">
+ <u-button
+ shape="circle"
+ :text="fleetShow < fleetTotal ? '鏌ョ湅鏇村' : '鏀惰捣'"
+ type="primary"
+ size="small"
+ @click="toggle(4)"
+ v-if="fleetTotal > 3"
+ ></u-button>
+ </view>
</view>
</view>
<view class="filter-body" v-if="roleType != 1">
@@ -56,6 +106,34 @@
<view class="filter-name">
<view class="filter-button" v-for="(item, index) in filedList" :key="index" @click="filterCondition(5, index, item.condition)">
<u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
+ </view>
+ <view class="toggle-button">
+ <u-button
+ shape="circle"
+ :text="filedShow < filedTotal ? '鏌ョ湅鏇村' : '鏀惰捣'"
+ type="primary"
+ size="small"
+ @click="toggle(5)"
+ v-if="filedTotal > 3"
+ ></u-button>
+ </view>
+ </view>
+ </view>
+ <view class="filter-body" v-if="roleType == 2">
+ <view class="condition-name">杞︾墝鍙凤細</view>
+ <view class="filter-name">
+ <view class="filter-button" v-for="(item, index) in carNoList" :key="index" @click="filterCondition(6, index, item.condition)">
+ <u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
+ </view>
+ <view class="toggle-button">
+ <u-button
+ shape="circle"
+ :text="carNoShow < carNoTotal ? '鏌ョ湅鏇村' : '鏀惰捣'"
+ type="primary"
+ size="small"
+ @click="toggle(6)"
+ v-if="carNoTotal > 3"
+ ></u-button>
</view>
</view>
</view>
@@ -96,10 +174,10 @@
</view>
</view>
<view class="card-main" v-for="(value, i) in item.taskCoalList" :key="i">
- <view class="arrow-right"><u-icon name="arrow-right" size="50"></u-icon></view>
+ <view class="arrow-right" @click="faYunDetail(value.id)"><u-icon name="arrow-right" size="50"></u-icon></view>
<view class="main-body">
<view class="coal-name">鐓ょ:{{ value.coalName || '' }}</view>
- <view class="clean">鎵ц閲�:{{ value.clean || 0 }}</view>
+ <view class="clean">鎵ц閲�:{{ value.clean.toFixed(2) || 0 }}</view>
<view class="out-time">鍑哄満鏃堕棿:{{ value.outTime || '' }}</view>
<view class="car-number">杞︾墝鍙�:{{ value.carNo || '' }}</view>
<view class="filedName">鐭垮満:{{ value.filedName || '' }}</view>
@@ -121,6 +199,7 @@
forwarderList: [],
fleetList: [],
filedList: [],
+ carNoList: [],
isactive: false,
info: {
lunar: false,
@@ -133,7 +212,26 @@
taskList: [],
filterList: [],
totalLength: 0,
- totalTon: 0
+ totalTon: 0,
+ // 瓒呰繃涓よ鑷姩闅愯棌
+ coalShow: 3,
+ typeShow: 3,
+ customerShow: 3,
+ forwarderShow: 3,
+ fleetShow: 3,
+ filedShow: 3,
+ carNoShow: 3,
+ coalToggeleState: false,
+ typeToggeleState: false,
+ customerToggeleState: false,
+ forwarderToggeleState: false,
+ fleetToggeleState: false,
+ filedToggeleState: false,
+ carNoToggeleState: false,
+ // 鐐瑰嚮鍙崇澶磋鎯呭脊绐�
+ faYunDetailobj: {},
+ modalShow: false,
+ coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅鍦�', '鍑虹叅浠�']
};
},
onShow() {
@@ -210,6 +308,14 @@
active: false
};
});
+ this.carNoList = res.data
+ .filter(v => v.conditionType == 6)
+ .map(item => {
+ return {
+ ...item,
+ active: false
+ };
+ });
});
},
// 鑾峰彇鏁版嵁
@@ -255,6 +361,9 @@
case 5:
this.filedList[i].active = !this.filedList[i].active;
break;
+ case 6:
+ this.carNoList[i].active = !this.carNoList[i].active;
+ break;
}
const validateFn = key => (v, arr) => {
@@ -270,7 +379,8 @@
customerName: this.customerList.filter(v => v.active == true).map(item => item.condition),
xsUser2Name: this.forwarderList.filter(v => v.active == true).map(item => item.condition),
fleetName: this.fleetList.filter(v => v.active == true).map(item => item.condition),
- filedName: this.filedList.filter(v => v.active == true).map(item => item.condition)
+ filedName: this.filedList.filter(v => v.active == true).map(item => item.condition),
+ carNo: this.carNoList.filter(v => v.active == true).map(item => item.condition)
};
const mapping = {
@@ -279,7 +389,8 @@
customerName: validateFn('customerName'),
xsUser2Name: validateFn('xsUser2Name'),
fleetName: validateFn('fleetName'),
- filedName: validateFn('filedName')
+ filedName: validateFn('filedName'),
+ carNo: validateFn('carNo')
};
this.filterList = this.taskList.map(val => {
return {
@@ -308,6 +419,83 @@
},
opencalendar() {
this.$refs.calendar.open();
+ },
+ // 鐐瑰嚮鏌ョ湅鏇村
+ toggle(value) {
+ switch (value) {
+ case 0:
+ if (!this.coalToggeleState) {
+ this.coalShow = this.coalTotal;
+ this.coalToggeleState = true;
+ } else {
+ this.coalShow = 3;
+ this.coalToggeleState = false;
+ }
+ break;
+ case 1:
+ if (!this.typeToggeleState) {
+ this.typeShow = this.typeTotal;
+ this.typeToggeleState = true;
+ } else {
+ this.typeShow = 3;
+ this.typeToggeleState = false;
+ }
+ break;
+ case 2:
+ if (!this.customerToggeleState) {
+ this.customerShow = this.customerTotal;
+ this.customerToggeleState = true;
+ } else {
+ this.customerShow = 3;
+ this.customerToggeleState = false;
+ }
+ break;
+ case 3:
+ if (!this.forwarderToggeleState) {
+ this.forwarderShow = this.forwarderTotal;
+ this.forwarderToggeleState = true;
+ } else {
+ this.forwarderShow = 3;
+ this.forwarderToggeleState = false;
+ }
+ break;
+ case 4:
+ if (!this.fleetToggeleState) {
+ this.fleetShow = this.fleetTotal;
+ this.fleetToggeleState = true;
+ } else {
+ this.fleetShow = 3;
+ this.fleetToggeleState = false;
+ }
+ break;
+ case 5:
+ if (!this.filedToggeleState) {
+ this.filedShow = this.filedTotal;
+ this.filedToggeleState = true;
+ } else {
+ this.filedShow = 3;
+ this.filedToggeleState = false;
+ }
+ break;
+ case 6:
+ if (!this.carNoToggeleState) {
+ this.carNoShow = this.carNoTotal;
+ this.carNoToggeleState = true;
+ } else {
+ this.carNoShow = 3;
+ this.carNoToggeleState = false;
+ }
+ break;
+ }
+ },
+ // 璺宠浆鍙戣繍璇︽儏
+ faYunDetail(takeCoalId) {
+ uni.navigateTo({
+ url: `/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails?id=${takeCoalId}`
+ });
+ },
+ confirm() {
+ this.modalShow = false;
}
},
computed: {
@@ -319,12 +507,32 @@
},
dateselect() {
return `${this.first}-${this.last}`;
+ },
+ coalTotal() {
+ return this.coalList.length;
+ },
+ typeTotal() {
+ return this.typeList.length;
+ },
+ customerTotal() {
+ return this.customerList.length;
+ },
+ forwarderTotal() {
+ return this.forwarderList.length;
+ },
+ fleetTotal() {
+ return this.fleetList.length;
+ },
+ filedTotal() {
+ return this.filedList.length;
+ },
+ carNoTotal() {
+ return this.carNoList.length;
}
},
watch: {
dateselect(newV, old) {
let tempDate = `${this.first}-${this.last}`;
- console.log(newV, '鏂�', old, '鏃�', tempDate, '涓�寮�濮�');
if (newV != old && old != '-') {
this.first = newV.slice(0, 10);
this.last = newV.slice(11);
@@ -364,7 +572,7 @@
justify-content: space-between;
align-items: center;
.content-text {
- width: vww(80);
+ width: 33.3%;
height: vww(30);
font-size: vww(20);
color: #393a3c;
@@ -410,6 +618,12 @@
margin-left: vww(48);
}
}
+ .toggle-button {
+ margin: vww(12) auto;
+ position: relative;
+ left: -10%;
+ transform: translateX(-50%);
+ }
}
}
}
--
Gitblit v1.9.1