coys преди 1 година
родител
ревизия
fe3286efe6
променени са 1 файла, в които са добавени 32 реда и са изтрити 22 реда
  1. 32 22
      src/views/resumptionEvaluate/evaluate/editDialog.vue

+ 32 - 22
src/views/resumptionEvaluate/evaluate/editDialog.vue

@@ -5,14 +5,13 @@
       :title="`${id ? '编辑' : '新增'}外包履职评价计划`"
       :visible.sync="isShow"
       width="1500px"
-     
     >
       <div class="page-body">
         <el-form
           :model="formData"
           :rules="formDataRules"
           size="small"
-          ref="form"
+          ref="formData"
           label-position="right"
           label-width="130px"
           label-prefix=":"
@@ -95,7 +94,12 @@
             </el-col>
           </el-row>
         </el-form>
-        <el-button @click="openSelect" type="primary" style="margin-bottom: 10px;">新增评价内容</el-button>
+        <el-button
+          @click="openSelect"
+          type="primary"
+          style="margin-bottom: 10px"
+          >新增评价内容</el-button
+        >
 
         <el-table :data="tableData" style="width: 100%" height="400px">
           <el-table-column label="序号" type="index" width="100">
@@ -110,7 +114,12 @@
           </el-table-column>
           <el-table-column label="操作">
             <template v-slot="{ row }">
-              <el-button type="text" @click="removeRow(row)" v-if="row.code!==0">移除</el-button>
+              <el-button
+                type="text"
+                @click="removeRow(row)"
+                v-if="row.code !== 0"
+                >移除</el-button
+              >
             </template>
           </el-table-column>
         </el-table>
@@ -121,12 +130,11 @@
         <el-button @click="onHide">取消</el-button>
       </div>
       <DialogSelect
-      ref="dialogEvaluate"
-      :orgType="formData.orgType"
-      @submitHandler="onSelect"
-    ></DialogSelect>
+        ref="dialogEvaluate"
+        :orgType="formData.orgType"
+        @submitHandler="onSelect"
+      ></DialogSelect>
     </DialogCom>
-    
   </div>
 </template>
 
@@ -166,11 +174,11 @@ export default {
       id: null,
       isShow: false,
       formData: {
-        evaluateName:'',
-        roleIds:[],
-        orgType:'',
-        evaluateCycle:'',
-        planStatus:'',
+        evaluateName: "",
+        roleIds: [],
+        orgType: "",
+        evaluateCycle: "",
+        planStatus: "",
       },
       formDataRules: {
         evaluateName: [{ required: true, message: "请输入评价名称" }],
@@ -292,7 +300,7 @@ export default {
     },
     // 事件
     onHide() {
-      this.$refs.form.resetFields();
+      this.$refs.formData.resetFields();
       this.isShow = false;
       this.formData = {};
 
@@ -303,28 +311,30 @@ export default {
       this.$refs.dialogEvaluate.show();
     },
     onSubmit() {
-      this.$refs.form.validate(async (isValidate) => {
+      this.$refs.formData.validate((isValidate) => {
         if (isValidate) {
           if (this.tableData.length == 0) {
             return this.$message.error("评价内容项,不能为空");
           }
-          if (falg) {
-            return this.$message.error(
-              "评价内容所有项,至少有一项评价类型为打分"
-            );
-          }
+          
 
           let obj = {
             ...this.formData,
             coreEvaluateContentList: this.tableData,
           };
-          
+
           let falg = true;
+         
           this.tableData.forEach((item) => {
             if (item.contentType == "2") {
               falg = false;
             }
           });
+          if (falg) {
+            return this.$message.error(
+              "评价内容所有项,至少有一项评价类型为打分"
+            );
+          }
           if (this.formData.id) {
             //编辑