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.

1892 lines
72 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
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
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. <!--组件主体-->
  4. <div style="display: flex">
  5. <div :style="'width:' + (window.pageWidth - 110 - 20) + 'px;'">
  6. <!--查询条件-->
  7. <div style="position: absolute;top:28px;left:140px;display: flex;">
  8. <div v-show="checkPagePriv(pagePriv.privs, '查找')">
  9. <PatientRegisterEditQuery />
  10. </div>
  11. <div style="display: flex;margin-left: 5px;">
  12. <div v-show="checkPagePriv(pagePriv.privs, '读身份证')">
  13. <el-button @click="peopleIcCard" class="commonbutton">读身份证</el-button>
  14. </div>
  15. <div style="margin-left: 5px;" v-show="checkPagePriv(pagePriv.privs, '拍照')">
  16. <el-button type="primary" class="commonbutton" @click="photoGrah" icon="el-icon-camera">拍照</el-button>
  17. </div>
  18. </div>
  19. </div>
  20. <div>
  21. <el-form ref="form" :model="form" label-width="80px" :rules="rules" size="medium">
  22. <el-row>
  23. <el-col :span="5">
  24. <el-form-item label="单位名称" prop="customerOrgId">
  25. <el-cascader v-model="form.customerOrgId" :options="patientRegister.customerOrgTreeAll"
  26. :style="'width:' + Math.floor((window.pageWidth - 510) / 4.8) + 'px;'" filterable
  27. popper-class="example" :show-all-levels="false" @change="changeCustomerOrgId"
  28. :props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }"
  29. :disabled="(form.completeFlag == '3' || isDoctor != '1') ? true : false" size="small">
  30. </el-cascader>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :span="5">
  34. <el-form-item label="条码号" prop="patientRegisterNo">
  35. <el-input v-model="form.patientRegisterNo" disabled size="small"></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :span="5">
  39. <el-form-item label="档案号" prop="patientNo">
  40. <el-input v-model="form.patientNo" disabled size="small"></el-input>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :span="3">
  44. <el-form-item label="体检次数" prop="medicalTimes">
  45. <el-input v-model="form.medicalTimes" disabled size="small"></el-input>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="3">
  49. <el-form-item label="性别" prop="sexId" label-width="50px">
  50. <el-select v-model="form.sexId" placeholder="请选择" size="small" filterable
  51. :style="'width:' + Math.floor((window.pageWidth - 630) / 8) + 'px;'">
  52. <el-option v-for="item in dict.sex" :key="item.id" :label="item.displayName" :value="item.id">
  53. </el-option>
  54. </el-select>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="3">
  58. </el-col>
  59. </el-row>
  60. <el-row>
  61. <el-col :span="5">
  62. <el-form-item label="姓名" prop="patientName">
  63. <el-input id="patientName" v-model="form.patientName" @change="Query(form.patientName)" size="small"
  64. autocomplete="off"></el-input>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :span="5">
  68. <el-form-item label="身份证号" prop="idNo">
  69. <el-input v-model="form.idNo" @change="changeIdNo" size="small"></el-input>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="5">
  73. <el-form-item label="出生日期" prop="birthDate">
  74. <!--
  75. <input type="date" v-model="form.birthDate" size="small"
  76. :style="'border-radius: 4px;border: 1px solid #DCDFE6;height: 32px;line-height: 32px;padding-left: 2px;width:' + Math.floor((window.pageWidth - 510) / 4.8) + 'px;'"/>
  77. -->
  78. <el-date-picker v-model="form.birthDate" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  79. placeholder="出生日期" :style="'width:' + Math.floor((window.pageWidth - 510) / 4.8) + 'px;'"
  80. @change="changeBirthDate" prefix-icon="" size="small" />
  81. </el-form-item>
  82. </el-col>
  83. <el-col :span="3">
  84. <el-form-item label="年龄" prop="age">
  85. <el-input v-model="form.age" size="small" @change="changeAge"></el-input>
  86. </el-form-item>
  87. </el-col>
  88. <el-col :span="3">
  89. <el-form-item label="婚姻" prop="maritalStatusId" label-width="50px">
  90. <el-select v-model="form.maritalStatusId" placeholder="请选择" size="small" filterable
  91. :style="'width:' + Math.floor((window.pageWidth - 630) / 8) + 'px;'">
  92. <el-option v-for="item in dict.maritalStatus" :key="item.id" :label="item.displayName"
  93. :value="item.id">
  94. </el-option>
  95. </el-select>
  96. </el-form-item>
  97. </el-col>
  98. <el-col :span="3" />
  99. </el-row>
  100. <el-row>
  101. <el-col :span="5">
  102. <el-form-item label="手机号" prop="mobileTelephone">
  103. <el-input v-model="form.mobileTelephone" size="small"></el-input>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="5">
  107. <el-form-item label="电话" prop="telephone">
  108. <el-input v-model="form.telephone" size="small"></el-input>
  109. </el-form-item>
  110. </el-col>
  111. <el-col :span="5">
  112. <el-form-item label="邮箱" prop="email">
  113. <el-input v-model="form.email" size="small"></el-input>
  114. </el-form-item>
  115. </el-col>
  116. <el-col :span="3">
  117. <el-form-item label="邮编" prop="postalCode">
  118. <el-input v-model="form.postalCode" size="small"></el-input>
  119. </el-form-item>
  120. </el-col>
  121. <el-col :span="3">
  122. <el-form-item label="籍贯" prop="birthPlaceId" label-width="50px">
  123. <el-select v-model="form.birthPlaceId" placeholder="请选择" filterable clearable
  124. :style="'width:' + Math.floor((window.pageWidth - 630) / 8) + 'px;'" size="small">
  125. <el-option v-for="item in dict.birthPlace" :key="item.id" :label="item.displayName"
  126. :value="item.id" />
  127. </el-select>
  128. </el-form-item>
  129. </el-col>
  130. <el-col :span="3" />
  131. </el-row>
  132. <el-row>
  133. <el-col :span="10">
  134. <el-form-item label="地址" prop="address">
  135. <el-input v-model="form.address" size="small"></el-input>
  136. </el-form-item>
  137. </el-col>
  138. <el-col :span="5">
  139. <el-form-item label="人员类别" prop="personnelTypeId">
  140. <el-select v-model="form.personnelTypeId" placeholder="请选择" filterable clearable
  141. :style="'width:' + Math.floor((window.pageWidth - 510) / 4.8) + 'px;'" size="small">
  142. <el-option v-for="item in dict.personnelType" :key="item.id" :label="item.displayName"
  143. :value="item.id" />
  144. </el-select>
  145. </el-form-item>
  146. </el-col>
  147. <el-col :span="3">
  148. <el-form-item label="性激素期" prop="sexHormoneTermId">
  149. <el-select v-model="form.sexHormoneTermId" placeholder="请选择" filterable clearable size="small"
  150. :disabled="isComplete">
  151. <el-option v-for="item in dict.sexHormoneTerm" :key="item.id" :label="item.displayName"
  152. :value="item.id">
  153. </el-option>
  154. </el-select>
  155. </el-form-item>
  156. </el-col>
  157. <el-col :span="3">
  158. <el-form-item label="民族" prop="nationId" label-width="50px">
  159. <el-select v-model="form.nationId" placeholder="请选择" filterable clearable
  160. default-first-option :filter-method="filterMethod"
  161. :style="'width:' + Math.floor((window.pageWidth - 630) / 8) + 'px;'" size="small">
  162. <el-option v-for="item in nation" :key="item.id" :label="item.displayName" :value="item.id" />
  163. </el-select>
  164. </el-form-item>
  165. </el-col>
  166. <el-col :span="3" />
  167. </el-row>
  168. <el-row>
  169. <el-col :span="5">
  170. <el-form-item label="体检类别" prop="medicalTypeId">
  171. <el-select v-model="form.medicalTypeId" placeholder="请选择" filterable clearable
  172. :style="'width:' + Math.floor((window.pageWidth - 510) / 4.8) + 'px;'" size="small">
  173. <el-option v-for="item in dict.medicalType" :key="item.id" :label="item.displayName"
  174. :value="item.id" />
  175. </el-select>
  176. </el-form-item>
  177. </el-col>
  178. <el-col :span="5">
  179. <el-form-item label="工卡号" prop="jobCardNo">
  180. <el-input v-model="form.jobCardNo" size="small"></el-input>
  181. </el-form-item>
  182. </el-col>
  183. <el-col :span="5">
  184. <el-form-item label="体检卡号" prop="medicalCardNo">
  185. <el-input v-model="form.medicalCardNo" size="small"></el-input>
  186. </el-form-item>
  187. </el-col>
  188. <el-col :span="3">
  189. <el-form-item label="职务" prop="jobPost">
  190. <el-input v-model="form.jobPost" size="small"></el-input>
  191. </el-form-item>
  192. </el-col>
  193. <el-col :span="3">
  194. <el-form-item label="职称" prop="jobTitle" label-width="50px">
  195. <el-input v-model="form.jobTitle" size="small"
  196. :style="'width:' + Math.floor((window.pageWidth - 630) / 8) + 'px;'" />
  197. </el-form-item>
  198. </el-col>
  199. <el-col :span="3">
  200. <el-form-item label="介绍人" prop="salesman">
  201. <el-input v-model="form.salesman" size="small"></el-input>
  202. </el-form-item>
  203. </el-col>
  204. </el-row>
  205. <el-row>
  206. <el-col :span="5">
  207. <el-form-item label="体检中心" prop="medicalCenterId">
  208. <el-select v-model="form.medicalCenterId" placeholder="请选择" filterable :disabled="peisid ? true : false"
  209. size="small" :style="'width:' + Math.floor((window.pageWidth - 510) / 4.8) + 'px;'">
  210. <el-option v-for="item in dict.organization" :key="item.id" :label="item.displayName"
  211. :value="item.id">
  212. </el-option>
  213. </el-select>
  214. </el-form-item>
  215. </el-col>
  216. <el-col :span="5">
  217. <el-form-item label="单位体检次数" prop="isVip" label-width="110px">
  218. <el-select :class="form.customerOrgId == dict.personOrgId ? '' : 'enterToTab'"
  219. v-model="form.customerOrgRegisterId" placeholder="次数" size="small"
  220. :disabled="form.customerOrgId == dict.personOrgId"
  221. :style="'width:' + Math.floor((window.pageWidth - 654) / 4.8) + 'px;'" @change="changeMedicalTimes"
  222. value-key="id">
  223. <el-option v-for="item in customerOrgRegisterList" :key="item.id" :label="item.medicalTimes"
  224. :value="item.id" />
  225. </el-select>
  226. </el-form-item>
  227. </el-col>
  228. <el-col :span="3">
  229. <el-form-item label="电话随访" prop="isPhoneFollow">
  230. <!--
  231. <el-radio v-model="form.isPhoneFollow" label="Y"></el-radio>
  232. <el-radio v-model="form.isPhoneFollow" label="N"></el-radio>
  233. -->
  234. <el-checkbox v-model="form.isPhoneFollowBox" @change="changeBox('isPhoneFollow')" />
  235. </el-form-item>
  236. </el-col>
  237. <el-col :span="2">
  238. <el-form-item label="VIP" prop="isVip" label-width="50px">
  239. <!--
  240. <el-radio v-model="form.isVip" label="Y"></el-radio>
  241. <el-radio v-model="form.isVip" label="N"></el-radio>
  242. -->
  243. <el-checkbox v-model="form.isVipBox" @change="changeBox('isVip')" />
  244. </el-form-item>
  245. </el-col>
  246. <el-col :span="3">
  247. <el-form-item label="隐藏姓名" prop="isNameHide">
  248. <!--
  249. <el-radio v-model="form.isNameHide" label="Y"></el-radio>
  250. <el-radio v-model="form.isNameHide" label="N"></el-radio>
  251. -->
  252. <el-checkbox v-model="form.isNameHideBox" @change="changeBox('isNameHide')" />
  253. </el-form-item>
  254. </el-col>
  255. <el-col :span="3">
  256. <el-form-item label="锁住" prop="isLock" label-width="50px">
  257. <!--
  258. <el-radio v-model="form.isLock" label="Y"></el-radio>
  259. <el-radio v-model="form.isLock" label="N"></el-radio>
  260. -->
  261. <el-checkbox v-model="form.isLockBox" @change="changeBox('isLock')" />
  262. </el-form-item>
  263. </el-col>
  264. <el-col :span="3">
  265. <el-form-item label="体检开始" prop="isMedicalStart">
  266. <el-select v-model="form.isMedicalStart" placeholder="请选择" disabled size="small">
  267. <el-option label="是" value="Y" />
  268. <el-option label="否" value="N" />
  269. </el-select>
  270. </el-form-item>
  271. </el-col>
  272. </el-row>
  273. <el-row>
  274. <el-col :span="5">
  275. <el-form-item label="分组" prop="customerOrgGroupId">
  276. <el-select v-model="form.customerOrgGroupId" placeholder="请选择" filterable clearable
  277. @change="changeCustomerOrgGroupId" :disabled="displayGroup"
  278. :style="'width:' + Math.floor((window.pageWidth - 510) / 4.8) + 'px;'" size="small">
  279. <el-option v-for="item in patientRegister.customerOrgGroup" :key="item.id" :label="item.displayName"
  280. :value="item.id" />
  281. </el-select>
  282. </el-form-item>
  283. </el-col>
  284. <el-col :span="5">
  285. <el-form-item label="套餐" prop="medicalPackageId">
  286. <el-select v-model="form.medicalPackageId" placeholder="请选择" filterable clearable
  287. @change="changeMedicalPackageId" :disabled="displayPackage"
  288. :style="'width:' + Math.floor((window.pageWidth - 510) / 4.8) + 'px;'" size="small">
  289. <el-option v-for="item in dict.medicalPackage" :key="item.id" :label="item.displayName"
  290. :value="item.id" />
  291. </el-select>
  292. </el-form-item>
  293. </el-col>
  294. <el-col :span="11">
  295. <el-form-item label="备注" prop="remark">
  296. <el-input v-model="form.remark" type="textarea" :rows="1" placeholder="请输入备注" size="small"></el-input>
  297. </el-form-item>
  298. </el-col>
  299. <el-col :span="3">
  300. <el-form-item label="状态" prop="completeFlag" label-width="50px">
  301. <el-select v-model="form.completeFlag" placeholder="请选择"
  302. :disabled="(form.completeFlag == '2' || form.completeFlag == '3') ? true : false" size="small">
  303. <div v-if="form.completeFlag == '2' || form.completeFlag == '3'">
  304. <el-option v-for="item in dict.completeFlag" :key="item.id" :label="item.displayName"
  305. :value="item.id">
  306. </el-option>
  307. </div>
  308. <div v-else>
  309. <el-option label="预登记" value="0" />
  310. <el-option label="正式登记" value="1" />
  311. </div>
  312. </el-select>
  313. </el-form-item>
  314. </el-col>
  315. </el-row>
  316. <el-row>
  317. <el-col :span="6">
  318. <el-form-item label="创建人员">
  319. <el-input v-model="form.creatorName" disabled size="small"></el-input>
  320. </el-form-item>
  321. </el-col>
  322. <el-col :span="6">
  323. <el-form-item label="创建时间">
  324. <el-input :value="form.creationTime
  325. ? moment(form.creationTime).format('yyyy-MM-DD')
  326. : ''
  327. " disabled size="small"></el-input>
  328. </el-form-item>
  329. </el-col>
  330. <el-col :span="6">
  331. <el-form-item label="修改人员">
  332. <el-input v-model="form.lastModifierName" disabled size="small"></el-input>
  333. </el-form-item>
  334. </el-col>
  335. <el-col :span="6">
  336. <el-form-item label="修改时间">
  337. <el-input :value="form.lastModificationTime
  338. ? moment(form.lastModificationTime).format('yyyy-MM-DD')
  339. : ''
  340. " disabled size="small"></el-input>
  341. </el-form-item>
  342. </el-col>
  343. </el-row>
  344. </el-form>
  345. <el-image
  346. :style="'position: absolute;top:70px;right:' + (100 + Math.floor((window.pageWidth - 680) / 24)) + 'px; width: 130px; height: 140px;'"
  347. :src="peoplePhoto">
  348. <div slot="placeholder" class="image-slot">
  349. 加载中<span class="dot">...</span>
  350. </div>
  351. </el-image>
  352. </div>
  353. <!--人员登记组合项目明细 register_check_asbitem-->
  354. <div>
  355. <PatientRegisterItem :prForm="form" :prAsbOpraOpts="prAsbOpraOpts" :triggerHeadSave="triggerHeadSave"
  356. :refreshFormId="refreshFormId" />
  357. </div>
  358. </div>
  359. <div style="margin-left: 10px;">
  360. <div v-show="checkPagePriv(pagePriv.privs, '新增')">
  361. <el-button type="primary" class="commonbutton" @click="btnAdd">新增</el-button>
  362. </div>
  363. <div v-show="checkPagePriv(pagePriv.privs, '复制新增')" class="btn">
  364. <el-button type="primary" class="commonbutton" @click="rdCopy">复制新增</el-button>
  365. </div>
  366. <div v-show="checkPagePriv(pagePriv.privs, '保存')" class="btn">
  367. <el-button type="success" class="commonbutton" @click="btnSubmit('form', true)">保存</el-button>
  368. </div>
  369. <div v-show="checkPagePriv(pagePriv.privs, '检验单申请')" class="btn">
  370. <el-button type="primary" class="commonbutton" @click="lisRequest">检验单申请</el-button>
  371. </div>
  372. <div v-show="checkPagePriv(pagePriv.privs, '条码打印')" class="btn">
  373. <el-button type="primary" class="commonbutton" @click="lisPrint('0002', false)">条码打印</el-button>
  374. </div>
  375. <div v-show="checkPagePriv(pagePriv.privs, '条码补打')" class="btn">
  376. <el-button type="danger" class="commonbutton" @click="reLisRequest">条码补打</el-button>
  377. </div>
  378. <div v-show="checkPagePriv(pagePriv.privs, '指引单打印')" class="btn">
  379. <el-button type="primary" class="commonbutton" @click="guidePrint('0001', false)">指引单打印</el-button>
  380. </div>
  381. <!--
  382. <div v-show="checkPagePriv(pagePriv.privs, '指引单预览')" class="btn">
  383. <el-button type="primary" class="commonbutton" @click="guidePrint('0001', true)">指引单预览</el-button>
  384. </div>
  385. -->
  386. <div v-show="checkPagePriv(pagePriv.privs, '手动合并项目')" class="btn">
  387. <el-button type="danger" class="commonbutton" @click="reMergeAsbitem">手动合并项目</el-button>
  388. </div>
  389. <div v-show="checkPagePriv(pagePriv.privs, '全个人支付')" style="margin-top: 30px;">
  390. <el-button type="primary" class="commonbutton" @click="prAsbOpraOpts.payTypeFlag = '0'">全个人支付</el-button>
  391. </div>
  392. <div v-show="checkPagePriv(pagePriv.privs, '全单位支付')" class="btn">
  393. <el-button type="primary" class="commonbutton" @click="prAsbOpraOpts.payTypeFlag = '1'">全单位支付</el-button>
  394. </div>
  395. <div v-show="checkPagePriv(pagePriv.privs, '全免费')" class="btn">
  396. <el-button type="primary" class="commonbutton" @click="prAsbOpraOpts.payTypeFlag = '2'">全免费</el-button>
  397. </div>
  398. <div v-show="checkPagePriv(pagePriv.privs, '收费')" class="btn">
  399. <el-button type="success" class="commonbutton" @click="toCharge(form.patientRegisterNo)">收费</el-button>
  400. </div>
  401. <!--
  402. <div class="btn">
  403. <el-button type="success" class="commonbutton" @click="btnTest">test</el-button>
  404. </div>
  405. -->
  406. </div>
  407. </div>
  408. <!--组件弹窗-->
  409. <div>
  410. <!-- 人员档案列表 -->
  411. <el-dialog title="人员档案列表" :visible.sync="dialogVisible" width="800px" :show-close="false"
  412. :close-on-click-modal="false" :append-to-body="true">
  413. <el-table :data="patientList" border width="800" height="480" row-key="id" size="small"
  414. class="el-table__body-wrapper tbody" highlight-current-row @row-click="rowick" @row-dblclick="patientDblclick"
  415. ref="patientList">
  416. <el-table-column type="index" width="30" />
  417. <el-table-column prop="patientNo" label="档案号" />
  418. <el-table-column prop="lastTime" label="末次体检" width="100">
  419. <template slot-scope="scope">
  420. <div v-if="scope.row.lastTime">
  421. {{ moment(scope.row.lastTime).format("yyyy-MM-DD") }}
  422. </div>
  423. </template>
  424. </el-table-column>
  425. <el-table-column prop="medicalTimes" label="体检次数" />
  426. <el-table-column prop="displayName" label="姓名" />
  427. <el-table-column prop="sexId" label="性别">
  428. <template slot-scope="scope">
  429. <div>
  430. {{ dddw(dict.sex, "id", scope.row.sexId, "displayName") }}
  431. </div>
  432. </template>
  433. </el-table-column>
  434. <el-table-column prop="maritalStatusId" label="婚姻">
  435. <template slot-scope="scope">
  436. <div>
  437. {{ dddw(dict.maritalStatus, "id", scope.row.maritalStatusId, "displayName") }}
  438. </div>
  439. </template>
  440. </el-table-column>
  441. <el-table-column prop="birthDate" label="出生日期" width="100">
  442. <template slot-scope="scope">
  443. <div v-if="scope.row.birthDate">
  444. {{ moment(scope.row.birthDate).format("yyyy-MM-DD") }}
  445. </div>
  446. </template>
  447. </el-table-column>
  448. <el-table-column prop="nationId" label="民族">
  449. <template slot-scope="scope">
  450. <div>
  451. {{ dddw(dict.nation, "id", scope.row.nationId, "displayName") }}
  452. </div>
  453. </template>
  454. </el-table-column>
  455. <el-table-column prop="idNo" label="身份证号" />
  456. <el-table-column prop="telephone" label="电话" />
  457. <el-table-column prop="mobileTelephone" label="手机号" />
  458. </el-table>
  459. <span slot="footer" class="dialog-footer">
  460. <el-button class="commonbutton" @click="dialogVisible = false" style="width:90px;">取消</el-button>
  461. <el-button class="commonbutton" type="primary" @click="choosePatient" style="width:90px;">确定</el-button>
  462. </span>
  463. </el-dialog>
  464. <!-- 拍照openCamera 网页模式已废弃
  465. <el-dialog title="拍照" :visible.sync="patientRegister.cameraVisble" width="400" height="600"
  466. :close-on-click-modal="false" :append-to-body="true">
  467. <Camera :id="form.id" />
  468. </el-dialog>
  469. -->
  470. <!-- 检验条码补打 -->
  471. <el-dialog title="检验条码补打" :visible.sync="patientRegister.lisRequestVisble" width="600px" height="400"
  472. :show-close="false" :close-on-click-modal="false" :append-to-body="true">
  473. <LisRequest :id="form.id" :brushTimes="brushTimes" />
  474. </el-dialog>
  475. <!-- 手动合并项目 -->
  476. <el-dialog title="手动合并项目" :visible.sync="patientRegister.mergeAsbitemVisble" width="600px" height="400"
  477. :show-close="false" :close-on-click-modal="false" :append-to-body="true">
  478. <MergeAsbitem :id="form.id" :medicalCenterId="form.medicalCenterId" :brushTimes="brushTimes" />
  479. </el-dialog>
  480. <!-- 收费 -->
  481. <el-dialog title="" :visible.sync="dialogWin.charge" :close-on-click-modal="false" :append-to-body="true" fullscreen
  482. @close="closeDialogCharge">
  483. <div style="margin-top: -30px;">
  484. <Charge :patientRegisterNo="chargePatientRegisterNo" />
  485. </div>
  486. </el-dialog>
  487. </div>
  488. </div>
  489. </template>
  490. <script>
  491. import moment from "moment";
  492. import { mapState, mapActions } from "vuex";
  493. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  494. import {
  495. getPagePriv, checkPagePriv, objCopy, setNull, dddw, checkIDCode, parseID,
  496. birthdayToAge, ageToBirthday, deepCopy, arrayFilter, arrayReduce, parsIcCardtoLocal,
  497. photoParse, savePeoplePhoto, arrayExistObj
  498. } from "../../utlis/proFunc";
  499. import Camera from "./Camera.vue";
  500. import PatientRegisterItem from "./PatientRegisterItem.vue";
  501. import LisRequest from "./LisRequest.vue";
  502. import MergeAsbitem from "./MergeAsbitem.vue";
  503. import Charge from "../../views/charge/charge.vue";
  504. import PatientRegisterEditQuery from "../../components/patientRegister/PatientRegisterEditQuery.vue";
  505. import proApi from "../../utlis/proApi";
  506. export default {
  507. components: {
  508. Camera,
  509. LisRequest,
  510. MergeAsbitem,
  511. PatientRegisterItem,
  512. Charge,
  513. PatientRegisterEditQuery
  514. },
  515. // isDoctor: '0:标准人员登记/1:医生诊台登记(可修改单位)'
  516. props: ['isDoctor', 'patientRegisterId', 'editTimes', 'refreshRegister', 'refFuncSetData'],
  517. data() {
  518. return {
  519. pagePriv: {
  520. routeUrlorPageName: 'PatientRegisterEdit', //当前页面归属路由或归属页面权限名称
  521. privs: [] // 页面权限
  522. },
  523. brushTimes: 0,
  524. peisid: null,
  525. peoplePhoto: '',
  526. preCustomerOrgId: '', // 上一个人的体检单位,只是在本组件点新增时才用到
  527. form: {
  528. registerManType: 'customer', //登记人员类型,客服:customer 医生:doctor 支持在医生诊台处理登记人员
  529. id: "", //id
  530. photo: '', //照片
  531. patientId: "00000000-0000-0000-0000-000000000000", //档案号ID 选择了档案就传档案号,未选就传00000-0000...
  532. patientNo: "", //档案号
  533. customerOrgId: ["00000000-0000-0000-0000-000000000001"], //单位编号 默认个人
  534. customerOrgRegisterId: "00000000-0000-0000-0000-000000000001", //默认单位体检次数
  535. customerOrgGroupId: null, //分组
  536. medicalPackageId: null, //套餐
  537. patientName: "", //姓名
  538. birthDate: null, //日期型
  539. sexId: "U", //性别 默认未知U
  540. age: null, //年龄
  541. jobCardNo: "", //工卡号
  542. medicalCardNo: "", //体检卡号
  543. maritalStatusId: "9", //婚姻状况 默认未知
  544. medicalTypeId: null, //体检类别
  545. personnelTypeId: null, //人员类别
  546. jobPost: "", //职务
  547. jobTitle: "", //职称
  548. salesman: "", //介绍人
  549. sexHormoneTermId: null, //性激素期限
  550. isNameHide: "N", //隐藏姓名
  551. isPhoneFollow: "N", //电话随访
  552. isVip: "N", //vip客户
  553. remark: "", //
  554. isLock: "N", //是否锁住
  555. completeFlag: "1", //完成标志 0:预登记,1:正式登记(未检),2:部份已检,3:已总检 【创建编辑时不操作】
  556. isMedicalStart: "N", //体检开始标志 【创建编辑时不操作】
  557. patientRegisterNo: "", //条码号 【创建编辑时不操作】
  558. medicalTimes: 1, //条码号 【创建编辑时不操作】
  559. medicalCenterId: null, //体检中心
  560. address: "", //地址
  561. email: "", //email
  562. idNo: "", //身份证号
  563. telephone: "", //电话
  564. mobileTelephone: "", //手机号
  565. nationId: null, //民族编号
  566. birthPlaceId: null, //籍惯(出生地)
  567. postalCode: "", //邮编
  568. creatorId: null,
  569. creationTime: "",
  570. lastModificationTime: "",
  571. lastModifierId: null,
  572. isVipBox: false, //vip客户
  573. isNameHideBox: false, //隐藏姓名
  574. isPhoneFollowBox: false, //电话随访
  575. isLockBox: false, //是否锁住
  576. isMaxMedicalTimes: 'N',
  577. medicalStartDate: null
  578. }, //单位 记录 目前新增与更新是一致
  579. formInit: {}, //表单初始化
  580. customerOrgRegisterList: [], //单位体检次数列表
  581. defaultNull: [
  582. "customerOrgId",
  583. "customerOrgGroupId",
  584. "medicalPackageId",
  585. "birthDate",
  586. "age",
  587. "maritalStatusId",
  588. "medicalTypeId",
  589. "personnelTypeId",
  590. "sexHormoneTermId",
  591. "medicalCenterId",
  592. "nationId",
  593. "birthPlaceId",
  594. ], //一般uuid字段为空时,需设置为null值
  595. rules: {
  596. customerOrgId: [
  597. { required: true, message: "请填写单位", trigger: "blur" },
  598. ],
  599. patientName: [
  600. { required: true, message: "请填写姓名", trigger: "blur" },
  601. ],
  602. medicalCenterId: [
  603. { required: true, message: "请填写体检中心", trigger: "blur" },
  604. ],
  605. },
  606. dialogVisible: false,
  607. patientList: [], //人员列表(用于判断人员多次体检)
  608. patientChoosed: {}, //查重选中的人员
  609. registerVisible: false,
  610. patientRegisters: [],
  611. registerChoosed: {},
  612. dialogCamera: false, //拍照组件
  613. chargePatientRegisterNo: '', //对哪个条码客户收费
  614. //人员登记,组合项目明细操作相关参数
  615. prAsbOpraOpts: {
  616. formId: '', //form.id为空时,明细保存取此formId
  617. copyNew: 0, //触发复制新增
  618. payTypeFlag: '', //触发调整支付方式
  619. prAsbSave: 0, //触发组合项目明细保存
  620. prAsbQuery: 0,//触发组合项目明细查询,比如收费后,刷新收费状态
  621. prAsbGroup: 0, //触发分组更换
  622. prAsbPackage: 0, //触发套餐更换
  623. },
  624. nation:[], //
  625. };
  626. },
  627. created() {
  628. //获取用户当前页面的权限
  629. let userPriv = window.sessionStorage.getItem('userPriv')
  630. if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
  631. this.formInit = deepCopy(this.form)
  632. // 初始化字典数据
  633. this.dictInit()
  634. },
  635. //挂载完成
  636. mounted() {
  637. this.initFormData(this.dataTransOpts.tableS.patient_register.id)
  638. // 表单中 回车 代替 tab
  639. this.enterToTab();
  640. },
  641. computed: {
  642. ...mapState(["window", "dialogWin", "dataTransOpts", "dict", "patientRegister", "customerOrg", "projPriv"]),
  643. //是否总检(已总检则不允许修改套餐与分组)
  644. isComplete() {
  645. return this.form.completeFlag == '3' ? true : false;
  646. },
  647. // 套餐 disabled 如完成体检亦不允许编辑
  648. displayPackage() {
  649. let isPersonOrgId = true
  650. if (!this.isComplete) {
  651. if (!this.form.customerOrgId) return false
  652. if (typeof this.form.customerOrgId == 'string') {
  653. if (this.form.customerOrgId == this.dict.personOrgId) isPersonOrgId = false
  654. } else {
  655. if (this.form.customerOrgId[this.form.customerOrgId.length - 1] == this.dict.personOrgId) isPersonOrgId = false
  656. }
  657. }
  658. return isPersonOrgId
  659. },
  660. // 分组 disabled 如完成体检亦不允许编辑
  661. displayGroup() {
  662. let isPersonOrgId = true
  663. if (!this.isComplete) {
  664. if (!this.form.customerOrgId) return isPersonOrgId
  665. if (typeof this.form.customerOrgId == 'string') {
  666. if (this.form.customerOrgId != this.dict.personOrgId) isPersonOrgId = false
  667. } else {
  668. if (this.form.customerOrgId[this.form.customerOrgId.length - 1] != this.dict.personOrgId) isPersonOrgId = false
  669. }
  670. }
  671. return isPersonOrgId
  672. },
  673. },
  674. methods: {
  675. ...mapActions(['getPatientRegisterAbs']),
  676. dddw, moment, checkPagePriv,
  677. btnTest() {
  678. console.log('form', this.form)
  679. },
  680. //数据初始化
  681. dictInit() {
  682. //性别(仅档案用)
  683. getapi("/api/app/sex").then((res) => {
  684. if (res.code == 1) {
  685. this.dict.sex = res.data;
  686. }
  687. });
  688. //适用性别
  689. getapi("/api/app/for-sex").then((res) => {
  690. if (res.code == 1) {
  691. this.dict.forSex = res.data;
  692. }
  693. });
  694. //体检中心
  695. getapi("/api/app/organization-units/organization-unit-by-is-peis").then(
  696. (res) => {
  697. if (res.code == 1) {
  698. this.dict.organization = res.data;
  699. }
  700. }
  701. );
  702. //体检单位
  703. // getapi("/api/app/customer-org/in-filter").then((res) => {
  704. // if (res.code == 1) {
  705. // this.dict.customerOrg = res.data;
  706. // }
  707. // });
  708. //体检类别
  709. getapi("/api/app/medical-type/in-filter").then((res) => {
  710. if (res.code == 1) {
  711. this.dict.medicalType = res.data;
  712. }
  713. });
  714. //人员类别
  715. getapi("/api/app/personnel-type/in-filter").then((res) => {
  716. if (res.code == 1) {
  717. this.dict.personnelType = res.data;
  718. }
  719. });
  720. //婚姻状况
  721. getapi("/api/app/MaritalStatus/GetMaritalStatusList").then((res) => {
  722. if (res.code == 1) {
  723. this.dict.maritalStatus = res.data;
  724. }
  725. });
  726. //性激素期
  727. getapi("/api/app/sex-hormone-term/in-filter").then((res) => {
  728. if (res.code == 1) {
  729. this.dict.sexHormoneTerm = res.data;
  730. }
  731. });
  732. //民族
  733. getapi("/api/app/nation/in-filter").then((res) => {
  734. if (res.code != -1) {
  735. this.dict.nation = res.data;
  736. this.nation = deepCopy(res.data)
  737. }
  738. });
  739. //籍惯 ,出生地
  740. getapi("/api/app/birth-place/in-filter").then((res) => {
  741. if (res.code == 1) {
  742. this.dict.birthPlace = res.data;
  743. }
  744. });
  745. //套餐
  746. postapi("/api/app/medicalpackage/GetBasicList", {}).then((res) => {
  747. if (res.code == 1) {
  748. this.dict.medicalPackage = res.data;
  749. }
  750. });
  751. //支付方式
  752. getapi("/api/app/pay-mode").then((res) => {
  753. if (res.code == 1) {
  754. this.dict.payMode = res.data;
  755. }
  756. });
  757. //项目类别 树结构
  758. // getapi("/api/app/item-type/by-code-all").then((res) => {
  759. // if (res.code != -1) {
  760. // this.dict.itemTypeTree = res.data;
  761. // tcdate(this.dict.itemTypeTree);
  762. // }
  763. // });
  764. // postapi("/api/app/asbitem/GetBasicList",{isFilterActive:'Y'}).then((res) => {
  765. // if (res.code != -1) {
  766. // this.dict.asbItemAll = res.data;
  767. // }
  768. // });
  769. // console.log("dict", this.dict);
  770. },
  771. // 获取登记信息 初始form表单数据
  772. async initFormData(patientRegisterId) {
  773. this.peisid = window.sessionStorage.getItem('peisid');
  774. this.preCustomerOrgId = this.preCustomerOrgId || this.patientRegister.query.customerOrgId
  775. if (!patientRegisterId) { //添加
  776. objCopy(this.formInit, this.form);
  777. this.form.medicalCenterId = this.peisid; //体检中收
  778. this.form.customerOrgId = this.preCustomerOrgId || this.dict.personOrgId //体检单位
  779. this.form.customerOrgParentId = await this.getParentCustomerOrgId(this.form.customerOrgId) //体检父单位
  780. } else {
  781. // let res = await getapi(`/api/app/patient-register/${patientRegisterId}`)
  782. let res = await postapi(`/api/app/patientregister/getinfoorpatient?PatientRegisterId=${patientRegisterId}`)
  783. // this.form = res.data 这种方式,会造成 checkbox 值变化不响应,故取消
  784. objCopy(res.data, this.form)
  785. }
  786. this.initBox();
  787. this.getPeoplePhoto(this.form.photo)
  788. this.dataTransOpts.refresh.register_check_asbitem.D++ //触发所选组合项目刷新
  789. // 单位/个人 的分组与套餐处理
  790. this.changeCustomerOrgId(this.form.customerOrgId)
  791. },
  792. //快速选择组合项目时,调整可按拼间简码及简称查找
  793. filterMethod(keyWords) {
  794. //console.log('filterMethod',this.asbItemQuick)
  795. if (keyWords) {
  796. this.nation = [];
  797. this.dict.nation.forEach(item => {
  798. if (item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
  799. || item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1) {
  800. this.nation.push(item);
  801. }
  802. });
  803. } else {
  804. this.nation = deepCopy(this.dict.nation);
  805. }
  806. },
  807. //选择单位
  808. async changeCustomerOrgId(v) {
  809. // console.log('changeCustomerOrgId',v)
  810. let customerOrgId = ""
  811. if (Array.isArray(v) && v.length > 0) {
  812. customerOrgId = v[v.length - 1]
  813. } else {
  814. customerOrgId = v
  815. }
  816. this.preCustomerOrgId = customerOrgId
  817. let customerOrgParentId = await this.getParentCustomerOrgId(customerOrgId)
  818. if (customerOrgParentId) {
  819. if (customerOrgParentId == this.dict.personOrgId) {
  820. this.form.customerOrgRegisterId = "00000000-0000-0000-0000-000000000001"
  821. } else {
  822. // 获取体检次数
  823. this.getCustomerOrgRegisterList(customerOrgParentId)
  824. }
  825. // 父单位被更改时,需要触发 修改 分组/套餐
  826. if (this.form.customerOrgParentId != customerOrgParentId) {
  827. this.form.customerOrgGroupId = null
  828. this.form.medicalPackageId = null
  829. // 清除套餐分组标识
  830. this.dataTransOpts.tableM.register_check_asbitem.forEach(e => {
  831. e.isBelongGroupPackage = 'N'
  832. });
  833. if (customerOrgParentId == this.dict.personOrgId) {
  834. this.patientRegister.customerOrgGroup = []
  835. } else {
  836. this.form.customerOrgRegisterId = null
  837. }
  838. if (this.form.customerOrgParentId == this.dict.personOrgId) {
  839. this.changeMedicalPackageId()
  840. } else {
  841. this.changeCustomerOrgGroupId()
  842. }
  843. this.form.customerOrgParentId = customerOrgParentId
  844. }
  845. }
  846. },
  847. // 获取顶级单位ID
  848. async getParentCustomerOrgId(customerOrgId) {
  849. let customerOrgParentId = null
  850. if (!customerOrgId) return customerOrgParentId
  851. if (typeof customerOrgId == 'string') {
  852. try {
  853. let res = await getapi(`/api/app/customer-org/parent/${customerOrgId}`)
  854. if (res.code != -1) customerOrgParentId = res.data
  855. } catch (error) {
  856. console.log('获取顶级单位ID出错:', error)
  857. }
  858. } else if (customerOrgId.length > 0) {
  859. customerOrgParentId = customerOrgId[0]
  860. }
  861. return customerOrgParentId
  862. },
  863. //获取单位体检次数
  864. getCustomerOrgRegisterList(customerOrgParentId) {
  865. //获取单位体检次数信息
  866. getapi(`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${customerOrgParentId}`)
  867. .then(res => {
  868. if (res.code != - 1) {
  869. console.log('获取单位体检次数', this.form.customerOrgRegisterId, res.data)
  870. if (this.form.customerOrgRegisterId) {
  871. let lfind = arrayExistObj(res.data, "id", this.form.customerOrgRegisterId)
  872. if (lfind == -1) this.form.customerOrgRegisterId = ''
  873. }
  874. if (!this.form.customerOrgRegisterId) {
  875. this.customerOrgRegisterList = arrayFilter(res.data, 'isComplete', 'N') //不显示已完成的体检次数
  876. if (this.customerOrgRegisterList.length > 0) {
  877. this.form.customerOrgRegisterId = this.customerOrgRegisterList[this.customerOrgRegisterList.length - 1].id
  878. }
  879. }
  880. if (this.form.customerOrgRegisterId) return getapi(`/api/app/customerorggroup/getlistinfilter?CustomerOrgRegisterId=${this.form.customerOrgRegisterId}`) //获取单位分组
  881. }
  882. }).then(res => {
  883. if (res && res.code != -1) {
  884. this.patientRegister.customerOrgGroup = res.data;
  885. }
  886. })
  887. },
  888. //读取身份证信息
  889. peopleIcCard() {
  890. if (!this.$peisAPI) {
  891. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  892. return
  893. }
  894. this.$peisAPI.peopleIcCard().then(res => {
  895. console.log('peopleIcCard', res)
  896. let lres = JSON.parse(res)
  897. if (lres.code >= -1) {
  898. let idNos = parsIcCardtoLocal(lres.data, this.dict.sex, this.dict.nation)
  899. this.form.patientName = idNos.Name
  900. this.form.birthDate = idNos.birthDate
  901. this.form.sexId = idNos.sexId
  902. this.form.age = idNos.age
  903. this.form.nationId = idNos.nationId
  904. this.form.idNo = idNos.IDCode
  905. this.form.address = idNos.Address
  906. this.peoplePhoto = 'data:image/bmp;base64,' + idNos.Photo
  907. this.patientRegister.photo = 'data:image/bmp;base64,' + idNos.Photo
  908. this.changeIdNo() // 触发身份证查询档案号
  909. }else{
  910. this.$message.error({showClose:true,message:`${lres.message}`})
  911. }
  912. })
  913. },
  914. //获取单位体检次数列表,并默认赋最后一次体检次数
  915. // async getCustomerOrgRegisterList() {
  916. // this.customerOrgRegisterList = []
  917. // if (this.form.customerOrgId == this.dict.personOrgId) {
  918. // this.form.customerOrgRegisterId = null
  919. // return
  920. // }
  921. // try {
  922. // let res = await getapi(`/api/app/customer-org/parent/${this.form.customerOrgId}`);
  923. // let res1 = await getapi(`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${res.data}`);
  924. // this.customerOrgRegisterList = arrayFilter(res1.data, 'isComplete', 'N')
  925. // //要把已完成体检的次数去掉 (查询时不能触发保存)
  926. // // if (this.customerOrgRegisterList.length > 0) {
  927. // // this.form.customerOrgRegisterId = this.customerOrgRegisterList[this.customerOrgRegisterList.length - 1].id
  928. // // //this.changeCustomerOrgGroupId()
  929. // // this.changeMedicalTimes()
  930. // // }
  931. // } catch (error) {
  932. // console.log(error)
  933. // }
  934. // },
  935. //修改单位体检次数
  936. changeMedicalTimes() {
  937. this.form.customerOrgGroupId = null
  938. this.changeCustomerOrgGroupId()
  939. //获取体检次数下的分组
  940. this.getCustomerOrgGroup(this.form.customerOrgRegisterId)
  941. },
  942. //移除旧分组或套餐的组合项目
  943. removeGroupPackageAsb() {
  944. let body = { registerAsbitemIds: [] }
  945. let registerAsbitemIds = []
  946. let chargeComplete = ''
  947. //体检基本信息未保存时,删除所有所选项目
  948. if (!this.form.id) {
  949. this.patientRegister.patientRegisterAbs = [];
  950. return body;
  951. }
  952. //删除已选 分组或套餐的组合项目 ,如已收费或 已检时,将 groupPackageId 置为null
  953. for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) {
  954. if (!this.patientRegister.patientRegisterAbs[i].id) {
  955. this.patientRegister.patientRegisterAbs.splice(i, 1)
  956. i--
  957. continue
  958. }
  959. if (this.patientRegister.patientRegisterAbs[i].isCharge == 'Y' || this.patientRegister.patientRegisterAbs[i].checkCompleteFlag != '0') {
  960. chargeComplete += this.patientRegister.patientRegisterAbs[i].asbitemName + ','
  961. this.patientRegister.patientRegisterAbs[i].groupPackageId = null
  962. } else {
  963. //数据库有,才添加到待删除的数组中
  964. if (this.patientRegister.patientRegisterAbs[i].id) {
  965. registerAsbitemIds.push(this.patientRegister.patientRegisterAbs[i].id)
  966. }
  967. this.patientRegister.patientRegisterAbs.splice(i, 1)
  968. i--
  969. }
  970. }
  971. if (chargeComplete) {
  972. this.$message.info({ showClose: true, message: `所选项目:${chargeComplete}已收费或已检,不可删除!` });
  973. }
  974. body = { registerAsbitemIds };
  975. return body;
  976. },
  977. //添加新套餐/分组的组合项目
  978. addGroupPackageAsb(groupPackageAsb, typeFlag, groupPackageId) {
  979. let payTypeFlag = '0'; //默认个人支付
  980. let lfind = -1
  981. if (this.form.customerOrgId != this.dict.personOrgId) payTypeFlag = '1' //单位支付
  982. for (let i = 0; i < groupPackageAsb.length; i++) {
  983. lfind = arrayExistObj(this.patientRegister.patientRegisterAbs, 'asbitemId', groupPackageAsb[i].id)
  984. if (lfind > - 1) {
  985. this.patientRegister.patientRegisterAbs[lfind].groupPackageId = groupPackageId
  986. //editCount++
  987. continue
  988. }
  989. let pojo = {
  990. asbitemId: groupPackageAsb[i].id,
  991. asbitemName: groupPackageAsb[i].displayName,
  992. patientRegisterId: this.form.id,
  993. standardPrice: groupPackageAsb[i].price,
  994. chargePrice: typeFlag == 'group' ? groupPackageAsb[i].customerOrgGroupDetailPrice : groupPackageAsb[i].price,
  995. payTypeFlag,
  996. discount: typeFlag == 'group' ? groupPackageAsb[i].discount : 100,
  997. isCharge: "N",
  998. amount: typeFlag == 'group' ? groupPackageAsb[i].customerOrgGroupDetailAmount : 1,
  999. groupPackageId: groupPackageId
  1000. }
  1001. this.patientRegister.patientRegisterAbs.push(pojo)
  1002. }
  1003. },
  1004. //获取体检次数下的分组
  1005. getCustomerOrgGroup(customerOrgRegisterId) {
  1006. this.patientRegister.customerOrgGroup = []
  1007. getapi(`/api/app/customerorggroup/getlistinfilter?CustomerOrgRegisterId=${customerOrgRegisterId}`).then(res => {
  1008. if (res.code != - 1) {
  1009. this.patientRegister.customerOrgGroup = res.data;
  1010. }
  1011. })
  1012. },
  1013. //修改出生日期
  1014. changeBirthDate() {
  1015. this.form.age = birthdayToAge(this.form.birthDate)
  1016. },
  1017. //修改出生日期
  1018. changeAge() {
  1019. this.form.birthDate = ageToBirthday(this.form.age)
  1020. },
  1021. //修改身份证,生成年龄、出生、性别
  1022. changeIdNo() {
  1023. if (!this.form.idNo) return
  1024. this.Query(this.form.idNo)
  1025. let ret = parseID(this.form.idNo)
  1026. if (ret.age != -1) {
  1027. this.form.birthDate = new Date(ret.birthday)
  1028. this.form.age = ret.age
  1029. this.form.sexId = ret.sex
  1030. }
  1031. },
  1032. // //分组改变时触发
  1033. changeCustomerOrgGroupId() {
  1034. // this.patientRegister.customerOrgGroupChange++;
  1035. // if (this.form.id) this.btnSubmit('form', false);
  1036. // this.getGroupPackageAsb('group',this.form.customerOrgGroupId)
  1037. this.prAsbOpraOpts.prAsbGroup++
  1038. },
  1039. // //套餐改变时触发
  1040. changeMedicalPackageId() {
  1041. // this.patientRegister.medicalPackageChange++;
  1042. // if (this.form.id) this.btnSubmit('form', false);
  1043. // this.getGroupPackageAsb('package',this.form.medicalPackageId)
  1044. this.prAsbOpraOpts.prAsbPackage++
  1045. },
  1046. //根据姓名,身份证号 查询档案信息,用于判断人员多次体检
  1047. Query(param) {
  1048. //编辑的时候不查重
  1049. if (this.form.id || !param) return;
  1050. //console.log(`/api/app/patient/in-filter?Filter=${param}`)
  1051. let body = {
  1052. filter: param,
  1053. maxResultCount: 500
  1054. }
  1055. postapi('/api/app/patient/getlistinfilter', body).then((res) => {
  1056. if (res.code > -1) {
  1057. console.log("查重 ", res); //有数据才显示
  1058. if (res.data && res.data.length > 0) {
  1059. this.patientList = res.data;
  1060. this.dialogVisible = true;
  1061. }
  1062. }
  1063. });
  1064. },
  1065. //列表选中
  1066. rowick(row) {
  1067. this.patientChoosed = row;
  1068. },
  1069. patientDblclick(row) {
  1070. this.patientChoosed = row;
  1071. this.choosePatient()
  1072. },
  1073. //确定选择人员
  1074. choosePatient() {
  1075. if (!this.patientChoosed) {
  1076. alert("请选中人员档案信息");
  1077. return;
  1078. }
  1079. this.dialogVisible = false;
  1080. this.form.patientId = this.patientChoosed.id;
  1081. this.form.patientName = this.patientChoosed.displayName;
  1082. this.form.sexId = this.patientChoosed.sexId;
  1083. this.form.maritalStatusId = this.patientChoosed.maritalStatusId;
  1084. this.form.birthDate = new Date(this.patientChoosed.birthDate);
  1085. this.form.nationId = this.patientChoosed.nationId;
  1086. this.form.idNo = this.patientChoosed.idNo;
  1087. this.form.telephone = this.patientChoosed.telephone;
  1088. this.form.mobileTelephone = this.patientChoosed.mobileTelephone;
  1089. this.form.patientNo = this.patientChoosed.patientNo;
  1090. this.form.medicalTimes = this.patientChoosed.medicalTimes + 1;
  1091. if (this.form.birthDate) {
  1092. this.form.age = birthdayToAge(this.form.birthDate)
  1093. }
  1094. if (this.form.idNo) {
  1095. let ret = parseID(this.form.idNo)
  1096. if (!this.form.birthDate) this.form.birthDate = new Date(ret.birthday)
  1097. if (!this.form.age) this.form.age = ret.age
  1098. if (!this.form.sexId) this.form.age = ret.sex
  1099. }
  1100. },
  1101. registerRowClick(row) {
  1102. this.registerChoosed = row;
  1103. },
  1104. registerRowDblclick(row) {
  1105. this.registerChoosed = row;
  1106. this.chooseRegister()
  1107. },
  1108. chooseRegister() {
  1109. if (!this.registerChoosed) {
  1110. alert("请选中人员登记信息");
  1111. return;
  1112. }
  1113. objCopy(this.registerChoosed, this.form)
  1114. // this.patientRegister.patientRegisterId = this.registerChoosed.id
  1115. // this.patientRegister.photo = this.registerChoosed.photo
  1116. // this.getPatientRegisterAbs(this.registerChoosed.id)
  1117. this.dataTransOpts.tableS.patient_register.id = this.registerChoosed.id
  1118. setTimeout(() => {
  1119. this.dataTransOpts.refresh.register_check_asbitem.M++
  1120. }, 20);
  1121. this.registerVisible = false
  1122. },
  1123. changeBox(type) {
  1124. //赋值
  1125. if (this.form[type + 'Box']) {
  1126. this.form[type] = 'Y';
  1127. } else {
  1128. this.form[type] = 'N';
  1129. }
  1130. console.log('Box-type', this.form[type + 'Box'], this.form[type])
  1131. },
  1132. initBox() {
  1133. if (this.form.isVip == 'Y') {
  1134. this.form.isVipBox = true;
  1135. } else {
  1136. this.form.isVipBox = false;
  1137. }
  1138. if (this.form.isNameHide == 'Y') {
  1139. this.form.isNameHideBox = true;
  1140. } else {
  1141. this.form.isNameHideBox = false;
  1142. }
  1143. if (this.form.isPhoneFollow == 'Y') {
  1144. this.form.isPhoneFollowBox = true;
  1145. } else {
  1146. this.form.isPhoneFollowBox = false;
  1147. }
  1148. if (this.form.isLock == 'Y') {
  1149. this.form.isLockBox = true;
  1150. } else {
  1151. this.form.isLockBox = false;
  1152. }
  1153. if (!this.form.id) {
  1154. this.form.medicalCenterId = this.peisid;
  1155. }
  1156. },
  1157. // 组装基本信息保存的参数体
  1158. madePrBody() {
  1159. //赋值
  1160. let body = deepCopy(this.form);
  1161. // console.log('this.form',this.form)
  1162. // console.log('body',body)
  1163. if (this.form.birthDate) {
  1164. try {
  1165. body.birthDate = moment(body.birthDate).format("yyyy-MM-DD")
  1166. } catch (error) {
  1167. // this.form.birthDate != "Invalid date"
  1168. body.birthDate = null
  1169. }
  1170. } else {
  1171. body.birthDate = null
  1172. }
  1173. if (body.birthDate == "Invalid date") body.birthDate = null
  1174. if (isNaN(body.age)) body.age = null
  1175. // console.log('body',body)
  1176. // Invalid date
  1177. delete body.registerManType;
  1178. delete body.patientRegisterNo;
  1179. delete body.medicalTimes;
  1180. // delete body.completeFlag;
  1181. delete body.isMedicalStart;
  1182. delete body.patientNo;
  1183. delete body.creatorId;
  1184. delete body.creationTime;
  1185. delete body.lastModificationTime;
  1186. delete body.lastModifierId;
  1187. delete body.isVipBox;
  1188. delete body.isNameHideBox;
  1189. delete body.isPhoneFollowBox;
  1190. delete body.isLockBox;
  1191. delete body.photo;
  1192. // if(this.form.registerManType == 'customer') delete body.medicalStartDate;
  1193. if (this.form.id) delete body.medicalStartDate;
  1194. setNull(body, this.defaultNull);
  1195. if (typeof this.form.customerOrgId == 'object') {
  1196. if (this.form.customerOrgId.length > 0) body.customerOrgId = this.form.customerOrgId[this.form.customerOrgId.length - 1]
  1197. }
  1198. //日期转换 日期控件增加格式
  1199. // console.log("body.birthDate", body.birthDate);
  1200. // if (body.birthDate) {
  1201. // body.birthDate = moment(new Date(body.birthDate)).format(
  1202. // "yyyy-MM-DD"
  1203. // );
  1204. // }
  1205. return body
  1206. },
  1207. //提交
  1208. btnSubmit(formName, msgTip) {
  1209. this.$refs[formName].validate((valid, fields) => {
  1210. console.log('fields', fields)
  1211. if (!valid) {
  1212. this.$message.warning({ showClose: true, message: fields[Object.keys(fields)[0]][0].message});
  1213. return false
  1214. }
  1215. if (this.form.customerOrgId != this.dict.personOrgId) {
  1216. if (!this.form.customerOrgRegisterId) {
  1217. this.$message.warning({ showClose: true, message: "请填写单位体检次数!"});
  1218. return false
  1219. }
  1220. }
  1221. if (this.form.idNo && checkIDCode(this.form.idNo) == false) {
  1222. this.$message.warning({ showClose: true, message: "身份证号填写不合法!"});
  1223. return false
  1224. }
  1225. let body = this.madePrBody()
  1226. body.registerCheckAsbitems = deepCopy(this.dataTransOpts.tableM.register_check_asbitem)
  1227. if (this.form.id) {
  1228. // 更新时,先保存明细,再更新主表
  1229. // this.prAsbOpraOpts.prAsbSave++ //触发组合项目保存
  1230. body.patientRegisterId = body.id;
  1231. } else {
  1232. delete body.id;
  1233. }
  1234. // console.log(`/api/patientregister/createreturninfo`, body);
  1235. postapi(`/api/PatientRegister/CreatePatientRegister`, body)
  1236. .then(res => {
  1237. if (res.code == 1) {
  1238. objCopy(res.data, this.form)
  1239. this.dataTransOpts.tableS.patient_register = deepCopy(res.data)
  1240. delete this.dataTransOpts.tableS.patient_register.registerCheckAsbitems
  1241. // 保存成功赋 id 值等
  1242. this.dataTransOpts.tableM.register_check_asbitem = deepCopy(res.data.registerCheckAsbitems)
  1243. // //触发已选组合项目保存
  1244. // this.prAsbOpraOpts.formId = res.data.id
  1245. // setTimeout(() => {
  1246. // this.dataTransOpts.refresh.register_check_asbitem.D++
  1247. // }, 10);
  1248. // 用于刷新登记的列表
  1249. // this.refreshRegister(Object.assign({}, res.data))
  1250. //一般读身份证照片时,会出现这种情况
  1251. if (this.patientRegister.photo && this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(res.data.id, this.patientRegister.photo);
  1252. }
  1253. }
  1254. );
  1255. });
  1256. },
  1257. // 人员新增
  1258. btnAdd() {
  1259. this.dataTransOpts.tableS.patient_register.id = ''
  1260. this.dataTransOpts.refresh.patient_register.S++
  1261. },
  1262. //将现有的数据,复制并展现,但未保存
  1263. rdCopy() {
  1264. if (!this.form.id) {
  1265. this.$message.info({ showClose: true, message: "该信息尚未保存,不可执行此操作!"});
  1266. return;
  1267. }
  1268. this.dataTransOpts.tableS.patient_register.id = ''
  1269. this.patientRegister.photo = '/pic/Photo.jpg'
  1270. this.patientRegister.patientRegisterId = '';
  1271. this.form.id = '';
  1272. this.form.patientId = '00000000-0000-0000-0000-000000000000';
  1273. this.form.patientRegisterNo = '';
  1274. this.form.patientNo = '';
  1275. this.form.medicalTimes = 1;
  1276. this.form.patientName = '';
  1277. this.form.photo = '';
  1278. this.form.completeFlag = '1'; //
  1279. // this.patientRegister.patientRegisterAbs.forEach(e => {
  1280. // e.id = '';
  1281. // e.patientRegisterId = '';
  1282. // e.isCharge = 'N';
  1283. // e.checkCompleteFlag = '0'
  1284. // e.isLock = 'N'
  1285. // });
  1286. // 触发明细项目复制
  1287. // setTimeout(() => {
  1288. // this.prAsbOpraOpts.copyNew++
  1289. // }, 10);
  1290. this.dataTransOpts.tableM.register_check_asbitem.forEach(e => {
  1291. delete e.id
  1292. e.patientRegisterId = ''
  1293. e.isCharge = 'N'
  1294. e.isLock = 'N'
  1295. });
  1296. // console.log('this.patientRegister.patientRegisterAbs',this.patientRegister.patientRegisterAbs)
  1297. this.$message.info({ showClose: true, message: "操作成功,请记得点保存"});
  1298. },
  1299. //删除
  1300. del() {
  1301. deletapi(
  1302. `/api/app/customer-org/${this.customerOrg.customerOrgRd.id}`
  1303. ).then((res) => {
  1304. console.log("删除 操作成功");
  1305. this.setData({ key: "customerOrg.customerOrgRd", value: { id: "" } });
  1306. this.getCustomerOrgTree();
  1307. });
  1308. },
  1309. //拍照(已废弃)
  1310. // openCamera() {
  1311. // if (!this.form.id) {
  1312. // alert("请先保存人员信息");
  1313. // return;
  1314. // }
  1315. // this.patientRegister.cameraVisble = true;
  1316. // },
  1317. //拍照(调壳程序)
  1318. photoGrah() {
  1319. if (!this.form.id) {
  1320. alert("请先保存人员信息");
  1321. return;
  1322. }
  1323. if (!this.$peisAPI) {
  1324. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  1325. return
  1326. }
  1327. this.$peisAPI.photoGrah()
  1328. .then(res => {
  1329. console.log('this.$peisAPI.photoGrah 原始返回结果', res)
  1330. let lres = JSON.parse(res)
  1331. if (lres.code > -1) {
  1332. let uploadPhoto = {
  1333. patientRegisterId: this.form.id,
  1334. photo: lres.data.Photo,
  1335. };
  1336. this.peoplePhoto = `data:image/${lres.data.PhotoFormat == 'jpg' ? 'jpeg' : lres.data.PhotoFormat};base64,${lres.data.Photo}`
  1337. this.patientRegister.photo = `data:image/${lres.data.PhotoFormat == 'jpg' ? 'jpeg' : lres.data.PhotoFormat};base64,${lres.data.Photo}`
  1338. return postapi(`/api/app/patient-register/up-load-img`, uploadPhoto)
  1339. } else {
  1340. this.$message.error({ showClose: true, message: "上传照片错误" + lres.code})
  1341. }
  1342. }).then(res => {
  1343. if (res && res.code > -1) {
  1344. let body = {
  1345. patientRegisterId: this.form.id,
  1346. photo: res.data,
  1347. };
  1348. console.log(body);
  1349. return postapi(`/api/app/patient-register/update-photo`, body);
  1350. }
  1351. }).then(res => {
  1352. if (res && res.code > -1) {
  1353. //console.log('拍照',res.data)
  1354. this.patientRegister.patientRegisterRd.photo = res.data.photo
  1355. console.log("操作成功");
  1356. }
  1357. }).catch(err => {
  1358. console.log('this.$peisAPI.photoGrah', err)
  1359. this.$message.error({ showClose: true, message: `照片操作错误 ${err}`})
  1360. })
  1361. },
  1362. getPeoplePhoto(photo) {
  1363. this.peoplePhoto = photoParse(photo)
  1364. },
  1365. // 打印指引单(isPreview)
  1366. async guidePrint(ReportCode, isPreview) {
  1367. if (this.form.id.length < 1) {
  1368. this.$message.info({ showClose: true, message: "人员信息尚未保存,不可执行此操作!"});
  1369. return;
  1370. }
  1371. if (!this.$peisAPI) {
  1372. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!"})
  1373. return
  1374. }
  1375. let token = window.sessionStorage.getItem('token');
  1376. let user = window.sessionStorage.getItem('user');
  1377. let toOutShell = {
  1378. ReportCode, token,
  1379. isBuildImage: 'N',
  1380. IsUploadPdf: 'N',
  1381. preViewCanPrint: 'N',
  1382. BusinessCode:this.form.id,
  1383. Parameters: [
  1384. { Name: 'printer', Value: user },
  1385. { Name: 'hisLog', Value: 'pic/hisLog.jpg' },
  1386. ],
  1387. };
  1388. if (isPreview) {
  1389. /*
  1390. postapi(`/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${this.form.id}`)
  1391. .then((res) => {
  1392. if (res.code != -1) {
  1393. toOutShell.ReportTable = res.data;
  1394. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  1395. return this.$peisAPI.printPre(JSON.stringify(toOutShell));
  1396. }
  1397. })
  1398. .catch(err => {
  1399. this.$message.warning({ showClose: true, message: err});
  1400. });
  1401. */
  1402. this.$peisAPI.printPre(JSON.stringify(toOutShell))
  1403. .then(res => {
  1404. console.log('this.$peisAPI.printPre',res)
  1405. if (JSON.parse(res).code < 0) {
  1406. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  1407. }
  1408. })
  1409. .catch((err) => {
  1410. console.log('打印指引单错误', err)
  1411. this.$message.warning({ showClose: true, message: `${err}` });
  1412. });
  1413. } else {
  1414. // postapi(`/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${this.form.id}`)
  1415. // .then((res) => {
  1416. // if (res.code != -1) {
  1417. // toOutShell.ReportTable = res.data;
  1418. // console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  1419. // return this.$peisAPI.print(JSON.stringify(toOutShell));
  1420. // }
  1421. // })
  1422. this.$peisAPI.print(JSON.stringify(toOutShell))
  1423. .then(res => {
  1424. if (JSON.parse(res).code < 0) {
  1425. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  1426. }else{
  1427. //更新打印次数
  1428. return postapi('/api/app/patientregister/updatepatientregisterguideprinttimesmany', [this.form.id])
  1429. }
  1430. })
  1431. .then(res => {
  1432. if (res && res.code > -1) {
  1433. let lfind = arrayExistObj(this.patientRegister.prList, 'id', this.form.id)
  1434. if (lfind > -1) {
  1435. if (this.patientRegister.prList[lfind].guidePrintTimes) {
  1436. this.patientRegister.prList[lfind].guidePrintTimes = Number(this.patientRegister.prList[lfind].guidePrintTimes) + 1;
  1437. } else {
  1438. this.patientRegister.prList[lfind].guidePrintTimes = 1;
  1439. }
  1440. }
  1441. }else{
  1442. this.$message.warning({ showClose: true, message: res.message});
  1443. }
  1444. })
  1445. .catch(err => {
  1446. this.$message.warning({ showClose: true, message: err});
  1447. });
  1448. }
  1449. },
  1450. //检验申请
  1451. async lisRequest() {
  1452. this.$message.warning({ showClose: true, message: '开发中……'});
  1453. /*
  1454. let isPrintLisRequest = false
  1455. let res = null
  1456. if (this.form.id.length < 1) {
  1457. this.$message.info({ showClose: true, message: "人员信息尚未保存,不可执行此操作!"});
  1458. return;
  1459. }
  1460. try {
  1461. res = await postapi(`/api/app/lisrequest/setlisrequest?PatientRegisterId=${this.form.id}`);
  1462. console.log(`/api/app/lisrequest/setlisrequest?PatientRegisterId=${this.form.id}`, res)
  1463. } catch (error) {
  1464. return;
  1465. }
  1466. if (res.code > -1) {
  1467. // this.$message.info("发送检验申请成功!");
  1468. isPrintLisRequest = true;
  1469. }
  1470. //重复申请,重打
  1471. if (res.code == -1 && res.message.indexOf('已申请') > -1) {
  1472. isPrintLisRequest = true;
  1473. }
  1474. if (!isPrintLisRequest) return;
  1475. try {
  1476. await this.$confirm("是否打印检验申请单?", "提示", {
  1477. confirmButtonText: "是",
  1478. cancelButtonText: "否",
  1479. type: "info",
  1480. showClose: false,
  1481. closeOnClickModal: false,
  1482. closeOnPressEscape: false,
  1483. });
  1484. } catch (error) {
  1485. return;
  1486. }
  1487. //打印检验申请单
  1488. this.lisPrint('0003', false);
  1489. */
  1490. },
  1491. //条码打印
  1492. lisPrint(ReportCode, isPreview) {
  1493. if (this.form.id.length < 1) {
  1494. this.$message.info({ showClose: true, message: "人员信息尚未保存,不可执行此操作!"});
  1495. return;
  1496. }
  1497. if (!this.$peisAPI) {
  1498. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!"})
  1499. return
  1500. }
  1501. let token = window.sessionStorage.getItem('token');
  1502. let user = window.sessionStorage.getItem('user');
  1503. let toOutShell = {
  1504. ReportCode, token,
  1505. isBuildImage: 'N',
  1506. IsUploadPdf: 'N',
  1507. BusinessCode:this.form.id,
  1508. Parameters: [
  1509. { Name: 'printer', Value: user },
  1510. { Name: 'hisLog', Value: 'pic/hisLog.jpg' },
  1511. ],
  1512. };
  1513. if (isPreview) {
  1514. this.$peisAPI.printPre(JSON.stringify(toOutShell))
  1515. .then(res => {
  1516. let lres = JSON.parse(res)
  1517. console.log('this.$peisAPI.printPre',lres)
  1518. if (lres.code < 0) {
  1519. console.log('打印检验条码错误',lres.message)
  1520. this.$message.warning({ showClose: true, message: lres.message });
  1521. }
  1522. })
  1523. .catch((err) => {
  1524. console.log('打印检验条码错误', err)
  1525. this.$message.warning({ showClose: true, message: `${err}` });
  1526. });
  1527. } else {
  1528. this.$peisAPI.print(JSON.stringify(toOutShell))
  1529. .then(res => {
  1530. let lres = JSON.parse(res)
  1531. if (res && lres.code > -1) {
  1532. return postapi('/api/app/lisrequest/updatelisrequestisprint', { operateType: 1, patientRegisterId: this.form.id })
  1533. }else{
  1534. this.$message.warning({ showClose: true, message: lres.message });
  1535. }
  1536. })
  1537. .then(res => {
  1538. if(res && res.code < 0){
  1539. this.$message.error({ showClose: true, message: `更新条码打印状态失败,原因:${res.message}` });
  1540. }
  1541. })
  1542. .catch(err => {
  1543. this.$message.warning({ showClose: true, message: `${err}`});
  1544. });
  1545. }
  1546. },
  1547. //补打条码
  1548. reLisRequest() {
  1549. if (this.form.id.length < 1) {
  1550. this.$message.info({ showClose: true, message: "人员信息尚未保存,不可执行此操作!"});
  1551. return;
  1552. }
  1553. this.brushTimes++;
  1554. this.patientRegister.lisRequestVisble = true;
  1555. },
  1556. //手动合并项目
  1557. reMergeAsbitem() {
  1558. if (this.form.id.length < 1) {
  1559. this.$message.info({ showClose: true, message: "人员信息尚未保存,不可执行此操作!"});
  1560. return;
  1561. }
  1562. this.brushTimes++;
  1563. this.patientRegister.mergeAsbitemVisble = true;
  1564. },
  1565. async toCharge(patientRegisterNo) {
  1566. if (!patientRegisterNo) {
  1567. this.$message.warning({ showClose: true, message: "请先保存人员信息!"})
  1568. return
  1569. }
  1570. let chargeMoney = Number(0)
  1571. //支付方式,比如是0自费、2免费、1单位支付
  1572. this.dataTransOpts.tableM.register_check_asbitem.forEach(e => {
  1573. if (e.payTypeFlag == '0' && e.isCharge == 'N') chargeMoney += Number(e.total)
  1574. });
  1575. if (chargeMoney == 0) {
  1576. this.$message.warning({ showClose: true, message: '没有可收费的记录!' })
  1577. return
  1578. }
  1579. // try {
  1580. // let res = await proApi.getPrAsb(this.form.id)
  1581. // if (res.code == -1) {
  1582. // this.$message.warning(`操作失败,原因:${res.message}`)
  1583. // return
  1584. // }
  1585. // } catch (error) {
  1586. // this.$message.warning(`操作失败,原因:${error}`)
  1587. // return
  1588. // }
  1589. //多次重复点击时,刷新处理
  1590. this.chargePatientRegisterNo = patientRegisterNo
  1591. setTimeout(() => {
  1592. this.dataTransOpts.refresh.charge.S++
  1593. }, 10)
  1594. this.dialogWin.charge = true
  1595. },
  1596. //关闭收费窗口时,刷新收费状态信息
  1597. closeDialogCharge() {
  1598. // this.prAsbOpraOpts.prAsbQuery++
  1599. this.dataTransOpts.refresh.register_check_asbitem.D++
  1600. },
  1601. //触发人员信息保存(更新)
  1602. triggerHeadSave() {
  1603. //id不为空则编辑 api/patientregister/updatepatientregister
  1604. let body = this.madePrBody()
  1605. // console.log(`/api/patientregister/updatepatientregister?PatientRegisterId=${this.form.id}`, body);
  1606. postapi(`/api/patientregister/updatepatientregister?PatientRegisterId=${this.form.id}`, body).then((res) => {
  1607. if (res.code != -1) {
  1608. console.log("操作成功");
  1609. //一般读身份证照片时,会出现这种情况
  1610. if (this.patientRegister.photo && this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(this.form.id, this.patientRegister.photo);
  1611. objCopy(this.form, this.patientRegister.patientRegisterRd);
  1612. this.refreshRegister(Object.assign({}, this.form))
  1613. }
  1614. });
  1615. },
  1616. // 新增保存基本信息产生新的ID,等明细保存后,再更新表单form.id
  1617. refreshFormId() {
  1618. console.log('refreshFormId', this.prAsbOpraOpts.formId)
  1619. this.form.id = this.prAsbOpraOpts.formId
  1620. this.prAsbOpraOpts.formId = '' //清空
  1621. /**/
  1622. // this.patientRegister.prList.push(res.data); //列表添加记录
  1623. this.patientRegister.patientRegisterId = this.form.id;
  1624. objCopy(this.form, this.patientRegister.patientRegisterRd);
  1625. //this.patientRegister.query.times++; 不在触发列表查询(换成局部刷新)放在窗口关闭事件中去
  1626. // let curRow = deepCopy(this.patientRegister.patientRegisterRd)
  1627. // curRow.index = this.patientRegister.prList.length
  1628. // this.patientRegister.prList.push(curRow)
  1629. },
  1630. //回车替代tab键
  1631. enterToTab() {
  1632. this.$nextTick(() => {
  1633. let inputs = document.querySelectorAll("form input"); //用数组可以读取多个标签的元素 //.inline-input
  1634. //console.log('inputs',inputs);
  1635. // 为每个输入框添加键盘事件监听器
  1636. inputs.forEach((input, i) => {
  1637. input.addEventListener('keydown', (event) => {
  1638. // 如果按下的是回车键
  1639. // console.log('data-ismultiline',input.getAttribute('data-ismultiline'));
  1640. if (event.keyCode === 13) {
  1641. // 阻止回车键的默认行为(换行)
  1642. event.preventDefault();
  1643. // 跳至下一个输入框
  1644. for (let j = i + 1; j < inputs.length; j++) {
  1645. if (inputs[j].getAttribute('disabled') != "disabled") {
  1646. inputs[j].focus();
  1647. break;
  1648. }
  1649. }
  1650. }
  1651. });
  1652. });
  1653. });
  1654. },
  1655. },
  1656. //监听事件
  1657. watch: {
  1658. //人员ID未切换换时 也可以强制刷新数据
  1659. "dataTransOpts.refresh.patient_register.S": {
  1660. // immediate: true,
  1661. handler(newVal, oldVal) {
  1662. console.log(`watch 人员登记 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.dataTransOpts.tableS.patient_register.id}`);
  1663. if (newVal != oldVal) this.initFormData(this.dataTransOpts.tableS.patient_register.id)
  1664. }
  1665. },
  1666. //拍照触发
  1667. // "form.photo"(newVal, oldVal) {
  1668. // //console.log('patientRegister.patientRegisterRd.id newVal:',newVal,' oldVal:',oldVal)
  1669. // if (newVal != oldVal) {
  1670. // this.getPeoplePhoto(newVal)
  1671. // }
  1672. // },
  1673. //修改单位触发
  1674. // "form.customerOrgId": {
  1675. // // immediate:true,
  1676. // // // deep:true,
  1677. // handler(newVal, oldVal) {
  1678. // //console.log('patientRegister.patientRegisterRd.id newVal:',newVal,' oldVal:',oldVal)
  1679. // if (newVal != oldVal) {
  1680. // this.changeCustomerOrgId(newVal)
  1681. // }
  1682. // }
  1683. // },
  1684. // 从体检人员登记列表 点登记,触发
  1685. // 清空查询条件
  1686. "dataTransOpts.plus.clearPatientRegisterQuery": {
  1687. immediate: true,
  1688. handler(newVal, oldVal) {
  1689. console.log('从体检人员登记列表 点登记,触发', newVal, oldVal)
  1690. if (newVal != oldVal) {
  1691. this.preCustomerOrgId = this.patientRegister.query.customerOrgId
  1692. console.log('this.preCustomerOrgId', this.preCustomerOrgId)
  1693. }
  1694. }
  1695. },
  1696. },
  1697. };
  1698. </script>
  1699. <style scoped>
  1700. .btn {
  1701. margin-top: 5px;
  1702. }
  1703. .commonbutton {
  1704. width: 100px;
  1705. }
  1706. .query {
  1707. margin-left: 10px;
  1708. }
  1709. .querySpan {
  1710. margin-right: 2px;
  1711. }
  1712. </style>