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.

299 lines
11 KiB

3 years ago
  1. <template>
  2. <div>
  3. <div style="display: flex">
  4. <el-table :data="dataList" border width="100%" height="700" row-key="id" size="small"
  5. highlight-current-row ref="dataList"
  6. @selection-change="handleSelectionChange">
  7. <el-table-column type="selection" width="40"/>
  8. <el-table-column prop="isMedicalStart" label="签到" width="50">
  9. <template slot-scope="scope">
  10. <el-checkbox :value="scope.row.isMedicalStart == 'Y'" />
  11. </template>
  12. </el-table-column>
  13. <el-table-column prop="medicalStartDate" label="签到日期" width="90">
  14. <template slot-scope="scope">
  15. <div>{{ lmoment(scope.row.medicalStartDate, "yyyy-MM-DD") }}</div>
  16. </template>
  17. </el-table-column>
  18. <el-table-column prop="completeFlag" label="体检进度">
  19. <template slot-scope="scope">
  20. <div>{{ ldddw(dict.completeFlag, "id", scope.row.completeFlag, "displayName") }}</div>
  21. </template>
  22. </el-table-column>
  23. <el-table-column prop="isLock" label="锁住" width="50">
  24. <template slot-scope="scope">
  25. <div>{{ scope.row.isLock == "Y" ? "是" : "否" }}</div>
  26. </template>
  27. </el-table-column>
  28. <el-table-column prop="customerOrgParentName" label="单位" width="180">
  29. <template slot-scope="scope">
  30. <div>{{ scope.row.customerOrgParentName ? scope.row.customerOrgParentName : scope.row.customerOrgName }}</div>
  31. </template>
  32. </el-table-column>
  33. <el-table-column prop="customerOrgName" label="部门" width="180">
  34. <template slot-scope="scope">
  35. <div>{{ scope.row.customerOrgParentName ? scope.row.customerOrgName : "" }}</div>
  36. </template>
  37. </el-table-column>
  38. <el-table-column prop="patientName" label="姓名" />
  39. <el-table-column prop="sexId" label="性别">
  40. <template slot-scope="scope">
  41. <div>{{ ldddw(dict.sex, "id", scope.row.sexId, "displayName") }}</div>
  42. </template>
  43. </el-table-column>
  44. <el-table-column prop="age" label="年龄" />
  45. <el-table-column prop="patientRegisterNo" label="条码号" width="150" />
  46. <el-table-column prop="patientNo" label="档案号" />
  47. <el-table-column prop="medicalTimes" label="体检次数"></el-table-column>
  48. <el-table-column label="分组/套餐" width="150">
  49. <template slot-scope="scope">
  50. <div v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId === dict.personOrgId">
  51. {{ ldddw(dict.medicalPackage, "id", scope.row.medicalPackageId, "displayName") }}
  52. </div>
  53. <div v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId !== dict.personOrgId">
  54. {{ ldddw(dict.customerOrgGroupAll, "id", scope.row.customerOrgGroupId, "displayName") }}
  55. </div>
  56. </template>
  57. </el-table-column>
  58. <el-table-column prop="nationId" label="民族">
  59. <template slot-scope="scope">
  60. <div>
  61. {{ ldddw(dict.nation, "id", scope.row.nationId, "displayName") }}
  62. </div>
  63. </template>
  64. </el-table-column>
  65. <el-table-column prop="idNo" label="身份证" width="150" />
  66. <el-table-column prop="birthDate" label="出生日期" width="100">
  67. <template slot-scope="scope">
  68. <div v-if="scope.row.birthDate">
  69. {{ lmoment(scope.row.birthDate, "yyyy-MM-DD") }}
  70. </div>
  71. </template>
  72. </el-table-column>
  73. <el-table-column prop="email" label="邮箱" width="100" />
  74. <el-table-column prop="mobileTelephone" label="手机" width="100" />
  75. <el-table-column prop="telephone" label="电话" width="100" />
  76. <el-table-column prop="address" label="地址" width="300" />
  77. <el-table-column prop="medicalCardNo" label="体检卡号" />
  78. <el-table-column prop="jobCardNo" label="工卡号" />
  79. <el-table-column prop="maritalStatusId" label="婚姻状况">
  80. <template slot-scope="scope">
  81. <div>
  82. {{ ldddw(dict.maritalStatus, "id", scope.row.maritalStatusId, "displayName") }}
  83. </div>
  84. </template>
  85. </el-table-column>
  86. <el-table-column prop="medicalTypeId" label="体检类别">
  87. <template slot-scope="scope">
  88. <div v-if="scope.row.medicalTypeId !== dict.personOrgId">
  89. {{ ldddw(dict.medicalType, "id", scope.row.medicalTypeId, "displayName") }}
  90. </div>
  91. </template>
  92. </el-table-column>
  93. <el-table-column prop="personnelTypeId" label="人员类别">
  94. <template slot-scope="scope">
  95. <div v-if="scope.row.personnelTypeId !== dict.personOrgId">
  96. {{ ldddw(dict.personnelType, "id", scope.row.personnelTypeId, "displayName") }}
  97. </div>
  98. </template>
  99. </el-table-column>
  100. <el-table-column prop="jobPost" label="职务" />
  101. <el-table-column prop="jobTitle" label="职称" />
  102. <el-table-column prop="salesman" label="介绍人" />
  103. <el-table-column prop="isVip" label="是否VIP">
  104. <template slot-scope="scope">
  105. <div>{{ scope.row.isVip == "Y" ? "是" : "否" }}</div>
  106. </template>
  107. </el-table-column>
  108. <el-table-column prop="creatorName" label="登记人" />
  109. <el-table-column prop="creationTime" label="登记日期" width="100">
  110. <template slot-scope="scope">
  111. <div>{{ lmoment(scope.row.creationTime, "yyyy-MM-DD") }}</div>
  112. </template>
  113. </el-table-column>
  114. <el-table-column prop="isUpload" label="是否上传">
  115. <template slot-scope="scope">
  116. <div>{{ scope.row.isUpload == "Y" ? "是" : "否" }}</div>
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. <div style="margin-left: 10px">
  121. <div class="listBtn">
  122. <el-button type="success" @click="sign">签到</el-button>
  123. </div>
  124. <div class="listBtn">
  125. <el-button type="primary" @click="scanSign">扫码签到</el-button>
  126. </div>
  127. </div>
  128. </div>
  129. <el-dialog title="扫/输入条码签到" :visible.sync="dialogVisible">
  130. <el-form :model="form">
  131. <el-form-item label="条码" label-width="100px">
  132. <el-input v-model="form.patientRegisterNo" @change="signByPatientRegisterNo"></el-input>
  133. </el-form-item>
  134. </el-form>
  135. <div slot="footer" class="dialog-footer">
  136. <el-button @click="dialogVisible = false">关闭</el-button>
  137. <el-button type="primary" @click="signByPatientRegisterNo">确定</el-button>
  138. </div>
  139. </el-dialog>
  140. </div>
  141. </template>
  142. <script>
  143. import moment from "moment";
  144. import { mapState, mapActions } from "vuex";
  145. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  146. import { dddw, objCopy, arrayReduce } from "@/utlis/proFunc";
  147. import PatientRegisterEdit from "../../components/patientRegister/PatientRegisterEdit.vue";
  148. import Camera from "../../components/patientRegister/Camera.vue";
  149. export default {
  150. components: {
  151. PatientRegisterEdit,
  152. Camera,
  153. },
  154. data() {
  155. return {
  156. dataList: [], //列表数据
  157. multipleSelection: [], //选中的数据列表
  158. dialogVisible: false,
  159. form:{
  160. patientRegisterNo:''
  161. }
  162. };
  163. },
  164. created() { },
  165. //挂载完成
  166. mounted() { },
  167. computed: {
  168. ...mapState(["dict", "patientRegister", "customerOrg"]),
  169. },
  170. methods: {
  171. ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
  172. handleSelectionChange(val) {
  173. this.multipleSelection = val;
  174. },
  175. signCore(body){
  176. postapi(`/api/app/patientregister/updatesigninmany`, body)
  177. .then((res) => {
  178. if (res.code != -1){
  179. this.$message.success("操作成功");
  180. }
  181. })
  182. .catch(() => {
  183. this.$message({type: "error",message: "已取消删除",});
  184. });
  185. },
  186. //选中人员签到
  187. sign() {
  188. if (!this.multipleSelection || this.multipleSelection.length < 1 ) {
  189. alert("请选择体检人员,再进行此操作");
  190. return;
  191. }
  192. let body = []
  193. this.multipleSelection.forEach(e =>{
  194. body.push(e.id)
  195. });
  196. this.signCore(body)
  197. },
  198. scanSign(){
  199. this.dialogVisible = true
  200. },
  201. //按条码号查个人数据
  202. signByPatientRegisterNo() {
  203. let val = this.form.patientRegisterNo
  204. console.log(`/api/app/patient-register/patient-register-or-patient?SType=1&PatientRegisterNo=${val}`)
  205. getapi(`/api/app/patient-register/patient-register-or-patient?SType=1&PatientRegisterNo=${val}`)
  206. .then((res) => {
  207. if (res.code != -1) {
  208. if(res.data){
  209. this.signCore([res.data.id])
  210. this.form.patientRegisterNo = ''
  211. }
  212. }
  213. });
  214. },
  215. ldddw(arrayData, key, value, display) {
  216. return dddw(arrayData, key, value, display);
  217. },
  218. lmoment(date, forMat) {
  219. return moment(new Date(date)).format(forMat);
  220. },
  221. //查询
  222. query() {
  223. let body = {}
  224. console.log(`this.patientRegister.query`, this.patientRegister.query)
  225. if (this.patientRegister.query.customerOrgFlag) {
  226. if (this.patientRegister.query.CustomerOrgParentId) {
  227. body.customerOrgId = this.patientRegister.query.CustomerOrgParentId
  228. } else{
  229. if (this.patientRegister.query.customerOrgId) body.customerOrgId = this.patientRegister.query.customerOrgId
  230. }
  231. }
  232. if (this.patientRegister.query.sex) body.sexId = this.patientRegister.query.sex
  233. if (this.patientRegister.query.patientName) body.patientName = this.patientRegister.query.patientName
  234. if (this.patientRegister.query.completeFlag) body.completeFlag = this.patientRegister.query.completeFlag
  235. //StartDate EndDate
  236. if (this.patientRegister.query.dateRange) {
  237. body.startDate = moment(new Date(this.patientRegister.query.dateRange[0])).format("yyyy-MM-DD")
  238. body.endDate = moment(new Date(this.patientRegister.query.dateRange[1])).format("yyyy-MM-DD")
  239. }
  240. if (this.patientRegister.query.idCardNo) body = { idNo: this.patientRegister.query.idCardNo }
  241. if (this.patientRegister.query.patientNo) body = { patientNo: this.patientRegister.query.patientNo }
  242. if (this.patientRegister.query.patientRegisterNo) body = { patientRegisterNo: this.patientRegister.query.patientRegisterNo }
  243. console.log('/api/app/patientregister/getlistinfilter', body)
  244. postapi('/api/app/patientregister/getlistinfilter', body)
  245. .then((res) => {
  246. this.dataList = res.data;
  247. });
  248. },
  249. },
  250. //监听事件
  251. watch: {
  252. //触发查询事件
  253. "patientRegister.query.times"(newVal, oldVal) {
  254. if (newVal != oldVal) {
  255. //alert('触发查询事件')
  256. this.query();
  257. }
  258. },
  259. },
  260. };
  261. </script>
  262. <style scoped>
  263. .box {
  264. display: flex;
  265. }
  266. .listBtn {
  267. margin-top: 10px;
  268. }
  269. </style>