|
|
@@ -36,7 +36,7 @@
|
|
|
</el-pagination>
|
|
|
|
|
|
<el-dialog :title="Title" :visible.sync="visible" top="5vh">
|
|
|
- <el-form ref="refPerformance" :model="PerformanceForm" label-width="100px">
|
|
|
+ <el-form ref="refPerformance" :model="PerformanceForm" :rules="rules" label-width="100px">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="项目名称">
|
|
|
@@ -66,12 +66,8 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="有无事故"
|
|
|
- :rules="[
|
|
|
- { required: true, message: '有无事故不能为空', trigger: 'change'}
|
|
|
- ]" >
|
|
|
- <el-select ref="refplace" v-model="PerformanceForm.Tudge" style="width:100%"
|
|
|
- placeholder="请选择是否发生过质量、安全、环境事故">
|
|
|
+ <el-form-item label="有无事故" prop="Tudge">
|
|
|
+ <el-select v-model="PerformanceForm.Tudge" style="width:100%" placeholder="请选择是否发生过质量、安全、环境事故">
|
|
|
<el-option label="无事故" value="无事故"></el-option>
|
|
|
<el-option label="有事故" value="有事故"></el-option>
|
|
|
</el-select>
|
|
|
@@ -86,7 +82,7 @@
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer" style="margin-top:-30px;">
|
|
|
<el-button @click="visible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="savedata()">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="savedata('refPerformance')">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
@@ -145,6 +141,13 @@
|
|
|
Tudge: '',
|
|
|
Remark: '',
|
|
|
},
|
|
|
+ rules: {
|
|
|
+ Tudge: [{
|
|
|
+ required: true,
|
|
|
+ message: '请选择有无事故',
|
|
|
+ trigger: 'change'
|
|
|
+ }]
|
|
|
+ },
|
|
|
selfVisible: this.visible, // 避免vue双向绑定警告
|
|
|
currentPage: 1, // 分页
|
|
|
size: 10,
|
|
|
@@ -178,12 +181,20 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- savedata() {
|
|
|
- if (this.Title == '近三年主要工程业绩') {
|
|
|
- this.addPerformance()
|
|
|
- } else if (this.Title == '编辑近三年主要工程业绩') {
|
|
|
- this.editPerformance()
|
|
|
- }
|
|
|
+ savedata(formName) {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.Title == '近三年主要工程业绩') {
|
|
|
+ console.log("1111",this.Title)
|
|
|
+ this.addPerformance()
|
|
|
+ } else if (this.Title == '编辑近三年主要工程业绩') {
|
|
|
+ this.editPerformance()
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
addPerformance() {
|
|
|
let _this = this
|