You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2578 lines
83 KiB

<template>
<div class="box">
<div style="width: 95%">
<el-card
style="width: 100%; border-radius: 15px"
class="elcard"
>
<div class="publiccss">项目设置</div>
<div style="display: flex;margin-top:15px;">
<div style="width: 15%;">
<div>
<el-select v-model="department" placeholder="请选择项目类别" filterable :filter-method="remoteMethodes" default-first-option @change="quckDepartments" clearable>
<el-option
v-for="item in quckDepartment"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
</el-select>
</div>
<div :style="'margin-top: 10px;overflow: scroll;border: 1px solid;height:'+ (window.pageHeight < 600 ? 410 : window.pageHeight - 210) + 'px;'">
<el-tree
:data="itemTypeId"
:props="treeprops"
@node-click="treeclick"
node-key="id"
ref="itemType"
highlight-current
auto-expand-parent
></el-tree>
</div>
</div>
<div style="width: 85%;margin-left:5px;">
<el-table
:data="tableData"
style="width: 100%"
row-key="id"
:height="window.pageHeight < 600 ? 185 : window.pageHeight - 160"
class="el-table__body-wrapper tbody"
highlight-current-row
@row-click="rowick"
ref="tableData"
border
>
<el-table-column prop="id" label="编号" width="300">
</el-table-column>
<el-table-column prop="displayName" label="名称" width="">
</el-table-column>
<el-table-column prop="creatorName" label="创建者" width="">
</el-table-column>
<el-table-column prop="creationTime" label="创建时间" width="200">
<template slot-scope="scope">
{{ scope.row.creationTime | dateFormat }}
</template>
</el-table-column>
<el-table-column prop="lastModifierName" label="修改者" width="">
</el-table-column>
<el-table-column
prop="lastModificationTime"
label="修改时间"
width="200"
>
<template slot-scope="scope">
{{ scope.row.lastModificationTime | dateFormat }}
</template>
</el-table-column>
<el-table-column
label="结果类别"
prop="resultTemplateTypeFlag"
></el-table-column>
<el-table-column label="操作">
<template>
<el-tag
class="move"
style="
cursor: move;
margin-left: 15px;
background-color: rgb(245, 245, 245);
border: none;
"
draggable="true"
>
<i
class="el-icon-d-caret"
style="
width: 1rem;
height: 1rem;
color: rgb(113, 113, 113);
"
></i>
</el-tag>
</template>
</el-table-column>
</el-table>
</div>
</div>
</el-card>
</div>
<el-dialog
:title="title == 1 ? '新增' : '编辑'"
:visible.sync="dialogVisible"
width="70%"
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" label-width="110px" :rules="rules">
<el-row>
<el-col :span="10">
<el-form-item label="项目编号" prop="">
<el-input v-model="form.id" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="项目类别" prop="itemTypeId">
<!-- <el-cascader
v-model="form.itemTypeId"
:options="itemTypeId"
:props="props"
:show-all-levels="false"
>
</el-cascader> -->
<el-cascader
v-model="form.itemTypeId"
:options="itemTypeId"
@change="onchange"
:props="{
value: 'id',
label: 'displayName',
children: 'treeChildren'
}"
></el-cascader>
<!-- <el-select
v-model="form.itemTypeId"
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="item in itemTypeId"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="名称" prop="displayName">
<el-input v-model="form.displayName" ref="refinput"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="英文缩写" prop="">
<el-input v-model="form.englishShortName"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="价格" prop="">
<el-input v-model="form.price"></el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="8">
<el-form-item label="价表项目编码" prop="">
<el-select
v-model="form.priceItemId"
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="item in priceItemId"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col> -->
<el-col :span="6">
<el-form-item label="单位" prop="">
<el-select
v-model="form.unitId"
placeholder="请选择"
style="width: 100%"
filterable
>
<el-option
v-for="item in unitId"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
</el-select>
<!-- <el-autocomplete
class="inline-input"
v-model="unitIdName"
:fetch-suggestions="querySearch"
value-key="displayName"
placeholder="请输入内容"
@select="handleSelect"
>
</el-autocomplete> -->
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="生成小结" prop="">
<el-checkbox v-model="isProduceSummaryBox" @change="changeBox('isProduceSummary')" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="参考范围类型" prop="">
<el-select
v-model="form.referenceRangeTypeFlag"
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="item in referenceRangeTypeFlag"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<!-- <el-input v-model="form.referenceRangeTypeFlag"></el-input> -->
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="名称进入小结" prop="">
<el-checkbox v-model="isNameIntoSummaryBox" @change="changeBox('isNameIntoSummary')" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="启用诊断函数" prop="">
<el-checkbox v-model="isDiagnosisFunctionBox" @change="changeBox('isDiagnosisFunction')" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="诊断函数" prop="">
<el-input
v-model="form.diagnosisFunction"
:disabled="disableddiagnosisFunction"
>
<el-button slot="append" icon="el-icon-more" v-if="isDiagnosisFunctionBox" @click="diagnosisFunctionBox=true,diagnosisFunctionText=form.diagnosisFunction"></el-button>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-row>
<el-form-item label="默认结果" prop="">
<div style="display: flex;justify-content: center;">
<el-input v-model="form.defaultResult" type="textarea" :autosize="{ minRows: 2, maxRows: 5}"/>
<el-select
v-model="form.defaultResult"
style="width: 40px;"
class="downText"
>
<el-option
v-for="item in defaultResult"
:key="item.value"
:label="item.label"
:value="item.label"
>
</el-option>
</el-select>
</div>
</el-form-item>
</el-row>
</el-col>
<el-col :span="3">
<el-form-item label="是计算项目" prop="">
<el-checkbox v-model="isCalculationItemBox" @change="changeBox('isCalculationItem')" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计算函数" prop="">
<el-input v-model="form.calculationFunction" :disabled="true">
<el-button slot="append" icon="el-icon-more" v-if="isCalculationItemBox" @click="calculationFunctionBox=true,calculationFunctionText=form.calculationFunction"></el-button>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="输入结果校验" prop="">
<el-input v-model="form.inputCheck"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="继续处理" prop="">
<el-checkbox v-model="isContinueProcessBox" @change="changeBox('isContinueProcess')" />
</el-form-item>
</el-col>
<!-- <el-col :span="8">
<el-form-item label="项目结果模板" prop="resultTemplateTypeFlag">
<el-input v-model="form.resultTemplateTypeFlag"
>resulttemp</el-input
>
<el-select
v-model="form.resultTemplateTypeFlag"
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="item in resulttemp"
:key="item.id"
:label="item.result"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col> -->
<el-col :span="3">
<el-form-item label="启用" prop="">
<el-checkbox v-model="isActiveBox" @change="changeBox('isActive')" />
</el-form-item>
</el-col>
</el-row>
<!-- -->
<el-divider></el-divider>
<el-row>
<el-col :span="5">
<el-form-item label="创建者">
<el-input v-model="form.creatorName" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="创建时间" style="margin-left: -5%">
<el-input
:value="form.creationTime | dateFormat"
disabled
style="width: 90%"
></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="修改者" style="margin-left: -25%">
<el-input v-model="form.creatorName" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="修改时间" style="margin-left: -5%">
<el-input
:value="form.lastModificationTime | dateFormat"
disabled
style="width: 90%"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="Onsubmit">确 定</el-button>
</span>
</el-dialog>
<!-- 按钮区域 -->
<div style="margin-left: 10px; margin-top: 4%">
<el-button type="" @click="add" class="commonbutton">新增</el-button>
<div>
<el-button
type=""
@click="editpopup"
class="commonbutton"
>编辑</el-button
>
</div>
<div>
<el-button type="" @click="delsrts" class="commonbutton"
>删除</el-button
>
</div>
<div>
<el-button type="" @click="topping" class="commonbutton"
>置顶</el-button
>
</div>
<div>
<el-button type="" @click="toppings" class="commonbutton"
>置底</el-button
>
</div>
<div>
<el-button
type=""
:disabled="isshow"
@click="assertion"
class="commonbutton"
>排序</el-button
>
</div>
<div>
<el-button
type=""
:disabled="isshow"
@click="cancellation"
class="commonbutton"
>取消</el-button
>
</div>
<div>
<el-button
type=""
size=""
@click="resulttemplate"
class="commonbutton"
>结果模板</el-button
>
</div>
<div>
<el-button
type=""
size=""
@click="referencerange"
class="commonbutton"
>参考范围</el-button
>
</div>
</div>
<!-- 结果模板弹框 -->
<el-dialog
title="结果模板"
:visible.sync="rurestdialogVisible"
width="80%"
:close-on-click-modal="false"
>
<div style="display: flex">
<div style="width: 90%">
<el-table
border=""
:data="reusttableData"
@row-click="reustclick"
row-key="id"
highlight-current-row
style="width: 100%"
:height="window.pageHeight < 600 ? 280 : window.pageHeight - 320"
ref="reusttableData"
class="el-table__body-wrappers tbodys"
>
<!-- <el-table-column label="编号" prop="id"></el-table-column>
<el-table-column label="项目编号" prop="itemId"></el-table-column> -->
<el-table-column label="结果" prop="result" width="300"></el-table-column>
<el-table-column label="诊断" width="200">
<template slot-scope="scope">
{{getChangeDiagnosis(scope.row.diagnosisId)}}
</template>
</el-table-column>
<el-table-column label="小结前加名称" width="120">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.isNameIntoSummary" true-label="Y" false-label="N" disabled/>
</template>
</el-table-column>
<el-table-column label="结果状态" width="100">
<template slot-scope="scope">
{{getChangeResult(scope.row.resultStatusId)}}
</template>
</el-table-column>
<el-table-column label="结果进入小结" width="120">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.isResultIntoSummary" true-label="Y" false-label="N" disabled/>
</template>
</el-table-column>
<el-table-column label="操作">
<template>
<el-tag
class="moves"
style="
cursor: move;
margin-left: 15px;
background-color: rgb(245, 245, 245);
border: none;
"
draggable="true"
>
<i
class="el-icon-d-caret"
style="
width: 1rem;
height: 1rem;
color: rgb(113, 113, 113);
"
></i>
</el-tag>
</template>
</el-table-column>
<el-table-column label="创建者" width="100">
<template slot-scope="scope">
{{ scope.row.creatorName}}
</template>
</el-table-column>
<el-table-column label="创建时间" width="200">
<template slot-scope="scope">
{{ scope.row.creationTime | dateFormat }}
</template>
</el-table-column>
<el-table-column label="修改者" width="100">
<template slot-scope="scope">
{{ scope.row.lastModifierName}}
</template>
</el-table-column>
<el-table-column label="修改时间" width="200">
<template slot-scope="scope">
{{ scope.row.lastModificationTime | dateFormat }}
</template>
</el-table-column>
</el-table>
</div>
<div style="margin-top: 5px; margin-left: 15px;width:10%;">
<el-button type="" @click="increase" style="width:100%;">添加</el-button>
<div style="margin-top: 5px">
<el-button type="" @click="resultediting" style="width:100%;">编辑</el-button>
</div>
<div style="margin-top: 5px">
<el-button type="" @click="delemtdelite" style="width:100%;">删除</el-button>
</div>
<div style="margin-top: 5px">
<el-button type="" @click="resulttopping" style="width:100%;">置顶</el-button>
</div>
<div style="margin-top: 5px">
<el-button type="" @click="resulttoppings" style="width:100%;">置底</el-button>
</div>
<div style="margin-top: 5px">
<el-button
type=""
:disabled="isshows"
@click="assertions"
style="width:100%;"
>排序</el-button>
</div>
<div style="margin-top: 5px">
<el-button
type=""
:disabled="isshows"
@click="resultcancellation"
style="width:100%;"
>取消</el-button>
</div>
<!-- <div style="margin-top: 5px">
<el-button type="primary" @click="templatecategory"
>模板类别</el-button
>
</div> -->
<div style="margin-top: 5px;margin-bottom:14px;">
<el-button type="" @click="diagnosticmatching" style="width:100%;">诊断匹配</el-button
>
</div>
</div>
</div>
<el-divider></el-divider>
<span slot="footer" class="dialog-footer">
<el-button @click="rurestdialogVisible = false,rusetform={},curRows={}">取 消</el-button>
<el-button type="primary" @click="rurestdialogVisible = false,rusetform={},curRows={}"
>确 定</el-button
>
</span>
</el-dialog>
<!-- 结果模板添加或者修改弹框 -->
<el-dialog
:title="ruesttiele == 1 ? '新增' : '修改'"
:visible.sync="ruesttieledialogVisible"
width="80%"
:close-on-click-modal="false"
>
<el-form :model="rusetform" ref="rusetform" label-width="100px" :rules="rusetformcheck">
<el-row>
<!-- <el-col :span="8">
<el-form-item label="项目">
<el-select v-model="rusetform.itemId" placeholder="请选择">
<el-option
v-for="item in itemId"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col> -->
<el-col :span="8">
<el-form-item label="结果" prop="result">
<el-input v-model="rusetform.result" ref="ruseInput" @change="changeUpdate($event)"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="诊断编号">
<el-select v-model="rusetform.diagnosisId" placeholder="请选择" filterable :filter-method="remoteMethod" default-first-option clearable @change="quckRusetform">
<el-option
v-for="item in quickAsb"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="小结前加名称">
<el-checkbox v-model="rusetform.isNameIntoSummary" true-label="Y" false-label="N"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="结果进入小结">
<el-checkbox v-model="rusetform.isResultIntoSummary" true-label="Y" false-label="N" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="结果状态" prop="resultStatusId">
<el-select
v-model="rusetform.resultStatusId"
placeholder="请选择"
filterable
>
<el-option
v-for="item in resultStatusId"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-divider></el-divider>
<span slot="footer" class="dialog-footer">
<el-button @click="ruesttieledialogVisible = false">取 消</el-button>
<el-button type="primary" @click="rusteronsubmit">确 定</el-button>
</span>
</el-dialog>
<!-- 参考范围弹框 -->
<el-dialog
title="参考范围"
:visible.sync="referencerangedialogVisible"
width="80%"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="8">
<span>参考范围类型:</span>
<el-select
v-model="referencerangevalue"
filterable
placeholder="请选择"
@change="selecttype"
>
<el-option
v-for="item in referencerangedata"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
</el-row>
<!-- //无参考范围 2223456-->
<el-card
v-if="referencerangevalue == 0"
style="margin-top: 20px"
>无参考范围</el-card>
<!-- 数字型参考范围 -->
<div style="display: flex" v-if="referencerangevalue == 1">
<ReferenceRange :itemId="form.id" ReferenceRangeTypeFlag="1" />
</div>
<!-- 字符型参考范围 -->
<div v-if="referencerangevalue == 2">
<div style="margin: 20px 0; display: flex">
<div style="width: 100%">
<el-input
type="textarea"
placeholder="请输入内容"
v-model="fssubdex"
maxlength="300"
show-word-limit
style="height: 50px"
>
</el-input>
</div>
<!-- <div style="margin-top: 5px; margin-left: 15px;width:10%;">
<el-button type="primary" @click="addfssubdex" style="width:100%;">新增</el-button>
</div> -->
</div>
</div>
<!-- 性激素参考范围 -->
<div v-if="referencerangevalue == 2"></div>
<el-divider></el-divider>
<span
slot="footer"
class="dialog-footer"
>
<el-button @click="referencerangedialogVisible = false,referencerangevalue='0'"
>取 消</el-button
>
<el-button type="primary" @click="determinetype">确 定</el-button>
</span>
</el-dialog>
<!-- 项目结果模板弹框 -->
<el-dialog
title="结果模板"
:visible.sync="projectdialogVisible"
width="80%"
:close-on-click-modal="false"
>
<div style="display: flex">
<div style="width: 95%">
<el-table :data="projectdata">
<el-table-column label="编号" prop="id"> </el-table-column>
<el-table-column label="结果" prop="result"> </el-table-column>
<el-table-column label="修改者" prop="lastModifierName">
</el-table-column>
<el-table-column label="修改时间" prop="lastModificationTime">
<template slot-scope="scope">
{{ scope.row.lastModificationTime | dateFormat }}
</template>
</el-table-column>
</el-table>
</div>
<!-- 结果模板 -->
<div style="margin-left: 10px; margin-top: 5%">
<el-button type="primary" @click="resultaddition">添加</el-button>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="projectdialogVisible = false">取 消</el-button>
<el-button type="primary" @click="projectdialogVisible = false"
>确 定</el-button
>
</span>
</el-dialog>
<!--诊断匹配弹框-->
<el-dialog
title="诊断匹配"
:visible.sync="diagnosdialogVisible"
width="80%"
:close-on-click-modal="false"
>
<div style="display: flex">
<div style="width: 95%">
<el-table :data="diagnosticdata" :height="window.pageHeight < 600 ? 280 : window.pageHeight - 320" border highlight-current-row @row-click="diagnosick" row-key="id" ref="diagnosticdata" class="el-table__body-wrapperes tbodyes">
<el-table-column label="结果" prop="result"></el-table-column>
<el-table-column label="诊断" width="200">
<template slot-scope="scope">
{{getChangeDiagnosies(scope.row.diagnosisId)}}
</template>
</el-table-column>
<el-table-column label="创建者" width="100">
<template slot-scope="scope">
{{ scope.row.creatorName}}
</template>
</el-table-column>
<el-table-column label="创建时间" width="200">
<template slot-scope="scope">
{{ scope.row.creationTime | dateFormat }}
</template>
</el-table-column>
<el-table-column label="修改者" width="100">
<template slot-scope="scope">
{{ scope.row.lastModifierName}}
</template>
</el-table-column>
<el-table-column label="修改时间" width="200">
<template slot-scope="scope">
{{ scope.row.lastModificationTime | dateFormat }}
</template>
</el-table-column>
<el-table-column label="操作">
<template>
<el-tag
class="movess"
style="
cursor: move;
margin-left: 15px;
background-color: rgb(245, 245, 245);
border: none;
"
draggable="true"
>
<i
class="el-icon-d-caret"
style="
width: 1rem;
height: 1rem;
color: rgb(113, 113, 113);
"
></i>
</el-tag>
</template>
</el-table-column>
</el-table>
</div>
<div style="margin-top: 5px; margin-left: 15px;width:10%;">
<el-button type="" @click="adddiagnosis" style="width:100%;">增加</el-button>
<div style="margin-top: 5px">
<el-button type="" @click="editDiagnosis" style="width:100%;">编辑</el-button>
</div>
<div style="margin-top: 5px">
<el-button type="" @click="deleteDiagnosis" style="width:100%;">删除</el-button>
</div>
<div style="margin-top: 5px">
<el-button type="" @click="diagnosistopping" style="width:100%;">置顶</el-button>
</div>
<div style="margin-top: 5px">
<el-button type="" @click="diagnosistoppings" style="width:100%;">置底</el-button>
</div>
<div style="margin-top: 5px">
<el-button
type=""
:disabled="isshowes"
@click="assertiones"
style="width:100%;"
>排序</el-button>
</div>
<div style="margin-top: 5px">
<el-button
type=""
:disabled="isshowes"
@click="diagnosiscancellation"
style="width:100%;"
>取消</el-button>
</div>
</div>
</div>
<el-divider></el-divider>
<span slot="footer" class="dialog-footer">
<el-button @click="diagnosdialogVisible = false,editdigoisceditingform={},curRowes={}">取 消</el-button>
<el-button type="primary" @click="diagnosdialogVisible = false,editdigoisceditingform={},curRowes={}"
>确 定</el-button
>
</span>
</el-dialog>
<!-- 增加诊断弹框 -->
<el-dialog
:title="diagnostiele == 1 ? '新增' : '修改'"
:visible.sync="diagnosticediting"
width="80%"
:close-on-click-modal="false"
>
<el-form :model="editdigoisceditingform" ref="editdigoisceditingform" label-width="100px" :rules="editdigoisceditingformcheck">
<el-row>
<el-col :span="8">
<el-form-item label="结果" prop="result">
<el-input v-model="editdigoisceditingform.result" ref="editdiInput" @change="changeUpdates($event)"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="诊断编号" prop="diagnosisId">
<el-select v-model="editdigoisceditingform.diagnosisId" placeholder="请选择" filterable :filter-method="remoteMethodess" default-first-option clearable @change="quckEditdigoisce">
<el-option
v-for="item in quckeDitd"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-divider></el-divider>
<span slot="footer" class="dialog-footer">
<el-button @click="diagnosticediting = false">取 消</el-button>
<el-button type="primary" @click="diagnosticsadd">确 定</el-button>
</span>
</el-dialog>
<!--诊断设置弹框 -->
<el-dialog
title="诊断建议设置"
:visible.sync="diagnostisbox"
width="80%"
:close-on-click-modal="false"
>
<div style="display: flex">
<div style="width: 95%">
<el-card>
<el-row>
<el-col :span="8">
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in itemTypeId"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
</el-select>
</el-col>
<el-col :span="8"> 2122 </el-col>
</el-row>
<!-- table部分 -->
<el-row> </el-row>
</el-card>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="diagnostisbox = false">取 消</el-button>
<el-button type="primary" @click="diagnostisbox = false"
>确 定</el-button
>
</span>
</el-dialog>
<!-- 诊断函数弹框 -->
<el-dialog
title="诊断函数设置"
:visible.sync="diagnosisFunctionBox"
width="50%"
:close-on-click-modal="false"
>
<el-form label-width="110px">
<el-row>
<el-col :span="24">
<el-form-item label="诊断函数">
<el-input type="textarea" v-model="diagnosisFunctionText" :autosize="{ minRows: 12, maxRows: 12}"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="diagnosisFunctionBox = false,diagnosisFunctionText=''">取 消</el-button>
<el-button type="primary" @click="OnsubmitDiagnosis">确 定</el-button>
</span>
</el-dialog>
<!-- 计算函数弹框 -->
<el-dialog
title="计算函数设置"
:visible.sync="calculationFunctionBox"
width="50%"
:close-on-click-modal="false"
>
<el-form label-width="110px">
<el-row>
<el-col :span="24">
<el-form-item label="诊断函数">
<el-input type="textarea" v-model="calculationFunctionText" :autosize="{ minRows: 12, maxRows: 12}"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="calculationFunctionBox = false,calculationFunctionText=''">取 消</el-button>
<el-button type="primary" @click="OnsubmitCalculation">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { yzstr } from "@/utlis/validate";
import {
getporjectlists,
projectlist,
addproject,
priceitemlist,
posjrctid,
projectedit,
projectdeleft,
projttitem,
projectdreog,
} from "@/request/commonapi";
import { unitlist } from "@/request/systemapi";
import Sortable from "sortablejs";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { deepCopy } from "../../utlis/proFunc";
import ReferenceRange from "../../components/itemSet/ReferenceRange.vue";
import { mapState, mapActions } from "vuex";
export default {
components: {
ReferenceRange,
},
data() {
return {
value: "",
diagnostisbox: false, //诊断设置弹框的方法
// tabelform: {
// ageLowerLimit: "input无法输入",
// },
sexname: [],
sexid: [],
treeprops: {
label: "displayName",
value: "id",
children: "treeChildren",
}, //左侧树形结构需要的数据
editdigoisceditingform: {
itemId: "",
result: "",
diagnosisId: ""
}, //诊断编辑需要绑定的对象诊断所需要的编辑
diagnosticediting: false, //诊断编辑
diagnosdialogVisible: false, //匹配诊断
diagnosticdata: [], //匹配诊断
initdiagnosticdata:[],
projectdata: [], //结果模板
projectdialogVisible: false,
itemId: [], //项目id
diagnosisId: [], //诊断
rusetform: {
itemId: "",
result: "",
diagnosisId: null,
isNameIntoSummary: "N",
isResultIntoSummary: "Y",
resultStatusId: "01",
simpleCode: "",
}, //项目结果模板需要的数据
resultStatusId: [], //结果状态
isNameIntoSummary: [
{
value: "Y",
label: "是",
},
{
value: "N",
label: "否",
},
], //小结名称
isResultIntoSummary: [
{
value: "Y",
label: "是",
},
{
value: "N",
label: "否",
},
], //进入小结
ruesttiele: 1,
ruesttieledialogVisible: false,
referencerangedata: [
{
value: "0",
label: "无参考范围",
},
{
value: "1",
label: "数字型参考范围",
},
{
value: "2",
label: "字符型参考范围",
},
{
value: "3",
label: "性激素参考范围",
},
], //参考范围下拉框
referencerangevalue: "0",
referencerangedialogVisible: false, //参考范围弹框
Selectvalue: "",
Selectacategory: [],
rurestdialogVisible: false,
isshow: true,
reusttableData: [],
initReusttableData:[],
tableData: [],
initTableData: [],
pages: {
Filter: "",
Sorting: "",
SkipCount: 0,
MaxResultCount: 100,
},
title: 1,
isProduceSummaryBox: true,
isNameIntoSummaryBox:true,
isDiagnosisFunctionBox:false,
isCalculationItemBox:false,
isContinueProcessBox:false,
isActiveBox:true,
// unitIdName:"",
diagnosisFunctionBox:false,
calculationFunctionBox:false,
form: {
displayName: "",
englishShortName: "",
itemTypeId: "",
price: "0",
priceItemId: null,
unitId: null,
defaultResult: "未见异常",
referenceRangeTypeFlag: "0",
isProduceSummary: "",
isNameIntoSummary: "",
isDiagnosisFunction: "",
diagnosisFunction: "",
isCalculationItem: "",
calculationFunction: "",
isContinueProcess: "",
resultTemplateTypeFlag: null,
inputCheck: "",
isActive: ""
},
referenceRangeTypeFlag: [
{
value: "0",
label: "无参考范围",
},
{
value: "1",
label: "数字型参考范围",
},
{
value: "2",
label: "字符型参考范围",
},
{
value: "3",
label: "性激素参考范围",
},
],
isProduceSummary: [
{
value: "Y",
label: "是",
},
{
value: "N",
label: "否",
},
], //生成小结
isNameIntoSummary: [
{
value: "Y",
label: "是",
},
{
value: "N",
label: "否",
},
], //名称进入小结
isDiagnosisFunction: [
{
value: "Y",
label: "是",
},
{
value: "N",
label: "否",
},
], //启用诊断函数
isCalculationItem: [
{
value: "Y",
label: "是",
},
{
value: "N",
label: "否",
},
], //是计算项目
isContinueProcess: [
{
value: "Y",
label: "是",
},
{
value: "N",
label: "否",
},
], //是继续处理
inputCheck: [
{
value: "Y",
label: "是",
},
{
value: "N",
label: "否",
},
], //输入结果校验公式
isActive: [
{
value: "Y",
label: "是",
},
{
value: "N",
label: "否",
},
], //启用
dialogVisible: false,
rules: {
displayName: [
{ required: true, message: "请输入名称", trigger: "blur" },
],
englishShortName: [
{ required: true, message: "请输入英文缩写", trigger: "blur" },
],
itemTypeId: [
{ required: true, message: "请输入项目类别", trigger: "blur" },
],
price: [{ required: true, message: "请输入价格", trigger: "blur" }],
priceItemId: [
{ required: true, message: "请输入价表项目编码", trigger: "blur" },
],
unitId: [{ required: true, message: "请输入单位", trigger: "blur" }],
defaultResult: [
{ required: true, message: "请输入默认结果", trigger: "blur" },
],
referenceRangeTypeFlag: [
{ required: true, message: "请输入参考范围类别", trigger: "blur" },
],
isProduceSummary: [
{ required: true, message: "请选择是生成小结", trigger: "blur" },
],
isNameIntoSummary: [
{ required: true, message: "请输择称进入小结", trigger: "blur" },
],
isDiagnosisFunction: [
{ required: true, message: "请选择启用诊断函数", trigger: "blur" },
],
diagnosisFunction: [
{ required: true, message: "请输入诊断函数", trigger: "blur" },
],
isCalculationItem: [
{ required: true, message: "请选择计算项目", trigger: "blur" },
],
calculationFunction: [
{ required: true, message: "请输入计算函数", trigger: "blur" },
],
isContinueProcess: [
{ required: true, message: "请选择继续处理", trigger: "blur" },
],
resultTemplateTypeFlag: [
{
required: true,
message: "请输入结果模板类别标志",
trigger: "blur",
},
],
inputCheck: [
{ required: true, message: "请选择结果校验公式", trigger: "blur" },
],
isActive: [{ required: true, message: "请选择启用", trigger: "blur" }],
},
rusetformcheck:{
result: [
{ required: true, message: "请输入名称", trigger: "blur" },
],
resultStatusId: [
{ required: true, message: "请选择结果状态", trigger: "blur" },
]
},
editdigoisceditingformcheck:{
result: [
{ required: true, message: "请输入名称", trigger: "blur" },
],
diagnosisId: [
{ required: true, message: "请选择诊断编号", trigger: "blur" },
]
},
unitId: [], //单位Id
priceItemId: [], //价格id1
result: [], //结果
forSexId: [], //性别
itemTypeId: [], //项目类别
diagnosisLevelId: [], //诊断级别
isIll: [
{
value: "Y",
label: "是",
},
{
value: "N",
label: "否",
},
], //是疾病
isSummaryTemplate: [
{
value: "Y",
label: "是",
},
{
value: "N",
label: "否",
},
], //总监模板
props: {
label: "displayName",
value: "id",
children: "treeChildren",
}, //左侧树形结构
newssdate: [
{
id: "1",
name: "",
},
{
id: "2",
name: "",
},
],
defaultResult: [
{
value: "1",
label: "未见异常",
},
{
value: "2",
label: "正常",
},
{
value: "3",
label: "阴性",
},
{
value: "4",
label: "无",
},
{
value: "5",
label: "(—)",
},
{
value: "6",
label: "­-",
},
], //默认结果
ssdate: [],
fssubdex: "",
resultitemtype: [], //项目类别
scopediagnostic: [], //诊断范围下拉框
reference: [], //参考范围
resulttemp: [], // 结果模板
disableddiagnosisFunction: true,
curRow: {},
diagnosisFunctionText:"",
calculationFunctionText:"",
quickAsb:[],
quckDepartment:[],
department:"",
quckeDitd:[],
editdigoisceDiagnosisId:"",
diagnostiele:1,
curRows:{},
curRowes:{},
fssubdexDete:"",
isshows:true,
isshowes:true,
initItemTypeId:""
};
},
created() {
// this.getlist();
this.getmedicalconclusionlist();
},
mounted() {
this.rowDrop();
this.typeid();
},
computed: {
...mapState(["window"]),
},
methods: {
//启用诊断函数
enablediagnostics(v) {
if (v == "N") {
this.disableddiagnosisFunction = true;
} else {
this.disableddiagnosisFunction = false;
}
},
// addfssubdex(){
// if(this.fssubdex){
// let obj = {
// itemId: this.form.id,
// referenceRangeValue: this.fssubdex,
// referenceRangeTypeFlag: this.referencerangevalue,
// };
// postapi("/api/app/reference-range/text", obj).then((res) => {
// if(res.code!=-1){
// this.$message.success("新增成功");
// this.fssubdex = "";
// }
// });
// }else{
// this.$message.warning("内容不能为空");
// }
// },
//参考范围确定类型
determinetype() {
this.referencerangedialogVisible = false;
if(this.referencerangevalue == 2){
if(this.fssubdex){
if(!this.fssubdexDete){
let obj = {
itemId: this.form.id,
referenceRangeValue: this.fssubdex,
referenceRangeTypeFlag: this.referencerangevalue,
};
postapi("/api/app/reference-range/text", obj).then((res) => {
if(res.code!=-1){
this.$message.success("新增成功");
this.fssubdex = "";
this.curRow.referenceRangeTypeFlag=this.referencerangevalue
}
});
}else{
let obj = {
itemId: this.form.id,
referenceRangeValue: this.fssubdex,
referenceRangeTypeFlag: this.referencerangevalue,
};
putapi(`/api/app/reference-range/${this.fssubdexDete.id}/text`, obj).then((res) => {
if(res.code!=-1){
this.$message.success("修改成功");
this.fssubdex = "";
this.curRow.referenceRangeTypeFlag=this.referencerangevalue
}
});
}
}else{
this.$message.warning("内容不能为空");
}
}else{
postapi("/api/app/item/updateitemreferencerangetypeflag", {
itemId:this.form.id,
referenceRangeTypeFlag:this.referencerangevalue
}).then((res) => {
if(res.code!=-1){
this.curRow.referenceRangeTypeFlag=this.referencerangevalue
}
});
}
},
async blurInput(id, name, value) {
var isdate = false; //是否存在
for (var i = 0; i < this.newssdate.length; i++) {
if (this.newssdate[i].id == id) {
isdate = true;
this.newssdate[i][name] = value;
}
}
if (!isdate) {
for (var j = 0; j < this.ssdate.length; j++) {
if (this.ssdate[j].id == id) {
this.newssdate.push(this.ssdate[j]);
}
}
}
//
},
treeclick(data) {
this.initItemTypeId=data.id
getapi(`/api/app/item/in-item-type/${data.id}`).then((res) => {
this.tableData = res.data;
this.initTableData=[...res.data]
// this.getlist();
});
},
typeid() {
projectlist().then((res) => {
this.itemTypeId = res.data;
this.itemTypeId=this.formatData(this.itemTypeId)
});
},
formatData(dataList){
for(let i=0;i<dataList.length;i++){
if(dataList[i].treeChildren.length<1){
dataList[i].treeChildren=undefined
}else{
this.formatData(dataList[i].treeChildren)
}
}
return dataList
},
//诊断新增获取数据
diagnosticsadd() {
this.$refs.editdigoisceditingform.validate((v) => {
if (v) {
if(this.diagnostiele==1){
postapi("/api/app/item-result-match", this.editdigoisceditingform).then((res) => {
if(res.code!=-1){
this.$message.success("添加成功");
this.diagnosticediting = false;
this.putDiagnosis()
}
});
}else if(this.diagnostiele==2){
putapi(
`/api/app/item-result-match/${this.editdigoisceditingform.id}`,{
itemId:this.editdigoisceditingform.itemId,
result:this.editdigoisceditingform.result,
diagnosisId:this.editdigoisceditingform.diagnosisId
}
).then((res) => {
if(res.code!=-1){
this.$message.success("修改成功");
this.diagnosticediting = false;
this.putDiagnosis()
}
});
}
}
});
},
diagnosick(row){
getapi(`/api/app/item-result-match/${row.id}`).then((res) => {
this.curRowes = res.data;
});
},
editDiagnosis(){
this.editdigoisceditingform={ ...this.curRowes }
if (this.editdigoisceditingform.id == undefined) {
this.$message.warning("请选择操作的数据");
}else{
this.diagnostiele=2
this.diagnosticediting = true
if (this.$refs.editdigoisceditingform !== undefined){
this.$refs.editdigoisceditingform.resetFields()
}
this.diageoisaddId();
}
},
deleteDiagnosis(){
this.editdigoisceditingform={ ...this.curRowes }
if (this.editdigoisceditingform.id == undefined) {
this.$message.warning("请选择操作的数据");
}else{
this.$confirm("是否确认删除,是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deletapi(`/api/app/item-result-match/${this.editdigoisceditingform.id}`).then(
(res) => {
if(res.code!=-1){
this.$message.success("删除成功");
Object.assign(this.$data.editdigoisceditingform, this.$options.data().editdigoisceditingform)
this.curRowes={}
this.putDiagnosis()
}
}
);
})
.catch(() => {});
}
},
putDiagnosis(){
postapi(`/api/app/itemresultmatch/getlistinitmeid`,{itemId:this.form.id}).then(
(res) => {
this.diagnosticdata = res.data;
this.initdiagnosticdata=[...res.data]
}
);
},
//增加诊断需要的Id
diageoisaddId() {
postapi("/api/app/diagnosis/getlistinsuggestion").then((res) => {
this.editdigoisceDiagnosisId = res.data;
this.quckeDitd=res.data;
});
},
// 增加诊断弹框
adddiagnosis() {
this.diageoisaddId();
this.diagnostiele=1
this.diagnosticediting = true;
if (this.$refs.editdigoisceditingform !== undefined){
this.$refs.editdigoisceditingform.resetFields()
}
this.$nextTick(() => {
this.$refs.editdiInput.focus();
});
Object.assign(this.$data.editdigoisceditingform, this.$options.data().editdigoisceditingform)
this.editdigoisceditingform.itemId = this.form.id;
},
//诊断匹配弹框获取诊断数据
//改成直接跳转到诊断页面
diagnosticmatching() {
this.form = { ...this.curRow };
this.diagnosdialogVisible = true;
this.putDiagnosis()
this.diageoisaddId()
this.$nextTick(()=>{
this.rowDropes()
})
},
quckEditdigoisce(e){
if(!e){
this.remoteMethodess()
}
},
changeUpdate(e){
this.$delete(this.rusetform,'result')
this.$set(this.rusetform,'result',e)
},
changeUpdates(e){
this.$delete(this.editdigoisceditingform,'result')
this.$set(this.editdigoisceditingform,'result',e)
},
//结果模板添加
resultaddition() {},
//模板类别弹框
// templatecategory() {
// getapi("/api/app/item-result-template").then((res) => {
// this.projectdata = res.data.items;
// console.log(res);
// });
// this.projectdialogVisible = true;
// },
//项目模板置底
bottoming() {
if (this.rusetform.id == undefined) {
this.$message.warning("请选择操作的数据");
} else {
putapi(
`/api/app/itemresulttemplate/updatemanysort?id=${this.rusetform.id}&SortType=2`
).then((res) => {
this.$message.success("操作成功");
this.resultlist();
});
}
},
//项目模板置顶
toppingqq() {
if (this.rusetform.id == undefined) {
this.$message.warning("请选择操作的数据");
} else {
putapi(
`/api/app/itemresulttemplate/updatemanysort?id=${this.rusetform.id}&SortType=1`
).then((res) => {
this.$message.success("操作成功");
this.resultlist();
});
}
},
//结果模板删除
delemtdelite() {
this.rusetform = { ...this.curRows };
if (this.rusetform.id == undefined) {
this.$message.warning("请选择操作的数据");
} else {
this.$confirm("是否确认删除,是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deletapi(`/api/app/item-result-template/${this.rusetform.id}`).then(
(res) => {
if(res.code!=-1){
this.$message.success("删除成功");
Object.assign(this.$data.rusetform, this.$options.data().rusetform)
this.curRows={}
this.resultlist();
}
}
);
})
.catch(() => {});
}
},
reustclick(row) {
// this.rusetform = row;
getapi(`/api/app/item-result-template/${row.id}`).then((res) => {
this.curRows = res.data;
});
},
//项目结果模板新增弹框
resultediting() {
this.rusetform = { ...this.curRows };
if (this.rusetform.id == undefined) {
this.$message.warning("请选择操作的数据");
} else {
this.addoredit();
this.ruesttiele = 2;
this.ruesttieledialogVisible = true;
if (this.$refs.rusetform !== undefined){
this.$refs.rusetform.resetFields()
}
}
},
//结果模板新增或者修改
rusteronsubmit() {
this.$refs.rusetform.validate((v) => {
if (v) {
if (this.ruesttiele == 1) {
if(this.rusetform.diagnosisId==""){
this.rusetform.diagnosisId=null
}
postapi(`/api/app/item-result-template`, this.rusetform).then((res) => {
if(res.code!=-1){
this.$message.success("新增成功");
this.ruesttieledialogVisible = false;
this.resultlist();
}
});
} else if (this.ruesttiele == 2) {
if(this.rusetform.diagnosisId==""){
this.rusetform.diagnosisId=null
}
putapi(
`/api/app/item-result-template/${this.rusetform.id}`,
this.rusetform
).then((res) => {
if(res.code!=-1){
this.$message.success("修改成功");
this.ruesttieledialogVisible = false;
this.resultlist();
}
});
}
}
});
},
//诊断设置弹框新增
diagnosticsettings() {
// this.diagnostisbox = true;
// console.log("1");
this.$router.push({ path: "/diagnosis" });
},
digitaladdion() {
// this.referencerangedata.push({
// gender: "全部",
// agewise: "200",
// underage: "下",
// onreference: "0",
// underreference: "上",
// });
},
//参考范围下拉选择
selecttype(v) {
this.referencerangevalue = v;
if(v=="2"){
getapi(`/api/app/reference-range/in-type/${this.form.id}?ReferenceRangeTypeFlag=${this.referencerangevalue}`).then((res) => {
if(res.code!=-1){
if(res.data[0]){
this.fssubdex=res.data[0].referenceRangeValue
}else{
this.fssubdex=""
}
this.fssubdexDete=res.data[0]
}
});
}
},
//参考范围
referencerange() {
this.form = { ...this.curRow };
if (this.form.id == undefined) {
this.$message.warning("请选择操作的数据");
} else {
this.referencerangevalue=this.form.referenceRangeTypeFlag
this.referencerangedialogVisible = true;
if(this.referencerangevalue=="2"){
getapi(`/api/app/reference-range/in-type/${this.form.id}?ReferenceRangeTypeFlag=${this.form.referenceRangeTypeFlag}`).then((res) => {
if(res.code!=-1){
if(res.data[0]){
this.fssubdex=res.data[0].referenceRangeValue
}else{
this.fssubdex=""
}
this.fssubdexDete=res.data[0]
}
});
}
}
},
//结果模板添加或者修改需要的列
addoredit() {
getapi("/api/app/item/in-filter").then((res) => {
this.itemId = res.data.items;
});
postapi("/api/app/diagnosis/getlistinsuggestion").then((res) => {
this.diagnosisId = res.data;
this.quickAsb=res.data;
});
},
//结果模板添加
increase() {
this.addoredit();
this.ruesttiele = 1;
this.ruesttieledialogVisible = true;
if (this.$refs.rusetform !== undefined){
this.$refs.rusetform.resetFields()
}
this.$nextTick(() => {
this.$refs.ruseInput.focus();
});
Object.assign(this.$data.rusetform, this.$options.data().rusetform)
this.rusetform.itemId = this.form.id;
},
quckRusetform(e){
if(!e){
this.remoteMethod()
}
},
//获取项目类别列表
getmedicalconclusionlist() {
getporjectlists(this.pages).then((res) => {
this.initTableData = [...res.data.items];
this.quckDepartment=res.data.items;
});
},
onchange(id) {
// this.form.customerOrgId = id;
// console.log(id);
// this.form.customerOrgId=this.form.customerOrgId[0]
if(this.form.itemTypeId){
this.form.itemTypeId.forEach((item) => {
// console.log(item);
this.form.itemTypeId = item;
});
}
},
gettypelist(listdata) {
listdata.forEach((items) => {
if (items.treeChildren.length > 0) {
this.gettypelist(items.treeChildren);
} else {
items.treeChildren = undefined;
}
});
},
isselctvalue(v) {
this.pages.TypeId = v;
this.getlist();
},
handleSelect(item) {
this.pages.Filter = item.displayName;
this.item = item;
this.formid = item.id;
//console.log(item);
// quersmedicalid(item.id).then((res) => {
// console.log(res);
// this.form = res.data;
// });
},
getlistM(rowsid) {
getporjectlists(this.pages).then((res) => {
this.initTableData = [...res.data.items];
this.tableData = res.data.items;
this.quckDepartment=res.data.items;
if (rowsid != null && rowsid != "") {
var row = this.tableData.filter((item) => item.id == rowsid);
this.$refs.tableData.setCurrentRow(row[0]);
getapi(`/api/app/item/${rowsid}`).then((res) => {
this.form = res.data;
});
}
});
},
selsearch(id, typeid) {
this.Selectvalue = typeid;
this.pages.TypeId = typeid;
this.getlistM(id);
},
createFilter(queryString) {
return (tableData) => {
return (
tableData.displayName
.toLowerCase()
.indexOf(queryString.toLowerCase()) != -1
);
};
},
querySearch(queryString, cb) {
var tableData = this.tableData;
var tableDatas = queryString
? tableData.filter(this.createFilter(queryString))
: tableData;
// 调用 callback 返回建议列表的数据
cb(tableDatas);
},
resultlist() {
getapi(`/api/app/item-result-template/in-item-id/${this.form.id}`).then(
(res) => {
this.reusttableData = res.data
this.initReusttableData=[...res.data]
}
);
},
resulttemplate() {
let that=this
this.form = { ...this.curRow };
if (this.form.id == undefined) {
this.$message.warning("请选择操作的数据");
} else {
this.rurestdialogVisible = true;
getapi(`/api/app/item-result-template/in-item-id/${this.form.id}`).then(
(res) => {
this.reusttableData = res.data
this.initReusttableData=[...res.data]
this.$nextTick(()=>{
that.rowDrops()
})
}
);
getapi("/api/app/result-status").then((res) => {
this.resultStatusId = res.data.items;
});
postapi("/api/app/diagnosis/getlistinsuggestion").then((res) => {
this.diagnosisId = res.data;
this.quickAsb=res.data;
});
// // 获取项目类别
// getapi("/api/app/item-type/by-code-all").then((res) => {
// this.resultitemtype = res.data;
// });
}
},
remoteMethod(keyWords) {
if (keyWords) {
this.quickAsb = [];
this.diagnosisId.forEach(item => {
if (item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
|| item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
// || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
) {
this.quickAsb.push(item);
}
});
} else {
this.quickAsb = deepCopy(this.diagnosisId);
}
},
remoteMethodes(keyWords) {
if (keyWords) {
this.quckDepartment = [];
this.initTableData.forEach(item => {
if (item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
|| item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
// || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
) {
this.quckDepartment.push(item);
}
});
} else {
this.quckDepartment = deepCopy(this.initTableData);
}
},
remoteMethodess(keyWords){
if (keyWords) {
this.quckeDitd = [];
this.editdigoisceDiagnosisId.forEach(item => {
if (item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
|| item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
// || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
) {
this.quckeDitd.push(item);
}
});
} else {
this.quckeDitd = deepCopy(this.editdigoisceDiagnosisId);
}
},
quckDepartments(e){
if(e){
let currentKey=""
this.quckDepartment.forEach(item=>{
if(e==item.id){
currentKey=item.itemTypeId
this.initItemTypeId=item.itemTypeId
}
})
this.$refs['itemType'].setCurrentKey(currentKey)
let selected = this.$refs['itemType'].getCurrentNode();
if (this.$refs['itemType'].getNode(selected) && this.$refs['itemType'].getNode(selected).parent) {
this.expandParents(this.$refs['itemType'].getNode(selected).parent);
}
getapi(`/api/app/item/in-item-type/${currentKey}`).then((res) => {
this.tableData = res.data;
this.tableData.forEach((item,index)=>{
if(e==item.id){
this.$refs['tableData'].setCurrentRow(item);
this.rowick(item)
this.tableScrollToRow(this.$refs.tableData, index)
}
})
});
}else{
this.remoteMethodes()
}
},
expandParents(node) {
node.expanded = true;
if (node.parent) {
this.expandParents(node.parent);
}
},
getChangeDiagnosis(e){
for (var i = 0; i < this.diagnosisId.length; i++) {
if (this.diagnosisId[i].id == e) { //dictValue,dictLabel保持和上面定义一致
return this.diagnosisId[i].displayName;
}
}
},
getChangeResult(e){
for (var i = 0; i < this.resultStatusId.length; i++) {
if (this.resultStatusId[i].id == e) { //dictValue,dictLabel保持和上面定义一致
return this.resultStatusId[i].displayName;
}
}
},
getChangeDiagnosies(e){
for (var i = 0; i < this.editdigoisceDiagnosisId.length; i++) {
if (this.editdigoisceDiagnosisId[i].id == e) { //dictValue,dictLabel保持和上面定义一致
return this.editdigoisceDiagnosisId[i].displayName;
}
}
},
tableScrollToRow(tableElement, rowIndex){
let theTableRows = tableElement.bodyWrapper.querySelectorAll('.el-table__body tbody .el-table__row')
let scrollTop = 0
for (let i = 0; i < theTableRows.length; i++) {
if (i === rowIndex) {
break
}
scrollTop += theTableRows[i].offsetHeight
}
tableElement.bodyWrapper.scrollTop = scrollTop
},
//取消排序
cancellation() {
this.$message.info("取消操作");
this.isshow = true;
this.tableData=this.initTableData
},
//确定拖拽
assertion() {
let result = [];
this.tableData.forEach((item, index) => {
// index 从0开始的, displayOrder从大到小排
// let currentDisplayOrder = this.tableData.length -1
let currentDisplayOrder = this.initTableData[index].displayOrder;
if (item.displayOrder != currentDisplayOrder) {
// 如果它的displayOrder和它当前所在的位置不同代表挪动过位置
result.push({ id: item.id, displayOrder: currentDisplayOrder });
}
});
projectdreog({ itemList: result }).then((res) => {
if(res.code!=-1){
this.$message.success("操作成功");
this.isshow = true;
}
// this.getlist();
});
},
//初始化
rowDrop() {
this.$nextTick(() => {
let tbody = document.querySelector(".el-table__body-wrapper tbody");
let _this = this;
Sortable.create(tbody, {
handle: ".move",
animation: 300,
onChoose({oldIndex}){
_this.$refs['tableData'].setCurrentRow(_this.tableData[oldIndex]);
_this.rowick(_this.tableData[oldIndex])
},
onEnd({ newIndex, oldIndex }) {
_this.isshow = false;
let currRow = _this.tableData.splice(oldIndex, 1)[0];
_this.tableData.splice(newIndex, 0, currRow);
_this.tableData.map((item, index) => {
if (index == newIndex && index == oldIndex) {
// console.log(item, "新数据");
} else if (index == oldIndex) {
} else if (index == newIndex) {
}
});
console.log(_this.tableData.map((item) => item.displayOrder));
console.log(_this.initTableData.map((item) => item.displayOrder));
},
});
});
},
//项目模板确定拖拽
assertions() {
let result = [];
this.reusttableData.forEach((item, index) => {
// index 从0开始的, displayOrder从大到小排
// let currentDisplayOrder = this.tableData.length -1
let currentDisplayOrder = this.initReusttableData[index].displayOrder;
if (item.displayOrder != currentDisplayOrder) {
// 如果它的displayOrder和它当前所在的位置不同代表挪动过位置
result.push({ id: item.id, displayOrder: currentDisplayOrder });
}
});
putapi("/api/app/itemresulttemplate/updatesortmany",{ itemList: result }).then((res) => {
if(res.code!=-1){
this.$message.success("操作成功");
this.isshows = true;
}
// this.getlist();
});
},
//结果模板初始化
rowDrops() {
this.$nextTick(() => {
let tbody = document.querySelector(".el-table__body-wrappers tbody");
let _this = this;
Sortable.create(tbody, {
handle: ".moves",
animation: 300,
onChoose({oldIndex}){
_this.$refs['reusttableData'].setCurrentRow(_this.reusttableData[oldIndex]);
_this.reustclick(_this.reusttableData[oldIndex])
},
onEnd({ newIndex, oldIndex }) {
_this.isshows = false;
let currRow = _this.reusttableData.splice(oldIndex, 1)[0];
_this.reusttableData.splice(newIndex, 0, currRow);
_this.reusttableData.map((item, index) => {
if (index == newIndex && index == oldIndex) {
// console.log(item, "新数据");
} else if (index == oldIndex) {
} else if (index == newIndex) {
}
});
},
});
});
},
//结果模板取消
resultcancellation(){
this.$message.info("取消操作");
this.isshows = true;
this.reusttableData=this.initReusttableData
},
//结果模板置顶
resulttopping(){
this.rusetform = { ...this.curRows };
if (this.rusetform.id == undefined) {
this.$message.warning("请点击选择操作的数据");
} else {
putapi(
`/api/app/itemresulttemplate/updatemanysort?id=${this.rusetform.id}&SortType=1`
).then((res) => {
if(res.code!=-1){
this.$message.success("操作成功");
this.resultlist();
}
});
}
},
//结果模板置底
resulttoppings(){
this.rusetform = { ...this.curRows };
if (this.rusetform.id == undefined) {
this.$message.success("请点击选择操作的数据");
} else {
putapi(
`/api/app/itemresulttemplate/updatemanysort?id=${this.rusetform.id}&SortType=2`
).then((res) => {
if(res.code!=-1){
this.$message.success("操作成功");
this.resultlist();
}
});
}
},
//诊断匹配确定拖拽
assertiones() {
let result = [];
this.diagnosticdata.forEach((item, index) => {
// index 从0开始的, displayOrder从大到小排
// let currentDisplayOrder = this.tableData.length -1
let currentDisplayOrder = this.initdiagnosticdata[index].displayOrder;
if (item.displayOrder != currentDisplayOrder) {
// 如果它的displayOrder和它当前所在的位置不同代表挪动过位置
result.push({ id: item.id, displayOrder: currentDisplayOrder });
}
});
putapi("/api/app/itemresultmatch/updatesortmany",{ itemList: result }).then((res) => {
if(res.code!=-1){
this.$message.success("操作成功");
this.isshowes = true;
}
// this.getlist();
});
},
//诊断匹配初始化
rowDropes() {
this.$nextTick(() => {
let tbody = document.querySelector(".el-table__body-wrapperes tbody");
let _this = this;
Sortable.create(tbody, {
handle: ".movess",
animation: 300,
onChoose({oldIndex}){
_this.$refs['diagnosticdata'].setCurrentRow(_this.diagnosticdata[oldIndex]);
_this.diagnosick(_this.diagnosticdata[oldIndex])
},
onEnd({ newIndex, oldIndex }) {
_this.isshowes = false;
let currRow = _this.diagnosticdata.splice(oldIndex, 1)[0];
_this.diagnosticdata.splice(newIndex, 0, currRow);
_this.diagnosticdata.map((item, index) => {
if (index == newIndex && index == oldIndex) {
// console.log(item, "新数据");
} else if (index == oldIndex) {
} else if (index == newIndex) {
}
});
},
});
});
},
//诊断匹配置顶
diagnosistopping(){
this.editdigoisceditingform={ ...this.curRowes }
if (this.editdigoisceditingform.id == undefined) {
this.$message.warning("请点击选择操作的数据");
} else {
putapi(
`/api/app/itemresultmatch/updatesortmany?id=${this.editdigoisceditingform.id}&SortType=1`
).then((res) => {
if(res.code!=-1){
this.$message.success("操作成功");
this.resultlist();
}
});
}
},
//诊断匹配置底
diagnosistoppings(){
this.editdigoisceditingform={ ...this.curRowes }
if (this.editdigoisceditingform.id == undefined) {
this.$message.warning("请点击选择操作的数据");
} else {
putapi(
`/api/app/itemresultmatch/updatesortmany?id=${this.editdigoisceditingform.id}&SortType=2`
).then((res) => {
if(res.code!=-1){
this.$message.success("操作成功");
this.resultlist();
}
});
}
},
//诊断匹配取消
diagnosiscancellation(){
this.$message.info("取消操作");
this.isshowes = true;
this.diagnosticdata=this.initdiagnosticdata
},
//置低
toppings() {
this.form = { ...this.curRow };
if (this.form.id == undefined) {
this.$message.success("请点击选择操作的数据");
} else {
projttitem(this.form.id, 2).then((res) => {
if(res.code!=-1){
this.$message.success("操作成功");
this.getItemTypeIdList();
}
});
}
},
//置顶
topping() {
this.form = { ...this.curRow };
if (this.form.id == undefined) {
this.$message.warning("请点击选择操作的数据");
} else {
projttitem(this.form.id, 1).then((res) => {
if(res.code!=-1){
this.$message.success("操作成功");
this.getItemTypeIdList();
}
});
}
},
//删除
delsrts() {
this.form = { ...this.curRow };
if (this.form.id == undefined) {
this.$message.warning("请选择删除的数据");
} else {
this.$confirm("是否确认删除,是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
projectdeleft(this.form.id).then((res) => {
this.$message.success("删除成功");
this.getItemTypeIdList();
Object.assign(this.$data.form, this.$options.data().form)
this.curRow=this.$options.data().curRow
});
})
.catch(() => {});
}
},
//点击列表通过id查询
rowick(row) {
posjrctid(row.id).then((res) => {
this.curRow = { ...res.data };
// console.log(res);
// this.form = res.data;
});
},
//编辑弹框
editpopup() {
this.form = { ...this.curRow };
console.log(this.form)
if (this.form.id == undefined) {
this.$message.warning("请选择操作的数据");
} else {
this.form.price = Number(this.form.price);
this.addorgropdata();
this.title = 2;
this.dialogVisible = true;
if (this.$refs.form !== undefined){
this.$refs.form.resetFields()
}
posjrctid(this.form.id).then((res) => {
if(res.code!=-1){
this.form = res.data;
if (res.data.isProduceSummary == 'Y') {
this.isProduceSummaryBox = true;
} else {
this.isProduceSummaryBox = false;
}
if (res.data.isNameIntoSummary == 'Y') {
this.isNameIntoSummaryBox = true;
} else {
this.isNameIntoSummaryBox = false;
}
if (res.data.isDiagnosisFunction == 'Y') {
this.isDiagnosisFunctionBox = true;
} else {
this.isDiagnosisFunctionBox = false;
}
if (res.data.isCalculationItem == 'Y') {
this.isCalculationItemBox = true;
} else {
this.isCalculationItemBox = false;
}
if (res.data.isContinueProcess == 'Y') {
this.isContinueProcessBox = true;
} else {
this.isContinueProcessBox = false;
}
if (res.data.isActive == 'Y') {
this.isActiveBox = true;
} else {
this.isActiveBox = false;
}
}
});
}
},
//编辑弹框勾选重新赋值
changeBox(type) {
//赋值
if(this[type+'Box']){
this.form[type] = 'Y';
}else{
this.form[type] = 'N';
}
},
// querySearch(queryString, cb) {
// var restaurants = this.unitId;
// var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
// // 调用 callback 返回建议列表的数据
// cb(results);
// },
// createFilter(queryString) {
// return (restaurant) => {
// return (restaurant.displayName.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
// };
// },
// handleSelect(item) {
// this.form.unitId=item.id
// },
OnsubmitDiagnosis(){
this.form.diagnosisFunction=this.diagnosisFunctionText
this.diagnosisFunctionText=''
this.diagnosisFunctionBox=false
this.$message.success("设置诊断函数成功");
},
OnsubmitCalculation(){
this.form.calculationFunction=this.calculationFunctionText
this.calculationFunctionText=''
this.calculationFunctionBox=false
this.$message.success("设置计算函数成功");
},
//确定新增或者编辑
Onsubmit() {
this.$refs.form.validate((v) => {
if (v) {
if (this.title == 1) {
this.form.price = Number(this.form.price);
addproject(this.form).then((res) => {
if (res.code == 1) {
this.$message.success("新增成功");
this.getItemTypeIdList();
this.dialogVisible = false;
this.$nextTick(()=>{
this.$refs['tableData'].setCurrentRow(res.data);
this.rowick(res.data)
})
}
});
} else if (this.title == 2) {
projectedit(this.form.id, this.form).then((res) => {
this.$message.success("修改成功");
this.tableData.forEach((item,index)=>{
if(res.data.id==item.id){
this.$set(this.tableData,index,res.data)
}
})
this.curRow={...res.data}
this.dialogVisible = false;
});
}
}
});
// addproject(this.form)
},
//新增弹框
add() {
if(this.initItemTypeId==undefined || this.initItemTypeId==""){
this.$message.warning('请选择项目类别')
}else{
this.form.price = Number(this.form.price);
// this.form={}
this.title = 1;
this.dialogVisible = true;
if (this.$refs.form !== undefined){
this.$refs.form.resetFields()
}
Object.assign(this.$data.form, this.$options.data().form)
this.isProduceSummaryBox=true
this.isNameIntoSummaryBox=true
this.isDiagnosisFunctionBox=false
this.isCalculationItemBox=false
this.isContinueProcessBox=false
this.isActiveBox=true
let isBox=["isProduceSummary","isNameIntoSummary","isActive"];
isBox.forEach(item=>{
this.form[item] = 'Y';
})
let isNotBox=["isDiagnosisFunction","isCalculationItem","isContinueProcess"]
isNotBox.forEach(item=>{
this.form[item] = 'N';
})
this.form.itemTypeId=this.initItemTypeId
// this.unitIdName=""
this.$nextTick(() => {
this.$refs.refinput.focus();
});
this.addorgropdata();
}
},
//新增或者编辑弹框需要的下拉框接口数据
addorgropdata() {
//获取项目id
// projectlist().then((res) => {
// this.itemTypeId = res.data;
// this.tcdate(this.itemTypeId);
// });
//获取单位
unitlist().then((res) => {
this.unitId = res.data.items;
});
//获取价格Id
priceitemlist().then((res) => {
this.priceItemId = res.data.items;
});
//参考范围
// getapi("/api/app/reference-range").then((res) => {
// this.reference = res.data.items;
// });
//结果模板
getapi("/api/app/item-result-template").then((res) => {
this.resulttemp = res.data.items;
});
},
getlist() {
this.getlistM();
// getporjectlists(this.pages).then((res) => {
// this.initTableData = [...res.data.items];
// this.tableData = res.data.items;
// });
},
getItemTypeIdList(){
getapi(`/api/app/item/in-item-type/${this.initItemTypeId}`).then((res) => {
if(res.code!=-1){
this.tableData = res.data;
}
});
},
tcdate(date) {
for (var i = 0; i < date.length; i++) {
if (date[i].treeChildren.length == 0) {
date[i].treeChildren = undefined;
} else {
this.tcdate(date[i].treeChildren);
}
}
},
///
},
};
</script>
<style scoped>
@import "../../assets/css/global_button.css";
@import "../../assets/css/global_dialog.css";
@import "../../assets/css/global_table.css";
@import "../../assets/css/global_form.css";
@import "../../assets/css/global_input.css";
@import "../../assets/css/global.css";
.commonbutton {
width:100px;
margin-bottom: 10px
}
::v-deep .el-table__header th {
/* font-size: px; */
background-color: rgb(245, 245, 245); /* 设置表头背景颜色 */
color: rgb(113, 113, 113); /* 设置表头文字颜色 */
}
.box {
display: flex;
width: 100%;
}
:deep(.el-textarea__inner){
resize: none;
}
:deep .el-dialog__header {
padding: 14px 20px 14px;
}
:deep .el-dialog__body {
padding: 0px 20px 0px;
}
:deep .el-form-item {
margin-bottom: 14px;
}
:deep .el-divider--horizontal {
margin: 0px 0 14px;
}
:deep .el-dialog__footer {
padding: 0px 20px 14px;
}
:deep .downText .el-input--suffix .el-input__inner {
width: 0;
height: 100%;
padding: 0 19px;
}
:deep .downText .el-input--suffix .el-input__suffix {
right: 12px;
}
:deep .downText{
display: flex!important;
}
:deep .el-input-group__append {
padding: 0 11px;
}
</style>
<style lang="scss">
.chosen td{
background-color: blue!important;
color: #fff;
}
//checkBox自定义禁用样式
.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
background-color: #409EFF !important;
border-color: #409EFF !important;
}
.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after {
border-color: #fff !important;
}
</style>