Explorar o código

停用状态下可编辑机构

zhulu hai 1 ano
pai
achega
036467c5ce

+ 18 - 1
src/views/resumption/plan/dialog.edit.vue

@@ -205,7 +205,7 @@
                 <org-select ref="orgTreeSelect"
                 v-model="formData.orgList"
                 :limitOrgType="String(formData.execOrgType?formData.execOrgType:'')"
-                :disabled="cannotEdit()"
+                :disabled="cannotEditExecOrg()"
               >
             </org-select>
 
@@ -585,7 +585,24 @@ export default {
           break;
       }
     },
+    cannotEditExecOrg() {
+      //停用状态下,可编辑履职机构
+      if (this.formData.planStatus == null) {
+        return false;
+      }
+
+      if (this.formData.planCycle == 0 && this.formData.taskHasCompleted == 1) {
+        return true;
+      }
 
+      if (this.formData.planOfOrgId != this.orgId) {
+        return true;
+      }
+
+      let r = !(this.formData.planStatus == "0" || this.formData.planStatus == "2");
+
+      return r;
+    },
     cannotEdit() {
       //停用和使用中的任务,只能编辑名称和履职内容
       if (this.formData.planStatus == null) {

+ 6 - 3
src/views/resumption/plan/distribute.vue

@@ -105,8 +105,10 @@ export default {
             return { orgId: d.id, orgName: d.shortName, status: "1" };
           });
           this.$emit("select", this.info, plan);
-        } else {
-          this.isShow = true;
+        } 
+        else 
+        {
+          // this.isShow = true;
           this.loading = true;
           listByTypes({
             orgId: plan.planCreateOrgId,
@@ -117,7 +119,8 @@ export default {
               this.info.orgAndStatus = r.data.map((d) => {
                 return { orgId: d.id, orgName: d.shortName, status: "1" };
               });
-              this.tableData = this.info.orgAndStatus;
+              this.$emit("select", this.info, plan);
+              // this.tableData = this.info.orgAndStatus;
             })
             .catch(() => {
               this.loading = false;