| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
- <el-form-item label="患者名称" prop="name">
- <el-input v-model="queryParams.name" placeholder="请输入患者名称" clearable size="small"
- @keyup.enter.native="handleQuery" />
- </el-form-item>
- <el-form-item label="手机号" prop="mobile">
- <el-input v-model="queryParams.mobile" placeholder="请输入手机号" clearable size="small"
- @keyup.enter.native="handleQuery" />
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <!--
- <el-row :gutter="10" class="mb8">
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row> -->
- <el-table v-loading="loading" :data="listData" row-key="id">
- <el-table-column prop="name" label="患者名称" :show-overflow-tooltip="true"></el-table-column>
- <el-table-column prop="age" label="年龄"></el-table-column>
- <el-table-column prop="education" label="学历">
- <template slot-scope="scope">
- <dict-tag :options="dict.type.education_type" :value="scope.row.education" />
- </template>
- </el-table-column>
- <el-table-column prop="mobile" label="手机号"></el-table-column>
- <el-table-column prop="doctorName" label="负责医生"></el-table-column>
- <el-table-column prop="testFlag" label="测评状态">
- <template slot-scope="scope">
- <span v-if="scope.row.testFlag=='0'">否</span>
- <span v-if="scope.row.testFlag=='1'">是</span>
- <span v-if="scope.row.testFlag=='2'">测评中</span>
- </template>
- </el-table-column>
- <el-table-column prop="packageName" label="套餐名称"></el-table-column>
-
- <!-- <el-table-column prop="gameDifficulty" label="游戏难度">
- <template slot-scope="scope">
- <dict-tag :options="dict.type.game_difficulty" :value="scope.row.gameDifficulty" />
- </template>
- </el-table-column> -->
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <!-- <el-button size="mini" type="text" @click="handelCePing(scope.row)">专业测评</el-button> -->
- <el-button size="mini" type="text" @click="handelLook(scope.row)">查看</el-button>
- <el-button size="mini" type="text" @click="handelEdit(scope.row)">修改</el-button>
- <el-button size="mini" type="text" style="color: red;" @click="handelDel(scope.row.id)">删除</el-button>
- <el-button size="mini" type="text" @click="handelCePingInfo(scope.row)">测评报告</el-button>
- <el-button size="mini" type="text" @click="handelTrain(scope.row)">训练数据</el-button>
- <el-button size="mini" type="text" @click="resetPassWord(scope.row)">重置密码</el-button>
- <!-- <router-link :to="'/train/list/index/' + scope.row.id" style="color: #1890ff; font-size: 12px;margin: 0 10px;">训练数据</router-link> -->
- </template>
- </el-table-column>
- </el-table>
- <lookDetail ref="look" />
- <trainDetatil ref="train" />
- <cePingInfo ref="cepingInfo" @refresh="handleQuery" />
- <!-- 分页 -->
- <pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :page-sizes="[10, 20, 30,50,100]" :limit.sync="queryParams.limit" />
- <el-dialog title="重置患者密码" :visible="resetShow" width="700px" append-to-body destroy-on-close>
- <el-form ref="resetForm" :model="resetForm" :rules="rulesPass" label-width="110px">
- <el-form-item label="新密码" prop="newPwd">
- <el-input v-model="resetForm.newPwd" placeholder="请输入新密码" type="password" show-password />
- </el-form-item>
- <el-form-item>
- <el-button type="primary" size="mini" @click="submit">修改</el-button>
- <el-button type="danger" size="mini" @click="resetShow = false">关闭</el-button>
- </el-form-item>
- </el-form>
- </el-dialog>
- </div>
- </template>
- <script>
- import { listData, delpatient, patientDetail, learnSelectAll, queryMonthRecord, reviewTaskSave,resetPasswordSys } from '@/api/patient/index'
- import { debounce } from 'lodash-es'
- import lookDetail from './lookDetail.vue';
- import trainDetatil from './trainDetatil.vue';
- import cePingInfo from './cePingInfo.vue';
- import {symmetryEncrypt} from '@/utils/secret'
- export default {
- name: "patient_list",
- dicts: ['education_type'],
- components: { lookDetail, trainDetatil, cePingInfo },
- data() {
- return {
- // 遮罩层
- loading: true,
- // 显示搜索条件
- showSearch: true,
- // 表格树数据
- listData: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- // 总条数
- total: 0,
- // 查询参数
- queryParams: {
- page: 1,
- limit: 10,
- status: 0
- },
- resetShow: false,
- resetForm:{
- id: "",
- pwd: "",
- newPwd: ""
- },
- rulesPass: {
- newPwd: [
- { required: true, message: "新密码不能为空", trigger: "blur" },
- {
- pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,11}$/,
- message:
- "密码长度必须8-11位数且包含大小写字母,数字",
- trigger: "blur"
- }
- ]
- }
- };
- },
- created() {
- this.getList();
- },
- watch: {
- 'queryParams.page': {
- handler(newVal, oldVal) {
- if (newVal != oldVal) {
- this.getList()
- }
- },
- deep: true,
- immediate: true
- },
- 'queryParams.limit': {
- handler(newVal, oldVal) {
- if (newVal != oldVal) {
- this.getList()
- }
- },
- deep: true,
- immediate: true
- }
-
- },
- methods: {
- submit() {
- this.$refs["resetForm"].validate(valid => {
- if(valid) {
- this.resetForm.pwd = symmetryEncrypt(this.resetForm.newPwd)
- this.resetForm.newPwd = ""
- resetPasswordSys(this.resetForm).then(resp => {
- if(resp.data == true) {
- this.$modal.msgSuccess("修改成功");
- this.resetShow = false
- }
- })
- }
- })
- },
- resetPassWord(row) {
- this.resetShow = true
- this.resetForm = {
- id: row.id,
- newPwd: ""
- }
- },
- /** 查询机构列表 */
- getList() {
- this.loading = true;
- listData(this.queryParams).then(response => {
- this.listData = response.data.records
- this.total = response.data.total;
- this.loading = false;
- });
- },
- // 表单重置
- reset() {
- this.form = {
- };
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- /** 删除按钮 */
- handelDel(id) {
- this.$confirm('此操作将永久删除, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- delpatient(id).then(res => {
- this.$modal.msgSuccess(`删除成功`);
- this.getList()
- })
- }).catch(() => {
- });
- },
- // 修改
- handelEdit(row) {
- let item = JSON.stringify(row)
- this.$router.push({ name: 'add', params: { item, isEdit: '1',next:'1'} });
- // this.$router.push({ path: '/patient/add', params: { item } });
- },
- // 专业测评
- handelCePing: debounce(function (row) {
- let that = this
- reviewTaskSave({ userId: row.id }).then(res => {
- that.$modal.msgSuccess('测评推送成功')
- that.handleQuery()
- })
- }, 500),
- // 查看
- handelLook(row) {
- let item = JSON.parse(JSON.stringify(row))
- patientDetail(row.id).then(res => {
- res.data.medicalCurrentTypes = res.data.medicalCurrentTypes.split ? res.data.medicalCurrentTypes.split(',') : undefined
- res.data.medicalHisTypes = res.data.medicalHisTypes ? res.data.medicalHisTypes.split(',') : undefined
- res.data.geneticDiseases = res.data.geneticDiseases ? res.data.geneticDiseases.split(',') : undefined
- res.data.tags = res.data.tags ? res.data.tags.split(',') : undefined
- res.data.diagnoseResult = res.data.diagnoseResult ? res.data.diagnoseResult.split(',') : undefined
- learnSelectAll().then(res1 => {
- res1.data.map((item) => {
- if (item.id == res.data.packageId) {
- res.data.packageName = item.packageName
- }
- })
- this.$refs.look.open(res.data)
- })
- })
- },
- handelTrain(item) {
- let date = new Date();
- let year = date.getFullYear();
- let month = date.getMonth() + 1;
- let day = date.getDate();
- month = (month > 9) ? month : ('0' + month);
- day = (day < 10) ? ('0' + day) : day;
- let today = year + '-' + month + '-' + day;
- const oktrain = []
- const notrain = []
- queryMonthRecord({ time: year + '-' + month, id: item.id }).then(res => {
- // for (const key in res.data[0]) {
- // if(res.data[0][key]=='1'){
- // oktrain.push(key)
- // }else if( res.data[0][key]== '2'){
- // notrain.push(key)
- // }
- // }
- res.data.map((item) => {
- if (item.status == '1') {
- oktrain.push(item.time)
- } else if (item.status == '2') {
- notrain.push(item.time)
- }
- })
- this.$refs.train.open({ oktrain, notrain, id: item.id, today })
- })
- },
- // 测评报告
- handelCePingInfo(row) {
- let item = JSON.parse(JSON.stringify(row))
- this.$refs.cepingInfo.open(item)
- }
- }
- };
- </script>
|