| | |
| | | method: "GET" |
| | | }, |
| | | |
| | | |
| | | // 用户 |
| | | // 获取用户信息 |
| | | getUserEntity: { |
| | |
| | | url: "/wrzs/userOperation/weighList", |
| | | method: 'GET' |
| | | }, |
| | | // 获取所在磅房 |
| | | getWeighHouse:{ |
| | | url:"/wrzs/jccoalweighhouse/getWeighHouse", |
| | | method:'GET' |
| | | }, |
| | | |
| | | // 提煤单日志查询 |
| | | coalDayPage: { |
| | | url: "/wrzs/tmtaskcoallog/page", |
| | | url: "/wrzs/tmtaskcoallog/getTmId", |
| | | method: 'GET' |
| | | } |
| | | } |
| | |
| | | // const BaseUrl = "http://192.168.3.159:9999/"; |
| | | import {BaseUrl as wrBaseUrl} from '@/api/request.js' |
| | | // const BaseUrl = "http://192.168.0.120:9999" |
| | | const BaseUrl = "http://192.168.0.130:9999" |
| | | const BaseUrl = "http://192.168.3.130:9999" |
| | | |
| | | // 登录 |
| | | // function apiLogin({ |
| | |
| | | |
| | | // const BaseUrl = "http://192.168.0.120:9997" |
| | | // const webSocketUrl = "ws://192.168.0.120:9997/wrzs/ws/info" |
| | | const BaseUrl = "http://192.168.0.130:9997"; |
| | | const webSocketUrl = "ws://192.168.0.130:9997/wrzs/ws/info" |
| | | const BaseUrl = "http://192.168.3.130:9997"; |
| | | const webSocketUrl = "ws://192.168.3.130:9997/wrzs/ws/info" |
| | | |
| | | // 请求拦截 |
| | | const fetch = (url, opt) => { |
| | |
| | | "enablePullDownRefresh": false |
| | | } |
| | | |
| | | }, { |
| | | "path": "pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock", |
| | | "style": { |
| | | "navigationBarTitleText": "矿场签到", |
| | | "enablePullDownRefresh": false |
| | | } |
| | | |
| | | } |
| | | ,{ |
| | | "path" : "pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock", |
| | | "style" : |
| | | { |
| | | "navigationBarTitleText": "", |
| | | "enablePullDownRefresh": false |
| | | } |
| | | |
| | | } |
| | | ], |
| | | ], |
| | | "tabBar": { |
| | | // "color": "#999794", |
| | | // "selectedColor": "#007AFF", |
| | |
| | | <script> |
| | | import card from '@/components/card/card.vue'; |
| | | import { customerId } from '@/utils/status'; |
| | | import { todayDate } from '@/utils/util.js'; |
| | | export default { |
| | | components: { |
| | | card |
| | |
| | | |
| | | <script> |
| | | import combinedTitle from '@/components/combined-title/combined-title.vue'; |
| | | import { BigNumber } from 'bignumber.js'; |
| | | export default { |
| | | components: { |
| | | combinedTitle |
| | |
| | | this.$reqPost('yuYue', { takeCoalId: this.yuYuePostParams.takeCoalId, yuYueId: this.yuYuePostParams.yuYueId }, 'params').then(res => { |
| | | if (res.code == 0) { |
| | | this.$u.toast('预约成功!'); |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }) |
| | | } else { |
| | | this.$u.toast(res.data ? res.data : '预约失败'); |
| | | } |
| | |
| | | <u-button text="放空" type="primary" plain></u-button> |
| | | <u-button text="呼叫客服" type="primary" plain></u-button> |
| | | </view> |
| | | <view class="utils_chil"><u-button text="展示提煤单" @click="showCaolPickUpBill" type="primary" ></u-button></view> |
| | | <view class="utils_chil"><u-button text="展示提煤单" @click="showCaolPickUpBill" type="primary"></u-button></view> |
| | | <view class="utils_chil"><u-button text="上磅计量" @click="cengZhongClick" type="primary"></u-button></view> |
| | | </view> |
| | | </view> |
| | |
| | | return { |
| | | orderPlanId: null, |
| | | yyId: null, |
| | | dayRZ: [] |
| | | dayRZ: [], |
| | | coalDetailsData: {}, // 提煤单详情 |
| | | getWeightHouseObj: { |
| | | // 获取所在磅房 |
| | | deptId: '', |
| | | filedId: '', |
| | | tmId: '', |
| | | tmCode: '', |
| | | carNo: '' |
| | | } |
| | | }; |
| | | }, |
| | | onShow() { |
| | | this.init(); |
| | | }, |
| | | computed:{ |
| | | userName(){ |
| | | return uni.getStorageSync('username') |
| | | computed: { |
| | | userName() { |
| | | return uni.getStorageSync('username'); |
| | | }, |
| | | openid(){ |
| | | return uni.getStorageSync('openid') |
| | | openid() { |
| | | return uni.getStorageSync('openid'); |
| | | } |
| | | }, |
| | | methods: { |
| | | init() { |
| | | this.coalDayPage(); |
| | | this.getTakeCoal(); |
| | | }, |
| | | // 获取提煤单详情 |
| | | getTakeCoal() { |
| | | this.$reqGet('getTakeCoal', { takeCoalId: this.orderPlanId }).then(res => { |
| | | if (res.code == 0) { |
| | | this.coalDetailsData = res.data[0]; |
| | | this.getWeightHouseObj.deptId = this.coalDetailsData.deptId; |
| | | this.getWeightHouseObj.filedId = this.coalDetailsData.filedId; |
| | | this.getWeightHouseObj.tmId = this.coalDetailsData.id; |
| | | this.getWeightHouseObj.tmCode = this.coalDetailsData.code; |
| | | this.getWeightHouseObj.carNo = this.coalDetailsData.carNo; |
| | | } |
| | | }); |
| | | }, |
| | | // 日志查询 |
| | | coalDayPage() { |
| | | this.$reqGet('coalDayPage').then(res => { |
| | | this.$reqGet('coalDayPage', { id: this.orderPlanId }).then(res => { |
| | | if (res.code == 0) { |
| | | this.dayRZ = res.data.records; |
| | | this.dayRZ = res.data; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | }, |
| | | // 签到 |
| | | arriveClick() { |
| | | this.$reqPost('arrive', { id: this.orderPlanId }, 'params').then(res => { |
| | | console.log(res, '签到'); |
| | | uni.navigateTo({ |
| | | url: `/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock?orderPlanId=${this.orderPlanId}` |
| | | }); |
| | | }, |
| | | // 入场申请 |
| | |
| | | }); |
| | | }, |
| | | // 呼叫客服 |
| | | callCustomerService(){ |
| | | callCustomerService() { |
| | | wx.join1v1Chat({ |
| | | caller: { nickname:this.userName , openid: this.openid }, |
| | | caller: { nickname: this.userName, openid: this.openid }, |
| | | listener: { nickname: '客服', openid: 'orutI5YT0yEvARVngdsTmBpisWmw' }, // 这里的openid是fyy的,充当固定的客服openid |
| | | backgroundType: 2, |
| | | roomType: 'voice' |
| | |
| | | }, |
| | | // 称重 |
| | | cengZhongClick() { |
| | | uni.navigateTo({ |
| | | url:`/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice?takeCoalId=${this.orderPlanId}` |
| | | }) |
| | | this.$reqGet('getWeighHouse', this.getWeightHouseObj).then(res => { |
| | | 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.gateCameraId}&gateCameraCode=${res.data.gateCameraCode}&weighCode=${res.data.weighCode}` |
| | | }); |
| | | }else{ |
| | | this.$u.toast('未在磅房,请前往磅房后再试!!') |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * @desc 等待取煤单接口 |
| | | * */ |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | padding: vww(20); |
| | | box-sizing: border-box; |
| | | overflow-y: overlay; //行为与 auto 相同,但是滚动条绘制在内容之上,而不是占据空间。 |
| | | .u-text{ |
| | | margin-bottom: vww(5)!important; |
| | | .u-text { |
| | | margin-bottom: vww(5) !important; |
| | | } |
| | | } |
| | | .utilsBox { |
| | |
| | | <view class="punchTheClock"> |
| | | <!-- 打卡按钮 --> |
| | | <view class="punchTheClock_container"> |
| | | <view class="punchTheClock_btn">签到/打卡</view> |
| | | <view class="punchTheClock_text"><text>未进入考勤区域</text></view> |
| | | <view class="punchTheClock_btn"> |
| | | <view class=""> |
| | | <p>签到/打卡</p> |
| | | <p>{{ nowTime }}</p> |
| | | </view> |
| | | </view> |
| | | <view class="punchTheClock_text"> |
| | | <u-icon name="map" color="#51e30d" size="30"></u-icon> |
| | | <text>未进入矿场区域</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { todayDate } from '@/utils/util.js'; |
| | | export default { |
| | | data() { |
| | | return {}; |
| | | onLoad(params){ |
| | | if(params.orderPlanId){ |
| | | this.orderPlanId = params.orderPlanId |
| | | } |
| | | }, |
| | | methods: {} |
| | | data() { |
| | | return { |
| | | nowTime: '', |
| | | orderPlanId:null |
| | | }; |
| | | }, |
| | | onShow() { |
| | | this.todayDate(); |
| | | }, |
| | | methods: { |
| | | todayDate() { |
| | | setInterval(() => { |
| | | this.nowTime = todayDate('hms'); |
| | | }, 1000); |
| | | }, |
| | | // 签到 |
| | | arrive(){ |
| | | this.$reqPost('arrive', { id: this.orderPlanId }, 'params').then(res => { |
| | | console.log(res, '签到'); |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .punchTheClock{ |
| | | display:flex; |
| | | .punchTheClock { |
| | | height: 100vh; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | .punchTheClock_container{ |
| | | .punchTheClock_btn{ |
| | | width:vww(240); |
| | | height:vww(240); |
| | | .punchTheClock_container { |
| | | .punchTheClock_btn { |
| | | width: vww(240); |
| | | height: vww(240); |
| | | color: #ffffff; |
| | | font-size: vww(20); |
| | | border-radius: 50%; |
| | | background-color: #ffd63e; |
| | | display:flex; |
| | | background-color: #36d4e5; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | .punchTheClock_text{ |
| | | |
| | | .punchTheClock_text { |
| | | display:flex; |
| | | justify-content: center; |
| | | margin-top: vww(20); |
| | | color: #b8b8b8; |
| | | .text{ |
| | | margin-left:vww(5); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | </style> |
| | |
| | | <view class="weighingDevice"> |
| | | <view class="one"> |
| | | <view class="top"> |
| | | <view class="top_left"><text>41.5</text></view> |
| | | <view class="top_left"> |
| | | <text>{{ realTimeWeigh }}</text> |
| | | </view> |
| | | <view class="top_right"> |
| | | <view class=""> |
| | | 称重: |
| | |
| | | import { webSocketUrl } from '@/api/request.js'; |
| | | export default { |
| | | onLoad(params) { |
| | | console.log('称重页面', params); |
| | | this.takeCoalId = params.takeCoalId; |
| | | this.weighData.sceneId = params.sceneId; |
| | | this.weighData.gateCameraId = params.gateCameraId; |
| | | this.weighData.equipmentCode = params.gateCameraCode; |
| | | this.weighCode = params.weighCode; |
| | | }, |
| | | data() { |
| | | return { |
| | | weighData: { |
| | | //确认称重接口参数 |
| | | deptId: '', |
| | | tmId: '', |
| | | sceneId: '', |
| | | carNo: '', |
| | | gateCameraId: '', |
| | | equipmentCode: '', |
| | | weigh: '', |
| | | tmCode: '' |
| | | }, |
| | | takeCoalId: null, |
| | | weighCode: '', |
| | | realTimeWeigh: '', |
| | | weighList: {}, |
| | | webSocket: null // webSocket实例 |
| | | // lockReconnect: false, // 重连锁,避免多次重连 |
| | |
| | | console.log(res, '获取称重信息'); |
| | | if (res.code == 0) { |
| | | this.weighList = res.data; |
| | | this.weighData.deptId = res.data.deptId; |
| | | this.weighData.tmId = res.data.id; |
| | | this.weighData.carNo = res.data.carNo; |
| | | this.weighData.tmCode = res.data.code; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | * @确认称重等待后端提供实时称重接口,获取皮重,毛重 |
| | | */ |
| | | confirmWeigh() { |
| | | // this.$reqPost('saveWeigh',{id:this.takeCoalId,skin:'',hair:''}).then(res=>{ |
| | | // console.log(res,"确认称重"); |
| | | // }) |
| | | console.log('确认称重', this.weighData); |
| | | this.$reqPost('saveWeigh',this.weighData,'json').then(res=>{ |
| | | console.log(res,"确认称重"); |
| | | }) |
| | | }, |
| | | /** |
| | | * 初始化 weoSocket |
| | | */ |
| | | initWebSocket() { |
| | | // let wsUrl = `wss://192.168.0.120:9997/wrzs/ws/info?access_token=${this.token}`; |
| | | let wsUrl = `${webSocketUrl}?access_token=c954c7f5-f34b-453e-8c9d-e291747b401f`; |
| | | let wsUrl = `${webSocketUrl}?access_token=${uni.getStorageSync('token')}`; |
| | | socket = uni.connectSocket({ |
| | | url: wsUrl, |
| | | header: { |
| | |
| | | console.log('onOpen'); |
| | | }); |
| | | socket.onMessage(res => { |
| | | console.log(res, '服务器返回的数据'); |
| | | console.log('socketWeigh', res); |
| | | let nowWeigh = JSON.parse(res.data.slice(7)).weigh; |
| | | // if (nowWeigh.eqCode == this.weighCode) { |
| | | // this.weighData.weigh = this.realTimeWeigh = nowWeigh; |
| | | // } |
| | | this.weighData.weigh = this.realTimeWeigh = nowWeigh; |
| | | }); // 获取服务器传来的数据,做相应处理 |
| | | socket.onClose(() => { |
| | | console.log('close'); |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | username: 'appuser',// 客户 |
| | | // username: '12222222222',// 客户 |
| | | // username: '18805080506',// 王楠(司机) |
| | | username: '13333333332',// driver |
| | | password: '123456', |
| | | remember: true, |
| | | baseUrl: '' |
| | |
| | | export function todayDate(){ |
| | | export function todayDate(arg){ |
| | | let date = new Date() |
| | | let year = date.getFullYear() |
| | | let month = date.getMonth() + 1; |
| | | let day = date.getDate() |
| | | return year + '-' + month + '-' + day |
| | | let hour = date.getHours() |
| | | let minutes = date.getMinutes() |
| | | let seconds = date.getSeconds() |
| | | console.log(arg,'时间'); |
| | | 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 |
| | | } |
| | | } |