luojun 2 rokov pred
rodič
commit
b3233a712d

+ 18 - 3
src/views/check/dialog.edit.vue

@@ -74,7 +74,7 @@
                 v-if="NowBuild()"
                 ><div class="checkbox-wrapper">
                   <el-checkbox
-                    :disabled="isChildren()"
+                    :disabled="isbuildTaskNow()"
                     v-model="formData.buildTaskNow"
                     size="medium"
                     @change="handleCheckboxChange"
@@ -371,6 +371,7 @@ export default {
       execOrgType: null,
       roleNames: null,
       planExec: null,
+      defbuildTaskNow:false,
       count: 0,
       description: null,
       selectedRows: [],
@@ -408,6 +409,18 @@ export default {
     ...mapGetters(["orgId", "orgName"]),
   },
   methods: {
+    isbuildTaskNow(){
+      if (
+        (this.formData.planCreateOrgId == this.orgId &&
+          this.formData.hasEdit != 1) ||
+        (this.formData.planOfOrgType != 3 && this.formData.hasEdit != 1) ||
+        this.id == null
+      &&(this.id==null||this.id==undefined||this.formData.planStatus==0)) {
+        return false;
+      } else return true;
+
+
+    },
     handleSelectable(row) {
       // 在这里根据特定条件判断是否禁用多选框行
       return this.getshenglianshe(row); // 返回 true 禁用,返回 false 不禁用
@@ -449,8 +462,9 @@ export default {
       } else return true;
     },
     NowBuild() {
-      if (this.formData.planCycle == 6) return false;
-      else return true;
+      //如果新增或者是草稿状态的立即生效的编辑
+      if ((this.id==null||this.id==undefined)||(this.defbuildTaskNow &&this.formData.planStatus==0)) return true;
+      else return false;
     },
     getLabel(options, value) {
       return getLabel(options, value);
@@ -527,6 +541,7 @@ export default {
     async refresh(id, other) {
       if (id != null && id != undefined) {
         await api.get(id).then((res) => {
+          this.defbuildTaskNow=res.data.buildTaskNow;
           this.parentCount = res.data.parentCount;
           this.formData = res.data;
           this.formData.buildTaskNow;

+ 24 - 23
src/views/check/index.vue

@@ -23,7 +23,7 @@
           v-show="showSearch"
           label-width="70px"
         >
-        <el-form-item prop="checkType" label="任务类型" >
+          <el-form-item prop="checkType" label="任务类型">
             <el-select
               prop="checkType"
               label="任务类型"
@@ -156,9 +156,7 @@
 
         <!--    按纽    -->
         <el-row :gutter="10" class="mb8">
-          <el-col :span="1.5">
-            
-          </el-col>
+          <el-col :span="1.5"> </el-col>
           <right-toolbar
             :showSearch.sync="showSearch"
             @queryTable="getList"
@@ -187,7 +185,7 @@
             label="任务名称"
             v-if="columns[1].visible"
           ></el-table-column>
-         
+
           <el-table-column
             prop="checkType"
             label="任务类型"
@@ -210,20 +208,13 @@
           >
           </el-table-column>
 
-          <el-table-column
-            prop="execOrgType"
-            label="检查主体"
-          >
+          <el-table-column prop="execOrgType" label="检查主体">
             <template slot-scope="r"
               >{{ getLabel(dict.type.sys_org_type, `${r.row.execOrgType}`) }}
             </template>
           </el-table-column>
 
-          <el-table-column
-            prop="checkOrgType"
-            label="受检机构"
-            width="120px"
-          >
+          <el-table-column prop="checkOrgType" label="受检机构" width="120px">
             <template slot-scope="r"
               >{{ getLabel(dict.type.sys_org_type, `${r.row.checkOrgType}`) }}
             </template>
@@ -469,8 +460,8 @@ export default {
         (row.planOfOrgType == 3 &&
           row.planStatus != 1 &&
           row.planCreateOrgId == this.orgId) ||
-        (row.planStatus == 2 && row.parentId != -1 && row.planOfOrgType == 1)||
-        (row.planStatus != 1&&(row.execOrgType == 1||row.execOrgType == 2))
+        (row.planStatus == 2 && row.parentId != -1 && row.planOfOrgType == 1) ||
+        (row.planStatus != 1 && (row.execOrgType == 1 || row.execOrgType == 2))
       ) {
         return true;
       }
@@ -573,11 +564,21 @@ export default {
     },
     //开始撤回
     chhuile(row) {
-      this.loading = true;
-      api.cheHui(row.id).then((response) => {
-        this.getList();
-        this.loading = false;
-      });
+      this.$modal
+        .confirm("撤回计划会清除本周期所有任务!", "提示")
+        .then(() => {
+          // 用户点击了确认按钮
+          // console.log("执行操作...");
+          this.loading = true;
+          api.cheHui(row.id).then((response) => {
+            this.getList();
+            this.loading = false;
+          });
+        })
+        .catch(() => {
+          // 用户点击了取消按钮
+          // console.log("取消操作...");
+        });
     },
     //已下发的显示撤回
     chehui(row) {
@@ -595,7 +596,7 @@ export default {
         .confirm('是否确认删除名称为"' + name + '"的数据项?')
         .then(() => {
           // 用户点击了确认按钮
-          console.log("执行操作...");
+          // console.log("执行操作...");
           this.loading = true;
           api
             .delelte(id)
@@ -610,7 +611,7 @@ export default {
         })
         .catch(() => {
           // 用户点击了取消按钮
-          console.log("取消操作...");
+          // console.log("取消操作...");
         });
     },
     // 多选框选中数据

+ 2 - 2
src/views/check/task/index.vue

@@ -116,7 +116,7 @@
             label="任务时间"
             prop="planStartTime"
           >
-            <el-date-picker
+            <DataRangePicker
               type="daterange"
               value-format="yyyy-MM-dd HH:mm:ss"
               :default-time="['00:00:00', '23:59:59']"
@@ -125,7 +125,7 @@
               v-model="queryParams.range"
               :picker-options="pickerOptions"
             >
-            </el-date-picker>
+            </DataRangePicker>
           </el-form-item>
           <el-row>
             <el-form-item style="margin-left: 35px">

+ 44 - 11
src/views/resumption/plan/dialog.edit.vue

@@ -19,7 +19,8 @@
           <el-row>
             <el-col :span="6">
               <el-form-item prop="planName" label="任务名称:">
-                <el-input :disabled="isChildren()"
+                <el-input
+                  :disabled="isChildren()"
                   v-model.trim="formData.planName"
                   :maxlength="50"
                   name="planName"
@@ -119,7 +120,6 @@
                 ></el-switch> -->
             <!-- </el-form-item> -->
             <!-- </el-col> -->
-            
           </el-row>
           <el-row>
             <el-col :span="6">
@@ -163,10 +163,9 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            
 
             <el-col :span="6">
-              <el-form-item prop="count" label="任务次数:" >
+              <el-form-item prop="count" label="任务次数:">
                 <el-input-number
                   style="margin-left: 10px"
                   v-model="formData.count"
@@ -177,10 +176,15 @@
                 ></el-input-number>
               </el-form-item>
             </el-col>
-            <el-col :span="6" >
-              <el-form-item prop="tempBuildTaskNow" label="立即生效:">
+            <el-col :span="6">
+              <el-form-item
+                prop="tempBuildTaskNow"
+                label="立即生效:"
+                v-if="NowBuild()"
+              >
                 <div class="checkbox-wrapper">
-                  <el-checkbox :disabled="isChildren()"
+                  <el-checkbox
+                    :disabled="isbuildTaskNow()"
                     v-model="tempBuildTaskNow"
                     size="medium"
                     @change="handleCheckboxChange"
@@ -208,7 +212,10 @@
           height="400px"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column type="selection" :selectable="handleSelectable"></el-table-column>
+          <el-table-column
+            type="selection"
+            :selectable="handleSelectable"
+          ></el-table-column>
 
           <el-table-column label="是否扫描">
             <template v-slot="{ row }">
@@ -244,7 +251,8 @@
           <el-table-column v-if="false" prop="ofOrgId" label="所属机构id">
           </el-table-column>
           <el-table-column prop="areaName" label="履职区域"> </el-table-column>
-          <el-table-column prop="checkName" label="履职点位" v-if="false"> </el-table-column>
+          <el-table-column prop="checkName" label="履职点位" v-if="false">
+          </el-table-column>
           <el-table-column label="操作">
             <template v-slot="{ row }">
               <el-button
@@ -307,6 +315,7 @@ export default {
       execOrgType: null,
       roleNames: null,
       planExec: null,
+      defbuildTaskNow:false,
       count: 0,
       description: null,
       propItem: "",
@@ -379,6 +388,29 @@ export default {
     ...mapGetters(["orgId", "orgName"]),
   },
   methods: {
+    isbuildTaskNow() {
+      if (
+        (this.formData.planCreateOrgId == this.orgId &&
+          this.formData.hasEdit != 1) ||
+        (this.formData.planOfOrgType != 3 && this.formData.hasEdit != 1) ||
+        (this.id == null &&
+          (this.id == null ||
+            this.id == undefined ||
+            this.formData.planStatus == 0))
+      ) {
+        return false;
+      } else return true;
+    },
+    NowBuild() {
+      //如果新增或者是草稿状态的立即生效的编辑
+      if (
+        this.id == null ||
+        this.id == undefined ||
+        (this.defbuildTaskNow && this.formData.planStatus == 0)
+      )
+        return true;
+      else return false;
+    },
     handleSelectable(row) {
       // 在这里根据特定条件判断是否禁用多选框行
       return this.getshenglianshe(row); // 返回 true 禁用,返回 false 不禁用
@@ -690,7 +722,7 @@ export default {
       this.getRolesByOrg();
     },
     async show(id, other = {}) {
-      this.parentCount =1;
+      this.parentCount = 1;
       this.tempBuildTaskNow = false;
       this.buildTime = null;
       this.id = id;
@@ -700,7 +732,8 @@ export default {
       // console.log(id);
       if (id !== undefined) {
         await api.get(id).then((res) => {
-          this.tempBuildTaskNow=res.data.buildTaskNow>0?true:false;
+          this.defbuildTaskNow=res.data.buildTaskNow> 0 ? true : false;;
+          this.tempBuildTaskNow = res.data.buildTaskNow > 0 ? true : false;
           this.parentCount = res.data.parentCount;
           // console.log(res, "res");
           this.tableData = res.data.itemList;

+ 2 - 2
src/views/resumption/plan/index.vue

@@ -465,7 +465,7 @@ export default {
         .confirm("撤回计划会清除本周期所有任务!", "提示")
         .then(() => {
           // 用户点击了确认按钮
-          console.log("执行操作...");
+          // console.log("执行操作...");
           this.loading = true;
           api.cheHui(row.id).then((response) => {
             this.getList();
@@ -474,7 +474,7 @@ export default {
         })
         .catch(() => {
           // 用户点击了取消按钮
-          console.log("取消操作...");
+          // console.log("取消操作...");
         });
     },
     //已下发的显示撤回