Forráskód Böngészése

修改评价的规则

luowei 1 éve
szülő
commit
88eaaca9ef

+ 2 - 2
src/api/resumption/outsourcing.js

@@ -50,9 +50,9 @@ export function delelteEvaluate(id) {
   });
 }
 // 发布计划
-export function publishEvaluate(id) {
+export function publishEvaluate(id,immediateEffect) {
   return request({
-    url: `/core/evaluatePlan/distribute/${id}`,
+    url: `/core/evaluatePlan/distribute/${id}/${immediateEffect}`,
     method: "get",
   });
 }

+ 12 - 5
src/views/core/accessPlan/index.vue

@@ -468,7 +468,6 @@ import { mapGetters } from "vuex";
 import DialogThreeState from "@/components/message/threeStateMessageBox.vue";
 import * as api from "@/api/core/accessPlan";
 export default {
-  name: "Plan",
   dicts: [
     "sys_org_type",
     "sys_access_cycle",
@@ -478,13 +477,14 @@ export default {
     "edu_plan_status",
     "monitor_org",
   ],
+
+  name: "Plan",
+
   components: {
     orgTree,
     DialogThreeState,
   },
-  computed: {
-    ...mapGetters(["orgId"]),
-  },
+
   data() {
     return {
       startDatepickerOptions: {
@@ -568,11 +568,17 @@ export default {
       issue: null,
     };
   },
+
+  computed: {
+    ...mapGetters(["orgId"]),
+  },
+
   created() {
     allRole().then((response) => {
       this.roleList = response.data;
     });
   },
+
   methods: {
     numChange(value) {
       if (value <= 0) this.form.planFrequency = 0;
@@ -998,6 +1004,7 @@ export default {
         `plan_${new Date().getTime()}.xlsx`
       );
     },
-  },
+  }
 };
 </script>
+

+ 5 - 0
src/views/resumptionEvaluate/evaluate/addEvaluate.vue

@@ -43,13 +43,18 @@
         </el-form-item>
       </el-form>
     </DialogCom>
+    <DialogThreeState ref="DialogThreeState"> </DialogThreeState>
   </div>
 </template>
 <script>
 import { guid } from "@/utils/index.js";
+import DialogThreeState from "@/components/message/threeStateMessageBox.vue";
 export default {
   dicts: ["evaluate_type"],
   name: "SocWebAddEvaluate",
+  components: {
+    DialogThreeState,
+  },
   data() {
     return {
       ruleForm: {},

+ 1 - 0
src/views/resumptionEvaluate/evaluate/editDialog.vue

@@ -135,6 +135,7 @@
         :orgType="formData.orgType"
         @submitHandler="onSelect"
       ></DialogSelect>
+      <DialogThreeState ref="DialogThreeState"> </DialogThreeState>
     </DialogCom>
   </div>
 </template>

+ 49 - 14
src/views/resumptionEvaluate/evaluate/index.vue

@@ -219,6 +219,7 @@
     </el-row>
 
     <editEvaluate ref="Evaluate" @success="getList()"></editEvaluate>
+    <DialogThreeState ref="DialogThreeState"> </DialogThreeState>
   </div>
 </template>
 <script>
@@ -233,12 +234,15 @@ import {
 } from "@/api/resumption/outsourcing.js";
 import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
 import editEvaluate from "./editDialog.vue";
+import DialogThreeState from "@/components/message/threeStateMessageBox.vue";
+import * as api from "@/api/resumption/outsourcing";
 export default {
   name: "SocWebIndex",
   dicts: ["sys_org_type", "plan_status"],
   components: {
     OrgTree,
     editEvaluate,
+    DialogThreeState,
   },
   data() {
     const { params, query } = this.$route;
@@ -328,22 +332,53 @@ export default {
             });
           });
       } else {
-        this.$modal
-          .confirm("是否确认发布?")
-          .then(function () {})
-          .then(() => {
-            publishEvaluate(row.id).then((res) => {
-              let { code, msg } = res;
-              if (code == 200) {
-                this.getList();
-                this.$modal.msgSuccess("发布成功");
-              } else {
-                this.$modal.msgSuccess(msg);
-              }
-            });
-          });
+        // this.$modal
+        //   .confirm("是否确认发布?")
+        //   .then(function () {})
+        //   .then(() => {
+        //     publishEvaluate(row.id).then((res) => {
+        //       let { code, msg } = res;
+        //       if (code == 200) {
+        //         this.getList();
+        //         this.$modal.msgSuccess("发布成功");
+        //       } else {
+        //         this.$modal.msgSuccess(msg);
+        //       }
+        //     });
+        //   });
+        let   msg = "请选择下发后立即生成或下周期生成任务?";
+        this.$refs["DialogThreeState"].show(
+          msg,
+          (state) => {
+            if (state == 0 || state == 1) {
+            this.  distribute(row.id, state == 1);
+            }
+          },
+          {
+            yesText: "立即生成",
+            noText: "下周期",
+            cancelText: "取消",
+          }
+        );
       }
     },
+    distribute(id, immediateEffect) {
+      this.loading = true;
+      api
+        .publishEvaluate(id, immediateEffect)
+        .then((response) => {
+          if (response.data == 0) {
+            this.loading = false;
+          } else {
+            this.getList();
+            this.loading = false;
+          }
+        })
+        .catch((response) => {
+          this.getList();
+          this.loading = false;
+        });
+    },
     deleteHandler(row) {
       this.$modal
         .confirm("是否确认删除?")