From 82af85eae92790fc125ca42d1a800046fe0bd916 Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期三, 29 三月 2023 14:00:08 +0800 Subject: [PATCH] 登录页修改 --- pages/public-page/forward/forward.vue | 35 ++++++++++++++++++++++++++++------- 1 files changed, 28 insertions(+), 7 deletions(-) diff --git a/pages/public-page/forward/forward.vue b/pages/public-page/forward/forward.vue index e98e380..e57f01f 100644 --- a/pages/public-page/forward/forward.vue +++ b/pages/public-page/forward/forward.vue @@ -69,12 +69,24 @@ } this.orderPlanId = params.orderPlanId; this.$reqGet('forwardList', { OrderPlanId: params.orderPlanId }).then(res => { - if (res.data.length !== 0) { + if (res.data.length !== 0 && this.roleType == 1) { this.jhOrderPlanForwardList = res.data.map(item => { return { id: item.id, orderPlanId: item.orderPlanId, name: item.xsUserName === null ? item.fleetName : item.xsUserName, + carNum: item.carNum, + xsUserId: item.xsUserId === null ? 0 : item.xsUserId, + fleetId: item.fleetId === null ? 0 : item.fleetId, + checkboxValue1: '' + }; + }); + } else if (res.data.length !== 0 && this.roleType == 2) { + this.jhOrderPlanForwardList = res.data.map(item => { + return { + id: item.id, + orderPlanId: item.orderPlanId, + name: item.fleetName, carNum: item.carNum, xsUserId: item.xsUserId === null ? 0 : item.xsUserId, fleetId: item.fleetId === null ? 0 : item.fleetId, @@ -226,15 +238,19 @@ }, // 鍒犻櫎涓�缁勮〃鍗� deleteGroup(index, v) { - if (v.id) { + let tempcarNum = v.carNum; + if (v.id && this.jhOrderPlanForwardList[index].carNum !== tempcarNum) { this.$reqPost('deleteForward', { id: v.id }, 'params').then(res => { if (res.code === 0) { this.jhOrderPlanForwardList.splice(index, 1); this.$u.toast('鍒犻櫎鎴愬姛'); + } else if (res.code === 1) { + this.$u.toast(res.msg); } }); } else { this.jhOrderPlanForwardList.splice(index, 1); + this.$u.toast('鍒犻櫎鎴愬姛'); } }, // 鎻愪氦 @@ -245,22 +261,27 @@ this.$u.toast('璇疯緭鍏ュ悎娉曟暟瀛�'); isPass = false; return isPass; - } else if (Number(v.carNum) > Number(this.forwardSurplus)) { - this.$u.toast('瓒呰繃鏈�澶ц鍗曞墿浣欓噺'); - isPass = false; - return isPass; - } else { + } + // else if (Number(v.carNum) > Number(this.forwardSurplus)) { + // this.$u.toast('瓒呰繃鏈�澶ц鍗曞墿浣欓噺'); + // isPass = false; + // return isPass; + // } + else { isPass = true; return isPass; } }); if (isPass) { this.$reqPost('forward', this.jhOrderPlanForwardList, 'json').then(res => { + console.log(res, 'zh'); if (res.code == 0) { this.$u.toast('鎻愪氦鎴愬姛'); setTimeout(() => { uni.navigateBack({ delta: 1 }); }, 1000); + } else { + this.$u.toast(res.msg); } }); } -- Gitblit v1.9.1