molilang 3 anos atrás
pai
commit
b4eb43b25b
1 arquivos alterados com 43 adições e 17 exclusões
  1. 43 17
      src/pages/main/gridDivision/workersList.vue

+ 43 - 17
src/pages/main/gridDivision/workersList.vue

@@ -14,7 +14,7 @@
       :loading="table_loading"
       :multiple="true"
       :handle-row="table_handle_row"
-      @selection="handleaaa"
+      @selection="handleSlect"
       @check="handleCheck"
       @edit="handleEdit"
       @approve="handleApprove"
@@ -88,8 +88,12 @@
       </el-form>
       <template v-slot:footer>
         <div v-if="title === '新建'">
-          <el-button type="primary">保存</el-button>
-          <el-button @click="handleSubmit" type="primary">提交</el-button>
+          <el-button @click="handleSubmit('save')" type="primary"
+            >保存</el-button
+          >
+          <el-button @click="handleSubmit('add')" type="primary"
+            >提交</el-button
+          >
           <el-button @click="handleVisible('add')" type="default"
             >取消</el-button
           >
@@ -105,8 +109,12 @@
           >
         </div>
         <div v-else>
-          <el-button @click="handleSubmit" type="primary">保存</el-button>
-          <el-button type="default">退回修改</el-button>
+          <el-button @click="handleSubmit('adopt')" type="primary"
+            >保存</el-button
+          >
+          <el-button @click="handleSubmit('failed')" type="default"
+            >退回修改</el-button
+          >
         </div>
       </template>
     </simple-dialog>
@@ -228,7 +236,7 @@ export default {
           label: "编辑",
           props: "edit",
           visible: {
-            sts: ["0"],
+            draft: ["0"],
           },
         },
         {
@@ -373,7 +381,7 @@ export default {
           break;
       }
     },
-    handleaaa(val) {
+    handleSlect(val) {
       this.summaryIds = val.map((item) => {
         return item.id.toString();
       });
@@ -441,7 +449,7 @@ export default {
     // 处理按钮
     handleApprove(row) {
       console.log(row);
-      if (row.parentLevel === 1) {
+      if (row.parentLevel === "1") {
         this.$router.push({
           path: "/approvalExamination",
           query: row,
@@ -474,21 +482,27 @@ export default {
         this.handleVisible("approve");
       }
     },
-    handleSubmit() {
+    handleSubmit(type) {
       // console.log(this.add_form);
       // let _this = this;
+      let draft = "";
+      if (type === "add") {
+        draft = '1'
+      }else if(type === 'save'){
+        draft = '0'
+      }
       this.$refs.add_ref.validate((valid) => {
         if (valid) {
           let reqdata = [
             {
               ...this.add_form,
               procId: "729294602773110788",
-              draft: "1",
+              draft: draft,
               num: "1",
             },
           ];
           if (!this.approve_visible) {
-            // 编辑
+            // 编辑/新增
             this.$http({
               url: "/mkWangge/saveOrUpdateList",
               method: "post",
@@ -498,12 +512,12 @@ export default {
               data: reqdata,
             }).then((res) => {
               console.log(res);
-            });
-            this.handleInit({
-              ...this.table_search,
-              type: "1",
-              page: this.page,
-              pageSize: this.rows,
+              this.handleInit({
+                ...this.table_search,
+                type: "1",
+                page: this.page,
+                pageSize: this.rows,
+              });
             });
           } else {
             // 审批
@@ -523,6 +537,12 @@ export default {
                 ...reqdata,
               },
             });
+            this.handleInit({
+              ...this.table_search,
+              type: "1",
+              page: this.page,
+              pageSize: this.rows,
+            });
           }
 
           this.edit_visible = false;
@@ -559,6 +579,12 @@ export default {
               type: "success",
             });
           }
+          this.handleInit({
+            ...this.table_search,
+            type: "1",
+            page: this.page,
+            pageSize: this.rows,
+          });
         });
         this.handleVisible("summary");
       }