|
|
<template> <div class="box"> <div style="width: 95%"> <el-card> <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: 20px"> <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%;"> <el-table :data="tableData" style="width: 100%;" row-key="id" :height="window.pageHeight < 600 ? 695 : window.pageHeight - 415" class="el-table__body-wrapper tbody" @row-click="rowick" highlight-current-row :row-style="{ height: '40px' }" ref="tableData" > <el-table-column prop="id" label="编号" width="320"> </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="lastModifierName" 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="lastModificationTime" label="修改时间" width="200" > <template slot-scope="scope"> {{ scope.row.lastModificationTime | dateFormat }} </template> </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> <!-- table页 --> <el-tabs v-model="activeName"> <el-tab-pane label="项目明细" name="first"> <div> <span style="margin-top: 10px; padding: 5px; margin-left: 19.8%" >项目类别</span > <el-select v-model="values" placeholder="请选择" @change="ischangs" style="margin-top: 5px" filterable :filter-method="remoteMethod" default-first-option clearable > <el-option v-for="item in projectid" :key="item.id" :label="item.displayName" :value="item.id" > </el-option> </el-select> <span style="margin-left: 10%; padding: 5px">搜索选择</span> <el-select value-key="id" @change="selectitem" filterable v-model="flitvalues" placeholder="请选择" style="margin-top: 5px" :filter-method="remoteMethods" default-first-option clearable > <el-option v-for="item in filetelists" :key="item.id" :label="item.displayName" :value="item" > </el-option> </el-select> </div> <div class="mainbox"> <div class="mainleftbox"> <!-- <div class="weixuan">未选项目</div> <div v-for="(item, index) in leftdata" :key="index" @click="clickPaixu(item, index)" @dblclick="shuanji(item, index)" :class="num === index ? 'activetext' : ''" style="" > <div>{{ item.displayName }}</div> </div> --> <el-table :data="leftdata" :height="400" @row-dblclick="dbClickChoosedAsb" @selection-change="handleSelectionChange" size="small"> <el-table-column type="selection" align="center" /> <el-table-column prop="displayName" label="未选项目" /> </el-table> </div> <div class="Selectbutton"> <!-- <div style="margin-top: 18px"> <el-button @click="addall" style="width:100%;" >全添加<i class="el-icon-caret-right"></i ><i class="el-icon-caret-right"></i ></el-button> </div> --> <!-- <div style="margin-top: 18px"> <el-button @click="addobj" style="width: 111px" >添加<i class="el-icon-caret-right"></i> </el-button> </div> <div style="margin-top: 18px"> <el-button @click="removeright" style="width: 111px" >移去<i class="el-icon-caret-left"></i> </el-button> </div> --> <div style=""> <el-button @click="addAbs" style="width: 111px" >添加<i class="el-icon-caret-right"></i> </el-button> </div> <div style="margin-top: 35px"> <el-button @click="delAbs" style="width: 111px" >移除<i class="el-icon-caret-left"></i> </el-button> </div> <!-- <div style="margin-top: 18px"> <el-button @click="allclear" style="width:100%;" >全移去<i class="el-icon-caret-left"></i ><i class="el-icon-caret-left"></i> </el-button> </div> --> </div> <div class="mainleftbox"> <!-- <div class="weixuan">已选项目</div> <div v-for="(item, index) in rightdata" :key="index" @click="rightindex(item, index)" @dblclick="rightdelite(item, index)" :class="nums === index ? 'activetext' : ''" > <div>{{ item.displayName }}</div> </div> --> <el-table :data="rightdata" height="400" width="100%" @row-dblclick="removeAbs" @selection-change="selecteditems" size="small"> <el-table-column type="selection" align="center" /> <el-table-column label="已选项目" prop="displayName" /> </el-table> </div> </div> <div class="confirmcancellation"> <el-button type="" :disabled="isdislob" @click="Onsubmit">确定</el-button> <el-button type="" :disabled="isdislob">取消</el-button> </div> </el-tab-pane> <!-- 指引单信息 --> <el-tab-pane label="指引信息" name="second"> <div style="display: flex; width: 100%"> <div style="width: 90%"> <el-table :data="guidanceinformationdata" style="width: 100%" highlight-current-row @row-click="guiderow" > <el-table-column prop="guide" label="指引信息" width="180"> </el-table-column> <el-table-column prop="forSexId" label="性别" width="180"> </el-table-column> <el-table-column prop="address" label="地址"> </el-table-column> </el-table> </div> <div> <el-button type="" @click="createabulletbox" style="margin-top: 50px; margin-left: 30px" class="commonbutton" >创建</el-button > <div style="margin-top: 10px; margin-left: 30px"> <el-button type="" @click="deleteguidelines" class="commonbutton" >删除</el-button > </div> </div> </div> <!-- 科室改为体检中心 --> </el-tab-pane> </el-tabs> </div> </div> </el-card> </div> <!-- 新增或者编辑弹框 --> <el-dialog :title="title == 1 ? '新增' : '编辑'" :visible.sync="dialogVisible" width="70%" @close="bindidclose" :close-on-click-modal="false" > <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px" > <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-select v-model="form.itemTypeId" placeholder="请选择"> <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="shortName"> <el-input v-model="form.shortName"></el-input> </el-form-item> </el-col> <el-col :span="8"> <el-form-item label="适用性别" prop="forSexId"> <el-select v-model="form.forSexId" placeholder="请选择"> <el-option v-for="item in forSexId" :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="price"> <el-input v-model="form.price" type="number"></el-input> </el-form-item> </el-col> <el-col :span="8"> <el-form-item label="仪器类别" prop="deviceTypeId"> <el-select v-model="form.deviceTypeId" placeholder="请选择"> <el-option v-for="item in deviceTypeId" :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="invoiceItemTypeId"> <el-select v-model="form.invoiceItemTypeId" placeholder="请选择" > <el-option v-for="item in invoiceItemTypeId" :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="项目结果合并" prop="isItemResultMerger" label-width="110px" > <!-- <el-select v-model="form.isItemResultMerger" placeholder="请选择" > <el-option v-for="item in isItemResultMerger" :key="item.value" :label="item.label" :value="item.value" > </el-option> </el-select> --> <el-checkbox v-model="form.isItemResultMergerBox" @change="changeBox('isItemResultMerger')"/> </el-form-item> </el-col> <el-col :span="4"> <el-form-item label="餐前项目" prop="isBeforeEat"> <!-- <el-select v-model="form.isBeforeEat" placeholder="请选择"> <el-option v-for="item in isBeforeEat" :key="item.value" :label="item.label" :value="item.value" > </el-option> </el-select> --> <el-checkbox v-model="form.isBeforeEatBox" @change="changeBox('isBeforeEat')"/> </el-form-item> </el-col> <el-col :span="24"> <el-form-item label="临床意义" prop=""> <el-input v-model="form.clinicalMeaning" type="textarea" :autosize="{ minRows: 2, maxRows: 2}"/> </el-form-item> </el-col> <el-col :span="24"> <el-form-item label="默认结果" prop="" class="my-el-form-item"> <!-- <el-input v-model="form.defaultResult"></el-input> --> <div style="display: flex;justify-content: center;"> <el-input v-model="form.defaultResult" type="textarea" :autosize="{ minRows: 1, maxRows: 1}"/> <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-col> <el-col :span="4"> <el-form-item label="启用诊断" prop="isDiagnosisFunction"> <!-- <el-select v-model="form.isDiagnosisFunction" placeholder="请选择" > <el-option v-for="item in isDiagnosisFunction" :key="item.value" :label="item.label" :value="item.value" > </el-option> </el-select> --> <el-checkbox v-model="form.isDiagnosisFunctionBox" @change="changeBox('isDiagnosisFunction')"/> </el-form-item> </el-col> <el-col :span="8"> <el-form-item label="诊断函数" prop="diagnosisFunction"> <el-input v-model="form.diagnosisFunction" :disabled="disableddiagnosisFunction" > <el-button slot="append" icon="el-icon-more" v-if="form.isDiagnosisFunctionBox" @click="diagnosisFunctionBox=true"></el-button> </el-input> </el-form-item> </el-col> <el-col :span="4"> <el-form-item label="函数处理完毕" prop="isContinueProcess" label-width="110px" > <!-- <el-select v-model="form.isContinueProcess" placeholder="请选择" > <el-option v-for="item in isContinueProcess" :key="item.value" :label="item.label" :value="item.value" > </el-option> </el-select> --> <el-checkbox v-model="form.isContinueProcessBox" @change="changeBox('isContinueProcess')"/> </el-form-item> </el-col> <el-col :span="8"> <el-form-item label="候诊时间" prop="queueTime"> <el-input v-model="form.queueTime" type="nember"></el-input> </el-form-item> </el-col> <el-col :span="4"> <el-form-item label="体检报告" prop="isPictureRotate"> <!-- <el-select v-model="form.isPictureRotate" placeholder="请选择" > <el-option v-for="item in isPictureRotate" :key="item.value" :label="item.label" :value="item.value" > </el-option> </el-select> --> <el-checkbox v-model="form.isPictureRotateBox" @change="changeBox('isPictureRotate')"/> </el-form-item> </el-col> <el-col :span="4"> <el-form-item label="检查项目" prop="isCheck"> <!-- <el-select v-model="form.isCheck" placeholder="请选择"> <el-option v-for="item in isCheck" :key="item.value" :label="item.label" :value="item.value" > </el-option> </el-select> --> <el-checkbox v-model="form.isCheckBox" @change="changeBox('isCheck')"/> </el-form-item> </el-col> <el-col :span="4"> <el-form-item label="启用" prop="isActive"> <!-- <el-select v-model="form.isActive" placeholder="请选择"> <el-option v-for="item in isActive" :key="item.value" :label="item.label" :value="item.value" > </el-option> </el-select> --> <el-checkbox v-model="form.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="addoredit">确 定</el-button> </span> </el-dialog> <!-- 指引信息新增修改弹框 --> <el-dialog :title="guidetitle == 1 ? '指引信息新增' : '指引信息修改'" :visible.sync="guidetitledialogVisible" width="50%" > <el-row> <el-form :model="guideform" :rules="guiderules" ref="ruleForms" label-width="100px" class="demo-ruleForm" > <el-col :span="12"> <el-form-item label="体检中心" prop="organizationUnitId"> <el-select v-model="guideform.organizationUnitId" placeholder="请选择" > <el-option v-for="item in organizationUnitdata" :key="item.id" :label="item.displayName" :value="item.id" > </el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="组合项目" prop="asbitemId"> <el-select v-model="guideform.asbitemId" placeholder="请选择"> <el-option v-for="item in asbitemdata" :key="item.id" :label="item.displayName" :value="item.id" > </el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="适用性别" prop="forSexId"> <el-select v-model="guideform.forSexId" placeholder="请选择"> <el-option v-for="item in forsexdata" :key="item.id" :label="item.displayName" :value="item.id" > </el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="指引内容" prop="guide"> <el-input v-model="guideform.guide" placeholder="请输入内容" style="width: 60%" ></el-input> </el-form-item> </el-col> </el-form> </el-row> <span slot="footer" class="dialog-footer"> <el-button @click="guidetitledialogVisible = false">取 消</el-button> <el-button type="primary" @click="determineguidelines">确 定</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"></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> <!-- 按钮区域 --> <div style="margin-left: 10px; margin-top: 5%"> <el-button type="" @click="addll" class="commonbutton">新增</el-button> <div style="margin-top: 10px"> <el-button type="" @click="editpopup" class="commonbutton" >编辑</el-button > </div> <div style="margin-top: 10px"> <el-button type="" @click="deleteid" class="commonbutton" >删除</el-button > </div> <div style="margin-top: 10px"> <el-button type="" @click="topping" class="commonbutton" >置顶</el-button > </div> <div style="margin-top: 10px"> <el-button type="" @click="setlow" class="commonbutton">置底</el-button> </div> <div style="margin-top: 10px"> <el-button type="" :disabled="isshow" @click="assertion" class="commonbutton" >排序</el-button > </div> <div style="margin-top: 10px"> <el-button type="" :disabled="isshow" @click="cancellation" class="commonbutton" >取消</el-button > </div> </div> </div></template><script>import { mapState } from "vuex";import Sortable from "sortablejs";import { getapi, postapi, deletapi } from "@/api/api";import { examinationgender, instrumentlist } from "@/request/systemapi";import { getporjectlists} from "@/request/commonapi";import { deepCopy,objCopy} from "../../utlis/proFunc";import { groupsandlist, projectlist, invoicetypelist, newcombination, asbitemgetid, updateombination, samplesetlow, deletescombinationprojectid, combination,} from "@/request/commonapi";export default { data() { return { guiderules: { organizationUnitId: [ { required: true, message: "请选择体检单位", trigger: "change", }, ], asbitemId: [ { required: true, message: "请选择组合项目", trigger: "change", }, ], forSexId: [ { required: true, message: "请选择组适用性别", trigger: "change", }, ], guide: [{ required: true, message: "请输入指引内容", trigger: "blur" }], }, guidetitle: 1, guideform: { organizationUnitId: "", asbitemId: "", forSexId: "", guide: "", }, //指引信息的数据对象
organizationUnitdata: [], //体检中心
guidetitledialogVisible: false, guidanceinformationdata: [], activeName: "first", isdislob: true, filetelists: [], flitvalues: [], num: 0, isshow: true, values: [], projectid: [], initprojectid:[], rules: { displayName: [ { required: true, message: "请输入名称", trigger: "blur" }, ], shortName: [{ required: true, message: "请输入简称", trigger: "blur" }], forSexId: [ { required: true, message: "请选择适用性别", trigger: "blur" }, ], itemTypeId: [ { required: true, message: "请选择项目类别", trigger: "blur" }, ], price: [{ required: true, message: "请输入价格", trigger: "blur" }], deviceTypeId: [ { required: true, message: "请选择仪器类别", trigger: "blur" }, ], invoiceItemTypeId: [ { required: true, message: "请选择发票类别", trigger: "blur" }, ], isItemResultMerger: [ { required: true, message: "请选择项目结果", trigger: "blur" }, ], isBeforeEat: [ { required: true, message: "请选择餐前项目", trigger: "change" }, ], clinicalMeaning: [ { required: true, message: "请输入临床意义", trigger: "blur" }, ], defaultResult: [ { required: true, message: "请输入默认结果", trigger: "blur" }, ], queueTime: [ { required: true, message: "请输入候诊时间", trigger: "blur" }, ], isDiagnosisFunction: [ { required: true, message: "请选择启用诊断函数", trigger: "blur" }, ], diagnosisFunction: [ { required: true, message: "请输入诊断函数", trigger: "blur" }, ], isContinueProcess: [ { required: true, message: "请选择诊断函数处理完毕后继续处理", trigger: "blur", }, ], isPictureRotate: [ { required: true, message: "请选择体检报告图片旋", trigger: "blur" }, ], isCheck: [ { required: true, message: "请选择是检查项目", trigger: "blur" }, ], isActive: [ { required: true, message: "请选择是否启用", trigger: "blur" }, ], }, //表单校验对象
form: { displayName: "", shortName: "", forSexId: "", itemTypeId: "", price: "", deviceTypeId: "", invoiceItemTypeId: "", isItemResultMerger: "", isBeforeEat: "", clinicalMeaning: "", defaultResult: "", queueTime: "", isDiagnosisFunction: "", diagnosisFunction: "", isContinueProcess: "", isPictureRotate: "", isCheck: "", isActive: "", isActiveBox:true, isBeforeEatBox:false, isCheckBox:false, isContinueProcessBox:false, isDiagnosisFunctionBox:false, isItemResultMergerBox:false, isPictureRotateBox:false }, forSexId: [], //性别
itemTypeId: [], //项目类别
deviceTypeId: [], //仪器类别
invoiceItemTypeId: [], //发票类别
isItemResultMerger: [ { value: "Y", label: "是", }, { value: "N", label: "否", }, ], //项目结果合并
isBeforeEat: [ { value: "Y", label: "是", }, { value: "N", label: "否", }, ], //餐前项目
isDiagnosisFunction: [ { value: "Y", label: "是", }, { value: "N", label: "否", }, ], //启用诊断函数
isContinueProcess: [ { value: "Y", label: "是", }, { value: "N", label: "否", }, ], //诊断函数处理完毕
isContinueProcess: [ { value: "Y", label: "是", }, { value: "N", label: "否", }, ], //诊断函数处理完毕后继续处理
isPictureRotate: [ { value: "Y", label: "是", }, { value: "N", label: "否", }, ], //体检报告图片旋转
isCheck: [ { value: "Y", label: "是", }, { value: "N", label: "否", }, ], //是检查项目
isActive: [ { value: "Y", label: "是", }, { value: "N", label: "否", }, ], //是否启用
title: 1, dialogVisible: false, isshow: true, tableHeight: window.innerHeight - 180, //表格动态高度
screenHeight: window.innerHeight, //内容区域高度
pages: { Filter: "", SkipCount: 0, MaxResultCount: 100, Sorting: "displayOrder desc", }, tableData: [], initTableData: [], leftdata: [], ary2: [], ary1: [], rightobj: {}, rightdata: [], rightobj: {}, nums: 0, itemid: "", //项目id
curRow: {}, asbitemdata: [], //组合项目
forsexdata: [], //适用性别
department:"", quckDepartment:[], treeprops: { label: "displayName", value: "id", children: "treeChildren", }, defaultResult: [ { value: "1", label: "未见异常", }, { value: "2", label: "正常", }, { value: "3", label: "阴性", }, { value: "4", label: "无", }, { value: "5", label: "(—)", }, { value: "6", label: "-", }, ], diagnosisFunctionBox:false, diagnosisFunctionText:"", disableddiagnosisFunction:true, initfiletelists:[] }; }, created() { this.getlist(); this.gitprojectcategory(); }, mounted() { this.rowDrop(); this.gitfleslist(); this.getobtainguidance(); this.typeid() }, computed: { ...mapState(["window"]), }, methods: { remoteMethods(keyWords) { if (keyWords) { this.filetelists = []; this.initfiletelists.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.filetelists.push(item); } }); } else { this.filetelists = deepCopy(this.initfiletelists); } }, remoteMethod(keyWords) { if (keyWords) { this.projectid = []; this.initprojectid.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.projectid.push(item); } }); } else { this.projectid = deepCopy(this.initprojectid); } }, OnsubmitDiagnosis(){ this.form.diagnosisFunction=this.diagnosisFunctionText this.diagnosisFunctionText='' this.diagnosisFunctionBox=false this.$message.success("设置诊断函数成功"); }, changeBox(type) { //赋值
if(this.form[type+'Box']){ this.$delete(this.form,type) this.$set(this.form,type,"Y") }else{ this.$delete(this.form,type) this.$set(this.form,type,"N") } }, typeid() { projectlist().then((res) => { this.itemTypeId = res.data; }); }, treeclick(data) { getapi(`/api/app/asbitem/in-item-type/${data.id}`).then((res) => { this.tableData = res.data; console.log(res.data, "ress"); // this.getlist();
}); }, 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); } }, quckDepartments(e){ if(e){ let currentKey="" this.quckDepartment.forEach(item=>{ if(e==item.id){ currentKey=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/asbitem/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); } }, 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 }, guiderow(row) { this.guideform = row; }, //指引信息删除
deleteguidelines() { console.log(this.guideform.asbitemId); if (this.guideform.asbitemId == "") { this.$message.warning("请选择删除的数据"); } else { deletapi( `/api/app/asbitem-guide?OrganizationUnitId=${this.guideform.organizationUnitId}&AsbitemId=${this.guideform.AsbitemId}&ForSexId=${this.guideform.forSexId}` ).then((res) => { this.$message.warning(res.message); console.log(res); }); console.log(this.guideform); } }, //确定新增或者修改指引ruleForm
determineguidelines() { this.$refs.ruleForms.validate((v) => { if (v) { postapi("/api/app/asbitem-guide", this.guideform).then((res) => { // if (res.code == 1) {
this.guidetitledialogVisible = false; this.getobtainguidance(); this.$message.success("创建成功"); // }
}); } }); }, //新增或者编辑需要的api中的id
publicapi() { //获取体检中心
getapi("/api/app/organization-units/by-code-all").then((res) => { this.organizationUnitdata = res.data; }); //获取组合项目
getapi("/api/app/asbitem/in-filter").then((res) => { this.asbitemdata = res.data.items; }); //获取适用性别
getapi("/api/app/for-sex").then((res) => { this.forsexdata = res.data; }); }, //创建弹框
createabulletbox() { this.guidetitledialogVisible = true; this.guideform = {}; this.guidetitle = 1; this.publicapi(); }, //获取指引信息guidanceinformationdata
getobtainguidance() { getapi("/api/app/asbitem-guide").then((res) => { this.guidanceinformationdata = res.data; console.log(res, "指引信息"); }); }, //获取项目
gitfleslist() { let pages={ Filter: "", Sorting: "", SkipCount: 0, MaxResultCount: 100 } getporjectlists(pages).then((res) => { this.filetelists = res.data.items; this.initfiletelists=[...res.data.items] }); }, //搜索选择
selectitem(v) { console.log(v) this.itemid = v.id; this.rightdata.forEach((item) => { if (v.id = item.id) { this.$message.warning("已有该项目"); } else { this.rightdata.push({ displayName: v.displayName,id:v.id }); } }); }, Onsubmit() { let sampleGroupId = this.form.id; let sdate = []; // let sss = { itemId: this.itemid, asbitemId: sampleGroupId };
// sdate.push(sss);
this.rightdata.forEach((element) => { sdate.push({ asbitemId: sampleGroupId, itemId: element.id }); }); // this.leftdata.forEach((element) => {
// sdate.push({ asbitemId: sampleGroupId, itemId: element.id });
// });
// this.leftdata.forEach((element) => {
// let sss = { sampleGroupId: sampleGroupId, asbitemId: element.id };
// sdate.push(sss);
// });
// sdate.push(sss);
postapi("/api/app/asbitem-detail/many", sdate).then((res) => { if (res.code!=-1) { this.$message.success("操作成功"); this.isdislob = true; } }); // console.log(sdate);
// if (sampleGroupId == undefined) {
// this.$message.warning("请选择列表");
// } else if (this.itemid == "") {
// this.$message.warning("请选择项目");
// } else {
// postapi("/api/app/asbitem-detail/many", sdate).then((res) => {
// this.$message.success("操作成功");
// this.isdislob = true;
// });
// }
}, dbClickChoosedAsb(row, column, event){ let index = this.leftdata.findIndex((arr) => arr.id == row.id); this.leftdata.splice(index, 1); this.rightdata.push(row); this.isdislob = false; }, handleSelectionChange(val){ this.ary1=val }, addAbs(){ if(this.ary1.length<1){ this.$message.warning('请选择要添加的项目') }else{ let temporaryLeft=[] temporaryLeft = this.leftdata.filter(item => !this.ary1.some(ele=>ele.id === item.id)); this.leftdata=[...temporaryLeft] this.ary1.forEach(item=>{ this.rightdata.push(item); }) this.isdislob = false; } }, removeAbs(row){ let index = this.rightdata.findIndex((arr) => arr.id == row.id); this.rightdata.splice(index, 1); this.leftdata.push(row); this.isdislob = false; }, selecteditems(val){ this.ary2=val }, delAbs(){ if(this.ary2.length<1){ this.$message.warning('请选择要移除的项目') }else{ let temporaryRight=[] temporaryRight = this.rightdata.filter(item => !this.ary2.some(ele=>ele.id === item.id)); this.rightdata=[...temporaryRight] this.ary2.forEach(item=>{ this.leftdata.push(item); }) this.isdislob = false; } }, //右侧双击移动删除
rightdelite(item, index) { this.isdislob = false; this.rightdata.splice(index, 1); this.leftdata.push(item); // this.updatedate();
}, //右侧点击选中
rightindex(item, index) { this.nums = index; this.leftobj = item; // console.log(this.leftobj);
}, //左侧添加按钮
addobj() { if (this.leftdata.length > 0) { this.leftdata.splice(this.num, 1); this.rightdata.push(this.rightobj); this.isdislob = false; } }, //右移动
removeright() { if (this.rightdata.length > 0) { this.rightdata.splice(this.num, 1); this.leftdata.push(this.leftobj); this.isdislob = false; // this.isdislob=false
this.updatedate(); } }, //q全移去
allclear() { this.isdislob = false; if (this.rightdata.length > 0) { this.ary1 = this.rightdata; this.ary2 = this.leftdata; this.updatedate(); this.rightdata = []; } }, //全添加
addall() { this.isdislob = false; if (this.leftdata.length > 0) { this.ary1 = this.leftdata; this.ary2 = this.rightdata; this.updatedate(); this.leftdata = []; } }, //左侧双击事件
shuanji(item, index) { console.log(item); this.leftdata.splice(index, 1); this.rightdata.push(item); this.isdislob = false; }, clickPaixu(item, index) { this.rightobj = item; this.num = index; console.log(this.num); }, //获取项目类别 3a0b0b10-719f-5824-6956-8cb70f204013 /api/app/item-type/by-code-all
gitprojectcategory() { getapi("/api/app/item-type/by-code-all").then((res) => { this.projectid = res.data; this.initprojectid=[...res.data] }); }, //ary1 需要追加的数据 ary2目标数组
updatedate() { this.ary1.forEach((item) => { let iscz = false; this.ary2.forEach((item2) => { if (item2.id == item.id) { iscz = true; } }); if (!iscz) { console.log(item.id); this.ary2.push(item); // this.allid.push({ id: item.id });
} }); }, //项目类别选择
ischangs(v) { console.log(v);
//`/api/app/diagnosis/in-item-type/${v}`3a0c50b9-9621-61b7-fc93-1cfab1ec0478
if(v){ getapi(`/api/app/item/in-item-type/${v}`).then((res) => { console.log(res); this.leftdata = res.data; }); } }, bindidclose() { this.form = {}; }, rowDrop() { this.$nextTick(() => { const tbody = document.querySelector(".el-table__body-wrapper tbody"); const _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; const currRow = _this.tableData.splice(oldIndex, 1)[0]; _this.tableData.splice(newIndex, 0, currRow); _this.tableData.map((item, index) => { if (index == newIndex && index == oldIndex) { } else if (index == oldIndex) { } else if (index == newIndex) { } }); console.log(_this.tableData.map((item) => item.displayOrder)); }, }); }); }, //取消按钮
cancellation() { this.$message.info("操作取消"); this.isshow = true; this.tableData=this.initTableData }, //确定排序
assertion() { const result = []; this.tableData.forEach((item, index) => { const currentDisplayOrder = this.initTableData[index].displayOrder; if (item.displayOrder != currentDisplayOrder) { result.push({ id: item.id, displayOrder: currentDisplayOrder }); } }); combination({ itemList: result }).then((res) => { this.$message.success("操作成功"); this.isshow = true; // this.getlist();
}); }, //置底
setlow() { this.form = { ...this.curRow }; if (this.form.id == undefined) { this.$message.warning("请选择操作的数据"); } else { samplesetlow(this.form.id, 2).then((res) => { if(res.code!=-1){ this.getlist(); this.$message.success("操作成功"); } }); } }, //置顶
topping() { this.form = { ...this.curRow }; if (this.form.id == undefined) { this.$message.warning("请选择操作的数据"); } else { samplesetlow(this.form.id, 1).then((res) => { if(res.code!=-1){ this.$message.success("操作成功"); this.getlist(); } }); } }, //删除
deleteid() { this.form = { ...this.curRow }; if (this.form.id == undefined) { this.$message.warning("请选择操作的数据"); } else { this.$confirm("是否确认删除, 是否继续?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning", }).then(() => { deletescombinationprojectid(this.form.id).then((res) => { console.log(res); if (res.code == 1) { this.$message.success("删除成功"); this.getlist(); this.form = {}; } }); }); // deletescombinationprojectid(this.form.id).then((res) => {
// this.$message.success("删除成功");
// this.getlist();
// });
} }, //编辑弹框
editpopup() { this.form = { ...this.curRow }; if (this.form.id == undefined) { this.$message.warning("请点击选择操作的数据"); } else { this.dialogVisible = true; this.title = 2; if (this.$refs.ruleForm !== undefined){ this.$refs.ruleForm.resetFields() } asbitemgetid(this.form.id).then((res) => { if (res.data.isItemResultMerger == 'Y') { this.form.isItemResultMergerBox = true; } else { this.form.isItemResultMergerBox = false; } if (res.data.isBeforeEat == 'Y') { this.form.isBeforeEatBox = true; } else { this.form.isBeforeEatBox = false; } if (res.data.isDiagnosisFunction == 'Y') { this.form.isDiagnosisFunctionBox = true; } else { this.form.isDiagnosisFunctionBox = false; } if (res.data.isContinueProcess == 'Y') { this.form.isContinueProcessBox = true; } else { this.form.isContinueProcessBox = false; } if (res.data.isPictureRotate == 'Y') { this.form.isPictureRotateBox = true; } else { this.form.isPictureRotateBox = false; } if (res.data.isCheck == 'Y') { this.form.isCheckBox = true; } else { this.form.isCheckBox = false; } if (res.data.isActive == 'Y') { this.form.isActiveBox = true; } else { this.form.isActiveBox = false; } objCopy(res.data, this.form); }); console.log(this.form) //性别
// examinationgender().then((res) => {
// this.forSexId = res.data;
// });
//适用性别
getapi("/api/app/for-sex").then((res) => { this.forSexId = res.data; }); //项目类别
projectlist().then((res) => { this.itemTypeId = res.data; }); //仪器类别
instrumentlist().then((res) => { this.deviceTypeId = res.data.items; console.log(this.deviceTypeId); }); //发票项目类别
invoicetypelist().then((res) => { this.invoiceItemTypeId = res.data.items; }); } }, //确定新增或者编辑
addoredit() { this.$refs.ruleForm.validate((v) => { if (v) { if (this.title == 1) { let obj = { displayName: this.form.displayName, shortName: this.form.shortName, forSexId: this.form.forSexId, itemTypeId: this.form.itemTypeId, price: Number(this.form.price), deviceTypeId: this.form.deviceTypeId, invoiceItemTypeId: this.form.invoiceItemTypeId, isItemResultMerger: this.form.isItemResultMerger, isBeforeEat: this.form.isBeforeEat, clinicalMeaning: this.form.clinicalMeaning, defaultResult: this.form.defaultResult, queueTime: this.form.queueTime, isDiagnosisFunction: this.form.isDiagnosisFunction, diagnosisFunction: this.form.diagnosisFunction, isContinueProcess: this.form.isContinueProcess, isPictureRotate: this.form.isPictureRotate, isCheck: this.form.isCheck, isActive: this.form.isActive, }; newcombination(obj).then((res) => { if(res.data!=-1){ this.$message.success("新增成功"); this.getlist(); this.dialogVisible = false; } }); } else if (this.title == 2) { let obj = { displayName: this.form.displayName, shortName: this.form.shortName, forSexId: this.form.forSexId, itemTypeId: this.form.itemTypeId, price: Number(this.form.price), deviceTypeId: this.form.deviceTypeId, invoiceItemTypeId: this.form.invoiceItemTypeId, isItemResultMerger: this.form.isItemResultMerger, isBeforeEat: this.form.isBeforeEat, clinicalMeaning: this.form.clinicalMeaning, defaultResult: this.form.defaultResult, queueTime: this.form.queueTime, isDiagnosisFunction: this.form.isDiagnosisFunction, diagnosisFunction: this.form.diagnosisFunction, isContinueProcess: this.form.isContinueProcess, isPictureRotate: this.form.isPictureRotate, isCheck: this.form.isCheck, isActive: this.form.isActive, }; updateombination(this.form.id, obj).then((res) => { if(res.code!=-1){ 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; } }); } } }); }, //新增弹框
addll() { this.dialogVisible = true; this.title = 1; if (this.$refs.ruleForm !== undefined){ this.$refs.ruleForm.resetFields() } Object.assign(this.$data.form, this.$options.data().form) console.log(this.form) this.$nextTick(() => { this.$refs.refinput.focus(); }); //性别
examinationgender().then((res) => { console.log(res); this.forSexId = res.data; console.log(this.forSexId); }); //项目类别
projectlist().then((res) => { this.itemTypeId = res.data; }); //仪器类别
instrumentlist().then((res) => { this.deviceTypeId = res.data.items; }); //发票项目类别
invoicetypelist().then((res) => { this.invoiceItemTypeId = res.data.items; }); }, rowick(row) { asbitemgetid(row.id).then((res) => { this.curRow = { ...res.data }; this.form = res.data; }); this.values=row.itemTypeId getapi( `/api/app/asbitem-detail/asbitem-detail-in-item?AsbitemId=${row.id}` ).then((res) => { this.rightdata = [...res.data]; getapi(`/api/app/item/in-item-type/${row.itemTypeId}`).then((res) => { // this.leftdata = [...res.data];
let dq=res.data let bq=[] bq = res.data.filter(item => !this.rightdata.some(ele=>ele.id === item.id)); this.leftdata = [...bq]; }); }); }, getlist() { groupsandlist(this.pages).then((res) => { this.initTableData = [...res.data.items]; this.tableData = res.data.items; this.quckDepartment=res.data.items; console.log(res); }); }, },};</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";::v-deep .el-table__header th { /* font-size: px; */ background-color: rgb(245, 245, 245); /* 设置表头背景颜色 */ color: rgb(113, 113, 113); /* 设置表头文字颜色 */}::v-deep .el-table td.el-table__cell,.el-table th.el-table__cell.is-leaf { padding: 0;}.mainleftbox { width: 200px; height: 240px; border: 1px solid #ccc; margin-left: 3%; overflow-y: scroll;}.Selectbutton { margin-left: 3%; display: flex; flex-direction: column; justify-content: center; align-items: center;}.mainbox { display: flex; justify-content: center; margin-top: 20px;}.weixuan { text-align: center; line-height: 20px; background: rgb(185, 203, 235);}.leftbox { width: 200px; height: 240px; border: 1px solid #ccc;}.instrumentcategory { width: 100%; display: flex;}.box { display: flex;}.confirmcancellation { margin-left: 46%;}.activetext { background: rgb(185, 203, 235);}.weixuan { text-align: center; line-height: 20px; background: rgb(185, 203, 235);}:deep .el-form-item { margin-bottom: 14px;}:deep(.el-textarea__inner){ resize: none; } :deep .el-dialog__header { padding: 11px 20px 11px;}:deep .el-dialog__body { padding: 0px 20px 0px;}:deep .el-form-item { margin-bottom: 14px;}:deep .el-divider--horizontal { margin: 0px 0 12px;}: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;}.my-el-form-item :deep .el-form-item__content{ line-height: 0!important;}.my-el-form-item :deep .el-input__icon{ line-height: 0!important;}</style>
|