商品模块代码继续完善,表单校验等
parent
2932c7f35d
commit
20042786aa
|
@ -3,4 +3,7 @@
|
||||||
<component name="JavaScriptSettings">
|
<component name="JavaScriptSettings">
|
||||||
<option name="languageLevel" value="ES6" />
|
<option name="languageLevel" value="ES6" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="WebPackConfiguration">
|
||||||
|
<option name="mode" value="DISABLED" />
|
||||||
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -17,15 +17,15 @@ export default {
|
||||||
* @description api请求基础路径
|
* @description api请求基础路径
|
||||||
*/
|
*/
|
||||||
api_dev: {
|
api_dev: {
|
||||||
// common: 'http://192.168.0.101:8890',
|
common: 'http://192.168.0.100:8890',
|
||||||
// buyer: 'http://192.168.0.101:8888',
|
buyer: 'http://192.168.0.100:8888',
|
||||||
// seller: 'http://192.168.0.101:8889',
|
seller: 'http://192.168.0.100:8889',
|
||||||
// manager: 'http://192.168.0.101:8887'
|
manager: 'http://192.168.0.100:8887'
|
||||||
|
|
||||||
common: 'https://common-api.pickmall.cn',
|
// common: 'https://common-api.pickmall.cn',
|
||||||
buyer: 'https://buyer-api.pickmall.cn',
|
// buyer: 'https://buyer-api.pickmall.cn',
|
||||||
seller: 'https://store-api.pickmall.cn',
|
// seller: 'https://store-api.pickmall.cn',
|
||||||
manager: 'https://admin-api.pickmall.cn'
|
// manager: 'https://admin-api.pickmall.cn'
|
||||||
},
|
},
|
||||||
api_prod: {
|
api_prod: {
|
||||||
common: 'https://common-api.pickmall.cn',
|
common: 'https://common-api.pickmall.cn',
|
||||||
|
|
|
@ -17,14 +17,14 @@ export default {
|
||||||
* @description api请求基础路径
|
* @description api请求基础路径
|
||||||
*/
|
*/
|
||||||
api_dev: {
|
api_dev: {
|
||||||
common: "https://common-api.pickmall.cn",
|
// common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
// buyer: "https://buyer-api.pickmall.cn",
|
||||||
seller: "https://store-api.pickmall.cn",
|
// seller: "https://store-api.pickmall.cn",
|
||||||
manager: "https://admin-api.pickmall.cn"
|
// manager: "https://admin-api.pickmall.cn"
|
||||||
// common: 'http://192.168.0.100:8890',
|
common: 'http://192.168.0.100:8890',
|
||||||
// buyer: 'http://192.168.0.100:8888',
|
buyer: 'http://192.168.0.100:8888',
|
||||||
// seller: 'http://192.168.0.100:8889',
|
seller: 'http://192.168.0.100:8889',
|
||||||
// manager: 'http://192.168.0.100:8887'
|
manager: 'http://192.168.0.100:8887'
|
||||||
},
|
},
|
||||||
api_prod: {
|
api_prod: {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
|
|
|
@ -65,9 +65,19 @@ export const INTEGER = {
|
||||||
message:'请输入正整数'
|
message:'请输入正整数'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const VARCHAR5 = {
|
||||||
|
pattern:/^.{1,5}$/,
|
||||||
|
message:'长度应该限制在1-5个字符'
|
||||||
|
}
|
||||||
|
|
||||||
export const VARCHAR20 = {
|
export const VARCHAR20 = {
|
||||||
pattern:/^.{3,20}$/,
|
pattern:/^.{1,20}$/,
|
||||||
message:'长度应该限制在3-20个字符'
|
message:'长度应该限制在1-20个字符'
|
||||||
|
}
|
||||||
|
|
||||||
|
export const VARCHAR255 = {
|
||||||
|
pattern:/^.{1,255}$/,
|
||||||
|
message:'超出最大长度限制'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const URL200 = {
|
export const URL200 = {
|
||||||
|
|
|
@ -57,6 +57,9 @@ import {
|
||||||
updateGoodsUnit,
|
updateGoodsUnit,
|
||||||
delGoodsUnit
|
delGoodsUnit
|
||||||
} from "@/api/index";
|
} from "@/api/index";
|
||||||
|
|
||||||
|
import {regular} from "@/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "goods-unit",
|
name: "goods-unit",
|
||||||
data() {
|
data() {
|
||||||
|
@ -79,12 +82,9 @@ export default {
|
||||||
// 表单验证规则
|
// 表单验证规则
|
||||||
formValidate: {
|
formValidate: {
|
||||||
name: [
|
name: [
|
||||||
{
|
regular.REQUIRED,
|
||||||
required: true,
|
regular.VARCHAR5
|
||||||
message: "请输入计量单位",
|
]
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
submitLoading: false, // 添加或编辑提交状态
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
selectList: [], // 多选数据
|
selectList: [], // 多选数据
|
||||||
|
|
|
@ -56,7 +56,8 @@
|
||||||
:mask-closable="false"
|
:mask-closable="false"
|
||||||
:width="500"
|
:width="500"
|
||||||
>
|
>
|
||||||
<Form ref="form" :model="form" :label-width="100">
|
<Form ref="form" :model="form" :label-width="100"
|
||||||
|
:rules="formValidate">
|
||||||
<FormItem label="规格名称" prop="specName">
|
<FormItem label="规格名称" prop="specName">
|
||||||
<Input v-model="form.specName" maxlength="30" clearable style="width: 100%"/>
|
<Input v-model="form.specName" maxlength="30" clearable style="width: 100%"/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
@ -92,6 +93,7 @@ import {
|
||||||
delSpec
|
delSpec
|
||||||
} from "@/api/goods";
|
} from "@/api/goods";
|
||||||
|
|
||||||
|
import {regular} from "@/utils";
|
||||||
export default {
|
export default {
|
||||||
name: "spec",
|
name: "spec",
|
||||||
components: {},
|
components: {},
|
||||||
|
@ -108,6 +110,17 @@ export default {
|
||||||
sort: "createTime", // 默认排序字段
|
sort: "createTime", // 默认排序字段
|
||||||
order: "asc", // 默认排序方式
|
order: "asc", // 默认排序方式
|
||||||
},
|
},
|
||||||
|
// 表单验证规则
|
||||||
|
formValidate: {
|
||||||
|
specName: [
|
||||||
|
regular.REQUIRED,
|
||||||
|
regular.VARCHAR20
|
||||||
|
],
|
||||||
|
specValue: [
|
||||||
|
regular.REQUIRED,
|
||||||
|
regular.VARCHAR255
|
||||||
|
],
|
||||||
|
},
|
||||||
form: {
|
form: {
|
||||||
// 添加或编辑表单对象初始化数据
|
// 添加或编辑表单对象初始化数据
|
||||||
specName: "",
|
specName: "",
|
||||||
|
@ -280,6 +293,7 @@ export default {
|
||||||
this.modalType = 0;
|
this.modalType = 0;
|
||||||
this.modalTitle = "添加";
|
this.modalTitle = "添加";
|
||||||
this.$refs.form.resetFields();
|
this.$refs.form.resetFields();
|
||||||
|
this.specValue = '';
|
||||||
delete this.form.id;
|
delete this.form.id;
|
||||||
this.modalVisible = true;
|
this.modalVisible = true;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue