4 changed files with 263 additions and 133 deletions
-
173src/components/doctorCheck/CheckItemList.vue
-
72src/components/doctorCheck/PatientRegisterBase.vue
-
117src/components/doctorCheck/RegisterCheckList.vue
-
34src/store/index.js
@ -1,69 +1,134 @@ |
|||||
<template> |
<template> |
||||
<div> |
|
||||
<el-table :data="doctorCheck.checkItemList" style="width: 100%" height="350" border |
|
||||
@row-click="rowClick"> |
|
||||
<el-table-column prop="itemName" label="项目" width="180" /> |
|
||||
<el-table-column prop="itemName" label="结果" width="500" /> |
|
||||
<el-table-column prop="itemName" label="单位" width="80" /> |
|
||||
<el-table-column prop="itemName" label="参考范围" width="120" /> |
|
||||
</el-table> |
|
||||
</div> |
|
||||
</template> |
|
||||
<script> |
|
||||
import { mapState } from 'vuex'; |
|
||||
export default { |
|
||||
components: {}, |
|
||||
data() { |
|
||||
return { |
|
||||
|
<div> |
||||
|
<el-table :data="doctorCheck.checkItemList" style="width: 100%" height="350" border @row-click="rowClick"> |
||||
|
<el-table-column prop="itemName" label="项目" width="180" /> |
||||
|
<el-table-column prop="result" label="结果" width="500"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-autocomplete style="width: 480px" class="inline-input" type="textarea" |
||||
|
v-model="doctorCheck.checkItemList[scope.$index].result" :fetch-suggestions="querySearch" |
||||
|
placeholder="请输入结果值" @select="handleSelect" /> |
||||
|
</template> |
||||
|
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
created() {}, |
|
||||
|
|
||||
//挂载完成 |
|
||||
mounted() {}, |
|
||||
|
|
||||
computed:{ |
|
||||
...mapState(['dict','doctorCheck']), |
|
||||
|
</el-table-column> |
||||
|
<el-table-column prop="unit" label="单位" width="80" /> |
||||
|
<el-table-column prop="referenceRangeValue" label="参考范围" width="120" /> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<script> |
||||
|
import { mapState } from 'vuex'; |
||||
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
||||
|
|
||||
|
export default { |
||||
|
components: {}, |
||||
|
data() { |
||||
|
return { |
||||
|
restaurants:[], //结果模版 |
||||
|
currentRow: -1, //当前操作的行 |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
created() { }, |
||||
|
|
||||
|
//挂载完成 |
||||
|
mounted() { }, |
||||
|
|
||||
|
computed: { |
||||
|
...mapState(['dict', 'doctorCheck']), |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
|
||||
|
|
||||
|
|
||||
|
//选择组合项目 |
||||
|
rowClick(row) { |
||||
|
//registerCheckId |
||||
|
// "itemResultTemplates": [ |
||||
|
// { |
||||
|
// "itemId": "3a0c6555-0dad-55b4-b59f-b11e8074cfdd", |
||||
|
// "result": "阳性", |
||||
|
// "diagnosisId": "db34f48c-8c2f-9311-076d-302dc31930e7", |
||||
|
// "isNameIntoSummary": "Y", |
||||
|
// "isResultIntoSummary": "Y", |
||||
|
// "resultStatusId": "08", |
||||
|
// "simpleCode": null |
||||
|
// }, |
||||
|
// { |
||||
|
// "itemId": "3a0c6555-0dad-55b4-b59f-b11e8074cfdd", |
||||
|
// "result": "阴性", |
||||
|
// "diagnosisId": "db34f48c-8c2f-9311-076d-302dc31930e7", |
||||
|
// "isNameIntoSummary": "Y", |
||||
|
// "isResultIntoSummary": "Y", |
||||
|
// "resultStatusId": "08", |
||||
|
// "simpleCode": null |
||||
|
// } |
||||
|
// ], |
||||
|
this.restaurants = row.itemResultTemplates |
||||
}, |
}, |
||||
|
|
||||
methods: { |
|
||||
tableRowClassName({row, rowIndex}) { |
|
||||
if (row.completeFlag === '0') { |
|
||||
return 'warning-row'; //未检 |
|
||||
} else if (row.completeFlag === '2') { |
|
||||
return 'refuse-row'; //弃检 |
|
||||
} |
|
||||
return ''; |
|
||||
}, |
|
||||
|
|
||||
//选择组合项目 |
|
||||
rowClick(row){ |
|
||||
//registerCheckId |
|
||||
getapi(`/api/app/customer-org-group/in-customer-org-id/${customerOrgld}`) |
|
||||
|
//检查组合项目下所包含的明细项目 |
||||
|
checkItemList(RegisterCheckId) { |
||||
|
console.log(`/api/app/registercheckitem/getlistinregistercheckid?RegisterCheckId=${RegisterCheckId}`) |
||||
|
getapi(`/api/app/registercheckitem/getlistinregistercheckid?RegisterCheckId=${RegisterCheckId}`) |
||||
.then((res) => { |
.then((res) => { |
||||
console.log("getCustomerOrgGroup", res.data); |
|
||||
if (res.code == 1) { |
|
||||
this.doctorCheck.checkItemList = res.data; |
|
||||
} |
|
||||
|
console.log("checkItemList", res.data); |
||||
|
if (res.code == 1) { |
||||
|
this.doctorCheck.checkItemList = res.data; |
||||
|
} |
||||
}) |
}) |
||||
.catch((err) => { |
.catch((err) => { |
||||
this.$message({type: "error",message: `操作失败,原因:${err}`}); |
|
||||
|
this.$message({ type: "error", message: `操作失败,原因:${err}` }); |
||||
}); |
}); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
querySearch(queryString, cb) { |
||||
|
|
||||
|
|
||||
|
var restaurants = [...this.restaurants] //[{ value: '阴性' },{ value: '阳性' }] |
||||
|
restaurants.forEach((item) =>{ |
||||
|
return item.value = item.result |
||||
|
}) |
||||
|
console.log('restaurants',restaurants) |
||||
|
|
||||
|
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants; |
||||
|
// 调用 callback 返回建议列表的数据 |
||||
|
cb(results); |
||||
|
}, |
||||
|
createFilter(queryString) { |
||||
|
return (restaurant) => { |
||||
|
return (restaurant['value'].toLowerCase().indexOf(queryString.toLowerCase()) === 0); |
||||
|
}; |
||||
|
}, |
||||
|
handleSelect(item) { |
||||
|
console.log(item); |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
}, |
|
||||
|
//监听事件 |
||||
|
watch: { |
||||
|
//检查项目切换 |
||||
|
"doctorCheck.RegisterCheckId"(newVal, oldVal) { |
||||
|
console.log("watch doctorCheck.RegisterCheckId newVal:", newVal, " oldVal:", oldVal); |
||||
|
if (newVal != oldVal && newVal != '') { |
||||
|
this.checkItemList(newVal) |
||||
|
} |
||||
}, |
}, |
||||
}; |
|
||||
|
}, |
||||
|
|
||||
|
}; |
||||
</script> |
</script> |
||||
<style scoped> |
<style scoped> |
||||
.el-table .warning-row { |
|
||||
background: rgb(240, 125, 125); |
|
||||
} |
|
||||
|
|
||||
.el-table .refuse-row { |
|
||||
background: rgb(192, 192, 192); |
|
||||
} |
|
||||
|
.el-table .warning-row { |
||||
|
background: rgb(240, 125, 125); |
||||
|
} |
||||
|
|
||||
|
.el-table .refuse-row { |
||||
|
background: rgb(192, 192, 192); |
||||
|
} |
||||
</style> |
</style> |
||||
|
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue