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.
1072 lines
32 KiB
1072 lines
32 KiB
<template>
|
|
<div>
|
|
<el-card>
|
|
<div slot="header">诊断模板</div>
|
|
<div style="display: flex">
|
|
<div>
|
|
<div
|
|
:style="
|
|
'width:' +
|
|
(window.pageWidth < 750 ? 595 : window.pageWidth - 45 - 110) +
|
|
'px;'
|
|
"
|
|
>
|
|
<el-table
|
|
:data="tableData"
|
|
row-key="id"
|
|
width="100%"
|
|
border
|
|
height="240px"
|
|
class="el-table__body-wrapper tbody"
|
|
border:stripe="true"
|
|
@row-click="rowick"
|
|
ref="info"
|
|
highlight-current-row
|
|
>
|
|
<el-table-column prop="id" label="编号" width="300">
|
|
</el-table-column>
|
|
<el-table-column prop="displayName" label="名称">
|
|
</el-table-column>
|
|
<el-table-column prop="creatorName" label="创建者">
|
|
</el-table-column>
|
|
<el-table-column prop="creationTime" label="创建时间" width="180">
|
|
<template slot-scope="scope">
|
|
{{ scope.row.creationTime | dateFormat }}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="lastModifierName" label="修改者">
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="lastModificationTime"
|
|
label="修改时间"
|
|
width="180"
|
|
>
|
|
<template slot-scope="scope">
|
|
{{ scope.row.lastModificationTime | dateFormat }}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="操作" width="">
|
|
<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 style="display: flex; margin-top: 5px">
|
|
<div
|
|
:style="
|
|
'width:' +
|
|
(window.pageWidth < 750
|
|
? 0
|
|
: Math.round((window.pageWidth - 750) / 2)) +
|
|
'px;'
|
|
"
|
|
></div>
|
|
<!--未选诊断模块-->
|
|
<div style="width: 235px">
|
|
<div>
|
|
<span style="padding-right: 5px">项目类别</span>
|
|
<el-cascader
|
|
:options="dict.itemTypeTree"
|
|
v-model="itemTypeIds"
|
|
style="margin-left: 3px; width: 160px"
|
|
:props="{
|
|
checkStrictly: true,
|
|
expandTrigger: 'hover',
|
|
...customerOrg.treeprops,
|
|
}"
|
|
:show-all-levels="false"
|
|
clearable
|
|
filterable
|
|
@change="getAsbItemByItemType"
|
|
size="small"
|
|
>
|
|
</el-cascader>
|
|
</div>
|
|
<div class="box">
|
|
<el-table
|
|
:data="dict.asbItem"
|
|
width="160"
|
|
border
|
|
:height="
|
|
window.pageHeight < 600
|
|
? 165
|
|
: window.pageHeight - 150 - 240 - 45
|
|
"
|
|
highlight-current-row
|
|
@row-dblclick="dbClickChoosedAsb"
|
|
@selection-change="handleSelectionChange"
|
|
:row-class-name="handleRowClassName"
|
|
@row-click="chooseAsbItem"
|
|
>
|
|
<el-table-column prop="displayName" label="未选诊断" />
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
|
|
<!--中间操作按钮-->
|
|
<div style="display: block; margin: 40px 10px 0 10px">
|
|
<div>
|
|
<el-button
|
|
class="btnClass"
|
|
@click="addAbs(asbItemChoosed, 'choosed')"
|
|
>添加 <i class="el-icon-arrow-right"></i
|
|
></el-button>
|
|
</div>
|
|
<div>
|
|
<el-button
|
|
class="btnClass"
|
|
@click="addAbs(asbItemChoosed, 'all')"
|
|
>全部添加</el-button
|
|
>
|
|
</div>
|
|
<div>
|
|
<el-button
|
|
class="btnClass"
|
|
@click="delAbs(patientRegisterAbsChoosed, 'choosed')"
|
|
>移除 <i class="el-icon-arrow-left"></i
|
|
></el-button>
|
|
</div>
|
|
<div>
|
|
<el-button
|
|
class="btnClass"
|
|
@click="delAbs(patientRegisterAbsChoosed, 'all')"
|
|
>全部移除</el-button
|
|
>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 已选诊断模块 -->
|
|
<div style="width: 235px">
|
|
<div>
|
|
<span style="padding-right: 5px">快速选择</span>
|
|
<el-select
|
|
v-model="asbItemId"
|
|
placeholder="快速选择诊断"
|
|
size="small"
|
|
filterable
|
|
default-first-option
|
|
:filter-method="filterMethod"
|
|
clearable
|
|
@clear="quickAsb = deepCopy(dict.asbItemQuick)"
|
|
@change="quickChoosedAsb"
|
|
ref="quickAsbOCX"
|
|
style="margin-left: 3px; width: 160px"
|
|
>
|
|
<el-option
|
|
v-for="item in quickAsb"
|
|
:key="item.id"
|
|
:value="item.id"
|
|
:label="item.displayName"
|
|
/>
|
|
</el-select>
|
|
</div>
|
|
<div class="box">
|
|
<el-table
|
|
:data="sampleGroupAsbitems"
|
|
width="160"
|
|
border
|
|
:height="
|
|
window.pageHeight < 600
|
|
? 165
|
|
: window.pageHeight - 150 - 240 - 45
|
|
"
|
|
@selection-change="selecteditems"
|
|
highlight-current-row
|
|
:row-class-name="handleRowClassName"
|
|
@row-dblclick="removeAbs"
|
|
@row-click="removeAsbItem"
|
|
>
|
|
<el-table-column prop="displayName" label="已选诊断" />
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 按钮区域 -->
|
|
<div style="margin-left: 10px">
|
|
<div>
|
|
<el-button @click="btnAdd" class="btnClass">新增</el-button>
|
|
</div>
|
|
<div>
|
|
<el-button @click="btnEdit" class="btnClass">编辑</el-button>
|
|
</div>
|
|
<div>
|
|
<el-button @click="btnDel" class="btnClass">删除</el-button>
|
|
</div>
|
|
<div>
|
|
<el-button @click="btnSetTop" class="btnClass">置顶</el-button>
|
|
</div>
|
|
<div>
|
|
<el-button @click="btnSetButtom" class="btnClass">置底</el-button>
|
|
</div>
|
|
<div>
|
|
<el-button :disabled="isshow" @click="btnSaveSort" class="btnClass"
|
|
>排序</el-button
|
|
>
|
|
</div>
|
|
<div style="margin-top: 100px">
|
|
<el-button @click="saveAsb" class="btnClass">确定项目</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-card>
|
|
<!-- 新增弹框 -->
|
|
<el-dialog
|
|
:title="title == 1 ? '新增' : '修改'"
|
|
:visible.sync="dialogVisible"
|
|
width="520px"
|
|
:close-on-click-modal="false"
|
|
@close="closeDialog"
|
|
>
|
|
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-form-item label="名称" prop="displayName">
|
|
<el-input
|
|
ref="refinput"
|
|
v-model="form.displayName"
|
|
style="width: 100%"
|
|
></el-input> </el-form-item
|
|
></el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<el-form-item label="创建者">
|
|
<el-input v-model="form.creatorName" disabled></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="创建时间">
|
|
<el-input :value="form.creationTime" disabled></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<el-form-item label="修改者">
|
|
<el-input v-model="form.lastModifierName" disabled></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="修改时间">
|
|
<el-input :value="form.lastModificationTime" disabled></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>
|
|
</template>
|
|
<script>
|
|
import Sortable from "sortablejs";
|
|
import {
|
|
groupinglist,
|
|
samplegroup,
|
|
samplegropid,
|
|
barcodeediting,
|
|
barcodedeleteid,
|
|
barcodedetopbottom,
|
|
barcodedraganddrop,
|
|
projectlist,
|
|
itemtypeid,
|
|
sampleasbitemid,
|
|
asbitmfilte,
|
|
} from "@/request/commonapi";
|
|
import { specimenlist, containerlist } from "@/request/systemapi";
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api";
|
|
import { mapState } from "vuex";
|
|
import {
|
|
arrayExistObj,
|
|
tcdate,
|
|
arrayFilter,
|
|
arrayReduce,
|
|
deepCopy,
|
|
dddw,
|
|
objCopy,
|
|
} from "../../utlis/proFunc";
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
itemTypeIds: [], //项目类别
|
|
asbItemId: "", //当前快速选到的给合项目ID
|
|
quickAsb: [], //过滤显示的诊断
|
|
rules: {
|
|
displayName: [
|
|
{ required: true, message: "请输入名称", trigger: "blur" },
|
|
],
|
|
},
|
|
isdislob: true,
|
|
filetelists: [],
|
|
flitvalues: [],
|
|
checked: [],
|
|
tableHeight: window.innerHeight - 500, //表格动态高度
|
|
screenHeight: window.innerHeight, //内容区域高度
|
|
isshow: true,
|
|
form: {
|
|
displayName: "",
|
|
},
|
|
dialogVisible: false,
|
|
title: 1,
|
|
loading: false,
|
|
pages: {
|
|
SkipCount: 0,
|
|
MaxResultCount: 100,
|
|
Sorting: "displayOrder desc",
|
|
},
|
|
tableData: [],
|
|
initTableData: [],
|
|
projectid: [],
|
|
|
|
sampleGroupAsbitems: [], //右侧数据
|
|
num: "",
|
|
nums: "",
|
|
values: "",
|
|
rightobj: {},
|
|
leftobj: {},
|
|
ischank: 1,
|
|
filete: {
|
|
Filter: "",
|
|
},
|
|
|
|
ary1: [],
|
|
ary2: [],
|
|
sdate: [],
|
|
curRow: {},
|
|
};
|
|
},
|
|
created() {
|
|
this.dictInit();
|
|
|
|
this.getlist();
|
|
this.posjectlist();
|
|
},
|
|
mounted() {
|
|
this.rowDrop();
|
|
},
|
|
watch: {
|
|
// 监听screenHeight从而改变table的高度
|
|
// screenHeight(val) {
|
|
// this.screenHeight = val;
|
|
// this.tableHeight = this.screenHeight - 220;
|
|
// },
|
|
},
|
|
|
|
computed: {
|
|
...mapState(["window", "dict", "customerOrg"]),
|
|
},
|
|
|
|
methods: {
|
|
//初始数据
|
|
dictInit() {
|
|
//体检类别 树结构
|
|
getapi("/api/app/item-type/by-code-all").then((res) => {
|
|
if (res.code != -1) {
|
|
this.dict.itemTypeTree = res.data;
|
|
tcdate(this.dict.itemTypeTree);
|
|
}
|
|
});
|
|
|
|
//获取所有诊断
|
|
postapi("/api/app/diagnosis/getlistinsuggestion").then((res) => {
|
|
if (res.code != -1) {
|
|
this.dict.asbItemAll = res.data;
|
|
this.dict.asbItemAll.forEach((e) => {
|
|
e.choosed = false;
|
|
});
|
|
this.dict.asbItem = deepCopy(this.dict.asbItemAll);
|
|
this.dict.asbItemQuick = deepCopy(res.data);
|
|
this.quickAsb = deepCopy(res.data);
|
|
}
|
|
});
|
|
},
|
|
|
|
handleRowClassName({ row, rowIndex }) {
|
|
// highLightBg 为 'selected'的高亮
|
|
//console.log(rowIndex, row)
|
|
//return row.highLightBg == 'selected' ? 'high-light-bg' : '';
|
|
if (row.choosed) {
|
|
return "current-row";
|
|
} else {
|
|
return "";
|
|
}
|
|
},
|
|
|
|
//项目类别过滤 诊断,未过滤已选择的诊断
|
|
getAsbItemByItemTypeAll() {
|
|
//console.log('getAsbItemByItemType', typeof this.itemTypeIds, this.itemTypeIds)
|
|
let lv = "";
|
|
if (typeof this.itemTypeIds === "object") {
|
|
lv = this.itemTypeIds[this.itemTypeIds.length - 1];
|
|
}
|
|
|
|
if (lv) {
|
|
this.dict.asbItem = arrayFilter(this.dict.asbItemAll, "itemTypeId", lv);
|
|
} else {
|
|
this.dict.asbItem = deepCopy(this.dict.asbItemAll);
|
|
}
|
|
//console.log('lv,this.dict.asbItem', lv, this.dict.asbItem)
|
|
this.dict.asbItemQuick = deepCopy(this.dict.asbItemAll);
|
|
},
|
|
|
|
//按项目类别显示诊断,并过滤已选择的诊断
|
|
getAsbItemByItemType() {
|
|
this.getAsbItemByItemTypeAll();
|
|
//刷新显示 未选诊断
|
|
arrayReduce(this.dict.asbItem, [...this.sampleGroupAsbitems], "id=id");
|
|
arrayReduce(
|
|
this.dict.asbItemQuick,
|
|
[...this.sampleGroupAsbitems],
|
|
"id=id"
|
|
);
|
|
this.quickAsb = deepCopy(this.dict.asbItemQuick);
|
|
},
|
|
|
|
//快速选择诊断时,调整可按拼间简码及简称查找
|
|
filterMethod(keyWords) {
|
|
//console.log('filterMethod',this.dict.asbItemQuick)
|
|
if (keyWords) {
|
|
this.quickAsb = [];
|
|
console.log(this.dict.asbItemQuick);
|
|
this.dict.asbItemQuick.forEach((item) => {
|
|
if (
|
|
item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) >
|
|
-1 ||
|
|
item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > -1
|
|
) {
|
|
this.quickAsb.push(item);
|
|
}
|
|
});
|
|
} else {
|
|
this.quickAsb = deepCopy(this.dict.asbItemQuick);
|
|
}
|
|
},
|
|
|
|
// 添加诊断
|
|
///api/app/register-asbitem/many/3fa85f64-5717-4562-b3fc-2c963f66afa6'
|
|
async addAbs(asbItemChoosed, oprType) {
|
|
// console.log('this.customerOrgGroup',this.customerOrgGroup)
|
|
// console.log('asbItemChoosed', asbItemChoosed)
|
|
if (!this.form.id) {
|
|
this.$message.warning("请先选中条码分组");
|
|
return;
|
|
}
|
|
|
|
let message = [];
|
|
let checked = true;
|
|
let lfind = -1;
|
|
|
|
//oprType 不传值时,兼容勾选方式
|
|
//勾选时不需要此操作 start
|
|
if (oprType && oprType == "all") {
|
|
asbItemChoosed = deepCopy(this.dict.asbItem);
|
|
} else if (oprType && oprType == "choosed") {
|
|
asbItemChoosed = [];
|
|
this.dict.asbItem.forEach((e) => {
|
|
if (e.choosed) {
|
|
asbItemChoosed.push(e);
|
|
e.choosed = false;
|
|
}
|
|
});
|
|
}
|
|
//勾选时不需要此操作 end
|
|
|
|
if (asbItemChoosed.length < 1) {
|
|
this.$message.warning("请选择要添加的诊断");
|
|
return;
|
|
}
|
|
|
|
// 去掉重复的项目
|
|
arrayReduce(asbItemChoosed, this.sampleGroupAsbitems, "id=id");
|
|
/*
|
|
for (let i = asbItemChoosed.length - 1; i > - 1; i--) {
|
|
if (this.customerOrgGroup.forSexId == 'A') break //未选性别时,无需判断诊断性别限制
|
|
if (asbItemChoosed[i].forSexId == 'A' || asbItemChoosed[i].forSexId == 'U') continue
|
|
if (asbItemChoosed[i].forSexId != this.customerOrgGroup.forSexId) {
|
|
message.push(asbItemChoosed[i].displayName) //.warning(`所选项目:${asbItemChoosed[i].displayName},不适合当前人员性别`)
|
|
checked = false
|
|
asbItemChoosed.splice(i,1)
|
|
}
|
|
}
|
|
//console.log(222,checked)
|
|
if (!checked) this.$message.warning(`所选项目【${JSON.stringify(message)}】不适合当前人员性别`)
|
|
*/
|
|
|
|
asbItemChoosed.forEach((e) => {
|
|
this.sampleGroupAsbitems.push(deepCopy(e));
|
|
});
|
|
|
|
//刷新
|
|
this.getAsbItemByItemType();
|
|
},
|
|
|
|
//双击选择诊断
|
|
dbClickChoosedAsb(row) {
|
|
this.addAbs([row]);
|
|
},
|
|
//快速选择诊断
|
|
quickChoosedAsb(v) {
|
|
//远程查询时,设置了 value-key 也不管用,只能取到value console.log('quickChoosedAsb',v)
|
|
let lfind = -1;
|
|
if (v) {
|
|
lfind = arrayExistObj(this.dict.asbItemQuick, "id", v);
|
|
if (lfind > -1) {
|
|
this.addAbs([this.dict.asbItemQuick[lfind]]);
|
|
}
|
|
}
|
|
|
|
this.$nextTick(() => {
|
|
this.$refs["quickAsbOCX"].blur(); //total asbItemId
|
|
this.asbItemId = "";
|
|
this.quickAsb = deepCopy(this.dict.asbItemQuick);
|
|
this.$refs["quickAsbOCX"].focus(); //total asbItemId
|
|
});
|
|
},
|
|
|
|
//选择 未选的诊断
|
|
chooseAsbItem(row) {
|
|
this.dict.asbItem.forEach((e, index) => {
|
|
e.index = index;
|
|
return e;
|
|
});
|
|
// 按住了shift键
|
|
if (this.window.shift) {
|
|
//清除所有选择
|
|
this.dict.asbItem.forEach((e) => {
|
|
e.choosed = false;
|
|
return e;
|
|
});
|
|
|
|
if (this.startPoint == -1) {
|
|
this.dict.asbItem[row.index].choosed = true;
|
|
this.startPoint = row.index;
|
|
return;
|
|
}
|
|
|
|
if (this.startPoint > row.index) {
|
|
for (let i = row.index; i <= this.startPoint; i++) {
|
|
this.dict.asbItem[i].choosed = true;
|
|
}
|
|
} else if (this.startPoint <= row.index) {
|
|
for (let i = this.startPoint; i <= row.index; i++) {
|
|
this.dict.asbItem[i].choosed = true;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 按住了ctrl 键
|
|
if (this.window.ctrl) {
|
|
console.log("this.window.ctrl", this.window.ctrl, this.dict.asbItem);
|
|
this.dict.asbItem[row.index].choosed = true;
|
|
this.startPoint = row.index;
|
|
return;
|
|
}
|
|
|
|
// 未按住了ctrl 、shift 键
|
|
//清除所有选择
|
|
//console.log('清除所有选择')
|
|
this.dict.asbItem.forEach((e) => {
|
|
e.choosed = false;
|
|
return e;
|
|
});
|
|
this.dict.asbItem[row.index].choosed = true;
|
|
this.startPoint = row.index;
|
|
},
|
|
|
|
//删除 人员已选中的诊断
|
|
///api/app/register-asbitem/many?RegisterAsbitemIds=3fa85f64-5717-4562-b3fc-2c963f66afa6
|
|
delAbs(absForDel, oprType) {
|
|
if (!this.form.id) {
|
|
this.$message.warning("请先选中单位分组");
|
|
return;
|
|
}
|
|
|
|
let lfind = -1;
|
|
|
|
//勾选时不需要此操作 start
|
|
if (oprType && oprType == "all") {
|
|
absForDel = deepCopy(this.sampleGroupAsbitems);
|
|
} else if (oprType && oprType == "choosed") {
|
|
absForDel = [];
|
|
this.sampleGroupAsbitems.forEach((e) => {
|
|
if (e.choosed) {
|
|
absForDel.push(deepCopy(e));
|
|
e.choosed = false;
|
|
}
|
|
});
|
|
}
|
|
//勾选时不需要此操作 end
|
|
|
|
if (absForDel.length < 1) {
|
|
this.$message.warning("请选择要移除的诊断");
|
|
return;
|
|
}
|
|
|
|
for (let i = 0; i < absForDel.length; i++) {
|
|
lfind = arrayExistObj(this.sampleGroupAsbitems, "id", absForDel[i].id);
|
|
if (lfind > -1) this.sampleGroupAsbitems.splice(lfind, 1);
|
|
|
|
absForDel.splice(i, 1);
|
|
i--;
|
|
continue;
|
|
}
|
|
|
|
//刷新
|
|
this.getAsbItemByItemType();
|
|
},
|
|
|
|
//双击删除已选项目
|
|
removeAbs(row) {
|
|
this.delAbs([row]);
|
|
},
|
|
|
|
//选择 已选的诊断
|
|
removeAsbItem(row) {
|
|
this.sampleGroupAsbitems.forEach((e, index) => {
|
|
e.index = index;
|
|
return e;
|
|
});
|
|
// 按住了shift键
|
|
if (this.window.shift) {
|
|
//清除所有选择
|
|
this.sampleGroupAsbitems.forEach((e) => {
|
|
e.choosed = false;
|
|
return e;
|
|
});
|
|
|
|
if (this.PstartPoint == -1) {
|
|
this.sampleGroupAsbitems[row.index].choosed = true;
|
|
this.PstartPoint = row.index;
|
|
return;
|
|
}
|
|
|
|
if (this.PstartPoint > row.index) {
|
|
for (let i = row.index; i <= this.PstartPoint; i++) {
|
|
this.sampleGroupAsbitems[i].choosed = true;
|
|
}
|
|
} else if (this.PstartPoint <= row.index) {
|
|
for (let i = this.PstartPoint; i <= row.index; i++) {
|
|
this.sampleGroupAsbitems[i].choosed = true;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 按住了ctrl 键
|
|
if (this.window.ctrl) {
|
|
console.log(
|
|
"this.window.ctrl",
|
|
this.window.ctrl,
|
|
this.sampleGroupAsbitems
|
|
);
|
|
this.sampleGroupAsbitems[row.index].choosed = true;
|
|
this.PstartPoint = row.index;
|
|
return;
|
|
}
|
|
|
|
// 未按住了ctrl 、shift 键
|
|
//清除所有选择
|
|
//console.log('清除所有选择')
|
|
this.sampleGroupAsbitems.forEach((e) => {
|
|
e.choosed = false;
|
|
return e;
|
|
});
|
|
this.sampleGroupAsbitems[row.index].choosed = true;
|
|
this.PstartPoint = row.index;
|
|
},
|
|
|
|
selectchange(v) {
|
|
console.log(v);
|
|
this.sampleGroupAsbitems.push({ displayName: v.displayName });
|
|
// console.log(v);
|
|
},
|
|
saveAsb() {
|
|
if (!this.form.id) {
|
|
this.$message.warning("请选择要操作的模板!");
|
|
return;
|
|
}
|
|
let details = [];
|
|
let diagnosisTemplateId = this.form.id;
|
|
|
|
this.sampleGroupAsbitems.forEach((e) => {
|
|
details.push({
|
|
diagnosisTemplateId,
|
|
diagnosisId: e.id,
|
|
});
|
|
});
|
|
|
|
let body = { diagnosisTemplateId, details };
|
|
|
|
postapi(
|
|
"/api/app/diagnosistemplatedetail/creatediagnosistemplatedetailmany",
|
|
body
|
|
).then((res) => {
|
|
if (res.code != -1) {
|
|
this.$message.success("操作成功!");
|
|
}
|
|
});
|
|
},
|
|
|
|
//右侧勾选按钮
|
|
selecteditems(val) {
|
|
this.rightselctedata = val;
|
|
console.log(this.rightselctedata);
|
|
},
|
|
|
|
// 左侧未选
|
|
handleSelectionChange(val) {
|
|
// this.selecteddata = val;
|
|
this.unselecteddata = val;
|
|
console.log(this.unselecteddata);
|
|
},
|
|
|
|
clickPaixu(item, index) {
|
|
console.log(item);
|
|
this.rightobj = item;
|
|
// let arr = [];
|
|
// arr.push({ itemId: this.rightobj.id });
|
|
// this.allid.forEach((item) => {
|
|
// if (item.id == arr[id]) {
|
|
// return;
|
|
// } else {
|
|
// this.allid.push({ id: arr[id] });
|
|
// }
|
|
// });
|
|
console.log(this.allid);
|
|
this.ischank = 2;
|
|
this.num = index;
|
|
this.isdislob = false;
|
|
},
|
|
|
|
// 获取项目类别接口
|
|
posjectlist() {
|
|
projectlist().then((res) => {
|
|
console.log(res);
|
|
this.projectid = res.data;
|
|
});
|
|
},
|
|
handlechang(value, direction, movedkeys) {
|
|
console.log(value);
|
|
console.log(direction);
|
|
console.log(movedkeys);
|
|
},
|
|
//取消按钮
|
|
cancellation() {
|
|
this.$message.info("取消操作");
|
|
this.isshow = true;
|
|
this.getlist();
|
|
},
|
|
//确定排序
|
|
btnSaveSort() {
|
|
const result = [];
|
|
this.tableData.forEach((item, index) => {
|
|
// index 从0开始的, 你的displayOrder从大到小排
|
|
console.log(item.id);
|
|
// const currentDisplayOrder = this.tableData.length -1
|
|
const currentDisplayOrder = this.initTableData[index].displayOrder;
|
|
if (item.displayOrder != currentDisplayOrder) {
|
|
// 如果它的displayOrder和它当前所在的位置不同代表挪动过位置
|
|
result.push({ id: item.id, displayOrder: currentDisplayOrder });
|
|
}
|
|
});
|
|
// console.log('btnSaveSort', result);
|
|
putapi("/api/app/diagnosistemplate/updatesortmany", {
|
|
itemList: result,
|
|
}).then((res) => {
|
|
if (res.code != -1) {
|
|
this.$message.success("操作成功");
|
|
this.isshow = true;
|
|
this.getlist();
|
|
}
|
|
});
|
|
},
|
|
//初始化
|
|
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["info"].setCurrentRow(_this.tableData[oldIndex]);
|
|
_this.rowick(_this.tableData[oldIndex]);
|
|
},
|
|
// 指定父元素下可被拖拽的子元素
|
|
// draggable: ".module-manager .el-table__row",
|
|
onEnd({ newIndex, oldIndex }) {
|
|
// console.log(arr);
|
|
_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) {
|
|
// console.log(item, "新数据");
|
|
} else if (index == oldIndex) {
|
|
} else if (index == newIndex) {
|
|
}
|
|
});
|
|
console.log(_this.tableData.map((item) => item.displayOrder));
|
|
},
|
|
});
|
|
});
|
|
},
|
|
//置底
|
|
btnSetButtom() {
|
|
this.form = { ...this.curRow };
|
|
if (this.form.id == undefined) {
|
|
this.$message.warning("请选择操作的数据");
|
|
} else {
|
|
putapi(
|
|
`/api/app/diagnosistemplate/updatemanysort?id=${
|
|
this.form.id
|
|
}&SortType=${2}`
|
|
).then((res) => {
|
|
if (res.code != -1) {
|
|
this.getlist();
|
|
this.$message.success("操作成功");
|
|
}
|
|
});
|
|
}
|
|
},
|
|
//置顶
|
|
btnSetTop() {
|
|
this.form = { ...this.curRow };
|
|
if (this.form.id == undefined) {
|
|
this.$message.warning("请选择操作的数据");
|
|
} else {
|
|
putapi(
|
|
`/api/app/diagnosistemplate/updatemanysort?id=${
|
|
this.form.id
|
|
}&SortType=${1}`
|
|
).then((res) => {
|
|
if (res.code != -1) {
|
|
this.$message.success("操作成功");
|
|
this.getlist();
|
|
}
|
|
});
|
|
}
|
|
},
|
|
//删除
|
|
btnDel() {
|
|
this.form = { ...this.curRow };
|
|
if (this.form.id == undefined) {
|
|
this.$message.warning("请选择操作的数据");
|
|
} else {
|
|
this.$confirm("是否确认删除, 是否继续?", "提示", {
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
}).then(() => {
|
|
deletapi(`/api/app/diagnosis-template/${this.form.id}`).then(
|
|
(res) => {
|
|
console.log(res);
|
|
if (res.code == 0) {
|
|
this.$message.success("删除成功");
|
|
this.getlist();
|
|
}
|
|
}
|
|
);
|
|
});
|
|
// barcodedeleteid(this.form.id).then((res) => {
|
|
// console.log(res);
|
|
// this.$message.success("删除成功");
|
|
// this.getlist();
|
|
// });
|
|
}
|
|
},
|
|
//编辑弹框
|
|
btnEdit() {
|
|
this.form = { ...this.curRow };
|
|
if (this.form.id == undefined) {
|
|
this.$message.warning("请选择操作的数据");
|
|
} else {
|
|
this.dialogVisible = true;
|
|
this.title = 2;
|
|
if (this.$refs.form !== undefined) {
|
|
this.$refs.form.resetFields();
|
|
}
|
|
// //获取标本类型id
|
|
// specimenlist(this.pages).then((res) => {
|
|
// this.sampleTypeId = res.data.items;
|
|
// });
|
|
// // 获取标本容器Id
|
|
// containerlist(this.pages).then((res) => {
|
|
// this.sampleContainerId = res.data.items;
|
|
// });
|
|
// samplegropid(this.form.id).then((res) => {
|
|
// this.form = res.data;
|
|
// });
|
|
}
|
|
},
|
|
|
|
//确定新增或者编辑
|
|
onSubmit() {
|
|
this.$refs.form.validate((v) => {
|
|
if (v) {
|
|
if (this.title == 1) {
|
|
postapi("/api/app/diagnosis-template", this.form).then((res) => {
|
|
if (res.code != -1) {
|
|
this.$message.success("新增成功");
|
|
// this.getlist(); 改为局部刷新
|
|
this.form.id = res.data.id;
|
|
this.tableData.push(deepCopy(res.data));
|
|
this.dialogVisible = false;
|
|
}
|
|
});
|
|
} else if (this.title == 2) {
|
|
putapi(
|
|
`/api/app/diagnosis-template/${this.form.id}`,
|
|
this.form
|
|
).then((res) => {
|
|
if (res.code != -1) {
|
|
this.$message.success("修改成功");
|
|
// this.getlist(); 改为局部刷新
|
|
this.dialogVisible = false;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
|
|
closeDialog() {
|
|
if (!this.form.id) return;
|
|
|
|
let currentRow = {};
|
|
let lfind = arrayExistObj(this.tableData, "id", this.form.id);
|
|
if (lfind > -1) {
|
|
objCopy(this.form, this.tableData[lfind]);
|
|
currentRow = this.tableData[lfind];
|
|
} else {
|
|
currentRow = deepCopy(this.form);
|
|
lfind = this.tableData.length;
|
|
this.tableData.push(currentRow);
|
|
}
|
|
|
|
if (lfind > -1) {
|
|
this.$nextTick(() => {
|
|
this.$refs["info"].setCurrentRow(currentRow);
|
|
this.rowick(currentRow);
|
|
});
|
|
}
|
|
},
|
|
|
|
//新增弹框
|
|
btnAdd() {
|
|
this.dialogVisible = true;
|
|
this.title = 1;
|
|
this.form = this.$options.data().form;
|
|
this.$nextTick(() => {
|
|
this.$refs.refinput.focus();
|
|
});
|
|
|
|
// //获取标本类型id
|
|
// specimenlist(this.pages).then((res) => {
|
|
// this.sampleTypeId = res.data.items;
|
|
// console.log(res);
|
|
// });
|
|
// // 获取标本容器Id
|
|
// containerlist(this.pages).then((res) => {
|
|
// this.sampleContainerId = res.data.items;
|
|
// console.log(res, "11111");
|
|
// });
|
|
},
|
|
|
|
//点击条码分组记录
|
|
rowick(row) {
|
|
this.curRow = deepCopy(row);
|
|
this.form = deepCopy(row);
|
|
|
|
// samplegropid(row.id).then((res) => {
|
|
// this.curRow = { ...res.data };
|
|
// this.form = res.data;
|
|
// });
|
|
|
|
postapi(
|
|
"/api/app/diagnosistemplatedetail/getdiagnosistemplateindiagnosis",
|
|
{
|
|
diagnosisTemplateId: this.form.id,
|
|
}
|
|
).then((res) => {
|
|
if (res.code != -1) {
|
|
this.sampleGroupAsbitems = res.data;
|
|
this.getAsbItemByItemType();
|
|
}
|
|
});
|
|
},
|
|
|
|
getlist() {
|
|
this.loading = true;
|
|
getapi("/api/app/diagnosis-template/in-filter", this.pages).then(
|
|
(res) => {
|
|
this.loading = false;
|
|
this.tableData = res.data.items;
|
|
this.initTableData = [...res.data.items];
|
|
console.log(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 });
|
|
}
|
|
});
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
<style scoped>
|
|
@import "../../assets/css/global_button.css";
|
|
@import "../../assets/css/global_card.css";
|
|
@import "../../assets/css/global_dialog.css";
|
|
@import "../../assets/css/global_form.css";
|
|
@import "../../assets/css/global_input.css";
|
|
@import "../../assets/css/global_table.css";
|
|
@import "../../assets/css/global.css";
|
|
|
|
.box {
|
|
margin-top: 5px;
|
|
border: 1px solid #000;
|
|
}
|
|
|
|
.btnClass {
|
|
width: 100px;
|
|
margin-bottom: 5px;
|
|
}
|
|
</style>
|