index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :rules="rules" size="small" :inline="true" v-show="showSearch" label-width="80px">
  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: 108%;"
  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="startTime">
  18. <el-date-picker clearable
  19. v-model="queryParams.startTime"
  20. type="datetime"
  21. value-format="yyyy-MM-dd HH:mm:ss"
  22. format="yyyy-MM-dd HH:mm:ss"
  23. style="width: 100%;"
  24. placeholder="请选择比对开始时间">
  25. </el-date-picker>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :span="8">
  29. <el-form-item label="结束时间" prop="endTime">
  30. <el-date-picker clearable
  31. v-model="queryParams.endTime"
  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="8">
  41. <el-form-item label="采集时间" prop="nucleicCollectTime">
  42. <el-date-picker clearable
  43. v-model="queryParams.nucleicCollectTime"
  44. type="datetime"
  45. value-format="yyyy-MM-dd HH:mm:ss"
  46. format="yyyy-MM-dd HH:mm:ss"
  47. style="width: 100%;"
  48. placeholder="请选择核酸采集时间">
  49. </el-date-picker>
  50. </el-form-item>
  51. </el-col> -->
  52. <!-- <el-col :span="8">
  53. <el-form-item :label="'天' + '\u3000\u3000' + '数'" prop="detectionScope">
  54. <el-input
  55. v-model="queryParams.detectionScope"
  56. placeholder="请输入天数"
  57. min="0"
  58. type="number"
  59. @blur="nhksets"
  60. style="width: 108%;"
  61. @keyup.enter.native="handleQuery"
  62. />
  63. </el-form-item>
  64. </el-col> -->
  65. <el-col :span="24">
  66. <el-col :span="8">
  67. <el-form-item :label="'次' + '\u3000\u3000' + '数'" prop="detectionNumber">
  68. <el-input
  69. v-model="queryParams.detectionNumber"
  70. placeholder="请输入次数"
  71. style="width: 114%;"
  72. min="0"
  73. type="number"
  74. @blur="nhkse"
  75. @keyup.enter.native="handleQuery"
  76. />
  77. </el-form-item>
  78. </el-col>
  79. <el-col :span="8">
  80. <el-form-item class="nkseydf">
  81. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuerys">搜索</el-button>
  82. <!-- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">对比</el-button> -->
  83. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  84. </el-form-item>
  85. </el-col>
  86. </el-col>
  87. </el-row>
  88. </el-form>
  89. <el-row :gutter="10" class="mb8">
  90. <!-- <el-col :span="18">
  91. <div style="color: #343434; font-size: 20px;">截至 <span style="color: #00b385;">{{gettime}}</span> 止 共计 <span style="color: #00b385;">{{nskeia}}</span> 次核酸</div>
  92. </el-col>
  93. <el-col :span="1.5">
  94. <el-button
  95. type="primary"
  96. plain
  97. icon="el-icon-download"
  98. size="mini"
  99. @click="importTemplate"
  100. >下载模板</el-button>
  101. </el-col>
  102. <el-col :span="1.5">
  103. <el-button
  104. type="info"
  105. plain
  106. icon="el-icon-upload2"
  107. size="mini"
  108. @click="handleImport"
  109. v-hasPermi="['system:info:import']"
  110. >导入</el-button>
  111. </el-col> -->
  112. <el-col :span="1.5">
  113. <el-button
  114. type="warning"
  115. plain
  116. icon="el-icon-download"
  117. size="mini"
  118. @click="handleExport"
  119. v-hasPermi="['system:info:export']"
  120. >导出</el-button>
  121. </el-col>
  122. <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
  123. </el-row>
  124. <el-table v-loading="loading" v-if="mjue" :data="infoList" @selection-change="handleSelectionChange">
  125. <el-table-column :fixed="rigs" label="姓名" align="center" prop="name" width="110"/>
  126. <el-table-column :fixed="rigs" label="身份证号码" align="center" prop="idCard" width="180"/>
  127. <el-table-column label="联系号码" align="center" prop="phoneNum" width="110"/>
  128. <el-table-column label="核酸采集时间" align="center" prop="nucleicCollectTime" width="157">
  129. <template slot-scope="scope">
  130. <span v-html="scope.row.nucleicCollectTime"></span>
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="核酸结果时间" align="center" prop="nucleicResultsTime" width="157">
  134. <template slot-scope="scope">
  135. <span v-html="scope.row.nucleicResultsTime"></span>
  136. </template>
  137. </el-table-column>
  138. <el-table-column label="采集地点" align="center" width="117">
  139. <template slot-scope="scope">
  140. <span v-html="scope.row.collectPlace"></span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="采集结果" align="center" width="117">
  144. <template slot-scope="scope">
  145. <span v-html="scope.row.nucleicResults"></span>
  146. </template>
  147. </el-table-column>
  148. <!-- <el-table-column label="职业类别" align="center" prop="jobStyle" width="137"/> -->
  149. <!-- <el-table-column label="重点人群分类" align="center" prop="focusCrowdStyle" width="130"/> -->
  150. <el-table-column label="检测频次(次/天)" align="center" prop="detectionFrequency" width="115"/>
  151. <el-table-column label="比对开始时间" align="center" prop="startTime" width="157">
  152. <template slot-scope="scope">
  153. <span>{{ scope.row.startTime}}</span>
  154. </template>
  155. </el-table-column>
  156. <el-table-column label="比对结束时间" align="center" prop="endTime" width="157">
  157. <template slot-scope="scope">
  158. <span>{{ scope.row.endTime}}</span>
  159. </template>
  160. </el-table-column>
  161. <el-table-column :fixed="rig" label="进度(已做核酸次数/频次)" align="center" prop="detectionProgress" width="165"/>
  162. <el-table-column :fixed="rig" label="是否异常" align="center" prop="detectionResult" >
  163. <template slot-scope="scope">
  164. <span :class="[scope.row.detectionResult == '正常' ? 'heade_codfr' : 'lndw']">{{ scope.row.detectionResult}}</span>
  165. </template>
  166. </el-table-column>
  167. </el-table>
  168. <div v-if="!mjue" style="text-align: center;">正在加载数据......</div>
  169. </div>
  170. </template>
  171. <script>
  172. import { listInfo, getInfo, delInfo, addInfo, updateInfo,listInfohs } from "@/api/system/batch";
  173. import { getToken } from "@/utils/auth";
  174. export default {
  175. dicts: ['occupational_category', 'classification_population','whether_abnormal'],
  176. name: "Info",
  177. data() {
  178. return {
  179. // 遮罩层
  180. loading: true,
  181. // 选中数组
  182. ids: [],
  183. // 非单个禁用
  184. single: true,
  185. // 非多个禁用
  186. multiple: true,
  187. // 显示搜索条件
  188. showSearch: true,
  189. // 总条数
  190. total: 0,
  191. // 导入人员信息表格数据
  192. infoList: [],
  193. // 弹出层标题
  194. title: "",
  195. // 是否显示弹出层
  196. open: false,
  197. // 查询参数
  198. queryParams: {
  199. pageNum: 1,
  200. pageSize: 10,
  201. name: null,
  202. idCard: null,
  203. phoneNum: null,
  204. nucleicCollectTime: null,
  205. nucleicResultsTime: null,
  206. jobStyle: null,
  207. focusCrowdStyle: null,
  208. detectionFrequency: null,
  209. startTime: null,
  210. endTime: null,
  211. },
  212. // 表单参数
  213. form: {},
  214. // 表单校验
  215. rules: {
  216. // startTime: [
  217. // { required: true, message: "开始时间不能为空", trigger: "blur" }
  218. // ],
  219. // endTime:[
  220. // { required: true, message: "结束时间不能为空", trigger: "blur" }
  221. // ],
  222. // detectionNumber:[
  223. // { required: true, message: "次数不能为空", trigger: "blur" }
  224. // ],
  225. // detectionScope:[
  226. // { required: true, message: "天数不能为空", trigger: "blur" }
  227. // ],
  228. // idCard:[
  229. // { required: true, message: "身份证不能为空", trigger: "blur" }
  230. // ]
  231. },
  232. // 用户导入参数
  233. upload: {
  234. // 是否显示弹出层(用户导入)
  235. open: false,
  236. // 弹出层标题(用户导入)
  237. title: "",
  238. // 是否禁用上传
  239. isUploading: false,
  240. // 是否更新已经存在的用户数据
  241. detectionNumber:null,
  242. detectionScope:null,
  243. startTime: null,
  244. endTime: null,
  245. jobStyle:null,
  246. focusCrowdStyle:null,
  247. updateSupport: 0,
  248. // 设置上传的请求头部
  249. headers: { Authorization: "Bearer " + getToken() },
  250. // 上传的地址
  251. url: process.env.VUE_APP_BASE_API + "/system/info/importData"
  252. },
  253. postOptions:[],
  254. gettime:'',
  255. nskeia:'',
  256. mjue:true,
  257. rig:'right',
  258. rigs:'left',
  259. tableMaxHeight:300,
  260. };
  261. },
  262. created() {
  263. // this.getList();
  264. // this.getCurrentTime()
  265. this.getLisths()
  266. this.loading = false;
  267. window.onresize = () => {
  268. this.changeTableMaxHeight()
  269. }
  270. this.changeTableMaxHeight()
  271. },
  272. mounted() {
  273. window.onresize = () => {
  274. this.changeTableMaxHeight()
  275. }
  276. this.changeTableMaxHeight()
  277. },
  278. methods: {
  279. /** 查询导入人员信息列表 */
  280. getList() {
  281. this.loading = true;
  282. this.mjue = false
  283. listInfo(this.queryParams).then(response => {
  284. this.infoList = response.data;
  285. this.mjue = true
  286. // this.total = response.total;
  287. this.loading = false;
  288. });
  289. },
  290. /** 查询总核酸次数 */
  291. getLisths() {
  292. // this.loading = true;
  293. this.loading = true;
  294. this.mjue = false
  295. listInfohs(this.queryParams).then(response => {
  296. this.infoList = response.rows;
  297. this.mjue = true
  298. // this.total = response.total;
  299. this.loading = false;
  300. });
  301. },
  302. // 取消按钮
  303. cancel() {
  304. this.open = false;
  305. this.reset();
  306. },
  307. // 表单重置
  308. reset() {
  309. this.form = {
  310. id: null,
  311. name: null,
  312. gender: null,
  313. age: null,
  314. idCard: null,
  315. phoneNum: null,
  316. nucleicCollectTime: null,
  317. nucleicResultsTime: null,
  318. jobStyle: null,
  319. focusCrowdStyle: null,
  320. detectionFrequency: null,
  321. detectionNumber: null,
  322. detectionScope: null,
  323. deptName: null,
  324. startTime: null,
  325. endTime: null,
  326. createBy: null,
  327. createTime: null,
  328. updateBy: null,
  329. updateTime: null,
  330. remark: null
  331. };
  332. this.resetForm("form");
  333. },
  334. /** 对比按钮操作 */
  335. handleQuery() {
  336. this.queryParams.pageNum = 1;
  337. this.getList();
  338. },
  339. // 搜索
  340. handleQuerys(){
  341. this.queryParams.pageNum = 1;
  342. this.getLisths();
  343. },
  344. /** 重置按钮操作 */
  345. resetQuery() {
  346. this.resetForm("queryForm");
  347. this.handleQuerys();
  348. },
  349. // 多选框选中数据
  350. handleSelectionChange(selection) {
  351. this.ids = selection.map(item => item.id)
  352. this.single = selection.length!==1
  353. this.multiple = !selection.length
  354. },
  355. /** 新增按钮操作 */
  356. handleAdd() {
  357. this.reset();
  358. this.open = true;
  359. this.title = "添加导入人员信息";
  360. },
  361. /** 修改按钮操作 */
  362. handleUpdate(row) {
  363. this.reset();
  364. const id = row.id || this.ids
  365. getInfo(id).then(response => {
  366. this.form = response.data;
  367. this.open = true;
  368. this.title = "修改导入人员信息";
  369. });
  370. },
  371. /** 提交按钮 */
  372. submitForm() {
  373. this.$refs["form"].validate(valid => {
  374. if (valid) {
  375. if (this.form.id != null) {
  376. updateInfo(this.form).then(response => {
  377. this.$modal.msgSuccess("修改成功");
  378. this.open = false;
  379. this.getList();
  380. });
  381. } else {
  382. addInfo(this.form).then(response => {
  383. this.$modal.msgSuccess("新增成功");
  384. this.open = false;
  385. this.getList();
  386. });
  387. }
  388. }
  389. });
  390. },
  391. /** 删除按钮操作 */
  392. handleDelete(row) {
  393. const ids = row.id || this.ids;
  394. this.$modal.confirm('是否确认删除导入人员信息编号为"' + ids + '"的数据项?').then(function() {
  395. return delInfo(ids);
  396. }).then(() => {
  397. this.getList();
  398. this.$modal.msgSuccess("删除成功");
  399. }).catch(() => {});
  400. },
  401. /** 导出按钮操作 */
  402. handleExport() {
  403. this.download('system/info/export', {
  404. ...this.queryParams
  405. }, `info_${new Date().getTime()}.xlsx`)
  406. },
  407. /** 导入按钮操作 */
  408. handleImport() {
  409. this.upload.title = "导入信息";
  410. this.upload.open = true;
  411. },
  412. /** 下载模板操作 */
  413. importTemplate() {
  414. window.open("https://yqfk.qs163.cn/moban/模板.xlsx")
  415. },
  416. // 文件上传中处理
  417. handleFileUploadProgress(event, file, fileList) {
  418. this.upload.isUploading = true;
  419. },
  420. // 文件上传成功处理
  421. handleFileSuccess(response, file, fileList) {
  422. this.upload.open = false;
  423. this.upload.isUploading = false;
  424. this.$refs.upload.clearFiles();
  425. this.upload.detectionNumber = null
  426. this.upload.startTime=null
  427. this.upload.endTime= null
  428. this.upload.jobStyle= null
  429. this.upload.focusCrowdStyle= null
  430. this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
  431. this.getList();
  432. },
  433. // 提交上传文件
  434. submitFileForm() {
  435. this.$refs["form"].validate(valid => {
  436. if (valid) {
  437. this.$refs.upload.submit();
  438. }
  439. });
  440. },
  441. // 次数失去焦点事件
  442. nhkse(value){
  443. console.log(this.upload.detectionNumber)
  444. if(this.upload.detectionNumber < 0){
  445. this.upload.detectionNumber = 0
  446. }
  447. },
  448. // 天数失去焦点事件
  449. nhksets(){
  450. if(this.upload.detectionScope < 0){
  451. this.upload.detectionScope = 0
  452. }
  453. },
  454. // 取消
  455. nlmse(){
  456. this.upload.open = false
  457. this.upload.detectionNumber = null
  458. this.upload.startTime=null
  459. this.upload.endTime= null
  460. this.upload.jobStyle= null
  461. this.upload.focusCrowdStyle= null
  462. },
  463. getCurrentTime() {
  464. //获取当前时间并打印
  465. var _this = this;
  466. console.log(3)
  467.   let yy = new Date().getFullYear();
  468.   let mm = new Date().getMonth()+1;
  469.   let dd = new Date().getDate();
  470.   let hh = new Date().getHours();
  471.   let mf = new Date().getMinutes()<10 ? '0'+new Date().getMinutes() : new Date().getMinutes();
  472.   let ss = new Date().getSeconds()<10 ? '0'+new Date().getSeconds() : new Date().getSeconds();
  473.   _this.gettime = yy+'-'+mm+'-'+dd;
  474.   console.log(_this.gettime)
  475. },
  476. // 获取屏幕高度
  477. showFilterForm () {
  478. this.filterActive = !this.filterActive
  479. this.changeTableMaxHeight()
  480. },
  481. changeTableMaxHeight () {
  482. let height = document.body.offsetHeight // 网页可视区域高度
  483. // if (this.filterActive) {
  484. // this.tableMaxHeight = height - 320
  485. // } else {
  486. this.tableMaxHeight = height - 380
  487. // }
  488. console.log(height)
  489. },
  490. }
  491. };
  492. </script>
  493. <style type="text/css" lang="scss">
  494. .nhkiu{
  495. .el-upload-dragger{
  496. width: 560px !important;
  497. margin-bottom: 20px;
  498. }
  499. }
  500. .nkseydf{
  501. .el-button--primary{
  502. background-color: #00b385 !important;
  503. border-color: #00b385 !important;
  504. }
  505. }
  506. .lndw{
  507. color: red;
  508. }
  509. .heade_codfr{
  510. color: #00b385;
  511. }
  512. </style>