From bb52e0d4baffe8e0486c951e525b6614bd4aaa28 Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期一, 24 四月 2023 14:08:56 +0800 Subject: [PATCH] 修改样式,修复已知bug --- pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue | 388 +++++++++++++++++++++++++++++++++--------------------- 1 files changed, 235 insertions(+), 153 deletions(-) diff --git a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue index 83f3c08..b8dd609 100644 --- a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue +++ b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue @@ -4,144 +4,128 @@ <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"> - <u-collapse> - <u-collapse-item :title="dateRange" value="绛涢��"> - <view class="filter-main"> - <view class="filter-body"> - <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" 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> - <view class="filter-body"> - <view class="condition-name">绫诲瀷锛�</view> - <view class="filter-name"> - <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"> - <view class="condition-name">瀹㈡埛锛�</view> - <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> - <view class="filter-body" v-if="roleType == 1"> - <view class="condition-name">璐т唬锛�</view> - <view class="filter-name"> - <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"> - <view class="condition-name">杞﹂槦锛�</view> - <view class="filter-name"> - <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"> - <view class="condition-name">鐭垮満锛�</view> - <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"> - <view class="condition-name">鏃ユ湡锛�</view> - <view class="filter-name"> - <u-button :text="dateselect" @click="opencalendar"></u-button> - <view class="filter-button"> - <uni-calendar - ref="calendar" - class="uni-calendar--hook" - :clear-date="true" - :date="info.date" - :insert="info.insert" - :lunar="info.lunar" - :startDate="info.startDate" - :endDate="info.endDate" - :range="info.range" - @confirm="confirm" - /> - </view> + <view class="filter-show"> + <view class="filtershow-date">{{ dateRange }}</view> + <view class="filter-icon"><u-icon name="grid" :size="40" color="#9ec16c "></u-icon></view> + <view class="filtershow-text" @click="showPopup">绛涢��</view> + </view> + <u-popup :show="conditinonShow" mode="top" :closeable="true" :closeOnClickOverlay="true" @close="conditinonclose"> + <view class="filter-main"> + <view class="filter-body date-button"> + <view class="condition-name">鏃ユ湡</view> + <view class="filter-name"> + <u-button :text="dateselect" @click="opencalendar"></u-button> + <view class="filter-button "> + <uni-calendar + ref="calendar" + class="uni-calendar--hook" + :clear-date="true" + :date="info.date" + :insert="info.insert" + :lunar="info.lunar" + :startDate="info.startDate" + :endDate="info.endDate" + :range="info.range" + @confirm="confirm" + /> </view> </view> </view> - </u-collapse-item> - </u-collapse> + <view class="filter-body"> + <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 :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < coalShow"></u-button> + </view> + <view class="toggle-button"> + <u-button :text="coalShow < coalTotal ? '鏌ョ湅鏇村' : '鏀惰捣'" type="primary" size="small" @click="toggle(0)" v-if="coalTotal > 3"></u-button> + </view> + </view> + </view> + <view class="filter-body"> + <view class="condition-name">绫诲瀷</view> + <view class="filter-name"> + <view class="filter-button" v-for="(item, index) in typeList" :key="index" @click="filterCondition(1, index, item.condition)"> + <u-button :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < typeShow"></u-button> + </view> + <view class="toggle-button"> + <u-button :text="typeShow < typeTotal ? '鏌ョ湅鏇村' : '鏀惰捣'" type="primary" size="small" @click="toggle(1)" v-if="typeTotal > 3"></u-button> + </view> + </view> + </view> + <view class="filter-body"> + <view class="condition-name">瀹㈡埛</view> + <view class="filter-name"> + <view class="filter-button" v-for="(item, index) in customerList" :key="index" @click="filterCondition(2, index, item.condition)"> + <u-button :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < customerShow"></u-button> + </view> + <view class="toggle-button"> + <u-button + :text="customerShow < customerTotal ? '鏌ョ湅鏇村' : '鏀惰捣'" + type="primary" + size="small" + @click="toggle(2)" + v-if="customerTotal > 3" + ></u-button> + </view> + </view> + </view> + <view class="filter-body" v-if="roleType == 1"> + <view class="condition-name">璐т唬</view> + <view class="filter-name"> + <view class="filter-button" v-for="(item, index) in forwarderList" :key="index" @click="filterCondition(3, index, item.condition)"> + <u-button :text="item.condition" :type="item.active ? 'success' : ''" v-if="index < forwarderShow"></u-button> + </view> + <view class="toggle-button"> + <u-button + :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"> + <view class="condition-name">杞﹂槦</view> + <view class="filter-name"> + <view class="filter-button" v-for="(item, index) in fleetList" :key="index" @click="filterCondition(4, index, item.condition)"> + <u-button :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < fleetShow"></u-button> + </view> + <view class="toggle-button"> + <u-button :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"> + <view class="condition-name">鐭垮満</view> + <view class="filter-name"> + <view class="filter-button" v-for="(item, index) in filedList" :key="index" @click="filterCondition(5, index, item.condition)"> + <u-button :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < filedShow"></u-button> + </view> + <view class="toggle-button"> + <u-button :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 :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < carNoShow"></u-button> + </view> + <view class="toggle-button"> + <u-button :text="carNoShow < carNoTotal ? '鏌ョ湅鏇村' : '鏀惰捣'" type="primary" size="small" @click="toggle(6)" v-if="carNoTotal > 3"></u-button> + </view> + </view> + </view> + </view> + </u-popup> </view> <view class="date-information"> <view class="statistics-card" v-for="(item, index) in filterList" :key="index"> @@ -155,11 +139,11 @@ }}鍚� </view> </view> - <view class="card-main" v-for="(value, i) in item.taskCoalList" :key="i"> + <view class="card-main" v-for="(value, i) in item.taskCoalList" :key="i" @click="faYunDetail(value.id)"> <view class="arrow-right"><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> @@ -167,6 +151,7 @@ </view> </view> </view> + <tab-bar :current="1"></tab-bar> </view> </template> @@ -181,6 +166,7 @@ forwarderList: [], fleetList: [], filedList: [], + carNoList: [], isactive: false, info: { lunar: false, @@ -194,6 +180,8 @@ filterList: [], totalLength: 0, totalTon: 0, + // 绛涢�夊脊鍑哄眰 + conditinonShow: false, // 瓒呰繃涓よ鑷姩闅愯棌 coalShow: 3, typeShow: 3, @@ -201,12 +189,18 @@ forwarderShow: 3, fleetShow: 3, filedShow: 3, + carNoShow: 3, coalToggeleState: false, typeToggeleState: false, customerToggeleState: false, forwarderToggeleState: false, fleetToggeleState: false, - filedToggeleState: false + filedToggeleState: false, + carNoToggeleState: false, + // 鐐瑰嚮鍙崇澶磋鎯呭脊绐� + faYunDetailobj: {}, + modalShow: false, + coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅鍦�', '鍑虹叅浠�'] }; }, onShow() { @@ -283,6 +277,14 @@ active: false }; }); + this.carNoList = res.data + .filter(v => v.conditionType == 6) + .map(item => { + return { + ...item, + active: false + }; + }); }); }, // 鑾峰彇鏁版嵁 @@ -328,6 +330,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) => { @@ -343,7 +348,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 = { @@ -352,7 +358,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 { @@ -376,6 +383,7 @@ } }, confirm(e) { + console.log(e, '鏃ユ湡閫夋嫨'); this.first = e.range.before; this.last = e.range.after; }, @@ -439,7 +447,30 @@ 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}` + }); + }, + // 鎵撳紑绛涢�夋潯浠跺脊绐� + showPopup() { + this.conditinonShow = true; + }, + // 鍏抽棴绛涢�夋潯浠跺脊绐� + conditinonclose() { + this.conditinonShow = false; } }, computed: { @@ -469,6 +500,9 @@ }, filedTotal() { return this.filedList.length; + }, + carNoTotal() { + return this.carNoList.length; } }, watch: { @@ -485,15 +519,14 @@ </script> <style lang="scss" scoped> -::v-deep .u-cell__value { - color: #9ec16c !important; - font-size: vww(18) !important; +::v-deep .toggle-button .u-button { + width: vww(40); } -::v-deep .filter-name:nth-last-child(1) { - .u-button { - width: 66%; - } -} +// ::v-deep .filter-name:nth-last-child(1) { +// .u-button { +// width: 66%; +// } +// } .main { width: 96%; margin: 0 auto; @@ -513,7 +546,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; @@ -527,11 +560,54 @@ background-color: #fff; border: 1px solid #cccccc; border-radius: vww(5); + .filter-show { + width: 100%; + height: vww(40); + background-color: #fff; + border-radius: vww(5); + font-size: vww(18); + color: #333; + position: relative; + display: flex; + justify-content: space-between; + align-items: center; + .filtershow-date { + font-size: vww(15); + padding-left: vww(8); + } + .filter-icon { + position: absolute; + right: vww(45); + top: vww(11); + } + .filtershow-text { + color: #9ec16c; + padding-right: vww(8); + position: relative; + &::before { + content: ''; + position: absolute; + width: 1px; + height: vww(22); + background-color: #dcdfe6; + right: 94px; + bottom: 0; + } + } + } .filter-main { width: 100%; display: flex; flex-direction: column; justify-content: space-around; + .date-button { + width: 80%; + height: vww(80); + margin: vww(5) auto; + .condition-name { + margin-bottom: vww(10); + } + } .filter-body { width: 100%; position: relative; @@ -539,28 +615,34 @@ justify-content: flex-start; flex-wrap: wrap; .condition-name { + margin-left: vww(15); + margin-top: vww(10); font-size: vww(16); + color: #686868; } .filter-name { - width: 100%; + width: 94%; + margin: 0 auto; + position: relative; display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: flex-start; - position: relative; - top: vww(-34); .filter-button { color: #393a3c; height: vww(16); padding: vww(8); margin: vww(5) vww(5); - &:nth-child(1) { - margin-left: vww(48); - } + margin-bottom: vww(10); } .toggle-button { - margin-top: vww(12); + width: 30%; + display: flex; + justify-content: center; + position: absolute; + right: vww(-21); + top: vww(-23); } } } -- Gitblit v1.9.1