商品信息

dev
wxy 2024-05-14 21:12:54 +08:00
parent 456cf765be
commit 37d367fdaf
1 changed files with 14 additions and 7 deletions

View File

@ -400,7 +400,8 @@ export default {
//
rules: {
name: [
{ required: true, message: "商品名称不能为空", trigger: "blur" }
{required: true, message: '请输入商品名称', trigger: 'blur'},
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
],
unit: [
{ required: true, message: "单位不能为空", trigger: "blur" }
@ -671,22 +672,28 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
//
let typeIds = this.form.type.join(',');
let type = this.form.type[this.form.type - 1];
this.form.typeIds = typeIds;
this.form.type = type;
this.form.step = this.active
let type = this.form.type[this.form.type - 1];
this.form.typeIds = typeIds;
this.form.type = type;
this.form.step = this.active;
this.form["skuInfoList"] = this.tableBodyTemplate;
if (this.form.id != null) {
this.updateInfoById(this.form)
// ID
this.updateInfoById(this.form);
} else {
//
addInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
} else {
//
this.$message.error("表单校验失败,请检查输入内容");
}
});
},