Browse Source

Merge branch 'V0.0.5' of http://10.87.21.221:8000/jzyd_yyds/soc_web into V0.0.5

jiawuxian 1 year ago
parent
commit
c8cf6ddf02

+ 16 - 17
src/views/core/drill/plan/index.vue

@@ -447,7 +447,7 @@
         <el-row>
           <el-col :span="24">
             <el-form-item label="备注" prop="remark">
-              <el-input v-model="form.remark" placeholder="请输入备注"  :disabled="tableDisable()"/>
+              <el-input v-model="form.remark" placeholder="请输入备注" :disabled="tableDisable()"/>
             </el-form-item>
           </el-col>
         </el-row>
@@ -615,6 +615,11 @@ export default {
         this.loading = false;
       });
     },
+    delayFlush(time) {
+      setTimeout(() => {
+        this.getList()
+      }, time)
+    },
     //初始化与计划相关的角色信息
     initPlanRoleList() {
       listPlanRole({}).then((response) => {
@@ -663,7 +668,7 @@ export default {
     },
     //所属机构为当前用户登录机构时才显示 “编辑、删除”按钮
     checkCanEdit(row) {
-       console.log("checkCanEdit",this.$store.getters.orgId,row.belongOrgId)
+      console.log("checkCanEdit", this.$store.getters.orgId, row.belongOrgId)
       return (
         row.belongOrgId == this.$store.getters.orgId
       );
@@ -913,9 +918,7 @@ export default {
           })
           .then(() => {
             publishPlan(row.id, 1);
-            setTimeout(() => {
-              this.getList()
-            }, 100)
+            this.delayFlush(200);
           });
       } else {
         if (row.planStatus == 0) {
@@ -925,9 +928,7 @@ export default {
             (state) => {
               if (state == 0 || state == 1) {
                 publishPlan(row.id, state);
-                setTimeout(() => {
-                  this.getList()
-                }, 100)
+                this.delayFlush(200);
               }
             },
             {
@@ -944,9 +945,7 @@ export default {
             })
             .then(() => {
               publishPlan(row.id, 0);
-              setTimeout(() => {
-                this.getList()
-              }, 100)
+              this.delayFlush(200);
             });
         }
       }
@@ -960,12 +959,12 @@ export default {
         if (row.planCycle == 0) {
           if (row.done == 1) {
             msg = '因存在已完成任务,无周期任务不允许撤回,如需删除下发任务请点击"删除"';
-            this.$alert(msg,'系统提示',{
-              confirmButtonText:"确认"
+            this.$alert(msg, '系统提示', {
+              confirmButtonText: "确认"
             })
             return
           } else {
-            msg = "因存在已完成任务,撤回后将删除所有生成任务";
+            msg = "因存在已完成任务,撤回后将删除所有生成任务";
           }
         } else {
           //有周期
@@ -973,7 +972,7 @@ export default {
             msg =
               "因存在已完成任务,撤回后下周期起将不再生成任务";
           } else {
-            msg = "因存在已完成任务,撤回后将删除所有生成任务";
+            msg = "因存在已完成任务,撤回后将删除所有生成任务";
           }
         }
         this.$modal
@@ -999,8 +998,8 @@ export default {
         `plan_${new Date().getTime()}.xlsx`
       );
     },
-    tableDisable(){
-      return this.form.planStatus==1;
+    tableDisable() {
+      return this.form.planStatus == 1;
     },
     // showSelectFile() {
     //   this.$refs["DialogSelectFile"].show();

+ 13 - 13
src/views/core/edu/plan/index.vue

@@ -993,9 +993,7 @@ export default {
           })
           .then(() => {
             publishPlan(row.id, 1);
-            setTimeout(() => {
-              this.getList()
-            }, 100)
+            this.delayFlush(200)
           });
       } else {
         if (row.planStatus == 0) {
@@ -1005,9 +1003,7 @@ export default {
             (state) => {
               if (state == 0 || state == 1) {
                 publishPlan(row.id, state);
-                setTimeout(() => {
-                  this.getList()
-                }, 100)
+                this.delayFlush(200)
               }
             },
             {
@@ -1024,13 +1020,17 @@ export default {
             })
             .then(() => {
               publishPlan(row.id, 0);
-              setTimeout(() => {
-                this.getList()
-              }, 100)
+              this.delayFlush(200)
             });
         }
       }
     },
+
+    delayFlush(time) {
+      setTimeout(() => {
+        this.getList()
+      }, time)
+    },
     getMsgStr(row, type) {
       let str = "是否确认" + type + "该计划?";
       if (row.standard == 1) {
@@ -1045,12 +1045,12 @@ export default {
       if (row.planCycle == 0) {
         if (row.done == 1) {
           msg = '因存在已完成任务,无周期任务不允许撤回,如需删除下发任务请点击"删除"';
-          this.$alert(msg,'系统提示',{
-            confirmButtonText:"确认"
+          this.$alert(msg, '系统提示', {
+            confirmButtonText: "确认"
           })
           return
         } else {
-          msg = "因存在已完成任务,撤回后将删除所有生成任务";
+          msg = "因存在已完成任务,撤回后将删除所有生成任务";
         }
       } else {
         //有周期
@@ -1058,7 +1058,7 @@ export default {
           msg =
             "因存在已完成任务,撤回后下周期起将不再生成任务";
         } else {
-          msg = "因存在已完成任务,撤回后将删除所有生成任务";
+          msg = "因存在已完成任务,撤回后将删除所有生成任务";
         }
       }
 

+ 2 - 1
src/views/login.vue

@@ -220,13 +220,14 @@ export default {
 }
 
 .login-form {
-  margin-right: 15%;
   border-radius: 6px;
   background: #ffffff;
   width: 544px;
   height: 488px;
   padding: 25px 60px 50px 60px;
   z-index:2;
+  position: absolute;
+  right: 12%;
   .el-input {
     height: 38px;
     input {

+ 88 - 26
src/views/system/user/index.vue

@@ -324,7 +324,7 @@
                     type="text"
                     icon="el-icon-key"
                     v-if="scope.row.source == 0"
-                    @click="handleResetPwd(scope.row)"
+                    @click="handleRestPassword(scope.row)"
                     v-hasPermi="['system:user:resetPwd']"
                     >重置密码</el-button
                   >
@@ -341,6 +341,32 @@
         </div>
       </el-col>
     </el-row>
+  <!-- 重置密码对话框 -->
+    <DialogCom :title="title" :visible.sync="close" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-row>
+       
+          <el-col :span="10">
+            <el-form-item  label="密码" prop="password" >
+              <el-input
+              style="width: 317px;"
+                v-model="form.password"
+                placeholder="请输入密码"
+                autocomplete="off"
+                type="password"
+                maxlength="20"
+                show-password
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitRest">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </DialogCom>
+
 
     <!-- 添加或编辑配置对话框 -->
     <DialogCom :title="title" :visible.sync="open" width="800px" append-to-body>
@@ -588,6 +614,7 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
+      close:false,
       // 机构名称
       deptName: null,
       isRoleIdsChanged: false,
@@ -691,13 +718,6 @@ export default {
         orgId: [
           { required: true, message: "所属机构不能为空", trigger: "blur" },
         ],
-        // email: [
-        //   {
-        //     type: "email",
-        //     message: "请输入正确的邮箱地址",
-        //     trigger: ["blur", "change"]
-        //   }
-        // ],
         phone: [
           {
             pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
@@ -872,6 +892,7 @@ export default {
     // 取消按钮
     cancel() {
       this.open = false;
+      this.close=false;
       this.reset();
     },
     // 表单重置
@@ -928,6 +949,15 @@ export default {
         this.form.password = this.initPassword;
       });
     },
+    handleRestPassword(row) {
+      this.reset();
+      const userId = row.id || this.ids;
+      getUser(userId).then((response) => {
+        this.form.id = response.data.id;
+        this.close = true;
+        this.title = "重置密码";
+      });
+    },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.isRoleIdsChanged = false;
@@ -952,31 +982,63 @@ export default {
 
     /** 重置密码按钮操作 */
     handleResetPwd(row) {
-      console.log(row, "row");
-      this.$prompt('请输入"' + row.name + '"的新密码', "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        closeOnClickModal: false,
-        inputPattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z0-9_]{8,16}$/,
-        inputErrorMessage:
-          "用户密码长度介于8和16之间,只能输入字母、数字及_,必须包含大小写字母和数字",
-      })
-        .then(({ value }) => {
-          let data = {
-            id: row.userId,
-            password: value,
-          };
-          resetUserPwd(data).then((response) => {
-            this.$modal.msgSuccess("修改成功,新密码是:" + value);
+      // console.log(row, "row");
+      // this.$prompt('请输入"' + row.name + '"的新密码', "提示", {
+      //   confirmButtonText: "确定",
+      //   cancelButtonText: "取消",
+      //   closeOnClickModal: false,
+      //   inputPattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z0-9_]{8,16}$/,
+      //   inputErrorMessage:
+      //     "用户密码长度介于8和16之间,只能输入字母、数字及_,必须包含大小写字母和数字",
+      // })
+      //   .then(({ value }) => {
+      //     let data = {
+      //       id: row.userId,
+      //       password: value,
+      //     };
+      //     resetUserPwd(data).then((response) => {
+      //       this.$modal.msgSuccess("修改成功,新密码是:" + value);
+      //     });
+      //   })
+      //   .catch(() => {});
+      console.log(this.form.id, "row");
+      let data = {
+             id: this.form.id,
+             password: this.form.password,
+           };
+      resetUserPwd(data).then((response) => {
+             this.$modal.msgSuccess("修改成功,新密码是:" + value);
           });
-        })
-        .catch(() => {});
     },
     /** 分配角色操作 */
     handleAuthRole: function (row) {
       const userId = row.id;
       this.$router.push("/system/user-auth/role/" + userId);
     },
+    submitRest:function (){
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          console.log(this.form, "this.form");
+          if (this.form.id != undefined) {
+            // console.log(this.form, "this.form");
+            // updateUser(this.form).then((response) => {
+            //   this.$modal.msgSuccess("修改成功");
+            //   this.close = false;
+            //   this.getList();
+            // });
+         
+            let data = {
+             id: this.form.id,
+             password: this.form.password,
+           };
+            resetUserPwd(data).then((response) => {
+             this.$modal.msgSuccess("修改成功,新密码是:" + this.form.password);
+             this.close = false;
+          });
+          } 
+        }
+      });
+    },
     /** 提交按钮 */
     submitForm: function () {
       this.$refs["form"].validate((valid) => {