Browse Source

目录问题修复

liangbowen 10 months ago
parent
commit
42d4bdad74

+ 2 - 2
src/main.js

@@ -14,7 +14,7 @@ Vue.use(Print);
 import App from "./App";
 import store from "./store";
 import router from "./router";
-
+import { moveToError } from "@/utils/utils.js";
 import "./icons"; // icon
 import "./permission"; // permission control
 import "./utils/error-log"; // error log
@@ -26,7 +26,7 @@ import { message } from "@/utils/resetMessage.js";
 
 import { hasBtnPermission } from "./utils/permission"; // button permission
 Vue.prototype.hasPerm = hasBtnPermission;
-
+Vue.prototype.$scrollToError = moveToError;
 Vue.use(Element, {
   size: Cookies.get("size") || "small" // set element-ui default size
   //locale: zhLang // 如果使用中文,无需设置,请删除

+ 11 - 0
src/utils/utils.js

@@ -119,6 +119,17 @@ export const getThreeMonthAgoDate = (deadline) => {
   const threeMonthsAgoDate = yearAgo + "-" + monthAgo + "-" + dayAgo;
   return threeMonthsAgoDate;
 }
+//表单验证错误直接滚动到错误位置
+export const moveToError = () => {
+  let isError = document.getElementsByClassName('is-error');
+     if(isError.length){
+      isError[0].scrollIntoView({
+        block: 'center',
+        behavior: 'smooth'
+
+     })
+    }
+};
 
 
 

+ 5 - 0
src/views/page/consumCataManage-sup/catalogdetailsadd.vue

@@ -913,6 +913,10 @@ export default {
                 });
             })
             .catch(() => {});
+        } else {
+          this.$nextTick(() => {
+            this.$scrollToError();
+          });
         }
       });
     },
@@ -1029,6 +1033,7 @@ export default {
               }
             })
             .catch(() => {});
+        } else {
         }
       });
     },

+ 2 - 2
src/views/page/orderManage-sup/purOrderDelivery/purchaseDetails.vue

@@ -15,10 +15,10 @@
             placeholder="请输入医保编码"
           ></el-input>
         </el-form-item>
-        <el-form-item label="耗材名称" prop="prodName">
+        <el-form-item label="耗材信息" prop="prodName">
           <el-input
             v-model="listQuery.prodName"
-            placeholder="请输入耗材名称"
+            placeholder="请输入耗材信息"
           ></el-input>
         </el-form-item>
         <el-form-item>

+ 34 - 18
src/views/page/qualityManagement-sup/information-filling/index.vue

@@ -10,13 +10,13 @@
       :closable="false"
     >
     </el-alert>
-    <div
+    <!-- <div
       class="common-card"
       v-if="infoData.stas == 'B' || infoData.stas == '0'"
     >
       <h3>审批状态</h3>
       <yl-step></yl-step>
-    </div>
+    </div> -->
     <el-form
       :model="infoData"
       ref="planForm"
@@ -445,8 +445,10 @@
           <el-date-picker
             v-model="temp.issuDate"
             type="date"
+            :picker-options="pickerStartOptions"
             placeholder="选择日期"
             value-format="yyyy-MM-dd"
+            @change="timeSartAble"
           >
           </el-date-picker>
         </el-form-item>
@@ -458,6 +460,7 @@
           <el-date-picker
             v-model="temp.endDate"
             type="date"
+            :picker-options="pickerEndOptions"
             placeholder="选择日期"
             value-format="yyyy-MM-dd"
           >
@@ -469,7 +472,9 @@
           :rules="rules.uploadRequired"
         >
           <yl-upload :fileId="temp.fileId" @getUpload="getUpload">
-            <template v-slot:dec>只能上传pdf文件</template>
+            <template v-slot:dec
+              >只能上传pdf文件</template
+            >
           </yl-upload>
         </el-form-item>
       </el-form>
@@ -500,11 +505,21 @@ export default {
       infoData: { quaList: [] },
       listLoading: false,
       planForm: {},
-      dialogStatus: '',
+      dialogStatus: "",
       textMap: {
         update: "编辑",
         create: "添加"
       },
+      pickerEndOptions: {
+        disabledDate: date => {
+          return date.getTime() < Date.now() - 24 * 60 * 60 * 1000;
+        }
+      },
+      pickerStartOptions: {
+        disabledDate: date => {
+          return date.getTime() > Date.now() - 24 * 60 * 60 * 1000;
+        }
+      },
       dialogFormVisible: false,
       temp: {
         quaName: "",
@@ -520,6 +535,8 @@ export default {
     this.getData();
   },
   methods: {
+    //发证日期改变触发
+    timeSartAble(tim) {},
     getUpload(id) {
       this.temp.fileId = id;
       if (id) {
@@ -533,11 +550,11 @@ export default {
       this.listLoading = true;
 
       getUserSplerInfoB()
-        .then((response) => {
+        .then(response => {
           this.infoData = response.data;
           this.listLoading = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.listLoading = false;
         });
     },
@@ -580,7 +597,7 @@ export default {
         });
         return false;
       }
-       if (this.temp.issuDate == this.temp.endDate) {
+      if (this.temp.issuDate == this.temp.endDate) {
         this.$message({
           message: "发证日期不能等于截止日期",
           type: "warning"
@@ -594,7 +611,7 @@ export default {
           this.infoData.quaList &&
           this.infoData.quaList.length > 0
         ) {
-          this.infoData.quaList.forEach((item) => {
+          this.infoData.quaList.forEach(item => {
             if (item.quaCode === this.temp.quaCode) {
               flag = true;
             }
@@ -609,14 +626,14 @@ export default {
         }
       }
 
-      this.$refs["dataForm"].validate((valid) => {
+      this.$refs["dataForm"].validate(valid => {
         if (valid) {
           if (this.temp.type === "add") {
             this.infoData.quaList.push(this.temp);
-            this.$message.success("操作成功")
+            this.$message.success("操作成功");
           } else {
             this.$set(this.infoData.quaList, this.temp.index, this.temp);
-            this.$message.success("操作成功")
+            this.$message.success("操作成功");
           }
           this.dialogFormVisible = false;
         }
@@ -625,7 +642,7 @@ export default {
 
     // 信息保存
     handleSave() {
-      this.$refs["planForm"].validate((valid) => {
+      this.$refs["planForm"].validate(valid => {
         if (valid) {
           this.$confirm("确认保存", "提示", {
             confirmButtonText: "确定",
@@ -635,7 +652,7 @@ export default {
             .then(() => {
               this.saveLoad = true;
               saveSplerInfo(this.infoData)
-                .then((response) => {
+                .then(response => {
                   this.$message({
                     message: "保存成功",
                     type: "success"
@@ -653,7 +670,7 @@ export default {
 
     // 整体提交
     handleSubmit() {
-      this.$refs["planForm"].validate((valid) => {
+      this.$refs["planForm"].validate(valid => {
         if (valid) {
           this.$confirm("确认提交", "提示", {
             confirmButtonText: "确定",
@@ -663,13 +680,13 @@ export default {
             .then(() => {
               this.submitLoad = true;
               submitSplerInfo(this.infoData)
-                .then((response) => {
+                .then(response => {
                   this.$message({
                     message: "提交成功",
                     type: "success"
                   });
                   this.submitLoad = false;
-                  this.getData()
+                  this.getData();
                 })
                 .catch(() => {
                   this.submitLoad = false;
@@ -689,5 +706,4 @@ export default {
 };
 </script>
 
-<style scoped lang="scss">
-</style>
+<style scoped lang="scss"></style>