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.

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