From 04bf082f36434f1847412492576d8472c422993c Mon Sep 17 00:00:00 2001 From: wk Date: 星期四, 06 六月 2024 15:33:53 +0800 Subject: [PATCH] 我来送货 --- pages/loadUnload-page/loadUnload-detail/loadUnload-detail.vue | 297 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 276 insertions(+), 21 deletions(-) diff --git a/pages/loadUnload-page/loadUnload-detail/loadUnload-detail.vue b/pages/loadUnload-page/loadUnload-detail/loadUnload-detail.vue index 8c89119..2ef7bb3 100644 --- a/pages/loadUnload-page/loadUnload-detail/loadUnload-detail.vue +++ b/pages/loadUnload-page/loadUnload-detail/loadUnload-detail.vue @@ -11,6 +11,7 @@ <view class="collection-form"> <view class="collection-form-item" v-for="(item, index) in detailData" + @click="faYundetail(item)" :key="index"> <view class="weigh-item"> <view class="item"> @@ -30,18 +31,31 @@ </view> <view class="info-container"> <view class="info-block"> - <view class="car-num info"> + <view class="car-num"> <text class="label-text">杞︾墝鍙�:</text>{{item.carNo}} </view> - <view class="order-margin info"> + <view class="order-margin"> <text class="label-text">鐓ょ鍚嶇О:</text> {{item.coalName}} </view> <view class="order-type info"> - 璁㈠崟绫诲瀷:{{item.orderType}} + 璁㈠崟绫诲瀷:<text style="font-weight: 600;">{{item.orderType}}</text> </view> <view class="file-name info"> - 鐘舵��:{{coalStatus[item.status]}} + 鐘舵��:<text style="font-weight: 600;">{{coalStatus[item.status]}}</text> + </view> + <view class="file-name checkStatus"> + 璐ㄦ鐘舵��:<text style="font-weight: 600;">{{coalStatus[item.checkStatus]}}</text> + </view> + <view class="info createTime"> + 鍏ュ満鏃堕棿:{{item.createTime}} + </view> + <view class="info code"> + 璁㈠崟缂栧彿:{{item.code}} + </view> + <view class="info confirmPeople" + v-if="item.confirmPeople"> + 瀹℃牳浜�:{{item.confirmPeople}} </view> </view> </view> @@ -52,16 +66,135 @@ shape="circle" @click.stop="loadOrder(item.id)" :loading="loading" + loadingText="纭"></u-button> + </view> + <!-- 濡傛灉鏈夊墿浣欐敹鍙戝崟鍒欑偣鍑绘煡鐪嬫洿澶� --> + <view class='downIcon' v-if='item.tmTaskCoalList.length'> + <u-icon @click='checkMore(item)' :name="!item.checkFlag ? 'arrow-down-fill' : 'arrow-up-fill'" color="#2979ff" size="38"></u-icon> + </view> + <!-- 鍓╀綑鏀跺彂鍗� ----澶氫骇鍝� --> + <view class='subBox' v-if='item.tmTaskCoalList.length && item.checkFlag'> + <view class='subItem' v-for='subItem,i in item.tmTaskCoalList' :key='i' + @click="faYundetail(subItem)" + > + <view class="weigh-item" style="position:static"> + <view class="item"> + <view class="concrete" + > + 鐨� + </view> + <view class="num">{{ subItem.skin }}</view> + </view> + <view class="item"> + <view class="concrete" + > + 姣� + </view> + <view class="num">{{ subItem.hair }}</view> + </view> + </view> + <view class="info-container"> + <view class="info-block"> + <view class="car-num"> + <text class="label-text">杞︾墝鍙�:</text>{{subItem.carNo}} + </view> + <view class="order-margin"> + <text class="label-text">鐓ょ鍚嶇О:</text> + {{subItem.coalName}} + </view> + <view class="order-type info"> + 璁㈠崟绫诲瀷:<text style="font-weight: 600;">{{subItem.orderType}}</text> + </view> + <view class="file-name info"> + 鐘舵��:<text style="font-weight: 600;">{{coalStatus[subItem.status]}}</text> + </view> + <view class="file-name checkStatus"> + 璐ㄦ鐘舵��:<text style="font-weight: 600;">{{coalStatus[subItem.checkStatus]}}</text> + </view> + <view class="info createTime"> + 鍏ュ満鏃堕棿:{{subItem.createTime}} + </view> + <view class="info code"> + 璁㈠崟缂栧彿:{{subItem.code}} + </view> + <view class="info confirmPeople" + v-if="subItem.confirmPeople"> + 瀹℃牳浜�:{{subItem.confirmPeople}} + </view> + </view> + </view> + <view class='btnBottom'> + <u-button plain + type="primary" + :text="subItem.orderTye === '澶栭攢' ? '纭畾鍗歌揣' :'纭畾瑁呰揣'" + shape="circle" + @click.stop="loadOrder(subItem.id,item)" + :loading="loading" + v-if="isBtnShow(subItem)" loadingText="纭" - v-if='item.isPretendDischar===0'></u-button> + ></u-button> + </view> + <u-divider :textSize='28' :text="subItem.coalName" :hairline="true"></u-divider> + </view> + </view> </view> </view> <u-modal :show="loadShow" - content='纭瑁呭嵏姝ゆ彁鐓ゅ崟' + :title="'纭瑁呭嵏姝ゆ彁鐓ゅ崟?'" :showCancelButton="true" @confirm="confirmUnload" - @cancel="cancelUnload"></u-modal> + @cancel="cancelUnload"> + <!-- 鏄惁灞曠ず --> + <u--form + v-if="activeObj.productQuantity" + :labelWidth='150' + labelPosition="left" + :model="model1" + ref="uForm" + > + <u-form-item + label="浜у搧鍚嶇О" + prop="name" + borderBottom + ref="item1" + > + <u--input + v-model="model1.name" + border="none" + placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" + ></u--input> + </u-form-item> + + <u-form-item + label="浜у搧鏁伴噺" + prop="num" + borderBottom + ref="item1" + > + <u--input + v-model="model1.num" + disabled + disabledColor="#ffffff" + placeholder="璇疯緭鍏ユ暟閲�" + border="none" + ></u--input> + </u-form-item> + <!-- 鐗规畩浜у搧瑁呰揣 --> + <u-form-item + label="闆嗚绠卞彿" + prop="code" + borderBottom + ref="item1" + > + <u--input + v-model="model1.code" + border="none" + placeholder="璇疯緭鍏ラ泦瑁呯鍙�" + ></u--input> + </u-form-item> + </u--form> + </u-modal> </view> </template> @@ -72,34 +205,87 @@ return { name: "", detailData: [], + model1:{ + name:'', + sex:"" + }, + activeObj:{}, onlineurl, loadShow: false, // 纭寮圭獥鎺у埗 loading: false, id: "", coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅浠�', '鍑虹叅浠�', '鏀剧┖', '浣滃簾', '鍏ュ満鐢宠', - '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�' + '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�', '杩斿洖鍔犲噺鍚�', '瓒呮椂', '鎵撳嵃涓�', '鎵撳嵃涓�', '濉啓' ], // 鐘舵�� + checkStatus:['寰呭彇鏍�','宸插彇鏍�','鍚堟牸','涓嶅悎鏍�'], + bunkerId: null + } + }, + computed: { + userId() { + return uni.getStorageSync('userId') + }, + isBtnShow(){ + return function (item){ + if(item.productName === 'EDC'){ + if(item.status === 15){ + return true + }else{ + return false + } + }else{ + return true + } + } } }, onLoad(params) { - this.name = params.coalName ? params.coalName : '' + this.bunkerId = params.bunkerId || '' this.init() }, methods: { + onPullDownRefresh() { + this.init() + uni.stopPullDownRefresh(); + }, init() { uni.showLoading({ title: "鍔犺浇涓�" }) - this.$reqGet('getAccordingCoalNameAll', { coalName: this.name }).then(res => { + this.$reqGet('getTaskCoalListByBunkerId', { bunkerId: this.bunkerId }).then(res => { uni.hideLoading() if (res.code === 0) { - this.detailData = res.data + const errorStatusArr = [0, 1, 2, 3, 6, 11, 12, 13]; + this.detailData = res.data.map(v => { + if(v.tmTaskCoalList.length){ + v.tmTaskCoalList = v.tmTaskCoalList.map(item=>{ + return { + ...item, + ableDischar: item.skin === item.hair || item.hair === 0 && item.skin === 0 || v + .isPretendDischar !== 0 || errorStatusArr.indexOf(item.status) !== -1, + isContainLoginUser: item.confirmPeopleId ? item.confirmPeopleId.split(',') + .indexOf(this.userId) === - + 1 : true + } + }) + } + return { + ...v, + checkFlag:false, + ableDischar: v.skin === v.hair || v.hair === 0 && v.skin === 0 || v + .isPretendDischar !== 0 || errorStatusArr.indexOf(v.status) !== -1, + isContainLoginUser: v.confirmPeopleId ? v.confirmPeopleId.split(',') + .indexOf(this.userId) === - + 1 : true + } + }) } else { this.$u.toast('鍔犺浇澶辫触') } }) }, - loadOrder(id) { + loadOrder(id,item) { + this.activeObj = item; this.loadShow = true; this.id = id; }, @@ -110,7 +296,9 @@ this.loading = false; if (res.code === 0) { this.$u.toast('瑁呭嵏鎴愬姛') - this.init() + setTimeout(() => { + this.init() + }, 1000) } else { this.$u.toast(res.msg ? res.msg : '瑁呭嵏澶辫触') } @@ -119,12 +307,53 @@ cancelUnload() { this.loadShow = false }, + checkMore(value){ + value.checkFlag =!value.checkFlag; + + } } } </script> <style lang="scss" scoped> + .collection-form{ + .subBox{ + background: #fff; + height:auto; + margin-top:10px; + padding:10rpx; + box-shadow: 4rpx 6rpx 25rpx 0rpx rgba(73, 120, 240, 0.15); + border-radius: 20rpx; + .subItem{ + position: relative; + } + .info-container{ + height:400rpx!important; + } + + .btnBottom{ + position: absolute; + bottom: 20px; + right: vww(10); + } + /deep/ .u-divider{ + margin: 10px 0!important; + } + } + } + + .downIcon{ + display: flex; + justify-content: center; + /* margin-top: 38rpx; */ + + } + .checkStatus{ + width:93%; + color: #515151; + margin: vww(5); + } .collection-form { width: vww(345); margin: 0 vww(15); @@ -132,11 +361,11 @@ .collection-form-item { width: 690rpx; - height: 380rpx; + transition: all 0.5s; background: #ffffff; box-shadow: 4rpx 6rpx 25rpx 0rpx rgba(73, 120, 240, 0.15); border-radius: 20rpx; - overflow: hidden; + // overflow: hidden; @include flex; flex-direction: column; position: relative; @@ -150,7 +379,6 @@ @include flex; justify-content: space-around; position: relative; - top: vww(-14); .item { min-width: vww(50); @@ -177,25 +405,38 @@ .info-container { width: 100%; - height: vww(100); + height: vww(150); display: flex; justify-content: center; + position: relative; + top: vww(-15); .info-block { width: 600rpx; - height: vww(80); + height: vww(120); display: flex; justify-content: center; flex-wrap: wrap; .car-num, .order-margin { + width: 100%; + display: flex; + justify-content: flex-start; + margin-left: 4%; + margin-top: vww(4); color: #FF0000; font-weight: 600; .label-text { color: #409eff; } + } + + .order-margin { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } } @@ -206,14 +447,28 @@ color: #515151; margin: vww(5); } + + .createTime, + .code, + .confirmPeople { + width: 100%; + margin-left: vww(9); + display: flex; + justify-content: flex-start; + } + + .confirmPeople { + margin-top: vww(24); + } } .confirm-button { width: vww(80); - position: absolute; - bottom: vww(6); - right: vww(10); + margin-left: 70%; + // position: absolute; + // bottom: vww(6); + // right: vww(10); } } } -- Gitblit v1.9.1