|
|
@@ -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: [{
|