瀏覽代碼

修改密码后跳转至登录页

morphone1995 4 年之前
父節點
當前提交
8f10c586a4
共有 3 個文件被更改,包括 51 次插入30 次删除
  1. 2 2
      src/components/common/HomePage.vue
  2. 39 26
      src/components/icss/AddMedicinePrompt.vue
  3. 10 2
      src/components/icss/MedicinePrompt.vue

+ 2 - 2
src/components/common/HomePage.vue

@@ -161,9 +161,9 @@
                 this.$message({
                   message: '修改成功',
                   type: 'success',
-                  duration: 1000,
+                  duration: 1500,
                   onClose:()=>{
-                    // this.logout()
+                    this.logout()
                   }
                 })
               } else if(res.data.code === '00020005'){

+ 39 - 26
src/components/icss/AddMedicinePrompt.vue

@@ -501,6 +501,13 @@ export default {
         param = paramsAll;
       }
       // this.showSaveDialog(param,'是否'+(this.isEdit?'修改':'保存')+'该静态知识?');
+
+      if (!this.isEdit) {
+        // 新增页面
+        this.saveDisable = true
+        this.sendSaveOrEdit(param)
+        return 
+      }
       this.showSaveDialog(
         param,
         '<div><p style="color: #333333">确定保存修改内容?</p><p style="color: #D70A25">保存后将覆盖原有数据,且原有数据无法恢复。</p></div>'
@@ -509,34 +516,40 @@ export default {
     showSaveDialog(param, msg) {
       this.showConfirmDialog(msg, () => {
         this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
-        api
-          .saveTermPrompts(param)
-          .then(res => {
-            if (res.data.code === '0') {
-              this.isSuccessUpload = 0; // 修改文件上传状态为0
-              this.warning(res.data.msg || '保存成功', 'success');
-              this.isSaveSuccess = true; // 保存成功,可正常退出
-              //返回带搜索条件的首页
-              this.$router.push({
-                name: 'MedicinePrompt',
-                params: Object.assign({}, this.$route.params, {
-                  currentPage: 1
-                })
-              });
-            } else {
-              this.warning(res.data.msg);
-            }
-            this.saveDisable = false;
-          })
-          .catch(err => {
-            if (err.code === '900010001') {
-              return false;
-            }
-            this.saveDisable = false;
-            this.warning(err);
-          });
+        this.sendSaveOrEdit(param)       
       });
     },
+
+    //保存编辑 接口
+    sendSaveOrEdit(param) {
+      api
+        .saveTermPrompts(param)
+        .then(res => {
+          if (res.data.code === '0') {
+            this.isSuccessUpload = 0; // 修改文件上传状态为0
+            this.warning(res.data.msg || '保存成功', 'success');
+            this.isSaveSuccess = true; // 保存成功,可正常退出
+            //返回带搜索条件的首页
+            this.$router.push({
+              name: 'MedicinePrompt',
+              params: Object.assign({}, this.$route.params, {
+                currentPage: 1
+              })
+            });
+          } else {
+            this.warning(res.data.msg);
+          }
+          this.saveDisable = false;
+        })
+        .catch(err => {
+          if (err.code === '900010001') {
+            return false;
+          }
+          this.saveDisable = false;
+          this.warning(err);
+        });
+    },
+
     // 弹出窗
     showConfirmDialog(msg, resolve) {
       this.$confirm(msg, '', {

+ 10 - 2
src/components/icss/MedicinePrompt.vue

@@ -2,7 +2,7 @@
   <div>
     <crumbs title="医学术语静态知识维护">
       <el-form :inline="true" class="demo-form-inline">
-        <el-form-item label="术语分类:">
+        <el-form-item label="术语分类:" class="selectMedicine">
           <el-select size="mini" v-model="filter.libType" placeholder="请选择" clearable>
             <el-option
               v-for="item in typeList"
@@ -15,7 +15,7 @@
         <el-form-item label="标准术语:">
           <el-input size="mini" maxlength="50" v-model="filter.term" placeholder="请输入" clearable></el-input>
         </el-form-item>
-        <el-form-item label="状态:">
+        <el-form-item label="状态:"  class="selectMedicine">
           <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
             <el-option v-for="item in stateList" :label="item.name" :value="item.id" :key="item.id"></el-option>
           </el-select>
@@ -398,4 +398,12 @@ export default {
     right: 0px !important;
   }
 }
+
+.selectMedicine{
+  /deep/ .el-input__suffix-inner{
+    position: relative;
+    top: -1px;
+  }
+}
+
 </style>