Browse Source

密码问题

xiaochan 1 year ago
parent
commit
ac2634e0c1

+ 2 - 2
src/api/settings/permission-settings.js

@@ -85,11 +85,11 @@ export function saveEmployeeInfo(data) {
     })
 }
 
-export function resetPasswordByCode(code) {
+export function resetPasswordByCode(data) {
     return request({
         url: '/settings/resetPasswordByCode',
         method: 'post',
-        data: {code},
+        data,
     })
 }
 

+ 9 - 9
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/report-of-infectious-diseases/DialogDiseases.vue

@@ -613,7 +613,7 @@ const vaccinateFunc = (rule, value, callback) => {
   }
 }
 
-const contagionMessage = '丙类,乙类,丙类,其他,任选其一'
+const contagionMessage = '丙类,乙类,丙类,其他,任选其一';
 
 const rules = reactive({
   name: [{required: true, message: '该项不能为空', trigger: 'blur'}],
@@ -661,17 +661,17 @@ const formRef = ref(null)
 
 const confirm = async () => {
   try {
-    await formRef.value.validate();
-    if (stringIsBlank(sheetData.value.cardNo)) {
-      await confirmCrb(sheetData.value)
-    } else {
-      await updateCrb(sheetData.value)
-    }
-    await query()
-    await newlyAddedClick()
+    await formRef.value.validate()
   } catch {
     xcMessage.error('有必填项不能为空。')
   }
+  if (stringIsBlank(sheetData.value.cardNo)) {
+    await confirmCrb(sheetData.value)
+  } else {
+    await updateCrb(sheetData.value)
+  }
+  await query()
+  await newlyAddedClick()
 }
 
 const deleteClick = async (row) => {

+ 2 - 0
src/store/modules/user.js

@@ -100,6 +100,8 @@ const actions = {
                 dispatch('getWards').then(() => {
                     resolve(res)
                 })
+            }).catch((err) => {
+                reject(err)
             })
         })
     },

+ 1 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/EmrMain.vue

@@ -1687,7 +1687,7 @@ const emrMittInit = () => {
     } else {
       showIframe.value = IframeTabs.已保存病历
     }
-    hisSaveEmr.loadDocument.({documentId: id}).then(res => {
+    hisSaveEmr.loadDocument({documentId: id}).then(res => {
       hisSaveEmr.editor?.setDocument(res, true);
       hisSaveEmr.editor?.setEditorMode('readonly')
     })

+ 38 - 8
src/views/settings/permissions/UserRoleSettings.vue

@@ -74,7 +74,12 @@
             <el-button-group>
               <el-button type="primary" text @click="clickToEdit(scope.$index, scope.row)">编辑</el-button>
               <el-button text size="small" v-if="competence" @click="viewUserRoles(scope.row)">角色</el-button>
-              <el-button text size="small" v-if="competence" @click="resetPasswordClick(scope.row)">重置密码</el-button>
+              <el-button size="small"
+                         v-if="competence"
+                         @contextmenu.stop.prevent="resetPasswordClick(scope.row, true)"
+                         @click="resetPasswordClick(scope.row)">
+                重置密码
+              </el-button>
             </el-button-group>
           </template>
         </el-table-column>
@@ -291,13 +296,38 @@ const addEmployees = () => {
   userInfo.value = {}
 }
 
-function resetPasswordClick(row) {
-  CyMessageBox.confirm({
-    type: 'info',
-    message: `是否要重置:【${row.name}】密码`,
-  }).then(() => {
-    resetPasswordByCode(row.code)
-  })
+function resetPasswordClick(row, setNextDate = false) {
+  if (setNextDate) {
+    CyMessageBox.prompt({
+      type: 'info',
+      message: `是否要重置:【${row.name}】密码`,
+      selectOption: [
+        {code: 0, name: '立刻'},
+        {code: 20, name: '20分钟'},
+        {code: 30, name: '30分钟'},
+        {code: 40, name: '40分钟'},
+        {code: 50, name: '50分钟'}
+      ],
+      inputDefaultValue: 30
+    }).then(({value}) => {
+      resetPasswordByCode({
+        code: row.code,
+        nextTime: value
+      })
+    })
+  } else {
+    CyMessageBox.confirm({
+      type: 'info',
+      message: `是否要重置:【${row.name}】密码`,
+    }).then(() => {
+      resetPasswordByCode({
+        code: row.code,
+        nextTime: 20
+      })
+    })
+
+
+  }
 
 }
 

+ 15 - 1
src/views/system/login.vue

@@ -2,6 +2,8 @@
   <div class="container">
     <div class="box">
       <h1>{{ systemTitle }}</h1>
+
+
       <el-form class="form">
         <el-input v-model="form.codeRs"
                   maxlength="50"
@@ -27,8 +29,13 @@
             <i class="sfont system-mima"></i>
           </template>
         </el-input>
-        <el-button size="large" style="width: 100%" type="primary" @click="submit">登录</el-button>
+        <el-button size="large" style="width: 100%" type="primary" @click="submit">登录
+        </el-button>
       </el-form>
+      <div style="display: flex;justify-content: center">
+        <el-countdown title="下次登录剩余" :value="nextInputTimes" v-if="nextInputTimes"/>
+      </div>
+
       <div class="hospital-name">{{ SYSTEM_CONFIG.HOSPITAL_NAME }}<i>·</i><span>{{ SYSTEM_CONFIG.HOSPITAL_CODE }}</span>
       </div>
     </div>
@@ -49,6 +56,7 @@ import changePassword, {checkPasswordStrength} from "@/components/system/passwor
 const store = useStore()
 const router = useRouter()
 const route = useRoute()
+const nextInputTimes = ref(null)
 const form = reactive({
   codeRs: '',
   password: '',
@@ -73,6 +81,7 @@ const checkForm = () => {
   })
 }
 const submit = () => {
+  // if (nextInputTimes.value) return
   checkForm().then(() => {
     let params = {
       codeRs: form.codeRs,
@@ -85,9 +94,14 @@ const submit = () => {
           submit()
         })
       } else {
+        nextInputTimes.value = null
         addRoutes();
         router.push(route.query.redirect || '/')
       }
+    }).catch(({data}) => {
+      if (data.nextInputTimes) {
+        nextInputTimes.value = new Date(data.nextInputTimes)
+      }
     })
   })
 }