Переглянути джерело

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc_web into V0.0.2

jiawuxian 2 роки тому
батько
коміт
920b49f872

+ 7 - 0
src/api/resumption/plan.js

@@ -24,6 +24,13 @@ export function cheHui(id) {
   })
 }
 // 查询【请填写功能名称】详细
+export function distributeCheHui(id) {
+  return request({
+    url: '/core/api/plan/distributeCheHui/' + id,
+    method: 'get'
+  })
+}
+// 查询【请填写功能名称】详细
 export function distribute(query) {
   return request({
     url: '/core/api/plan/distribute' ,

+ 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({

+ 24 - 25
src/views/check/dialog.edit.vue

@@ -64,7 +64,21 @@
                 </el-select>
               </el-form-item>
             </el-col>
-
+            <el-col :span="6">
+              <el-form-item
+                prop="buildTaskNow"
+                label="立即生效:"
+                v-if="NowBuild()"
+              >
+                <el-checkbox
+                  :disabled="id ? true : false"
+                  v-model="formData.buildTaskNow"
+                  size="medium"
+                  @change="handleCheckboxChange"
+                  >默认从下个周期生成任务,<br>勾选后从当前周期立即生成任务</el-checkbox
+                >
+              </el-form-item>
+            </el-col>
             <el-col :span="6">
               <el-form-item
                 prop="startDate"
@@ -174,21 +188,7 @@
                 ></el-input-number>
               </el-form-item>
             </el-col>
-            <el-col :span="6">
-              <el-form-item
-                prop="buildTaskNow"
-                label="立即生效:"
-                v-if="NowBuild()"
-              >
-                <el-checkbox
-                  :disabled="id ? true : false"
-                  v-model="formData.buildTaskNow"
-                  size="medium"
-                  @change="handleCheckboxChange"
-                  >勾选后当前周期开始生效</el-checkbox
-                >
-              </el-form-item>
-            </el-col>
+           
           </el-row>
           <el-row>
             <el-col :span="6">
@@ -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

@@ -116,7 +116,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
@@ -307,6 +306,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>
@@ -411,8 +418,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
       }
 
@@ -468,8 +475,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

+ 22 - 12
src/views/resumption/plan/index.vue

@@ -429,11 +429,12 @@ export default {
     //已完成下发的计划不显示下发按钮
     checkCanPublish(row) {
       // console.log(row.planOfOrgType,"row.planOfOrgType")
-      if (row.planOfOrgType == "1" && (row.distribute == null||row.distribute == 2)) {
+      if (row.planOfOrgType == "1" && row.distribute == 0) {
         return true;
       }
       return false;
     },
+    //开始撤回
     chhuile(row) {
       this.loading = true;
       api.cheHui(row.id).then((response) => {
@@ -441,8 +442,9 @@ export default {
         this.loading = false;
       });
     },
+    //已下发的显示撤回
     chehui(row) {
-      if (row.planOfOrgType == "1" && row.distribute == 1) {
+      if (row.distribute == 1) {
         return true;
       }
       return false;
@@ -493,17 +495,25 @@ export default {
       this.$refs.editDialog.show(id, other);
     },
     showDialogDistribute(row) {
-      api.cheHui(row.id).then((response) => {
-        console.log(response.data,"appPlanService.cheHui(id);")
-        if(response.data!=1){
-          this.$refs.dialogDistribute.show(row);
-        }else{
-          this.getList();
-        }
-          
-          
+      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