overviewUserPatietDetails.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <div >
  3. <el-row :gutter="10" class="mb8" style="float: right; top: -30px;">
  4. </el-row>
  5. <el-table v-loading="loading" border :data="patientList" @selection-change="handleSelectionChange" style="top: -30px;">
  6. <el-table-column label="患者姓名" align="center" prop="patientName" />
  7. <el-table-column label="所属会员" align="center" width="150px">
  8. <template slot-scope="scope">
  9. <div v-if="scope.row.nickName!=null"> {{scope.row.nickName}}-{{scope.row.phone}}</div>
  10. </template>
  11. </el-table-column>
  12. <el-table-column label="身份证号" align="center" prop="idCard" width="170px"/>
  13. <el-table-column label="出生年月" align="center" prop="birthday" width="180">
  14. <template slot-scope="scope">
  15. <span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') }}</span>
  16. </template>
  17. </el-table-column>
  18. <el-table-column label="性别" align="center" prop="sex" >
  19. <template slot-scope="scope">
  20. <dict-tag :options="sexOptions" :value="scope.row.sex"/>
  21. </template>
  22. </el-table-column>
  23. <el-table-column label="体重G" align="center" prop="weight" />
  24. <el-table-column label="手机号" align="center" prop="mobile" />
  25. <el-table-column label="状态" align="center" prop="status" >
  26. <template slot-scope="scope">
  27. <dict-tag :options="pOptions" :value="scope.row.status"/>
  28. </template>
  29. </el-table-column>
  30. <el-table-column label="与本人关系" align="center" prop="relation" />
  31. <el-table-column label="肝功能是否异常" align="center" prop="liverUnusual" />
  32. <el-table-column label="肾功能是否异常" align="center" prop="renalUnusual" />
  33. <el-table-column label="过敏史" align="center" prop="historyAllergic" />
  34. <el-table-column label="家族病史" align="center" prop="familyMedHistory" />
  35. <el-table-column label="个人病史" align="center" prop="selfMedHistory" />
  36. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150px">
  37. <template slot-scope="scope">
  38. <el-button
  39. size="mini"
  40. type="text"
  41. icon="el-icon-edit"
  42. @click="handleUpdate(scope.row)"
  43. v-hasPermi="['his:patient:edit']"
  44. >修改</el-button>
  45. <el-button
  46. size="mini"
  47. type="text"
  48. icon="el-icon-delete"
  49. @click="handleDelete(scope.row)"
  50. v-hasPermi="['his:patient:remove']"
  51. >删除</el-button>
  52. </template>
  53. </el-table-column>
  54. </el-table>
  55. <pagination
  56. v-show="total>0"
  57. :total="total"
  58. :page.sync="queryParams.pageNum"
  59. :limit.sync="queryParams.pageSize"
  60. @pagination="getList"
  61. />
  62. <!-- 添加或修改病人对话框 -->
  63. <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
  64. <el-form ref="form" :model="form" :rules="rules" label-width="125px">
  65. <el-form-item label="患者姓名" prop="patientName">
  66. <el-input v-model="form.patientName" placeholder="请输入患者姓名" />
  67. </el-form-item>
  68. <el-form-item label="身份证号" prop="idCard">
  69. <el-input v-model="form.idCard" placeholder="请输入身份证号" @blur="parseBirthdayFromIdCard(form.idCard)" />
  70. </el-form-item>
  71. <el-form-item label="出生年月" prop="birthday">
  72. <el-date-picker clearable size="small"
  73. v-model="form.birthday"
  74. type="date"
  75. value-format="yyyy-MM-dd"
  76. placeholder="选择出生年月">
  77. </el-date-picker>
  78. </el-form-item>
  79. <el-form-item label="性别" prop="sex">
  80. <el-select v-model="form.sex" placeholder="性别" clearable size="small">
  81. <el-option
  82. v-for="dict in sexOptions"
  83. :key="dict.dictValue"
  84. :label="dict.dictLabel"
  85. :value="dict.dictValue"
  86. />
  87. </el-select>
  88. </el-form-item>
  89. <el-form-item label="体重KG" prop="weight">
  90. <el-input v-model="form.weight" placeholder="请输入体重KG" />
  91. </el-form-item>
  92. <el-form-item label="手机号" prop="mobile">
  93. <el-input v-model="form.mobile" placeholder="请输入手机号" />
  94. </el-form-item>
  95. <el-form-item label="状态" prop="status">
  96. <el-select v-model="form.status" placeholder="状态" clearable size="small">
  97. <el-option
  98. v-for="dict in pOptions"
  99. :key="dict.dictValue"
  100. :label="dict.dictLabel"
  101. :value="dict.dictValue"
  102. />
  103. </el-select>
  104. </el-form-item>
  105. <el-form-item label="是否默认" prop="isDefault">
  106. <el-radio-group v-model="form.isDefault">
  107. <el-radio :label="item.dictValue" v-for="item in orOptions" >{{item.dictLabel}}</el-radio>
  108. </el-radio-group>
  109. </el-form-item>
  110. <el-form-item label="与本人关系" prop="relation">
  111. <el-select v-model="form.relation">
  112. <el-option v-for="(option, index) in relationOptions" :key="index" :value="option" clearable></el-option>
  113. </el-select>
  114. </el-form-item>
  115. <el-form-item label="肝功能是否异常" prop="liverUnusual">
  116. <el-radio-group v-model="form.liverUnusual">
  117. <el-radio :label="item" v-for="item in isGoodOptions" >{{item}}</el-radio>
  118. </el-radio-group>
  119. </el-form-item>
  120. <el-form-item label="肾功能是否异常" prop="renalUnusual">
  121. <el-radio-group v-model="form.renalUnusual" >
  122. <el-radio :label="item" v-for="item in isGoodOptions" >{{item}}</el-radio>
  123. </el-radio-group>
  124. </el-form-item>
  125. <el-form-item label="过敏史" prop="historyAllergic">
  126. <el-radio-group v-model="form.historyAllergic">
  127. <el-radio :label="item" v-for="item in isOptions" >{{item}}</el-radio>
  128. </el-radio-group>
  129. <el-checkbox-group v-model="historyAllergic" size="medium" v-if="form.historyAllergic=='有'">
  130. <el-checkbox v-for="item in historyAllergicOptions" :key="item" :label="item"
  131. >{{item}}</el-checkbox>
  132. </el-checkbox-group>
  133. </el-form-item>
  134. <el-form-item label="家族病史" prop="familyMedHistory">
  135. <el-radio-group v-model="form.familyMedHistory">
  136. <el-radio :label="item" v-for="item in isOptions" >{{item}}</el-radio>
  137. </el-radio-group>
  138. <el-checkbox-group v-model="familyMedHistory" size="medium" v-if="form.familyMedHistory=='有'">
  139. <el-checkbox v-for="item in historyOptions" :key="item" :label="item"
  140. >{{item}}</el-checkbox>
  141. </el-checkbox-group>
  142. </el-form-item>
  143. <el-form-item label="个人病史" prop="selfMedHistory" >
  144. <el-radio-group v-model="form.selfMedHistory">
  145. <el-radio :label="item" v-for="item in isOptions" >{{item}}</el-radio>
  146. </el-radio-group>
  147. <el-checkbox-group v-model="selfMedHistory" size="medium" v-if="form.selfMedHistory=='有'">
  148. <el-checkbox v-for="item in historyOptions" :key="item" :label="item"
  149. >{{item}}</el-checkbox>
  150. </el-checkbox-group>
  151. </el-form-item>
  152. </el-form>
  153. <div slot="footer" class="dialog-footer">
  154. <el-button type="primary" @click="">确 定</el-button>
  155. <el-button @click="cancel">取 消</el-button>
  156. </div>
  157. </el-dialog>
  158. </div>
  159. </template>
  160. <script>
  161. import { listPatient} from "@/api/store/patient";
  162. export default {
  163. name: "overviewUserPatietDetails",
  164. data() {
  165. return {
  166. addPatientInfo: process.env.VUE_APP_ADD_PATIENT,
  167. orOptions:[],
  168. show:{
  169. title:"患者详情",
  170. open:false,
  171. },
  172. // 遮罩层
  173. userList:[],
  174. userName: {name:null},
  175. sexOptions: [],
  176. pOptions: [],
  177. loading: true,
  178. // 导出遮罩层
  179. exportLoading: false,
  180. // 选中数组
  181. ids: [],
  182. // 非单个禁用
  183. single: true,
  184. // 非多个禁用
  185. multiple: true,
  186. // 显示搜索条件
  187. showSearch: true,
  188. historyAllergic:[],
  189. familyMedHistory:[],
  190. selfMedHistory:[],
  191. historyAllergicOptions:['阿司匹林', '磺胺类', '头孢类', '青霉素类', '奶制品', '其他'],
  192. historyOptions:['糖尿病', '哮喘', '恶性肿瘤', '高血压', '其他'],
  193. isOptions:['有', '无'],
  194. isGoodOptions:['正常', '异常'],
  195. relationOptions: ['本人', '配偶', '父母', '子女', '朋友', '亲戚', '其他'],
  196. // 总条数
  197. total: 0,
  198. // 病人表格数据
  199. patientList: [],
  200. // 弹出层标题
  201. title: "",
  202. // 是否显示弹出层
  203. open: false,
  204. // 查询参数
  205. queryParams: {
  206. pageNum: 1,
  207. pageSize: 10,
  208. patientName: null,
  209. nickName:null,
  210. userId: null,
  211. idCard: null,
  212. birthday: null,
  213. sex: null,
  214. weight: null,
  215. mobile: null,
  216. isDel: null,
  217. status: null,
  218. },
  219. // 表单参数
  220. form: {},
  221. // 表单校验
  222. rules: {
  223. patientName: [
  224. { required: true, message: "名称不能为空", trigger: "blur" }
  225. ],
  226. // idCard: [
  227. // { required: true, message: "身份证号不能为空", trigger: "blur" }
  228. // ],
  229. sex: [
  230. { required: true, message: "性别不能为空", trigger: "blur" }
  231. ],
  232. birthday: [
  233. { required: true, message: "生日不能为空", trigger: "blur" }
  234. ],
  235. status: [
  236. { required: true, message: "状态不能为空", trigger: "blur" }
  237. ],
  238. // mobile: [
  239. // { required: true, message: "手机号不能为空", trigger: "blur" },
  240. // ],
  241. relation: [
  242. { required: true, message: '请选择与本人关系', trigger: 'change' }
  243. ],
  244. liverUnusual: [
  245. { required: true, message: '请选择肝功能是否异常', trigger: 'change' }
  246. ],
  247. renalUnusual: [
  248. { required: true, message: '请选择肾功能是否异常', trigger: 'change' }
  249. ],
  250. historyAllergic: [
  251. { required: true, message: '请选择过敏史', trigger: 'change' }
  252. ],
  253. familyMedHistory: [
  254. { required: true, message: '请选择家族病史', trigger: 'change' }
  255. ],
  256. selfMedHistory: [
  257. { required: true, message: '请选择个人病史', trigger: 'change' }
  258. ]
  259. }
  260. };
  261. },
  262. created() {
  263. this.getDicts("sys_company_or").then(response => {
  264. this.orOptions = response.data;
  265. });
  266. this.getDicts("sys_patient_status").then(response => {
  267. this.pOptions = response.data;
  268. });
  269. this.getDicts("sys_patient_sex").then(response => {
  270. this.sexOptions = response.data;
  271. });
  272. },
  273. methods: {
  274. /** 查询病人列表 */
  275. getList() {
  276. this.loading = true;
  277. listPatient(this.queryParams).then(response => {
  278. this.patientList = response.rows;
  279. this.total = response.total;
  280. this.loading = false;
  281. });
  282. },
  283. getPatList(id){
  284. this.loading = true;
  285. this.queryParams.userId=id;
  286. listPatient(this.queryParams).then(response => {
  287. this.patientList = response.rows;
  288. this.total = response.total;
  289. this.loading = false;
  290. });
  291. },
  292. // 取消按钮
  293. cancel() {
  294. this.open = false;
  295. this.reset();
  296. },
  297. // 表单重置
  298. reset() {
  299. this.form = {
  300. patientId: null,
  301. patientName: null,
  302. userId: null,
  303. idCard: null,
  304. birthday: null,
  305. nickName:null,
  306. sex: null,
  307. weight: null,
  308. mobile: null,
  309. isDel: null,
  310. status: null,
  311. createTime: null,
  312. updateTime: null
  313. };
  314. this.resetForm("form");
  315. },
  316. /** 搜索按钮操作 */
  317. handleQuery() {
  318. this.queryParams.pageNum = 1;
  319. this.getList();
  320. },
  321. /** 重置按钮操作 */
  322. resetQuery() {
  323. this.resetForm("queryForm");
  324. this.handleQuery();
  325. },
  326. // 多选框选中数据
  327. handleSelectionChange(selection) {
  328. this.ids = selection.map(item => item.patientId)
  329. this.single = selection.length!==1
  330. this.multiple = !selection.length
  331. },
  332. }
  333. };
  334. </script>