|
@@ -2,104 +2,203 @@
|
|
|
<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="StaticInfo"
|
|
|
></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-select
|
|
|
- v-model="form.selectedTerm"
|
|
|
- filterable
|
|
|
- remote
|
|
|
- clearable
|
|
|
- :loading="showDrop"
|
|
|
- loading-text="加载中..."
|
|
|
- @change="changeWord"
|
|
|
- @visible-change="handleVisible"
|
|
|
- value-key="id"
|
|
|
- @clear="handleClear"
|
|
|
- ref="termName"
|
|
|
- placeholder="搜索"
|
|
|
- :remote-method="searchTerms"
|
|
|
+ <el-form :rules="rules1" :model="form" label-width="160px" ref="groups1" size="mini">
|
|
|
+ <div class="container_top">
|
|
|
+ <div v-if="!isEdit" style="margin-right: 40px">
|
|
|
+ <el-form-item label="选择标准术语:" prop="selectedTerm">
|
|
|
+ <el-select
|
|
|
+ v-model="form.selectedTerm"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ clearable
|
|
|
+ :loading="showDrop"
|
|
|
+ loading-text="加载中..."
|
|
|
+ @change="changeWord"
|
|
|
+ @visible-change="handleVisible"
|
|
|
+ value-key="id"
|
|
|
+ @clear="handleClear"
|
|
|
+ ref="termName"
|
|
|
+ placeholder="搜索"
|
|
|
+ :remote-method="searchTerms"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(term, idx) in terms"
|
|
|
+ :key="idx"
|
|
|
+ :label="
|
|
|
+ term.name +
|
|
|
+ (term.typeName ? '(' + term.typeName + ')' : '')
|
|
|
+ "
|
|
|
+ :value="term"
|
|
|
+ :title="
|
|
|
+ term.name +
|
|
|
+ (term.typeName ? '(' + term.typeName + ')' : '')
|
|
|
+ "
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-form-item label="已选择标准术语:" label-width="160px">
|
|
|
+ {{
|
|
|
+ form.selectedTermName
|
|
|
+ }}
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ <div class="tabs_box">
|
|
|
+ <div class="tabs">
|
|
|
+ <div
|
|
|
+ class="tabs_pane"
|
|
|
+ :style="
|
|
|
+ tabActive == 'one'
|
|
|
+ ? { color: '#fff', background: '#00c7da' }
|
|
|
+ : ''
|
|
|
+ "
|
|
|
+ @click="tabActiveChange('one')"
|
|
|
+ v-if="staticTabShow"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="(term,idx) in terms"
|
|
|
- :key="idx"
|
|
|
- :label="term.name+(term.typeName?'('+term.typeName+')':'')"
|
|
|
- :value="term"
|
|
|
- :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
|
|
|
- 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"
|
|
|
- >
|
|
|
- <el-input v-model="form.titleChange"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <p class="line"></p>
|
|
|
- <DevInfo
|
|
|
- v-for="(f,i) in form.prags"
|
|
|
- v-if="!upload"
|
|
|
- :key="(i+1)*10000 + showType"
|
|
|
- :data="f"
|
|
|
- :index="i"
|
|
|
- :total="form.prags.length"
|
|
|
- :isEdit="isEdit"
|
|
|
- :isCopy="isCopy"
|
|
|
- ref="subForm"
|
|
|
- @add="addParagraph(i)"
|
|
|
- @del="delParagraph"
|
|
|
- @reOrder="reOrder"
|
|
|
- :showType="showType"
|
|
|
- ></DevInfo>
|
|
|
- <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
|
|
|
- v-if="upload"
|
|
|
- label="上传文件:"
|
|
|
- ref="upload"
|
|
|
- prop="fileList"
|
|
|
- label-width="160px"
|
|
|
- >
|
|
|
- <el-upload
|
|
|
- @mouseenter.native="handleMouseenter"
|
|
|
- @mouseleave.native="handleMouseleave"
|
|
|
- class="upload-demo"
|
|
|
- :action="config.urls.promptServer"
|
|
|
- name="upfile"
|
|
|
- :multiple="false"
|
|
|
- :limit="1"
|
|
|
- :on-preview="handlePreview"
|
|
|
- :on-remove="handleRemove"
|
|
|
- :before-upload="handleBeforeUpLoad"
|
|
|
- :before-remove="beforeRemove"
|
|
|
- :on-change="handleChange"
|
|
|
- :on-success="handleSuccess"
|
|
|
- :show-file-list="showFileList"
|
|
|
- :file-list="form.fileList"
|
|
|
+ 静态信息
|
|
|
+ <img
|
|
|
+ @click.stop="handleStaticTab"
|
|
|
+ src="@/images/tab_add.png"
|
|
|
+ alt
|
|
|
+ v-if="AssesComSHow && !AssesTabSHow"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ v-if="AssesTabSHow && AssesComSHow"
|
|
|
+ @click.stop="closeStaticTab"
|
|
|
+ src="@/images/tab_close.png"
|
|
|
+ alt
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="tabs_pane"
|
|
|
+ :style="
|
|
|
+ tabActive == 'two'
|
|
|
+ ? { color: '#fff', background: '#00c7da' }
|
|
|
+ : ''
|
|
|
+ "
|
|
|
+ @click="tabActiveChange('two')"
|
|
|
+ v-if="AssesTabSHow && AssesComSHow"
|
|
|
>
|
|
|
- <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>
|
|
|
- <!-- <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>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div class="btn">
|
|
|
- <el-button type="primary" :disabled="saveDisable" @click="submitForm">确 定</el-button>
|
|
|
+ 评估内容
|
|
|
+ <img
|
|
|
+ v-if="!staticTabShow"
|
|
|
+ @click.stop="handleAssesTab"
|
|
|
+ src="@/images/tab_add.png"
|
|
|
+ alt
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ v-if="staticTabShow"
|
|
|
+ @click.stop="closeAssesTab"
|
|
|
+ src="@/images/tab_close.png"
|
|
|
+ alt
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <p class="line"></p>
|
|
|
+ <div class="tab_box_left" v-show="tabActive == 'one'" v-if="staticTabShow">
|
|
|
+ <el-form :rules="rules" :model="form" label-width="160px" ref="groups" size="mini">
|
|
|
+ <div
|
|
|
+ v-if="
|
|
|
+ form.selectedTerm &&
|
|
|
+ (form.typeId == 1 ||
|
|
|
+ form.typeId == 3 ||
|
|
|
+ form.typeId == 4 ||
|
|
|
+ form.typeId == 5 ||
|
|
|
+ form.typeId == 6)
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-form-item
|
|
|
+ :label="titleChange"
|
|
|
+ prop="titleChange"
|
|
|
+ label-width="160px"
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ >
|
|
|
+ <el-input v-model="form.titleChange"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div v-if="!upload">
|
|
|
+ <DevInfo
|
|
|
+ v-for="(f, i) in form.prags"
|
|
|
+ :key="(i + 1) * 10000 + showType"
|
|
|
+ :data="f"
|
|
|
+ :index="i"
|
|
|
+ :total="form.prags.length"
|
|
|
+ :isEdit="isEdit"
|
|
|
+ :isCopy="isCopy"
|
|
|
+ ref="subForm"
|
|
|
+ @add="addParagraph(i)"
|
|
|
+ @del="delParagraph"
|
|
|
+ @reOrder="reOrder"
|
|
|
+ :showType="showType"
|
|
|
+ ></DevInfo>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-if="upload">
|
|
|
+ <el-form-item label="标题名称搜索:" prop="fileTitle" label-width="160px">
|
|
|
+ <el-input v-model="form.fileTitle"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <el-form-item
|
|
|
+ v-if="upload"
|
|
|
+ label="上传文件:"
|
|
|
+ ref="upload"
|
|
|
+ prop="fileList"
|
|
|
+ label-width="160px"
|
|
|
+ >
|
|
|
+ <el-upload
|
|
|
+ @mouseenter.native="handleMouseenter"
|
|
|
+ @mouseleave.native="handleMouseleave"
|
|
|
+ class="upload-demo"
|
|
|
+ :action="config.urls.promptServer"
|
|
|
+ name="upfile"
|
|
|
+ :multiple="false"
|
|
|
+ :limit="1"
|
|
|
+ :on-preview="handlePreview"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :before-upload="handleBeforeUpLoad"
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ :on-change="handleChange"
|
|
|
+ :on-success="handleSuccess"
|
|
|
+ :show-file-list="showFileList"
|
|
|
+ :file-list="form.fileList"
|
|
|
+ >
|
|
|
+ <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>
|
|
|
+ <!-- <el-button size="small" type="primary" >点击上传</el-button> -->
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <el-form-item label-width="160px">
|
|
|
+ <div class="uploadInfo" v-if="isSuccessUpload === 1">文件上传中,请稍等...</div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div v-if="AssesComSHow && AssesTabSHow" v-show="tabActive == 'two'">
|
|
|
+ <AddAssess @scrollTo="scrollTo" :childScaleData="scaleData" ref="assessRef" />
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="btn">
|
|
|
+ <el-button type="primary" :disabled="saveDisable" @click="submitForm">确 定</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-scrollbar>
|
|
|
</template>
|
|
@@ -111,14 +210,22 @@ import api from '@api/knowledgeTree.js';
|
|
|
import DevInfo from './DevInfo';
|
|
|
import config from '@api/config';
|
|
|
import $ from 'jquery';
|
|
|
+import AddAssess from './AddAssess';
|
|
|
|
|
|
export default {
|
|
|
name: 'AddDevKnow',
|
|
|
components: {
|
|
|
- DevInfo
|
|
|
+ DevInfo,
|
|
|
+ AddAssess
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ staticTabShow: true,
|
|
|
+ AssesTabSHow: true,
|
|
|
+ staticComShow: true,
|
|
|
+ AssesComSHow: false,
|
|
|
+ toAssesTermId: null,
|
|
|
+ scaleData: null,
|
|
|
isFixedTop: true,
|
|
|
isEdit: false,
|
|
|
isCopy: false,
|
|
@@ -150,10 +257,12 @@ export default {
|
|
|
fileTitle: '',
|
|
|
titleChange: ''
|
|
|
},
|
|
|
- rules: {
|
|
|
+ rules1: {
|
|
|
selectedTerm: [
|
|
|
{ required: true, message: '请选择标准术语', trigger: 'change' }
|
|
|
- ],
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
fileTitle: [
|
|
|
{ required: true, message: '请输入标题名称', trigger: 'change' },
|
|
|
{
|
|
@@ -198,7 +307,8 @@ export default {
|
|
|
showType: -1, // 1 诊断 2 药品 3检验套餐 4检验细项 5检查 6检查子 7手术和操作 8量表
|
|
|
editCount: -1, // 页面会否被编辑 >0被编辑 =0 未编辑
|
|
|
startCount: -1,
|
|
|
- isSaveSuccess: false // 是否保存成功
|
|
|
+ isSaveSuccess: false, // 是否保存成功
|
|
|
+ tabActive: 'one'
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -222,21 +332,33 @@ export default {
|
|
|
created: function() {
|
|
|
const { isEdit, data, isCopy } = this.$route.params;
|
|
|
if (isEdit || isCopy) {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: 'Loading',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
this.showType = data.type; // 编辑页确认显示类型
|
|
|
this.isEdit = isEdit;
|
|
|
this.isCopy = isCopy;
|
|
|
this.title = isEdit ? '修改' : isCopy ? '复制' : '添加';
|
|
|
(isEdit || isCopy) && this.changeWord(data);
|
|
|
- if (isCopy) {
|
|
|
- const _this = this;
|
|
|
- setTimeout(() => {
|
|
|
- _this.handleClear();
|
|
|
- }, 300);
|
|
|
- }
|
|
|
- api.getBaseRecordById({ id: data.id })
|
|
|
+
|
|
|
+ api
|
|
|
+ .getBaseRecordById({ id: data.id })
|
|
|
.then(res => {
|
|
|
if (res.data.code == '0') {
|
|
|
const data = res.data.data;
|
|
|
+ console.log('dwadfesvgeosboau13131213h', data.scale);
|
|
|
+ if (data.type === 8) {
|
|
|
+ this.AssesComSHow = true;
|
|
|
+ if (data.scale) {
|
|
|
+ this.scaleData = data.scale;
|
|
|
+ this.AssesTabSHow = true;
|
|
|
+ } else {
|
|
|
+ this.AssesTabSHow = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (this.form.typeId === 82 || this.form.typeId === 83) {
|
|
|
// console.log('data',data)
|
|
|
this.form.fileList =
|
|
@@ -263,25 +385,37 @@ export default {
|
|
|
data.name + (data.typeName ? '(' + data.typeName + ')' : '');
|
|
|
this.form.selectedTerm =
|
|
|
data.name + (data.typeName ? '(' + data.typeName + ')' : '');
|
|
|
- this.form.prags =
|
|
|
- data &&
|
|
|
- data.details.map(it => {
|
|
|
- return {
|
|
|
- title: it.title,
|
|
|
- position: this.mapStringToNum(it.contentType),
|
|
|
- content: it.content.replace(
|
|
|
- /{imageUrlPrefix}/g,
|
|
|
- config.imgHost
|
|
|
- ),
|
|
|
- // isReason:it.isReason,
|
|
|
- text: it.text,
|
|
|
- disabled: true
|
|
|
- };
|
|
|
- });
|
|
|
+ if (isCopy) {
|
|
|
+ this.handleClear();
|
|
|
+ }
|
|
|
+ if (data.details.length) {
|
|
|
+ this.form.prags =
|
|
|
+ data &&
|
|
|
+ data.details.map(it => {
|
|
|
+ return {
|
|
|
+ title: it.title,
|
|
|
+ position: this.mapStringToNum(it.contentType),
|
|
|
+ content: it.content.replace(
|
|
|
+ /{imageUrlPrefix}/g,
|
|
|
+ config.imgHost
|
|
|
+ ),
|
|
|
+ // isReason:it.isReason,
|
|
|
+ text: it.text,
|
|
|
+ disabled: true
|
|
|
+ };
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.staticTabShow = false;
|
|
|
+ this.tabActiveChange('two');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.close();
|
|
|
+ }, 200);
|
|
|
})
|
|
|
.catch(error => {
|
|
|
+ loading.close();
|
|
|
if (error.code === '900010001') {
|
|
|
return false;
|
|
|
}
|
|
@@ -338,11 +472,75 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ scrollTo(dom) {
|
|
|
+ var div = this.$refs['elscrollbar'].$refs['wrap'];
|
|
|
+ if (dom >= 0) {
|
|
|
+ div.scrollTop += dom - 120;
|
|
|
+ } else {
|
|
|
+ div.scrollTop -= Math.abs(dom) + 120;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleStaticTab() {
|
|
|
+ this.AssesTabSHow = true;
|
|
|
+ this.AssesComSHow = true;
|
|
|
+ this.tabActiveChange('two');
|
|
|
+ },
|
|
|
+ handleAssesTab() {
|
|
|
+ this.staticTabShow = true;
|
|
|
+ this.form.prags = [
|
|
|
+ {
|
|
|
+ //单个段落相关
|
|
|
+ title: '',
|
|
|
+ content: '',
|
|
|
+ isReason: 0,
|
|
|
+ orderNo: 0,
|
|
|
+ position: [],
|
|
|
+ text: ''
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ this.tabActiveChange('one');
|
|
|
+ },
|
|
|
+ closeStaticTab() {
|
|
|
+ this.$alert('确定要删除该标签?删除后该标签内容将会被清空!', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ // cancelButtonClass: 'leaveBtn',
|
|
|
+ // customClass: 'leaveBox',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.staticTabShow = false;
|
|
|
+ this.tabActiveChange('two');
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ closeAssesTab() {
|
|
|
+ this.$alert('确定要删除该标签?删除后该标签内容将会被清空!', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ // cancelButtonClass: 'leaveBtn',
|
|
|
+ // customClass: 'leaveBox',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.AssesTabSHow = false;
|
|
|
+ // this.AssesComSHow = false;
|
|
|
+ this.tabActiveChange('one');
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ tabActiveChange(type) {
|
|
|
+ this.tabActive = type;
|
|
|
+ if (type == 'two') {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.assessRef.resizeTable();
|
|
|
+ }, 200);
|
|
|
+ }
|
|
|
+ },
|
|
|
handleClear() {
|
|
|
this.form.selectedTermName = '';
|
|
|
this.form.selectedTerm = '';
|
|
|
this.form.titleChange = '';
|
|
|
- // console.log('处理清空的操作');
|
|
|
},
|
|
|
|
|
|
handleMouseenter() {
|
|
@@ -354,12 +552,20 @@ export default {
|
|
|
this.isShowTip = false;
|
|
|
},
|
|
|
changeWord(newVal) {
|
|
|
- // console.log(newVal, '选中');
|
|
|
+ if (newVal.typeName == '量表') {
|
|
|
+ this.AssesComSHow = true;
|
|
|
+ } else {
|
|
|
+ this.staticTabShow = true;
|
|
|
+ this.AssesComSHow = false;
|
|
|
+ this.tabActive = 'one';
|
|
|
+ }
|
|
|
+ this.toAssesTermId = newVal.id;
|
|
|
this.showType = newVal.type || -1;
|
|
|
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 = [];
|
|
@@ -445,14 +651,16 @@ export default {
|
|
|
}
|
|
|
//搜索术语列表
|
|
|
this.showDrop = true;
|
|
|
- api.staticKnowledgeBaseInfo({ inputStr: query.trim(), types: [0] }).then(res => {
|
|
|
- this.showDrop = false;
|
|
|
- if (res.data.code === '0') {
|
|
|
- this.terms = res.data.data;
|
|
|
- } else {
|
|
|
- this.warning('数据获取失败');
|
|
|
- }
|
|
|
- });
|
|
|
+ api
|
|
|
+ .staticKnowledgeBaseInfo({ 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 => {
|
|
@@ -468,11 +676,11 @@ 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 ||
|
|
@@ -480,16 +688,16 @@ export default {
|
|
|
this.showType == 6) &&
|
|
|
isVisFlag
|
|
|
) {
|
|
|
- console.log('进入校验');
|
|
|
+ // console.log("进入校验");
|
|
|
//若医学术语为检验/检查,且内容类型选择了注意事项,此时“注意事项标题”是必填项
|
|
|
- this.$refs.groups.clearValidate();
|
|
|
+ this.$refs.groups && this.$refs.groups.clearValidate();
|
|
|
this.rules.titleChange.push({
|
|
|
required: true,
|
|
|
message: '请输入注意事项标题',
|
|
|
trigger: 'change'
|
|
|
});
|
|
|
- this.$refs.groups.validateField('titleChange');
|
|
|
- this.$refs.groups.validateField('selectedTerm');
|
|
|
+ this.$refs.groups && this.$refs.groups.validateField('titleChange');
|
|
|
+ this.$refs.groups && this.$refs.groups.validateField('selectedTerm');
|
|
|
this.rules.titleChange = this.rules.titleChange.slice(0, 1);
|
|
|
|
|
|
if (this.form.titleChange.trim() !== '') {
|
|
@@ -505,14 +713,14 @@ export default {
|
|
|
// return;
|
|
|
} else if (isDiagFlag && this.showType == 1) {
|
|
|
// 若医学术语为诊断,且内容类型选择了临床路径,此时“临床路径标题”是必填项
|
|
|
- this.$refs.groups.clearValidate();
|
|
|
+ this.$refs.groups && this.$refs.groups.clearValidate();
|
|
|
this.rules.titleChange.push({
|
|
|
required: true,
|
|
|
message: '请输入临床路径标题',
|
|
|
trigger: 'change'
|
|
|
});
|
|
|
- this.$refs.groups.validateField('titleChange');
|
|
|
- this.$refs.groups.validateField('selectedTerm');
|
|
|
+ this.$refs.groups && this.$refs.groups.validateField('titleChange');
|
|
|
+ this.$refs.groups && this.$refs.groups.validateField('selectedTerm');
|
|
|
this.rules.titleChange = this.rules.titleChange.slice(0, 1);
|
|
|
|
|
|
if (this.form.titleChange.trim() !== '') {
|
|
@@ -527,59 +735,171 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
- submitForm() {
|
|
|
- if (this.isSuccessUpload === 1) {
|
|
|
- this.warning('文件上传中,请稍等');
|
|
|
- return;
|
|
|
- }
|
|
|
- let flagVal = this.formVal(); // 额外的表单校验
|
|
|
- if (flagVal === false) return;
|
|
|
- //验证外层表单
|
|
|
+ async submitForm() {
|
|
|
+ let all = [];
|
|
|
let goOn = true,
|
|
|
it = null;
|
|
|
- let outIsVia = true; // 外层验证是否通过
|
|
|
- this.$refs.groups.validate(valid => {
|
|
|
- if (!valid) {
|
|
|
- goOn = false;
|
|
|
- outIsVia = false;
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- //验证段落表单
|
|
|
+ let assessRule = false;
|
|
|
let viewHeight = 0; // 定位到表单校验的高度
|
|
|
let viewHeightArr = []; // 表单校验出错高度的所有数组
|
|
|
- if (this.form.typeId !== 82 && this.form.typeId !== 83) {
|
|
|
- for (let i = 0; i < this.$refs.subForm.length; i++) {
|
|
|
- it = this.$refs.subForm[i];
|
|
|
- viewHeight += it.$el.offsetHeight;
|
|
|
- it.$refs.form.validate(valid => {
|
|
|
- if (!valid) {
|
|
|
- goOn = false;
|
|
|
- viewHeightArr.push(viewHeight);
|
|
|
- }
|
|
|
- });
|
|
|
+ let outIsVia = true; // 外层验证是否通过
|
|
|
+ let fvalidate1 = new Promise((resolve, reject) => {
|
|
|
+ //wanglei 添加promise
|
|
|
+ this.$refs.groups1.validate((valid, object) => {
|
|
|
+ if (valid) {
|
|
|
+ resolve(true);
|
|
|
+ } else {
|
|
|
+ reject('top', object);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ all.push(fvalidate1);
|
|
|
+ if (this.staticTabShow) {
|
|
|
+ if (this.isSuccessUpload === 1) {
|
|
|
+ this.warning('文件上传中,请稍等');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let flagVal = this.formVal(); // 额外的表单校验
|
|
|
+ if (flagVal === false) return;
|
|
|
+ //验证外层表单
|
|
|
+
|
|
|
+ let fvalidate = new Promise((resolve, reject) => {
|
|
|
+ //wanglei 添加promise
|
|
|
+ this.$refs.groups &&
|
|
|
+ this.$refs.groups.validate((valid, object) => {
|
|
|
+ if (valid) {
|
|
|
+ resolve(true);
|
|
|
+ } else {
|
|
|
+ reject('f', object);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // end....
|
|
|
+ //验证段落表单
|
|
|
+ // return;
|
|
|
+ all.push(fvalidate);
|
|
|
+ if (this.form.typeId !== 82 && this.form.typeId !== 83) {
|
|
|
+ for (let i = 0; i < this.$refs.subForm.length; i++) {
|
|
|
+ all.push(
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
+ it = this.$refs.subForm[i];
|
|
|
+ // viewHeight += it.$el.getBoundingClientRect().top;
|
|
|
+ it.$refs.form.validate((valid, object) => {
|
|
|
+ if (!valid) {
|
|
|
+ reject('f', object);
|
|
|
+ goOn = false;
|
|
|
+ viewHeightArr.push(it.$el);
|
|
|
+ } else {
|
|
|
+ resolve(true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- // console.log(viewHeightArr,'viewHeightArr');
|
|
|
- if (!goOn) {
|
|
|
- var div = this.$refs['elscrollbar'].$refs['wrap'];
|
|
|
- if (outIsVia) {
|
|
|
- // 外层校验通过,跳转至下层校验具体位置
|
|
|
+
|
|
|
+ // 表单验证
|
|
|
+
|
|
|
+ if (this.$refs.assessRef) {
|
|
|
+ all.push(...this.$refs.assessRef.assessCommit());
|
|
|
+ }
|
|
|
+ // 批量处理Promise返回
|
|
|
+ let transferedPromises = promises => {
|
|
|
+ // 返回一个处理之后的promise数组
|
|
|
+ return promises.map(promise => {
|
|
|
+ return promise.then(res => res).catch(err => err);
|
|
|
+ });
|
|
|
+ };
|
|
|
+ let promiseArr = transferedPromises(all);
|
|
|
+ await Promise.all(promiseArr).then(resArr => {
|
|
|
+ let cErrIndex = resArr.findIndex(item => item.type == 'c');
|
|
|
+ let fErrIndex = resArr.findIndex(item => item == 'f');
|
|
|
+ let topErrIndex = resArr.findIndex(item => item == 'top');
|
|
|
+ if (topErrIndex != -1) {
|
|
|
+ outIsVia = false;
|
|
|
+ var div = this.$refs['elscrollbar'].$refs['wrap'];
|
|
|
this.$nextTick(() => {
|
|
|
- div.scrollTop = +viewHeightArr[0] - 150;
|
|
|
+ div.scrollTop = 0;
|
|
|
});
|
|
|
- } else {
|
|
|
- // 外层校验没通过,页面滚动到顶部
|
|
|
+ } else if (cErrIndex != -1 && fErrIndex != -1) {
|
|
|
+ if (this.staticTabShow) {
|
|
|
+ goOn = false;
|
|
|
+ }
|
|
|
+ this.tabActive = 'one';
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: `"静态信息"和"评估内容"标签内有未填写项目,请填写完整或者删除该标签!`,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ } else if (cErrIndex != -1 && fErrIndex == -1) {
|
|
|
+ this.tabActive = 'two';
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: `"评估内容"标签内有未填写项目,请填写完整或者删除该标签!`,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ let cErrArr = resArr.filter(item => item.type == 'c');
|
|
|
+ if (cErrArr) {
|
|
|
+ cErrArr = Object.keys(cErrArr[0].object);
|
|
|
+ }
|
|
|
+
|
|
|
this.$nextTick(() => {
|
|
|
- div.scrollTop = 0;
|
|
|
+ setTimeout(() => {
|
|
|
+ let domTop = this.$refs.assessRef.getDom(cErrArr[0]);
|
|
|
+ var div = this.$refs['elscrollbar'].$refs['wrap'];
|
|
|
+ if (domTop >= 0) {
|
|
|
+ div.scrollTop += domTop - 120;
|
|
|
+ } else {
|
|
|
+ div.scrollTop -= Math.abs(domTop) + 120;
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
+ } else if (cErrIndex == -1 && fErrIndex != -1) {
|
|
|
+ this.tabActive = 'one';
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: `"静态信息"标签内有未填写项目,请填写完整或者删除该标签!`,
|
|
|
+ type: 'warning'
|
|
|
});
|
|
|
+ } else {
|
|
|
+ assessRule = true;
|
|
|
}
|
|
|
+ });
|
|
|
+ if (this.staticTabShow && !goOn) {
|
|
|
+ setTimeout(() => {
|
|
|
+ var div = this.$refs['elscrollbar'].$refs['wrap'];
|
|
|
+ if (outIsVia) {
|
|
|
+ // 外层校验通过,跳转至下层校验具体位置
|
|
|
+ let sTop = viewHeightArr[0].getBoundingClientRect().top;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (sTop >= 0) {
|
|
|
+ div.scrollTop += sTop - 120;
|
|
|
+ } else {
|
|
|
+ div.scrollTop -= Math.abs(sTop) + 120;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 外层校验没通过,页面滚动到顶部
|
|
|
+ this.$nextTick(() => {
|
|
|
+ div.scrollTop = 0;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, 200);
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ if (!assessRule) return;
|
|
|
+
|
|
|
//通过必填验证,提交保存
|
|
|
- const item = this.form.prags;
|
|
|
+
|
|
|
let param = [];
|
|
|
+ // const item = this.form.prags;
|
|
|
+
|
|
|
if (this.form.typeId === 82 || this.form.typeId === 83) {
|
|
|
if (this.form.fileList.length === 0) {
|
|
|
this.warning('文件未上传,不存储数据');
|
|
@@ -598,6 +918,8 @@ export default {
|
|
|
)
|
|
|
);
|
|
|
} else {
|
|
|
+ // if (this.staticTabShow) {
|
|
|
+ // }
|
|
|
let data = this.form.prags,
|
|
|
tempArr = [],
|
|
|
paramsAll = {},
|
|
@@ -620,11 +942,38 @@ export default {
|
|
|
? this.form.titleChange
|
|
|
: '';
|
|
|
paramsAll.type = this.form.typeId;
|
|
|
- paramsAll.details = tempArr;
|
|
|
+ if (this.staticTabShow) {
|
|
|
+ paramsAll.details = tempArr;
|
|
|
+ } else {
|
|
|
+ paramsAll.details = null;
|
|
|
+ }
|
|
|
param = paramsAll;
|
|
|
+ if (!param.details) param.details = [];
|
|
|
+ param.details.forEach(item => {
|
|
|
+ let regExp = new RegExp(config.imgHost, 'g');
|
|
|
+ item.content = item.content.replace(regExp, '{imageUrlPrefix}');
|
|
|
+ });
|
|
|
+ // 评估内容的数据
|
|
|
+ param.scale = {};
|
|
|
+ console.log(
|
|
|
+ 'this.AssesComSHow',
|
|
|
+ this.AssesComSHow,
|
|
|
+ 'AssesTabSHow',
|
|
|
+ this.AssesTabSHow
|
|
|
+ );
|
|
|
+ if (this.AssesComSHow && this.AssesTabSHow) {
|
|
|
+ const assessParam = this.$refs.assessRef.formtParams();
|
|
|
+ param.scale = assessParam;
|
|
|
+ param.scale.conceptId = this.toAssesTermId;
|
|
|
+ const userInfo = localStorage.getItem('userLoginDTO');
|
|
|
+ param.scale.modifier = userInfo.linkman;
|
|
|
+ }
|
|
|
}
|
|
|
+ // return;
|
|
|
// this.showSaveDialog(param,'是否'+(this.isEdit?'修改':'保存')+'该静态知识?');
|
|
|
-
|
|
|
+ console.log('param-------');
|
|
|
+ console.dir(param);
|
|
|
+ // return;
|
|
|
if (!this.isEdit) {
|
|
|
// 新增页面
|
|
|
this.saveDisable = true;
|
|
@@ -646,7 +995,9 @@ export default {
|
|
|
//保存编辑 接口
|
|
|
sendSaveOrEdit(param) {
|
|
|
this.isCopy && (param.id = undefined);
|
|
|
- api.saveBaseOrUpdateRecord(param)
|
|
|
+ param.source = 1; //0:医院端 1:云平台
|
|
|
+ api
|
|
|
+ .saveBaseOrUpdateRecord(param)
|
|
|
.then(res => {
|
|
|
if (res.data.code === '0') {
|
|
|
this.isSuccessUpload = 0; // 修改文件上传状态为0
|
|
@@ -770,9 +1121,10 @@ export default {
|
|
|
top: 0;
|
|
|
}
|
|
|
.info-container {
|
|
|
- background: #fff;
|
|
|
- padding: 20px;
|
|
|
- margin: 70px 20px -20px 20px;
|
|
|
+ // background: #fff;
|
|
|
+ // padding: 20px 0;
|
|
|
+ margin: 60px 20px -20px 20px;
|
|
|
+ min-width: 960px;
|
|
|
.el-input__inner {
|
|
|
width: 200px;
|
|
|
}
|
|
@@ -782,17 +1134,17 @@ export default {
|
|
|
.add-prg .el-form-item {
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
- .el-form-item {
|
|
|
- margin-bottom: 8px !important;
|
|
|
- }
|
|
|
+ // .el-form-item {
|
|
|
+ // margin-bottom: 8px !important;
|
|
|
+ // }
|
|
|
}
|
|
|
// .cancel span {
|
|
|
// color: #22ccc8;
|
|
|
// }
|
|
|
.line {
|
|
|
- border-top: 1px #dcdfe6 solid;
|
|
|
- margin-bottom: 25px;
|
|
|
- margin-top: 25px;
|
|
|
+ // border-top: 1px #dcdfe6 solid;
|
|
|
+ background: #dcdfe6;
|
|
|
+ height: 12px;
|
|
|
}
|
|
|
.NoiseTemplateWrapper .info-container .el-input__inner {
|
|
|
width: 250px;
|
|
@@ -855,7 +1207,9 @@ export default {
|
|
|
}
|
|
|
.btn {
|
|
|
text-align: right;
|
|
|
- padding-right: 20px;
|
|
|
+ margin: 10px 20px;
|
|
|
+ padding: 30px;
|
|
|
+ background: #fff;
|
|
|
}
|
|
|
.el-message-box {
|
|
|
/deep/ .el-icon-warning {
|
|
@@ -882,5 +1236,56 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+/deep/ .el-tabs__header {
|
|
|
+ padding: 0 10px !important;
|
|
|
+}
|
|
|
+.container_top {
|
|
|
+ display: flex;
|
|
|
+ padding: 20px 30px;
|
|
|
+}
|
|
|
+.tabs_box {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.tabs {
|
|
|
+ display: flex;
|
|
|
+ margin: 0px 30px;
|
|
|
+ font-size: 14px;
|
|
|
+ height: 31px;
|
|
|
+ .tabs_pane {
|
|
|
+ position: relative;
|
|
|
+ width: 92px;
|
|
|
+ height: 32px;
|
|
|
+ border-radius: 6px 6px 0px 0px;
|
|
|
+ border: 1px solid #00c7da;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 32px;
|
|
|
+ margin-right: 32px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ color: #00c7da;
|
|
|
+ cursor: pointer;
|
|
|
+ img {
|
|
|
+ position: absolute;
|
|
|
+ right: -18px;
|
|
|
+ bottom: 0;
|
|
|
+ width: 18px;
|
|
|
+ height: 18px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.tab_box_left {
|
|
|
+ padding: 30px;
|
|
|
+}
|
|
|
+
|
|
|
+/deep/ .el-form-item.is-success .el-input__inner,
|
|
|
+.el-form-item.is-success .el-textarea__inner {
|
|
|
+ border-color: #c9c9c9 !important;
|
|
|
+}
|
|
|
+/deep/ .el-form-item.is-success .el-textarea__inner {
|
|
|
+ border-color: #c9c9c9 !important;
|
|
|
+}
|
|
|
+/deep/ .el-form-item.is-success .el-textarea__inner {
|
|
|
+ border-color: #c9c9c9 !important;
|
|
|
+}
|
|
|
</style>
|
|
|
|