医院简介、号源占用、问卷调查后台获取列表
parent
1c121fac92
commit
0b18348f7f
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\API\Admin\YeWu;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class QuestionController extends Controller
|
||||
{
|
||||
public function GetList()
|
||||
{
|
||||
$searchInfo = request('searchInfo');
|
||||
if (!isset($searchInfo['hospital_id'])) return \Yz::echoError1("医院id不能为空");
|
||||
if (!isset($searchInfo['q_type'])) return \Yz::echoError1("问卷类型不能为空");
|
||||
$list = DB::table('questions')
|
||||
->where(['hospital_id'=>$searchInfo['hospital_id'],
|
||||
'q_type'=>$searchInfo['q_type']
|
||||
])->orderBy('order','asc')->get();
|
||||
return \Yz::Return(true,"查询成功",['list'=>$list]);
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="head">
|
||||
<el-row>
|
||||
<el-form-item>
|
||||
当前医院
|
||||
<el-select style="margin-left: 8px;" filterable v-model="searchInfo.hospital_id"
|
||||
placeholder="所有医嘱大类">
|
||||
<el-option v-for="(item, index) in hospital_list" :key="index" :label="item.name"
|
||||
:value="item.id" />
|
||||
</el-select>
|
||||
<el-button type="primary" style="margin-left: 10px;" @click="ChangeHospital()">切换</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item>
|
||||
问卷类型
|
||||
<el-radio-group style="margin-left: 8px;" v-model="searchInfo.q_type"
|
||||
@change="QuestionTypeChange()">
|
||||
<el-radio-button :label="2">满意度调查</el-radio-button>
|
||||
<el-radio-button :label="1">健康问卷</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-table :data="tableData" style="width: 100%;" row-key="id" v-loading="loading">
|
||||
<el-table-column prop="question" label="题目" />
|
||||
<el-table-column prop="type" label="类型">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.type==1" class="ml-2" type="success">填空</el-tag>
|
||||
<el-tag v-if="scope.row.type==2" class="ml-2">单选</el-tag>
|
||||
<el-tag v-if="scope.row.type==3" class="ml-2" type="warning">多选</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="状态">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.status==1" class="ml-2" type="success">正常</el-tag>
|
||||
<el-tag v-if="scope.row.status==0" class="ml-2" type="danger">关闭</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="" label="必填">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.must==1" class="ml-2" type="success">是</el-tag>
|
||||
<el-tag v-else class="ml-2">否</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="created_at" label="创建时间" />
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" @click="Add(scope.row)" :icon="Edit" circle />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
onMounted
|
||||
} from 'vue'
|
||||
import {
|
||||
ElMessage
|
||||
} from 'element-plus'
|
||||
import {
|
||||
HospitalGetEnableList,
|
||||
QuestionGetList
|
||||
} from '@/api/api.js'
|
||||
import {
|
||||
Edit
|
||||
} from '@element-plus/icons-vue'
|
||||
let loading = ref(false)
|
||||
let tableData = ref([])
|
||||
let currentPage = ref(1) //当前页码
|
||||
let pageSize = ref(15) //每页数量
|
||||
let total = 0 //总数量
|
||||
let dialogVisible = ref(false)
|
||||
let searchInfo = ref({});
|
||||
const PageSizeChange = (e) => { // 修改每页数量
|
||||
pageSize.value = e
|
||||
GetList()
|
||||
}
|
||||
const PageCurrentChange = (e) => { //切换页码
|
||||
currentPage.value = e
|
||||
GetList()
|
||||
}
|
||||
const ChangeHospital = () => {
|
||||
GetList()
|
||||
}
|
||||
const QuestionTypeChange = () => {
|
||||
GetList()
|
||||
}
|
||||
let hospital_list = ref([]);
|
||||
const GetEnableHospitalList_func = () => {
|
||||
loading.value = true
|
||||
HospitalGetEnableList().then(res => {
|
||||
loading.value = false
|
||||
if (res.status) {
|
||||
hospital_list.value = res.data.list
|
||||
searchInfo.value.hospital_id = res.data.list[0].id
|
||||
GetList()
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
const GetList = () => {
|
||||
loading.value = true
|
||||
QuestionGetList({
|
||||
searchInfo: searchInfo.value
|
||||
}).then(res => {
|
||||
loading.value = false
|
||||
if (res.status) {
|
||||
tableData.value = res.data.list
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
searchInfo.value.q_type =2
|
||||
GetEnableHospitalList_func()
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
Loading…
Reference in New Issue