Selaa lähdekoodia

履职调试;
提示框按钮变成 mini

jiawuxian 1 vuosi sitten
vanhempi
commit
5858febfbd

+ 3 - 3
src/components/message/threeStateMessageBox.vue

@@ -8,9 +8,9 @@
   >
     <div>{{ message }}</div>
     <div slot="footer" class="dialog-footer">
-      <el-button size="small" @click="onCanel">{{option && option.cancelText?option.cancelText:'取消'}}</el-button>
-      <el-button size="small" @click="onNo">{{option && option.noText?option.noText:'否'}}</el-button>
-      <el-button size="small" type="primary" @click="onYes">{{option && option.yesText?option.yesText:'是'}}</el-button>
+      <el-button size="mini" @click="onCanel">{{option && option.cancelText?option.cancelText:'取消'}}</el-button>
+      <el-button size="mini" @click="onNo">{{option && option.noText?option.noText:'否'}}</el-button>
+      <el-button size="mini" type="primary" @click="onYes">{{option && option.yesText?option.yesText:'是'}}</el-button>
     </div>
   </DialogCom>
 </template>

+ 2 - 0
src/plugins/modal.js

@@ -56,6 +56,8 @@ export default {
     return MessageBox.confirm(content, "系统提示", {
       confirmButtonText:(option && option.confirmButtonText)?option.confirmButtonText: '确定',
       cancelButtonText: (option && option.cancelButtonText)?option.cancelButtonText: '取消',
+      confirmButtonClass:"el-button--mini",
+      cancelButtonClass:"el-button--mini",
       type: (option && option.type)?option.type:  "warning",
     })
   },

+ 42 - 20
src/views/resumption/plan/dialog.edit.vue

@@ -20,7 +20,7 @@
             <el-col :span="6">
               <el-form-item prop="planName" label="任务名称:">
                 <el-input
-                  :disabled="canEdit()"
+                  :disabled="cannotEditName()"
                   v-model.trim="formData.planName"
                   :maxlength="50"
                   name="planName"
@@ -33,7 +33,7 @@
             <el-col :span="6">
               <el-form-item prop="planType" label="任务类型:">
                 <el-select
-                  :disabled="canEdit()"
+                  :disabled="cannotEdit()"
                   @change="changeData"
                   label="任务类型"
                   v-model="formData.planType"
@@ -55,7 +55,7 @@
               <el-form-item prop="planCycle" label="任务周期:">
                 <el-select
                   @change="changeBuildTime"
-                  :disabled="canEdit()"
+                  :disabled="cannotEdit()"
                   prop="planCycle"
                   label="任务周期"
                   v-model="formData.planCycle"
@@ -80,7 +80,7 @@
             <el-col :span="6">
               <el-form-item prop="planExec" label="任务时间:">
                 <el-select
-                  :disabled="canEdit()"
+                  :disabled="cannotEdit()"
                   label="任务时间"
                   v-model="formData.planExec"
                   placeholder="请选择任务时间"
@@ -126,7 +126,7 @@
             <el-col :span="6">
               <el-form-item prop="execOrgType" label="机构类型:">
                 <el-select
-                  :disabled="canEdit()"
+                  :disabled="cannotEdit()"
                   label="机构类型"
                   v-model="formData.execOrgType"
                   placeholder="请选择机构类型"
@@ -146,7 +146,7 @@
             <el-col :span="6">
               <el-form-item prop="roleList" label="履职人员:">
                 <el-select
-                  :disabled="canEdit()"
+                  :disabled="cannotEdit()"
                   label="履职人员"
                   v-model="formData.roleList"
                   placeholder="请选择履职人员"
@@ -167,7 +167,7 @@
             <el-col :span="6">
               <el-form-item prop="count" label="任务次数:">
                 <el-input-number
-                  :disabled="canEdit()"
+                  :disabled="cannotEdit()"
                   style="margin-left: 10px"
                   v-model="formData.count"
                   controls-position="right"
@@ -197,7 +197,7 @@
           </el-row>
           <el-form-item prop="note" label="备注">
             <el-input
-              :disabled="canEdit()"
+              :disabled="cannotEdit()"
               v-model="formData.note"
               :maxlength="255"
               clearable
@@ -205,10 +205,12 @@
             />
           </el-form-item>
         </el-form>
-        <el-button @click="openSelect"
+        <el-button @click="openSelect" v-if="formData.id==null || formData.planOfOrgId == orgId"
           ><span class="requiredlabel">选择履职内容</span></el-button
         >
-        <el-button @click="deleteSelected">批量删除</el-button>
+        <el-button @click="deleteSelected" v-if="formData.id==null || formData.planOfOrgId == orgId"
+          >批量删除</el-button
+        >
         <el-table
           :data="tableData"
           style="width: 100%"
@@ -257,7 +259,7 @@
           <el-table-column label="操作">
             <template v-slot="{ row }">
               <el-button
-                v-if="getshenglianshe(row)"
+                v-if="getshenglianshe(row) && (formData.Id==null || formData.planOfOrgId == orgId)"
                 type="text"
                 @click="removeRow(row)"
                 >删除</el-button
@@ -493,16 +495,31 @@ export default {
       }
     },
 
-    canEdit() {
+    cannotEdit() {
       //停用和使用中的任务,只能编辑名称和履职内容
       // let f = this.formData;
       //
-      let r = !(
-        this.formData.planStatus == null || this.formData.planStatus == "0"
-      );
+      if (this.formData.planStatus == null) {
+        return false;
+      }
+
+      if (this.formData.planOfOrgId != this.orgId) {
+        return true;
+      }
+
+      let r = !(this.formData.planStatus == "0");
+
+      return r;
+    },
+    //只能编辑创建机构和所属机构是自己的
+    cannotEditName() {
+      if (this.formData.planStatus == null) {
+        return false;
+      }
 
-      //行社不能编辑省联社计划的名称;省联社也不能单独编辑子计划的名称
-      r &= this.formData.planOfOrgId == this.orgId;
+      let r =
+        this.formData.planOfOrgId != this.orgId ||
+        this.formData.planCreateOrgId != this.orgId;
       return r;
     },
     //省联社履职内容不能删除
@@ -836,9 +853,14 @@ export default {
             msg = "因不存在已完成任务,本次修改内容将立即生成。";
           }
 
-          this.$modal.confirm(msg).then(() => {
-            this.update(this.formData, imme);
-          });
+          this.$modal
+            .confirm(msg)
+            .then(() => {
+              this.update(this.formData, imme);
+            })
+            .catch(() => {
+              this.loading = false;
+            });
         } else if (this.formData.planStatus == "2") {
           this.update(this.formData, false);
         } else {

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

@@ -456,7 +456,7 @@ export default {
     // },
     showPublish(row) {
       //有父计划且父计划不是使用中状态,不能下发
-      if (row.parentStatus != 1 && row.parentId) {
+      if (row.parentStatus != 1 && row.parentId>0) {
         return false;
       }
       //可以下发:本机构创建+状态为草稿、停用的计划
@@ -524,7 +524,7 @@ export default {
     //开始撤回
     chhuile(row) {
       let msg = "";
-      if (row.taskHasCompleted == 1) {
+      if (row.taskHasCompleted != 1) {
         msg = "因不存在已完成任务,撤回后将删除所有生成任务?";
       } else {
         msg = "因存在已完成任务,撤回后下周期起将不再生成任务?";