Commit 5743429f authored by liang's avatar liang

列表排序

parent b6f32a0d
...@@ -79,8 +79,8 @@ export default { ...@@ -79,8 +79,8 @@ export default {
}) })
}, },
methods: { methods: {
changeShow() { changeShow(isRefresh) {
this.$emit("changeShow") this.$emit("changeShow", isRefresh)
}, },
refreshData(data) { refreshData(data) {
// this.refreshFlag = false // this.refreshFlag = false
......
<template> <template>
<div> <FollowReview
<FollowReview :currentRow="currentRow" titlePosition="top" @update="update"> :currentRow="currentRow"
<template #button> ref="follow"
<el-button titlePosition="top"
style="padding: 8px 20px" @update="update"
v-if="isShowEdit" >
@click="handleEdit" <template #button>
>修 改</el-button <el-button style="padding: 8px 20px" v-if="isShowEdit" @click="handleEdit"
> >修 改</el-button
<el-button >
style="padding: 8px 20px; margin-left: 20px" <el-button
@click="$emit('back')" style="padding: 8px 20px; margin-left: 20px"
>返 回</el-button @click="$emit('back')"
> >返 回</el-button
</template> >
</FollowReview> </template>
</div> </FollowReview>
</template> </template>
<script> <script>
...@@ -35,21 +35,14 @@ export default { ...@@ -35,21 +35,14 @@ export default {
}, },
methods: { methods: {
handleEdit() { handleEdit() {
const { patientId, followId } = this.currentRow this.$emit("handleEdit", this.currentRow)
this.$router.push({
path: "/followupentry",
query: {
patientId,
followId,
model: "edit",
getData: 1,
formType: 2,
},
})
}, },
update(val) { update(val) {
this.isLast = val this.isLast = val
}, },
refresh() {
this.$refs.follow.refreshFollow()
},
}, },
computed: { computed: {
isShowEdit() { isShowEdit() {
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
v-for="form in followForms" v-for="form in followForms"
:key="form.id" :key="form.id"
:form="form" :form="form"
ref="myForm"
:patientId="currentRow.patientId" :patientId="currentRow.patientId"
:followId="followId" :followId="followId"
></MyCustomForm> ></MyCustomForm>
...@@ -152,6 +153,12 @@ export default { ...@@ -152,6 +153,12 @@ export default {
}, },
}, },
methods: { methods: {
refreshFollow() {
const refs = this.$refs["myForm"]
refs.map((ele) => {
ele.getFollowDetail()
})
},
getLogList() { getLogList() {
const obj = { const obj = {
patientId: this.currentRow.patientId, patientId: this.currentRow.patientId,
......
<template> <template>
<!-- 随访查询 --> <!-- 随访查询 -->
<div class="screeningSearch"> <div class="screeningSearch">
<div v-show="!isDetail && !show"> <div v-show="!isDetail && !isEdit">
<div class="top"> <div class="top">
<form-components <form-components
ref="form" ref="form"
:forms="formList" :forms="formList"
:form-edit="formEdit" @handleSearch="onClickSearch"
@handleSearch="onSearch"
></form-components> ></form-components>
</div> </div>
<div class="bot"> <div class="bot">
...@@ -23,15 +22,20 @@ ...@@ -23,15 +22,20 @@
:page-size="pageSize" :page-size="pageSize"
@pageSizeChange="handleSizeChange" @pageSizeChange="handleSizeChange"
@currentPageChange="handleCurrentChange" @currentPageChange="handleCurrentChange"
:sortChange="sortChange"
/> />
</div> </div>
</div> </div>
<FollowUpDetail <div v-show="!isEdit">
:currentRow="currentRow" <FollowUpDetail
v-if="isDetail" :currentRow="currentRow"
@back="back" @handleEdit="handleEdit"
></FollowUpDetail> ref="follow"
<followupentry v-if="show" @changeShow="changeShow"></followupentry> v-if="isDetail"
@back="back"
></FollowUpDetail>
</div>
<followupentry v-if="isEdit" @changeShow="changeShow"></followupentry>
</div> </div>
</template> </template>
<script> <script>
...@@ -52,7 +56,7 @@ export default { ...@@ -52,7 +56,7 @@ export default {
data() { data() {
return { return {
isDetail: false, isDetail: false,
show: false, isEdit: false,
followId: "", followId: "",
listLoading: false, listLoading: false,
keyword: "", keyword: "",
...@@ -65,6 +69,7 @@ export default { ...@@ -65,6 +69,7 @@ export default {
formatter: (row) => { formatter: (row) => {
return row.unionName ? row.unionName : "--" return row.unionName ? row.unionName : "--"
}, },
sortable: "custom",
}, },
{ {
label: "姓名", label: "姓名",
...@@ -73,6 +78,7 @@ export default { ...@@ -73,6 +78,7 @@ export default {
return row.name ? row.name : "--" return row.name ? row.name : "--"
}, },
value: "name", value: "name",
sortable: "custom",
}, },
{ {
label: "性别", label: "性别",
...@@ -84,6 +90,7 @@ export default { ...@@ -84,6 +90,7 @@ export default {
row.sex + "" row.sex + ""
) )
}, },
sortable: "custom",
}, },
{ {
label: "身份证", label: "身份证",
...@@ -92,6 +99,7 @@ export default { ...@@ -92,6 +99,7 @@ export default {
formatter: (row) => { formatter: (row) => {
return row.idCard ? row.idCard : "--" return row.idCard ? row.idCard : "--"
}, },
sortable: "custom",
}, },
{ {
label: "年龄", label: "年龄",
...@@ -100,6 +108,7 @@ export default { ...@@ -100,6 +108,7 @@ export default {
formatter: (row) => { formatter: (row) => {
return row.age ? row.age : "--" return row.age ? row.age : "--"
}, },
sortable: "custom",
}, },
{ {
label: "筛查时间", label: "筛查时间",
...@@ -108,6 +117,7 @@ export default { ...@@ -108,6 +117,7 @@ export default {
formatter: (row) => { formatter: (row) => {
return row.screeningTime ? row.screeningTime : "--" return row.screeningTime ? row.screeningTime : "--"
}, },
sortable: "custom",
}, },
{ {
label: "审核状态", label: "审核状态",
...@@ -119,10 +129,11 @@ export default { ...@@ -119,10 +129,11 @@ export default {
String(row.checkStatus) String(row.checkStatus)
) )
}, },
sortable: "custom",
}, },
{ {
label: "风险评估结果", label: "风险评估结果",
minWidth: 120, minWidth: 130,
value: "riskRank", value: "riskRank",
formatter: (row) => { formatter: (row) => {
let riskRank = { let riskRank = {
...@@ -132,14 +143,16 @@ export default { ...@@ -132,14 +143,16 @@ export default {
} }
return row.riskRank ? riskRank[row.riskRank] : "--" return row.riskRank ? riskRank[row.riskRank] : "--"
}, },
sortable: "custom",
}, },
{ {
label: "上次随访时间", label: "上次随访时间",
value: "followTime", value: "followTime",
minWidth: 120, minWidth: 130,
formatter: (row) => { formatter: (row) => {
return row.followTime ? row.followTime : "--" return row.followTime ? row.followTime : "--"
}, },
sortable: "custom",
}, },
{ {
label: "随访进度", label: "随访进度",
...@@ -151,6 +164,7 @@ export default { ...@@ -151,6 +164,7 @@ export default {
String(row.followBatch) String(row.followBatch)
) )
}, },
sortable: "custom",
}, },
{ {
label: "操作", label: "操作",
...@@ -268,7 +282,7 @@ export default { ...@@ -268,7 +282,7 @@ export default {
], ],
}, },
], ],
formEdit: {}, cacheForm: {},
currentRow: {}, currentRow: {},
} }
}, },
...@@ -286,19 +300,39 @@ export default { ...@@ -286,19 +300,39 @@ export default {
}, },
mounted() { mounted() {
const followId = this.$route.query.followId const followId = this.$route.query.followId
const isEdit = this.$route.query.model === "edit"
// 从随访录入跳转过来显示处理
if (followId) { if (followId) {
this.handleDetail({ ...this.$route.query }) this.isEdit = isEdit
this.isDetail = !isEdit
if (this.isDetail) {
this.handleDetail(this.$route.query)
}
} }
// this.formEdit = sessionStorage.getItem('followQuery-form') ? JSON.parse(sessionStorage.getItem('followQuery-form')) : {}
this.pageSize = Number(sessionStorage.getItem("followQuery-pageSize")) || 10 this.pageSize = Number(sessionStorage.getItem("followQuery-pageSize")) || 10
this.pageIndex = this.pageIndex =
Number(sessionStorage.getItem("followQuery-pageIndex")) || 1 Number(sessionStorage.getItem("followQuery-pageIndex")) || 1
this.getCurrentFormByType(2) this.getCurrentFormByType(2)
}, },
methods: { methods: {
changeShow() { changeShow(isRefresh) {
this.$router.push({ query: {} }) let query = {}
this.show = false if (this.isDetail) {
const { patientId, followId, followBatch } = this.$route.query
query = {
patientId,
followId,
followBatch,
}
}
if (isRefresh) {
if (this.isDetail) {
this.$refs.follow.refresh()
}
this.handleSearch()
}
this.$router.replace({ path: "/followupquery", query })
this.isEdit = false
}, },
back() { back() {
this.isDetail = false this.isDetail = false
...@@ -311,7 +345,6 @@ export default { ...@@ -311,7 +345,6 @@ export default {
this.modifiedFlag = !this.modifiedFlag this.modifiedFlag = !this.modifiedFlag
}, },
setSelectedIndex(i) { setSelectedIndex(i) {
console.log(this.selectedIndex)
this.selectedIndex = i this.selectedIndex = i
sessionStorage.setItem("homeSelectedIndex", this.selectedIndex) sessionStorage.setItem("homeSelectedIndex", this.selectedIndex)
}, },
...@@ -319,12 +352,13 @@ export default { ...@@ -319,12 +352,13 @@ export default {
console.log(v) console.log(v)
}, },
handleEdit(data, i, index) { handleEdit(data, i, index) {
this.show = true this.isEdit = true
this.$router.push({ this.$router.replace({
// path: "/followupentry", path: "/followupquery",
query: { query: {
patientId: data.patientId, patientId: data.patientId,
followId: data.id, followId: data.followId,
followBatch: data.followBatch,
model: "edit", model: "edit",
getData: 1, getData: 1,
formType: 2, formType: 2,
...@@ -334,19 +368,25 @@ export default { ...@@ -334,19 +368,25 @@ export default {
handleDetail(row) { handleDetail(row) {
this.isDetail = true this.isDetail = true
this.currentRow = row this.currentRow = row
}, this.$router.replace({
onSearch(form) { path: "/followupquery",
console.log(form) query: {
this.pageIndex = 1 patientId: row.patientId,
sessionStorage.setItem("followQuery-form", JSON.stringify(form)) followId: row.followId,
this.formEdit = form followBatch: row.followBatch,
this.handleSearch() },
})
}, },
onClickSearch() { onClickSearch() {
this.pageIndex = 1 this.pageIndex = 1
this.handleSearch() this.handleSearch()
}, },
async handleSearch() { sortChange({ prop, order }) {
const sort = order ? (order === "ascending" ? "asc" : "desc") : ""
const sortField = order ? prop : ""
this.handleSearch({ sortField, sort })
},
async handleSearch(form = {}) {
this.listLoading = true this.listLoading = true
let params = { let params = {
...@@ -354,11 +394,10 @@ export default { ...@@ -354,11 +394,10 @@ export default {
pageNum: this.pageIndex, pageNum: this.pageIndex,
formId: this.formId, formId: this.formId,
...this.$refs.form.form, ...this.$refs.form.form,
...form,
patientFrom: sessionStorage.getItem("selectedIndex"), //筛查场景 patientFrom: sessionStorage.getItem("selectedIndex"), //筛查场景
} }
if (this.formEdit) { params = Object.assign(this.cacheForm, params)
params = { ...Object.assign(this.formEdit, params) }
}
for (let key in params) { for (let key in params) {
if (params[key] !== "" && params[key] !== null) { if (params[key] !== "" && params[key] !== null) {
if (key.includes("Time") && params[key]) { if (key.includes("Time") && params[key]) {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
:total-count="total" :total-count="total"
:page-sizes="pageSizes" :page-sizes="pageSizes"
:page-size="pageSize" :page-size="pageSize"
:sort-change="sortChange"
@pageSizeChange="handleSizeChange" @pageSizeChange="handleSizeChange"
@currentPageChange="handleCurrentChange" @currentPageChange="handleCurrentChange"
/> />
...@@ -57,6 +58,7 @@ export default { ...@@ -57,6 +58,7 @@ export default {
formatter: (row) => { formatter: (row) => {
return row.unionName ? row.unionName : "--" return row.unionName ? row.unionName : "--"
}, },
sortable: "custom",
}, },
{ {
label: "姓名", label: "姓名",
...@@ -65,6 +67,7 @@ export default { ...@@ -65,6 +67,7 @@ export default {
return row.name ? row.name : "--" return row.name ? row.name : "--"
}, },
value: "name", value: "name",
sortable: "custom",
}, },
{ {
label: "性别", label: "性别",
...@@ -76,6 +79,7 @@ export default { ...@@ -76,6 +79,7 @@ export default {
row.sex + "" row.sex + ""
) )
}, },
sortable: "custom",
}, },
{ {
label: "身份证", label: "身份证",
...@@ -84,6 +88,7 @@ export default { ...@@ -84,6 +88,7 @@ export default {
formatter: (row) => { formatter: (row) => {
return row.idCard ? row.idCard : "--" return row.idCard ? row.idCard : "--"
}, },
sortable: "custom",
}, },
{ {
label: "年龄", label: "年龄",
...@@ -92,6 +97,7 @@ export default { ...@@ -92,6 +97,7 @@ export default {
formatter: (row) => { formatter: (row) => {
return row.age ? row.age : "--" return row.age ? row.age : "--"
}, },
sortable: "custom",
}, },
{ {
label: "筛查时间", label: "筛查时间",
...@@ -100,11 +106,12 @@ export default { ...@@ -100,11 +106,12 @@ export default {
formatter: (row) => { formatter: (row) => {
return row.screeningTime ? row.screeningTime : "--" return row.screeningTime ? row.screeningTime : "--"
}, },
sortable: "custom",
}, },
{ {
label: "风险评估结果", label: "风险评估结果",
minWidth: 120, minWidth: 130,
value: "riskRank", value: "riskRank",
formatter: (row) => { formatter: (row) => {
let riskRank = { let riskRank = {
...@@ -114,14 +121,16 @@ export default { ...@@ -114,14 +121,16 @@ export default {
} }
return row.riskRank ? riskRank[row.riskRank] : "--" return row.riskRank ? riskRank[row.riskRank] : "--"
}, },
sortable: "custom",
}, },
{ {
label: "上次随访时间", label: "上次随访时间",
value: "followTime", value: "followTime",
minWidth: 120, minWidth: 130,
formatter: (row) => { formatter: (row) => {
return row.followTime ? row.followTime : "--" return row.followTime ? row.followTime : "--"
}, },
sortable: "custom",
}, },
{ {
label: "随访进度", label: "随访进度",
...@@ -133,6 +142,7 @@ export default { ...@@ -133,6 +142,7 @@ export default {
String(row.followBatch) String(row.followBatch)
) )
}, },
sortable: "custom",
}, },
{ {
label: "计划随访时间", label: "计划随访时间",
...@@ -143,7 +153,8 @@ export default { ...@@ -143,7 +153,8 @@ export default {
// String(row.nextFollowTime) // String(row.nextFollowTime)
// ) // )
// }, // },
minWidth: 120, sortable: "custom",
minWidth: 130,
}, },
{ {
label: "操作", label: "操作",
...@@ -261,6 +272,7 @@ export default { ...@@ -261,6 +272,7 @@ export default {
}, },
], ],
formEdit: {}, formEdit: {},
cacheForm: {},
} }
}, },
computed: { computed: {
...@@ -294,6 +306,11 @@ export default { ...@@ -294,6 +306,11 @@ export default {
this.pageIndex = 1 this.pageIndex = 1
this.handleSearch() this.handleSearch()
}, },
sortChange({ prop, order }) {
const sort = order ? (order === "ascending" ? "asc" : "desc") : ""
const sortField = order ? prop : ""
this.handleSearch({ sortField, sort })
},
rowOpration(data, i) { rowOpration(data, i) {
sessionStorage.setItem("formEdit", JSON.stringify(data)) sessionStorage.setItem("formEdit", JSON.stringify(data))
this.$router.push({ this.$router.push({
...@@ -307,11 +324,13 @@ export default { ...@@ -307,11 +324,13 @@ export default {
}) })
this.show = true this.show = true
}, },
async handleSearch() { async handleSearch(form = {}) {
Object.assign(this.cacheForm, form)
this.listLoading = true this.listLoading = true
let params = { let params = {
pageSize: this.pageSize, pageSize: this.pageSize,
pageNum: this.pageIndex, pageNum: this.pageIndex,
...this.cacheForm,
} }
params.patientFrom = this.selectedIndex params.patientFrom = this.selectedIndex
if (this.formEdit) { if (this.formEdit) {
......
...@@ -347,7 +347,11 @@ export default { ...@@ -347,7 +347,11 @@ export default {
// 筛查提交 // 筛查提交
this.dialogType = "submit" this.dialogType = "submit"
if (this.formType == 2) { if (this.formType == 2) {
this.$refs.followDialog.dialogVisible = true if (this.$route.query.model === "edit") {
this.$emit("changeShow", true)
} else {
this.$refs.followDialog.dialogVisible = true
}
} else { } else {
this.$refs.showDialog.dialogVisible = true this.$refs.showDialog.dialogVisible = true
} }
......
...@@ -113,6 +113,7 @@ export default { ...@@ -113,6 +113,7 @@ export default {
formatter: (row) => { formatter: (row) => {
return row.unionName ? row.unionName : "--" return row.unionName ? row.unionName : "--"
}, },
sortable: "custom",
}, },
{ {
label: "姓名", label: "姓名",
...@@ -121,6 +122,7 @@ export default { ...@@ -121,6 +122,7 @@ export default {
return row.name ? row.name : "--" return row.name ? row.name : "--"
}, },
value: "name", value: "name",
sortable: "custom",
}, },
{ {
label: "性别", label: "性别",
...@@ -131,6 +133,7 @@ export default { ...@@ -131,6 +133,7 @@ export default {
? this.$handle.formatDicList(this.dictMap["d-sex"], row.sex + "") ? this.$handle.formatDicList(this.dictMap["d-sex"], row.sex + "")
: "--" : "--"
}, },
sortable: "custom",
}, },
// { // {
// label: "身份证", // label: "身份证",
...@@ -147,15 +150,16 @@ export default { ...@@ -147,15 +150,16 @@ export default {
formatter: (row) => { formatter: (row) => {
return row.age ? row.age : "--" return row.age ? row.age : "--"
}, },
sortable: "custom",
}, },
{ {
label: "筛查时间", label: "筛查时间",
minWidth: 180, minWidth: 180,
// sortable: "custom",
value: "createTime", value: "createTime",
formatter: (row) => { formatter: (row) => {
return row.createTime ? row.createTime : "--" return row.createTime ? row.createTime : "--"
}, },
sortable: "custom",
}, },
{ {
label: "风险评估结果", label: "风险评估结果",
...@@ -169,11 +173,13 @@ export default { ...@@ -169,11 +173,13 @@ export default {
} }
return row.riskRank ? riskRank[row.riskRank] : "--" return row.riskRank ? riskRank[row.riskRank] : "--"
}, },
sortable: "custom",
}, },
{ {
label: "是否内镜", label: "是否内镜",
minWidth: 120, minWidth: 120,
value: "isInnerCheck", value: "isInnerCheck",
sortable: "custom",
formatter: (row) => { formatter: (row) => {
let arr = [ let arr = [
{ label: "", value: "0" }, { label: "", value: "0" },
...@@ -207,6 +213,7 @@ export default { ...@@ -207,6 +213,7 @@ export default {
} }
return label return label
}, },
sortable: "custom",
}, },
{ {
label: "操作", label: "操作",
...@@ -282,9 +289,9 @@ export default { ...@@ -282,9 +289,9 @@ export default {
}, },
sortChange({ prop, order }) { sortChange({ prop, order }) {
const asc = order ? (order === "ascending" ? true : false) : "" const sort = order ? (order === "ascending" ? "asc" : "desc") : ""
const column = order ? prop : "" const sortField = order ? prop : ""
this.handleSearch({ "orders[0].asc": asc, "orders[0].column": column }) this.handleSearch({ sortField, sort })
}, },
// 查询 // 查询
handleFormSearch(form) { handleFormSearch(form) {
......
...@@ -18,9 +18,7 @@ export default { ...@@ -18,9 +18,7 @@ export default {
items: [1, 2, 3, 4, 5, 6, 7, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], items: [1, 2, 3, 4, 5, 6, 7, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
} }
}, },
mounted() { mounted() {},
},
} }
</script> </script>
<style lang="scss"> <style lang="scss">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment