| | |
| | | coalDayPage: { |
| | | url: "/wrzs/tmtaskcoallog/getTmId", |
| | | method: 'GET' |
| | | }, |
| | | |
| | | // 获取openId |
| | | getCallOutList:{ |
| | | url:'/wrzs/callout/getCallOutList', |
| | | 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.110.82:9999" |
| | | const BaseUrl = "http://192.168.3.109: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.110.82:9997"; |
| | | const webSocketUrl = "ws://192.168.110.82:9997/wrzs/ws/info" |
| | | const BaseUrl = "http://192.168.3.109:9997"; |
| | | const webSocketUrl = "ws://192.168.3.109:9997/wrzs/ws/info" |
| | | |
| | | // 请求拦截 |
| | | const fetch = (url, opt) => { |
| | |
| | | }, { |
| | | "path": "pages/driver-page/appointment/appointment", |
| | | "style": { |
| | | "navigationBarTitleText": "预约", |
| | | "navigationBarTitleText": "时段", |
| | | "enablePullDownRefresh": false |
| | | } |
| | | |
| | |
| | | <uni-td align="center">{{ (item.startTime || '') + '-' + (item.endTime || '') }}</uni-td> |
| | | <uni-td align="center">{{ item.carNum || '' }}</uni-td> |
| | | <uni-td align="center">{{ item.carNum1 || '' }}</uni-td> |
| | | <uni-td><u-button text="预约" type="primary" :disabled="item.carNum == item.carNum1" @click="yuYueBtnClick(item)"></u-button></uni-td> |
| | | <uni-td><u-button text="选择" type="primary" :disabled="item.carNum == item.carNum1" @click="yuYueBtnClick(item)"></u-button></uni-td> |
| | | </uni-tr> |
| | | </uni-table> |
| | | </view> |
| | |
| | | <view class="bill-of-lading-details"> |
| | | <view class="bangDanMessage"> |
| | | <view class=""> |
| | | <u--text align="center" size="35" bold plain text="主色" :text="'客户:' + coalDetailsData.customerName"></u--text> |
| | | <u--text align="center" size="35" bold plain text="主色" :text="'矿厂:' + coalDetailsData.deptName"></u--text> |
| | | <text>客户:{{ coalDetailsData.customerName }}</text> |
| | | <text>矿厂:{{ coalDetailsData.deptName }}</text> |
| | | </view> |
| | | <view class=""> |
| | | <u--text align="center" size="35" bold plain text="主色" :text="'皮重:' + coalDetailsData.skin"></u--text> |
| | | <u--text align="center" size="35" bold plain text="主色" :text="'毛重:' + coalDetailsData.hair"></u--text> |
| | | <u--text align="center" size="35" bold plain text="主色" :text="'净重:' + coalDetailsData.clean"></u--text> |
| | | <text>皮重:{{ coalDetailsData.skin }}</text> |
| | | <text>毛重:{{ coalDetailsData.hair }}</text> |
| | | <text>净重:{{ coalDetailsData.clean }}</text> |
| | | </view> |
| | | <view class=""> |
| | | <u--text align="center" size="35" bold plain text="主色" :text="'磅单类型:' + coalDetailsData.orderTye"></u--text> |
| | | <u--text align="center" size="35" bold plain text="主色" :text="'状态:' + coalStatus[coalDetailsData.status]"></u--text> |
| | | <text>磅单类型:{{ coalDetailsData.orderTye }}</text> |
| | | <text>状态:{{ coalStatus[coalDetailsData.status] }}</text> |
| | | </view> |
| | | <u--text align="center" size="35" bold plain text="主色" :text="'煤场:' + coalDetailsData.filedName"></u--text> |
| | | <u--text align="center" size="35" bold plain text="主色" :text="'发运时间:' + coalDetailsData.sendDate"></u--text> |
| | | <u--text align="center" size="35" bold plain text="主色" :text="'提煤单编号:' + coalDetailsData.code"></u--text> |
| | | <u--text align="center" size="35" bold plain text="主色" :text="'订单编号:' + coalDetailsData.orderCode"></u--text> |
| | | <view class=""> |
| | | <text>煤场:{{ coalDetailsData.filedName }}</text> |
| | | <text>发运时间:{{ coalDetailsData.sendDate }}</text> |
| | | <text>提煤单编号:{{ coalDetailsData.code }}</text> |
| | | <text>订单编号:{{ coalDetailsData.orderCode }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="timeLine" style="font-size: 16rpx;"> |
| | | <u--text type="primary" size="30" plain text="主色" v-for="(item, index) in dayRZ" :key="index" :text="item.taskStatusDes"></u--text> |
| | | <u--text type="primary" size="30" plain v-for="(item, index) in dayRZ" :key="index" :text="item.taskStatusDes"></u--text> |
| | | </view> |
| | | <view class="utilsBox"> |
| | | <view class="utils_chil utils_chilTop"> |
| | | <u-button text="签到" type="primary" plain @click="arriveClick"></u-button> |
| | | <u-button text="入场申请" type="primary" plain @click="rcsqClick"></u-button> |
| | | <u-button text="放空" type="primary" plain></u-button> |
| | | <u-button text="呼叫客服" type="primary" plain></u-button> |
| | | <u-button text="呼叫客服" type="primary" plain @click="callCustomerService"></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> |
| | |
| | | <script> |
| | | export default { |
| | | onLoad(value) { |
| | | console.log('页面加载', value); |
| | | if (value.orderPlanId && value.yyId) { |
| | | this.orderPlanId = value.orderPlanId; |
| | | this.yyId = value.yyId; |
| | | } |
| | | // wx.startRecord(); |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | yyId: null, |
| | | dayRZ: [], |
| | | coalDetailsData: {}, // 提煤单详情 |
| | | // 获取所在磅房参数 |
| | | getWeightHouseObj: { |
| | | // 获取所在磅房 |
| | | deptId: '', |
| | | filedId: '', |
| | | tmId: '', |
| | | tmCode: '', |
| | | carNo: '' |
| | | }, |
| | | // 获取入场申请的列表页面参数 |
| | | getYuYueDataParams: { |
| | | deptId: '', |
| | | filedId: '', |
| | | sendDate: '' |
| | | }, |
| | | // 获取客服openid参数 |
| | | getServiceOpenid: { |
| | | deptId: '', |
| | | filedId: '' |
| | | }, |
| | | // 客服信息 |
| | | serviceInfoObj: { |
| | | openId: null, |
| | | openName: '' |
| | | }, |
| | | coalStatus: ['领取', '预约', '签到', '入场', '称皮', '称毛', '离场', '入磅房', '出磅房', '入煤场', '出煤仓'] // 状态 |
| | | }; |
| | |
| | | this.init(); |
| | | }, |
| | | computed: { |
| | | userName() { |
| | | return uni.getStorageSync('username'); |
| | | name() { |
| | | return uni.getStorageSync('name'); |
| | | }, |
| | | openid() { |
| | | return uni.getStorageSync('openid'); |
| | |
| | | }, |
| | | methods: { |
| | | init() { |
| | | this.coalDayPage(); |
| | | this.getTakeCoal(); |
| | | this.coalDayPage(); //获取日志 |
| | | this.getTakeCoal(); //获取提煤单详情 |
| | | this.getgetService(); //获取客服 |
| | | }, |
| | | // 获取客服openid |
| | | getgetService() { |
| | | this.$reqGet('getCallOutList', this.getServiceOpenid).then(res => { |
| | | console.log(res, '客服openid'); |
| | | if (res.code != 0) { |
| | | this.$u.toast('获取客服信息失败'); |
| | | } else { |
| | | if (res.data.length > 0) { |
| | | this.serviceInfoObj.openId = res.data[0].openId; |
| | | this.serviceInfoObj.openName = res.data[0].openName; |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | // 获取提煤单详情 |
| | | getTakeCoal() { |
| | |
| | | this.getYuYueDataParams.deptId = this.coalDetailsData.deptId; |
| | | this.getYuYueDataParams.filedId = this.coalDetailsData.filedId; |
| | | this.getYuYueDataParams.sendDate = this.coalDetailsData.sendDate; |
| | | // 获取客服openId参数赋值 |
| | | this.getServiceOpenid.deptId = this.coalDetailsData.deptId; |
| | | this.getServiceOpenid.filedId = this.coalDetailsData.filedId; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | }, |
| | | // 呼叫客服 |
| | | callCustomerService() { |
| | | wx.join1v1Chat({ |
| | | caller: { nickname: this.userName, openid: this.openid }, |
| | | listener: { nickname: '客服', openid: 'orutI5YT0yEvARVngdsTmBpisWmw' }, // 这里的openid是fyy的,充当固定的客服openid |
| | | backgroundType: 2, |
| | | roomType: 'voice' |
| | | // if (!this.serviceInfoObj.openId) { |
| | | // this.$u.toast('无客服信息'); |
| | | // } |
| | | wx.getSetting({ |
| | | success(res) { |
| | | console.log('授权success', res); |
| | | if (!res.authSetting['scope.camera'] || !res.authSetting['scope.record']) { |
| | | if (!res.authSetting['scope.camera']) { |
| | | uni.showToast({ |
| | | title: '无相机权限' |
| | | }); |
| | | } else if (!res.authSetting['scope.record']) { |
| | | uni.showToast({ |
| | | title: '无麦克风权限' |
| | | }); |
| | | } |
| | | } else { |
| | | wx.join1v1Chat({ |
| | | caller: { nickname: uni.getStorageSync('name'), openid: uni.getStorageSync('openid') }, |
| | | listener: { nickname: '付延余', openid: 'oZjXk5e7G9uIvOzaTO6nFV51ALwk' }, // 这里的openid是fyy的,充当固定的客服openid |
| | | backgroundType: 2, |
| | | roomType: 'voice', |
| | | success() { |
| | | console.log('一对一成功'); |
| | | }, |
| | | fail(err) { |
| | | console.log('一对一失败', err); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | fail() { |
| | | console.log('获取失败'); |
| | | } |
| | | }); |
| | | }, |
| | | calling() { |
| | | // wx.join1v1Chat({ |
| | | // caller: { nickname: this.name, openid: this.openid }, //oZjXk5RRmbroAfl1m5aZ6hRNvqh4 |
| | | // listener: { nickname: this.serviceInfoObj.openName, openid: 'orutI5YT0yEvARVngdsTmBpisWmw' }, // 这里的openid是fyy的,充当固定的客服openid |
| | | // backgroundType: 2, |
| | | // roomType: 'voice' |
| | | // }); |
| | | }, |
| | | // 称重 |
| | | cengZhongClick() { |
| | |
| | | display: flex; |
| | | flex-direction: column; |
| | | .bangDanMessage { |
| | | padding:vww(10); |
| | | padding: vww(10); |
| | | border: vww(2) solid #dddddd; |
| | | border-radius: vww(20); |
| | | margin: vww(20); |
| | | margin-bottom: vww(10); |
| | | height: 40%; |
| | | box-sizing: border-box; |
| | | overflow-y: overlay; //行为与 auto 相同,但是滚动条绘制在内容之上,而不是占据空间。 |
| | | font-size:vww(16); |
| | | font-weight: 500; |
| | | .u-text { |
| | | margin-bottom: vww(5) !important; |
| | | } |
| | |
| | | } |
| | | view:nth-of-type(1) { |
| | | display: flex; |
| | | text{ |
| | | width:50%; |
| | | } |
| | | } |
| | | view:nth-of-type(2) { |
| | | display: flex; |
| | | text{ |
| | | width:33%; |
| | | } |
| | | } |
| | | view:nth-of-type(3) { |
| | | display: flex; |
| | | text{ |
| | | width:50%; |
| | | } |
| | | } |
| | | view:nth-of-type(4){ |
| | | display:flex; |
| | | flex-direction: column; |
| | | } |
| | | } |
| | | .timeLine { |
| | |
| | | // pingMessage: JSON.stringify({ type: 'ping' }) // 心跳请求信息 |
| | | // } |
| | | // 临时称重对象 |
| | | temporaryWeighObj:{ |
| | | skin:0, |
| | | hair:0, |
| | | clean:0 |
| | | temporaryWeighObj: { |
| | | skin: 0, |
| | | hair: 0, |
| | | clean: 0 |
| | | }, |
| | | infraredStatus:false// 红外状态 |
| | | infraredStatus: false // 红外状态 |
| | | }; |
| | | }, |
| | | watch:{ |
| | | realTimeWeigh(newV,oldV){ |
| | | if(this.weighList.orderTye == '外销'){ |
| | | if(this.weighList.skin == 0){ |
| | | this.temporaryWeighObj.skin = this.realTimeWeigh |
| | | watch: { |
| | | realTimeWeigh(newV, oldV) { |
| | | if (this.weighList.orderTye == '外销') { |
| | | if (this.weighList.skin == 0) { |
| | | this.temporaryWeighObj.skin = this.realTimeWeigh; |
| | | } else { |
| | | this.temporaryWeighObj.hair = this.realTimeWeigh |
| | | this.temporaryWeighObj.clean = this.temporaryWeighObj.hair - this.weighList.skin |
| | | this.temporaryWeighObj.hair = this.realTimeWeigh; |
| | | this.temporaryWeighObj.clean = this.temporaryWeighObj.hair - this.weighList.skin; |
| | | } |
| | | } else if(this.weighList.orderTye == '外购'){ |
| | | if(this.weighList.hair == 0){ |
| | | this.temporaryWeighObj.hair = this.realTimeWeigh |
| | | } else if (this.weighList.orderTye == '外购') { |
| | | if (this.weighList.hair == 0) { |
| | | this.temporaryWeighObj.hair = this.realTimeWeigh; |
| | | } else { |
| | | this.temporaryWeighObj.skin = this.realTimeWeigh |
| | | this.temporaryWeighObj = this.weighList.hair - this.temporaryWeighObj.skin |
| | | this.temporaryWeighObj.skin = this.realTimeWeigh; |
| | | this.temporaryWeighObj = this.weighList.hair - this.temporaryWeighObj.skin; |
| | | } |
| | | } |
| | | } |
| | |
| | | return false; |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | methods: { |
| | | init() { |
| | |
| | | // 获取服务器传来的数据,做相应处理 |
| | | socket.onMessage(res => { |
| | | console.log('socketWeigh', res); |
| | | let nowWeighObj = JSON.parse(res.data.slice(7)) |
| | | let nowWeighObj = JSON.parse(res.data.slice(7)); |
| | | if (nowWeighObj.eqCode == this.weighHouseCode) { |
| | | if(nowWeighObj.eqInfraredStatus){ |
| | | this.infraredStatus = true |
| | | if (nowWeighObj.eqInfraredStatus) { |
| | | this.infraredStatus = true; |
| | | this.weighData.weigh = this.realTimeWeigh = nowWeighObj.weigh; |
| | | }else{ |
| | | this.infraredStatus = false |
| | | } else { |
| | | this.infraredStatus = false; |
| | | this.weighData.weigh = this.realTimeWeigh = nowWeighObj.weigh; |
| | | } |
| | | } |
| | |
| | | <view class="login"> |
| | | <view class="logo">无人值守</view> |
| | | <!--用户名密码登录--> |
| | | <user-password :btnText='0'/> |
| | | <user-password :btnText="0" /> |
| | | <!-- 微信openid登录 --> |
| | | <view class="loginBtn"> |
| | | <u-button class="button" @click.stop="beforeLoginEvent" :disabled="btnLoading" :loading="btnLoading" type="primary" text="微信一键登录"></u-button> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | wxcode: '', // 司机1 |
| | | btnLoading: false, |
| | | loginPopupShow: false, |
| | | // 绑定微信模态框 |
| | |
| | | uni.login({ |
| | | success: res => { |
| | | if (res.code) { |
| | | this.wxcode = res.code; |
| | | this.apiLogin(); |
| | | this.apiLogin(res.code); |
| | | } else { |
| | | uni.showToast({ |
| | | title: '微信登录失败!', |
| | |
| | | }); |
| | | }, |
| | | // 登录接口 |
| | | apiLogin() { |
| | | // apiLoginWx({ code: this.wxcode }) |
| | | // .then(res => { |
| | | // console.log('请求登录', res); |
| | | // if (res.msg == '需绑定') { |
| | | // uni.navigateTo({ |
| | | // url: `/pages/register/register?code=${res.data}` |
| | | // }); |
| | | // } |
| | | // if (res.msg == '登录成功') { |
| | | // uni.setStorageSync('userInfo', res.data); |
| | | // this.setUserTabbar(res.data.type); |
| | | // uni.switchTab({ |
| | | // url: '/pages/tabbar-page/index-tabbar/index-tabbar' |
| | | // }); |
| | | // } |
| | | // }) |
| | | // .catch(err => { |
| | | // console.log('错误', err); |
| | | // }); |
| | | |
| | | apiLogin(code) { |
| | | /** |
| | | * @openid |
| | | * 获取微信用户openid,微信一键登录暂无相关接口,用于测试呼叫客服功能 |
| | | */ |
| | | |
| | | uni.showLoading({ |
| | | title: '加载中...' |
| | | }); |
| | | wx.request({ |
| | | url: `https://api.weixin.qq.com/sns/jscode2session?appid=wx4a62fc1684c429a9&secret=ee90afe376cdcec2fdd947c0a4db961a&js_code=${this.wxcode}&grant_type=authorization_code`, |
| | | url: `https://api.weixin.qq.com/sns/jscode2session?appid=wx4a62fc1684c429a9&secret=ee90afe376cdcec2fdd947c0a4db961a&js_code=${code}&grant_type=authorization_code`, |
| | | success(res) { |
| | | let id = res.data.openid; |
| | | uni.setStorageSync('openid', id); |
| | | uni.setStorageSync('openid', res.data.openid); |
| | | uni.showToast({ |
| | | title: '成功获取测试openid', |
| | | icon: 'none' |
| | |
| | | }); |
| | | this.$nextTick(() => { |
| | | apiLoginWx({ code: uni.getStorageSync('openid') }).then(res => { |
| | | uni.hideLoading(); |
| | | if (res.code != 1) { |
| | | this.$u.toast('恭喜您,登录成功!'); |
| | | // 登陆成功,存储相关信息 |
| | |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | this.loginPopupShow = false; |
| | | }, |
| | | bindWxConfirm() { |
| | |
| | | <script> |
| | | import { apiLoginPassword } from '@/api/publicInterface.js'; |
| | | import { mapMutations } from 'vuex'; |
| | | import { setToken, setRefreshToken, setUsernameKey, setCustomerId, redirectHome } from '@/utils/status.js'; |
| | | import { setName, setToken, setRefreshToken, setUsernameKey, setCustomerId, redirectHome } from '@/utils/status.js'; |
| | | export default { |
| | | name: 'userPassword', |
| | | props: { |
| | |
| | | data() { |
| | | return { |
| | | // username: '12222222222', // 客户 |
| | | username: '13333333332',// 司机 |
| | | username: '13333333332', // 司机 |
| | | password: '123456', |
| | | remember: true, |
| | | baseUrl: '' |
| | |
| | | this.setUserTabbar(res.data.type); |
| | | uni.setStorageSync('roleType', res.data.type); |
| | | setCustomerId(res.data.customerid); |
| | | setName(res.name); |
| | | uni.hideLoading(); |
| | | //跳转页面 |
| | | this.$nextTick(() => { |
| | |
| | | this.$u.toast(res.msg); |
| | | } |
| | | } else { |
| | | this.$nextTick(() => { |
| | | this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('code') }, 'params').then(res => { |
| | | uni.hideLoading(); |
| | | if (res.code == 0) { |
| | | this.$u.toast('绑定成功!即将回到登录页!'); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 1000); |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '绑定失败'); |
| | | } |
| | | }); |
| | | this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('openid') }, 'params').then(res => { |
| | | uni.hideLoading(); |
| | | if (res.code == 0) { |
| | | this.$u.toast('绑定成功!即将回到登录页!'); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 1000); |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '绑定失败'); |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | driverIndex, |
| | | freightForwarderIndex |
| | | }, |
| | | onLoad(){ |
| | | // 开启双人通话 |
| | | wx.setEnable1v1Chat({ |
| | | enable: true, |
| | | backgroundType: 1, |
| | | minWindowType:2, |
| | | success() { |
| | | console.log('开启双人通话成功'); |
| | | }, |
| | | fail() { |
| | | console.log('开启双人通话失败'); |
| | | }, |
| | | complete() { |
| | | console.log('开启双人通话成功Complete'); |
| | | } |
| | | }); |
| | | }, |
| | | data() { |
| | | return { |
| | | roleType: null |
| | |
| | | userAuthorization() { |
| | | wx.getSetting({ |
| | | success(res) { |
| | | wx.startRecord(); |
| | | // wx.startRecord(); |
| | | console.log('success'); |
| | | if (!res.authSetting['scope.record'] || !res.authSetting['scope.camera']) { |
| | | if (!res.authSetting['scope.camera']) { |
| | |
| | | export const UserTabbar = 'userTabbar'; |
| | | export const FailRedirect = '/pages/login/login'; |
| | | export const SuccessRedirect = '/pages/tabbar-page/index-tabbar/index-tabbar'; |
| | | export const customerIdKey = 'customerId'; |
| | | export const customerIdKey = 'customerId'; |
| | | export const nameKey = 'name'; |
| | |
| | | UsernameKey, |
| | | SuccessRedirect, |
| | | FailRedirect, |
| | | customerIdKey |
| | | customerIdKey, |
| | | nameKey |
| | | } from './status.config.js'; |
| | | |
| | | const SetStorage = (key) => (value) => uni.setStorageSync(key, value); |
| | |
| | | export const setToken = SetStorage(TokenKey); |
| | | export const setRefreshToken = SetStorage(RefreshToken); |
| | | export const setUsernameKey = SetStorage(UsernameKey); |
| | | export const setCustomerId = SetStorage(customerIdKey) |
| | | export const setCustomerId = SetStorage(customerIdKey); |
| | | export const setName = SetStorage(nameKey) |
| | | export const redirectHome = (path) => { |
| | | uni.switchTab({ |
| | | url: path || SuccessRedirect |