shish 2 dagen geleden
bovenliggende
commit
bfbb0b0442
1 gewijzigde bestanden met toevoegingen van 22 en 4 verwijderingen
  1. 22 4
      ghsApp/src/pagesOrder/refund.vue

+ 22 - 4
ghsApp/src/pagesOrder/refund.vue

@@ -57,13 +57,15 @@
 						<view class="input-item">
 							<input 
 								class="refund-input" 
-								type="number" 
+								type="digit" 
 								placeholder="0" 
 								v-model="res.refundCount" 
 								placeholder-style="color:#ccc" />
 							<text class="unit-label">{{res.xhUnitName}}</text>
 						</view>
 					</view>
+					<!-- digit 可输小数;数量按整数落库,金额仍按带小数的数量×单价 -->
+					<view v-if="hasRefundDecimal(res)" class="decimal-refund-tip">售后数量会去掉小数点,售后金额会算上小数点</view>
 				</view>
 			</view>
 		</view>
@@ -270,6 +272,13 @@ export default {
 	watch:{
 	},
 	methods: {
+		/**
+		 * 售后数量是否带小数点:有则提示「数量去小数、金额按小数算」。
+		 */
+		hasRefundDecimal(item) {
+			const raw = item && item.refundCount != null ? String(item.refundCount) : ''
+			return raw.indexOf('.') >= 0
+		},
 		addHalf(item){
 			let that = this
 			let orderSn = this.orderInfo.orderSn
@@ -303,7 +312,7 @@ export default {
 				if(Number(ele.refundCount)>0){
 					product.push({
 						"productId":ele.productId,
-						"num":ele.refundCount,
+						"num": parseInt(ele.refundCount, 10) || 0,
 						"unitType":ele.unitType,
 						unitName:ele.xhUnitName,
 						unitType:ele.xhUnitType,
@@ -626,6 +635,7 @@ export default {
 	display: flex;
 	align-items: center;
 	justify-content: space-between;
+	flex-wrap: wrap;
 	padding: 20upx;
 	margin-bottom: 8upx;
 	background: #fafbfc;
@@ -680,15 +690,22 @@ export default {
 .refund-control {
 	display: flex;
 	align-items: center;
-	gap: 8upx;
 	
 	.input-item {
 		display: flex;
 		align-items: center;
-		gap: 8upx;
 	}
 }
 
+.decimal-refund-tip {
+	width: 100%;
+	margin-top: 12upx;
+	font-size: 26upx;
+	font-weight: bold;
+	color: #e67e22;
+	line-height: 1.4;
+}
+
 .refund-input {
 	width: 100upx;
 	height: 60upx;
@@ -706,6 +723,7 @@ export default {
 }
 
 .unit-label {
+	margin-left: 8upx;
 	font-size: 24upx;
 	color: #666;
 	min-width: 40upx;