From 48a4ff3409804fc62139a9fa9fc05498cbc0a0ce Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期四, 05 九月 2024 17:41:02 +0800 Subject: [PATCH] feat:库管拼单 --- pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue | 129 +++++++++++++++++++++++++------------------ 1 files changed, 75 insertions(+), 54 deletions(-) diff --git a/pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue b/pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue index f9e1544..9d72e63 100644 --- a/pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue +++ b/pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue @@ -75,15 +75,18 @@ <!-- <view class="statistics"><u-button text="鍙戣繍缁熻" type="primary" @click="statistics"></u-button></view> --> <view class="utils-button"> - <!-- <view class="utils"><u-button text="淇敼瀵嗙爜" + <view class="utils"><u-button text="淇敼瀵嗙爜" type="primary" @click="modifyPwd"></u-button></view> - <view class="utils"><u-button text="閲嶇疆瀵嗙爜" + <!-- <view class="utils"><u-button text="閲嶇疆瀵嗙爜" type="primary" @click="initPwd"></u-button></view> --> <view class="utils"><u-button text="閫�鍑虹櫥褰�" type="primary" @click="logout"></u-button></view> + <view class="utils"><u-button text="鑱旂郴鎴戜滑" + type="primary" + @click="contactUs"></u-button></view> </view> <!-- 鍒犻櫎杞﹂槦妯℃�佹 --> @@ -135,6 +138,7 @@ <script> import { redirectLogin } from '@/utils/status'; + import { BaseUrl } from '@/api/publicInterface.js' export default { data() { return { @@ -161,7 +165,8 @@ modifyPwdShow: false, passwordModified: '', // 鐢ㄦ埛淇℃伅瀵硅薄 - userEntity: {}, + userInfo: {}, + phoneList:[] }; }, onLoad() { @@ -170,21 +175,74 @@ methods: { init() { this.getFleet(); - this.getUserEntity() - }, - // 鑾峰彇鐢ㄦ埛淇℃伅 - getUserEntity() { - this.$reqGet('getUserEntity').then(res => { - this.userEntity = res.data; - }); + this.getUserEntity(); + uni.request({ + url: `${BaseUrl}/admin/dict/page`, + method: 'GET', + data: { + dictType:'Setings' + }, + header: { + Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'), + clientToc: 'Y', + 'CLIENT_TOC': 'Y', + }, + success: res => { + let dictId=res.data.data?.records[0].id + uni.request({ + url: `${BaseUrl}/admin/dict/item/page`, + method: 'GET', + data: { + dictId:dictId + }, + header: { + Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'), + clientToc: 'Y', + 'CLIENT_TOC': 'Y', + }, + success: res => { + res.data.data.records.forEach(item=>{ + if(item.description.includes('鑱旂郴')){ + this.phoneList=item.value.split(','); + } + }) + }, + fail: err => { + } + }) + }, + fail: err => { + } + }) }, // 鑾峰彇杞﹂槦 getFleet() { - // this.$reqGet('getFleet', { wxUserId: this.addGroupForm.wxUserId }).then(res => { this.$reqGet('getFleet').then(res => { - console.log('璐т唬1杞﹂槦', res); + console.log('鎵胯繍鍟�1杞﹂槦', res); this.fleetData = res.data; }); + }, + contactUs(){ + uni.showActionSheet({ + itemList: this.phoneList, + success: (res) => { + uni.makePhoneCall({ + phoneNumber:this.phoneList[res.tapIndex].split(":")[1] + }) + }, + fail: (err) => { + console.log('寮圭獥鍙栨秷'); + } + }); + }, + getUserEntity() { + uni.showLoading({ + title: '鍔犺浇涓�...' + }); + this.$reqGet('getUserEntity').then(res => { + uni.hideLoading() + this.userInfo = res.data; + }) }, // 娣诲姞杞﹂槦 addFleet() { @@ -247,49 +305,12 @@ url: `/pages/customer-page/fleet-management/fleet-management?id=${id}` }); }, - updateInfo() { - this.$reqPost('updateUser', this.userEntity, 'json').then(res => { - uni.hideLoading() - if (res.code == 0) { - uni.showToast({ - title: '閲嶇疆鎴愬姛', - duration: 2000, - icon: 'success' - }) - } else { - this.$u.toast(res.msg ? res.msg : '淇敼澶辫触'); - } - }).catch(err => { - this.$u.toast('淇敼澶辫触'); - }); - }, - initPwd() { - this.initPwdShow = true - }, - initPwdConfirm() { - this.initPwdShow = false - uni.showLoading({ - title: '鍔犺浇涓�' - }) - this.userEntity.password = '123456' - this.updateInfo() - }, - initPwdCancel() { - this.initPwdShow = false - }, modifyPwd() { - this.modifyPwdShow = true - }, - modifyPwdConfirm() { - if (this.passwordModified.length === 0) { - return this.$u.toast('瀵嗙爜涓嶈兘涓虹┖') - } - this.modifyPwdShow = false - this.userEntity.password = this.passwordModified - this.updateInfo() - }, - modifyPwdCancel() { - this.modifyPwdShow = false + this.$store.commit('changeisLogin', false) + this.$store.dispatch('websocketOnClose') + uni.reLaunch({ + url: `/pages/login/resetPassword/resetPassword?phone=${this.userInfo.phone}&idCard=${this.userInfo.idCard}` + }) }, logout() { this.logoutShow = true; -- Gitblit v1.9.1