luojun 2 жил өмнө
parent
commit
9d67b76517

+ 14 - 1
src/api/safetycheck/plan.js

@@ -8,7 +8,20 @@ export function list(query) {
     data: query
   })
 }
-
+// 查询【请填写功能名称】详细
+export function cheHui(id) {
+  return request({
+    url: '/core/checkplan/cheHui/' + id,
+    method: 'get'
+  })
+}
+// 查询【请填写功能名称】详细
+export function distributeCheHui(id) {
+  return request({
+    url: '/core/checkplan/distributeCheHui/' + id,
+    method: 'get'
+  })
+}
 // 查询【请填写功能名称】详细
 export function itemfind(id) {
   return request({

+ 8 - 9
src/views/check/dialog.edit.vue

@@ -215,9 +215,9 @@
                 </org-tree-select>
               </el-form-item>
             </el-col>
-            <el-col :span="6">
-              <el-form-item prop="planStatus" label="计划状态">
-                <!-- <el-select
+            <!-- <el-col :span="6"> -->
+            <!-- <el-form-item prop="planStatus" label="计划状态"> -->
+            <!-- <el-select
                   label="计划状态"
                   v-model="formData.planStatus"
                   placeholder="请选择计划状态"
@@ -231,13 +231,13 @@
                   >
                   </el-option>
                 </el-select> -->
-                <el-switch
+            <!-- <el-switch
                   v-model="formData.planStatus"
                   active-value="1"
                   inactive-value="2"
-                ></el-switch>
-              </el-form-item>
-            </el-col>
+                ></el-switch> -->
+            <!-- </el-form-item> -->
+            <!-- </el-col> -->
           </el-row>
           <el-form-item :span="6" prop="description" label="备注">
             <el-input
@@ -348,7 +348,6 @@ export default {
         planName: [{ required: true, message: "请输入计划名称" }],
         checkType: [{ required: true, message: "请选择检查类型" }],
         planCycle: [{ required: true, message: "请选择检查周期" }],
-        planStatus: [{ required: true, message: "请选择计划状态" }],
         execOrgType: [{ required: true, message: "请选择检查机构类型" }],
         roleList: [{ required: true, message: "请选择检查角色" }],
         planExec: [{ required: true, message: "请选择计划时间" }],
@@ -552,13 +551,13 @@ export default {
       this.$refs.form.validate(async (isValidate) => {
         this.formData.planCreateOrgId = this.orgId;
         this.formData.planCreateOrgName = this.orgName;
+        this.formData.planStatus = 0;
         if (!isValidate) return;
         this.formData.rulePointList =
           this.tableData == null ? [] : this.tableData;
         this.formData.roleList = null;
         this.formData.roleIds =
           this.selectedValues.length == 0 ? null : this.selectedValues;
-
         await api.add(this.formData);
         this.$emit("success");
         this.onHide();

+ 44 - 4
src/views/check/index.vue

@@ -115,7 +115,6 @@
               >
               </el-option>
             </el-select>
-            <!-- <el-switch v-model="queryParams.planStatus" active-value="1" inactive-value="2"></el-switch> -->
           </el-form-item>
           <el-form-item>
             <el-button
@@ -306,6 +305,14 @@
                 @click="showDialogDistribute(r.row)"
                 v-hasPermi="['core:checkplan:distribute']"
                 >下发</el-button>
+                <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-arrow-down"
+                v-if="chehui(r.row)"
+                @click="chhuile(r.row)"
+                v-hasPermi="['core:checkplan:distribute']"
+                >撤回</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -410,8 +417,8 @@ export default {
       // console.log(row.planOfOrgType == "1","row.planOfOrgType")
       // console.log(row.planOfOrgType == "1"&& row.distribute==null,"row.distribute")
 
-      //如果计划所属机构为省联社并且计划下发为null并且计划检查机构类型不为省联社和办事处(只有一个无法下发)
-      if (row.planOfOrgType == "1"&& row.distribute==null&&row.execOrgType!="1"&&row.execOrgType!="2") {
+      //如果计划所属机构为省联社并且计划下发状态为0并且计划检查机构类型不为省联社和办事处(只有一个无法下发)
+      if (row.planOfOrgType == "1"&& row.distribute==0&&row.execOrgType!="1"&&row.execOrgType!="2") {
         return true
       }
 
@@ -467,8 +474,41 @@ export default {
     onEdit(id, other = {}) {
       this.$refs.editDialog.show(id, other);
     },
+     //开始撤回
+     chhuile(row) {
+      this.loading = true;
+      api.cheHui(row.id).then((response) => {
+        this.getList();
+        this.loading = false;
+      });
+    },
+    //已下发的显示撤回
+    chehui(row) {
+      if (row.distribute == 1) {
+        return true;
+      }
+      return false;
+    },
     showDialogDistribute(row){
-      this.$refs.dialogDistribute.show(row);
+      this.loading = true;
+      api
+        .distributeCheHui(row.id)
+        .then((response) => {
+          // console.log(response, "then");
+          if (response.data == 0) {
+            this.loading = false;
+            this.$refs.dialogDistribute.show(row);
+          } else {
+            this.getList();
+            this.loading = false;
+          }
+        })
+        .catch((response) => {
+          // console.log(response, "catch");
+          this.getList();
+          this.loading = false;
+          this.$refs.dialogDistribute.show(row);
+        });
     },
     async onDel(id, name) {
       this.$modal