|
@@ -452,32 +452,29 @@
|
|
|
:label="item.normName"
|
|
|
:name="item.normName"
|
|
|
>
|
|
|
- <el-form
|
|
|
- v-for="(listItem, listIndex) in form.feeLists"
|
|
|
- :key="index + listIndex + listItem.normId"
|
|
|
- :rules="validatorList(listItem.normfeeName)"
|
|
|
- :model="listItem"
|
|
|
- :ref="'form' + listIndex"
|
|
|
- >
|
|
|
- <!-- :rules="rules" ref="form" -->
|
|
|
- <el-form-item
|
|
|
- :key="listItem.normfeeId"
|
|
|
- :label="
|
|
|
- listItem.normfeeName + '(' + listItem.funit_dictText + ')'
|
|
|
- "
|
|
|
+ <template v-for="(listItem, listIndex) in form.feeLists">
|
|
|
+ <el-form
|
|
|
v-if="listItem.normId == item.normId"
|
|
|
- prop="collCalue"
|
|
|
- >
|
|
|
- <!-- 这里科研失败!想动态绑定校验规则的 -->
|
|
|
- <!-- :prop="listItem.normfeeId" -->
|
|
|
- <!-- :rules="rules.listItem.normfeeId" -->
|
|
|
- <el-input
|
|
|
- v-model="listItem.collCalue"
|
|
|
- :placeholder="'请输入' + listItem.normfeeName"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
-
|
|
|
+ :rules="validatorList(listItem.normfeeName)"
|
|
|
+ :model="listItem"
|
|
|
+ :ref="'form' + listItem.normfeeId"
|
|
|
+ :key="listItem.normfeeId"
|
|
|
+ > <!-- :key="index + listIndex + listItem.normId" -->
|
|
|
+ <!-- :rules="rules" ref="form" -->
|
|
|
+ <el-form-item
|
|
|
+ :label="listItem.normfeeName + '(' + listItem.funit_dictText + ')'"
|
|
|
+ prop="collCalue"
|
|
|
+ >
|
|
|
+ <!-- 这里科研失败!想动态绑定校验规则的 -->
|
|
|
+ <!-- :prop="listItem.normfeeId" -->
|
|
|
+ <!-- :rules="rules.listItem.normfeeId" -->
|
|
|
+ <el-input
|
|
|
+ v-model="listItem.collCalue"
|
|
|
+ :placeholder="'请输入' + listItem.normfeeName"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </template>
|
|
|
<!-- 这里是第二种写法 -->
|
|
|
<!-- <el-form :model="form" label-width="300px">
|
|
|
<el-form-item
|
|
@@ -497,15 +494,13 @@
|
|
|
<el-form
|
|
|
v-for="(listItem, listIndex) in form.feeLists"
|
|
|
:model="listItem"
|
|
|
- :ref="'form' + listIndex"
|
|
|
+ :ref="'form' + listItem.normfeeId"
|
|
|
:rules="rules"
|
|
|
+ :key="listItem.normfeeId"
|
|
|
>
|
|
|
<!-- :rules="rules" ref="form" -->
|
|
|
<el-form-item
|
|
|
- :key="listItem.normfeeId"
|
|
|
- :label="
|
|
|
- listItem.normfeeName + '(' + listItem.funit_dictText + ')'
|
|
|
- "
|
|
|
+ :label="listItem.normfeeName + '(' + listItem.funit_dictText + ')'"
|
|
|
prop="collCalue"
|
|
|
>
|
|
|
<!-- 这里科研失败!想动态绑定校验规则的 -->
|
|
@@ -545,31 +540,30 @@
|
|
|
:label="item.normName"
|
|
|
:name="item.normName"
|
|
|
>
|
|
|
- <el-form
|
|
|
- v-for="(listItem, listIndex) in form.feeLists"
|
|
|
- :model="listItem"
|
|
|
- :ref="'form' + listIndex"
|
|
|
- :rules="rules"
|
|
|
- >
|
|
|
- <!-- :rules="rules" ref="form" -->
|
|
|
- <el-form-item
|
|
|
- prop="collCalue"
|
|
|
- :key="listItem.normfeeId"
|
|
|
- :label="
|
|
|
- listItem.normfeeName + '(' + listItem.funit_dictText + ')'
|
|
|
- "
|
|
|
+ <template v-for="(listItem, listIndex) in form.feeLists">
|
|
|
+ <el-form
|
|
|
v-if="listItem.normId == item.normId"
|
|
|
+ :model="listItem"
|
|
|
+ :ref="'form' + listItem.normfeeId"
|
|
|
+ :rules="rules"
|
|
|
+ :key="listItem.normfeeId"
|
|
|
>
|
|
|
- <!-- 这里科研失败!想动态绑定校验规则的 -->
|
|
|
- <!-- :prop="listItem.normfeeId" -->
|
|
|
- <!-- :rules="rules.listItem.normfeeId" -->
|
|
|
- <el-input
|
|
|
- :disabled="!edit"
|
|
|
- v-model="listItem.collCalue"
|
|
|
- :placeholder="'请输入' + listItem.normfeeName"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ <!-- :rules="rules" ref="form" -->
|
|
|
+ <el-form-item
|
|
|
+ prop="collCalue"
|
|
|
+ :label="listItem.normfeeName + '(' + listItem.funit_dictText + ')'"
|
|
|
+ >
|
|
|
+ <!-- 这里科研失败!想动态绑定校验规则的 -->
|
|
|
+ <!-- :prop="listItem.normfeeId" -->
|
|
|
+ <!-- :rules="rules.listItem.normfeeId" -->
|
|
|
+ <el-input
|
|
|
+ :disabled="!edit"
|
|
|
+ v-model="listItem.collCalue"
|
|
|
+ :placeholder="'请输入' + listItem.normfeeName"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </template>
|
|
|
|
|
|
<!-- 这里是第二种写法 -->
|
|
|
<!-- <el-form :model="form" label-width="150px">
|
|
@@ -587,16 +581,37 @@
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
|
|
|
+ <template v-else-if="this.form.type == 1">
|
|
|
+ <el-form
|
|
|
+ v-for="(listItem, listIndex) in form.feeLists"
|
|
|
+ :model="listItem"
|
|
|
+ :ref="'form' + listItem.normfeeId"
|
|
|
+ :rules="rules"
|
|
|
+ :key="listItem.normfeeId"
|
|
|
+ >
|
|
|
+ <!-- :rules="rules" ref="form" -->
|
|
|
+ <el-form-item
|
|
|
+ :label="listItem.normfeeName + '(' + listItem.funit_dictText + ')'"
|
|
|
+ prop="collCalue"
|
|
|
+ >
|
|
|
+ <!-- 这里科研失败!想动态绑定校验规则的 -->
|
|
|
+ <!-- :prop="listItem.normfeeId" -->
|
|
|
+ <!-- :rules="rules.listItem.normfeeId" -->
|
|
|
+ <el-input
|
|
|
+ v-model="listItem.collCalue"
|
|
|
+ :placeholder="'请输入' + listItem.normfeeName"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!--
|
|
|
<el-form :model="form" v-else-if="this.form.type == 1">
|
|
|
- <!-- :rules="rules" ref="form" -->
|
|
|
<el-form-item
|
|
|
v-for="(listItem, listIndex) in form.feeLists"
|
|
|
:key="listItem.normfeeId"
|
|
|
:label="listItem.normfeeName + '(' + listItem.funit_dictText + ')'"
|
|
|
>
|
|
|
- <!-- 这里科研失败!想动态绑定校验规则的 -->
|
|
|
- <!-- :prop="listItem.normfeeId" -->
|
|
|
- <!-- :rules="rules.listItem.normfeeId" -->
|
|
|
<el-input
|
|
|
:disabled="!edit"
|
|
|
v-model="listItem.collCalue"
|
|
@@ -604,6 +619,7 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+ -->
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitForm('edit')" v-if="edit"
|
|
|
>确 定</el-button
|
|
@@ -738,7 +754,7 @@ export default {
|
|
|
let reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g;
|
|
|
if (!reg.test(value)) {
|
|
|
callback(new Error("请输入数字和正确格式的数字"));
|
|
|
- } else if (value.split(".").length > 2) {
|
|
|
+ } else if (value.split(".") && value.split(".").length > 2) {
|
|
|
callback(new Error("请输入正确格式的数字")); //防止输入多个小数点
|
|
|
}
|
|
|
// else if (value.indexOf('.') != -1 && value.split('.')[1].length > 2) {
|
|
@@ -752,7 +768,7 @@ export default {
|
|
|
let reg = /^[+]?(0|([1-9]\d*))(\.\d+)?$/g;
|
|
|
if (!reg.test(value)) {
|
|
|
callback(new Error("请输入正数和正确格式的数字"));
|
|
|
- } else if (value.split(".").length > 2) {
|
|
|
+ } else if (value.split(".") && value.split(".").length > 2) {
|
|
|
callback(new Error("请输入正确格式的数字")); //防止输入多个小数点
|
|
|
}
|
|
|
// else if (value.indexOf('.') != -1 && value.split('.')[1].length > 2) {
|
|
@@ -1121,7 +1137,8 @@ export default {
|
|
|
let p = [];
|
|
|
p = this.form.feeLists.map((item, index) => {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- this.$refs["form" + index][0].validate((valid) => {
|
|
|
+ this.$refs["form" + item.normfeeId][0].validate((valid) => {
|
|
|
+ // this.$refs["form" + index].validate((valid) => {
|
|
|
if (valid) {
|
|
|
resolve(); //完成态
|
|
|
} else {
|