You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

846 lines
29 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div>
  3. <table>
  4. <td style="width: 60%">
  5. <div style="display: flex">
  6. <el-form
  7. ref="form"
  8. :model="form"
  9. label-width="80px"
  10. :rules="rules"
  11. size="medium"
  12. >
  13. <el-row>
  14. <el-col :span="6">
  15. <el-form-item label="单位名称" prop="customerOrgId">
  16. <el-cascader
  17. v-model="form.customerOrgId"
  18. :options="patientRegister.customerOrgTreeAll"
  19. :props="{
  20. checkStrictly: true,
  21. expandTrigger: 'hover',
  22. ...customerOrg.treeprops,
  23. }"
  24. :show-all-levels="false"
  25. disabled
  26. >
  27. </el-cascader>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="6">
  31. <el-form-item label="条码号" prop="patientRegisterNo">
  32. <el-input
  33. v-model="form.patientRegisterNo"
  34. disabled
  35. ></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :span="6">
  39. <el-form-item label="档案号" prop="patientNo">
  40. <el-input v-model="form.patientNo" disabled></el-input>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :span="6" />
  44. </el-row>
  45. <el-row>
  46. <el-col :span="6">
  47. <el-form-item label="姓名" prop="patientName">
  48. <el-input
  49. v-model="form.patientName"
  50. @blur="query(form.patientName)"
  51. ></el-input>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="6">
  55. <el-form-item label="性别" prop="sexId">
  56. <el-select v-model="form.sexId" placeholder="请选择">
  57. <el-option
  58. v-for="item in dict.sex"
  59. :key="item.id"
  60. :label="item.displayName"
  61. :value="item.id"
  62. >
  63. </el-option>
  64. </el-select>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :span="6">
  68. <el-form-item label="体检次数" prop="medicalTimes">
  69. <el-input v-model="form.medicalTimes" disabled></el-input>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="6" />
  73. </el-row>
  74. <el-row>
  75. <el-col :span="6">
  76. <el-form-item label="年龄" prop="age">
  77. <el-input v-model="form.age"></el-input>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="6">
  81. <el-form-item label="出生日期" prop="birthDate">
  82. <el-date-picker
  83. v-model="form.birthDate"
  84. type="date"
  85. placeholder="出生日期"
  86. style="width: 135px"
  87. />
  88. </el-form-item>
  89. </el-col>
  90. <el-col :span="6">
  91. <el-form-item label="婚姻状况" prop="maritalStatusId">
  92. <el-select
  93. v-model="form.maritalStatusId"
  94. placeholder="请选择"
  95. >
  96. <el-option
  97. v-for="item in dict.maritalStatus"
  98. :key="item.id"
  99. :label="item.displayName"
  100. :value="item.id"
  101. >
  102. </el-option>
  103. </el-select>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="6" />
  107. </el-row>
  108. <el-row>
  109. <el-col :span="6">
  110. <el-form-item label="体检类别" prop="medicalTypeId">
  111. <el-select
  112. v-model="form.medicalTypeId"
  113. placeholder="请选择"
  114. filterable
  115. >
  116. <el-option
  117. v-for="item in dict.medicalType"
  118. :key="item.id"
  119. :label="item.displayName"
  120. :value="item.id"
  121. />
  122. </el-select>
  123. </el-form-item>
  124. </el-col>
  125. <el-col :span="6">
  126. <el-form-item label="人员类别" prop="personnelTypeId">
  127. <el-select
  128. v-model="form.personnelTypeId"
  129. placeholder="请选择"
  130. filterable
  131. >
  132. <el-option
  133. v-for="item in dict.personnelType"
  134. :key="item.id"
  135. :label="item.displayName"
  136. :value="item.id"
  137. />
  138. </el-select>
  139. </el-form-item>
  140. </el-col>
  141. <el-col :span="6">
  142. <el-form-item label="工卡号" prop="jobCardNo">
  143. <el-input v-model="form.jobCardNo"></el-input>
  144. </el-form-item>
  145. </el-col>
  146. <el-col :span="6">
  147. <el-form-item label="体检卡号" prop="medicalCardNo">
  148. <el-input v-model="form.medicalCardNo"></el-input>
  149. </el-form-item>
  150. </el-col>
  151. <el-col :span="6">
  152. <el-form-item label="职务" prop="jobPost">
  153. <el-input v-model="form.jobPost"></el-input>
  154. </el-form-item>
  155. </el-col>
  156. <el-col :span="6">
  157. <el-form-item label="职称" prop="jobTitle">
  158. <el-input v-model="form.jobTitle"></el-input>
  159. </el-form-item>
  160. </el-col>
  161. <el-col :span="6">
  162. <el-form-item label="邮箱" prop="email">
  163. <el-input v-model="form.email"></el-input>
  164. </el-form-item>
  165. </el-col>
  166. <el-col :span="6">
  167. <el-form-item label="身份证号" prop="idNo">
  168. <el-input
  169. v-model="form.idNo"
  170. @blur="query(form.idNo)"
  171. ></el-input>
  172. </el-form-item>
  173. </el-col>
  174. <el-col :span="6">
  175. <el-form-item label="地址" prop="address">
  176. <el-input v-model="form.address"></el-input>
  177. </el-form-item>
  178. </el-col>
  179. <el-col :span="6">
  180. <el-form-item label="邮政编码" prop="postalCode">
  181. <el-input v-model="form.postalCode"></el-input>
  182. </el-form-item>
  183. </el-col>
  184. <el-col :span="6">
  185. <el-form-item label="电话" prop="telephone">
  186. <el-input v-model="form.telephone"></el-input>
  187. </el-form-item>
  188. </el-col>
  189. <el-col :span="6">
  190. <el-form-item label="手机号" prop="mobileTelephone">
  191. <el-input v-model="form.mobileTelephone"></el-input>
  192. </el-form-item>
  193. </el-col>
  194. <el-col :span="6">
  195. <el-form-item label="民族" prop="nationId">
  196. <el-select
  197. v-model="form.nationId"
  198. placeholder="请选择"
  199. filterable
  200. >
  201. <el-option
  202. v-for="item in dict.nation"
  203. :key="item.id"
  204. :label="item.displayName"
  205. :value="item.id"
  206. />
  207. </el-select>
  208. </el-form-item>
  209. </el-col>
  210. <el-col :span="6">
  211. <el-form-item label="介绍人" prop="salesman">
  212. <el-input v-model="form.salesman"></el-input>
  213. </el-form-item>
  214. </el-col>
  215. <el-col :span="6">
  216. <el-form-item label="性激素期" prop="sexHormoneTermId">
  217. <el-select
  218. v-model="form.sexHormoneTermId"
  219. placeholder="请选择"
  220. filterable
  221. clearable
  222. >
  223. <el-option
  224. v-for="item in dict.sexHormoneTerm"
  225. :key="item.id"
  226. :label="item.displayName"
  227. :value="item.id"
  228. >
  229. </el-option>
  230. </el-select>
  231. </el-form-item>
  232. </el-col>
  233. <el-col :span="6">
  234. <el-form-item label="是否VIP" prop="isVip">
  235. <el-radio v-model="form.isVip" label="Y"></el-radio>
  236. <el-radio v-model="form.isVip" label="N"></el-radio>
  237. </el-form-item>
  238. </el-col>
  239. </el-row>
  240. <el-row>
  241. <el-col :span="6" style="margin-bottom: -15px; line-height: 40px">
  242. <el-form-item label="电话随访" prop="isPhoneFollow">
  243. <el-radio v-model="form.isPhoneFollow" label="Y"></el-radio>
  244. <el-radio v-model="form.isPhoneFollow" label="N"></el-radio>
  245. </el-form-item>
  246. </el-col>
  247. <el-col :span="6">
  248. <el-form-item label="隐藏姓名" prop="isNameHide">
  249. <el-radio v-model="form.isNameHide" label="Y"></el-radio>
  250. <el-radio v-model="form.isNameHide" label="N"></el-radio>
  251. </el-form-item>
  252. </el-col>
  253. <el-col :span="6">
  254. <el-form-item label="是否锁住" prop="isLock">
  255. <el-radio v-model="form.isLock" label="Y"></el-radio>
  256. <el-radio v-model="form.isLock" label="N"></el-radio>
  257. </el-form-item>
  258. </el-col>
  259. <el-col :span="6">
  260. <el-form-item label="体检开始" prop="isMedicalStart">
  261. <el-radio v-model="form.isMedicalStart" label="Y" disabled
  262. ></el-radio
  263. >
  264. <el-radio v-model="form.isMedicalStart" label="N" disabled
  265. ></el-radio
  266. >
  267. </el-form-item>
  268. </el-col>
  269. <el-col :span="6">
  270. <el-form-item label="体检中心" prop="organizationUnitId">
  271. <el-select
  272. v-model="form.organizationUnitId"
  273. placeholder="请选择"
  274. filterable
  275. >
  276. <el-option
  277. v-for="item in dict.organization"
  278. :key="item.id"
  279. :label="item.displayName"
  280. :value="item.id"
  281. >
  282. </el-option>
  283. </el-select>
  284. </el-form-item>
  285. </el-col>
  286. <el-col :span="6">
  287. <el-form-item label="分组" prop="customerOrgGroupId">
  288. <el-select
  289. v-model="form.customerOrgGroupId"
  290. placeholder="请选择"
  291. filterable
  292. clearable
  293. @change="changeCustomerOrgGroupId"
  294. :disabled="
  295. form.customerOrgId === dict.personOrgId ? true : false
  296. "
  297. >
  298. <el-option
  299. v-for="item in patientRegister.customerOrgGroup"
  300. :key="item.id"
  301. :label="item.displayName"
  302. :value="item.id"
  303. />
  304. </el-select>
  305. </el-form-item>
  306. </el-col>
  307. <el-col :span="6">
  308. <el-form-item label="套餐" prop="medicalPackageId">
  309. <el-select
  310. v-model="form.medicalPackageId"
  311. placeholder="请选择"
  312. filterable
  313. clearable
  314. @change="changeMedicalPackageId"
  315. :disabled="
  316. form.customerOrgId === dict.personOrgId ? false : true
  317. "
  318. >
  319. <el-option
  320. v-for="item in dict.medicalPackage"
  321. :key="item.id"
  322. :label="item.displayName"
  323. :value="item.id"
  324. />
  325. </el-select>
  326. </el-form-item>
  327. </el-col>
  328. <el-col :span="6">
  329. <el-form-item label="完成标志" prop="completeFlag">
  330. <el-select
  331. v-model="form.completeFlag"
  332. placeholder="请选择"
  333. disabled
  334. >
  335. <el-option
  336. v-for="item in dict.completeFlag"
  337. :key="item.id"
  338. :label="item.displayName"
  339. :value="item.id"
  340. >
  341. </el-option>
  342. </el-select>
  343. </el-form-item>
  344. </el-col>
  345. <el-col :span="24">
  346. <el-form-item label="备注" prop="remark">
  347. <el-input
  348. v-model="form.remark"
  349. type="textarea"
  350. :rows="2"
  351. placeholder="请输入备注"
  352. ></el-input>
  353. </el-form-item>
  354. </el-col>
  355. </el-row>
  356. <el-row>
  357. <el-col :span="6">
  358. <el-form-item label="创建者">
  359. <el-input v-model="form.creatorId" disabled></el-input>
  360. </el-form-item>
  361. </el-col>
  362. <el-col :span="6">
  363. <el-form-item label="创建时间">
  364. <el-input
  365. :value="
  366. form.creationTime
  367. ? lmoment(form.creationTime, 'yyyy-MM-DD')
  368. : ''
  369. "
  370. disabled
  371. ></el-input>
  372. </el-form-item>
  373. </el-col>
  374. <el-col :span="6">
  375. <el-form-item label="修改者">
  376. <el-input v-model="form.lastModifierId" disabled></el-input>
  377. </el-form-item>
  378. </el-col>
  379. <el-col :span="6">
  380. <el-form-item label="修改时间">
  381. <el-input
  382. :value="
  383. form.lastModificationTime
  384. ? lmoment(form.lastModificationTime, 'yyyy-MM-DD')
  385. : ''
  386. "
  387. disabled
  388. ></el-input>
  389. </el-form-item>
  390. </el-col>
  391. </el-row>
  392. </el-form>
  393. <el-image
  394. class="photo"
  395. :src="apiurl + '/' + patientRegister.patientRegisterRd.photo"
  396. style="width: 150; height: 200"
  397. >
  398. <div slot="placeholder" class="image-slot">
  399. 加载中<span class="dot">...</span>
  400. </div>
  401. </el-image>
  402. </div>
  403. <!-- 按钮区域 -->
  404. <div style="margin-left: 10px; display: flex; margin-top: 10px">
  405. <div class="btn">
  406. <el-button @click="readIdCard">读身份证</el-button>
  407. </div>
  408. <div class="btn">
  409. <el-button type="success" @click="Onsubmit('form')">保存</el-button>
  410. </div>
  411. <div class="btn">
  412. <el-button type="primary" @click="openCamera" icon="el-icon-camera"
  413. >拍照</el-button
  414. >
  415. </div>
  416. <div class="btn">
  417. <el-button type="primary">申请单</el-button>
  418. </div>
  419. <div class="btn">
  420. <el-button type="primary">打条码</el-button>
  421. </div>
  422. <div class="btn">
  423. <el-button type="primary">打指引单</el-button>
  424. </div>
  425. <div class="btn">
  426. <el-button type="primary">复制新增</el-button>
  427. </div>
  428. </div>
  429. </td>
  430. <td style="width: 40%">
  431. <PatientRegisterItem :patientRegisterForm="form" />
  432. </td>
  433. </table>
  434. <!-- 人员档案列表 -->
  435. <el-dialog
  436. title="人员档案列表"
  437. :visible.sync="dialogVisible"
  438. width="800"
  439. :append-to-body="true"
  440. >
  441. <el-table
  442. :data="patientList"
  443. border
  444. width="800"
  445. height="480"
  446. row-key="id"
  447. size="small"
  448. class="el-table__body-wrapper tbody"
  449. highlight-current-row
  450. @row-click="rowick"
  451. ref="patientList"
  452. >
  453. <el-table-column type="index" width="30" />
  454. <el-table-column prop="patientNo" label="档案号" />
  455. <el-table-column prop="lastTime" label="末次体检" width="100">
  456. <template slot-scope="scope">
  457. <div v-if="scope.row.lastTime">
  458. {{ lmoment(scope.row.lastTime, "yyyy-MM-DD") }}
  459. </div>
  460. </template>
  461. </el-table-column>
  462. <el-table-column prop="medicalTimes" label="体检次数" />
  463. <el-table-column prop="displayName" label="姓名" />
  464. <el-table-column prop="sexId" label="性别">
  465. <template slot-scope="scope">
  466. <div>
  467. {{ ldddw(dict.sex, "id", scope.row.sexId, "displayName") }}
  468. </div>
  469. </template>
  470. </el-table-column>
  471. <el-table-column prop="maritalStatusId" label="婚姻">
  472. <template slot-scope="scope">
  473. <div>
  474. {{
  475. ldddw(
  476. dict.maritalStatus,
  477. "id",
  478. scope.row.maritalStatusId,
  479. "displayName"
  480. )
  481. }}
  482. </div>
  483. </template>
  484. </el-table-column>
  485. <el-table-column prop="birthDate" label="出生日期" width="100">
  486. <template slot-scope="scope">
  487. <div v-if="scope.row.birthDate">
  488. {{ lmoment(scope.row.birthDate, "yyyy-MM-DD") }}
  489. </div>
  490. </template>
  491. </el-table-column>
  492. <el-table-column prop="nationId" label="民族">
  493. <template slot-scope="scope">
  494. <div>
  495. {{ ldddw(dict.nation, "id", scope.row.nationId, "displayName") }}
  496. </div>
  497. </template>
  498. </el-table-column>
  499. <el-table-column prop="idNo" label="身份证号" />
  500. <el-table-column prop="telephone" label="电话" />
  501. <el-table-column prop="mobileTelephone" label="手机号" />
  502. </el-table>
  503. <span slot="footer" class="dialog-footer">
  504. <el-button @click="dialogVisible = false"> </el-button>
  505. <el-button type="primary" @click="choosePatient"> </el-button>
  506. </span>
  507. </el-dialog>
  508. <!-- 拍照 -->
  509. <el-dialog
  510. title="拍照"
  511. :visible.sync="patientRegister.cameraVisble"
  512. width="400"
  513. height="800"
  514. :show-close="false"
  515. :append-to-body="true"
  516. >
  517. <Camera :id="form.id" />
  518. </el-dialog>
  519. </div>
  520. </template>
  521. <script>
  522. import moment from "moment";
  523. import { mapState } from "vuex";
  524. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  525. import mm from "../../utlis/mm";
  526. import { objCopy, setNull, dddw } from "../../utlis/proFunc";
  527. import Camera from "./Camera.vue";
  528. import PatientRegisterItem from "./PatientRegisterItem.vue";
  529. export default {
  530. components: {
  531. Camera,
  532. PatientRegisterItem,
  533. },
  534. data() {
  535. return {
  536. apiurl: mm.apiurl,
  537. form: {
  538. id: "", //id
  539. patientId: "00000000-0000-0000-0000-000000000000", //档案号ID 选择了档案就传档案号,未选就传00000-0000...
  540. patientNo: "", //档案号
  541. customerOrgId: null, //单位编号
  542. customerOrgGroupId: null, //分组
  543. medicalPackageId: null, //套餐
  544. patientName: "", //姓名
  545. birthDate: "", //字符串 如:2012-01-29
  546. sexId: "9", //性别 默认未知U
  547. age: null, //年龄
  548. jobCardNo: "", //工卡号
  549. medicalCardNo: "", //体检卡号
  550. maritalStatusId: "9", //婚姻状况 默认未知
  551. medicalTypeId: null, //体检类别
  552. personnelTypeId: null, //人员类别
  553. jobPost: "", //职务
  554. jobTitle: "", //职称
  555. photo:
  556. "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg", //照片
  557. salesman: "", //介绍人
  558. sexHormoneTermId: null, //性激素期限
  559. isNameHide: "N", //隐藏姓名
  560. isPhoneFollow: "N", //电话随访
  561. isVip: "N", //vip客户
  562. remark: "", //
  563. isLock: "N", //是否锁住
  564. completeFlag: "1", //完成标志 0:预登记,1:未检,2:部份已检,3:已总检 【创建编辑时不操作】
  565. isMedicalStart: "N", //体检开始标志 【创建编辑时不操作】
  566. patientRegisterNo: "", //条码号 【创建编辑时不操作】
  567. medicalTimes: 1, //条码号 【创建编辑时不操作】
  568. organizationUnitId: null, //体检中心
  569. address: "", //地址
  570. email: "", //email
  571. idNo: "", //身份证号
  572. telephone: "", //电话
  573. mobileTelephone: "", //手机号
  574. nationId: null, //民族编号
  575. postalCode: "", //邮编
  576. creatorId: null,
  577. creationTime: "",
  578. lastModificationTime: "",
  579. lastModifierId: null,
  580. }, //单位 记录 目前新增与更新是一致
  581. defaultNull: [
  582. "customerOrgId",
  583. "customerOrgGroupId",
  584. "medicalPackageId",
  585. "age",
  586. "medicalTypeId",
  587. "personnelTypeId",
  588. "sexHormoneTermId",
  589. "organizationUnitId",
  590. "nationId",
  591. ], //一般uuid字段为空时,需设置为null值
  592. rules: {
  593. patientName: [
  594. { required: true, message: "请输入姓名", trigger: "blur" },
  595. ],
  596. organizationUnitId: [
  597. { required: true, message: "请填写体检中心", trigger: "blur" },
  598. ],
  599. },
  600. dialogVisible: false,
  601. patientList: [], //人员列表(用于判断人员多次体检)
  602. patientChoosed: {}, //查重选中的人员
  603. dialogCamera: false, //拍照组件
  604. };
  605. },
  606. created() {},
  607. //挂载完成
  608. mounted() {
  609. //表单赋值
  610. //console.log('mounted this.patientRegister.patientRegisterRd',this.patientRegister.patientRegisterRd)
  611. objCopy(this.patientRegister.patientRegisterRd, this.form);
  612. console.log("mounted this.form", this.form);
  613. },
  614. computed: {
  615. ...mapState(["dict", "patientRegister", "customerOrg"]),
  616. },
  617. methods: {
  618. readIdCard() {
  619. console.log("this.form1", this.form);
  620. },
  621. //分组改变时触发
  622. changeCustomerOrgGroupId() {
  623. this.patientRegister.customerOrgGroupChange++;
  624. },
  625. //套餐改变时触发
  626. changeMedicalPackageId() {
  627. this.patientRegister.medicalPackageChange++;
  628. },
  629. //根据姓名,身份证号 查询档案信息,用于判断人员多次体检
  630. query(param) {
  631. //编辑的时候不查重
  632. if (this.form.id || !param) return;
  633. //console.log(param)
  634. getapi(`/api/app/patient/in-filter?Filter=${param}`).then((res) => {
  635. if (res.code == 1) {
  636. console.log("查重 ", res); //有数据才显示
  637. if (res.data.items && res.data.items.length > 0) {
  638. this.patientList = res.data.items;
  639. this.dialogVisible = true;
  640. }
  641. }
  642. });
  643. },
  644. //列表选中
  645. rowick(row) {
  646. this.patientChoosed = row;
  647. },
  648. //确定选择人员
  649. choosePatient() {
  650. if (!this.patientChoosed) {
  651. alert("请选中人员档案信息");
  652. return;
  653. }
  654. this.dialogVisible = false;
  655. this.form.patientId = this.patientChoosed.id;
  656. this.form.patientName = this.patientChoosed.displayName;
  657. this.form.sexId = this.patientChoosed.sexId;
  658. this.form.maritalStatusId = this.patientChoosed.maritalStatusId;
  659. this.form.birthDate = this.patientChoosed.birthDate;
  660. this.form.nationId = this.patientChoosed.nationId;
  661. this.form.idNo = this.patientChoosed.idNo;
  662. this.form.telephone = this.patientChoosed.telephone;
  663. this.form.mobileTelephone = this.patientChoosed.mobileTelephone;
  664. this.form.patientNo = this.patientChoosed.patientNo;
  665. this.form.medicalTimes = this.patientChoosed.medicalTimes + 1;
  666. },
  667. ldddw(arrayData, key, value, display) {
  668. return dddw(arrayData, key, value, display);
  669. },
  670. lmoment(date, forMat) {
  671. return moment(new Date(date)).format(forMat);
  672. },
  673. //提交
  674. Onsubmit(formName) {
  675. this.$refs[formName].validate((valid) => {
  676. if (valid) {
  677. //赋值
  678. let body = { ...this.form };
  679. delete body.id;
  680. delete body.patientRegisterNo;
  681. delete body.medicalTimes;
  682. delete body.completeFlag;
  683. delete body.isMedicalStart;
  684. delete body.patientNo;
  685. delete body.creatorId;
  686. delete body.creationTime;
  687. delete body.lastModificationTime;
  688. delete body.lastModifierId;
  689. setNull(body, this.defaultNull);
  690. //日期转换
  691. console.log("body.birthDate", body.birthDate);
  692. if (body.birthDate) {
  693. body.birthDate = moment(new Date(body.birthDate)).format(
  694. "yyyy-MM-DD"
  695. );
  696. }
  697. if (this.form.id.length < 1) {
  698. //id为空则新增
  699. console.log(`/api/app/patient-register/return-info`, body);
  700. postapi(`/api/app/patient-register/return-info`, body).then(
  701. (res) => {
  702. if (res.code == 1) {
  703. //console.log('res',res)
  704. this.$message.success("创健 操作成功");
  705. objCopy(res.data, this.form);
  706. this.patientRegister.patientRegisterId = res.data.id;
  707. this.patientRegister.patientRegisterId = res.data.id;
  708. this.patientRegister.patientRegisterRd = res.data;
  709. this.patientRegister.query.times++;
  710. this.patientRegister.saveTimes++;
  711. }
  712. }
  713. );
  714. } else {
  715. //id不为空则编辑
  716. console.log(
  717. `/api/app/patient-register?PatientRegisterId=${this.form.id}`,
  718. body
  719. );
  720. putapi(
  721. `/api/app/patient-register?PatientRegisterId=${this.form.id}`,
  722. body
  723. ).then((res) => {
  724. if (res.code == 1) {
  725. this.$message.success("更新 操作成功");
  726. this.patientRegister.query.times++;
  727. this.patientRegister.saveTimes++;
  728. }
  729. });
  730. }
  731. } else {
  732. alert("未通过数据校验");
  733. return false;
  734. }
  735. });
  736. },
  737. //新增弹框
  738. add() {
  739. //
  740. },
  741. //删除
  742. del() {
  743. deletapi(
  744. `/api/app/customer-org/${this.customerOrg.customerOrgRd.id}`
  745. ).then((res) => {
  746. this.$message.success("删除 操作成功");
  747. this.setData({ key: "customerOrg.customerOrgRd", value: { id: "" } });
  748. this.getCustomerOrgTree();
  749. });
  750. },
  751. //拍照
  752. openCamera() {
  753. if (!this.form.id) {
  754. alert("请先保存人员信息");
  755. return;
  756. }
  757. this.patientRegister.cameraVisble = true;
  758. },
  759. },
  760. //监听事件
  761. watch: {
  762. //新增触发
  763. "patientRegister.addTimes"(newVal, oldVal) {
  764. //console.log('patientRegister.addTimes newVal:',newVal,' oldVal:',oldVal)
  765. if (newVal != oldVal) {
  766. //console.log('this.patientRegister.patientRegisterRdInit',this.patientRegister.patientRegisterRdInit)
  767. objCopy(this.patientRegister.patientRegisterRdInit, this.form);
  768. //console.log('this.form',this.form)
  769. }
  770. },
  771. //编辑触发
  772. "patientRegister.patientRegisterRd.id"(newVal, oldVal) {
  773. console.log(
  774. "patientRegister.patientRegisterRd.id newVal:",
  775. newVal,
  776. " oldVal:",
  777. oldVal
  778. );
  779. if (newVal != oldVal) {
  780. console.log("newVal:", this.patientRegister.patientRegisterRd);
  781. objCopy(this.patientRegister.patientRegisterRd, this.form);
  782. }
  783. },
  784. //拍照触发
  785. "patientRegister.photo"(newVal, oldVal) {
  786. //console.log('patientRegister.patientRegisterRd.id newVal:',newVal,' oldVal:',oldVal)
  787. if (newVal != oldVal) {
  788. //console.log('newVal:',newVal)
  789. this.form.photo = newVal;
  790. }
  791. },
  792. },
  793. };
  794. </script>
  795. <style scoped>
  796. ::v-deep .el-form-item {
  797. margin-bottom: -15px;
  798. }
  799. .btn {
  800. margin-left: 10px;
  801. }
  802. .photo {
  803. position: absolute;
  804. top: 100px;
  805. right: 42%;
  806. /* width: 150px;
  807. height: 150px; */
  808. width: 150px;
  809. height: 160px;
  810. }
  811. ::v-deep .el-table--small .el-table__cell {
  812. padding: 0px 0;
  813. }
  814. </style>