diff --git a/yxt-as-ui/src/views/basicinformation/additionitem/additionitem.vue b/yxt-as-ui/src/views/basicinformation/additionitem/additionitem.vue index 2d64043bf0..362e3410d6 100644 --- a/yxt-as-ui/src/views/basicinformation/additionitem/additionitem.vue +++ b/yxt-as-ui/src/views/basicinformation/additionitem/additionitem.vue @@ -52,11 +52,11 @@ - + -
项目名称
- +
*项目名称
+
拼音缩写
@@ -69,18 +69,18 @@
-
排序
- +
*排序
+
-
销售价
- +
*销售价
+
-
成本
- +
*成本
+
@@ -121,6 +121,12 @@ export default { createOrgSid: '', useOrgSid: '' }, + rules: { + aitemName: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }], + price: [{ required: true, message: '销售价不能为空', trigger: 'blur' }], + sortNo: [{ required: true, message: '排序不能为空', trigger: 'blur' }], + cost: [{ required: true, message: '成本不能为空', trigger: 'blur' }], + }, btndisabled: false, btnList: [ { @@ -252,6 +258,9 @@ export default { }, toAdd() { this.dialogVisible = true + this.$nextTick(() => { + this.$refs['form_obj'].clearValidate() + }) }, getNumber(val, limit) { val = val.replace(/[^0-9.]/g, '') // 保留数字 @@ -285,11 +294,15 @@ export default { getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => { if (res.success) { this.formobj.createOrgSid = res.data - req.saveOrUpdate(this.formobj).then((resp) => { - if (resp.success) { - this.$message({ showClose: true, type: 'success', message: '保存成功' }) - this.getList() - this.handleClose() + this.$refs['form_obj'].validate((valid) => { + if (valid) { + req.saveOrUpdate(this.formobj).then((resp) => { + if (resp.success) { + this.$message({ showClose: true, type: 'success', message: '保存成功' }) + this.getList() + this.handleClose() + } + }) } }) } @@ -354,6 +367,9 @@ export default { .addinputInfo { margin-left: 75px !important; } +/deep/ .el-form-item__error { + margin-left: 75px !important; +} .formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw { margin-left: 75px !important; width: calc(100% - 70px); diff --git a/yxt-as-ui/src/views/basicinformation/setmeal/setmealAdd.vue b/yxt-as-ui/src/views/basicinformation/setmeal/setmealAdd.vue index f7bf12613d..ce21e7f742 100644 --- a/yxt-as-ui/src/views/basicinformation/setmeal/setmealAdd.vue +++ b/yxt-as-ui/src/views/basicinformation/setmeal/setmealAdd.vue @@ -12,7 +12,7 @@ -
*套餐名称
+
*套餐名称
@@ -211,7 +211,8 @@ export default { size: 2, total: 0, params: { - name: '' + name: '', + orgPath: '' } }, commodityData: [],