index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-row>
  5. <el-col :span="8">
  6. <el-form-item label="身份证号" prop="idCard">
  7. <el-input
  8. v-model="queryParams.idCard"
  9. placeholder="请输入身份证号码"
  10. style="width: 100%;"
  11. clearable
  12. @keyup.enter.native="handleQuery"
  13. />
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="8">
  17. <el-form-item label="人群分类" prop="focusCrowdStyle">
  18. <el-select style="width: 108%;" filterable v-model="queryParams.focusCrowdStyle" placeholder="请选择人群分类">
  19. <el-option
  20. v-for="dict in dict.type.classification_population"
  21. :key="dict.label"
  22. :label="dict.label"
  23. :value="dict.label"
  24. ></el-option>
  25. </el-select>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :span="8">
  29. <el-form-item label="采集时间" prop="nucleicCollectTime">
  30. <el-date-picker clearable
  31. v-model="queryParams.nucleicCollectTime"
  32. type="datetime"
  33. value-format="yyyy-MM-dd HH:mm:ss"
  34. format="yyyy-MM-dd HH:mm:ss"
  35. style="width: 100%;"
  36. placeholder="请选择核酸采集时间">
  37. </el-date-picker>
  38. </el-form-item>
  39. </el-col>
  40. <el-col :span="24">
  41. <el-col :span="8">
  42. <el-form-item :label="'姓' + '\u3000\u3000' + '名'" prop="name">
  43. <el-input
  44. v-model="queryParams.name"
  45. placeholder="请输入姓名"
  46. style="width: 100%;"
  47. clearable
  48. @keyup.enter.native="handleQuery"
  49. />
  50. </el-form-item>
  51. </el-col>
  52. <el-col :span="8">
  53. <el-form-item label="采集地点" prop="collectPlace">
  54. <el-input
  55. v-model="queryParams.collectPlace"
  56. placeholder="请输入采集地点"
  57. clearable
  58. style="width: 108%;"
  59. @keyup.enter.native="handleQuery"
  60. />
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="8">
  64. <el-form-item label="结果时间" prop="nucleicResultsTime">
  65. <el-date-picker clearable
  66. v-model="queryParams.nucleicResultsTime"
  67. type="datetime"
  68. value-format="yyyy-MM-dd HH:mm:ss"
  69. format="yyyy-MM-dd HH:mm:ss"
  70. style="width: 100%;"
  71. placeholder="请选择核酸结果时间">
  72. </el-date-picker>
  73. </el-form-item>
  74. </el-col>
  75. </el-col>
  76. <el-col :span="8">
  77. <el-form-item label="联系号码" prop="phoneNum">
  78. <el-input
  79. v-model="queryParams.phoneNum"
  80. placeholder="请输入联系号码"
  81. style="width: 100%;"
  82. clearable
  83. @keyup.enter.native="handleQuery"
  84. />
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="8">
  88. <el-form-item label="开始时间" prop="startTime">
  89. <el-date-picker clearable
  90. v-model="queryParams.startTime"
  91. type="datetime"
  92. value-format="yyyy-MM-dd HH:mm:ss"
  93. format="yyyy-MM-dd HH:mm:ss"
  94. style="width: 100%;"
  95. placeholder="请选择比对开始时间">
  96. </el-date-picker>
  97. </el-form-item>
  98. </el-col>
  99. <el-col :span="8">
  100. <el-form-item label="结束时间" prop="endTime">
  101. <el-date-picker clearable
  102. v-model="queryParams.endTime"
  103. type="datetime"
  104. value-format="yyyy-MM-dd HH:mm:ss"
  105. format="yyyy-MM-dd HH:mm:ss"
  106. style="width: 100%;"
  107. placeholder="请选择比对结束时间">
  108. </el-date-picker>
  109. </el-form-item>
  110. </el-col>
  111. <el-col :span="24">
  112. <el-col :span="8">
  113. <el-form-item label="职业类别" prop="jobStyle">
  114. <el-select filterable v-model="queryParams.jobStyle" placeholder="请选择职业类别">
  115. <el-option
  116. v-for="dict in dict.type.occupational_category "
  117. :key="dict.label"
  118. :label="dict.label"
  119. :value="dict.label"
  120. ></el-option>
  121. </el-select>
  122. </el-form-item>
  123. </el-col>
  124. <el-form-item>
  125. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  126. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  127. </el-form-item>
  128. </el-col>
  129. </el-row>
  130. </el-form>
  131. <el-row :gutter="10" class="mb8">
  132. <el-col :span="20">
  133. <div style="color: #343434; font-size: 20px;">截至 <span style="color: #00b385;">2022年08月14日</span> 止 共计 <span style="color: #00b385;">33256</span> 次核酸</div>
  134. </el-col>
  135. <el-col :span="1.5">
  136. <el-button
  137. type="info"
  138. plain
  139. icon="el-icon-upload2"
  140. size="mini"
  141. @click="handleImport"
  142. v-hasPermi="['system:info:import']"
  143. >导入</el-button>
  144. </el-col>
  145. <el-col :span="1.5">
  146. <el-button
  147. type="warning"
  148. plain
  149. icon="el-icon-download"
  150. size="mini"
  151. @click="handleExport"
  152. v-hasPermi="['system:info:export']"
  153. >导出</el-button>
  154. </el-col>
  155. <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
  156. </el-row>
  157. <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
  158. <el-table-column label="姓名" align="center" prop="name" width="110"/>
  159. <el-table-column label="性别" align="center" prop="gender" />
  160. <el-table-column label="年龄" align="center" prop="age" />
  161. <el-table-column label="身份证号码" align="center" prop="idCard" width="180"/>
  162. <el-table-column label="联系号码" align="center" prop="phoneNum" width="110"/>
  163. <el-table-column label="核酸采集时间" align="center" prop="nucleicCollectTime" width="102">
  164. <template slot-scope="scope">
  165. <span>{{ scope.row.nucleicCollectTime }}</span>
  166. </template>
  167. </el-table-column>
  168. <el-table-column label="核酸结果时间" align="center" prop="nucleicResultsTime" width="102">
  169. <template slot-scope="scope">
  170. <span>{{ scope.row.nucleicResultsTime}}</span>
  171. </template>
  172. </el-table-column>
  173. <el-table-column label="职业类别" align="center" prop="jobStyle" />
  174. <el-table-column label="重点人群分类" align="center" prop="focusCrowdStyle" width="130"/>
  175. <el-table-column label="检测频次" align="center" prop="detectionFrequency" />
  176. <el-table-column label="比对开始时间" align="center" prop="startTime" width="102">
  177. <template slot-scope="scope">
  178. <span>{{ scope.row.startTime}}</span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="比对结束时间" align="center" prop="endTime" width="102">
  182. <template slot-scope="scope">
  183. <span>{{ scope.row.endTime}}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="是否异常" align="center" prop="detectionFrequency" />
  187. </el-table>
  188. <pagination
  189. v-show="total>0"
  190. :total="total"
  191. :page.sync="queryParams.pageNum"
  192. :limit.sync="queryParams.pageSize"
  193. @pagination="getList"
  194. />
  195. <!-- 添加或修改导入人员信息对话框 -->
  196. <!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  197. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  198. <el-form-item label="姓名" prop="name">
  199. <el-input v-model="form.name" placeholder="请输入姓名" />
  200. </el-form-item>
  201. <el-form-item label="性别" prop="gender">
  202. <el-input v-model="form.gender" placeholder="请输入性别" />
  203. </el-form-item>
  204. <el-form-item label="年龄" prop="age">
  205. <el-input v-model="form.age" placeholder="请输入年龄" />
  206. </el-form-item>
  207. <el-form-item label="身份证号码" prop="idCard">
  208. <el-input v-model="form.idCard" placeholder="请输入身份证号码" />
  209. </el-form-item>
  210. <el-form-item label="联系号码" prop="phoneNum">
  211. <el-input v-model="form.phoneNum" placeholder="请输入联系号码" />
  212. </el-form-item>
  213. <el-form-item label="检测频次" prop="detectionNumber">
  214. <el-input v-model="form.detectionNumber" placeholder="请输入检测频次" />
  215. </el-form-item>
  216. <el-form-item label="检测频次" prop="detectionScope">
  217. <el-input v-model="form.detectionScope" placeholder="请输入检测频次" />
  218. </el-form-item>
  219. <el-form-item label="比对开始时间" prop="startTime">
  220. <el-date-picker clearable
  221. v-model="form.startTime"
  222. type="date"
  223. value-format="yyyy-MM-dd"
  224. placeholder="请选择比对开始时间">
  225. </el-date-picker>
  226. </el-form-item>
  227. <el-form-item label="比对结束时间" prop="endTime">
  228. <el-date-picker clearable
  229. v-model="form.endTime"
  230. type="date"
  231. value-format="yyyy-MM-dd"
  232. placeholder="请选择比对结束时间">
  233. </el-date-picker>
  234. </el-form-item>
  235. </el-form>
  236. <div slot="footer" class="dialog-footer">
  237. <el-button type="primary" @click="submitForm">确 定</el-button>
  238. <el-button @click="cancel">取 消</el-button>
  239. </div>
  240. </el-dialog> -->
  241. <!-- 用户导入对话框 -->
  242. <el-dialog :title="upload.title" :visible.sync="upload.open" width="600px" append-to-body>
  243. <el-upload
  244. ref="upload"
  245. :limit="1"
  246. accept=".xlsx, .xls"
  247. :headers="upload.headers"
  248. :action="upload.url"
  249. :disabled="upload.isUploading"
  250. :on-progress="handleFileUploadProgress"
  251. :on-success="handleFileSuccess"
  252. :auto-upload="false"
  253. :data="{focusCrowdStyle:upload.focusCrowdStyle,jobStyle:upload.jobStyle,startTime:upload.startTime,endTime:upload.endTime,detectionNumber:upload.detectionNumber,detectionScope:upload.detectionScope}"
  254. drag
  255. class="nhkiu"
  256. >
  257. <i class="el-icon-upload"></i>
  258. <div class="el-upload__text">将文件拖到此处,或<em style="color: #00b385;">点击上传</em></div>
  259. <div class="el-upload__tip text-center" slot="tip">
  260. <div class="el-upload__tip" slot="tip">
  261. <!-- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据 -->
  262. </div>
  263. <el-row>
  264. <el-form ref="form" :model="upload" :rules="rules" label-width="80px">
  265. <el-col :span="12">
  266. <el-form-item label="开始时间" prop="startTime">
  267. <el-date-picker clearable
  268. v-model="upload.startTime"
  269. type="datetime"
  270. value-format="yyyy-MM-dd HH:mm:ss"
  271. format="yyyy-MM-dd HH:mm:ss"
  272. style="width: 100%;"
  273. placeholder="请选择比对开始时间">
  274. </el-date-picker>
  275. </el-form-item>
  276. </el-col>
  277. <el-col :span="12">
  278. <el-form-item label="结束时间" prop="endTime">
  279. <el-date-picker clearable
  280. v-model="upload.endTime"
  281. type="datetime"
  282. value-format="yyyy-MM-dd HH:mm:ss"
  283. format="yyyy-MM-dd HH:mm:ss"
  284. style="width: 100%;"
  285. placeholder="请选择比对结束时间">
  286. </el-date-picker>
  287. </el-form-item>
  288. </el-col>
  289. <el-col :span="12">
  290. <el-form-item :label="'次' + '\u3000\u3000' + '数'" prop="detectionNumber">
  291. <el-input
  292. v-model="upload.detectionNumber"
  293. placeholder="请输入次数"
  294. min="0"
  295. type="number"
  296. @blur="nhkse"
  297. />
  298. </el-form-item>
  299. </el-col>
  300. <el-col :span="12">
  301. <el-form-item :label="'天' + '\u3000\u3000' + '数'" prop="detectionScope">
  302. <el-input
  303. v-model="upload.detectionScope"
  304. placeholder="请输入天数"
  305. min="0"
  306. type="number"
  307. @blur="nhksets"
  308. @keyup.enter.native="handleQuery"
  309. />
  310. </el-form-item>
  311. </el-col>
  312. <el-col :span="12">
  313. <el-form-item label="职业类别" prop="jobStyle">
  314. <el-select filterable v-model="upload.jobStyle" placeholder="请选择职业类别">
  315. <el-option
  316. v-for="dict in dict.type.occupational_category "
  317. :key="dict.label"
  318. :label="dict.label"
  319. :value="dict.label"
  320. ></el-option>
  321. </el-select>
  322. </el-form-item>
  323. </el-col>
  324. <el-col :span="12">
  325. <el-form-item label="人群分类" prop="focusCrowdStyle">
  326. <el-select filterable v-model="upload.focusCrowdStyle" placeholder="请选择人群分类">
  327. <el-option
  328. v-for="dict in dict.type.classification_population"
  329. :key="dict.label"
  330. :label="dict.label"
  331. :value="dict.label"
  332. ></el-option>
  333. </el-select>
  334. </el-form-item>
  335. </el-col>
  336. </el-form>
  337. </el-row>
  338. <span>仅允许导入xls、xlsx格式文件。</span>
  339. <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline; color: #00b385;" @click="importTemplate">下载模板</el-link>
  340. </div>
  341. </el-upload>
  342. <div slot="footer" class="dialog-footer">
  343. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  344. <el-button @click="nlmse">取 消</el-button>
  345. </div>
  346. </el-dialog>
  347. </div>
  348. </template>
  349. <script>
  350. import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/system/info";
  351. import { getToken } from "@/utils/auth";
  352. export default {
  353. dicts: ['occupational_category', 'classification_population'],
  354. name: "Info",
  355. data() {
  356. return {
  357. // 遮罩层
  358. loading: true,
  359. // 选中数组
  360. ids: [],
  361. // 非单个禁用
  362. single: true,
  363. // 非多个禁用
  364. multiple: true,
  365. // 显示搜索条件
  366. showSearch: true,
  367. // 总条数
  368. total: 0,
  369. // 导入人员信息表格数据
  370. infoList: [],
  371. // 弹出层标题
  372. title: "",
  373. // 是否显示弹出层
  374. open: false,
  375. // 查询参数
  376. queryParams: {
  377. pageNum: 1,
  378. pageSize: 10,
  379. name: null,
  380. idCard: null,
  381. phoneNum: null,
  382. nucleicCollectTime: null,
  383. nucleicResultsTime: null,
  384. jobStyle: null,
  385. focusCrowdStyle: null,
  386. detectionFrequency: null,
  387. startTime: null,
  388. endTime: null,
  389. },
  390. // 表单参数
  391. form: {},
  392. // 表单校验
  393. rules: {
  394. startTime: [
  395. { required: true, message: "开始时间不能为空", trigger: "blur" }
  396. ],
  397. endTime:[
  398. { required: true, message: "结束时间不能为空", trigger: "blur" }
  399. ],
  400. detectionNumber:[
  401. { required: true, message: "次数不能为空", trigger: "blur" }
  402. ],
  403. detectionScope:[
  404. { required: true, message: "天数不能为空", trigger: "blur" }
  405. ],
  406. jobStyle:[
  407. { required: true, message: "职业类别不能为空", trigger: "blur" }
  408. ],
  409. focusCrowdStyle:[
  410. { required: true, message: "人群分类不能为空", trigger: "blur" }
  411. ]
  412. },
  413. // 用户导入参数
  414. upload: {
  415. // 是否显示弹出层(用户导入)
  416. open: false,
  417. // 弹出层标题(用户导入)
  418. title: "",
  419. // 是否禁用上传
  420. isUploading: false,
  421. // 是否更新已经存在的用户数据
  422. detectionNumber:null,
  423. detectionScope:null,
  424. startTime: null,
  425. endTime: null,
  426. jobStyle:null,
  427. focusCrowdStyle:null,
  428. updateSupport: 0,
  429. // 设置上传的请求头部
  430. headers: { Authorization: "Bearer " + getToken() },
  431. // 上传的地址
  432. url: process.env.VUE_APP_BASE_API + "/system/info/importData"
  433. },
  434. postOptions:[]
  435. };
  436. },
  437. created() {
  438. this.getList();
  439. },
  440. methods: {
  441. /** 查询导入人员信息列表 */
  442. getList() {
  443. this.loading = true;
  444. listInfo(this.queryParams).then(response => {
  445. this.infoList = response.rows;
  446. this.total = response.total;
  447. this.loading = false;
  448. });
  449. },
  450. // 取消按钮
  451. cancel() {
  452. this.open = false;
  453. this.reset();
  454. },
  455. // 表单重置
  456. reset() {
  457. this.form = {
  458. id: null,
  459. name: null,
  460. gender: null,
  461. age: null,
  462. idCard: null,
  463. phoneNum: null,
  464. nucleicCollectTime: null,
  465. nucleicResultsTime: null,
  466. jobStyle: null,
  467. focusCrowdStyle: null,
  468. detectionFrequency: null,
  469. detectionNumber: null,
  470. detectionScope: null,
  471. deptName: null,
  472. startTime: null,
  473. endTime: null,
  474. createBy: null,
  475. createTime: null,
  476. updateBy: null,
  477. updateTime: null,
  478. remark: null
  479. };
  480. this.resetForm("form");
  481. },
  482. /** 搜索按钮操作 */
  483. handleQuery() {
  484. this.queryParams.pageNum = 1;
  485. this.getList();
  486. },
  487. /** 重置按钮操作 */
  488. resetQuery() {
  489. this.resetForm("queryForm");
  490. this.handleQuery();
  491. },
  492. // 多选框选中数据
  493. handleSelectionChange(selection) {
  494. this.ids = selection.map(item => item.id)
  495. this.single = selection.length!==1
  496. this.multiple = !selection.length
  497. },
  498. /** 新增按钮操作 */
  499. handleAdd() {
  500. this.reset();
  501. this.open = true;
  502. this.title = "添加导入人员信息";
  503. },
  504. /** 修改按钮操作 */
  505. handleUpdate(row) {
  506. this.reset();
  507. const id = row.id || this.ids
  508. getInfo(id).then(response => {
  509. this.form = response.data;
  510. this.open = true;
  511. this.title = "修改导入人员信息";
  512. });
  513. },
  514. /** 提交按钮 */
  515. submitForm() {
  516. this.$refs["form"].validate(valid => {
  517. if (valid) {
  518. if (this.form.id != null) {
  519. updateInfo(this.form).then(response => {
  520. this.$modal.msgSuccess("修改成功");
  521. this.open = false;
  522. this.getList();
  523. });
  524. } else {
  525. addInfo(this.form).then(response => {
  526. this.$modal.msgSuccess("新增成功");
  527. this.open = false;
  528. this.getList();
  529. });
  530. }
  531. }
  532. });
  533. },
  534. /** 删除按钮操作 */
  535. handleDelete(row) {
  536. const ids = row.id || this.ids;
  537. this.$modal.confirm('是否确认删除导入人员信息编号为"' + ids + '"的数据项?').then(function() {
  538. return delInfo(ids);
  539. }).then(() => {
  540. this.getList();
  541. this.$modal.msgSuccess("删除成功");
  542. }).catch(() => {});
  543. },
  544. /** 导出按钮操作 */
  545. handleExport() {
  546. this.download('system/info/export', {
  547. ...this.queryParams
  548. }, `info_${new Date().getTime()}.xlsx`)
  549. },
  550. /** 导入按钮操作 */
  551. handleImport() {
  552. this.upload.title = "用户导入";
  553. this.upload.open = true;
  554. },
  555. /** 下载模板操作 */
  556. importTemplate() {
  557. // this.download('system/user/importTemplate', {
  558. // }, `user_template_${new Date().getTime()}.xlsx`)
  559. },
  560. // 文件上传中处理
  561. handleFileUploadProgress(event, file, fileList) {
  562. this.upload.isUploading = true;
  563. },
  564. // 文件上传成功处理
  565. handleFileSuccess(response, file, fileList) {
  566. this.upload.open = false;
  567. this.upload.isUploading = false;
  568. this.$refs.upload.clearFiles();
  569. this.upload.detectionNumber = null
  570. this.upload.startTime=null
  571. this.upload.endTime= null
  572. this.upload.jobStyle= null
  573. this.upload.focusCrowdStyle= null
  574. this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
  575. this.getList();
  576. },
  577. // 提交上传文件
  578. submitFileForm() {
  579. this.$refs["form"].validate(valid => {
  580. if (valid) {
  581. this.$refs.upload.submit();
  582. }
  583. });
  584. },
  585. // 次数失去焦点事件
  586. nhkse(value){
  587. console.log(this.upload.detectionNumber)
  588. if(this.upload.detectionNumber < 0){
  589. this.upload.detectionNumber = 0
  590. }
  591. },
  592. // 天数失去焦点事件
  593. nhksets(){
  594. if(this.upload.detectionScope < 0){
  595. this.upload.detectionScope = 0
  596. }
  597. },
  598. // 取消
  599. nlmse(){
  600. this.upload.open = false
  601. this.upload.detectionNumber = null
  602. this.upload.startTime=null
  603. this.upload.endTime= null
  604. this.upload.jobStyle= null
  605. this.upload.focusCrowdStyle= null
  606. }
  607. }
  608. };
  609. </script>
  610. <style type="text/css" lang="scss">
  611. .nhkiu{
  612. .el-upload-dragger{
  613. width: 560px !important;
  614. margin-bottom: 20px;
  615. }
  616. }
  617. .el-button--primary{
  618. background-color: #00b385 !important;
  619. border-color: #00b385 !important;
  620. }
  621. </style>