From 589231104e74c362512f656f8a50b4bb6c26e182 Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期三, 05 六月 2024 13:34:56 +0800 Subject: [PATCH] feat:库管确认装卸 及查看详情功能 --- pages/loadUnload-page/selectTarget/selectTarget.vue | 198 +++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 174 insertions(+), 24 deletions(-) diff --git a/pages/loadUnload-page/selectTarget/selectTarget.vue b/pages/loadUnload-page/selectTarget/selectTarget.vue index 8448fc3..dc157c4 100644 --- a/pages/loadUnload-page/selectTarget/selectTarget.vue +++ b/pages/loadUnload-page/selectTarget/selectTarget.vue @@ -2,7 +2,8 @@ <view class="main"> <!-- 褰撳墠閫夋嫨浠撳簱 --> <view class="top-tag"> - <u-tag :text="dataForm.firstClass ? dataForm.firstClass : '璇烽�夋嫨浠撳簱'" + <u-tag + :text="dataForm.firstClass ? dataForm.firstClass : '璇烽�夋嫨浠撳簱'" @click="firstClassSelect" ></u-tag> </view> @@ -44,8 +45,7 @@ <zh-collapse @change='change' accordion v-for="item,i in detailData" :key="i"> <zh-collapse-item - class="collItem" - @clickContent='clickContent'> + class="collItem"> <view class="" slot='title'> <view class="history-information"> <view class="first"> @@ -94,7 +94,48 @@ </view> </view> - <view class="" slot='cont'>鏀寔瀹氫箟鍐呭</view> + <view class="" slot='cont'> + <view class="table"> + <uni-table border stripe + emptyText="鏆傛棤鏇村鏁版嵁"> + <uni-tr> + <uni-th align="center" width='100'>浜у搧</uni-th> + <uni-th align="center">杞︾墝鍙�</uni-th> + <uni-th align="center" width='100'>绫诲瀷</uni-th> + <uni-th align="center" width='100'>鐨噸</uni-th> + <uni-th align="center" width='100'>姣涢噸</uni-th> + <!-- <uni-th align="center">浠撳簱</uni-th> --> + <uni-th align="center" width='100'>鐘舵��</uni-th> + <uni-th width='200' class="fixed" align="center">鎿嶄綔</uni-th> + </uni-tr> + <uni-tr v-for="(subItem, index) in item.tmTaskCoalList" :key="index"> + <uni-td align="center"> + <view>{{ subItem.productName }}</view></uni-td> + <uni-td align="center"> + <view style="width:150rpx">{{ subItem.carNo }}</view></uni-td> + <uni-td> + <view class="name">{{ subItem.orderType }}</view> + </uni-td> + <uni-td> + <view class="name">{{ subItem.skin }}</view> + </uni-td> + <uni-td> + <view class="name">{{ subItem.hair }}</view> + </uni-td> +<!-- + 聽 <uni-td align="center"> + <view>{{ subItem.bunkerName }}</view></uni-td> --> + <uni-td align="center"> + <view>{{ subItem.statusView }}</view></uni-td> + <uni-td align="center"> + <view class="btnBox"> + <text @click="viewDetail(subItem)">鏌ョ湅</text> + <text v-if="subItem.flag" @click="enterOk(subItem)">纭瑁呭嵏</text> + </view></uni-td> + </uni-tr> + </uni-table> + </view> + </view> </zh-collapse-item> </zh-collapse> @@ -105,6 +146,27 @@ :closeOnClickOverlay='true' @close='firstClassClose' @select="firstClassSelectClick"></u-action-sheet> + <u-modal :show="enterZx" + :title="'鎻愮ず'" + @close="closeModal" + @cancel="cancelModal" + @confirm="confirmModal" + :closeOnClickOverlay="true" + :showCancelButton="true"> + <view class="slot-content"> + 鏄惁纭瑁呭嵏锛� + <view v-if="isNumOk"> + <text>浜у搧鍚嶇О锛歿{activeObj.productName}}</text> + <view> + <u--input + placeholder="璇疯緭鍏ユ暟閲�" + border="surround" + v-model="checkNum" + ></u--input> + </view> + </view> + </view> + </u-modal> <!-- 鐓や粨 --> <!-- <u-action-sheet :actions="secondClassActionsList" :show="secondClassShow" @@ -133,6 +195,8 @@ bunkerId:"" }, index: '', + enterZx:false, + isNumOk:false, // 鐓ゅ満鎿嶄綔鑿滃崟 firstClassActionsList: [], firstClassShow: false, @@ -141,6 +205,8 @@ secondClassShow: false, coalList: [], checkedCoal: [], + checkNum:'', + activeObj:{}, userInfo: {}, detailData:[], filedId: "", @@ -161,6 +227,13 @@ }; }, methods: { + viewDetail(item){ + //鏌ョ湅鏀跺彂鍗曡鎯� + uni.navigateTo({ + url: `/pages/loadUnload-page/loadUnlaodPageDetail/detail?id=${item.id}&checkId=${item.checkId}` + }); + + }, getUserInfo() { this.$reqGet('getUserEntity').then(res => { this.userInfo = res.data; @@ -180,11 +253,6 @@ this.dataForm.bunkerId = res.data[0].id; uni.setStorageSync('bunkerId',res.data[0].id) this.dataForm.firstClass = res.data[0].name; - setTimeout(()=>{ - uni.navigateTo({ - url: `/pages/loadUnload-page/loadUnload-detail/loadUnload-detail?bunkerId=${this.dataForm.bunkerId}` - }) - },300) } } else { @@ -200,19 +268,32 @@ firstClassClose() { this.firstClassShow = false }, - firstClassSelectClick(val) { - this.dataForm.firstClass = val.name; - this.dataForm.bunkerId= val.id; - uni.setStorageSync('bunkerId', val.id); - this.$reqGet('getTaskCoalListByBunkerId', { bunkerId:this.dataForm.bunkerId }).then(res => { - uni.hideLoading() + getDetailData(){ + uni.showLoading({ + title:'鍔犺浇涓�' + }) + this.$reqGet('getTaskCoalListByBunkerId', { bunkerId:this.dataForm.bunkerId }).then(res => { if (res.code === 0) { - this.detailData = res.data; + this.detailData = res.data.map(item=>{ + item.tmTaskCoalList.map(el=>{ + el.flag = el.isPretendDischar ? false : true + return el + }) + return item; + }); console.log(this.detailData,'detailData') + uni.hideLoading(); } else { this.$u.toast('鍔犺浇澶辫触') } }) + + }, + firstClassSelectClick(val) { + this.dataForm.firstClass = val.name; + this.dataForm.bunkerId= val.id; + uni.setStorageSync('bunkerId', val.id); + this.getDetailData(); this.filedId = val.id }, // 鑾峰彇鐓や粨 @@ -272,7 +353,38 @@ close(){ }, - open(){} + open(){}, + enterOk(item){ + console.log('123',item) + this.activeObj = item; + if(item.productQuantity){ + this.isNumOk = true; + } + this.enterZx = true; + }, + closeModal(){ + this.enterZx = false; + }, + cancelModal(){ + this.enterZx = false; + }, + confirmModal(){ + this.enterZx = false; + this.$reqPost('confirmLoadAndUnload',{ + id: this.activeObj.id, + productQuantity:this.isNumOk ? this.checkNum :this.activeObj.skin, + isPretendDischar:this.activeObj.isPretendDischar + },'json').then(res=>{ + console.log(res,'rez') + if(res.code === 0){ + this.$u.toast('鎿嶄綔鎴愬姛'); + this.getDetailData(); + + } + }) + } + + }, onShow(){ @@ -301,6 +413,41 @@ <style lang="scss" scoped> + .table{ + width: 94%; + margin-left: 20rpx; + overflow-x: auto; + /deep/ .uni-table-th{ + font-size: 12px; + } + /deep/ .uni-table-td { + font-size: 12px; + } + /deep/ .uni-table{ + min-width: 340rpx!important; + } + /deep/ .uni-table-body-wrapper { + position: relative; +} + /deep/ .uni-table-body { + display: flex; +} +.fixed { + position: sticky; + right: 0; + z-index: 1; + background-color: #ffffff; +} + + } + .btnBox{ + min-width: 150rpx; + display: flex; + justify-content: space-between; + text{ + color: #035cfb; + } + } .main { width: 94%; margin: 10px; @@ -331,7 +478,7 @@ } .coal-name { - width: 95%; + width: 75%; min-height: vww(100); .u-checkbox-group { @@ -354,18 +501,20 @@ } .collItem{ margin-top: 30rpx; + /deep/ .content{ + background: none!important; + } } .history-information { - width: 690rpx; - height: 398rpx; - margin: vww(10) vww(15); + background: #ffffff; - box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12); border-radius: 20rpx; @include flex flex-direction: column; + padding: 10px; align-items: flex-start; justify-content: space-evenly; - overflow: hidden; + box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12); + .first { width: 96%; @@ -388,12 +537,13 @@ justify-content: flex-start; .coal-name { - min-width: vww(30); + min-width: vww(20); height: vww(20); margin-right: vww(21); } .order-type { + height: 45rpx; color: #035cfb; border: 2px solid #035cfb; border-radius: 4rpx; -- Gitblit v1.9.1