From 52c0cc56e20ddb454812fa89e0fa38c785ef79f8 Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期四, 19 九月 2024 18:47:10 +0800
Subject: [PATCH] 1.商品限购数量非必填项

---
 sub_pages/supplier/flower-manage/flower-add.vue |   47 ++++++++++++++++++++++++++++++++---------------
 1 files changed, 32 insertions(+), 15 deletions(-)

diff --git a/sub_pages/supplier/flower-manage/flower-add.vue b/sub_pages/supplier/flower-manage/flower-add.vue
index 82c1e79..4fbbcc5 100644
--- a/sub_pages/supplier/flower-manage/flower-add.vue
+++ b/sub_pages/supplier/flower-manage/flower-add.vue
@@ -114,14 +114,19 @@
 			<view class="form-item before-line">
 				<view class="label required">售价(元)</view>
 				<view class="m-l-a m-r-0 flex">
-					<input v-model="dto.price" placeholder="请输入数字" type="digit"
-						style="margin-top: 16px;text-align: right;"></input>
+					<input v-model="dto.price" placeholder="请输入数字" type="digit" class="text-right m-t-15"></input>
 				</view>
 			</view>
 			<view class="form-item ">
 				<view class="label required">库存</view>
 				<view class="m-l-a m-r-0 flex">
-					<input v-model="dto.stock" placeholder="请输入数字" type="number"
+					<input v-model="dto.stock" placeholder="请输入数字" type="number" class="text-right m-t-15"></input>
+				</view>
+			</view>
+			<view class="form-item ">
+				<view class="label">限购数量</view>
+				<view class="m-l-a m-r-0 flex">
+					<input v-model="dto.limited" placeholder="请输入数字" type="number"
 						style="margin-top: 16px;text-align: right;"></input>
 				</view>
 			</view>
@@ -150,8 +155,17 @@
 			</view>
 			<view class="line-gray-big"></view>
 
+			<view class="form-item  before-line">
+				<view class="label">商品描述</view>
+				<view class="m-l-a m-r-0 flex">
 
-			<view class="form-item before-line">
+				</view>
+			</view>
+			<view style="min-width: 500rpx;margin-left: 20rpx;margin-right: 20rpx;margin-top: 20rpx;">
+				<u--textarea v-model="dto.description" autoHeight placeholder="请输入商品描述"></u--textarea>
+			</view>
+
+			<view class="form-item bottom-border-no">
 				<view class="label">商品视频</view>
 				<view class="m-l-a m-r-0 flex">
 					<!-- :style="{'background-image':dto.icon&&`url('${dto.icon}')`||''}" -->
@@ -164,18 +178,10 @@
 			<view v-if="dto.video">
 				<video :src="dto.video" :auto-pause-if-navigate="true" style="display: block;margin: 0 auto;"></video>
 			</view>
-			<view class="form-item bottom-border-no">
-				<view class="label">商品描述</view>
-				<view class="m-l-a m-r-0 flex">
-
-				</view>
-			</view>
-			<view style="min-width: 500rpx;margin-left: 20rpx;margin-right: 20rpx;margin-top: 20rpx;">
-				<u--textarea v-model="dto.description" autoHeight placeholder="请输入商品描述"></u--textarea>
-			</view>
 
 
-			<view style="min-height: 200rpx;">
+
+			<view style="min-height: 240rpx;">
 				&nbsp;
 			</view>
 			<view class="button-green-1 m-t-20 button-fixed-bottom " @click="submit" v-if="!dto.id">
@@ -242,6 +248,7 @@
 					level: '', //FLOWER_LEVEL
 					price: '',
 					stock: '',
+					limited:'',
 					params: [], //id,value
 					description: '',
 				},
@@ -260,7 +267,9 @@
 				}, {
 					name: '商品库存',
 					key: 'stock'
-				}],
+				},
+			
+				],
 				show_select_category: false,
 				show_select_level: false,
 				columns_categorys: [],
@@ -660,6 +669,14 @@
 					this.$message.showToast('商品库存格式错误,需要大于0')
 					return
 				}
+				
+			
+				if ( this.dto.limited && this.dto.limited !== '' && (!Number(this.dto.limited) || Number(this.dto.limited) <= 0)) {
+				    this.$message.showToast('商品限购数量格式错误');
+				    return;
+				}
+
+
 
 				for (var field of this.requireFields) {
 					if (!this.dto[field.key]) {

--
Gitblit v1.9.3