|
@@ -350,7 +350,7 @@
|
|
|
:label="item.normName"
|
|
|
:name="item.normName"
|
|
|
>
|
|
|
- <el-form :model="form">
|
|
|
+ <el-form :model="form" >
|
|
|
<!-- :rules="rules" ref="form" -->
|
|
|
<el-form-item
|
|
|
v-for="(listItem, listIndex) in form.feeLists"
|
|
@@ -384,27 +384,32 @@
|
|
|
</el-form> -->
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
-
|
|
|
+ <template v-else-if="this.form.type == 1">
|
|
|
<el-form
|
|
|
- :model="form"
|
|
|
- v-else-if="this.form.type == 1"
|
|
|
+ v-for="(listItem, listIndex) in form.feeLists"
|
|
|
+ :model="listItem"
|
|
|
+ :ref="'form' + listIndex"
|
|
|
+ :rules="rules"
|
|
|
+
|
|
|
>
|
|
|
<!-- :rules="rules" ref="form" -->
|
|
|
<el-form-item
|
|
|
- v-for="(listItem, listIndex) in form.feeLists"
|
|
|
:key="listItem.normfeeId"
|
|
|
:label="listItem.normfeeName"
|
|
|
:required="true"
|
|
|
+ prop="collCalue"
|
|
|
+
|
|
|
>
|
|
|
<!-- 这里科研失败!想动态绑定校验规则的 -->
|
|
|
<!-- :prop="listItem.normfeeId" -->
|
|
|
<!-- :rules="rules.listItem.normfeeId" -->
|
|
|
<el-input
|
|
|
v-model="listItem.collCalue"
|
|
|
- :placeholder="'请输入' + listItem.normfeeName"
|
|
|
+ :placeholder="'请输入' + listItem.normfeeName"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+ </template>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitForm('add')">确 定</el-button>
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
@@ -519,6 +524,7 @@ import axios from "axios";
|
|
|
export default {
|
|
|
name: "GATHER",
|
|
|
data() {
|
|
|
+
|
|
|
return {
|
|
|
edit: Boolean, //false 查看 true修改
|
|
|
tabList: [],
|
|
@@ -589,6 +595,9 @@ export default {
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
// id: [{ required: true, message: "$comment不能为空", trigger: "blur" }],
|
|
|
+ collCalue: [{ required: true, message: "不能为空", trigger: "blur" },
|
|
|
+ { trigger: "blur", validator: this.validator }
|
|
|
+ ]
|
|
|
},
|
|
|
//设置文件名字
|
|
|
setFileName: "",
|
|
@@ -603,6 +612,19 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ validator(rule, value, callback) {
|
|
|
+ let reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g;
|
|
|
+ if (!reg.test(value)) {
|
|
|
+ callback(new Error('请输入数字'));
|
|
|
+ }else if(value.split(".").length > 2) {
|
|
|
+ callback(new Error("输入正确格式的金额")); //防止输入多个小数点
|
|
|
+ }else if (value.indexOf(".") != -1 && value.split('.')[1].length > 2) {
|
|
|
+ callback(new Error('只能输入两位小数')) //小数点后两位
|
|
|
+ }else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
submitUpload() {
|
|
|
this.$refs.upload.submit();
|
|
|
},
|