CrbBaseInfo.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <div class="layout_container">
  3. <header>
  4. <el-input v-model.trim="codeRs" class="w-50 m-2" style="width: 280px" placeholder="请输入工号" clearable>
  5. <template #prepend>工号</template>
  6. </el-input>
  7. <el-input v-model.trim="xm" class="w-50 m-2" style="width: 280px; margin-left: 3px" placeholder="请输入姓名" clearable>
  8. <template #prepend>姓名</template>
  9. </el-input>
  10. <el-input v-model.trim="idCard" class="w-50 m-2" style="width: 280px; margin-left: 3px" placeholder="请输入身份证号码" clearable>
  11. <template #prepend>身份证号码</template>
  12. </el-input>
  13. <el-input v-model.trim="deptName" class="w-50 m-2" style="width: 280px; margin-left: 3px" placeholder="请输入科室名称" clearable>
  14. <template #prepend>科室名称</template>
  15. </el-input>
  16. <el-divider direction="vertical" />
  17. <el-button type="primary" icon="Search" @click="queryBaseInfo" style="margin-left: 5px">查询</el-button>
  18. </header>
  19. <div class="layout_main">
  20. <el-tabs class="el-tabs__fill" v-model="editableTabsValue" type="border-card" @tab-click="handleClick">
  21. <el-tab-pane key="baseUser" label="用户上传" name="baseUser">
  22. <div class="layout_display_flex_y">
  23. <div class="layout_flex_1-y">
  24. <el-table :data="baseUserData.slice(pageSize * (currentPage - 1), pageSize * currentPage)" border
  25. stripe highlight-current-row height="100%">
  26. <el-table-column type="index" label="序号" width="50" fixed/>
  27. <el-table-column prop="id" label="账号" width="100" />
  28. <el-table-column prop="loginName" label="工号" width="100"/>
  29. <el-table-column prop="orgCode" label="所属机构" width="100" />
  30. <el-table-column prop="deptCode" label="所属科室" width="100" />
  31. <el-table-column prop="userName" label="姓名" width="100" />
  32. <el-table-column prop="idCardTypeCode" label="身份证件类别" width="120"/>
  33. <el-table-column prop="idCard" label="身份证件号码" width="180" >
  34. <template #default="scope">
  35. {{scope.row.idCard.replace(reg, '\$1******\$2')}}
  36. </template>
  37. </el-table-column>
  38. <el-table-column prop="tel" label="联系电话" width="180">
  39. <template #default="scope">
  40. {{scope.row.tel.replace(reg1, '\$1****\$2')}}
  41. </template>
  42. </el-table-column>
  43. <el-table-column prop="physicianNo" label="医师执业资格证号" width="180"/>
  44. <el-table-column prop="userTypeCode" label="用户类型" width="100"/>
  45. <el-table-column fixed="right" label="操作" min-width="80" width="80" center>
  46. <template #default="scope">
  47. <el-button type="primary" size="small" @click="uploadBaseUser(scope.row)">上传</el-button>
  48. </template>
  49. </el-table-column>
  50. </el-table>
  51. </div>
  52. <div>
  53. <el-pagination :current-page="currentPage" :page-size="pageSize" :page-sizes="[10, 15, 20, 25]"
  54. :total="baseUserData.length" layout="total, sizes, prev, pager, next, jumper"
  55. style="margin-top: 5px" @size-change="handleSizeChange"
  56. @current-change="handleCurrentChange">
  57. </el-pagination>
  58. </div>
  59. </div>
  60. </el-tab-pane>
  61. <el-tab-pane key="baseDept" label="科室上传" name="baseDept">
  62. <div class="layout_display_flex_y">
  63. <div class="layout_flex_1-y">
  64. <el-table :data="baseDeptData.slice(pageSizeDept * (currentPageDept - 1), pageSizeDept * currentPageDept)" border
  65. stripe highlight-current-row height="100%">
  66. <el-table-column type="index" label="序号" width="50" />
  67. <el-table-column prop="deptCode" label="院内科室代码" width="180" />
  68. <el-table-column prop="deptName" label="院内科室名称" width="280" />
  69. <el-table-column prop="targetDeptCode" label="前置软件科室代码" width="180" />
  70. <el-table-column prop="targetDeptName" label="前置软件科室名称" width="280" />
  71. <el-table-column fixed="right" label="操作" min-width="80" width="80" center>
  72. <template #default="scope">
  73. <el-button type="primary" size="small" @click="uploadBaseDept(scope.row)">上传</el-button>
  74. </template>
  75. </el-table-column>
  76. </el-table>
  77. </div>
  78. <div>
  79. <el-pagination :current-page="currentPageDept" :page-size="pageSizeDept" :page-sizes="[10, 15, 20, 25]"
  80. :total="baseDeptData.length" layout="total, sizes, prev, pager, next, jumper"
  81. style="margin-top: 5px" @size-change="handleSizeChangeDept"
  82. @current-change="handleCurrentChangeDept">
  83. </el-pagination>
  84. </div>
  85. </div>
  86. </el-tab-pane>
  87. </el-tabs>
  88. </div>
  89. </div>
  90. </template>
  91. <script setup name="CrbBaseInfo">
  92. import {nextTick, onMounted, ref} from "vue";
  93. import {
  94. selectBaseDept,
  95. selectBaseUser,
  96. uploadBaseDeptData,
  97. uploadBaseUserData
  98. } from "@/api/crb-manage/crb-base-info.js";
  99. import {ElMessage, ElMessageBox} from "element-plus";
  100. import {updateMzDrugCodgData} from "@/api/yp-codg/yp-codg-match.js";
  101. const codeRs = ref('')
  102. const xm = ref('')
  103. const idCard = ref('')
  104. const deptName = ref('')
  105. const editableTabsValue = ref("baseUser")
  106. const baseUserData = ref([])
  107. const pageSize = ref(20)
  108. const currentPage = ref(1)
  109. const handleSizeChange = (val) => {
  110. pageSize.value = val
  111. }
  112. const handleCurrentChange = (val) => {
  113. currentPage.value = val
  114. }
  115. const baseDeptData = ref([])
  116. const pageSizeDept = ref(20)
  117. const currentPageDept = ref(1)
  118. const handleSizeChangeDept = (val) => {
  119. pageSizeDept.value = val
  120. }
  121. const handleCurrentChangeDept = (val) => {
  122. currentPageDept.value = val
  123. }
  124. const reg = /^(.{6})\d+(.{4})$/
  125. const reg1 = /^(1[3-9][0-9])\d{4}(\d{4}$)/
  126. onMounted(() => {
  127. nextTick(() => {
  128. queryBaseUser()
  129. })
  130. })
  131. const handleClick = (tab, event) => {
  132. // 查询哪个tab页面
  133. editableTabsValue.value = tab.props.name;
  134. if (editableTabsValue.value === "baseUser") {
  135. queryBaseUser()
  136. } if(editableTabsValue.value === "baseDept"){
  137. queryBaseDept()
  138. }
  139. }
  140. const queryBaseInfo = () => {
  141. if (editableTabsValue.value === "baseUser") {
  142. queryBaseUser()
  143. } if(editableTabsValue.value === "baseDept"){
  144. queryBaseDept()
  145. }
  146. }
  147. const userInfo = ref({
  148. loginName: '', // 工号
  149. userName: '', // 姓名
  150. idCard: '', // 身份证号码
  151. })
  152. //查询用户信息
  153. const queryBaseUser = () => {
  154. userInfo.value.loginName = codeRs.value
  155. userInfo.value.userName = xm.value
  156. userInfo.value.idCard = idCard.value
  157. selectBaseUser(userInfo.value).then((res) => {
  158. baseUserData.value = res
  159. })
  160. }
  161. // 上传用户信息
  162. const uploadBaseUser = (row) => {
  163. ElMessageBox.confirm('确定上传用户信息?', {
  164. cancelButtonText: '取消',
  165. confirmButtonText: '确定',
  166. type: 'warning',
  167. distinguishCancelAndClose: true,
  168. dangerouslyUseHTMLString: true
  169. }).then(() => {
  170. uploadBaseUserData(row).then((res) => {
  171. ElMessage({
  172. type: "success",
  173. message: "用户信息上传成功!",
  174. duration: 2500,
  175. showClose: true,
  176. });
  177. })
  178. }).catch((action) => {
  179. if (action === 'cancel') {
  180. console.log("已取消。。。")
  181. }
  182. })
  183. }
  184. const deptInfo = ref({
  185. deptCode: '',
  186. deptName: '',
  187. })
  188. //查询科室信息
  189. const queryBaseDept = () => {
  190. deptInfo.value.deptName = deptName.value
  191. selectBaseDept(deptInfo.value).then((res) => {
  192. baseDeptData.value = res
  193. })
  194. }
  195. // 上传科室信息
  196. const uploadBaseDept = (row) => {
  197. ElMessageBox.confirm('确定上传科室信息?', {
  198. cancelButtonText: '取消',
  199. confirmButtonText: '确定',
  200. type: 'warning',
  201. distinguishCancelAndClose: true,
  202. dangerouslyUseHTMLString: true
  203. }).then(() => {
  204. uploadBaseDeptData(row).then((res) => {
  205. ElMessage({
  206. type: "success",
  207. message: "科室信息上传成功!",
  208. duration: 2500,
  209. showClose: true,
  210. });
  211. })
  212. }).catch((action) => {
  213. if (action === 'cancel') {
  214. console.log("已取消。。。")
  215. }
  216. })
  217. }
  218. </script>