|
@@ -96,7 +96,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="股票截图" prop="today_stock_img">
|
|
|
<div class="imgs" v-for="(item,index) in form.today_stock_img" :key='index'>
|
|
|
- <img width="150" :src="item" alt="">
|
|
|
+ <img width="150" :src="item" alt="">
|
|
|
<i @click="form.today_stock_img.splice(index,1)" class="el-icon-circle-close del"></i>
|
|
|
</div>
|
|
|
<img v-if='form.today_stock_img.length == 0' width="110" src="upload.png" alt="">
|
|
@@ -143,7 +143,7 @@
|
|
|
{ required: true, message: '请输入用户代码', trigger: 'blur' }
|
|
|
],
|
|
|
today_fund: [
|
|
|
- { required: true, message: '请输入今日资产', trigger: 'blur' }
|
|
|
+ { required: true, message: '请输入今日资产', trigger: 'blur' },
|
|
|
],
|
|
|
today_stock_img: [
|
|
|
{ required: true, message: '请输入股票截图', trigger: 'blur' }
|
|
@@ -171,13 +171,17 @@
|
|
|
form.is_markt=Number(form.is_markt)
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
+ if(isNaN(Number(form.today_fund)) || Number(form.today_fund)<=0){
|
|
|
+ this.$message('请输入今日资产');
|
|
|
+ return
|
|
|
+ }
|
|
|
if(!this.form.is_markt){
|
|
|
if(this.form.today_stock.length<=0){
|
|
|
this.$message('请添加股票');
|
|
|
return
|
|
|
}else{
|
|
|
- if((!this.form.today_stock[0].name || !this.form.today_stock[0].fund) && !this.form.is_markt){
|
|
|
- this.$message('请选择股票并输入资金额');
|
|
|
+ if((!form.today_stock[0].name || isNaN(Number(form.today_stock[0].fund)) || Number(form.today_stock[0].fund)<=0)){
|
|
|
+ this.$message('请输入股票代码并输入资金额');
|
|
|
return
|
|
|
}
|
|
|
}
|