yangdr 6 ay önce
ebeveyn
işleme
dae6c210e2

Dosya farkı çok büyük olduğundan ihmal edildi
+ 13773 - 33
package-lock.json


+ 258 - 204
src/components/icss/AddMedicinePrompt.vue

@@ -2,14 +2,18 @@
   <el-scrollbar style="height: 100%" ref="elscrollbar" id="message-container">
     <div class="NoiseTemplateWrapper TemplateWrapper knowledgeWrapper">
       <crumbs
-        :title="'医学术语静态知识维护-'+title"
+        :title="'医学术语静态知识维护-' + title"
         class="topBack"
         :param="$route.params"
         linkTo="MedicinePrompt"
       ></crumbs>
       <div class="info-container">
         <el-form :rules="rules" :model="form" label-width="160px" ref="groups">
-          <el-form-item v-if="!isEdit" label="选择标准术语:" prop="selectedTerm">
+          <el-form-item
+            v-if="!isEdit"
+            label="选择标准术语:"
+            prop="selectedTerm"
+          >
             <el-select
               v-model="form.selectedTerm"
               filterable
@@ -26,17 +30,30 @@
               :remote-method="searchTerms"
             >
               <el-option
-                v-for="(term,idx) in terms"
+                v-for="(term, idx) in terms"
                 :key="idx"
-                :label="term.name+(term.typeName?'('+term.typeName+')':'')"
+                :label="
+                  term.name + (term.typeName ? '(' + term.typeName + ')' : '')
+                "
                 :value="term"
-                :title="term.name+(term.typeName?'('+term.typeName+')':'')"
+                :title="
+                  term.name + (term.typeName ? '(' + term.typeName + ')' : '')
+                "
               ></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="已选择标准术语:" label-width="160px">{{form.selectedTermName}}</el-form-item>
+          <el-form-item label="已选择标准术语:" label-width="160px">{{
+            form.selectedTermName
+          }}</el-form-item>
           <el-form-item
-            v-if="form.selectedTerm&&(form.typeId==1||form.typeId==3||form.typeId==4||form.typeId==5||form.typeId==6)"
+            v-if="
+              form.selectedTerm &&
+              (form.typeId == 1 ||
+                form.typeId == 3 ||
+                form.typeId == 4 ||
+                form.typeId == 5 ||
+                form.typeId == 6)
+            "
             :label="titleChange"
             prop="titleChange"
             label-width="160px"
@@ -45,9 +62,9 @@
           </el-form-item>
           <p class="line"></p>
           <InfoParagraph
-            v-for="(f,i) in form.prags"
+            v-for="(f, i) in form.prags"
             v-if="!upload"
-            :key="(i+1)*10000 + showType"
+            :key="(i + 1) * 10000 + showType"
             :data="f"
             :index="i"
             :total="form.prags.length"
@@ -58,7 +75,12 @@
             @reOrder="reOrder"
             :showType="showType"
           ></InfoParagraph>
-          <el-form-item v-if="upload" label="标题名称:" prop="fileTitle" label-width="160px">
+          <el-form-item
+            v-if="upload"
+            label="标题名称:"
+            prop="fileTitle"
+            label-width="160px"
+          >
             <el-input v-model="form.fileTitle"></el-input>
           </el-form-item>
           <el-form-item
@@ -85,18 +107,26 @@
               :show-file-list="showFileList"
               :file-list="form.fileList"
             >
-              <el-button size="small" type="primary" v-if="showUpLoad">点击上传</el-button>
+              <el-button size="small" type="primary" v-if="showUpLoad"
+                >点击上传</el-button
+              >
               <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
             </el-upload>
-            <span class="tipInfo" v-show="isShowTip">{{form.fileList[0]&&form.fileList[0].name}}</span>
+            <span class="tipInfo" v-show="isShowTip">{{
+              form.fileList[0] && form.fileList[0].name
+            }}</span>
             <!-- <el-button size="small" type="primary" >点击上传</el-button> -->
           </el-form-item>
           <el-form-item label-width="160px">
-            <div class="uploadInfo" v-if="isSuccessUpload===1">文件上传中,请稍等...</div>
+            <div class="uploadInfo" v-if="isSuccessUpload === 1">
+              文件上传中,请稍等...
+            </div>
           </el-form-item>
         </el-form>
         <div class="btn">
-          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确 定</el-button>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm"
+            >确 定</el-button
+          >
         </div>
       </div>
     </div>
@@ -106,69 +136,69 @@
 /**
  *
  */
-import api from '@api/icss.js';
-import InfoParagraph from './MedicineInfoPg';
-import config from '@api/config';
+import api from "@api/icss.js";
+import InfoParagraph from "./MedicineInfoPg";
+import config from "@api/config";
 
 export default {
-  name: 'AddMedicinePrompt',
+  name: "AddMedicinePrompt",
   components: {
-    InfoParagraph
+    InfoParagraph,
   },
   data() {
     return {
       isFixedTop: true,
       isEdit: false,
       isCopy: false,
-      title: '添加',
+      title: "添加",
       termTypes: [],
       terms: [], //术语列表
       form: {
-        conceptId: '', //术语id
+        conceptId: "", //术语id
         isTip: 0, //是否要覆盖,0不覆盖,1覆盖
-        selectedTerm: '', //术语标签
-        termType: '',
-        typeId: '',
-        selectedTermName: '',
-        selectedTermType: '',
+        selectedTerm: "", //术语标签
+        termType: "",
+        typeId: "",
+        selectedTermName: "",
+        selectedTermType: "",
         // titleChange: '',
         fileList: [],
-        name: '',
+        name: "",
         prags: [
           {
             //单个段落相关
-            title: '',
-            content: '',
+            title: "",
+            content: "",
             isReason: 0,
             orderNo: 0,
             position: [],
-            text: ''
-          }
+            text: "",
+          },
         ],
-        fileTitle: '',
-        titleChange: ''
+        fileTitle: "",
+        titleChange: "",
       },
       rules: {
         selectedTerm: [
-          { required: true, message: '请选择术语标签', trigger: 'change' }
+          { required: true, message: "请选择术语标签", trigger: "change" },
         ],
         fileTitle: [
-          { required: true, message: '请输入标题名称', trigger: 'change' },
+          { required: true, message: "请输入标题名称", trigger: "change" },
           {
             validator: (rule, value, callback) => {
               if (value.length > 30) {
-                callback(new Error('标题名称不能超过30字'));
+                callback(new Error("标题名称不能超过30字"));
               } else {
                 callback();
               }
             },
-            trigger: 'change'
-          }
+            trigger: "change",
+          },
         ],
         fileList: [
-          { required: true, message: '请上传文件', trigger: 'change' }
+          { required: true, message: "请上传文件", trigger: "change" },
         ],
-        titleChange: [{ max: 30, message: '标题最多30字', trigger: 'change' }]
+        titleChange: [{ max: 30, message: "标题最多30字", trigger: "change" }],
       },
       saveDisable: false, //保存按钮禁止点击
       showDrop: false, //下拉框显示文字bug1774
@@ -182,108 +212,35 @@ export default {
       showType: -1, // 1 诊断  2  药品   3检验套餐 4检验细项  5检查  6检查子 7手术和操作 8量表 9护理
       editCount: -1, // 页面会否被编辑 >0被编辑   =0 未编辑
       startCount: -1,
-      isSaveSuccess: false // 是否保存成功
+      isSaveSuccess: false, // 是否保存成功
     };
   },
   watch: {
     showType: {
       handler(newVal, oldVal) {
-        // console.log('newVal============', newVal, 'oldVal============', oldVal);
+        // console.log("newVal============", newVal, "oldVal============", oldVal);
         if (newVal !== oldVal) {
-          this.form.prags = this.form.prags.map(item => {
+          this.form.prags = this.form.prags.map((item) => {
             return { ...item, position: [] };
+            // return { ...item };
           });
         }
-      }
+      },
     },
     form: {
       handler(newName, oldName) {
         this.editCount++;
       },
       deep: true,
-      immediate: true
-    }
+      immediate: true,
+    },
   },
-  created: function() {
-    const { isEdit, data, isCopy } = this.$route.params;   
-    console.log('静态数据???',data)
-    if (isEdit || isCopy) {
-      this.showType = data.type; // 编辑页确认显示类型
-      this.isEdit = isEdit;
-      this.isCopy = isCopy;
-      this.title = isEdit ? '修改' : isCopy ? '复制' : '添加';
-      isEdit && this.changeWord(data);
-      api
-        .getTremList({ id: data.id })
-        .then(res => {
-          if (res.data.code == '0') {
-            const data = res.data.data;
-            if (this.form.typeId === 82 || this.form.typeId === 83) {
-              // console.log('data',data)
-              this.form.fileList =
-                data &&
-                data.map(it => {
-                  return JSON.parse(it.content);
-                });
-              this.showFileList = true;
-              this.showUpLoad = false;
-            } else {
-              this.conceptId = data.id;
-              this.form.typeId = data.type;
-              this.form.name = data.name;
-              this.form.titleChange =
-                data.type == 1
-                  ? data.clinicalPathwayName
-                  : data.type == 3 || data.type == 4 || data.type == 5||  data.type == 6
-                  ? data.noticeName
-                  : '';
-              this.form.selectedTermName =
-                data.name + (data.typeName ? '(' + data.typeName + ')' : '');
-              this.form.selectedTerm =
-                data.name + (data.typeName ? '(' + data.typeName + ')' : '');
-              if(data &&data.details&&data.details.length===0){   //量表有评估内容没有静态知识的情况
-                  this.form.prags =[
-                      {
-                          title: '',
-                          content: '',
-                          isReason: 0,
-                          orderNo: 0,
-                          position: [],
-                          text: ''
-                      }
-                  ];
-                  return;
-              }
-              this.form.prags =
-                data &&
-                data.details.map(it => {
-                  return {
-                    title: it.title,
-                    position: (it.contentType||'').split(","),
-                    content: it.content.replace(
-                      /{imageUrlPrefix}/g,
-                      config.imgHost
-                    ),
-                    // isReason:it.isReason,
-                    text: it.text,
-                    disabled: true
-                  };
-                });
-            }
-          }
-        })
-        .catch(error => {
-          if (error.code === '900010001') {
-            return false;
-          }
-          console.log(error);
-        });
-    }
-    setTimeout(() => {
-      this.startCount = this.editCount;
-    }, 500);
+  created: function () {
+    this.init();
+  },
+  mounted() {
+    this.init();
   },
-  mounted() {},
   beforeRouteLeave(to, from, next) {
     // if (this.isSuccessUpload === 1) {
     //   this.$confirm('文件正在上传,是否确定返回?', '提示', {
@@ -313,12 +270,12 @@ export default {
     // }
 
     if (this.startCount !== this.editCount && !this.isSaveSuccess) {
-      this.$confirm('还有未保存的内容,确定要退出当前页面吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        cancelButtonClass: 'leaveBtn',
-        customClass: 'leaveBox',
-        type: 'warning'
+      this.$confirm("还有未保存的内容,确定要退出当前页面吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leaveBtn",
+        customClass: "leaveBox",
+        type: "warning",
       })
         .then(() => {
           next();
@@ -330,12 +287,102 @@ export default {
   },
   methods: {
     handleClear() {
-      this.form.selectedTermName = '';
-      this.form.selectedTerm = '';
-      this.form.titleChange = '';
+      this.form.selectedTermName = "";
+      this.form.selectedTerm = "";
+      this.form.titleChange = "";
       // console.log('处理清空的操作');
     },
+    init() {
+      const { isEdit, data, isCopy } = this.$route.params;
+      // console.log("静态数据???", data);
+      if (isEdit || isCopy) {
+        this.showType = data.type; // 编辑页确认显示类型
+        this.isEdit = isEdit;
+        this.isCopy = isCopy;
+        this.title = isEdit ? "修改" : isCopy ? "复制" : "添加";
+        isEdit && this.changeWord(data);
+        api
+          .getTremList({ id: data.id })
+          .then((res) => {
+            // console.log("@@data", res.data);
+            if (res.data.code == "0") {
+              const data = res.data.data;
+              if (this.form.typeId === 82 || this.form.typeId === 83) {
+                this.form.fileList =
+                  data &&
+                  data.map((it) => {
+                    return JSON.parse(it.content);
+                  });
+                this.showFileList = true;
+                this.showUpLoad = false;
+              } else {
+                this.conceptId = data.id;
+                this.form.typeId = data.type;
+                this.form.name = data.name;
+                this.form.titleChange =
+                  data.type == 1
+                    ? data.clinicalPathwayName
+                    : data.type == 3 ||
+                      data.type == 4 ||
+                      data.type == 5 ||
+                      data.type == 6
+                    ? data.noticeName
+                    : "";
+                this.form.selectedTermName =
+                  data.name + (data.typeName ? "(" + data.typeName + ")" : "");
+                this.form.selectedTerm =
+                  data.name + (data.typeName ? "(" + data.typeName + ")" : "");
+                if (data && data.details && data.details.length === 0) {
+                  //量表有评估内容没有静态知识的情况
+                  this.form.prags = [
+                    {
+                      title: "",
+                      content: "",
+                      isReason: 0,
+                      orderNo: 0,
+                      position: [],
+                      text: "",
+                    },
+                  ];
+                  return;
+                }
 
+                this.form.prags =
+                  data &&
+                  data.details.map((it) => {
+                    let position = it.contentType
+                      ? it.contentType.split(",")
+                      : [];
+                    return {
+                      title: it.title,
+                      position: position,
+                      content: it.content.replace(
+                        /{imageUrlPrefix}/g,
+                        config.imgHost
+                      ),
+                      // isReason:it.isReason,
+                      text: it.text,
+                      disabled: true,
+                    };
+                  });
+                // this.form.prags.forEach((element) => {
+                //   element.position = element.position_backup;
+                // });
+                // console.log("this.form.prags", this.form.prags);
+              }
+            }
+          })
+          .catch((error) => {
+            if (error.code === "900010001") {
+              return false;
+            }
+            console.log(error);
+          });
+      }
+      setTimeout(() => {
+        this.startCount = this.editCount;
+      }, 500);
+    },
     handleMouseenter() {
       if (this.form.fileList.length !== 0) {
         this.isShowTip = true;
@@ -349,20 +396,21 @@ export default {
       const name = newVal.name;
       const typeName = newVal.typeName;
       const type = newVal.type;
-      this.form.selectedTermName = name + (typeName ? '(' + typeName + ')' : '');
+      this.form.selectedTermName =
+        name + (typeName ? "(" + typeName + ")" : "");
       // this.form.selectedTerm = name + (typeName ? '(' + typeName + ')' : '');
       this.form.name = name;
       this.form.fileList = [];
       this.showFileList = false;
-      this.form.typeId = type || '';
+      this.form.typeId = type || "";
       this.showUpLoad = true;
       this.titleChange =
         type == 1
-          ? '临床路径标题:'
+          ? "临床路径标题:"
           : type == 3 || type == 4 || type == 5 || type == 6
-          ? '注意事项标题:'
-          : '';
-      this.form.fileTitle = '';
+          ? "注意事项标题:"
+          : "";
+      this.form.fileTitle = "";
       if (newVal.typeId === 82 || newVal.typeId === 83) {
         this.upload = true;
         this.form.fileTitle = newVal.title;
@@ -377,12 +425,12 @@ export default {
     },
     reOrder(isUp, i) {
       // isUp: 1 上升    0 下降
-      let div = this.$refs['elscrollbar'].$refs['wrap'];
+      let div = this.$refs["elscrollbar"].$refs["wrap"];
       let temp = {},
         it = {};
       if (isUp === 1) {
         if (i === 0) {
-          this.warning('已经是第一个,不能再升啦!');
+          this.warning("已经是第一个,不能再升啦!");
           return;
         }
         temp = Object.assign(this.form.prags[i - 1]);
@@ -393,7 +441,7 @@ export default {
         });
       } else {
         if (i === this.form.prags.length - 1) {
-          this.warning('已经是最后一个,不能再降啦!');
+          this.warning("已经是最后一个,不能再降啦!");
           return;
         }
         temp = Object.assign(this.form.prags[i + 1]);
@@ -404,25 +452,25 @@ export default {
     // 添加段落
     addParagraph(i) {
       this.form.prags.splice(i + 1, 0, {
-        title: '',
-        content: '',
+        title: "",
+        content: "",
         isReason: 0,
         position: [],
-        text: ''
+        text: "",
       });
       //添加段落光标自动落到新增的段落中
       setTimeout(() => {
         this.$refs.subForm[i + 1].$el
-          .getElementsByClassName('el-input__inner')[0]
+          .getElementsByClassName("el-input__inner")[0]
           .focus();
       });
     },
     delParagraph(i) {
       if (this.form.prags.length == 1) {
-        this.warning('只剩一个段落,不能再删啦!');
+        this.warning("只剩一个段落,不能再删啦!");
         return;
       }
-      this.showConfirmDialog('确定要删除该段落?', () => {
+      this.showConfirmDialog("确定要删除该段落?", () => {
         this.form.prags.splice(i, 1);
       });
     },
@@ -436,52 +484,55 @@ export default {
       }
       //搜索术语列表
       this.showDrop = true;
-      api.getAllConcept({ inputStr: query.trim(), types: [0] }).then(res => {
+      api.getAllConcept({ inputStr: query.trim(), types: [0] }).then((res) => {
         this.showDrop = false;
-        if (res.data.code === '0') {
+        if (res.data.code === "0") {
           this.terms = res.data.data;
         } else {
-          this.warning('数据获取失败');
+          this.warning("数据获取失败");
         }
       });
     },
     mapStringToNum(str) {
-      return str.split(',').map(it => {
+      return str.split(",").map((it) => {
         return +it;
       });
     },
 
     // 额外的表单检验
     formVal() {
-      let positiontemp = this.form.prags.map(item => {
+      let positiontemp = this.form.prags.map((item) => {
         return [...item.position];
       });
-      let positionArr = positiontemp.reduce(function(a, b) {
+      let positionArr = positiontemp.reduce(function (a, b) {
         return a.concat(b);
       }); // 所有被选中的值集合
       // console.log(positionArr, 'positionArr');
       // console.log(this.showType, '当前页的显示类型');
-      let isVisFlag = positionArr.some(item => item === 2);
-      let isDiagFlag = positionArr.some(item => item === 3);
+      let isVisFlag = positionArr.some((item) => item === 2);
+      let isDiagFlag = positionArr.some((item) => item === 3);
       // console.log(isVisFlag, 'isVisFlag');
       if (
-        (this.showType == 3 || this.showType == 4 || this.showType == 5|| this.showType == 6) &&
+        (this.showType == 3 ||
+          this.showType == 4 ||
+          this.showType == 5 ||
+          this.showType == 6) &&
         isVisFlag
       ) {
         //若医学术语为检验/检查,且内容类型选择了注意事项,此时“注意事项标题”是必填项
         this.$refs.groups.clearValidate();
         this.rules.titleChange.push({
           required: true,
-          message: '请输入注意事项标题',
-          trigger: 'change'
+          message: "请输入注意事项标题",
+          trigger: "change",
         });
-        this.$refs.groups.validateField('titleChange');
+        this.$refs.groups.validateField("titleChange");
         this.rules.titleChange = this.rules.titleChange.slice(0, 1);
-        if (this.form.titleChange.trim() !== '') {
+        if (this.form.titleChange.trim() !== "") {
           // console.log('内容不为空');
           return true;
         } else {
-          var div = this.$refs['elscrollbar'].$refs['wrap'];
+          var div = this.$refs["elscrollbar"].$refs["wrap"];
           this.$nextTick(() => {
             div.scrollTop = 0;
           });
@@ -493,17 +544,17 @@ export default {
         this.$refs.groups.clearValidate();
         this.rules.titleChange.push({
           required: true,
-          message: '请输入临床路径标题',
-          trigger: 'change'
+          message: "请输入临床路径标题",
+          trigger: "change",
         });
-        this.$refs.groups.validateField('titleChange');
+        this.$refs.groups.validateField("titleChange");
         this.rules.titleChange = this.rules.titleChange.slice(0, 1);
 
-        if (this.form.titleChange.trim() !== '') {
+        if (this.form.titleChange.trim() !== "") {
           // console.log('内容不为空');
           return true;
         } else {
-          var div = this.$refs['elscrollbar'].$refs['wrap'];
+          var div = this.$refs["elscrollbar"].$refs["wrap"];
           this.$nextTick(() => {
             div.scrollTop = 0;
           });
@@ -514,7 +565,7 @@ export default {
 
     submitForm() {
       if (this.isSuccessUpload === 1) {
-        this.warning('文件上传中,请稍等');
+        this.warning("文件上传中,请稍等");
         return;
       }
       let flagVal = this.formVal(); // 额外的表单校验
@@ -523,7 +574,7 @@ export default {
       let goOn = true,
         it = null;
       let outIsVia = true; // 外层验证是否通过
-      this.$refs.groups.validate(valid => {
+      this.$refs.groups.validate((valid) => {
         if (!valid) {
           goOn = false;
           outIsVia = false;
@@ -537,7 +588,7 @@ export default {
         for (let i = 0; i < this.$refs.subForm.length; i++) {
           it = this.$refs.subForm[i];
           viewHeight += it.$el.offsetHeight;
-          it.$refs.form.validate(valid => {
+          it.$refs.form.validate((valid) => {
             if (!valid) {
               goOn = false;
               viewHeightArr.push(viewHeight);
@@ -547,7 +598,7 @@ export default {
       }
       // console.log(viewHeightArr,'viewHeightArr');
       if (!goOn) {
-        var div = this.$refs['elscrollbar'].$refs['wrap'];
+        var div = this.$refs["elscrollbar"].$refs["wrap"];
         if (outIsVia) {
           // 外层校验通过,跳转至下层校验具体位置
           this.$nextTick(() => {
@@ -566,18 +617,18 @@ export default {
       let param = [];
       if (this.form.typeId === 82 || this.form.typeId === 83) {
         if (this.form.fileList.length === 0) {
-          this.warning('文件未上传,不存储数据');
+          this.warning("文件未上传,不存储数据");
           return;
         }
         param.push(
           Object.assign(
             {},
             {
-              position: this.form.typeId === 82 ? '8' : '9',
+              position: this.form.typeId === 82 ? "8" : "9",
               conceptId: this.form.conceptId,
               title: this.form.fileTitle,
               orderNo: 0,
-              content: JSON.stringify(this.form.fileList[0])
+              content: JSON.stringify(this.form.fileList[0]),
             }
           )
         );
@@ -593,13 +644,16 @@ export default {
           obj.conceptId = data[i].conceptId;
           obj.orderNo = i;
           obj.title = data[i].title;
-          obj.contentType = data[i].position.join(',');
+          obj.contentType = data[i].position.join(",");
           tempArr.push(obj);
         }
-        paramsAll.clinicalPathwayName = types == 1 ? this.form.titleChange : '';
+        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.noticeName =
+          types == 3 || types == 4 || types == 5 || types == 6
+            ? this.form.titleChange
+            : "";
         paramsAll.type = this.form.typeId;
         paramsAll.details = tempArr;
         param = paramsAll;
@@ -628,25 +682,25 @@ export default {
     sendSaveOrEdit(param) {
       api
         .saveTermPrompts(param)
-        .then(res => {
-          if (res.data.code === '0') {
+        .then((res) => {
+          if (res.data.code === "0") {
             this.isSuccessUpload = 0; // 修改文件上传状态为0
-            this.warning(res.data.msg || '保存成功', 'success');
+            this.warning(res.data.msg || "保存成功", "success");
             this.isSaveSuccess = true; // 保存成功,可正常退出
             //返回带搜索条件的首页
             this.$router.push({
-              name: 'MedicinePrompt',
+              name: "MedicinePrompt",
               params: Object.assign({}, this.$route.params, {
-                currentPage: 1
-              })
+                currentPage: 1,
+              }),
             });
           } else {
             this.warning(res.data.msg);
           }
           this.saveDisable = false;
         })
-        .catch(err => {
-          if (err.code === '900010001') {
+        .catch((err) => {
+          if (err.code === "900010001") {
             return false;
           }
           this.saveDisable = false;
@@ -656,13 +710,13 @@ export default {
 
     // 弹出窗
     showConfirmDialog(msg, resolve) {
-      this.$confirm(msg, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        cancelButtonClass: 'cancel',
-        confirmButtonClass: 'confirmBtn',
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancel",
+        confirmButtonClass: "confirmBtn",
         dangerouslyUseHTMLString: true,
-        type: 'warning'
+        type: "warning",
       })
         .then(() => {
           resolve();
@@ -673,8 +727,8 @@ export default {
       this.$message({
         showClose: true,
         message: msg,
-        type: type || 'warning',
-        duration:1000
+        type: type || "warning",
+        duration: 1000,
       });
     },
     handleChange(file, fileList) {
@@ -688,13 +742,13 @@ export default {
       // console.log(fileList,this.form.fileList,'aa')
     },
     handleSuccess(response, file, fileList) {
-      if (response.code == '0') {
+      if (response.code == "0") {
         this.showFileList = true;
         this.form.fileList = [];
         this.form.fileList.push({
           name: response.data.title,
           url: response.data.url,
-          size: response.data.size
+          size: response.data.size,
         });
         this.showUpLoad = false;
         if (!this.form.fileTitle) {
@@ -703,7 +757,7 @@ export default {
         this.isSuccessUpload = 2; // 上传成功状态
         this.$refs.upload && this.$refs.upload.clearValidate(); // 清除校验
       } else {
-        this.warning(response.msg || '上传失败');
+        this.warning(response.msg || "上传失败");
         // this.form.fileList = []
         this.showUpLoad = true;
         this.showFileList = false;
@@ -723,7 +777,7 @@ export default {
 
       this.showUpLoad = false;
       if (file.size / 1024 / 1024 >= 500) {
-        this.warning('文件上传失败,超出大小限制500MB');
+        this.warning("文件上传失败,超出大小限制500MB");
         this.form.fileList = [];
         this.showConfirm = false;
         return false;
@@ -734,16 +788,16 @@ export default {
     handlePreview(file) {},
     beforeRemove(file, fileList) {
       if (this.showConfirm) {
-        return this.$confirm(`确定移除 ${file.name}?`, '', {
-          cancelButtonClass: 'cacelBtn'
+        return this.$confirm(`确定移除 ${file.name}?`, "", {
+          cancelButtonClass: "cacelBtn",
         });
       }
-    }
-  }
+    },
+  },
 };
 </script>
 <style lang="less">
-@import '../../less/common.less';
+@import "../../less/common.less";
 .cell .el-button.delete:focus {
   color: red !important;
 }
@@ -823,7 +877,7 @@ export default {
   font-size: 14px;
 }
 .tipInfo:before {
-  content: '';
+  content: "";
   display: block;
   position: absolute;
   // bottom: 9px;

+ 85 - 72
src/components/icss/MedicineInfoPg.vue

@@ -18,7 +18,9 @@
     </el-form-item>
     <el-form-item label="内容类型:" prop="position" label-width="160px">
       <el-checkbox-group v-model="data.position">
-        <el-checkbox v-for="it in positions" :key="it.val" :label="it.val">{{it.name}}</el-checkbox>
+        <el-checkbox v-for="it in positions" :key="it.val" :label="it.val">{{
+          it.name
+        }}</el-checkbox>
       </el-checkbox-group>
     </el-form-item>
     <el-form-item label="内容" prop="content" label-width="160px" ref="editor">
@@ -30,8 +32,18 @@
       ></quillEditor>
     </el-form-item>
     <div class="order-btn">
-      <a v-if="index!==0" :class="index===total-1?'order-spc':'order-up'" @click="reOrder(1)">上升</a>
-      <a v-if="index!==total-1" :class="index===0?'order-spc':'order-down'" @click="reOrder(0)">下降</a>
+      <a
+        v-if="index !== 0"
+        :class="index === total - 1 ? 'order-spc' : 'order-up'"
+        @click="reOrder(1)"
+        >上升</a
+      >
+      <a
+        v-if="index !== total - 1"
+        :class="index === 0 ? 'order-spc' : 'order-down'"
+        @click="reOrder(0)"
+        >下降</a
+      >
     </div>
     <el-form-item label-width="160px" class="btns">
       <el-button @click="addEmit">添加段落</el-button>
@@ -41,181 +53,182 @@
 </template>
 
 <script>
-import 'quill/dist/quill.core.css';
-import 'quill/dist/quill.snow.css';
-import 'quill/dist/quill.bubble.css';
-import { quillEditor, Quill } from 'vue-quill-editor';
-import config from '@api/config';
-import api from '@api/knowledgeLib.js';
-import { container, ImageExtend, QuillWatch } from 'quill-image-extend-module';
-Quill.register('modules/ImageExtend', ImageExtend);
+import "quill/dist/quill.core.css";
+import "quill/dist/quill.snow.css";
+import "quill/dist/quill.bubble.css";
+import { quillEditor, Quill } from "vue-quill-editor";
+import config from "@api/config";
+import api from "@api/knowledgeLib.js";
+import { container, ImageExtend, QuillWatch } from "quill-image-extend-module";
+Quill.register("modules/ImageExtend", ImageExtend);
 export default {
-  props: ['data', 'index', 'isEdit', 'total', 'showType'],
-  name: 'MedicineInfoParagraph',
+  props: ["data", "index", "isEdit", "total", "showType"],
+  name: "MedicineInfoParagraph",
   components: {
-    quillEditor
+    quillEditor,
   },
   data() {
     return {
       toolbars: [
         [
-          ['bold', 'underline', 'strike'],
-          [{ list: 'ordered' }, { list: 'bullet' }],
-          [{ script: 'sub' }, { script: 'super' }],
+          ["bold", "underline", "strike"],
+          [{ list: "ordered" }, { list: "bullet" }],
+          [{ script: "sub" }, { script: "super" }],
           [{ color: [] }, { background: [] }],
           [{ align: [] }],
-          ['image']
-        ]
+          ["image"],
+        ],
       ],
       toolbarMode: 0,
       editorOption: {
         modules: {
           ImageExtend: {
             loading: true,
-            name: 'upfile',
+            name: "upfile",
             size: 1,
             sizeError: () => {
               this.$message({
                 showClose: true,
-                message: '请上传 1M 以内的图片!',
-                type: 'warning'
+                message: "请上传 1M 以内的图片!",
+                type: "warning",
               });
             },
             action: config.urls.promptServer,
-            response: res => {
-              if (res.code == '0') {
+            response: (res) => {
+              if (res.code == "0") {
                 return config.imgHost + res.data.url;
               } else {
                 this.$message({
                   showClose: true,
                   message: res.msg,
-                  type: 'warning'
+                  type: "warning",
                 });
               }
-            }
+            },
           },
           toolbar: {
             container: container,
             handlers: {
-              image: function() {
+              image: function () {
                 QuillWatch.emit(this.quill.id);
-              }
-            }
-          }
-        }
+              },
+            },
+          },
+        },
       },
       form: {
         position: [],
-        orderNo: 0
+        orderNo: 0,
       },
       positions: [], //位置列表
-      rules: {}
+      rules: {},
     };
   },
   watch: {
-    'data.content': function() {
-      if (this.data.content !== '') {
+    "data.content": function () {
+      if (this.data.content !== "") {
         this.$refs.editor && this.$refs.editor.clearValidate(); // 清除校验
       }
-      if (this.data.content === '') {
+      if (this.data.content === "") {
         // console.log('内容为空');
-        this.$refs['form'].validateField('content'); // 手动校验
+        this.$refs["form"].validateField("content"); // 手动校验
       }
       this.data.text = this.$refs.quillEditor.quill.root.innerText;
-    }
+    },
   },
   created() {
     // console.log(this.showType, 'showType','需要显示的类型');
-    this.editorOption.modules.toolbar.container = this.toolbars[
-      this.toolbarMode
-    ];
+    this.editorOption.modules.toolbar.container =
+      this.toolbars[this.toolbarMode];
     this.zskgetDict();
     if (this.isEdit) {
       setTimeout(() => {
         this.rules = {
           position: [
-            { required: true, message: '请选择内容类型', trigger: 'change' }
+            { required: true, message: "请选择内容类型", trigger: "change" },
           ],
           title: [
-            { required: true, message: '请输入段落标题', trigger: 'change' },
-            { max: 30, message: '标题名称不能超过30字', trigger: 'change' }
+            { required: true, message: "请输入段落标题", trigger: "change" },
+            { max: 30, message: "标题名称不能超过30字", trigger: "change" },
           ],
           content: [
-            { required: true, message: '请输入段落内容', trigger: 'change' }
-          ]
+            { required: true, message: "请输入段落内容", trigger: "change" },
+          ],
         };
       }, 100);
     } else {
       this.rules = {
         position: [
-          { required: true, message: '请选择内容类型', trigger: 'change' }
+          { required: true, message: "请选择内容类型", trigger: "change" },
         ],
         title: [
-          { required: true, message: '请输入段落标题', trigger: 'change' },
-          { max: 30, message: '标题名称不能超过30字', trigger: 'change' }
+          { required: true, message: "请输入段落标题", trigger: "change" },
+          { max: 30, message: "标题名称不能超过30字", trigger: "change" },
         ],
         content: [
-          { required: true, message: '请输入段落内容', trigger: 'change' }
-        ]
+          { required: true, message: "请输入段落内容", trigger: "change" },
+        ],
       };
     }
     setTimeout(() => {
       this.filterHiddenPosition();
     }, 200);
   },
-  mounted() {},
+  mounted() {
+    // console.log("MedicineInfoPgData", this.data);
+  },
   methods: {
     zskgetDict() {
       api
         .zskgetDict()
-        .then(res => {
-          if (res.data.code == '0') {
+        .then((res) => {
+          if (res.data.code == "0") {
             const data = res.data.data;
-            this.positions = data['50'];
-            this.renderPositions(data['50'], data['51']);
+            this.positions = data["50"];
+            this.renderPositions(data["50"], data["51"]);
           }
         })
-        .catch(error => {
+        .catch((error) => {
           console.log(error);
         });
     },
     reOrder(i) {
-      this.$emit('reOrder', i, this.index);
+      this.$emit("reOrder", i, this.index);
     },
-    
+
     // 添加段落
     addEmit() {
-      this.$emit('add');
+      this.$emit("add");
     },
 
     // 删除段落
     delEmit() {
-      this.$emit('del', this.index);
+      this.$emit("del", this.index);
     },
     filterHiddenPosition() {
       const pos = this.data.position;
-      const pArr = this.positions.map(it => {
+      const pArr = this.positions.map((it) => {
         return it.val;
       });
-      const pStr = pArr.join(',');
-      const arr = pos.filter(it => {
+      const pStr = pArr.join(",");
+      const arr = pos.filter((it) => {
         return pStr.indexOf(it) > -1;
       });
       this.data.position = arr;
     },
     // 渲染内容类型
-    renderPositions(data1,data2) {
+    renderPositions(data1, data2) {
       //显示位置枚举列表
-      if (this.showType>0) {
-        data2 = data2.filter(item => item.name == this.showType);
-        let val = data2[0].val.split(',');
-        this.positions = data1.filter(it => {
-          let arr = val.map(v => v);
+      if (this.showType > 0) {
+        data2 = data2.filter((item) => item.name == this.showType);
+        let val = data2[0].val.split(",");
+        this.positions = data1.filter((it) => {
+          let arr = val.map((v) => v);
           return arr.includes(it.val);
         });
       }
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 201 - 158
src/components/icss/case/AddCase.vue

@@ -2,14 +2,18 @@
   <el-scrollbar style="height: 100%" ref="elscrollbar" id="message-container">
     <div class="NoiseTemplateWrapper TemplateWrapper knowledgeWrapper">
       <crumbs
-        :title="'医学术语经典病历维护-'+title"
+        :title="'医学术语经典病历维护-' + title"
         class="topBack"
         :param="$route.params"
         linkTo="ClassicCase"
       ></crumbs>
       <div class="info-container">
         <el-form :rules="rules" :model="form" label-width="160px" ref="groups">
-          <el-form-item v-if="!isEdit" label="选择标准术语:" prop="selectedTerm">
+          <el-form-item
+            v-if="!isEdit"
+            label="选择标准术语:"
+            prop="selectedTerm"
+          >
             <el-select
               v-model="form.selectedTerm"
               filterable
@@ -26,17 +30,30 @@
               :remote-method="searchTerms"
             >
               <el-option
-                v-for="(term,idx) in terms"
+                v-for="(term, idx) in terms"
                 :key="idx"
-                :label="term.name+(term.typeName?'('+term.typeName+')':'')"
+                :label="
+                  term.name + (term.typeName ? '(' + term.typeName + ')' : '')
+                "
                 :value="term"
-                :title="term.name+(term.typeName?'('+term.typeName+')':'')"
+                :title="
+                  term.name + (term.typeName ? '(' + term.typeName + ')' : '')
+                "
               ></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="已选择标准术语:" label-width="160px">{{form.selectedTermName}}</el-form-item>
+          <el-form-item label="已选择标准术语:" label-width="160px">{{
+            form.selectedTermName
+          }}</el-form-item>
           <el-form-item
-            v-if="form.selectedTerm&&(form.typeId==1||form.typeId==3||form.typeId==4||form.typeId==5||form.typeId==6)"
+            v-if="
+              form.selectedTerm &&
+              (form.typeId == 1 ||
+                form.typeId == 3 ||
+                form.typeId == 4 ||
+                form.typeId == 5 ||
+                form.typeId == 6)
+            "
             :label="titleChange"
             prop="titleChange"
             label-width="160px"
@@ -45,8 +62,8 @@
           </el-form-item>
           <p class="line"></p>
           <CaseInfo
-            v-for="(f,i) in form.prags"
-            :key="(i+1)*10000 + showType"
+            v-for="(f, i) in form.prags"
+            :key="(i + 1) * 10000 + showType"
             :data="f"
             :index="i"
             :total="form.prags.length"
@@ -57,7 +74,12 @@
             @reOrder="reOrder"
             :showType="showType"
           ></CaseInfo>
-          <el-form-item v-if="upload" label="标题名称:" prop="fileTitle" label-width="160px">
+          <el-form-item
+            v-if="upload"
+            label="标题名称:"
+            prop="fileTitle"
+            label-width="160px"
+          >
             <el-input v-model="form.fileTitle"></el-input>
           </el-form-item>
           <el-form-item
@@ -84,18 +106,26 @@
               :show-file-list="showFileList"
               :file-list="form.fileList"
             >
-              <el-button size="small" type="primary" v-if="showUpLoad">点击上传</el-button>
+              <el-button size="small" type="primary" v-if="showUpLoad"
+                >点击上传</el-button
+              >
               <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
             </el-upload>
-            <span class="tipInfo" v-show="isShowTip">{{form.fileList[0]&&form.fileList[0].name}}</span>
+            <span class="tipInfo" v-show="isShowTip">{{
+              form.fileList[0] && form.fileList[0].name
+            }}</span>
             <!-- <el-button size="small" type="primary" >点击上传</el-button> -->
           </el-form-item>
           <el-form-item label-width="160px">
-            <div class="uploadInfo" v-if="isSuccessUpload===1">文件上传中,请稍等...</div>
+            <div class="uploadInfo" v-if="isSuccessUpload === 1">
+              文件上传中,请稍等...
+            </div>
           </el-form-item>
         </el-form>
         <div class="btn">
-          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确 定</el-button>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm"
+            >确 定</el-button
+          >
         </div>
       </div>
     </div>
@@ -105,69 +135,69 @@
 /**
  *
  */
-import api from '@api/icss.js';
-import CaseInfo from './CaseInfo';
-import config from '@api/config';
+import api from "@api/icss.js";
+import CaseInfo from "./CaseInfo";
+import config from "@api/config";
 
 export default {
-  name: 'AddCase',
+  name: "AddCase",
   components: {
-    CaseInfo
+    CaseInfo,
   },
   data() {
     return {
       isFixedTop: true,
       isEdit: false,
       isCopy: false,
-      title: '添加',
+      title: "添加",
       termTypes: [],
       terms: [], //术语列表
       form: {
-        conceptId: '', //术语id
+        conceptId: "", //术语id
         isTip: 0, //是否要覆盖,0不覆盖,1覆盖
-        selectedTerm: '', //术语标签
-        termType: '',
-        typeId: '',
-        selectedTermName: '',
-        selectedTermType: '',
+        selectedTerm: "", //术语标签
+        termType: "",
+        typeId: "",
+        selectedTermName: "",
+        selectedTermType: "",
         // titleChange: '',
         fileList: [],
-        name: '',
+        name: "",
         prags: [
           {
             //单个段落相关
-            title: '',
-            content: '',
+            title: "",
+            content: "",
             isReason: 0,
             orderNo: 0,
             position: [],
-            text: ''
-          }
+            text: "",
+          },
         ],
-        fileTitle: '',
-        titleChange: ''
+        fileTitle: "",
+        titleChange: "",
       },
       rules: {
         selectedTerm: [
-          { required: true, message: '请选择术语标签', trigger: 'change' }
+          { required: true, message: "请选择术语标签", trigger: "change" },
         ],
         fileTitle: [
-          { required: true, message: '请输入标题名称', trigger: 'change' },
+          { required: true, message: "请输入标题名称", trigger: "change" },
           {
             validator: (rule, value, callback) => {
               if (value.length > 30) {
-                callback(new Error('标题名称不能超过30字'));
+                callback(new Error("标题名称不能超过30字"));
               } else {
                 callback();
               }
             },
-            trigger: 'change'
-          }
+            trigger: "change",
+          },
         ],
         fileList: [
-          { required: true, message: '请上传文件', trigger: 'change' }
+          { required: true, message: "请上传文件", trigger: "change" },
         ],
-        titleChange: [{ max: 30, message: '标题最多30字', trigger: 'change' }]
+        titleChange: [{ max: 30, message: "标题最多30字", trigger: "change" }],
       },
       saveDisable: false, //保存按钮禁止点击
       showDrop: false, //下拉框显示文字bug1774
@@ -181,7 +211,7 @@ export default {
       showType: -1, // 1 诊断  2  药品   3检验套餐 4检验细项  5检查  6检查子 7手术和操作 8量表 9护理
       editCount: -1, // 页面会否被编辑 >0被编辑   =0 未编辑
       startCount: -1,
-      isSaveSuccess: false // 是否保存成功
+      isSaveSuccess: false, // 是否保存成功
     };
   },
   watch: {
@@ -189,39 +219,39 @@ export default {
       handler(newVal, oldVal) {
         // console.log('newVal============', newVal, 'oldVal============', oldVal);
         if (newVal !== oldVal) {
-          this.form.prags = this.form.prags.map(item => {
+          this.form.prags = this.form.prags.map((item) => {
             return { ...item, position: [] };
           });
         }
-      }
+      },
     },
     form: {
       handler(newName, oldName) {
         this.editCount++;
       },
       deep: true,
-      immediate: true
-    }
+      immediate: true,
+    },
   },
-  created: function() {
-    const { isEdit, data, isCopy } = this.$route.params;   
-    console.log('静态数据???',data)
+  created: function () {
+    const { isEdit, data, isCopy } = this.$route.params;
+    console.log("静态数据???", data);
     if (isEdit || isCopy) {
       this.showType = data.type; // 编辑页确认显示类型
       this.isEdit = isEdit;
       this.isCopy = isCopy;
-      this.title = isEdit ? '修改' : isCopy ? '复制' : '添加';
+      this.title = isEdit ? "修改" : isCopy ? "复制" : "添加";
       isEdit && this.changeWord(data);
       api
         .getTremList({ id: data.id })
-        .then(res => {
-          if (res.data.code == '0') {
+        .then((res) => {
+          console.log("@getTremListDataRes", res.data);
+          if (res.data.code == "0") {
             const data = res.data.data;
             if (this.form.typeId === 82 || this.form.typeId === 83) {
-              // console.log('data',data)
               this.form.fileList =
                 data &&
-                data.map(it => {
+                data.map((it) => {
                   return JSON.parse(it.content);
                 });
               this.showFileList = true;
@@ -233,46 +263,50 @@ export default {
               this.form.titleChange =
                 data.type == 1
                   ? data.clinicalPathwayName
-                  : data.type == 3 || data.type == 4 || data.type == 5||  data.type == 6
+                  : data.type == 3 ||
+                    data.type == 4 ||
+                    data.type == 5 ||
+                    data.type == 6
                   ? data.noticeName
-                  : '';
+                  : "";
               this.form.selectedTermName =
-                data.name + (data.typeName ? '(' + data.typeName + ')' : '');
+                data.name + (data.typeName ? "(" + data.typeName + ")" : "");
               this.form.selectedTerm =
-                data.name + (data.typeName ? '(' + data.typeName + ')' : '');
-              if(data &&data.details&&data.details.length===0){   //量表有评估内容没有静态知识的情况
-                  this.form.prags =[
-                      {
-                          title: '',
-                          content: '',
-                          isReason: 0,
-                          orderNo: 0,
-                          position: [],
-                          text: ''
-                      }
-                  ];
-                  return;
+                data.name + (data.typeName ? "(" + data.typeName + ")" : "");
+              if (data && data.details && data.details.length === 0) {
+                //量表有评估内容没有静态知识的情况
+                this.form.prags = [
+                  {
+                    title: "",
+                    content: "",
+                    isReason: 0,
+                    orderNo: 0,
+                    position: [],
+                    text: "",
+                  },
+                ];
+                return;
               }
               this.form.prags =
                 data &&
-                data.details.map(it => {
+                data.details.map((it) => {
                   return {
                     title: it.title,
-                    position: (it.contentType||'').split(","),
+                    position: (it.contentType || "").split(","),
                     content: it.content.replace(
                       /{imageUrlPrefix}/g,
                       config.imgHost
                     ),
                     // isReason:it.isReason,
                     text: it.text,
-                    disabled: true
+                    disabled: true,
                   };
                 });
             }
           }
         })
-        .catch(error => {
-          if (error.code === '900010001') {
+        .catch((error) => {
+          if (error.code === "900010001") {
             return false;
           }
           console.log(error);
@@ -312,12 +346,12 @@ export default {
     // }
 
     if (this.startCount !== this.editCount && !this.isSaveSuccess) {
-      this.$confirm('还有未保存的内容,确定要退出当前页面吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        cancelButtonClass: 'leaveBtn',
-        customClass: 'leaveBox',
-        type: 'warning'
+      this.$confirm("还有未保存的内容,确定要退出当前页面吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leaveBtn",
+        customClass: "leaveBox",
+        type: "warning",
       })
         .then(() => {
           next();
@@ -329,9 +363,9 @@ export default {
   },
   methods: {
     handleClear() {
-      this.form.selectedTermName = '';
-      this.form.selectedTerm = '';
-      this.form.titleChange = '';
+      this.form.selectedTermName = "";
+      this.form.selectedTerm = "";
+      this.form.titleChange = "";
       // console.log('处理清空的操作');
     },
 
@@ -348,20 +382,21 @@ export default {
       const name = newVal.name;
       const typeName = newVal.typeName;
       const type = newVal.type;
-      this.form.selectedTermName = name + (typeName ? '(' + typeName + ')' : '');
+      this.form.selectedTermName =
+        name + (typeName ? "(" + typeName + ")" : "");
       // this.form.selectedTerm = name + (typeName ? '(' + typeName + ')' : '');
       this.form.name = name;
       this.form.fileList = [];
       this.showFileList = false;
-      this.form.typeId = type || '';
+      this.form.typeId = type || "";
       this.showUpLoad = true;
       this.titleChange =
         type == 1
-          ? '临床路径标题:'
+          ? "临床路径标题:"
           : type == 3 || type == 4 || type == 5 || type == 6
-          ? '注意事项标题:'
-          : '';
-      this.form.fileTitle = '';
+          ? "注意事项标题:"
+          : "";
+      this.form.fileTitle = "";
       if (newVal.typeId === 82 || newVal.typeId === 83) {
         this.upload = true;
         this.form.fileTitle = newVal.title;
@@ -376,12 +411,12 @@ export default {
     },
     reOrder(isUp, i) {
       // isUp: 1 上升    0 下降
-      let div = this.$refs['elscrollbar'].$refs['wrap'];
+      let div = this.$refs["elscrollbar"].$refs["wrap"];
       let temp = {},
         it = {};
       if (isUp === 1) {
         if (i === 0) {
-          this.warning('已经是第一个,不能再升啦!');
+          this.warning("已经是第一个,不能再升啦!");
           return;
         }
         temp = Object.assign(this.form.prags[i - 1]);
@@ -392,7 +427,7 @@ export default {
         });
       } else {
         if (i === this.form.prags.length - 1) {
-          this.warning('已经是最后一个,不能再降啦!');
+          this.warning("已经是最后一个,不能再降啦!");
           return;
         }
         temp = Object.assign(this.form.prags[i + 1]);
@@ -403,25 +438,25 @@ export default {
     // 添加段落
     addParagraph(i) {
       this.form.prags.splice(i + 1, 0, {
-        title: '',
-        content: '',
+        title: "",
+        content: "",
         isReason: 0,
         position: [],
-        text: ''
+        text: "",
       });
       //添加段落光标自动落到新增的段落中
       setTimeout(() => {
         this.$refs.subForm[i + 1].$el
-          .getElementsByClassName('el-input__inner')[0]
+          .getElementsByClassName("el-input__inner")[0]
           .focus();
       });
     },
     delParagraph(i) {
       if (this.form.prags.length == 1) {
-        this.warning('只剩一个段落,不能再删啦!');
+        this.warning("只剩一个段落,不能再删啦!");
         return;
       }
-      this.showConfirmDialog('确定要删除该段落?', () => {
+      this.showConfirmDialog("确定要删除该段落?", () => {
         this.form.prags.splice(i, 1);
       });
     },
@@ -435,52 +470,57 @@ export default {
       }
       //搜索术语列表
       this.showDrop = true;
-      api.classicCaseBaseInfo({ inputStr: query.trim(), types: [0] }).then(res => {
-        this.showDrop = false;
-        if (res.data.code === '0') {
-          this.terms = res.data.data;
-        } else {
-          this.warning('数据获取失败');
-        }
-      });
+      api
+        .classicCaseBaseInfo({ inputStr: query.trim(), types: [0] })
+        .then((res) => {
+          this.showDrop = false;
+          if (res.data.code === "0") {
+            this.terms = res.data.data;
+          } else {
+            this.warning("数据获取失败");
+          }
+        });
     },
     mapStringToNum(str) {
-      return str.split(',').map(it => {
+      return str.split(",").map((it) => {
         return +it;
       });
     },
 
     // 额外的表单检验
     formVal() {
-      let positiontemp = this.form.prags.map(item => {
+      let positiontemp = this.form.prags.map((item) => {
         return [...item.position];
       });
-      let positionArr = positiontemp.reduce(function(a, b) {
+      let positionArr = positiontemp.reduce(function (a, b) {
         return a.concat(b);
       }); // 所有被选中的值集合
       // console.log(positionArr, 'positionArr');
       // console.log(this.showType, '当前页的显示类型');
-      let isVisFlag = positionArr.some(item => item === 2);
-      let isDiagFlag = positionArr.some(item => item === 3);
+      let isVisFlag = positionArr.some((item) => item === 2);
+      let isDiagFlag = positionArr.some((item) => item === 3);
       // console.log(isVisFlag, 'isVisFlag');
       if (
-        (this.showType == 3 || this.showType == 4 || this.showType == 5|| this.showType == 6) &&
+        (this.showType == 3 ||
+          this.showType == 4 ||
+          this.showType == 5 ||
+          this.showType == 6) &&
         isVisFlag
       ) {
         //若医学术语为检验/检查,且内容类型选择了注意事项,此时“注意事项标题”是必填项
         this.$refs.groups.clearValidate();
         this.rules.titleChange.push({
           required: true,
-          message: '请输入注意事项标题',
-          trigger: 'change'
+          message: "请输入注意事项标题",
+          trigger: "change",
         });
-        this.$refs.groups.validateField('titleChange');
+        this.$refs.groups.validateField("titleChange");
         this.rules.titleChange = this.rules.titleChange.slice(0, 1);
-        if (this.form.titleChange.trim() !== '') {
+        if (this.form.titleChange.trim() !== "") {
           // console.log('内容不为空');
           return true;
         } else {
-          var div = this.$refs['elscrollbar'].$refs['wrap'];
+          var div = this.$refs["elscrollbar"].$refs["wrap"];
           this.$nextTick(() => {
             div.scrollTop = 0;
           });
@@ -492,17 +532,17 @@ export default {
         this.$refs.groups.clearValidate();
         this.rules.titleChange.push({
           required: true,
-          message: '请输入临床路径标题',
-          trigger: 'change'
+          message: "请输入临床路径标题",
+          trigger: "change",
         });
-        this.$refs.groups.validateField('titleChange');
+        this.$refs.groups.validateField("titleChange");
         this.rules.titleChange = this.rules.titleChange.slice(0, 1);
 
-        if (this.form.titleChange.trim() !== '') {
+        if (this.form.titleChange.trim() !== "") {
           // console.log('内容不为空');
           return true;
         } else {
-          var div = this.$refs['elscrollbar'].$refs['wrap'];
+          var div = this.$refs["elscrollbar"].$refs["wrap"];
           this.$nextTick(() => {
             div.scrollTop = 0;
           });
@@ -513,7 +553,7 @@ export default {
 
     submitForm() {
       if (this.isSuccessUpload === 1) {
-        this.warning('文件上传中,请稍等');
+        this.warning("文件上传中,请稍等");
         return;
       }
       let flagVal = this.formVal(); // 额外的表单校验
@@ -522,7 +562,7 @@ export default {
       let goOn = true,
         it = null;
       let outIsVia = true; // 外层验证是否通过
-      this.$refs.groups.validate(valid => {
+      this.$refs.groups.validate((valid) => {
         if (!valid) {
           goOn = false;
           outIsVia = false;
@@ -536,7 +576,7 @@ export default {
         for (let i = 0; i < this.$refs.subForm.length; i++) {
           it = this.$refs.subForm[i];
           viewHeight += it.$el.offsetHeight;
-          it.$refs.form.validate(valid => {
+          it.$refs.form.validate((valid) => {
             if (!valid) {
               goOn = false;
               viewHeightArr.push(viewHeight);
@@ -546,7 +586,7 @@ export default {
       }
       // console.log(viewHeightArr,'viewHeightArr');
       if (!goOn) {
-        var div = this.$refs['elscrollbar'].$refs['wrap'];
+        var div = this.$refs["elscrollbar"].$refs["wrap"];
         if (outIsVia) {
           // 外层校验通过,跳转至下层校验具体位置
           this.$nextTick(() => {
@@ -565,18 +605,18 @@ export default {
       let param = [];
       if (this.form.typeId === 82 || this.form.typeId === 83) {
         if (this.form.fileList.length === 0) {
-          this.warning('文件未上传,不存储数据');
+          this.warning("文件未上传,不存储数据");
           return;
         }
         param.push(
           Object.assign(
             {},
             {
-              position: this.form.typeId === 82 ? '8' : '9',
+              position: this.form.typeId === 82 ? "8" : "9",
               conceptId: this.form.conceptId,
               title: this.form.fileTitle,
               orderNo: 0,
-              content: JSON.stringify(this.form.fileList[0])
+              content: JSON.stringify(this.form.fileList[0]),
             }
           )
         );
@@ -592,13 +632,16 @@ export default {
           obj.conceptId = data[i].conceptId;
           obj.orderNo = i;
           obj.title = data[i].title;
-          obj.contentType = data[i].position.join(',');
+          obj.contentType = data[i].position.join(",");
           tempArr.push(obj);
         }
-        paramsAll.clinicalPathwayName = types == 1 ? this.form.titleChange : '';
+        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.noticeName =
+          types == 3 || types == 4 || types == 5 || types == 6
+            ? this.form.titleChange
+            : "";
         paramsAll.type = this.form.typeId;
         paramsAll.details = tempArr;
         param = paramsAll;
@@ -627,25 +670,25 @@ export default {
     sendSaveOrEdit(param) {
       api
         .saveOrUpdateCase(param)
-        .then(res => {
-          if (res.data.code === '0') {
+        .then((res) => {
+          if (res.data.code === "0") {
             this.isSuccessUpload = 0; // 修改文件上传状态为0
-            this.warning(res.data.msg || '保存成功', 'success');
+            this.warning(res.data.msg || "保存成功", "success");
             this.isSaveSuccess = true; // 保存成功,可正常退出
             //返回带搜索条件的首页
             this.$router.push({
-              name: 'ClassicCase',
+              name: "ClassicCase",
               params: Object.assign({}, this.$route.params, {
-                currentPage: 1
-              })
+                currentPage: 1,
+              }),
             });
           } else {
             this.warning(res.data.msg);
           }
           this.saveDisable = false;
         })
-        .catch(err => {
-          if (err.code === '900010001') {
+        .catch((err) => {
+          if (err.code === "900010001") {
             return false;
           }
           this.saveDisable = false;
@@ -655,13 +698,13 @@ export default {
 
     // 弹出窗
     showConfirmDialog(msg, resolve) {
-      this.$confirm(msg, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        cancelButtonClass: 'cancel',
-        confirmButtonClass: 'confirmBtn',
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancel",
+        confirmButtonClass: "confirmBtn",
         dangerouslyUseHTMLString: true,
-        type: 'warning'
+        type: "warning",
       })
         .then(() => {
           resolve();
@@ -672,8 +715,8 @@ export default {
       this.$message({
         showClose: true,
         message: msg,
-        type: type || 'warning',
-        duration:1000
+        type: type || "warning",
+        duration: 1000,
       });
     },
     handleChange(file, fileList) {
@@ -687,13 +730,13 @@ export default {
       // console.log(fileList,this.form.fileList,'aa')
     },
     handleSuccess(response, file, fileList) {
-      if (response.code == '0') {
+      if (response.code == "0") {
         this.showFileList = true;
         this.form.fileList = [];
         this.form.fileList.push({
           name: response.data.title,
           url: response.data.url,
-          size: response.data.size
+          size: response.data.size,
         });
         this.showUpLoad = false;
         if (!this.form.fileTitle) {
@@ -702,7 +745,7 @@ export default {
         this.isSuccessUpload = 2; // 上传成功状态
         this.$refs.upload && this.$refs.upload.clearValidate(); // 清除校验
       } else {
-        this.warning(response.msg || '上传失败');
+        this.warning(response.msg || "上传失败");
         // this.form.fileList = []
         this.showUpLoad = true;
         this.showFileList = false;
@@ -722,7 +765,7 @@ export default {
 
       this.showUpLoad = false;
       if (file.size / 1024 / 1024 >= 500) {
-        this.warning('文件上传失败,超出大小限制500MB');
+        this.warning("文件上传失败,超出大小限制500MB");
         this.form.fileList = [];
         this.showConfirm = false;
         return false;
@@ -733,16 +776,16 @@ export default {
     handlePreview(file) {},
     beforeRemove(file, fileList) {
       if (this.showConfirm) {
-        return this.$confirm(`确定移除 ${file.name}?`, '', {
-          cancelButtonClass: 'cacelBtn'
+        return this.$confirm(`确定移除 ${file.name}?`, "", {
+          cancelButtonClass: "cacelBtn",
         });
       }
-    }
-  }
+    },
+  },
 };
 </script>
 <style lang="less">
-@import '../../../less/common.less';
+@import "../../../less/common.less";
 .cell .el-button.delete:focus {
   color: red !important;
 }
@@ -822,7 +865,7 @@ export default {
   font-size: 14px;
 }
 .tipInfo:before {
-  content: '';
+  content: "";
   display: block;
   position: absolute;
   // bottom: 9px;

+ 83 - 72
src/components/icss/case/CaseInfo.vue

@@ -16,7 +16,7 @@
     <el-form-item label="段落标题:" prop="title" label-width="160px">
       <el-input v-model="data.title"></el-input>
     </el-form-item>
-    
+
     <el-form-item label="内容" prop="content" label-width="160px" ref="editor">
       <quillEditor
         v-model="data.content"
@@ -26,8 +26,18 @@
       ></quillEditor>
     </el-form-item>
     <div class="order-btn">
-      <a v-if="index!==0" :class="index===total-1?'order-spc':'order-up'" @click="reOrder(1)">上升</a>
-      <a v-if="index!==total-1" :class="index===0?'order-spc':'order-down'" @click="reOrder(0)">下降</a>
+      <a
+        v-if="index !== 0"
+        :class="index === total - 1 ? 'order-spc' : 'order-up'"
+        @click="reOrder(1)"
+        >上升</a
+      >
+      <a
+        v-if="index !== total - 1"
+        :class="index === 0 ? 'order-spc' : 'order-down'"
+        @click="reOrder(0)"
+        >下降</a
+      >
     </div>
     <el-form-item label-width="160px" class="btns">
       <el-button @click="addEmit">添加段落</el-button>
@@ -37,181 +47,182 @@
 </template>
 
 <script>
-import 'quill/dist/quill.core.css';
-import 'quill/dist/quill.snow.css';
-import 'quill/dist/quill.bubble.css';
-import { quillEditor, Quill } from 'vue-quill-editor';
-import config from '@api/config';
-import api from '@api/knowledgeLib.js';
-import { container, ImageExtend, QuillWatch } from 'quill-image-extend-module';
-Quill.register('modules/ImageExtend', ImageExtend);
+import "quill/dist/quill.core.css";
+import "quill/dist/quill.snow.css";
+import "quill/dist/quill.bubble.css";
+import { quillEditor, Quill } from "vue-quill-editor";
+import config from "@api/config";
+import api from "@api/knowledgeLib.js";
+import { container, ImageExtend, QuillWatch } from "quill-image-extend-module";
+Quill.register("modules/ImageExtend", ImageExtend);
 export default {
-  props: ['data', 'index', 'isEdit', 'total', 'showType'],
-  name: 'MedicineInfoParagraph',
+  props: ["data", "index", "isEdit", "total", "showType"],
+  name: "MedicineInfoParagraph",
   components: {
-    quillEditor
+    quillEditor,
   },
   data() {
     return {
       toolbars: [
         [
-          ['bold', 'underline', 'strike'],
-          [{ list: 'ordered' }, { list: 'bullet' }],
-          [{ script: 'sub' }, { script: 'super' }],
+          ["bold", "underline", "strike"],
+          [{ list: "ordered" }, { list: "bullet" }],
+          [{ script: "sub" }, { script: "super" }],
           [{ color: [] }, { background: [] }],
           [{ align: [] }],
-          ['image']
-        ]
+          ["image"],
+        ],
       ],
       toolbarMode: 0,
       editorOption: {
         modules: {
           ImageExtend: {
             loading: true,
-            name: 'upfile',
+            name: "upfile",
             size: 1,
             sizeError: () => {
               this.$message({
                 showClose: true,
-                message: '请上传 1M 以内的图片!',
-                type: 'warning'
+                message: "请上传 1M 以内的图片!",
+                type: "warning",
               });
             },
             action: config.urls.promptServer,
-            response: res => {
-              if (res.code == '0') {
+            response: (res) => {
+              if (res.code == "0") {
                 return config.imgHost + res.data.url;
               } else {
                 this.$message({
                   showClose: true,
                   message: res.msg,
-                  type: 'warning'
+                  type: "warning",
                 });
               }
-            }
+            },
           },
           toolbar: {
             container: container,
             handlers: {
-              image: function() {
+              image: function () {
                 QuillWatch.emit(this.quill.id);
-              }
-            }
-          }
-        }
+              },
+            },
+          },
+        },
       },
       form: {
         position: [],
-        orderNo: 0
+        orderNo: 0,
       },
       positions: [], //位置列表
-      rules: {}
+      rules: {},
     };
   },
   watch: {
-    'data.content': function() {
-      if (this.data.content !== '') {
+    "data.content": function () {
+      if (this.data.content !== "") {
         this.$refs.editor && this.$refs.editor.clearValidate(); // 清除校验
       }
-      if (this.data.content === '') {
+      if (this.data.content === "") {
         // console.log('内容为空');
-        this.$refs['form'].validateField('content'); // 手动校验
+        this.$refs["form"].validateField("content"); // 手动校验
       }
       this.data.text = this.$refs.quillEditor.quill.root.innerText;
-    }
+    },
   },
   created() {
     // console.log(this.showType, 'showType','需要显示的类型');
-    this.editorOption.modules.toolbar.container = this.toolbars[
-      this.toolbarMode
-    ];
+    this.editorOption.modules.toolbar.container =
+      this.toolbars[this.toolbarMode];
     this.zskgetDict();
     if (this.isEdit) {
       setTimeout(() => {
         this.rules = {
           position: [
-            { required: true, message: '请选择内容类型', trigger: 'change' }
+            { required: true, message: "请选择内容类型", trigger: "change" },
           ],
           title: [
-            { required: true, message: '请输入段落标题', trigger: 'change' },
-            { max: 30, message: '标题名称不能超过30字', trigger: 'change' }
+            { required: true, message: "请输入段落标题", trigger: "change" },
+            { max: 30, message: "标题名称不能超过30字", trigger: "change" },
           ],
           content: [
-            { required: true, message: '请输入段落内容', trigger: 'change' }
-          ]
+            { required: true, message: "请输入段落内容", trigger: "change" },
+          ],
         };
       }, 100);
     } else {
       this.rules = {
         position: [
-          { required: true, message: '请选择内容类型', trigger: 'change' }
+          { required: true, message: "请选择内容类型", trigger: "change" },
         ],
         title: [
-          { required: true, message: '请输入段落标题', trigger: 'change' },
-          { max: 30, message: '标题名称不能超过30字', trigger: 'change' }
+          { required: true, message: "请输入段落标题", trigger: "change" },
+          { max: 30, message: "标题名称不能超过30字", trigger: "change" },
         ],
         content: [
-          { required: true, message: '请输入段落内容', trigger: 'change' }
-        ]
+          { required: true, message: "请输入段落内容", trigger: "change" },
+        ],
       };
     }
     setTimeout(() => {
       this.filterHiddenPosition();
     }, 200);
   },
-  mounted() {},
+  mounted() {
+    console.log("caseInfo", this.data);
+  },
   methods: {
     zskgetDict() {
       api
         .zskgetDict()
-        .then(res => {
-          if (res.data.code == '0') {
+        .then((res) => {
+          if (res.data.code == "0") {
             const data = res.data.data;
-            this.positions = data['50'];
-            this.renderPositions(data['50'], data['51']);
+            this.positions = data["50"];
+            this.renderPositions(data["50"], data["51"]);
           }
         })
-        .catch(error => {
+        .catch((error) => {
           console.log(error);
         });
     },
     reOrder(i) {
-      this.$emit('reOrder', i, this.index);
+      this.$emit("reOrder", i, this.index);
     },
-    
+
     // 添加段落
     addEmit() {
-      this.$emit('add');
+      this.$emit("add");
     },
 
     // 删除段落
     delEmit() {
-      this.$emit('del', this.index);
+      this.$emit("del", this.index);
     },
     filterHiddenPosition() {
       const pos = this.data.position;
-      const pArr = this.positions.map(it => {
+      const pArr = this.positions.map((it) => {
         return it.val;
       });
-      const pStr = pArr.join(',');
-      const arr = pos.filter(it => {
+      const pStr = pArr.join(",");
+      const arr = pos.filter((it) => {
         return pStr.indexOf(it) > -1;
       });
       this.data.position = arr;
     },
     // 渲染内容类型
-    renderPositions(data1,data2) {
+    renderPositions(data1, data2) {
       //显示位置枚举列表
-      if (this.showType>0) {
-        data2 = data2.filter(item => item.name == this.showType);
-        let val = data2[0].val.split(',');
-        this.positions = data1.filter(it => {
-          let arr = val.map(v => v);
+      if (this.showType > 0) {
+        data2 = data2.filter((item) => item.name == this.showType);
+        let val = data2[0].val.split(",");
+        this.positions = data1.filter((it) => {
+          let arr = val.map((v) => v);
           return arr.includes(it.val);
         });
       }
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 139 - 77
src/components/icss/case/ClassicCase.vue

@@ -3,7 +3,12 @@
     <crumbs title="经典病例维护">
       <el-form :inline="true" class="demo-form-inline">
         <el-form-item label="标准术语归类:">
-          <el-select size="mini" v-model="filter.libType" placeholder="标准术语归类" clearable>
+          <el-select
+            size="mini"
+            v-model="filter.libType"
+            placeholder="标准术语归类"
+            clearable
+          >
             <!--typeList api相关-->
             <el-option
               v-for="item in typeList"
@@ -14,11 +19,26 @@
           </el-select>
         </el-form-item>
         <el-form-item label="医学标准术语:">
-          <el-input size="mini" v-model="filter.term" placeholder="请输入术语" clearable></el-input>
+          <el-input
+            size="mini"
+            v-model="filter.term"
+            placeholder="请输入术语"
+            clearable
+          ></el-input>
         </el-form-item>
         <el-form-item label="状态:">
-          <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
+            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>
         </el-form-item>
         <el-form-item>
@@ -27,49 +47,88 @@
           <el-button
             size="mini"
             type="warning"
-            style="margin:0 10px"
+            style="margin: 0 10px"
             @click="addMedicalPrompt"
-          >添加经典病例</el-button>
+            >添加经典病例</el-button
+          >
         </el-form-item>
       </el-form>
     </crumbs>
     <div class="contents">
       <el-table :data="list" border style="width: 100%">
-        <el-table-column type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
-        <el-table-column prop="name" width="150" label="医学标准术语"></el-table-column>
-        <el-table-column prop="typeName" label="标准术语归类" width="120"></el-table-column>
-        <el-table-column prop="title" label="关联标题" width="240"></el-table-column>
+        <el-table-column
+          type="index"
+          :index="indexMethod"
+          label="编号"
+          width="60"
+        ></el-table-column>
+        <el-table-column
+          prop="name"
+          width="150"
+          label="医学标准术语"
+        ></el-table-column>
+        <el-table-column
+          prop="typeName"
+          label="标准术语归类"
+          width="120"
+        ></el-table-column>
+        <el-table-column
+          prop="title"
+          label="关联标题"
+          width="240"
+        ></el-table-column>
         <el-table-column label="状态">
           <template slot-scope="scope">
-            <span v-if="scope.row.isDeleted=='N'">启用</span>
-            <span v-if="scope.row.isDeleted=='Y'" class="delete">禁用</span>
+            <span v-if="scope.row.isDeleted == 'N'">启用</span>
+            <span v-if="scope.row.isDeleted == 'Y'" class="delete">禁用</span>
           </template>
         </el-table-column>
-        <el-table-column prop="modifier" label="操作人" width="80"></el-table-column>
-        <el-table-column prop="gmtModified" label="操作时间" width="180" :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column
+          prop="modifier"
+          label="操作人"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          prop="gmtModified"
+          label="操作时间"
+          width="180"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
         <el-table-column label="操作" width="140">
           <!--4个点击事件-->
           <template slot-scope="scope">
             <!-- <el-button v-if="scope.row.isDeleted=='Y'" type="text" size="small" class="is-disabled">修改</el-button> -->
-            <el-button type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
-            <span style="margin:0 3px;">|</span>
+            <el-button
+              type="text"
+              size="small"
+              @click="toEditProduct(scope.row)"
+              >修改</el-button
+            >
+            <span style="margin: 0 3px">|</span>
             <!-- <el-button v-if="scope.row.isDeleted=='Y' || scope.row.typeId === 82 || scope.row.typeId === 83" type="text" size="small" class="is-disabled">复制</el-button> -->
             <!-- <el-button v-if="scope.row.isDeleted=='N'&&scope.row.typeId !== 82 && scope.row.typeId !== 83" type="text" size="small" @click="toCopyProduct(scope.row)">复制</el-button> -->
-            <el-button type="text" size="small" @click="toCopyProduct(scope.row)">复制</el-button>
-            <span style="margin:0 3px;">|</span>
             <el-button
-              v-if="scope.row.isDeleted=='Y'"
+              type="text"
+              size="small"
+              @click="toCopyProduct(scope.row)"
+              >复制</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              v-if="scope.row.isDeleted == 'Y'"
               type="text"
               size="small"
               @click="showReuseDialog(scope.row)"
-            >启用</el-button>
+              >启用</el-button
+            >
             <el-button
-              v-if="scope.row.isDeleted=='N'"
+              v-if="scope.row.isDeleted == 'N'"
               type="text"
               size="small"
               class="delete"
               @click="showDelDialog(scope.row)"
-            >禁用</el-button>
+              >禁用</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -88,13 +147,13 @@
 </template>
 
 <script>
-import api from '@api/icss.js';
-import config from '@api/config.js';
-import utils from '@api/utils.js';
+import api from "@api/icss.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
 
 export default {
-  name: 'ClassicCase',
-  data: function() {
+  name: "ClassicCase",
+  data: function () {
     return {
       list: [],
       cacheData: {},
@@ -107,16 +166,16 @@ export default {
       pays: [],
       typeList: [],
       stateList: [
-        { id: 'N', name: '启用' },
-        { id: 'Y', name: '禁用' }
+        { id: "N", name: "启用" },
+        { id: "Y", name: "禁用" },
       ],
       searched: false,
       filter: {
-        term: '',
-        title: '',
-        status: '',
-        libType: ''
-      }
+        term: "",
+        title: "",
+        status: "",
+        libType: "",
+      },
     };
   },
   created() {
@@ -135,11 +194,11 @@ export default {
   },
   watch: {
     filter: {
-      handler: function() {
+      handler: function () {
         this.searched = false;
       },
-      deep: true
-    }
+      deep: true,
+    },
   },
   // beforeRouteEnter(to, from, next){
   //   next(vm => {
@@ -163,35 +222,38 @@ export default {
         ? {
             currentPage: this.currentPage,
             pageSize: this.pageSize,
-            filter: this.filter
+            filter: this.filter,
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-      this.$router.push({ name: 'AddCase', params: pam });
+      this.$router.push({ name: "AddCase", params: pam });
+      console.log("addMedicalPrompt", pam);
     },
     toEditProduct(row) {
       const pam = this.searched
         ? {
             currentPage: this.currentPage,
             pageSize: this.pageSize,
-            filter: this.filter
+            filter: this.filter,
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
       this.$router.push({
-        name: 'AddCase',
-        params: Object.assign(pam, { data: row, isEdit: true })
+        name: "AddCase",
+        params: Object.assign(pam, { data: row, isEdit: true }),
       });
+      console.log("toEditProduct", pam);
+      console.log("toEditProductList", this.list);
     },
     toCopyProduct(row) {
       const pam = this.searched
         ? {
             currentPage: this.currentPage,
             pageSize: this.pageSize,
-            filter: this.filter
+            filter: this.filter,
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
       this.$router.push({
-        name: 'AddClassicCase',
-        params: Object.assign(pam, { data: row, isCopy: true })
+        name: "AddClassicCase",
+        params: Object.assign(pam, { data: row, isCopy: true }),
       });
     },
     filterDatas() {
@@ -199,10 +261,10 @@ export default {
       this.getDataList();
     },
     getDicList() {
-      api.getDicList().then(res => {
+      api.getDicList().then((res) => {
         // console.log(res, '字典类型');
-        if (res.data.code === '0') {
-          this.typeList = res.data.data && res.data.data['10'];
+        if (res.data.code === "0") {
+          this.typeList = res.data.data && res.data.data["10"];
           // console.log(this.typeList,'this.typeList');
         }
       });
@@ -212,22 +274,22 @@ export default {
       this.searched = true;
       const loading = this.$loading({
         lock: true,
-        text: 'Loading',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.7)'
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
       });
       api
         .getClassicCasePage(param)
-        .then(res => {
+        .then((res) => {
           loading.close();
-          if (res.data.code == '0') {
+          if (res.data.code == "0") {
             const data = res.data.data;
             let templis = data.records;
             this.list = templis;
             this.cacheData[param.current] = data.records;
             this.total = data.total;
             for (let i = 0; i < templis.length; i++) {
-              templis[i].isDeleted = templis[i].status == '1' ? 'N' : 'Y';
+              templis[i].isDeleted = templis[i].status == "1" ? "N" : "Y";
             }
             if (this.inCurrentPage !== undefined) {
               this.currentPage = this.inCurrentPage;
@@ -235,16 +297,16 @@ export default {
             }
           }
         })
-        .catch(error => {
+        .catch((error) => {
           console.log(error);
         });
     },
     clearFilter() {
       this.filter = {
-        term: '',
-        title: '',
-        status: '',
-        libType: ''
+        term: "",
+        title: "",
+        status: "",
+        libType: "",
       };
     },
     getFilterItems(isTurnPage) {
@@ -257,8 +319,8 @@ export default {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
         status:
-          this.filter.status == 'Y' ? 0 : this.filter.status == 'N' ? 1 : '',
-        type: this.filter.libType || ''
+          this.filter.status == "Y" ? 0 : this.filter.status == "N" ? 1 : "",
+        type: this.filter.libType || "",
         //type:11
       };
       return param;
@@ -278,16 +340,16 @@ export default {
       this.$message({
         showClose: true,
         message: msg,
-        type: type || 'warning'
+        type: type || "warning",
       });
     },
     showConfirmDialog(msg, resolve) {
-      this.$confirm(msg, '提示', {
-        confirmButtonText: '确定',
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "确定",
         showCancelButton: false,
         // cancelButtonText: '取消',
         // cancelButtonClass:'cancel',
-        type: 'warning'
+        type: "warning",
       })
         .then(() => {
           resolve();
@@ -295,45 +357,45 @@ export default {
         .catch(() => {});
     },
     showDelDialog(row) {
-      this.showConfirmDialog('是否禁用该经典病例?', () => {
+      this.showConfirmDialog("是否禁用该经典病例?", () => {
         api
           .changeCaseStatus({ id: row.id, status: 0 })
-          .then(res => {
-            if (res.data.code == '0') {
+          .then((res) => {
+            if (res.data.code == "0") {
               if (!this.searched) {
                 //未点确认时清空搜索条件
                 this.clearFilter();
               }
-              this.warning(res.data.msg || '操作成功', 'success');
+              this.warning(res.data.msg || "操作成功", "success");
               this.getDataList();
             } else {
               this.warning(res.data.msg);
             }
           })
-          .catch(error => {
+          .catch((error) => {
             this.warning(error);
           });
       });
     },
     showReuseDialog(row) {
-      this.showConfirmDialog('是否重新启用该条数据?', () => {
+      this.showConfirmDialog("是否重新启用该条数据?", () => {
         api
           .changeCaseStatus({ id: row.id, status: 1 })
-          .then(res => {
-            if (res.data.code == '0') {
+          .then((res) => {
+            if (res.data.code == "0") {
               this.currentPage = 1; //恢复数据跳转到筛选条件下首页
-              this.warning(res.data.msg || '操作成功', 'success');
+              this.warning(res.data.msg || "操作成功", "success");
               this.getDataList();
             } else {
               this.warning(res.data.msg);
             }
           })
-          .catch(error => {
+          .catch((error) => {
             this.warning(error);
           });
       });
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 25 - 10
src/components/knowledgeExtra/DiagCheckRule.vue

@@ -58,11 +58,13 @@
         <ux-table-column field="baseType" title="基础规则类型">
           <template slot-scope="scope">
             {{ transDataMap(baseTypeList)[scope.row.baseType] }}
+            <!-- {{ scope.row.baseType }} -->
           </template>
         </ux-table-column>
-        <ux-table-column prop="baseLibType" title="基础规则术语类型">
+        <ux-table-column field="baseLibType" title="基础规则术语类型">
           <template slot-scope="scope">
             {{ transDataMap(baseTermTypeList)[scope.row.baseLibType] }}
+            <!-- {{ scope.row.baseLibType }} -->
           </template>
         </ux-table-column>
         <ux-table-column
@@ -116,6 +118,7 @@
 
 <script>
 import api from "@api/knowledgeLib.js";
+import { isArray } from "jquery";
 export default {
   name: "CheckRule",
   data: function () {
@@ -131,21 +134,30 @@ export default {
     };
   },
   computed: {
-    baseTermTypeName() {
-      const item = this.baseTermTypeList.filter((it) => {
-        return it.val === this.filterp.baseLibType;
-      });
-      return item[0] ? item[0].name : "";
+    baseTermTypeName: function () {
+      if (isArray(this.baseTermTypeList)) {
+        const item = this.baseTermTypeList.filter((it) => {
+          return it.val === this.filterp.baseLibType;
+        });
+        return item[0] ? item[0].name : "";
+      } else {
+        return "";
+      }
     },
   },
   created() {
     this.baseTermTypeList2 = this.baseTermTypeList;
+    // console.log(this.baseTermTypeList2);
     this.filter.baseLibName = this.baseLibName;
     this.filter.baseLibType = this.baseLibType;
   },
   mounted() {
     this.$refs.plxTable.reloadData(this.rulelist);
+    console.log("rulelist", this.rulelist, this.baseTermTypeList);
     //this.loading.close();
+    // this.baseTermTypeList2 = this.baseTermTypeList;
+    // this.filter.baseLibName = this.baseLibName;
+    // this.filter.baseLibType = this.baseLibType;
   },
   props: [
     "loading",
@@ -162,14 +174,17 @@ export default {
   ],
   methods: {
     transDataMap(data) {
+      // console.log("transDataMap", data);
       const obj = {};
-      data.map((it) => {
-        obj[it.val] = it.name;
-      });
+      if (isArray(data)) {
+        data.map((it) => {
+          obj[it.val] = it.name;
+        });
+      }
       return obj;
     },
     getRuleDetail() {
-      console.log(456);
+      console.log(getRuleDetail);
       const param = {
         baseLibName: this.filter.baseLibName,
         baseLibType: this.filter.baseLibType,

+ 7 - 3
src/components/knowledgeExtra/RuleCheck.vue

@@ -227,11 +227,13 @@ export default {
             this.ruleTermTypeList = data[-102];
             this.baseTypeList = data[-103];
             this.baseTermTypeList = data[-104];
+            console.log("getDic", data);
           }
         })
         .catch((error) => {
           console.log(error);
         });
+      console.log(this.baseTermTypeList, this.baseTypeList);
     },
     statusTrans(type) {
       const obj = this.ruleTypeList.find((it) => it.type === type);
@@ -314,8 +316,9 @@ export default {
         type: type || "warning",
       });
     },
-    checkData(row) {
-      console.log(123);
+    checkData: function (row) {
+      debugger;
+
       this.row = row;
       if (!this.searched) {
         this.clearFilter();
@@ -334,6 +337,7 @@ export default {
         spinner: "el-icon-loading",
         background: "rgba(0, 0, 0, 0.7)",
       });
+
       api
         .zskgetRuleDetail(param)
         .then((res) => {
@@ -372,7 +376,6 @@ export default {
             }
             this.rulelist = datalist;
             this.mergeCells = mergeArr;
-            console.log(this.rulelist);
           } else {
             this.$message(res.data.msg || "获取详情失败,请稍后重试");
           }
@@ -380,6 +383,7 @@ export default {
         .catch((error) => {
           console.log(error);
         });
+      // console.log("filter:", this.filter);
     },
     closecheckDialog() {
       this.dialogVisible = false;

+ 6 - 6
yarn.lock

@@ -2858,9 +2858,9 @@
   "version" "1.3.100"
 
 "element-ui@^2.13.2":
-  "integrity" "sha512-r761DRPssMPKDiJZWFlG+4e4vr0cRG/atKr3Eqr8Xi0tQMNbtmYU1QXvFnKiFPFFGkgJ6zS6ASkG+sellcoHlQ=="
-  "resolved" "https://registry.npmjs.org/element-ui/-/element-ui-2.13.2.tgz"
-  "version" "2.13.2"
+  "integrity" "sha512-rcYXEKd/j2G0AgficAOk1Zd1AsnHRkhmrK4yLHmNOiimU2JfsywgfKUjMoFuT6pQx0luhovj8lFjpE4Fnt58Iw=="
+  "resolved" "https://registry.npmjs.org/element-ui/-/element-ui-2.15.6.tgz"
+  "version" "2.15.6"
   dependencies:
     "async-validator" "~1.8.1"
     "babel-helper-vue-jsx-merge-props" "^2.0.0"
@@ -7707,9 +7707,9 @@
   "version" "2.4.0"
 
 "vue@^2.5.17", "vue@>= 2.6.0 < 3":
-  "integrity" "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ=="
-  "resolved" "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz"
-  "version" "2.6.14"
+  "integrity" "sha512-Aejvyyfhn0zjVeLvXd70h4hrE4zZDx1wfZqia6ekkobLmUZ+vNFQer53B4fu0EjWBSiqApxPejzkO1Znt3joxQ=="
+  "resolved" "https://registry.npmjs.org/vue/-/vue-2.5.21.tgz"
+  "version" "2.5.21"
 
 "vuedraggable@^2.23.2":
   "integrity" "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g=="