morphone1995 %!s(int64=4) %!d(string=hai) anos
pai
achega
aa40fabc94
Modificáronse 1 ficheiros con 45 adicións e 28 borrados
  1. 45 28
      src/components/cdssManage/AddMedicinePrompt.vue

+ 45 - 28
src/components/cdssManage/AddMedicinePrompt.vue

@@ -110,7 +110,7 @@
 import api from '@api/cdss.js';
 import InfoParagraph from './MedicineInfoPg';
 import config from '@api/config';
-import $ from 'jquery'
+import $ from 'jquery';
 
 export default {
   name: 'AddMedicinePrompt',
@@ -170,16 +170,21 @@ export default {
         fileList: [
           { required: true, message: '请上传文件', trigger: 'change' }
         ],
-        titleChange: [{
-          validator: (rule, value, callback) => {
-            if (!value.trim()) {
-              callback(new Error('请输入'+this.titleChange.replace(":","")));
-            } else {
-              callback();
-            }
-          },
-          trigger: 'change'
-        },{ max: 30, message: '标题最多30字', trigger: 'change' }]
+        titleChange: [
+          // {
+          //   validator: (rule, value, callback) => {
+          //     if (!value.trim()) {
+          //       callback(
+          //         new Error('请输入' + this.titleChange.replace(':', ''))
+          //       );
+          //     } else {
+          //       callback();
+          //     }
+          //   },
+          //   trigger: 'change'
+          // },
+          { max: 30, message: '标题最多30字', trigger: 'change' }
+        ]
       },
       saveDisable: false, //保存按钮禁止点击
       showDrop: false, //下拉框显示文字bug1774
@@ -190,7 +195,7 @@ export default {
       showConfirm: true,
       isSuccessUpload: 0, //是否上传成功  0: 不在上传  1: 上传过程中  2: 上传成功
       isShowTip: false,
-      showType: -1, // 1 诊断  2  药品   3检验套餐 4检验细项  5检查 6手术和操作
+      showType: -1, // 1 诊断  2  药品   3检验套餐 4检验细项  5检查 6检查子   7手术和操作
       editCount: -1, // 页面会否被编辑 >0被编辑   =0 未编辑
       startCount: -1,
       isSaveSuccess: false // 是否保存成功
@@ -222,15 +227,16 @@ export default {
       this.isEdit = isEdit;
       this.isCopy = isCopy;
       this.title = isEdit ? '修改' : isCopy ? '复制' : '添加';
-      (isEdit||isCopy) && this.changeWord(data);
-      if(isCopy){
-        const _this=this;
-        setTimeout(()=>{
+      (isEdit || isCopy) && this.changeWord(data);
+      if (isCopy) {
+        const _this = this;
+        setTimeout(() => {
           _this.handleClear();
-        },300)
-
+        }, 300);
       }
-      api.getTremList({ id: data.id }).then(res => {
+      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) {
@@ -249,7 +255,10 @@ 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 =
@@ -393,7 +402,7 @@ export default {
         it = Object.assign(this.form.prags[i]);
         this.form.prags.splice(i - 1, 2, it, temp);
         this.$nextTick(() => {
-          div.scrollTop = this.$refs.subForm[i-1].$el.offsetTop -48;
+          div.scrollTop = this.$refs.subForm[i - 1].$el.offsetTop - 48;
         });
       } else {
         if (i === this.form.prags.length - 1) {
@@ -462,15 +471,19 @@ export default {
       let positionArr = positiontemp.reduce(function(a, b) {
         return a.concat(b);
       }); // 所有被选中的值集合
-      // console.log(positionArr, 'positionArr');
-      // console.log(this.showType, '当前页的显示类型');
+      console.log(positionArr, 'positionArr');
+      console.log(this.showType, '当前页的显示类型');
       let isVisFlag = positionArr.some(item => item === 2);
       let isDiagFlag = positionArr.some(item => item === 3);
-      // console.log(isVisFlag, 'isVisFlag');
+      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
       ) {
+        console.log('进入校验');
         //若医学术语为检验/检查,且内容类型选择了注意事项,此时“注意事项标题”是必填项
         this.$refs.groups.clearValidate();
         this.rules.titleChange.push({
@@ -606,7 +619,9 @@ export default {
         paramsAll.id = this.conceptId;
         paramsAll.name = this.form.name;
         paramsAll.noticeName =
-          types == 3 || types == 4 || types == 5 || types == 6 ? this.form.titleChange : '';
+          types == 3 || types == 4 || types == 5 || types == 6
+            ? this.form.titleChange
+            : '';
         paramsAll.type = this.form.typeId;
         paramsAll.details = tempArr;
         param = paramsAll;
@@ -633,8 +648,10 @@ export default {
 
     //保存编辑 接口
     sendSaveOrEdit(param) {
-      this.isCopy&&(param.id=undefined);
-      api.saveTermPrompts(param).then(res => {
+      this.isCopy && (param.id = undefined);
+      api
+        .saveTermPrompts(param)
+        .then(res => {
           if (res.data.code === '0') {
             this.isSuccessUpload = 0; // 修改文件上传状态为0
             this.warning(res.data.msg || '保存成功', 'success');