10 changed files with 1990 additions and 90 deletions
-
4src/api/api.js
-
26src/components/compTable.vue
-
72src/components/publicjs/public.js
-
16src/router/index.js
-
164src/views/Home.vue
-
152src/views/basic-dictionary/MedicalConclusion.vue
-
421src/views/fee-settings/ItemResultMatch.vue
-
428src/views/fee-settings/ItemResultTemplate.vue
-
383src/views/fee-settings/ItemTemplate.vue
-
414src/views/fee-settings/MedicalPackage.vue
@ -0,0 +1,72 @@ |
|||||
|
import Sortable from "sortablejs"; |
||||
|
import { putapi } from "@/api/api"; |
||||
|
//拖拽组件初始化
|
||||
|
function rowDrop(aa, tableData, isshow, cb) { |
||||
|
const tbody = document.querySelector(aa);//".el-table__body-wrapper tbody"
|
||||
|
console.log('tableDatatableData', tableData, isshow, this) |
||||
|
Sortable.create(tbody, { |
||||
|
handle: ".move", |
||||
|
animation: 300, |
||||
|
onEnd({ newIndex, oldIndex }) { |
||||
|
cb() |
||||
|
const currRow = tableData.splice(oldIndex, 1)[0]; |
||||
|
tableData.splice(newIndex, 0, currRow); |
||||
|
tableData.map((item, index) => { |
||||
|
if (index == newIndex && index == oldIndex) { |
||||
|
// console.log(item, "新数据");
|
||||
|
} else if (index == oldIndex) { |
||||
|
} else if (index == newIndex) { |
||||
|
} |
||||
|
}); |
||||
|
console.log(tableData); |
||||
|
console.log(tableData.map((item) => item.displayOrder)); |
||||
|
}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
//拖拽排序确定方法
|
||||
|
//确定拖拽
|
||||
|
// function aassertion() {
|
||||
|
// const result = [];
|
||||
|
// this.tableData.forEach((item, index) => {
|
||||
|
// // index 从0开始的, displayOrder从大到小排
|
||||
|
// console.log(item.id);
|
||||
|
// console.log(index);
|
||||
|
// // const currentDisplayOrder = this.tableData.length -1
|
||||
|
// const currentDisplayOrder = this.initTableData[index].displayOrder;
|
||||
|
// if (item.displayOrder != currentDisplayOrder) {
|
||||
|
// // 如果它的displayOrder和它当前所在的位置不同代表挪动过位置
|
||||
|
// result.push({ id: item.id, displayOrder: currentDisplayOrder });
|
||||
|
// }
|
||||
|
// });
|
||||
|
// conlusiondraganddrop({ itemList: result }).then((res) => {
|
||||
|
// this.$message.success("操作成功");
|
||||
|
// this.isshow = true;
|
||||
|
// this.getlist();
|
||||
|
// });
|
||||
|
// }
|
||||
|
function assertions(tableData, initTableData) { |
||||
|
const result = []; |
||||
|
tableData.forEach((item, index) => { |
||||
|
// index 从0开始的, displayOrder从大到小排
|
||||
|
console.log(item.id); |
||||
|
console.log(index); |
||||
|
// const currentDisplayOrder = this.tableData.length -1
|
||||
|
const currentDisplayOrder =initTableData[index].displayOrder; |
||||
|
if (item.displayOrder != currentDisplayOrder) { |
||||
|
// 如果它的displayOrder和它当前所在的位置不同代表挪动过位置
|
||||
|
result.push({ id: item.id, displayOrder: currentDisplayOrder }); |
||||
|
} |
||||
|
console.log('currentDisplayOrder',currentDisplayOrder); |
||||
|
console.log('item',item); |
||||
|
}); |
||||
|
// putapi(url, { itemList: result }).then((res) => {
|
||||
|
// this.$message.success("操作成功");
|
||||
|
// this.isshow = true;
|
||||
|
// this.getlist();
|
||||
|
// });
|
||||
|
} |
||||
|
export { |
||||
|
rowDrop, |
||||
|
assertions |
||||
|
} |
||||
@ -0,0 +1,421 @@ |
|||||
|
<template> |
||||
|
<div class="box"> |
||||
|
<div style="width: 150%"> |
||||
|
<el-card> |
||||
|
<el-table |
||||
|
:data="tableData" |
||||
|
style="width: 100%" |
||||
|
row-key="id" |
||||
|
class="el-table__body-wrapper tbody" |
||||
|
@row-click="rowclick" |
||||
|
highlight-current-row |
||||
|
> |
||||
|
<el-table-column prop="id" label="编号" width="300"> |
||||
|
</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 prop="result" label="结果" width=""> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="操作" width=""> |
||||
|
<template> |
||||
|
<el-tag |
||||
|
class="move" |
||||
|
style="cursor: move; margin-left: 15px" |
||||
|
draggable="true" |
||||
|
> |
||||
|
<i |
||||
|
class="el-icon-d-caret" |
||||
|
style="width: 1rem; height: 1rem" |
||||
|
></i> |
||||
|
</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<!-- <comp-table |
||||
|
:tableData="tableData" |
||||
|
:tableHeader="tableHeader" |
||||
|
@clickevents="rowclick" |
||||
|
ref="singleTable" |
||||
|
> |
||||
|
</comp-table> --> |
||||
|
</el-card> |
||||
|
<!-- 弹框 --> |
||||
|
<el-dialog |
||||
|
:title="title == 1 ? '新增' : '编辑'" |
||||
|
:visible.sync="dialogVisible" |
||||
|
width="75%" |
||||
|
> |
||||
|
<el-form ref="form" :model="form" label-width="80px" :rules="rules"> |
||||
|
<el-row> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="项目" prop="itemId"> |
||||
|
<el-select |
||||
|
filterable |
||||
|
v-model="form.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="form.result" style="width: 80%"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="诊断编号" prop="diagnosisId"> |
||||
|
<el-select |
||||
|
filterable |
||||
|
v-model="form.diagnosisId" |
||||
|
placeholder="请选择" |
||||
|
> |
||||
|
<el-option |
||||
|
v-for="item in diagnosisId" |
||||
|
:key="item.id" |
||||
|
:label="item.displayName" |
||||
|
:value="item.id" |
||||
|
> |
||||
|
</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="onsbmit">确 定</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
<!-- 按钮区域 --> |
||||
|
<div style="margin-left: 10px; margin-top: 5%"> |
||||
|
<el-button type="primary" @click="add">新增</el-button> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
@click="editpopup" |
||||
|
style="margin-left: 0; margin-top: 10px" |
||||
|
>编辑</el-button |
||||
|
> |
||||
|
<div style="margin-top: 10px"> |
||||
|
<el-button type="danger" @click="delets">删除</el-button> |
||||
|
</div> |
||||
|
<div style="margin-top: 10px"> |
||||
|
<el-button type="primary" @click="topping">置顶</el-button> |
||||
|
</div> |
||||
|
<div style="margin-top: 10px"> |
||||
|
<el-button type="primary" @click="toppings">置底</el-button> |
||||
|
</div> |
||||
|
<div style="margin-top: 10px"> |
||||
|
<el-button type="primary" :disabled="isshow" @click="assertion" |
||||
|
>排序</el-button |
||||
|
> |
||||
|
</div> |
||||
|
<div style="margin-top: 5px"> |
||||
|
<el-button type="primary" :disabled="isshow" @click="cancellation" |
||||
|
>取消</el-button |
||||
|
> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { rowDrop } from "@/components/publicjs/public"; |
||||
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
||||
|
import { getporjectlists } from "@/request/commonapi"; |
||||
|
import compTable from "@/components/compTable.vue"; |
||||
|
import Sortable from "sortablejs"; |
||||
|
export default { |
||||
|
components: { compTable }, |
||||
|
data() { |
||||
|
return { |
||||
|
isshow: true, |
||||
|
rules: { |
||||
|
itemId: [{ required: true, message: "请选择项目", trigger: "change" }], |
||||
|
result: [{ required: true, message: "请输入结果", trigger: "blur" }], |
||||
|
diagnosisId: [ |
||||
|
{ required: true, message: "请选择诊断编号", trigger: "change" }, |
||||
|
], |
||||
|
isNameIntoSummary: [ |
||||
|
{ required: true, message: "请选择小结名称", trigger: "change" }, |
||||
|
], |
||||
|
isResultIntoSummary: [ |
||||
|
{ required: true, message: "请选择进入小结", trigger: "change" }, |
||||
|
], |
||||
|
resultStatusId: [ |
||||
|
{ required: true, message: "请选择结果状态", trigger: "change" }, |
||||
|
], |
||||
|
simpleCode: [ |
||||
|
{ required: true, message: "请输入拼音简码", trigger: "change" }, |
||||
|
], |
||||
|
}, |
||||
|
form: { |
||||
|
itemId: "", |
||||
|
result: "", |
||||
|
diagnosisId: "", |
||||
|
// isNameIntoSummary: "", |
||||
|
// isResultIntoSummary: "", |
||||
|
// resultStatusId: "", |
||||
|
|
||||
|
// simpleCode: "", |
||||
|
}, |
||||
|
dialogVisible: false, |
||||
|
title: 1, |
||||
|
pages: { |
||||
|
SkipCount: 0, |
||||
|
MaxResultCount: 100, |
||||
|
Sorting: "displayOrder desc", |
||||
|
}, |
||||
|
itemId: [], //项目 |
||||
|
diagnosisId: [], //诊断 |
||||
|
resultStatusId: [], //结果状态 |
||||
|
isNameIntoSummary: [ |
||||
|
{ |
||||
|
value: "N", |
||||
|
label: "否", |
||||
|
}, |
||||
|
{ |
||||
|
value: "Y", |
||||
|
label: "是", |
||||
|
}, |
||||
|
], // 小结名称 |
||||
|
isResultIntoSummary: [ |
||||
|
{ |
||||
|
value: "N", |
||||
|
label: "否", |
||||
|
}, |
||||
|
{ |
||||
|
value: "Y", |
||||
|
label: "是", |
||||
|
}, |
||||
|
], //进入小结 |
||||
|
tableData: [], |
||||
|
initTableData: [], |
||||
|
tableHeader: [ |
||||
|
// 表头信息,可根据minWidth修改宽度 |
||||
|
{ prop: "id", label: "编号", minWidth: "150px" }, |
||||
|
{ prop: `creatorName`, label: "创建者" }, |
||||
|
{ prop: `creationTime`, label: "创建时间" }, |
||||
|
{ prop: `lastModifierName`, label: "修改者" }, |
||||
|
{ prop: `lastModificationTime`, label: "创建时间" }, |
||||
|
{ prop: "result", label: "结果" }, |
||||
|
// { prop: "simpleCode", label: "拼音简码" }, |
||||
|
], |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.getlist(); |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.rowDrop() |
||||
|
}, |
||||
|
methods: { |
||||
|
//取消排序 |
||||
|
cancellation() { |
||||
|
this.$message.info("取消操作"); |
||||
|
this.isshow = true; |
||||
|
this.getlist(); |
||||
|
}, |
||||
|
//确定排序 |
||||
|
assertion() { |
||||
|
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 }); |
||||
|
} |
||||
|
}); |
||||
|
putapi("/api/app/itemresultmatch/updatesortmany", { itemList: result }).then( |
||||
|
(res) => { |
||||
|
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, |
||||
|
|
||||
|
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) { |
||||
|
// console.log(item, "新数据"); |
||||
|
} else if (index == oldIndex) { |
||||
|
} else if (index == newIndex) { |
||||
|
} |
||||
|
}); |
||||
|
console.log(_this.tableData.map((item) => item.displayOrder)); |
||||
|
}, |
||||
|
}); |
||||
|
}); |
||||
|
}, |
||||
|
toppings() { |
||||
|
if (this.form.id == undefined) { |
||||
|
this.$message.warning("请选择操作的数据"); |
||||
|
} else { |
||||
|
putapi( |
||||
|
`/api/app/itemresultmatch/updatemanysort?id=${ |
||||
|
this.form.id |
||||
|
}&SortType=${2}` |
||||
|
).then((res) => { |
||||
|
this.$message.success("操作成功"); |
||||
|
this.getlist(); |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
topping() { |
||||
|
if (this.form.id == undefined) { |
||||
|
this.$message.warning("请选择操作的数据"); |
||||
|
} else { |
||||
|
putapi( |
||||
|
`/api/app/itemresultmatch/updatemanysort?id=${ |
||||
|
this.form.id |
||||
|
}&SortType=${1}` |
||||
|
).then((res) => { |
||||
|
this.$message.success("操作成功"); |
||||
|
this.getlist(); |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
//删除 |
||||
|
delets(row) { |
||||
|
if (this.form.id == undefined) { |
||||
|
this.$message.warning("请选择删除的数据"); |
||||
|
} else { |
||||
|
this.$confirm("是否确认删除,是否继续?", "提示", { |
||||
|
confirmButtonText: "确定", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
deletapi(`/api/app/item-result-match/${this.form.id}`).then( |
||||
|
(res) => { |
||||
|
this.$message.success("删除成功"); |
||||
|
this.getlist(); |
||||
|
} |
||||
|
); |
||||
|
}) |
||||
|
.catch(() => {}); |
||||
|
} |
||||
|
}, |
||||
|
//编辑弹框 |
||||
|
editpopup() { |
||||
|
if (this.form.id == undefined) { |
||||
|
this.$message.warning("请点击选择操作的数据"); |
||||
|
} else { |
||||
|
this.dialogVisible = true; |
||||
|
this.title = 2; |
||||
|
this.addtoedit(); |
||||
|
getapi(`/api/app/item-result-match/${this.form.id}`).then((res) => { |
||||
|
console.log(res); |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
//确定新增或者编辑 |
||||
|
onsbmit() { |
||||
|
this.$refs.form.validate((v) => { |
||||
|
if (v) { |
||||
|
if (this.title == 1) { |
||||
|
postapi("/api/app/item-result-match", this.form).then((res) => { |
||||
|
this.$message.success("新增成功"); |
||||
|
this.getlist(); |
||||
|
this.dialogVisible = false; |
||||
|
}); |
||||
|
} else if (this.title == 2) { |
||||
|
putapi( |
||||
|
`/api/app/item-result-match/${this.form.id}`, |
||||
|
this.form |
||||
|
).then((res) => { |
||||
|
this.$message.success("修改成功"); |
||||
|
this.getlist(); |
||||
|
this.dialogVisible = false; |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
rowclick(val) { |
||||
|
getapi(`/api/app/item-result-match/${val.id}`).then((res) => { |
||||
|
this.form = res.data; |
||||
|
console.log(res); |
||||
|
}); |
||||
|
}, |
||||
|
handleRowClick(Row) { |
||||
|
console.log(Row); |
||||
|
console.log("1"); |
||||
|
}, |
||||
|
// 新增或者编辑需要的类别 |
||||
|
addtoedit() { |
||||
|
//项目 |
||||
|
getporjectlists().then((res) => { |
||||
|
this.itemId = res.data.items; |
||||
|
}); |
||||
|
// 诊断 |
||||
|
postapi("/api/app/diagnosis/getlistinfilter").then((res) => { |
||||
|
this.diagnosisId = res.data.items; |
||||
|
}); |
||||
|
//结果状态 |
||||
|
getapi("/api/app/result-status").then((res) => { |
||||
|
this.resultStatusId = res.data.items; |
||||
|
}); |
||||
|
getapi("/api/app/diagnosis/getlistinfilter").then((res) => {}); |
||||
|
}, |
||||
|
//新增弹框 |
||||
|
add() { |
||||
|
this.addtoedit(); |
||||
|
this.dialogVisible = true; |
||||
|
this.title = 1; |
||||
|
this.form = {}; |
||||
|
}, |
||||
|
getlist() { |
||||
|
getapi("/api/app/item-result-match", this.pages).then((res) => { |
||||
|
console.log(res); |
||||
|
this.tableData = res.data.items; |
||||
|
this.initTableData = [...res.data.items]; |
||||
|
}); |
||||
|
let that = this; |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.box { |
||||
|
display: flex; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,383 @@ |
|||||
|
<template> |
||||
|
<div class="box"> |
||||
|
<div style="width: 95%"> |
||||
|
<el-card> |
||||
|
<el-table |
||||
|
:data="tableData" |
||||
|
style="width: 100%" |
||||
|
row-key="id" |
||||
|
class="el-table__body-wrapper tbody" |
||||
|
@row-click="rowclick" |
||||
|
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="创建者" width="150"> |
||||
|
</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 prop="result" label="结果" width=""> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="操作" width=""> |
||||
|
<template> |
||||
|
<el-tag |
||||
|
class="move" |
||||
|
style="cursor: move; margin-left: 15px" |
||||
|
draggable="true" |
||||
|
> |
||||
|
<i |
||||
|
class="el-icon-d-caret" |
||||
|
style="width: 1rem; height: 1rem" |
||||
|
></i> |
||||
|
</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<!-- <comp-table |
||||
|
:tableData="tableData" |
||||
|
:tableHeader="tableHeader" |
||||
|
@clickevents="rowclick" |
||||
|
ref="singleTable" |
||||
|
> |
||||
|
</comp-table> --> |
||||
|
</el-card> |
||||
|
<!-- 弹框 --> |
||||
|
<el-dialog |
||||
|
:title="title == 1 ? '新增' : '编辑'" |
||||
|
:visible.sync="dialogVisible" |
||||
|
width="75%" |
||||
|
> |
||||
|
<el-form ref="form" :model="form" label-width="80px" :rules="rules"> |
||||
|
<el-row> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="名称" prop="displayName"> |
||||
|
<el-input |
||||
|
v-model="form.displayName" |
||||
|
style="width: 80%" |
||||
|
></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="onsbmit">确 定</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
<!-- 按钮区域 --> |
||||
|
<div style="margin-left: 10px; margin-top: 5%"> |
||||
|
<el-button type="primary" @click="add">新增</el-button> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
@click="editpopup" |
||||
|
style="margin-left: 0; margin-top: 10px" |
||||
|
>编辑</el-button |
||||
|
> |
||||
|
<div style="margin-top: 10px"> |
||||
|
<el-button type="danger" @click="delets">删除</el-button> |
||||
|
</div> |
||||
|
<div style="margin-top: 10px"> |
||||
|
<el-button type="primary" @click="topping">置顶</el-button> |
||||
|
</div> |
||||
|
<div style="margin-top: 10px"> |
||||
|
<el-button type="primary" @click="toppings">置底</el-button> |
||||
|
</div> |
||||
|
<div style="margin-top: 10px"> |
||||
|
<el-button type="primary" :disabled="isshow" @click="assertion" |
||||
|
>排序</el-button |
||||
|
> |
||||
|
</div> |
||||
|
<div style="margin-top: 5px"> |
||||
|
<el-button type="primary" :disabled="isshow" @click="cancellation" |
||||
|
>取消</el-button |
||||
|
> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { rowDrop } from "@/components/publicjs/public"; |
||||
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
||||
|
import { getporjectlists } from "@/request/commonapi"; |
||||
|
import compTable from "@/components/compTable.vue"; |
||||
|
import Sortable from "sortablejs"; |
||||
|
export default { |
||||
|
components: { compTable }, |
||||
|
data() { |
||||
|
return { |
||||
|
isshow: true, |
||||
|
rules: { |
||||
|
itemId: [{ required: true, message: "请选择项目", trigger: "change" }], |
||||
|
displayName: [ |
||||
|
{ required: true, message: "请输入名称", trigger: "blur" }, |
||||
|
], |
||||
|
diagnosisId: [ |
||||
|
{ required: true, message: "请选择诊断编号", trigger: "change" }, |
||||
|
], |
||||
|
isNameIntoSummary: [ |
||||
|
{ required: true, message: "请选择小结名称", trigger: "change" }, |
||||
|
], |
||||
|
isResultIntoSummary: [ |
||||
|
{ required: true, message: "请选择进入小结", trigger: "change" }, |
||||
|
], |
||||
|
resultStatusId: [ |
||||
|
{ required: true, message: "请选择结果状态", trigger: "change" }, |
||||
|
], |
||||
|
simpleCode: [ |
||||
|
{ required: true, message: "请输入拼音简码", trigger: "change" }, |
||||
|
], |
||||
|
}, |
||||
|
form: { |
||||
|
displayName: "", |
||||
|
}, |
||||
|
dialogVisible: false, |
||||
|
title: 1, |
||||
|
pages: { |
||||
|
SkipCount: 0, |
||||
|
MaxResultCount: 100, |
||||
|
Sorting: "displayOrder desc", |
||||
|
}, |
||||
|
itemId: [], //项目 |
||||
|
diagnosisId: [], //诊断 |
||||
|
resultStatusId: [], //结果状态 |
||||
|
isNameIntoSummary: [ |
||||
|
{ |
||||
|
value: "N", |
||||
|
label: "否", |
||||
|
}, |
||||
|
{ |
||||
|
value: "Y", |
||||
|
label: "是", |
||||
|
}, |
||||
|
], // 小结名称 |
||||
|
isResultIntoSummary: [ |
||||
|
{ |
||||
|
value: "N", |
||||
|
label: "否", |
||||
|
}, |
||||
|
{ |
||||
|
value: "Y", |
||||
|
label: "是", |
||||
|
}, |
||||
|
], //进入小结 |
||||
|
tableData: [], |
||||
|
initTableData: [], |
||||
|
tableHeader: [ |
||||
|
// 表头信息,可根据minWidth修改宽度 |
||||
|
{ prop: "id", label: "编号", minWidth: "150px" }, |
||||
|
{ prop: `creatorName`, label: "创建者" }, |
||||
|
{ prop: `creationTime`, label: "创建时间" }, |
||||
|
{ prop: `lastModifierName`, label: "修改者" }, |
||||
|
{ prop: `lastModificationTime`, label: "创建时间" }, |
||||
|
{ prop: "result", label: "结果" }, |
||||
|
// { prop: "simpleCode", label: "拼音简码" }, |
||||
|
], |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.getlist(); |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.rowDrop(); |
||||
|
}, |
||||
|
methods: { |
||||
|
//取消排序 |
||||
|
cancellation() { |
||||
|
this.$message.info("取消操作"); |
||||
|
this.isshow = true; |
||||
|
this.getlist(); |
||||
|
}, |
||||
|
//确定排序 |
||||
|
assertion() { |
||||
|
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 }); |
||||
|
} |
||||
|
}); |
||||
|
putapi("/api/app/itemtemplate/updatesortmany", { |
||||
|
itemList: result, |
||||
|
}).then((res) => { |
||||
|
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, |
||||
|
|
||||
|
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) { |
||||
|
// console.log(item, "新数据"); |
||||
|
} else if (index == oldIndex) { |
||||
|
} else if (index == newIndex) { |
||||
|
} |
||||
|
}); |
||||
|
console.log(_this.tableData.map((item) => item.displayOrder)); |
||||
|
}, |
||||
|
}); |
||||
|
}); |
||||
|
}, |
||||
|
toppings() { |
||||
|
if (this.form.id == undefined) { |
||||
|
this.$message.warning("请选择操作的数据"); |
||||
|
} else { |
||||
|
putapi( |
||||
|
`/api/app/itemtemplate/updatemanysort?id=${ |
||||
|
this.form.id |
||||
|
}&SortType=${2}` |
||||
|
).then((res) => { |
||||
|
this.$message.success("操作成功"); |
||||
|
this.getlist(); |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
topping() { |
||||
|
if (this.form.id == undefined) { |
||||
|
this.$message.warning("请选择操作的数据"); |
||||
|
} else { |
||||
|
putapi( |
||||
|
`/api/app/itemtemplate/updatemanysort?id=${ |
||||
|
this.form.id |
||||
|
}&SortType=${1}` |
||||
|
).then((res) => { |
||||
|
this.$message.success("操作成功"); |
||||
|
this.getlist(); |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
//删除 |
||||
|
delets(row) { |
||||
|
if (this.form.id == undefined) { |
||||
|
this.$message.warning("请选择删除的数据"); |
||||
|
} else { |
||||
|
this.$confirm("是否确认删除,是否继续?", "提示", { |
||||
|
confirmButtonText: "确定", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
deletapi(`/api/app/item-template/${this.form.id}`).then((res) => { |
||||
|
this.$message.success("删除成功"); |
||||
|
this.getlist(); |
||||
|
}); |
||||
|
}) |
||||
|
.catch(() => {}); |
||||
|
} |
||||
|
}, |
||||
|
//编辑弹框 |
||||
|
editpopup() { |
||||
|
if (this.form.id == undefined) { |
||||
|
this.$message.warning("请点击选择操作的数据"); |
||||
|
} else { |
||||
|
this.dialogVisible = true; |
||||
|
this.title = 2; |
||||
|
// this.addtoedit(); |
||||
|
getapi(`/api/app/item-template/${this.form.id}`).then((res) => { |
||||
|
this.form = res.data; |
||||
|
console.log(res); |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
//确定新增或者编辑 |
||||
|
onsbmit() { |
||||
|
this.$refs.form.validate((v) => { |
||||
|
if (v) { |
||||
|
if (this.title == 1) { |
||||
|
postapi("/api/app/item-template/", this.form).then((res) => { |
||||
|
this.$message.success("新增成功"); |
||||
|
this.getlist(); |
||||
|
this.dialogVisible = false; |
||||
|
}); |
||||
|
} else if (this.title == 2) { |
||||
|
putapi(`/api/app/item-template/${this.form.id}`, this.form).then( |
||||
|
(res) => { |
||||
|
this.$message.success("修改成功"); |
||||
|
this.getlist(); |
||||
|
this.dialogVisible = false; |
||||
|
} |
||||
|
); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
rowclick(val) { |
||||
|
getapi(`/api/app/item-template/${val.id}`).then((res) => { |
||||
|
this.form = res.data; |
||||
|
console.log(res); |
||||
|
}); |
||||
|
}, |
||||
|
handleRowClick(Row) { |
||||
|
console.log(Row); |
||||
|
console.log("1"); |
||||
|
}, |
||||
|
// 新增或者编辑需要的类别 |
||||
|
addtoedit() { |
||||
|
//项目 |
||||
|
getporjectlists().then((res) => { |
||||
|
this.itemId = res.data.items; |
||||
|
}); |
||||
|
// 诊断 |
||||
|
postapi("/api/app/diagnosis/getlistinfilter").then((res) => { |
||||
|
this.diagnosisId = res.data.items; |
||||
|
}); |
||||
|
//结果状态 |
||||
|
getapi("/api/app/result-status").then((res) => { |
||||
|
this.resultStatusId = res.data.items; |
||||
|
}); |
||||
|
getapi("/api/app/diagnosis/getlistinfilter").then((res) => {}); |
||||
|
}, |
||||
|
//新增弹框 |
||||
|
add() { |
||||
|
// this.addtoedit(); |
||||
|
this.dialogVisible = true; |
||||
|
this.title = 1; |
||||
|
this.form = {}; |
||||
|
}, |
||||
|
getlist() { |
||||
|
getapi("/api/app/item-template/in-filter", this.pages).then((res) => { |
||||
|
console.log(res); |
||||
|
this.tableData = res.data.items; |
||||
|
this.initTableData = [...res.data.items]; |
||||
|
}); |
||||
|
let that = this; |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.box { |
||||
|
display: flex; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,414 @@ |
|||||
|
<template> |
||||
|
<div class="box"> |
||||
|
<div style="width: 95%"> |
||||
|
<el-card> |
||||
|
<el-table |
||||
|
:data="tableData" |
||||
|
style="width: 100%" |
||||
|
row-key="id" |
||||
|
class="el-table__body-wrapper tbody" |
||||
|
@row-click="rowclick" |
||||
|
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="创建者" width="150"> |
||||
|
</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="操作" width=""> |
||||
|
<template> |
||||
|
<el-tag |
||||
|
class="move" |
||||
|
style="cursor: move; margin-left: 15px" |
||||
|
draggable="true" |
||||
|
> |
||||
|
<i |
||||
|
class="el-icon-d-caret" |
||||
|
style="width: 1rem; height: 1rem" |
||||
|
></i> |
||||
|
</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<!-- <comp-table |
||||
|
:tableData="tableData" |
||||
|
:tableHeader="tableHeader" |
||||
|
@clickevents="rowclick" |
||||
|
ref="singleTable" |
||||
|
> |
||||
|
</comp-table> --> |
||||
|
</el-card> |
||||
|
<!-- 弹框 --> |
||||
|
<el-dialog |
||||
|
:title="title == 1 ? '新增' : '编辑'" |
||||
|
:visible.sync="dialogVisible" |
||||
|
width="75%" |
||||
|
> |
||||
|
<el-form ref="form" :model="form" label-width="80px" :rules="rules"> |
||||
|
<el-row> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="名称" prop="displayName"> |
||||
|
<el-input |
||||
|
v-model="form.displayName" |
||||
|
style="width: 80%" |
||||
|
></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="价格" prop="price"> |
||||
|
<el-input v-model="form.price" style="width: 80%"></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="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-col :span="8"> |
||||
|
<el-form-item label="备注" prop="remark"> |
||||
|
<el-input v-model="form.remark" style="width: 80%"></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="onsbmit">确 定</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
<!-- 按钮区域 --> |
||||
|
<div style="margin-left: 10px; margin-top: 5%"> |
||||
|
<el-button type="primary" @click="add">新增</el-button> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
@click="editpopup" |
||||
|
style="margin-left: 0; margin-top: 10px" |
||||
|
>编辑</el-button |
||||
|
> |
||||
|
<div style="margin-top: 10px"> |
||||
|
<el-button type="danger" @click="delets">删除</el-button> |
||||
|
</div> |
||||
|
<div style="margin-top: 10px"> |
||||
|
<el-button type="primary" @click="topping">置顶</el-button> |
||||
|
</div> |
||||
|
<div style="margin-top: 10px"> |
||||
|
<el-button type="primary" @click="toppings">置底</el-button> |
||||
|
</div> |
||||
|
<div style="margin-top: 10px"> |
||||
|
<el-button type="primary" :disabled="isshow" @click="assertion" |
||||
|
>排序</el-button |
||||
|
> |
||||
|
</div> |
||||
|
<div style="margin-top: 5px"> |
||||
|
<el-button type="primary" :disabled="isshow" @click="cancellation" |
||||
|
>取消</el-button |
||||
|
> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { rowDrop } from "@/components/publicjs/public"; |
||||
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
||||
|
import { getporjectlists } from "@/request/commonapi"; |
||||
|
import compTable from "@/components/compTable.vue"; |
||||
|
import Sortable from "sortablejs"; |
||||
|
export default { |
||||
|
components: { compTable }, |
||||
|
data() { |
||||
|
return { |
||||
|
isshow: true, |
||||
|
rules: { |
||||
|
forSexId: [ |
||||
|
{ required: true, message: "请选择性别", trigger: "change" }, |
||||
|
], |
||||
|
isActive: [ |
||||
|
{ required: true, message: "请选择启用标志", trigger: "change" }, |
||||
|
], |
||||
|
displayName: [ |
||||
|
{ required: true, message: "请输入名称", trigger: "blur" }, |
||||
|
], |
||||
|
price: [{ required: true, message: "请输入价格", trigger: "blur" }], |
||||
|
remark: [{ required: true, message: "请输入备注", trigger: "blur" }], |
||||
|
}, |
||||
|
form: { |
||||
|
displayName: "", |
||||
|
price: "", |
||||
|
forSexId: "", |
||||
|
isActive: "", |
||||
|
remark: "", |
||||
|
}, |
||||
|
isActive: [ |
||||
|
{ |
||||
|
value: "N", |
||||
|
label: "否", |
||||
|
}, |
||||
|
{ |
||||
|
value: "Y", |
||||
|
label: "是", |
||||
|
}, |
||||
|
], //启用标志 |
||||
|
forSexId: [], |
||||
|
dialogVisible: false, |
||||
|
title: 1, |
||||
|
pages: { |
||||
|
SkipCount: 0, |
||||
|
MaxResultCount: 100, |
||||
|
Sorting: "displayOrder desc", |
||||
|
}, |
||||
|
|
||||
|
isNameIntoSummary: [ |
||||
|
{ |
||||
|
value: "N", |
||||
|
label: "否", |
||||
|
}, |
||||
|
{ |
||||
|
value: "Y", |
||||
|
label: "是", |
||||
|
}, |
||||
|
], // 小结名称 |
||||
|
isResultIntoSummary: [ |
||||
|
{ |
||||
|
value: "N", |
||||
|
label: "否", |
||||
|
}, |
||||
|
{ |
||||
|
value: "Y", |
||||
|
label: "是", |
||||
|
}, |
||||
|
], //进入小结 |
||||
|
tableData: [], |
||||
|
initTableData: [], |
||||
|
tableHeader: [ |
||||
|
// 表头信息,可根据minWidth修改宽度 |
||||
|
{ prop: "id", label: "编号", minWidth: "150px" }, |
||||
|
{ prop: `creatorName`, label: "创建者" }, |
||||
|
{ prop: `creationTime`, label: "创建时间" }, |
||||
|
{ prop: `lastModifierName`, label: "修改者" }, |
||||
|
{ prop: `lastModificationTime`, label: "创建时间" }, |
||||
|
{ prop: "result", label: "结果" }, |
||||
|
// { prop: "simpleCode", label: "拼音简码" }, |
||||
|
], |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.getlist(); |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.rowDrop(); |
||||
|
}, |
||||
|
methods: { |
||||
|
//取消排序 |
||||
|
cancellation() { |
||||
|
this.$message.info("取消操作"); |
||||
|
this.isshow = true; |
||||
|
this.getlist(); |
||||
|
}, |
||||
|
//确定排序 |
||||
|
assertion() { |
||||
|
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 }); |
||||
|
} |
||||
|
}); |
||||
|
putapi("/api/app/medicalpackage/updatesortmany", { |
||||
|
itemList: result, |
||||
|
}).then((res) => { |
||||
|
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, |
||||
|
|
||||
|
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) { |
||||
|
// console.log(item, "新数据"); |
||||
|
} else if (index == oldIndex) { |
||||
|
} else if (index == newIndex) { |
||||
|
} |
||||
|
}); |
||||
|
console.log(_this.tableData.map((item) => item.displayOrder)); |
||||
|
}, |
||||
|
}); |
||||
|
}); |
||||
|
}, |
||||
|
toppings() { |
||||
|
if (this.form.id == undefined) { |
||||
|
this.$message.warning("请选择操作的数据"); |
||||
|
} else { |
||||
|
putapi( |
||||
|
`/api/app/medicalpackage/updatemanysort?id=${ |
||||
|
this.form.id |
||||
|
}&SortType=${2}` |
||||
|
).then((res) => { |
||||
|
this.$message.success("操作成功"); |
||||
|
this.getlist(); |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
topping() { |
||||
|
if (this.form.id == undefined) { |
||||
|
this.$message.warning("请选择操作的数据"); |
||||
|
} else { |
||||
|
putapi( |
||||
|
`/api/app/medicalpackage/updatemanysort?id=${ |
||||
|
this.form.id |
||||
|
}&SortType=${1}` |
||||
|
).then((res) => { |
||||
|
this.$message.success("操作成功"); |
||||
|
this.getlist(); |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
//删除 |
||||
|
delets(row) { |
||||
|
if (this.form.id == undefined) { |
||||
|
this.$message.warning("请选择删除的数据"); |
||||
|
} else { |
||||
|
this.$confirm("是否确认删除,是否继续?", "提示", { |
||||
|
confirmButtonText: "确定", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
deletapi(`/api/app/medical-package/${this.form.id}`).then((res) => { |
||||
|
this.$message.success("删除成功"); |
||||
|
this.getlist(); |
||||
|
}); |
||||
|
}) |
||||
|
.catch(() => {}); |
||||
|
} |
||||
|
}, |
||||
|
//编辑弹框 |
||||
|
editpopup() { |
||||
|
if (this.form.id == undefined) { |
||||
|
this.$message.warning("请点击选择操作的数据"); |
||||
|
} else { |
||||
|
this.dialogVisible = true; |
||||
|
this.title = 2; |
||||
|
this.addtoedit(); |
||||
|
getapi(`/api/app/medical-package/${this.form.id}`).then((res) => { |
||||
|
this.form = res.data; |
||||
|
console.log(res); |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
//确定新增或者编辑 |
||||
|
onsbmit() { |
||||
|
this.$refs.form.validate((v) => { |
||||
|
if (v) { |
||||
|
if (this.title == 1) { |
||||
|
this.form.price=Number(this.form.price) |
||||
|
postapi("/api/app/item-template", this.form).then((res) => { |
||||
|
this.$message.success("新增成功"); |
||||
|
this.getlist(); |
||||
|
this.dialogVisible = false; |
||||
|
}); |
||||
|
} else if (this.title == 2) { |
||||
|
putapi(`/api/app/medical-package/${this.form.id}`, this.form).then( |
||||
|
(res) => { |
||||
|
this.$message.success("修改成功"); |
||||
|
this.getlist(); |
||||
|
this.dialogVisible = false; |
||||
|
} |
||||
|
); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
rowclick(val) { |
||||
|
getapi(`/api/app/medical-package/${val.id}`).then((res) => { |
||||
|
this.form = res.data; |
||||
|
console.log(res); |
||||
|
}); |
||||
|
}, |
||||
|
handleRowClick(Row) { |
||||
|
console.log(Row); |
||||
|
console.log("1"); |
||||
|
}, |
||||
|
// 新增或者编辑需要的类别 |
||||
|
addtoedit() { |
||||
|
getapi("/api/app/sex").then((res) => { |
||||
|
this.forSexId = res.data; |
||||
|
}); |
||||
|
}, |
||||
|
//新增弹框 |
||||
|
add() { |
||||
|
this.addtoedit(); |
||||
|
this.dialogVisible = true; |
||||
|
this.title = 1; |
||||
|
this.form = {}; |
||||
|
}, |
||||
|
getlist() { |
||||
|
getapi("/api/app/medical-package/in-filter", this.pages).then((res) => { |
||||
|
console.log(res); |
||||
|
this.tableData = res.data.items; |
||||
|
this.initTableData = [...res.data.items]; |
||||
|
}); |
||||
|
let that = this; |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.box { |
||||
|
display: flex; |
||||
|
} |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue