From 38de059c83720527d3813448153390da3e6453dc Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期日, 02 七月 2023 13:52:25 +0800
Subject: [PATCH] 验质替换页面,称重判断修改
---
pages/public-page/forward/forward.vue | 120 ++++++++++++++++++++++++++++++++---------------------------
1 files changed, 65 insertions(+), 55 deletions(-)
diff --git a/pages/public-page/forward/forward.vue b/pages/public-page/forward/forward.vue
index 37b9201..0c8c3aa 100644
--- a/pages/public-page/forward/forward.vue
+++ b/pages/public-page/forward/forward.vue
@@ -9,14 +9,17 @@
</view>
<view v-if="roleType == 1" class="notice-bar">
<u-notice-bar :text="text" :fontSize="30"></u-notice-bar>
- <view class="notice-icon" style="background: url('../../../static/image/banner/notice.png') no-repeat;background-size: cover; width: 42rpx;height: 42rpx;"></view>
+ <view
+ class="notice-icon"
+ style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/notice.png') no-repeat;background-size: cover; width: 42rpx;height: 42rpx;"
+ ></view>
</view>
<view v-else-if="roleType == 2" class="notice-bar"><u-notice-bar :text="text1" :fontSize="30"></u-notice-bar></view>
<view class="card-main">
<view class="card-block">
- <view class="forward-card" v-for="(val, index) in jhOrderPlanForwardList" :key="index">
- <u-swipe-action>
- <u-swipe-action-item :options="options1" @click="deleteGroup(index, val)">
+ <u-swipe-action>
+ <u-swipe-action-item :options="options1" v-for="(val, index) in jhOrderPlanForwardList" :key="val.vid" :name="val.vid" @click="deleteGroup(index, val)">
+ <view class="forward-card">
<view class="card-content">
<u--form labelPosition="left" :model="forwardForm" ref="form1">
<u-form-item label="杞彂瀵硅薄" labelWidth="21%" ref="item1" @click="forwardObjectClick(index)">
@@ -34,16 +37,23 @@
></u--input>
</view>
<u-checkbox-group v-model="val.checkboxValue1" placement="column" @change="v => checkboxChange(v, index, val)">
- <u-checkbox size="30" shape="circle" labelSize="30" label="鍏ㄩ儴杞彂" name="鍏ㄩ儴杞彂" :disabled="val.ischecked"></u-checkbox>
+ <u-checkbox
+ size="30"
+ shape="circle"
+ labelSize="30"
+ label="鍏ㄩ儴杞彂"
+ name="鍏ㄩ儴杞彂"
+ :disabled="val.ischecked"
+ :checked="val.isSelected"
+ ></u-checkbox>
</u-checkbox-group>
</view>
</u-form-item>
- <!-- <u-form-item><u-button text="鍒犻櫎鏈粍" :hairline="false" type="error" @click="deleteGroup(index, val)"></u-button></u-form-item> -->
</u--form>
</view>
- </u-swipe-action-item>
- </u-swipe-action>
- </view>
+ </view>
+ </u-swipe-action-item>
+ </u-swipe-action>
</view>
</view>
@@ -100,7 +110,7 @@
this.orderPlanId = params.orderPlanId;
this.$reqGet('forwardList', { OrderPlanId: params.orderPlanId }).then(res => {
if (res.data.length !== 0 && this.roleType == 1) {
- this.jhOrderPlanForwardList = res.data.map(item => {
+ this.jhOrderPlanForwardList = res.data.map((item, index) => {
return {
id: item.id,
orderPlanId: item.orderPlanId,
@@ -108,11 +118,12 @@
carNum: item.carNum,
xsUserId: item.xsUserId === null ? 0 : item.xsUserId,
fleetId: item.fleetId === null ? 0 : item.fleetId,
- checkboxValue1: ''
+ checkboxValue1: '',
+ vid: `${new Date().getTime()}${index}${item.id}`
};
});
} else if (res.data.length !== 0 && this.roleType == 2) {
- this.jhOrderPlanForwardList = res.data.map(item => {
+ this.jhOrderPlanForwardList = res.data.map((item, index) => {
return {
id: item.id,
orderPlanId: item.orderPlanId,
@@ -120,15 +131,17 @@
carNum: item.carNum,
xsUserId: item.xsUserId === null ? 0 : item.xsUserId,
fleetId: item.fleetId === null ? 0 : item.fleetId,
- checkboxValue1: ''
+ checkboxValue1: '',
+ vid: `${new Date().getTime()}${index}${item.id}`
};
});
} else {
- this.jhOrderPlanForwardList = this.jhOrderPlanForwardList.map(v => {
- if (!v.orderPlanId) {
+ this.jhOrderPlanForwardList = this.jhOrderPlanForwardList.map((item, index) => {
+ if (!item.orderPlanId) {
return {
- ...v,
- orderPlanId: params.orderPlanId
+ ...item,
+ orderPlanId: params.orderPlanId,
+ vid: `${new Date().getTime()}${index}${item.id}`
};
}
});
@@ -150,7 +163,8 @@
carNum: null,
xsUserId: 0,
fleetId: 0,
- checkboxValue1: ''
+ checkboxValue1: '',
+ isSelected: false
}
],
// 绱㈠紩锛屽埄鐢ㄧ储寮曟纭樉绀�
@@ -244,29 +258,6 @@
};
});
if (value.length != 0) {
- let tempforwardSurplus = this.forwardSurplus;
- let tempcarNumSurplus1 = this.carNumSurplus1;
- // if (v.id) {
- // this.$reqGet('jhorderplanforward', { forwardId: v.id }).then(res => {
- // this.personalForward = res.data;
- // // 璁$畻鍏ㄩ儴杞彂鏁�
- // // 瀹㈡埛
- // if (this.roleType == 1) {
- // this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.personalForward.carNum, tempcarNumSurplus1);
- // this.calculate(this.jhOrderPlanForwardList);
- // if (tempcarNumSurplus1 == 0) {
- // this.jhOrderPlanForwardList[index].carNum = this.allrelay(0, this.carNumSurplus1);
- // }
- // }
- // tempcarNumSurplus1 = 0;
- // // 璐т唬
- // if (this.roleType == 2) {
- // this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.personalForward.carNum, tempforwardSurplus);
- // }
- // tempforwardSurplus = 0;
- // });
- // } else { }
-
if (this.roleType == 1) {
this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.carNumSurplus1, this.jhOrderPlanForwardList[index].carNum);
this.calculate(this.jhOrderPlanForwardList);
@@ -283,7 +274,7 @@
});
this.whetherClick = true;
} else {
- this.jhOrderPlanForwardList[index].carNum = 0;
+ this.jhOrderPlanForwardList[index].carNum = null;
this.calculate(this.jhOrderPlanForwardList);
}
},
@@ -345,8 +336,8 @@
}, 0);
console.log(total, '鎻愮叅鍗曚竴鍏辩殑鏁版嵁');
if (this.roleType == 1) {
- if (this.cars2 >= total) {
- this.carNumSurplus1 = this.cars2 - total;
+ if (Number(this.cars2) >= total) {
+ this.carNumSurplus1 = Number(this.cars2) - total;
this.whetherClick = false;
this.whetherClick1 = false;
} else {
@@ -357,8 +348,8 @@
}
}
if (this.roleType == 2) {
- if (this.carNum >= total) {
- this.carNumSurplusHuodai = this.carNum - total;
+ if (Number(this.carNum) >= total) {
+ this.carNumSurplusHuodai = Number(this.carNum) - total;
this.whetherClick = false;
this.whetherClick1 = false;
} else {
@@ -377,6 +368,27 @@
if (!time) {
time = setTimeout(() => {
that.calculate(that.jhOrderPlanForwardList);
+ if (that.roleType == 1) {
+ if (that.jhOrderPlanForwardList[index].carNum < Number(that.carNumSurplus1)) {
+ that.$set(that.jhOrderPlanForwardList[index], 'checkboxValue1', '');
+ that.jhOrderPlanForwardList.forEach((v, i) => {
+ if (index != i) {
+ v.ischecked = false;
+ }
+ });
+ }
+ }
+
+ if (that.roleType == 2) {
+ if (that.jhOrderPlanForwardList[index].carNum < Number(that.carNumSurplusHuodai)) {
+ that.$set(that.jhOrderPlanForwardList[index], 'checkboxValue1', '');
+ that.jhOrderPlanForwardList.forEach((v, i) => {
+ if (index != i) {
+ v.ischecked = false;
+ }
+ });
+ }
+ }
time = null;
}, 800);
}
@@ -398,7 +410,9 @@
xsUserId: 0,
fleetId: 0,
checkboxValue1: '',
- ischecked: false
+ ischecked: false,
+ vid: new Date().getTime(),
+ isSelected: false
});
} else {
this.jhOrderPlanForwardList.push({
@@ -408,7 +422,9 @@
xsUserId: 0,
fleetId: 0,
checkboxValue1: '',
- ischecked: true
+ ischecked: true,
+ vid: new Date().getTime(),
+ isSelected: false
});
}
this.calculate(this.jhOrderPlanForwardList);
@@ -444,13 +460,7 @@
this.$u.toast('璇疯緭鍏ュ悎娉曟暟瀛�');
isPass = false;
return isPass;
- }
- // else if (Number(v.carNum) > Number(this.forwardSurplus)) {
- // this.$u.toast('瓒呰繃鏈�澶ц鍗曞墿浣欓噺');
- // isPass = false;
- // return isPass;
- // }
- else {
+ } else {
isPass = true;
return isPass;
}
--
Gitblit v1.9.1