|
@@ -54,7 +54,7 @@
|
|
<el-input
|
|
<el-input
|
|
class="inp-name"
|
|
class="inp-name"
|
|
placeholder="请输入医院名称"
|
|
placeholder="请输入医院名称"
|
|
- maxlength="100"
|
|
|
|
|
|
+ maxlength="50"
|
|
v-model.trim="form.hospitalRelationVOList[scope.$index].name"
|
|
v-model.trim="form.hospitalRelationVOList[scope.$index].name"
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -75,7 +75,7 @@
|
|
<el-input
|
|
<el-input
|
|
class="inp-name"
|
|
class="inp-name"
|
|
placeholder="请输入编码"
|
|
placeholder="请输入编码"
|
|
- maxlength="100"
|
|
|
|
|
|
+ maxlength="50"
|
|
v-model.trim="form.hospitalRelationVOList[scope.$index].code"
|
|
v-model.trim="form.hospitalRelationVOList[scope.$index].code"
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -156,16 +156,21 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
onSubmit() {
|
|
onSubmit() {
|
|
- this.$refs.form.validate(valid => {
|
|
|
|
|
|
+ this.form.hospitalRelationVOList.forEach((item, index) => {
|
|
|
|
+ if (item.name == '' && item.code == '') {
|
|
|
|
+ this.form.hospitalRelationVOList.splice(index, 1);
|
|
|
|
+ this.$refs.form.clearValidate();
|
|
|
|
+ }
|
|
|
|
+ item.errorOther = false;
|
|
|
|
+ item.errorCurrent = false;
|
|
|
|
+ });
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.form.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
this.saveDisable = true;
|
|
this.saveDisable = true;
|
|
let params = {
|
|
let params = {
|
|
hospitalRelationVOList: this.form.hospitalRelationVOList
|
|
hospitalRelationVOList: this.form.hospitalRelationVOList
|
|
};
|
|
};
|
|
- this.form.hospitalRelationVOList.forEach((item, index) => {
|
|
|
|
- item.errorOther = false;
|
|
|
|
- item.errorCurrent = false;
|
|
|
|
- });
|
|
|
|
api.saveHospitalRelation(params).then(res => {
|
|
api.saveHospitalRelation(params).then(res => {
|
|
if (res.data.code === '0') {
|
|
if (res.data.code === '0') {
|
|
this.$message({
|
|
this.$message({
|
|
@@ -201,6 +206,8 @@ export default {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ });
|
|
|
|
+
|
|
},
|
|
},
|
|
getIndex(data, list) {
|
|
getIndex(data, list) {
|
|
let arr2Map = {};
|
|
let arr2Map = {};
|