|
|
@@ -16,6 +16,22 @@
|
|
|
<el-option label="其他" value="其他" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="身体部位">
|
|
|
+ <el-select v-model="queryForm.bodyPart" placeholder="全部" clearable filterable style="width:140px">
|
|
|
+ <el-option
|
|
|
+ v-for="item in bodyPartOptions"
|
|
|
+ :key="item"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="产品穴位">
|
|
|
+ <el-select v-model="queryForm.productAcupoint" placeholder="全部" clearable style="width:120px">
|
|
|
+ <el-option label="是" :value="1" />
|
|
|
+ <el-option label="否" :value="0" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="状态">
|
|
|
<el-select v-model="queryForm.status" placeholder="全部" clearable style="width:110px">
|
|
|
<el-option label="活跃" :value="1" />
|
|
|
@@ -314,6 +330,7 @@ import { parsePageData } from '@/utils/pagination'
|
|
|
import {
|
|
|
getAcupointPage,
|
|
|
exportAcupoint,
|
|
|
+ getBodyPartOptions,
|
|
|
addAcupoint,
|
|
|
updateAcupoint,
|
|
|
deleteAcupoint,
|
|
|
@@ -325,6 +342,8 @@ import {
|
|
|
const queryForm = reactive({
|
|
|
name: '',
|
|
|
meridian: '',
|
|
|
+ bodyPart: '',
|
|
|
+ productAcupoint: null,
|
|
|
status: null,
|
|
|
parseStatus: '',
|
|
|
pageNum: 1,
|
|
|
@@ -335,6 +354,7 @@ const tableData = ref([])
|
|
|
const total = ref(0)
|
|
|
const loading = ref(false)
|
|
|
const selectedIds = ref([])
|
|
|
+const bodyPartOptions = ref([])
|
|
|
|
|
|
// 弹窗
|
|
|
const dialogVisible = ref(false)
|
|
|
@@ -410,13 +430,29 @@ const exportHeaders = [
|
|
|
{ label: '状态', prop: 'statusLabel' }
|
|
|
]
|
|
|
|
|
|
+function buildQueryParams(includePage = true) {
|
|
|
+ const params = {
|
|
|
+ name: queryForm.name,
|
|
|
+ meridian: queryForm.meridian,
|
|
|
+ bodyPart: queryForm.bodyPart,
|
|
|
+ productAcupoint: queryForm.productAcupoint,
|
|
|
+ status: queryForm.status,
|
|
|
+ parseStatus: queryForm.parseStatus
|
|
|
+ }
|
|
|
+ if (includePage) {
|
|
|
+ params.pageNum = queryForm.pageNum
|
|
|
+ params.pageSize = queryForm.pageSize
|
|
|
+ }
|
|
|
+ return params
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 加载穴位列表
|
|
|
*/
|
|
|
async function loadData() {
|
|
|
loading.value = true
|
|
|
try {
|
|
|
- const res = await getAcupointPage(queryForm)
|
|
|
+ const res = await getAcupointPage(buildQueryParams())
|
|
|
const { records, total: pageTotal } = parsePageData(res.data)
|
|
|
// 添加辅助显示字段
|
|
|
tableData.value = records.map(formatAcupointRow)
|
|
|
@@ -426,6 +462,15 @@ async function loadData() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+async function loadBodyPartOptions() {
|
|
|
+ try {
|
|
|
+ const res = await getBodyPartOptions()
|
|
|
+ bodyPartOptions.value = res.data || []
|
|
|
+ } catch {
|
|
|
+ bodyPartOptions.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
function formatAcupointRow(item) {
|
|
|
return {
|
|
|
...item,
|
|
|
@@ -442,13 +487,7 @@ function formatAcupointRow(item) {
|
|
|
* 获取导出数据(全量,传入当前筛选条件)
|
|
|
*/
|
|
|
async function fetchExportData() {
|
|
|
- const params = {
|
|
|
- name: queryForm.name,
|
|
|
- meridian: queryForm.meridian,
|
|
|
- status: queryForm.status,
|
|
|
- parseStatus: queryForm.parseStatus
|
|
|
- }
|
|
|
- const res = await exportAcupoint(params)
|
|
|
+ const res = await exportAcupoint(buildQueryParams(false))
|
|
|
const list = res.data || []
|
|
|
return list.map(formatAcupointRow)
|
|
|
}
|
|
|
@@ -503,6 +542,8 @@ function handleSearch() {
|
|
|
function handleReset() {
|
|
|
queryForm.name = ''
|
|
|
queryForm.meridian = ''
|
|
|
+ queryForm.bodyPart = ''
|
|
|
+ queryForm.productAcupoint = null
|
|
|
queryForm.status = null
|
|
|
queryForm.parseStatus = ''
|
|
|
queryForm.pageNum = 1
|
|
|
@@ -649,6 +690,7 @@ async function handleImport(data) {
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
+ loadBodyPartOptions()
|
|
|
loadData()
|
|
|
})
|
|
|
</script>
|