|
|
<template> <div class="box"> <div style="width: 95%"> <el-card class="elcard" style="border-radius: 15px"> <div class="publiccss">组合项目</div> <el-table :data="tableData" style="width: 100%; margin-top: 20px" row-key="id" height="300px" class="el-table__body-wrapper tbody" @row-click="rowick" highlight-current-row :row-style="{ height: '40px' }" > <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> <!-- 新增或者编辑弹框 --> <el-dialog :title="title == 1 ? '新增' : '编辑'" :visible.sync="dialogVisible" width="50%" @close="bindidclose" :close-on-click-modal="false" > <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px" > <el-row> <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="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="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="8"> <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-form-item> </el-col> <el-col :span="8"> <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-form-item> </el-col> <el-col :span="8"> <el-form-item label="临床意义" prop=""> <el-input v-model="form.clinicalMeaning"></el-input> </el-form-item> </el-col> <el-col :span="8"> <el-form-item label="默认结果" prop=""> <el-input v-model="form.defaultResult"></el-input> </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="8"> <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-form-item> </el-col> <el-col :span="8"> <el-form-item label="诊断函数" prop="diagnosisFunction"> <el-input v-model="form.diagnosisFunction" maxlength="1" show-word-limit ></el-input> </el-form-item> </el-col> <el-col :span="8"> <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-form-item> </el-col> <el-col :span="8"> <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-form-item> </el-col> <el-col :span="8"> <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-form-item> </el-col> <el-col :span="8"> <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-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> <!-- table页 --> <el-tabs v-model="activeName"> <el-tab-pane label="项目明细" name="first"> <div style="margin-top: 30px"> <span style="margin-top: 10px; padding: 5px; margin-left: 28.8%" >项目类别</span > <el-select v-model="values" placeholder="请选择" @change="ischangs" style="margin-top: 5px" > <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" > <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> </div> <div class="Selectbutton"> <div style="margin-top: 10px"> <el-button @click="addall" >全添加<i class="el-icon-caret-right"></i ><i class="el-icon-caret-right"></i ></el-button> </div> <div style="margin-top: 10px"> <el-button @click="addobj" style="width: 111px" >添加<i class="el-icon-caret-right"></i> </el-button> </div> <div style="margin-top: 10px"> <el-button @click="removeright" style="width: 111px" >移去<i class="el-icon-caret-left"></i> </el-button> </div> <div style="margin-top: 10px"> <el-button @click="allclear" >全移去<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> </div> </div> <div class="confirmcancellation"> <el-button :disabled="isdislob" @click="Onsubmit">确定</el-button> <el-button :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>
<!-- --> </el-card> </div> <!-- 指引信息新增修改弹框 --> <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> <!-- --> <!-- 按钮区域 --> <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 { 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: [], 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: "blur" }, ], 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: "", }, 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: [], //适用性别
}; }, created() { this.getlist(); this.gitprojectcategory(); }, mounted() { this.rowDrop(); this.gitfleslist(); this.getobtainguidance(); }, methods: { 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() { getapi("/api/app/item").then((res) => { this.filetelists = res.data.items; console.log(res, "我是项目"); }); }, //搜索选择
selectitem(v) { // this.itemid = v.id;
// this.rightdata.forEach((item) => {
// if (v.id != item.id) {
// } else {
// this.rightdata.push({ displayName: v.displayName });
// }
// });
// this.rightdata.push({ displayName: v.displayName });
console.log(v, "sssssssss"); }, Onsubmit() { let sampleGroupId = this.form.id; console.log(sampleGroupId); let sdate = []; console.log(this.rightdata, "2222"); // let sss = { itemId: this.itemid, asbitemId: sampleGroupId };
// sdate.push(sss);
this.rightdata.forEach((element) => { console.log("项目元素id", element.id); console.log("组合项目id", sampleGroupId); 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 == 0) { 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;
// });
// }
}, //右侧双击移动删除
rightdelite(item, index) { this.isdislob = false; this.rightdata.splice(this.num, 1); this.leftdata.push(item); this.isdislob = false; 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; console.log("res项目类别", res); }); }, //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
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, 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.getlist(); }, //确定排序
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) => { console.log(res, "3333"); 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) => { 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(); } }); }); // 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; asbitemgetid(this.form.id).then((res) => { this.form = res.data; }); //性别
// 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) => { this.$message.success("新增成功"); this.getlist(); this.form = {}; 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) => { this.$message.success("修改成功"); this.getlist(); this.dialogVisible = false; }); } } }); }, //新增弹框
addll() { this.dialogVisible = true; this.title = 1; 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; }); getapi( `/api/app/asbitem-detail/asbitem-detail-in-item?AsbitemId=${row.id}` ).then((res) => { this.rightdata = res.data; console.log(res, "右侧"); let dq = res.data; if (dq.length > 0) { this.rightdata = []; dq.forEach((element) => { let bb = { displayName: element.displayName, id: element.id }; this.rightdata.push(bb); }); } }); }, getlist() { groupsandlist(this.pages).then((res) => { this.initTableData = [...res.data.items]; this.tableData = res.data.items; console.log(res); }); }, },};</script><style scoped>::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: 6%;}.Selectbutton { margin-left: 3%;}.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: 48%;}.activetext { background: rgb(185, 203, 235);}.weixuan { text-align: center; line-height: 20px; background: rgb(185, 203, 235);}</style>
|