From e7b0b34176549cfec809c6b89c4cab0999e488b9 Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期二, 28 三月 2023 16:40:56 +0800 Subject: [PATCH] 修改大部分问题 --- pages/public-page/forward/forward.vue | 2 uni_modules/uni-table/components/uni-td/uni-td.vue | 138 ++++++------ api/publicInterface.js | 4 pages/login/userPassword.vue | 4 pages/login/login.vue | 27 +- pages/register/register.vue | 8 pages/customer-page/customer-index/customer-index.vue | 47 ++-- pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue | 126 ++++++---- pages/driver-page/driver-index/driver-index.vue | 24 + store/index.js | 3 pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue | 23 +- utils/util.js | 9 api/request.js | 11 main.js | 1 api/index.js | 6 pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue | 21 + pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue | 69 ++++++ pages/customer-page/customer-index/fayunPlanDetails/fayunPlanMore/fayunPlanMore.vue | 115 ++++++++++ 18 files changed, 434 insertions(+), 204 deletions(-) diff --git a/api/index.js b/api/index.js index 87ad6ff..3d4d824 100644 --- a/api/index.js +++ b/api/index.js @@ -11,6 +11,9 @@ }, jsonPOST: { "Content-type": 'application/json' + }, + utfPOSt: { + 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' } } @@ -46,6 +49,9 @@ } else if (urlType == 'json') { opt.header = typeObj['jsonPOST']; opt.data = params; + } else if (urlType == 'utf8') { + opt.header = typeObj['utfPOSt']; + opt.data = params; } else { opt.data = params; opt.header = typeObj['headerPOST']; diff --git a/api/publicInterface.js b/api/publicInterface.js index 9d4e0c7..2458ce4 100644 --- a/api/publicInterface.js +++ b/api/publicInterface.js @@ -5,8 +5,8 @@ import { BaseUrl as wrBaseUrl } from '@/api/request.js' -// const BaseUrl = "http://192.168.0.120:9999" -const BaseUrl = "http://192.168.0.144:9999" +const BaseUrl = "http://hesuancj.cn:9999" +// const BaseUrl = "https://hesuancj.cn:9095" // const BaseUrl = "http://10.101.33.114:9999" // 鐧诲綍 diff --git a/api/request.js b/api/request.js index da0f940..8e8f968 100644 --- a/api/request.js +++ b/api/request.js @@ -81,11 +81,14 @@ // const BaseUrl = "http://192.168.0.120:9997" // const webSocketUrl = "ws://192.168.0.120:9997/wrzs/ws/info" -// const BaseUrl = "http://192.168.3.109:9997"; -const BaseUrl = "http://192.168.0.144:9997"; +// const BaseUrl = "http://192.168.3.119:9997"; +// const BaseUrl = "http://192.168.0.144:9997"; +const BaseUrl = "http://hesuancj.cn:9997"; +// 绾夸笂 +// const BaseUrl = "https://hesuancj.cn:9095"; -const webSocketUrl = "ws://192.168.3.109:9997/wrzs/ws/info" -// const webSocketUrl = "ws://10.101.33.114:9997/wrzs/ws/info" +// const webSocketUrl = "ws://hesuancj.cn:9095/wrzs/ws/info" +const webSocketUrl = "ws://hesuancj.cn:9997/wrzs/ws/info" // 璇锋眰鎷︽埅 const fetch = (url, opt) => { // 鏌ユ壘瀵瑰簲鍦板潃 diff --git a/main.js b/main.js index 5e8f4b3..6d629e2 100644 --- a/main.js +++ b/main.js @@ -25,6 +25,7 @@ Vue.prototype.$reqAll = reqAll; Vue.prototype.$reqGet = reqGet; Vue.prototype.$reqPost = reqPost; +Vue.prototype.$store = store; // 鐢变簬寰俊灏忕▼搴忕殑杩愯鏈哄埗闂锛岄渶澹版槑濡備笅涓�琛岋紝H5鍜孉PP闈炲繀濉� const app = new Vue({ store, diff --git a/pages/customer-page/customer-index/customer-index.vue b/pages/customer-page/customer-index/customer-index.vue index cce6dc0..b84232b 100644 --- a/pages/customer-page/customer-index/customer-index.vue +++ b/pages/customer-page/customer-index/customer-index.vue @@ -10,7 +10,7 @@ </view> <view class="card-left__utils"> <u-button @tap.stop="receiveClick(item)" text="棰嗗彇" type="primary" v-if="item.cars2 != item.carNum" shape="circle"></u-button> - <u-button text="杞彂" type="primary" @tap.stop="forwardClick(item)" shape="circle" v-if="item.carNum != item.carNumSurplus1"></u-button> + <u-button text="杞彂" type="primary" @tap.stop="forwardClick(item)" shape="circle"></u-button> </view> </template> <template v-slot:right-top> @@ -60,13 +60,13 @@ <uni-th align="center" width="80">鎻愮叅鍗曚釜鏁�</uni-th> </uni-tr> <uni-tr v-for="(item, index) in historyCoalData" :key="index"> - <uni-td align="center">{{ item.sendDate }}</uni-td> - <uni-td align="left">{{ item.deptName }}</uni-td> - <uni-td align="center">{{ item.filedName }}</uni-td> - <uni-td align="center">{{ item.coalName }}</uni-td> - <uni-td align="center">{{ item.orderCode }}</uni-td> - <uni-td align="center">{{ item.carNumSurplus }}</uni-td> - <uni-td align="center">{{ item.tmCount }}</uni-td> + <uni-td align="center" @row-click="faYundetail(item)">{{ item.sendDate }}</uni-td> + <uni-td align="left" @row-click="faYundetail(item)">{{ item.deptName }}</uni-td> + <uni-td align="center" @row-click="faYundetail(item)">{{ item.filedName }}</uni-td> + <uni-td align="center" @row-click="faYundetail(item)">{{ item.coalName }}</uni-td> + <uni-td align="center" @row-click="faYundetail(item)">{{ item.orderCode }}</uni-td> + <uni-td align="center" @row-click="faYundetail(item)">{{ item.carNumSurplus }}</uni-td> + <uni-td align="center" @row-click="faYundetail(item)">{{ item.tmCount }}</uni-td> </uni-tr> </uni-table> <view class="more_text" v-if="showMoreData">娌℃湁鏁版嵁浜�...</view> @@ -99,11 +99,12 @@ combinedTitle }, watch: { - orderPlanDataStore(v) { - if (v.length > 0) { - console.log(v, 'props'); + orderPlanDataStore: { + handler(v) { this.orderPlanData = v; - } + }, + deep: true, + immediate: true } }, data() { @@ -120,7 +121,7 @@ loading: false, scrollTop: 0, // 姣忛〉鏁版嵁閲� - pageSize: 5, + pageSize: 10, // 褰撳墠椤� pageCurrent: 1, // 鏁版嵁鎬婚噺 @@ -161,10 +162,6 @@ this.loading = false; } }); - }, - change2(e) { - this.pageCurrent = e.current; - this.getJhOrderPlanDataPage(); }, // 涓婃媺鍔犺浇 historyScrolltolower() { @@ -218,14 +215,23 @@ }, // 鎻愮叅鍗曡鎯� cardBodyClick(name) { + console.log(name, 'name'); let code = null; + let cars2 = null; this.orderPlanData.forEach(item => { if (item.id == name) { code = item.code; + cars2 = item.cars2; } }); uni.navigateTo({ - url: `/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails?orderPlanId=${name}&code=${code}` + url: `/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails?orderPlanId=${name}&code=${code}&cars2=${cars2}` + }); + }, + // 鐐瑰嚮鍘嗗彶鎻愮叅鍗曚竴琛岃幏鍙栬鎯� + faYundetail(v) { + uni.navigateTo({ + url: `/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails?orderPlanId=${v.id}&cars2=${v.cars2}` }); }, // 杞彂 @@ -239,11 +245,8 @@ </script> <style lang="scss" scoped> -.uni-pagination-box { - height: 60rpx; -} .scroll-Y { - height: 300rpx; + height: 600rpx; .more_text { color: #999; font-size: 24rpx; diff --git a/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue b/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue index b13c229..ed6d1c9 100644 --- a/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue +++ b/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue @@ -10,7 +10,7 @@ </uni-tr> <uni-tr> <uni-th align="left">棰嗗彇鎬婚噺</uni-th> - <uni-td align="left">{{ orderPlanDetail.fleetOrHuodaiNub || 0 }}寮�</uni-td> + <uni-td align="left">{{ cars2 || 0 }}寮�</uni-td> </uni-tr> <uni-tr v-for="(item, index) in orderPlanDetail.huodaiList" :key="index"> <uni-th align="left">{{ item.huoDaiName }}</uni-th> @@ -27,49 +27,25 @@ </uni-table> </view> <combined-title title="鎻愮叅鍗曡鎯�"></combined-title> - <view class="compDetails" v-for="(item, index) in orderPlanDetail.yyDailyList" :key="index"> - <uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁"> - <uni-tr> - <uni-th align="left">鎻愮叅鍗曠紪鍙�</uni-th> - <uni-td align="left">{{ item.code || '' }}</uni-td> - </uni-tr> - <uni-tr> - <uni-th align="left">鎻愮叅鍗曠姸鎬�</uni-th> - <uni-td align="left">{{ coalStatus[item.status] }}</uni-td> - </uni-tr> - <uni-tr> - <uni-th align="left">杞︾墝鍙�</uni-th> - <uni-td align="left">{{ item.carNo || '' }}</uni-td> - </uni-tr> - <uni-tr> - <uni-th align="left">鍏ュ満鏃堕棿</uni-th> - <uni-td align="left">{{ item.inTime || '' }}</uni-td> - </uni-tr> - <uni-tr> - <uni-th align="left">鍑哄満鏃堕棿</uni-th> - <uni-td align="left">{{ item.outTime || '' }}</uni-td> - </uni-tr> - <uni-tr> - <uni-th align="left">鐨噸</uni-th> - <uni-td align="left">{{ item.skin || 0 }}</uni-td> - </uni-tr> - <uni-tr> - <uni-th align="left">姣涢噸</uni-th> - <uni-td align="left">{{ item.hair || 0 }}</uni-td> - </uni-tr> - <uni-tr> - <uni-th align="left">鍑�閲�</uni-th> - <uni-td align="left">{{ item.clean || 0 }}</uni-td> - </uni-tr> - <uni-tr> - <uni-th align="left">璁㈠崟缂栧彿</uni-th> - <uni-td align="left">{{ orderCode || '' }}</uni-td> - </uni-tr> - <uni-tr> - <uni-th align="left">璁㈠崟鍓╀綑閲�</uni-th> - <uni-td align="left">{{ item.allowance || 0 }}</uni-td> - </uni-tr> - </uni-table> + <view class="empty-pointer" v-if="!yyDailyList">鏆傛棤鏇村鏁版嵁</view> + <view class="compDetails card" v-for="(item, index) in yyDailyList" :key="index"> + <view class="coal-status"> + <view class="label-title">鎻愮叅鍗曠姸鎬�</view> + <view class="label-value">{{ coalStatus[item.status] }}</view> + </view> + <view class="coal-clean"> + <view class="label-title">鍑�閲�</view> + <view class="label-value">{{ item.clean || 0 }}</view> + </view> + <view class="coal-carNo"> + <view class="label-title">杞︾墝鍙�</view> + <view class="label-value">{{ item.carNo || '' }}</view> + </view> + <view class="coal-allowance"> + <view class="label-title">浣欓噺</view> + <view class="label-value">{{ item.allowance || 0 }}</view> + </view> + <view class="more-button"><u-button type="success" text="鏇村" @click="showMore(index)"></u-button></view> </view> </view> </view> @@ -82,24 +58,31 @@ combinedTitle }, onLoad(value) { - console.log('椤甸潰鍔犺浇', value); - if (value.orderPlanId && value.code) { - this.orderPlanId = value.orderPlanId; - this.orderCode = value.code; - } + this.orderPlanId = value.orderPlanId; + this.orderCode = value.code; + this.cars2 = value.cars2; + console.log(value, '鍙戣繍璁″垝鍙傛暟'); }, data() { return { orderPlanId: null, orderCode: null, orderPlanDetail: {}, - coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅鍦�', '鍑虹叅浠�'] + coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅鍦�', '鍑虹叅浠�'], + yyDailyList: [], + // 棰嗗彇鏁伴噺 + cars2: '' }; }, onShow() { this.init(); }, methods: { + showMore(index) { + uni.navigateTo({ + url: `/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanMore/fayunPlanMore?orderPlanId=${this.orderPlanId}&index=${index}` + }); + }, init() { this.GetOrderPlanDetail(); }, @@ -111,6 +94,7 @@ this.$reqGet('xiangqingList', { orderPlanId: this.orderPlanId }).then(res => { if (res.code == 0) { this.orderPlanDetail = res.data; + this.yyDailyList = res.data.yyDailyList; uni.hideLoading(); } }); @@ -120,9 +104,16 @@ </script> <style lang="scss" scoped> +.empty-pointer { + position: absolute; + top: 50%; + left: 38%; + color: #909399; +} ::v-deep.fayunPlan { width: 100%; margin: 0 auto; + background-color: #f4f4f4; display: flex; flex-direction: column; .fayunPlanBody { @@ -143,6 +134,41 @@ background-color: #f5f5f5; } } + .card { + width: 94%; + height: vww(150); + margin: vww(24) auto 0 auto; + background-color: #fff; + border-radius: 4px; + box-shadow: 0 2px 12px 0 #ebeef5; + position: relative; + display: flex; + justify-content: center; + align-items: flex-start; + .coal-status, + .coal-clean, + .coal-allowance, + .coal-carNo { + width: 50%; + margin-top: vww(30); + height: vww(50); + text-align: center; + .label-title { + color: #909399; + } + .label-value { + margin-top: vww(10); + color: #606266; + } + } + .more-button { + width: vww(60); + position: absolute; + top: vww(100); + display: flex; + justify-content: center; + } + } // 琛ㄦ牸鏍峰紡 .uni-table { .uni-table-tr { diff --git a/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanMore/fayunPlanMore.vue b/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanMore/fayunPlanMore.vue new file mode 100644 index 0000000..2dedc99 --- /dev/null +++ b/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanMore/fayunPlanMore.vue @@ -0,0 +1,115 @@ +<template> + <view> + <combined-title title="鎻愮叅鍗曡鎯�"></combined-title> + <view class="compDetails" v-for="(item, index) in yyDailyList" :key="index"> + <uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁"> + <uni-tr> + <uni-th align="left">鎻愮叅鍗曠紪鍙�</uni-th> + <uni-td align="left">{{ item.code || '' }}</uni-td> + </uni-tr> + <uni-tr> + <uni-th align="left">鎻愮叅鍗曠姸鎬�</uni-th> + <uni-td align="left">{{ coalStatus[item.status] }}</uni-td> + </uni-tr> + <uni-tr> + <uni-th align="left">杞︾墝鍙�</uni-th> + <uni-td align="left">{{ item.carNo || '' }}</uni-td> + </uni-tr> + <uni-tr> + <uni-th align="left">鍏ュ満鏃堕棿</uni-th> + <uni-td align="left">{{ item.inTime || '' }}</uni-td> + </uni-tr> + <uni-tr> + <uni-th align="left">鍑哄満鏃堕棿</uni-th> + <uni-td align="left">{{ item.outTime || '' }}</uni-td> + </uni-tr> + <uni-tr> + <uni-th align="left">鐨噸</uni-th> + <uni-td align="left">{{ item.skin || 0 }}</uni-td> + </uni-tr> + <uni-tr> + <uni-th align="left">姣涢噸</uni-th> + <uni-td align="left">{{ item.hair || 0 }}</uni-td> + </uni-tr> + <uni-tr> + <uni-th align="left">鍑�閲�</uni-th> + <uni-td align="left">{{ item.clean || 0 }}</uni-td> + </uni-tr> + <uni-tr> + <uni-th align="left">璁㈠崟缂栧彿</uni-th> + <uni-td align="left">{{ item.orderCode || '' }}</uni-td> + </uni-tr> + <uni-tr> + <uni-th align="left">璁㈠崟鍓╀綑閲�</uni-th> + <uni-td align="left">{{ item.allowance || 0 }}</uni-td> + </uni-tr> + </uni-table> + </view> + </view> +</template> + +<script> +import combinedTitle from '@/components/combined-title/combined-title.vue'; + +export default { + components: { + combinedTitle + }, + onLoad(params) { + this.orderPlanId = params.orderPlanId; + this.index = params.index; + }, + onShow() { + this.GetOrderPlanDetail(); + }, + data() { + return { + orderPlanId: '', + yyDailyList: [], + orderPlanDetail: {}, + coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅鍦�', '鍑虹叅浠�'], + index: '' + }; + }, + methods: { + GetOrderPlanDetail() { + uni.showLoading({ + title: '鍔犺浇涓�...' + }); + this.$reqGet('xiangqingList', { orderPlanId: this.orderPlanId }).then(res => { + if (res.code == 0) { + this.orderPlanDetail = res.data; + this.yyDailyList = res.data.yyDailyList.filter((v, i) => i == this.index); + uni.hideLoading(); + } + }); + } + } +}; +</script> + +<style scoped lang="scss"> +.uni-table { + .uni-table-tr { + padding: 0; + border: vww(1) solid #c6c6c6; + .uni-table-th { + font-size: vww(14); + height: vww(30); + line-height: vww(30); + padding: vww(5) vww(10); + color: #111111; + font-weight: 500; + background: #e2e2e2; + } + .uni-table-td { + font-size: vww(14); + font-weight: 400; + height: vww(30); + line-height: vww(30); + padding: vww(5) vww(10); + color: #111111; + } + } +} +</style> diff --git a/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue b/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue index 0080b04..b4bcb74 100644 --- a/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue +++ b/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue @@ -52,7 +52,7 @@ yyId: null, dayRZ: [], coalDetailsData: {}, // 鎻愮叅鍗曡鎯� - currentPageCoalStatus:0,// 褰撳墠椤甸潰鎻愮叅鍗曠姸鎬� + currentPageCoalStatus: 0, // 褰撳墠椤甸潰鎻愮叅鍗曠姸鎬� // 鑾峰彇鎵�鍦ㄧ鎴垮弬鏁� getWeightHouseObj: { deptId: '', @@ -77,8 +77,7 @@ openId: null, openName: '' }, - coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅鍦�', '鍑虹叅浠�'] ,// 鐘舵�� - + coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅鍦�', '鍑虹叅浠�'] // 鐘舵�� }; }, onShow() { @@ -108,6 +107,8 @@ if (res.data.length > 0) { this.serviceInfoObj.openId = res.data[0].openId; this.serviceInfoObj.openName = res.data[0].openName; + uni.setStorageSync('customeropenId', this.serviceInfoObj.openId); + uni.setStorageSync('customerName', this.serviceInfoObj.openName); } } }); @@ -131,7 +132,7 @@ this.getServiceOpenid.deptId = this.coalDetailsData.deptId; this.getServiceOpenid.filedId = this.coalDetailsData.filedId; // 鑾峰彇鎻愮叅鍗曠姸鎬� - this.currentPageCoalStatus = this.coalDetailsData.status + this.currentPageCoalStatus = this.coalDetailsData.status; } }); }, @@ -152,7 +153,9 @@ // 绛惧埌 arriveClick() { uni.navigateTo({ - url: `/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock?orderPlanId=${this.orderPlanId}&coalStatus=${this.currentPageCoalStatus}` + url: `/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock?orderPlanId=${this.orderPlanId}&coalStatus=${ + this.currentPageCoalStatus + }&tmId=${this.getWeightHouseObj.tmId}` }); }, // 鍏ュ満鐢宠 @@ -184,7 +187,7 @@ } else { wx.join1v1Chat({ caller: { nickname: uni.getStorageSync('name'), openid: uni.getStorageSync('openid') }, - listener: { nickname: '浠樺欢浣�', openid: 'oZjXk5e7G9uIvOzaTO6nFV51ALwk' }, // 杩欓噷鐨刼penid鏄痜yy鐨勶紝鍏呭綋鍥哄畾鐨勫鏈峯penid + listener: { nickname: uni.getStorageSync('customerName'), openid: uni.getStorageSync('customeropenId') }, // 杩欓噷鐨刼penid鏄痜yy鐨勶紝鍏呭綋鍥哄畾鐨勫鏈峯penid backgroundType: 2, roomType: 'voice', success() { @@ -215,9 +218,9 @@ console.log(res, '鑾峰彇纾呮埧'); if (res.code == 0) { uni.navigateTo({ - url: `/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice?takeCoalId=${this.orderPlanId}&sceneId=${res.data.id}&gateCameraId=${ - res.data.lastEquipmentId - }&gateCameraCode=${res.data.lastEquipmentCode}&weighHouseCode=${res.data.code}` + url: `/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice?takeCoalId=${this.orderPlanId}&sceneId=${ + res.data.id + }&gateCameraId=${res.data.lastEquipmentId}&gateCameraCode=${res.data.lastEquipmentCode}&weighHouseCode=${res.data.code}` }); } else { this.$u.toast('鏈湪纾呮埧锛岃鍓嶅線纾呮埧鍚庡啀璇曪紒锛�'); diff --git a/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue b/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue index 4c20882..008c53a 100644 --- a/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue +++ b/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue @@ -21,19 +21,17 @@ import { todayDate } from '@/utils/util.js'; export default { onLoad(params) { - if (params.orderPlanId && params.coalStatus) { - this.punchTheClockObj.id = params.orderPlanId; - this.coalStatus = params.coalStatus; - } + this.punchTheClockObj.tmcoa = params.tmId.toString(); + this.coalStatus = params.coalStatus; }, data() { return { nowTime: '', coalStatus: 0, punchTheClockObj: { - latitude: null, - longitude: null, - id: null + tmcoa: null, + latA: null, + latB: null } }; }, @@ -69,8 +67,8 @@ type: 'wgs84', success(res) { console.log(res, '鑾峰彇浣嶇疆', that); - that.punchTheClockObj.latitude = res.latitude; - that.punchTheClockObj.longitude = res.longitude; + that.punchTheClockObj.latB = res.latitude; + that.punchTheClockObj.latA = res.longitude; } }); }, @@ -81,7 +79,8 @@ }, // 绛惧埌 arrive() { - if (this.punchTheClockObj.latitude && this.punchTheClockObj.longitude) { + if (this.punchTheClockObj.latA && this.punchTheClockObj.latB) { + console.log(this.punchTheClockObj); this.$reqPost('arrive', this.punchTheClockObj, 'params').then(res => { console.log(res, '绛惧埌'); if (res.code == 0) { @@ -95,7 +94,7 @@ ); }); } else { - this.$u.toast(res.data ? res.data : '绛惧埌澶辫触'); + this.$u.toast(res.msg ? res.msg : '绛惧埌澶辫触'); } }); } else { @@ -123,7 +122,7 @@ display: flex; justify-content: center; align-items: center; - p{ + p { text-align: center; } } diff --git a/pages/driver-page/driver-index/driver-index.vue b/pages/driver-page/driver-index/driver-index.vue index 630c030..d8a4eba 100644 --- a/pages/driver-page/driver-index/driver-index.vue +++ b/pages/driver-page/driver-index/driver-index.vue @@ -172,6 +172,7 @@ // 鎶㈠崟妯℃�佹 qiangDanConfirm() { this.qiangDanContent = ''; + this.qiangDanShow = false; this.qiangDan(this.qiangDanOrderPlanId, this.fleetId); }, qiangDanCancel() { @@ -179,16 +180,19 @@ }, // 鎶㈠崟璇锋眰 qiangDan(id, fleetId) { - this.$reqPost('qiangDan', { orderPlanId: id, fleetId: fleetId }, 'params').then(res => { - if (res.code == 0) { - this.$u.toast('鎶㈠崟鎴愬姛'); - this.qiangDanShow = false; - this.qiangDanList(); - } else { - this.$u.toast(res.data ? res.data : '鎶㈠崟澶辫触'); - this.qiangDanShow = false; - } - }); + this.$reqPost('qiangDan', { orderPlanId: id, fleetId: fleetId }, 'params') + .then(res => { + if (res.code == 0) { + this.$u.toast('鎶㈠崟鎴愬姛'); + } else { + this.$u.toast(res.data ? res.data : '鎶㈠崟澶辫触'); + } + }) + .then(() => { + setTimeout(() => { + this.qiangDanList(); + }, 1000); + }); }, list3CardIconClick(value) { uni.navigateTo({ diff --git a/pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue b/pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue index 57ba501..37f7a57 100644 --- a/pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue +++ b/pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue @@ -29,14 +29,56 @@ </template> </card> </view> + <view class="history-numbers"> + <combined-title title="鍘嗗彶鎻愮叅鍗�"></combined-title> + <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltolower="historyScrolltolower"> + <uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁" :loading="loading"> + <uni-tr> + <uni-th width="100" align="center">鍙戣繍鏃ユ湡</uni-th> + <uni-th width="100" align="center">鎵�灞炲崟浣�</uni-th> + <uni-th align="center" width="150">鐓ゅ満鍚嶇О</uni-th> + <uni-th align="center" width="100">鐓ょ鍚嶇О</uni-th> + <uni-th align="center" width="150">璁㈠崟缂栧彿</uni-th> + <uni-th align="center" width="100">璁㈠崟鍓╀綑閲�</uni-th> + <uni-th align="center" width="80">鎻愮叅鍗曚釜鏁�</uni-th> + </uni-tr> + <uni-tr v-for="(item, index) in historyCoalData" :key="index"> + <uni-td align="center">{{ item.sendDate }}</uni-td> + <uni-td align="left">{{ item.deptName }}</uni-td> + <uni-td align="center">{{ item.filedName }}</uni-td> + <uni-td align="center">{{ item.coalName }}</uni-td> + <uni-td align="center">{{ item.orderCode }}</uni-td> + <uni-td align="center">{{ item.carNumSurplus }}</uni-td> + <uni-td align="center">{{ item.tmCount }}</uni-td> + </uni-tr> + </uni-table> + <view class="more_text" v-if="showMoreData">娌℃湁鏁版嵁浜�...</view> + </scroll-view> + </view> </view> </template> <script> +import combinedTitle from '@/components/combined-title/combined-title.vue'; export default { + components: { + combinedTitle + }, data() { return { - orderPlanData: [] + orderPlanData: [], + historyCoalData: [], + // 琛ㄦ牸鍔犺浇鐘舵�� + loading: false, + scrollTop: 0, + // 姣忛〉鏁版嵁閲� + pageSize: 10, + // 褰撳墠椤� + pageCurrent: 1, + // 鏁版嵁鎬婚噺 + total: 0, + // 鏄惁鏄剧ず鏇村鏁版嵁 + showMoreData: false }; }, onShow() { @@ -48,8 +90,25 @@ } }, methods: { + getJhOrderPlanDataPage() { + this.loading = true; + this.$reqGet('getJhOrderPlanDataPage', { current: this.pageCurrent, size: this.pageSize }).then(res => { + if (res.data.records) { + this.historyCoalData = [...this.historyCoalData, ...res.data.records]; + this.total = res.data.total; + this.loading = false; + } + }); + }, + // 涓婃媺鍔犺浇 + historyScrolltolower() { + if (this.pageCurrent * this.pageSize >= this.total) return (this.showMoreData = true); + this.pageCurrent++; + this.getJhOrderPlanDataPage(); + }, init() { this.huoDaiList(); + this.getJhOrderPlanDataPage(); }, huoDaiList() { this.$reqGet('huoDaiList').then(res => { @@ -78,6 +137,14 @@ </script> <style lang="scss" scoped> +.scroll-Y { + height: 600rpx; + .more_text { + color: #999; + font-size: 24rpx; + text-align: center; + } +} ::v-deep.freightForwarder-index { width: 94%; margin: 0 auto; diff --git a/pages/login/login.vue b/pages/login/login.vue index d87737f..c362e72 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -61,6 +61,7 @@ uni.login({ success: res => { if (res.code) { + uni.setStorageSync('code', res.code); this.apiLogin(res.code); } else { uni.showToast({ @@ -80,20 +81,20 @@ uni.showLoading({ title: '鍔犺浇涓�...' }); - wx.request({ - url: `https://api.weixin.qq.com/sns/jscode2session?appid=wx4a62fc1684c429a9&secret=ee90afe376cdcec2fdd947c0a4db961a&js_code=${code}&grant_type=authorization_code`, - success(res) { - uni.setStorageSync('openid', res.data.openid); - uni.showToast({ - title: '鎴愬姛鑾峰彇娴嬭瘯openid', - icon: 'none' - }); - } - }); + // wx.request({ + // url: `https://api.weixin.qq.com/sns/jscode2session?appid=wx4a62fc1684c429a9&secret=ee90afe376cdcec2fdd947c0a4db961a&js_code=${code}&grant_type=authorization_code`, + // success(res) { + // uni.setStorageSync('openid', res.data.openid); + // uni.showToast({ + // title: '鎴愬姛鑾峰彇娴嬭瘯openid', + // icon: 'none' + // }); + // } + // }); this.$nextTick(() => { - apiLoginWx({ code: uni.getStorageSync('openid') }).then(res => { + apiLoginWx({ code: code }).then(res => { if (res.code != 1) { - this.$u.toast('鎭枩鎮紝鐧诲綍鎴愬姛锛�'); + this.$u.toast('鐧诲綍鎴愬姛'); // 鐧婚檰鎴愬姛锛屽瓨鍌ㄧ浉鍏充俊鎭� setToken(res.access_token); setRefreshToken(res.refresh_token); @@ -119,7 +120,7 @@ }, bindWxConfirm() { uni.navigateTo({ - url: `/pages/login/wxLogin?code=${uni.getStorageSync('openid')}` + url: `/pages/login/wxLogin?code=${uni.getStorageSync('code')}` }); this.bindWxModelShow = false; }, diff --git a/pages/login/userPassword.vue b/pages/login/userPassword.vue index 06e0f79..e71f036 100644 --- a/pages/login/userPassword.vue +++ b/pages/login/userPassword.vue @@ -87,7 +87,7 @@ //鏌ヨ鐢ㄦ埛璇︾粏淇℃伅骞跺偍瀛� this.$reqGet('getUserEntity') .then(res => { - this.$u.toast('鎭枩鎮紝鐧诲綍鎴愬姛锛�'); + this.$u.toast('鐧诲綍鎴愬姛'); this.setUserTabbar(res.data.type); uni.setStorageSync('roleType', res.data.type); setCustomerId(res.data.customerid); @@ -107,7 +107,7 @@ this.$u.toast(res.msg); } } else { - this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('openid') }, 'params').then(res => { + this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('code') }, 'params').then(res => { uni.hideLoading(); if (res.code == 0) { this.$u.toast('缁戝畾鎴愬姛锛佸嵆灏嗗洖鍒扮櫥褰曢〉锛�'); diff --git a/pages/public-page/forward/forward.vue b/pages/public-page/forward/forward.vue index 9b1f156..e98e380 100644 --- a/pages/public-page/forward/forward.vue +++ b/pages/public-page/forward/forward.vue @@ -69,7 +69,7 @@ } this.orderPlanId = params.orderPlanId; this.$reqGet('forwardList', { OrderPlanId: params.orderPlanId }).then(res => { - if (res.data) { + if (res.data.length !== 0) { this.jhOrderPlanForwardList = res.data.map(item => { return { id: item.id, diff --git a/pages/register/register.vue b/pages/register/register.vue index 5767e42..9948ed9 100644 --- a/pages/register/register.vue +++ b/pages/register/register.vue @@ -46,7 +46,9 @@ mode="widthFix" style="width: 250px;height: 150px;"></image> --> </u-upload> </u-form-item> - <u-form-item label="鎺ㄨ崘浜鸿处鍙�" labelWidth="25%" borderBottom><u--input v-model="registerFormModel.tuiJianMa" placeholder="璇疯緭鍏ュ唴瀹�" clearable></u--input></u-form-item> + <u-form-item label="鎺ㄨ崘浜鸿处鍙�" labelWidth="25%" borderBottom> + <u--input v-model="registerFormModel.tuiJianMa" placeholder="璇疯緭鍏ュ唴瀹�" clearable></u--input> + </u-form-item> </u--form> </view> <view class="roleModel"> @@ -233,7 +235,7 @@ .then(res => { if (res.data.code == 0) { uni.showToast({ - title: '娉ㄥ唽鎴愬姛,鍗冲皢杩涘叆鐧诲綍锛�', + title: '娉ㄥ唽鎴愬姛,鍗冲皢杩斿洖鐧诲綍椤�', icon: 'none', duration: 1000 }); @@ -241,7 +243,7 @@ uni.redirectTo({ url: '/pages/login/login' }); }, 1000); } else { - this.$u.toast(res.data.data?res.data.data:'娣诲姞澶辫触'); + this.$u.toast(res.data.data ? res.data.data : '娣诲姞澶辫触'); } }) .catch(err => { diff --git a/store/index.js b/store/index.js index 1396e8d..5669602 100644 --- a/store/index.js +++ b/store/index.js @@ -36,7 +36,8 @@ // 鐢ㄦ埗鐣岄潰鍒ゆ柗 userInfo: {}, roleType: null, // 1瀹㈡埛锛�2璐т唬锛�3鍙告満 - userTabbar: [] ,// 鐢ㄦ埛鎵�鍦ㄨ鑹插簳閮ㄨ彍鍗曪紝 + userTabbar: [], // 鐢ㄦ埛鎵�鍦ㄨ鑹插簳閮ㄨ彍鍗曪紝 + orderPlanDataStore: [], }, mutations: { setUserInfo(state, identity) { diff --git a/uni_modules/uni-table/components/uni-td/uni-td.vue b/uni_modules/uni-table/components/uni-td/uni-td.vue index 9ce93e9..ecfb882 100644 --- a/uni_modules/uni-table/components/uni-td/uni-td.vue +++ b/uni_modules/uni-table/components/uni-td/uni-td.vue @@ -1,90 +1,90 @@ <template> <!-- #ifdef H5 --> - <td class="uni-table-td" :rowspan="rowspan" :colspan="colspan" :class="{'table--border':border}" :style="{width:width + 'px','text-align':align}"> + <td class="uni-table-td" @click="getRow" :rowspan="rowspan" :colspan="colspan" :class="{ 'table--border': border }" :style="{ width: width + 'px', 'text-align': align }"> <slot></slot> </td> <!-- #endif --> <!-- #ifndef H5 --> <!-- :class="{'table--border':border}" --> - <view class="uni-table-td" :class="{'table--border':border}" :style="{width:width + 'px','text-align':align}"> - <slot></slot> - </view> + <view class="uni-table-td" @click="getRow" :class="{ 'table--border': border }" :style="{ width: width + 'px', 'text-align': align }"><slot></slot></view> <!-- #endif --> - </template> <script> - /** - * Td 鍗曞厓鏍� - * @description 琛ㄦ牸涓殑鏍囧噯鍗曞厓鏍肩粍浠� - * @tutorial https://ext.dcloud.net.cn/plugin?id=3270 - * @property {Number} align = [left|center|right] 鍗曞厓鏍煎榻愭柟寮� - */ - export default { - name: 'uniTd', - options: { - virtualHost: true +/** + * Td 鍗曞厓鏍� + * @description 琛ㄦ牸涓殑鏍囧噯鍗曞厓鏍肩粍浠� + * @tutorial https://ext.dcloud.net.cn/plugin?id=3270 + * @property {Number} align = [left|center|right] 鍗曞厓鏍煎榻愭柟寮� + */ +export default { + name: 'uniTd', + options: { + virtualHost: true + }, + props: { + width: { + type: [String, Number], + default: '' }, - props: { - width: { - type: [String, Number], - default: '' - }, - align: { - type: String, - default: 'left' - }, - rowspan: { - type: [Number,String], - default: 1 - }, - colspan: { - type: [Number,String], - default: 1 + align: { + type: String, + default: 'left' + }, + rowspan: { + type: [Number, String], + default: 1 + }, + colspan: { + type: [Number, String], + default: 1 + } + }, + data() { + return { + border: false + }; + }, + created() { + this.root = this.getTable(); + this.border = this.root.border; + }, + methods: { + getRow() { + this.$emit('row-click'); + }, + /** + * 鑾峰彇鐖跺厓绱犲疄渚� + */ + getTable() { + let parent = this.$parent; + let parentName = parent.$options.name; + while (parentName !== 'uniTable') { + parent = parent.$parent; + if (!parent) return false; + parentName = parent.$options.name; } - }, - data() { - return { - border: false - }; - }, - created() { - this.root = this.getTable() - this.border = this.root.border - }, - methods: { - /** - * 鑾峰彇鐖跺厓绱犲疄渚� - */ - getTable() { - let parent = this.$parent; - let parentName = parent.$options.name; - while (parentName !== 'uniTable') { - parent = parent.$parent; - if (!parent) return false; - parentName = parent.$options.name; - } - return parent; - }, + return parent; } } +}; </script> <style lang="scss"> - $border-color:#EBEEF5; +$border-color: #ebeef5; - .uni-table-td { - display: table-cell; - padding: 8px 10px; - font-size: 14px; - border-bottom: 1px $border-color solid; - font-weight: 400; - color: #606266; - line-height: 23px; - box-sizing: border-box; - } +.uni-table-td { + display: table-cell; + padding: 8px 10px; + font-size: 14px; + border-bottom: 1px $border-color solid; + font-weight: 400; + color: #606266; + line-height: 23px; + box-sizing: border-box; +} - .table--border { - border-right: 1px $border-color solid; - } +.table--border { + border-right: 1px $border-color solid; +} </style> diff --git a/utils/util.js b/utils/util.js index f9b67d7..7285440 100644 --- a/utils/util.js +++ b/utils/util.js @@ -1,4 +1,4 @@ -export function todayDate(arg){ +export function todayDate(arg) { let date = new Date() let year = date.getFullYear() let month = date.getMonth() + 1; @@ -6,11 +6,10 @@ let hour = date.getHours() let minutes = date.getMinutes() let seconds = date.getSeconds() - console.log(arg,'鏃堕棿'); - if(arg == 'hms'){ + if (arg == 'hms') { hour = hour < 10 ? '0' + hour : hour minutes = minutes < 10 ? '0' + minutes : minutes seconds = seconds < 10 ? '0' + seconds : seconds - return hour+':'+minutes+':' + seconds + return hour + ':' + minutes + ':' + seconds } -} \ No newline at end of file +} -- Gitblit v1.9.1