reaper 4 năm trước cách đây
mục cha
commit
e19cc34caf

+ 195 - 127
src/components/knowledgeExtra/AddDevKnow.vue

@@ -56,7 +56,7 @@
             }}</el-form-item>
           </div>
         </el-form>
-        <p class="line"></p>
+
         <div class="tabs">
           <div
             class="tabs_pane"
@@ -64,8 +64,21 @@
               tabActive == 'one' ? { color: '#fff', background: '#00c7da' } : ''
             "
             @click="tabActiveChange('one')"
+            v-if="staticTabShow"
           >
             静态信息
+            <img
+              @click.stop="AssesTabSHow = true"
+              src="@/images/tab_add.png"
+              alt=""
+              v-if="!AssesTabSHow && AssesComSHow"
+            />
+            <img
+              v-if="AssesTabSHow && AssesComSHow"
+              @click.stop="closeStaticTab"
+              src="@/images/tab_close.png"
+              alt=""
+            />
           </div>
           <div
             class="tabs_pane"
@@ -73,12 +86,29 @@
               tabActive == 'two' ? { color: '#fff', background: '#00c7da' } : ''
             "
             @click="tabActiveChange('two')"
-            v-if="AssesComSHow"
+            v-if="AssesTabSHow && AssesComSHow"
           >
             评估内容
+            <img
+              v-if="!staticTabShow"
+              @click.stop="staticTabShow = true"
+              src="@/images/tab_add.png"
+              alt=""
+            />
+            <img
+              v-if="staticTabShow"
+              @click.stop="closeAssesTab"
+              src="@/images/tab_close.png"
+              alt=""
+            />
           </div>
         </div>
-        <div class="tab_box_left" v-show="tabActive == 'one'">
+        <p class="line"></p>
+        <div
+          class="tab_box_left"
+          v-show="tabActive == 'one'"
+          v-if="staticTabShow"
+        >
           <el-form
             :rules="rules"
             :model="form"
@@ -175,7 +205,7 @@
             </el-form-item>
           </el-form>
         </div>
-        <div v-if="AssesComSHow" v-show="tabActive == 'two'">
+        <div v-if="AssesComSHow && AssesTabSHow" v-show="tabActive == 'two'">
           <AddAssess
             @scrollTo="scrollTo"
             :childScaleData="scaleData"
@@ -211,6 +241,9 @@ export default {
   },
   data() {
     return {
+      staticTabShow: true,
+      AssesTabSHow: true,
+      staticComShow: true,
       AssesComSHow: false,
       toAssesTermId: null,
       scaleData: null,
@@ -438,6 +471,14 @@ export default {
     }
   },
   methods: {
+    closeStaticTab() {
+      this.staticTabShow = false;
+      this.tabActiveChange("two");
+    },
+    closeAssesTab() {
+      this.AssesTabSHow = false;
+      this.tabActiveChange("one");
+    },
     scrollTo(value) {
       let div = this.$refs["elscrollbar"].$refs["wrap"];
       console.log("after", div.scrollTop);
@@ -466,7 +507,7 @@ export default {
       this.isShowTip = false;
     },
     changeWord(newVal) {
-      // console.log(newVal, '选中');
+      console.log(newVal, '选中');
       if (newVal.typeName == "量表") {
         this.AssesComSHow = true;
       } else {
@@ -604,14 +645,14 @@ export default {
       ) {
         console.log("进入校验");
         //若医学术语为检验/检查,且内容类型选择了注意事项,此时“注意事项标题”是必填项
-        this.$refs.groups.clearValidate();
+        this.$refs.groups && this.$refs.groups.clearValidate();
         this.rules.titleChange.push({
           required: true,
           message: "请输入注意事项标题",
           trigger: "change"
         });
-        this.$refs.groups.validateField("titleChange");
-        this.$refs.groups.validateField("selectedTerm");
+        this.$refs.groups && this.$refs.groups.validateField("titleChange");
+        this.$refs.groups && this.$refs.groups.validateField("selectedTerm");
         this.rules.titleChange = this.rules.titleChange.slice(0, 1);
 
         if (this.form.titleChange.trim() !== "") {
@@ -627,14 +668,14 @@ export default {
         // return;
       } else if (isDiagFlag && this.showType == 1) {
         // 若医学术语为诊断,且内容类型选择了临床路径,此时“临床路径标题”是必填项
-        this.$refs.groups.clearValidate();
+        this.$refs.groups && this.$refs.groups.clearValidate();
         this.rules.titleChange.push({
           required: true,
           message: "请输入临床路径标题",
           trigger: "change"
         });
-        this.$refs.groups.validateField("titleChange");
-        this.$refs.groups.validateField("selectedTerm");
+        this.$refs.groups && this.$refs.groups.validateField("titleChange");
+        this.$refs.groups && this.$refs.groups.validateField("selectedTerm");
         this.rules.titleChange = this.rules.titleChange.slice(0, 1);
 
         if (this.form.titleChange.trim() !== "") {
@@ -651,70 +692,78 @@ export default {
     },
 
     async submitForm() {
-      if (this.isSuccessUpload === 1) {
-        this.warning("文件上传中,请稍等");
-        return;
-      }
-      let flagVal = this.formVal(); // 额外的表单校验
-      if (flagVal === false) return;
-      //验证外层表单
+      let all = [];
       let goOn = true,
-        it = null;
-      let outIsVia = true; // 外层验证是否通过
-
-      let fvalidate = new Promise((resolve, reject) => {
-        //wanglei 添加promise
-        this.$refs.groups.validate((valid, object) => {
-          if (valid) {
-            resolve();
-          } else {
-            reject("f", object);
-            return false;
-          }
-        });
-      });
-      let fvalidate1 = new Promise((resolve, reject) => {
-        //wanglei 添加promise
-        this.$refs.groups1.validate((valid, object) => {
-          if (valid) {
-            resolve();
-          } else {
-            reject("f", object);
-            return false;
-          }
-        });
-      });
+          it = null;
+        let outIsVia = true; // 外层验证是否通过
+      if (this.staticTabShow) {
+        if (this.isSuccessUpload === 1) {
+          this.warning("文件上传中,请稍等");
+          return;
+        }
+        let flagVal = this.formVal(); // 额外的表单校验
+        if (flagVal === false) return;
+        //验证外层表单
+        
 
-      // end....
-      //验证段落表单
-      // return;
-      let viewHeight = 0; // 定位到表单校验的高度
-      let viewHeightArr = []; // 表单校验出错高度的所有数组
-      let fvalidate3 = null;
-      if (this.form.typeId !== 82 && this.form.typeId !== 83) {
-        fvalidate3 = new Promise((resolve, reject) => {
-          for (let i = 0; i < this.$refs.subForm.length; i++) {
-            it = this.$refs.subForm[i];
-            viewHeight += it.$el.offsetHeight;
-            it.$refs.form.validate((valid, object) => {
-              if (!valid) {
-                reject("f", object);
-                goOn = false;
-                viewHeightArr.push(viewHeight);
-              } else {
+        let fvalidate = new Promise((resolve, reject) => {
+          //wanglei 添加promise
+          this.$refs.groups &&
+            this.$refs.groups.validate((valid, object) => {
+              if (valid) {
                 resolve();
+              } else {
+                reject("f", object);
+                return false;
               }
             });
-          }
         });
+        let fvalidate1 = new Promise((resolve, reject) => {
+          //wanglei 添加promise
+          this.$refs.groups1.validate((valid, object) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject("f", object);
+              return false;
+            }
+          });
+        });
+        // end....
+        //验证段落表单
+        // return;
+        let viewHeight = 0; // 定位到表单校验的高度
+        let viewHeightArr = []; // 表单校验出错高度的所有数组
+        let fvalidate3 = null;
+        if (this.form.typeId !== 82 && this.form.typeId !== 83) {
+          fvalidate3 = new Promise((resolve, reject) => {
+            for (let i = 0; i < this.$refs.subForm.length; i++) {
+              it = this.$refs.subForm[i];
+              viewHeight += it.$el.offsetHeight;
+              it.$refs.form.validate((valid, object) => {
+                if (!valid) {
+                  reject("f", object);
+                  goOn = false;
+                  viewHeightArr.push(viewHeight);
+                } else {
+                  resolve();
+                }
+              });
+            }
+          });
+        }
+        all = [fvalidate, fvalidate1, fvalidate3];
       }
+
       // 表单验证
-      let all = [fvalidate, fvalidate1, fvalidate3];
+
       if (this.$refs.assessRef) {
         all.push(...this.$refs.assessRef.assessCommit());
       }
       await Promise.all(all)
-        .then(() => {})
+        .then(() => {
+          console.log("3.5");
+        })
         .catch((err, obj) => {
           console.log("obj", err);
           // 跳转到未校验通过的tab页
@@ -723,71 +772,82 @@ export default {
           } else if (err == "c") {
             this.tabActive = "two";
           }
-          goOn = false;
-          outIsVia = false;
+          if (this.staticTabShow) {
+            goOn = false;
+            outIsVia = false;
+          }
         });
       // console.log(viewHeightArr,'viewHeightArr');
-      if (!goOn) {
-        var div = this.$refs["elscrollbar"].$refs["wrap"];
-        if (outIsVia) {
-          // 外层校验通过,跳转至下层校验具体位置
-          this.$nextTick(() => {
-            div.scrollTop = +viewHeightArr[0] - 150;
-          });
-        } else {
-          // 外层校验没通过,页面滚动到顶部
-          this.$nextTick(() => {
-            div.scrollTop = 0;
-          });
+      if (this.staticTabShow) {
+        console.log("????");
+        if (!goOn) {
+          var div = this.$refs["elscrollbar"].$refs["wrap"];
+          if (outIsVia) {
+            // 外层校验通过,跳转至下层校验具体位置
+            this.$nextTick(() => {
+              div.scrollTop = +viewHeightArr[0] - 150;
+            });
+          } else {
+            // 外层校验没通过,页面滚动到顶部
+            this.$nextTick(() => {
+              div.scrollTop = 0;
+            });
+          }
+          return;
         }
-        return;
       }
+
       //通过必填验证,提交保存
-      const item = this.form.prags;
+
       let param = [];
-      if (this.form.typeId === 82 || this.form.typeId === 83) {
-        if (this.form.fileList.length === 0) {
-          this.warning("文件未上传,不存储数据");
-          return;
-        }
-        param.push(
-          Object.assign(
-            {},
-            {
-              position: this.form.typeId === 82 ? "8" : "9",
-              conceptId: this.form.conceptId,
-              title: this.form.fileTitle,
-              orderNo: 0,
-              content: JSON.stringify(this.form.fileList[0])
-            }
-          )
-        );
-      } else {
-        let data = this.form.prags,
-          tempArr = [],
-          paramsAll = {},
-          types = this.form.typeId;
-        for (let i = 0; i < data.length; i++) {
-          let obj = {};
-          obj.content = data[i].content;
-          obj.text = data[i].text;
-          obj.conceptId = data[i].conceptId;
-          obj.orderNo = i;
-          obj.title = data[i].title;
-          obj.contentType = data[i].position.join(",");
-          tempArr.push(obj);
+      // const item = this.form.prags;
+      if (this.staticTabShow) {
+        if (this.form.typeId === 82 || this.form.typeId === 83) {
+          if (this.form.fileList.length === 0) {
+            this.warning("文件未上传,不存储数据");
+            return;
+          }
+          param.push(
+            Object.assign(
+              {},
+              {
+                position: this.form.typeId === 82 ? "8" : "9",
+                conceptId: this.form.conceptId,
+                title: this.form.fileTitle,
+                orderNo: 0,
+                content: JSON.stringify(this.form.fileList[0])
+              }
+            )
+          );
+        } else {
+          let data = this.form.prags,
+            tempArr = [],
+            paramsAll = {},
+            types = this.form.typeId;
+          for (let i = 0; i < data.length; i++) {
+            let obj = {};
+            obj.content = data[i].content;
+            obj.text = data[i].text;
+            obj.conceptId = data[i].conceptId;
+            obj.orderNo = i;
+            obj.title = data[i].title;
+            obj.contentType = data[i].position.join(",");
+            tempArr.push(obj);
+          }
+          paramsAll.clinicalPathwayName =
+            types == 1 ? this.form.titleChange : "";
+          paramsAll.id = this.conceptId;
+          paramsAll.name = this.form.name;
+          paramsAll.noticeName =
+            types == 3 || types == 4 || types == 5 || types == 6
+              ? this.form.titleChange
+              : "";
+          paramsAll.type = this.form.typeId;
+          paramsAll.details = tempArr;
+          param = paramsAll;
         }
-        paramsAll.clinicalPathwayName = types == 1 ? this.form.titleChange : "";
-        paramsAll.id = this.conceptId;
-        paramsAll.name = this.form.name;
-        paramsAll.noticeName =
-          types == 3 || types == 4 || types == 5 || types == 6
-            ? this.form.titleChange
-            : "";
-        paramsAll.type = this.form.typeId;
-        paramsAll.details = tempArr;
-        param = paramsAll;
       }
+
       // this.showSaveDialog(param,'是否'+(this.isEdit?'修改':'保存')+'该静态知识?');
 
       // 评估内容的数据
@@ -799,9 +859,9 @@ export default {
         param.scale.modifier = userInfo.linkman;
       }
 
-      // console.log("param-------");
-      // console.dir(param);
-      // return;
+      console.log("param-------");
+      console.dir(param);
+      return;
       if (!this.isEdit) {
         // 新增页面
         this.saveDisable = true;
@@ -823,7 +883,7 @@ export default {
     //保存编辑 接口
     sendSaveOrEdit(param) {
       this.isCopy && (param.id = undefined);
-      param.source = 1;//0:医院端  1:云平台
+      param.source = 1; //0:医院端  1:云平台
       api
         .saveBaseOrUpdateRecord(param)
         .then((res) => {
@@ -1074,25 +1134,33 @@ export default {
 }
 .tabs {
   display: flex;
-  margin: 15px 30px;
+  margin: 15px 30px 0 30px;
   font-size: 14px;
   height: 31px;
   border-bottom: 1px solid #e6e6e6;
   .tabs_pane {
+    position: relative;
     width: 92px;
     height: 32px;
     border-radius: 6px 6px 0px 0px;
     border: 1px solid #00c7da;
     text-align: center;
     line-height: 32px;
-    margin-right: 15px;
+    margin-right: 32px;
     box-sizing: border-box;
     color: #00c7da;
     cursor: pointer;
+    img {
+      position: absolute;
+      right: -18px;
+      bottom: 0;
+      width: 18px;
+      height: 18px;
+    }
   }
 }
 .tab_box_left {
-  padding: 0 30px;
+  padding: 30px;
 }
 
 /deep/ .el-form-item.is-success .el-input__inner,

BIN
src/images/msg_close.png


BIN
src/images/tab_add.png


BIN
src/images/tab_close.png