li.shaoyi %!s(int64=2) %!d(string=hai) anos
pai
achega
f4f3c0466f

+ 6 - 7
src/packages/pc/views/centralize/list/components/buy/index.vue

@@ -1,7 +1,7 @@
 <!-- 集采交易-预售大厅-认购 -->
 <template>
-    <app-drawer title="认购" v-model:show="show" :loading="loading" :refresh="refresh">
-        <el-form ref="formRef" label-width="100px" :model="formData" :rules="formRules">
+    <app-drawer title="认购" v-model:show="show" :width="400" :loading="loading" :refresh="refresh">
+        <el-form ref="formRef" label-width="120px" :model="formData" :rules="formRules">
             <el-form-item label="商品名称">
                 {{ selectedRow.wrstandardname }}
             </el-form-item>
@@ -14,10 +14,9 @@
             <el-form-item label="剩余集采量">
                 {{ remainqty }}
             </el-form-item>
-            <el-form-item label="采购数量" prop="OrderQty">
-                <el-input type="number" placeholder="请输入" v-model.number="formData.OrderQty">
-                    <template #append>(克拉)</template>
-                </el-input>
+            <el-form-item label="采购数量(克拉)" prop="OrderQty">
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.OrderQty"
+                    style="width: 100%;" />
             </el-form-item>
         </el-form>
         <template #footer>
@@ -58,7 +57,7 @@ const formRules: FormRules = {
     OrderQty: [{
         required: true,
         validator: (rule, value, callback) => {
-            const message = validate(value, 'integer')
+            const message = validate(value, 'positive')
             if (message) {
                 callback(new Error('请输入采购数量'))
             } else {

+ 8 - 16
src/packages/pc/views/centralize/mine/components/add/index.vue

@@ -13,28 +13,20 @@
                     </el-radio>
                 </el-radio-group>
             </el-form-item>
-            <el-form-item label="集采数量" prop="PresaleQty">
-                <el-input type="number" placeholder="请输入" v-model.number="formData.PresaleQty">
-                    <template #append>(克拉)</template>
-                </el-input>
+            <el-form-item label="集采数量(克拉)" prop="PresaleQty">
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.PresaleQty" />
             </el-form-item>
             <el-form-item label="履约方式" prop="PerformanceTemplateID">
                 <component :is="PerformanceTemplate" v-model="formData.PerformanceTemplateID" />
             </el-form-item>
             <el-form-item label="最小采购单位" prop="MinBuyQty">
-                <el-input placeholder="请添加采集价格" :value="minQty" disabled>
-                    <template #append>(克拉)</template>
-                </el-input>
+                <el-input placeholder="请添加采集价格" :value="minQty" disabled />
             </el-form-item>
             <el-form-item label="最低成团量" prop="MinSuccessQty">
-                <el-input type="number" placeholder="请输入" v-model.number="formData.MinSuccessQty">
-                    <template #append>(克拉)</template>
-                </el-input>
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.MinSuccessQty" />
             </el-form-item>
             <el-form-item label="最大采购单位" prop="MaxBuyQty">
-                <el-input type="number" placeholder="请输入" v-model.number="formData.MaxBuyQty">
-                    <template #append>(克拉)</template>
-                </el-input>
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.MaxBuyQty" />
             </el-form-item>
             <el-form-item label="采购保证金比例" prop="BuyMarginValue">
                 <el-input type="number" placeholder="请输入" v-model="formData.BuyMarginValue">
@@ -178,17 +170,17 @@ const formRules: FormRules = {
     PresaleQty: [{
         required: true,
         message: '请输入集采数量',
-        pattern: regular.integer.reg
+        pattern: regular.positive.reg
     }],
     MinSuccessQty: [{
         required: true,
         message: '请输入最低成团量',
-        pattern: regular.integer.reg
+        pattern: regular.positive.reg
     }],
     MaxBuyQty: [{
         required: true,
         message: '请输入最大采购单位',
-        pattern: regular.integer.reg
+        pattern: regular.positive.reg
     }],
     BuyMarginValue: [{
         required: true,

+ 3 - 3
src/packages/pc/views/centralize/mine/components/add/price-edit.vue

@@ -3,10 +3,10 @@
     <app-drawer title="编辑" :width="400" v-model:show="show">
         <el-form ref="formRef" class="el-form--vertical" label-width="60px" :model="formItem" :rules="formRules">
             <el-form-item label="数量" prop="Qty">
-                <el-input-number placeholder="请输入" :min="0" :precision="0" v-model="formItem.Qty" />
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formItem.Qty" />
             </el-form-item>
             <el-form-item label="价格" prop="Price">
-                <el-input-number placeholder="请输入" :min="0" v-model="formItem.Price" />
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formItem.Price" />
             </el-form-item>
         </el-form>
         <template #footer>
@@ -37,7 +37,7 @@ const formRules: FormRules = {
     Qty: [{
         required: true,
         message: '请输入数量',
-        pattern: regular.integer.reg
+        pattern: regular.positive.reg
     }],
     Price: [{
         required: true,

+ 6 - 7
src/packages/pc/views/presale/list/components/buy/index.vue

@@ -1,7 +1,7 @@
 <!-- 预售大厅-预售大厅-认购 -->
 <template>
-    <app-drawer title="认购" v-model:show="show" :loading="loading" :refresh="refresh">
-        <el-form ref="formRef" label-width="100px" :model="formData" :rules="formRules">
+    <app-drawer title="认购" v-model:show="show" :width="400" :loading="loading" :refresh="refresh">
+        <el-form ref="formRef" label-width="120px" :model="formData" :rules="formRules">
             <el-form-item label="商品名称">
                 {{ selectedRow.wrstandardname }}
             </el-form-item>
@@ -14,10 +14,9 @@
             <el-form-item label="剩余预售量">
                 {{ remainqty }}
             </el-form-item>
-            <el-form-item label="认购数量" prop="OrderQty">
-                <el-input type="number" placeholder="请输入" v-model.number="formData.OrderQty">
-                    <template #append>(克拉)</template>
-                </el-input>
+            <el-form-item label="认购数量(克拉)" prop="OrderQty">
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.OrderQty"
+                    style="width: 100%;" />
             </el-form-item>
         </el-form>
         <template #footer>
@@ -58,7 +57,7 @@ const formRules: FormRules = {
     OrderQty: [{
         required: true,
         validator: (rule, value, callback) => {
-            const message = validate(value, 'integer')
+            const message = validate(value, 'positive')
             if (message) {
                 callback(new Error('请输入认购数量'))
             } else {

+ 14 - 23
src/packages/pc/views/presale/mine/components/add/index.vue

@@ -2,37 +2,27 @@
 <template>
     <app-drawer class="g-details" title="预售申请" v-model:show="show" :width="960" :loading="loading" :refresh="refresh">
         <h3 class="g-details__title">预售信息</h3>
-        <el-form ref="formRef" class="el-form--horizontal" label-width="140px" :model="formData" :rules="formRules">
+        <el-form ref="formRef" class="el-form--horizontal" label-width="150px" :model="formData" :rules="formRules">
             <el-form-item label="商品名称" prop="WRStandardName">
                 <el-input placeholder="请输入" v-model="formData.WRStandardName" />
             </el-form-item>
             <el-form-item label="履约方式" prop="PerformanceTemplateID">
                 <component :is="PerformanceTemplate" v-model="formData.PerformanceTemplateID" />
             </el-form-item>
-            <el-form-item label="预售总量" prop="PresaleQty">
-                <el-input type="number" placeholder="请输入" v-model.number="formData.PresaleQty">
-                    <template #append>(克拉)</template>
-                </el-input>
+            <el-form-item label="预售总量(克拉)" prop="PresaleQty">
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.PresaleQty" />
             </el-form-item>
-            <el-form-item label="预售价格" prop="UnitPrice">
-                <el-input type="number" placeholder="请输入" v-model="formData.UnitPrice">
-                    <template #append>(元/克拉)</template>
-                </el-input>
+            <el-form-item label="预售价格(元/克拉)" prop="UnitPrice">
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.UnitPrice" />
             </el-form-item>
             <el-form-item label="最小采购单位" prop="MinBuyQty">
-                <el-input type="number" placeholder="请输入" v-model.number="formData.MinBuyQty">
-                    <template #append>(克拉)</template>
-                </el-input>
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.MinBuyQty" />
             </el-form-item>
             <el-form-item label="最低成团量" prop="MinSuccessQty">
-                <el-input type="number" placeholder="请输入" v-model.number="formData.MinSuccessQty">
-                    <template #append>(克拉)</template>
-                </el-input>
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.MinSuccessQty" />
             </el-form-item>
             <el-form-item label="最大采购单位" prop="MaxBuyQty">
-                <el-input type="number" placeholder="请输入" v-model.number="formData.MaxBuyQty">
-                    <template #append>(克拉)</template>
-                </el-input>
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.MaxBuyQty" />
             </el-form-item>
             <el-form-item label="采购保证金比例" prop="BuyMarginValue">
                 <el-input type="number" placeholder="请输入" v-model="formData.BuyMarginValue">
@@ -120,26 +110,27 @@ const formRules: FormRules = {
     PresaleQty: [{
         required: true,
         message: '请输入预售总量',
-        pattern: regular.integer.reg
+        pattern: regular.positive.reg
     }],
     UnitPrice: [{
         required: true,
-        message: '请输入预售价格'
+        message: '请输入预售价格',
+        pattern: regular.positive.reg
     }],
     MinBuyQty: [{
         required: true,
         message: '请输入最小采购单位',
-        pattern: regular.integer.reg
+        pattern: regular.positive.reg
     }],
     MinSuccessQty: [{
         required: true,
         message: '请输入最低成团量',
-        pattern: regular.integer.reg
+        pattern: regular.positive.reg
     }],
     MaxBuyQty: [{
         required: true,
         message: '请输入最大采购单位',
-        pattern: regular.integer.reg
+        pattern: regular.positive.reg
     }],
     BuyMarginValue: [{
         required: true,

+ 19 - 17
src/packages/pc/views/warehousing/goods/components/edit/diamond.vue

@@ -1,6 +1,6 @@
 <!-- 添加商品-单颗裸钻 -->
 <template>
-    <el-form ref="formRef" class="el-form--horizontal" label-width="100px" :model="formData" :rules="formRules">
+    <el-form ref="formRef" class="el-form--horizontal" label-width="130px" :model="formData" :rules="formRules">
         <el-form-item label="商品编号" prop="GoodsNo">
             <el-input placeholder="请输入" v-model="formData.GoodsNo" />
         </el-form-item>
@@ -14,15 +14,11 @@
                 </el-radio>
             </el-radio-group>
         </el-form-item>
-        <el-form-item label="价格" prop="Price">
-            <el-input type="number" placeholder="请输入" v-model="formData.Price">
-                <template #append>{{ currencyInfo?.enumitemvalue }}</template>
-            </el-input>
+        <el-form-item :label="`价格(${currencyInfo?.enumitemvalue})`" prop="Price">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.Price" />
         </el-form-item>
-        <el-form-item label="克拉重量" prop="Weight">
-            <el-input type="number" placeholder="请输入" v-model="formData.Weight">
-                <template #append>(克拉)</template>
-            </el-input>
+        <el-form-item label="克拉重量(克拉)" prop="Weight">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.Weight" />
         </el-form-item>
         <el-form-item label="克拉单价">
             <span>{{ currencyInfo?.param2 }}{{ caratUnit }} (总价/总重量)</span>
@@ -84,10 +80,8 @@
                     :key="index" />
             </el-select>
         </el-form-item>
-        <el-form-item label="市场价" prop="MarketPrice">
-            <el-input type="number" placeholder="请输入" v-model="formData.MarketPrice">
-                <template #append>{{ currencyInfo?.enumitemvalue }}</template>
-            </el-input>
+        <el-form-item :label="`市场价(${currencyInfo?.enumitemvalue})`" prop="MarketPrice">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.MarketPrice" />
         </el-form-item>
         <el-form-item label="证书类型" prop="ZSCertType">
             <el-select v-model="formData.ZSCertType" clearable>
@@ -109,8 +103,8 @@
 
 <script lang="ts" setup>
 import { ref, PropType, defineAsyncComponent } from 'vue'
-import { ElMessage } from 'element-plus'
-import type { FormInstance, FormRules } from 'element-plus'
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
+import { regular } from '@/constants/regex'
 import { Category } from '@/constants/diamond'
 import { useDiamondForm } from '@/business/goods'
 import AppUpload from '@pc/components/base/upload/index.vue'
@@ -135,8 +129,16 @@ const formRules: FormRules = {
     ZSCategory: [{ required: true, message: '请选择商品分类' }],
     GoodsNo: [{ required: true, message: '请输入商品编号', trigger: 'blur' }],
     ZSCurrencyType: [{ required: true, message: '请选择货币类型' }],
-    Price: [{ required: true, message: '请输入价格' }],
-    Weight: [{ required: true, message: '请输入克拉重量' }],
+    Price: [{
+        required: true,
+        message: '请输入价格',
+        pattern: regular.positive.reg
+    }],
+    Weight: [{
+        required: true,
+        message: '请输入克拉重量',
+        pattern: regular.positive.reg
+    }],
     ZSColorType1: [{ required: true, message: '请选择颜色' }],
     ZSClarityType1: [{ required: true, message: '请选择净度' }],
     WarehouseID: [{ required: true, message: '请选择仓库' }],

+ 28 - 26
src/packages/pc/views/warehousing/goods/components/edit/diamonds.vue

@@ -1,6 +1,6 @@
 <!-- 添加商品-成批裸钻 -->
 <template>
-    <el-form ref="formRef" class="el-form--horizontal" label-width="100px" :model="formData" :rules="formRules">
+    <el-form ref="formRef" class="el-form--horizontal" label-width="130px" :model="formData" :rules="formRules">
         <el-form-item label="商品编号" prop="GoodsNo">
             <el-input placeholder="请输入" v-model="formData.GoodsNo" />
         </el-form-item>
@@ -14,20 +14,14 @@
                 </el-radio>
             </el-radio-group>
         </el-form-item>
-        <el-form-item label="总价" prop="Price">
-            <el-input type="number" placeholder="请输入" v-model="formData.Price">
-                <template #append>{{ currencyInfo?.enumitemvalue }}</template>
-            </el-input>
+        <el-form-item :label="`总价(${currencyInfo?.enumitemvalue})`" prop="Price">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.Price" />
         </el-form-item>
-        <el-form-item label="总重量" prop="Weight">
-            <el-input type="number" placeholder="请输入" v-model="formData.Weight">
-                <template #append>(克拉)</template>
-            </el-input>
+        <el-form-item label="总重量(克拉)" prop="Weight">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.Weight" />
         </el-form-item>
-        <el-form-item label="平均重量" prop="WeightAvg">
-            <el-input type="number" placeholder="请输入" v-model="formData.WeightAvg">
-                <template #append>(克拉)</template>
-            </el-input>
+        <el-form-item label="平均重量(克拉)" prop="WeightAvg">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.WeightAvg" />
         </el-form-item>
         <el-form-item label="克拉单价">
             <span>{{ currencyInfo?.param2 }}{{ caratUnit }} (总价/总重量)</span>
@@ -43,12 +37,10 @@
             <app-multiple class="el-form-item--col" :data-list="enums.cutTypeList" v-model="selectedType.cutType" />
         </el-form-item>
         <el-form-item label="净度" prop="ZSClarityType">
-            <app-multiple class="el-form-item--col" :data-list="enums.clarityTypeList"
-                v-model="selectedType.clarityType" />
+            <app-multiple class="el-form-item--col" :data-list="enums.clarityTypeList" v-model="selectedType.clarityType" />
         </el-form-item>
         <el-form-item label="抛光" prop="ZSPolishType">
-            <app-multiple class="el-form-item--col" :data-list="enums.polishTypeList"
-                v-model="selectedType.polishType" />
+            <app-multiple class="el-form-item--col" :data-list="enums.polishTypeList" v-model="selectedType.polishType" />
         </el-form-item>
         <el-form-item label="对称" prop="ZSSymmetryType">
             <app-multiple class="el-form-item--col" :data-list="enums.symmetryTypeList"
@@ -64,10 +56,8 @@
                     :key="index" />
             </el-select>
         </el-form-item>
-        <el-form-item label="市场价" prop="MarketPrice">
-            <el-input type="number" placeholder="请输入" v-model="formData.MarketPrice">
-                <template #append>{{ currencyInfo?.enumitemvalue }}</template>
-            </el-input>
+        <el-form-item :label="`市场价(${currencyInfo?.enumitemvalue})`" prop="MarketPrice">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.MarketPrice" />
         </el-form-item>
         <el-form-item label="商品图片" prop="ImagePath">
             <app-upload :file-types="['image']" type-message="请选择正确的图片类型" @change="onUploadChange" />
@@ -80,8 +70,8 @@
 
 <script lang="ts" setup>
 import { ref, PropType, defineAsyncComponent } from 'vue'
-import { ElMessage } from 'element-plus'
-import type { FormInstance, FormRules } from 'element-plus'
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
+import { regular } from '@/constants/regex'
 import { Category } from '@/constants/diamond'
 import { useDiamondForm } from '@/business/goods'
 import AppMultiple from '@pc/components/base/multiple/index.vue'
@@ -107,9 +97,21 @@ const formRules: FormRules = {
     ZSCategory: [{ required: true, message: '请选择商品分类' }],
     GoodsNo: [{ required: true, message: '请输入商品编号', trigger: 'blur' }],
     ZSCurrencyType: [{ required: true, message: '请选择货币类型' }],
-    Price: [{ required: true, message: '请输入总价' }],
-    Weight: [{ required: true, message: '请输入总重量' }],
-    WeightAvg: [{ required: true, message: '请输入平均重量' }],
+    Price: [{
+        required: true,
+        message: '请输入总价',
+        pattern: regular.positive.reg
+    }],
+    Weight: [{
+        required: true,
+        message: '请输入总重量',
+        pattern: regular.positive.reg
+    }],
+    WeightAvg: [{
+        required: true,
+        message: '请输入平均重量',
+        pattern: regular.positive.reg
+    }],
     ZSShapeType: [{ required: true, message: '请选择形状' }],
     WarehouseID: [{ required: true, message: '请选择仓库' }],
     PerformanceTemplateID: [{

+ 19 - 17
src/packages/pc/views/warehousing/goods/components/edit/fancy.vue

@@ -1,6 +1,6 @@
 <!-- 添加商品-彩色钻石 -->
 <template>
-    <el-form ref="formRef" class="el-form--horizontal" label-width="100px" :model="formData" :rules="formRules">
+    <el-form ref="formRef" class="el-form--horizontal" label-width="130px" :model="formData" :rules="formRules">
         <el-form-item label="商品编号" prop="GoodsNo">
             <el-input placeholder="请输入" v-model="formData.GoodsNo" />
         </el-form-item>
@@ -14,15 +14,11 @@
                 </el-radio>
             </el-radio-group>
         </el-form-item>
-        <el-form-item label="价格" prop="Price">
-            <el-input type="number" placeholder="请输入" v-model="formData.Price">
-                <template #append>{{ currencyInfo?.enumitemvalue }}</template>
-            </el-input>
+        <el-form-item :label="`价格(${currencyInfo?.enumitemvalue})`" prop="Price">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.Price" />
         </el-form-item>
-        <el-form-item label="克拉重量" prop="Weight">
-            <el-input type="number" placeholder="请输入" v-model="formData.Weight">
-                <template #append>(克拉)</template>
-            </el-input>
+        <el-form-item label="克拉重量(克拉)" prop="Weight">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.Weight" />
         </el-form-item>
         <el-form-item label="克拉单价">
             <span>{{ currencyInfo?.param2 }}{{ caratUnit }} (总价/总重量)</span>
@@ -94,10 +90,8 @@
                     :key="index" />
             </el-select>
         </el-form-item>
-        <el-form-item label="市场价" prop="MarketPrice">
-            <el-input type="number" placeholder="请输入" v-model="formData.MarketPrice">
-                <template #append>{{ currencyInfo?.enumitemvalue }}</template>
-            </el-input>
+        <el-form-item :label="`市场价(${currencyInfo?.enumitemvalue})`" prop="MarketPrice">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.MarketPrice" />
         </el-form-item>
         <el-form-item label="证书类型" prop="ZSCertType">
             <el-select v-model="formData.ZSCertType" clearable>
@@ -119,8 +113,8 @@
 
 <script lang="ts" setup>
 import { ref, PropType, defineAsyncComponent } from 'vue'
-import { ElMessage } from 'element-plus'
-import type { FormInstance, FormRules } from 'element-plus'
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
+import { regular } from '@/constants/regex'
 import { Category } from '@/constants/diamond'
 import { useDiamondForm } from '@/business/goods'
 import AppUpload from '@pc/components/base/upload/index.vue'
@@ -145,8 +139,16 @@ const formRules: FormRules = {
     ZSCategory: [{ required: true, message: '请选择商品分类' }],
     GoodsNo: [{ required: true, message: '请输入商品编号', trigger: 'blur' }],
     ZSCurrencyType: [{ required: true, message: '请选择货币类型' }],
-    Price: [{ required: true, message: '请输入价格' }],
-    Weight: [{ required: true, message: '请输入克拉重量' }],
+    Price: [{
+        required: true,
+        message: '请输入价格',
+        pattern: regular.positive.reg
+    }],
+    Weight: [{
+        required: true,
+        message: '请输入克拉重量',
+        pattern: regular.positive.reg
+    }],
     ZSClarityType1: [{ required: true, message: '请选择净度' }],
     WarehouseID: [{ required: true, message: '请选择仓库' }],
     PerformanceTemplateID: [{

+ 19 - 17
src/packages/pc/views/warehousing/goods/components/edit/jewelry.vue

@@ -1,6 +1,6 @@
 <!-- 添加商品-钻石首饰 -->
 <template>
-    <el-form ref="formRef" class="el-form--horizontal" label-width="100px" :model="formData" :rules="formRules">
+    <el-form ref="formRef" class="el-form--horizontal" label-width="130px" :model="formData" :rules="formRules">
         <el-form-item label="商品编号" prop="GoodsNo">
             <el-input placeholder="请输入" v-model="formData.GoodsNo" />
         </el-form-item>
@@ -14,15 +14,11 @@
                 </el-radio>
             </el-radio-group>
         </el-form-item>
-        <el-form-item label="价格" prop="Price">
-            <el-input type="number" placeholder="请输入" v-model="formData.Price">
-                <template #append>{{ currencyInfo?.enumitemvalue }}</template>
-            </el-input>
+        <el-form-item :label="`价格(${currencyInfo?.enumitemvalue})`" prop="Price">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.Price" />
         </el-form-item>
-        <el-form-item label="主石重量" prop="Weight">
-            <el-input type="number" placeholder="请输入" v-model="formData.Weight">
-                <template #append>(克拉)</template>
-            </el-input>
+        <el-form-item label="主石重量(克拉)" prop="Weight">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.Weight" />
         </el-form-item>
         <el-form-item label="款式" prop="ZSStyleType">
             <el-select v-model="formData.ZSStyleType">
@@ -81,10 +77,8 @@
                     :key="index" />
             </el-select>
         </el-form-item>
-        <el-form-item label="市场价" prop="MarketPrice">
-            <el-input type="number" placeholder="请输入" v-model="formData.MarketPrice">
-                <template #append>{{ currencyInfo?.enumitemvalue }}</template>
-            </el-input>
+        <el-form-item :label="`市场价(${currencyInfo?.enumitemvalue})`" prop="MarketPrice">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.MarketPrice" />
         </el-form-item>
         <el-form-item label="仓库" prop="WarehouseID">
             <el-select v-model="formData.WarehouseID">
@@ -118,8 +112,8 @@
 
 <script lang="ts" setup>
 import { ref, PropType, defineAsyncComponent } from 'vue'
-import { ElMessage } from 'element-plus'
-import type { FormInstance, FormRules } from 'element-plus'
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
+import { regular } from '@/constants/regex'
 import { Category } from '@/constants/diamond'
 import { useDiamondForm } from '@/business/goods'
 import AppUpload from '@pc/components/base/upload/index.vue'
@@ -146,8 +140,16 @@ const formRules: FormRules = {
     SettingMaterial: [{ required: true, message: '请输入镶嵌材料', trigger: 'blur' }],
     ZSCurrencyType: [{ required: true, message: '请选择货币类型' }],
     ZSStyleType: [{ required: true, message: '请选择款式' }],
-    Price: [{ required: true, message: '请输入价格' }],
-    Weight: [{ required: true, message: '请输入克拉重量' }],
+    Price: [{
+        required: true,
+        message: '请输入价格',
+        pattern: regular.positive.reg
+    }],
+    Weight: [{
+        required: true,
+        message: '请输入主石重量',
+        pattern: regular.positive.reg
+    }],
     ZSColorType1: [{ required: true, message: '请选择颜色' }],
     ZSClarityType1: [{ required: true, message: '请选择净度' }],
     WarehouseID: [{ required: true, message: '请选择仓库' }],

+ 27 - 24
src/packages/pc/views/warehousing/goods/components/edit/rough.vue

@@ -1,6 +1,6 @@
 <!-- 添加商品-成批毛坯 -->
 <template>
-    <el-form ref="formRef" class="el-form--horizontal" label-width="110px" :model="formData" :rules="formRules">
+    <el-form ref="formRef" class="el-form--horizontal" label-width="130px" :model="formData" :rules="formRules">
         <el-form-item label="商品编号" prop="GoodsNo">
             <el-input placeholder="请输入" v-model="formData.GoodsNo" />
         </el-form-item>
@@ -14,20 +14,14 @@
                 </el-radio>
             </el-radio-group>
         </el-form-item>
-        <el-form-item label="总价" prop="Price">
-            <el-input type="number" placeholder="请输入" v-model="formData.Price">
-                <template #append>{{ currencyInfo?.enumitemvalue }}</template>
-            </el-input>
+        <el-form-item :label="`总价(${currencyInfo?.enumitemvalue})`" prop="Price">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.Price" />
         </el-form-item>
-        <el-form-item label="总重量" prop="Weight">
-            <el-input type="number" placeholder="请输入" v-model="formData.Weight">
-                <template #append>(克拉)</template>
-            </el-input>
+        <el-form-item label="总重量(克拉)" prop="Weight">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.Weight" />
         </el-form-item>
-        <el-form-item label="平均重量" prop="WeightAvg">
-            <el-input type="number" placeholder="请输入" v-model="formData.WeightAvg">
-                <template #append>(克拉)</template>
-            </el-input>
+        <el-form-item label="平均重量(克拉)" prop="WeightAvg">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.WeightAvg" />
         </el-form-item>
         <el-form-item label="克拉单价">
             <span>{{ currencyInfo?.param2 }}{{ caratUnit }} (总价/总重量)</span>
@@ -44,8 +38,7 @@
                 v-model="selectedType.fluorescenceType" />
         </el-form-item>
         <el-form-item label="净度" prop="ZSClarityType">
-            <app-multiple class="el-form-item--col" :data-list="enums.clarityTypeList"
-                v-model="selectedType.clarityType" />
+            <app-multiple class="el-form-item--col" :data-list="enums.clarityTypeList" v-model="selectedType.clarityType" />
         </el-form-item>
         <el-form-item label="原产地" prop="Origin">
             <el-input placeholder="请输入" v-model="formData.Origin" />
@@ -59,10 +52,8 @@
         <el-form-item label="金伯利编号" prop="CPCertNo">
             <el-input placeholder="请输入" v-model="formData.CPCertNo" />
         </el-form-item>
-        <el-form-item label="市场价" prop="MarketPrice">
-            <el-input type="number" placeholder="请输入" v-model="formData.MarketPrice">
-                <template #append>{{ currencyInfo?.enumitemvalue }}</template>
-            </el-input>
+        <el-form-item :label="`市场价(${currencyInfo?.enumitemvalue})`" prop="MarketPrice">
+            <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.MarketPrice" />
         </el-form-item>
         <el-form-item label="金伯利重量" prop="KPWeight">
             <el-input type="number" placeholder="请输入" v-model="formData.KPWeight">
@@ -86,8 +77,8 @@
 
 <script lang="ts" setup>
 import { ref, PropType, defineAsyncComponent } from 'vue'
-import { ElMessage } from 'element-plus'
-import type { FormInstance, FormRules } from 'element-plus'
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
+import { regular } from '@/constants/regex'
 import { Category } from '@/constants/diamond'
 import { useDiamondForm } from '@/business/goods'
 import AppMultiple from '@pc/components/base/multiple/index.vue'
@@ -116,9 +107,21 @@ const formRules: FormRules = {
     CPCertNo: [{ required: true, message: '请输入金伯利证书编号', trigger: 'blur' }],
     KPWeight: [{ required: true, message: '请输入金伯利证书重量', trigger: 'blur' }],
     ZSCurrencyType: [{ required: true, message: '请选择货币类型' }],
-    Price: [{ required: true, message: '请输入总价' }],
-    Weight: [{ required: true, message: '请输入总重量' }],
-    WeightAvg: [{ required: true, message: '请输入平均重量' }],
+    Price: [{
+        required: true,
+        message: '请输入总价',
+        pattern: regular.positive.reg
+    }],
+    Weight: [{
+        required: true,
+        message: '请输入总重量',
+        pattern: regular.positive.reg
+    }],
+    WeightAvg: [{
+        required: true,
+        message: '请输入平均重量',
+        pattern: regular.positive.reg
+    }],
     WarehouseID: [{ required: true, message: '请选择仓库' }],
     KPPath: [{ required: true, message: '请上传金伯利证书图片' }],
     PerformanceTemplateID: [{