zhongdianrenyuan.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941
  1. <template>
  2. <div>
  3. <!-- 标题部分 -->
  4. <el-row>
  5. <el-col :span="24" class="first-row">
  6. <div class="tag">重点人员</div>
  7. </el-col>
  8. </el-row>
  9. <!-- 分割线 -->
  10. <div style="margin: 18px 0"></div>
  11. <hr style="background-color: #cccccc; height: 1px; border: 0" />
  12. <!-- 主体内容部分 -->
  13. <!-- 时间选择框区域 -->
  14. <el-row>
  15. <el-form :inline="true" style="padding-top: 13px">
  16. <el-form-item label="起止时间:">
  17. <el-date-picker
  18. v-model="select_datetime"
  19. type="daterange"
  20. align="center"
  21. unlink-panels
  22. range-separator="至"
  23. :start-placeholder="startTime"
  24. :end-placeholder="endTime"
  25. @change="dateChange"
  26. value-format="yyyy-MM-dd"
  27. :picker-options="pickerOptions"
  28. class="shijian_plus"
  29. >
  30. </el-date-picker>
  31. </el-form-item>
  32. <el-form-item label="处置情况:">
  33. <el-select v-model="people_state" @change="stateChange">
  34. <el-option
  35. v-for="item in state_options"
  36. :key="item.value"
  37. :label="item.label"
  38. :value="item.value"
  39. >
  40. </el-option>
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item label="查询:" style="marginleft: -30px">
  44. <el-input
  45. suffix-icon="el-icon-search"
  46. placeholder="请输入姓名"
  47. clearable
  48. v-model="keyWord"
  49. @change="handleSearch"
  50. @clear="handleClear"
  51. ></el-input>
  52. </el-form-item>
  53. <el-form-item style="marginleft: 10px">
  54. <el-button size="mini" type="success" @click="exportServerExcel">
  55. 后台数据导出
  56. </el-button>
  57. <el-button
  58. size="mini"
  59. type="primary"
  60. @click="exportExcel('起止时间')"
  61. >
  62. 当前列表导出
  63. </el-button>
  64. </el-form-item>
  65. </el-form>
  66. </el-row>
  67. <!-- 分割线 -->
  68. <hr style="background-color: #cccccc; height: 1px; border: 0" />
  69. <!-- 表单部分 -->
  70. <el-row>
  71. <el-table
  72. :data="tableData"
  73. ref="tableList"
  74. id="exportTab"
  75. border
  76. highlight-current-row
  77. v-loading="loading"
  78. element-loading-text="加载中"
  79. element-loading-spinner="el-icon-loading"
  80. height="500"
  81. >
  82. <el-table-column prop="sm_name" label="姓名" align="center" width="70">
  83. </el-table-column>
  84. <el-table-column
  85. prop="sm_phone"
  86. label="联系方式"
  87. align="center"
  88. width="120"
  89. >
  90. </el-table-column>
  91. <el-table-column
  92. prop="sm_card"
  93. label="身份证"
  94. align="center"
  95. width="170"
  96. >
  97. </el-table-column>
  98. <el-table-column prop="sm_color" label="码色" align="center" width="70">
  99. </el-table-column>
  100. <el-table-column prop="leixing" label="人员类型" align="center">
  101. </el-table-column>
  102. <el-table-column prop="sm_time" label="时间" align="center" width="100">
  103. </el-table-column>
  104. <el-table-column
  105. prop="handler_unit"
  106. label="处理单位"
  107. align="center"
  108. width="130"
  109. >
  110. </el-table-column>
  111. <el-table-column label="轨迹" align="center" show-overflow-tooltip>
  112. <template slot-scope="{ row }">
  113. {{ row.jingwei_place + "->" + row.trace_after }}
  114. </template>
  115. </el-table-column>
  116. <el-table-column label="处理情况" width="120" align="center">
  117. <template slot-scope="scope">
  118. <div
  119. v-if="
  120. scope.row.handler_state2 === '0' ||
  121. scope.row.handler_message === '待处置'
  122. "
  123. >
  124. <el-select
  125. v-if="myArr"
  126. style="width: 100%"
  127. size="mini"
  128. v-model="myArr[scope.$index].label"
  129. placeholder="待处理"
  130. @change="handleShowDialog(scope.$index, scope.row)"
  131. >
  132. <el-option
  133. v-for="item in options"
  134. :key="item.value"
  135. :label="item.label"
  136. :value="item.label"
  137. >
  138. </el-option>
  139. </el-select>
  140. </div>
  141. <div v-else>{{ scope.row.handler_message }}</div>
  142. </template>
  143. </el-table-column>
  144. <el-table-column
  145. label="处置详情"
  146. align="center"
  147. prop="message_commit"
  148. show-overflow-tooltip
  149. >
  150. </el-table-column>
  151. <el-table-column label="操作" width="240" align="center">
  152. <template slot-scope="{ row }">
  153. <el-button
  154. :disabled="row.handler_state2 === '0'"
  155. type="text"
  156. size="mini"
  157. style="width: 60px"
  158. @click="handleThemeModifyClick(row)"
  159. >编辑
  160. </el-button>
  161. <el-button
  162. type="text"
  163. size="mini"
  164. style="width: 60px"
  165. @click="guiXiang(row)"
  166. >轨迹详情
  167. </el-button>
  168. <el-button
  169. type="text"
  170. size="mini"
  171. style="width: 60px"
  172. @click="deleteTitle(row)"
  173. >记录
  174. </el-button>
  175. </template>
  176. </el-table-column>
  177. </el-table>
  178. </el-row>
  179. <!-- 分页器 -->
  180. <el-row style="marginTop: 20px">
  181. <el-pagination
  182. background
  183. @size-change="handleSizeChange"
  184. @current-change="handleCurrentChange"
  185. :page-sizes="[6, 20, 50, 100, 500]"
  186. :current-page="currentPage"
  187. :page-size="pageSize"
  188. layout="total, sizes, prev, pager, next, jumper"
  189. :total="total"
  190. >
  191. </el-pagination>
  192. </el-row>
  193. <!-- 编辑弹窗 -->
  194. <el-dialog
  195. title="编辑"
  196. :close-on-click-modal="false"
  197. :visible.sync="dialogModifyThemeFormVisible"
  198. width="600px"
  199. center
  200. >
  201. <el-form
  202. :model="form"
  203. :rules="rules"
  204. ref="form"
  205. style="width: 80%"
  206. label-width="100px"
  207. >
  208. <el-form-item label="处置方式:" prop="handler_message">
  209. <el-select
  210. style="width: 50%"
  211. size="mini"
  212. v-model="form.handler_message"
  213. placeholder="待处理"
  214. >
  215. <el-option
  216. v-for="item in options"
  217. :key="item.value"
  218. :label="item.label"
  219. :value="item.label"
  220. >
  221. </el-option>
  222. </el-select>
  223. </el-form-item>
  224. <el-form-item label="处置详情:" prop="message_commit">
  225. <el-input
  226. type="textarea"
  227. :autosize="{ minRows: 4, maxRows: 6 }"
  228. v-model="form.message_commit"
  229. ></el-input>
  230. </el-form-item>
  231. </el-form>
  232. <div slot="footer" class="dialog-footer">
  233. <el-button type="primary" @click="modifyRowThemeAction('form')"
  234. >提交</el-button
  235. >
  236. <el-button @click="dialogModifyThemeFormVisible = false"
  237. >取 消</el-button
  238. >
  239. </div>
  240. </el-dialog>
  241. <!-- 记录弹窗 -->
  242. <el-dialog
  243. title="操作记录"
  244. :close-on-click-modal="false"
  245. :visible.sync="dialogModifyThemeFormVisible2"
  246. center
  247. >
  248. <el-table
  249. :data="tableData2"
  250. v-loading="loading_Record"
  251. element-loading-text="加载中"
  252. element-loading-spinner="el-icon-loading"
  253. >
  254. <el-table-column
  255. prop="handler_time"
  256. label="时间"
  257. align="center"
  258. width="160"
  259. >
  260. </el-table-column>
  261. <el-table-column
  262. prop="record1"
  263. label="处理情况"
  264. align="center"
  265. width="120"
  266. >
  267. </el-table-column>
  268. <el-table-column prop="record2" label="处理详情" align="center">
  269. </el-table-column>
  270. </el-table>
  271. </el-dialog>
  272. <!-- 轨迹详情弹窗 -->
  273. <el-dialog
  274. title="轨迹详情"
  275. :close-on-click-modal="false"
  276. :visible.sync="dialogModifyThemeFormVisible4"
  277. width="1200px"
  278. center
  279. >
  280. <el-table
  281. :data="tableData4"
  282. v-loading="loading_path"
  283. element-loading-text="加载中"
  284. element-loading-spinner="el-icon-loading"
  285. style="width: 100%"
  286. height="480"
  287. >
  288. <el-table-column
  289. prop="sm_time"
  290. label="时间"
  291. align="center"
  292. width="200px"
  293. >
  294. </el-table-column>
  295. <el-table-column
  296. prop="sm_color"
  297. label="码色"
  298. align="center"
  299. width="120px"
  300. >
  301. </el-table-column>
  302. <el-table-column
  303. prop="jingwei_place"
  304. label="地点"
  305. align="center"
  306. width="400px"
  307. >
  308. </el-table-column>
  309. <el-table-column prop="jingwei" label="经纬度" align="center">
  310. </el-table-column>
  311. </el-table>
  312. <!-- 轨迹详情分页器 -->
  313. <el-pagination
  314. style="marginTop: 20px"
  315. background
  316. @current-change="handleCurrentChange_path"
  317. :current-page.sync="currentPage_path"
  318. :page-size="pageSize_path"
  319. layout="total, prev, pager, next"
  320. :total="total_path"
  321. :hide-on-single-page="true"
  322. >
  323. </el-pagination>
  324. </el-dialog>
  325. <!-- 输入密码弹窗 -->
  326. <el-dialog
  327. title="输入密码"
  328. :close-on-click-modal="false"
  329. :visible.sync="dialogModifyThemeFormVisible3"
  330. width="600px"
  331. center
  332. >
  333. <el-form
  334. :model="form2"
  335. :rules="rules2"
  336. ref="form2"
  337. style="width: 80%"
  338. label-width="80px"
  339. >
  340. <el-form-item label="账号:" prop="userName">
  341. <el-input
  342. placeholder="请输入账号"
  343. v-model="form2.userName"
  344. ></el-input>
  345. </el-form-item>
  346. <el-form-item label="密码:" prop="password">
  347. <el-input
  348. placeholder="请输入密码"
  349. type="password"
  350. v-model="form2.password"
  351. ></el-input>
  352. </el-form-item>
  353. </el-form>
  354. <div slot="footer" class="dialog-footer">
  355. <el-button type="primary" @click="getSubmit('form2')">下一步</el-button>
  356. </div>
  357. </el-dialog>
  358. </div>
  359. </template>
  360. <script>
  361. import FileSaver from "file-saver";
  362. import XLSX from "xlsx";
  363. export default {
  364. data() {
  365. return {
  366. currentPage: 1, // 当前页
  367. pageSize: 6, // 每页记录数
  368. total: 0, // 总条数
  369. keyWord: "",
  370. select_datetime: [], // 选择的时间范围
  371. startTime: "",
  372. endTime: "",
  373. tableData: [], // 列表
  374. tableData2: [], // 操作记录列表
  375. tableData4: [], // 轨迹详情列表
  376. options: [
  377. {
  378. value: "1",
  379. label: "集中隔离",
  380. },
  381. {
  382. value: "2",
  383. label: "居家隔离",
  384. },
  385. {
  386. value: "3",
  387. label: "居家监测",
  388. },
  389. {
  390. value: "4",
  391. label: "发送协查",
  392. },
  393. {
  394. value: "5",
  395. label: "正常管理",
  396. },
  397. {
  398. value: "6",
  399. label: "闭环管理",
  400. },
  401. {
  402. value: "7",
  403. label: "自我监测",
  404. },
  405. {
  406. value: "8",
  407. label: "其他情况",
  408. }
  409. ],
  410. people_value: [],
  411. people_state: 1,
  412. state_options: [
  413. {
  414. value: 0,
  415. label: "未处置",
  416. },
  417. {
  418. value: 1,
  419. label: "已处置",
  420. },
  421. ],
  422. color_value: "",
  423. handlerMsg: "",
  424. myArr: [],
  425. pickerOptions: {
  426. shortcuts: [
  427. {
  428. text: "最近一周",
  429. onClick(picker) {
  430. const end = new Date();
  431. const start = new Date();
  432. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  433. picker.$emit("pick", [start, end]);
  434. },
  435. },
  436. {
  437. text: "最近一个月",
  438. onClick(picker) {
  439. const end = new Date();
  440. const start = new Date();
  441. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  442. picker.$emit("pick", [start, end]);
  443. },
  444. },
  445. {
  446. text: "最近三个月",
  447. onClick(picker) {
  448. const end = new Date();
  449. const start = new Date();
  450. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  451. picker.$emit("pick", [start, end]);
  452. },
  453. },
  454. ],
  455. },
  456. dialogModifyThemeFormVisible: false,
  457. dialogModifyThemeFormVisible2: false,
  458. dialogModifyThemeFormVisible3: false,
  459. dialogModifyThemeFormVisible4: false,
  460. form: {
  461. id: "",
  462. uuid: "",
  463. handler_message: "",
  464. sm_time: "",
  465. message_commit: "",
  466. },
  467. rules: {
  468. handler_message: [
  469. { required: true, message: "请选择处置方式", trigger: "change" },
  470. ],
  471. message_commit: [
  472. { required: true, message: "请输入处置详情", trigger: "blur" },
  473. ],
  474. },
  475. form2: {
  476. userName: "",
  477. password: "",
  478. },
  479. rules2: {
  480. password: [{ required: true, message: "请输入密码", trigger: "blur" }],
  481. userName: [{ required: true, message: "请输入账号", trigger: "blur" }],
  482. },
  483. loading: false,
  484. loading_path: false,
  485. loading_Record: false,
  486. currentPage_path: 1, // 轨迹详情当前页
  487. pageSize_path: 8, // 轨迹详情每页记录数
  488. total_path: null, // 轨迹详情总条数
  489. uuid_Path: "",
  490. sm_time_Path: "",
  491. temObj: {
  492. // sm_time:"",
  493. // sm_color:"",
  494. // jingwei_place:"",
  495. // jingwei:"",
  496. },
  497. };
  498. },
  499. created() {
  500. // 初始化日期为昨天 至 今天
  501. this.initDate();
  502. },
  503. methods: {
  504. // 初始化日期时间
  505. initDate() {
  506. //当前设定的日期时间
  507. let d = new Date();
  508. var year1 = d.getFullYear(); // 获取当前年份
  509. var mon1 = d.getMonth() + 1; // 获取当前月份
  510. var day1 = d.getDate(); // 获取当前日
  511. //前一天设定的日期时间
  512. d.setTime(d.getTime() - 24 * 60 * 60 * 1000);
  513. var year2 = d.getFullYear(); // 获取当前年份
  514. var mon2 = d.getMonth() + 1; // 获取当前月份
  515. var day2 = d.getDate(); // 获取当前日
  516. this.startTime = this.getDate(year2, mon2, day2);
  517. this.endTime = this.getDate(year1, mon1, day1);
  518. this.select_datetime.push(this.startTime);
  519. this.select_datetime.push(this.endTime);
  520. this.handleCurrentChange();
  521. },
  522. // 获取指定格式 年、月、日
  523. getDate(y, m, d) {
  524. m = m > 9 ? m : "0" + m;
  525. d = d > 9 ? d : "0" + d;
  526. return y + "-" + m + "-" + d;
  527. },
  528. // 整理参数
  529. handleCurrentChange(val = 1) {
  530. this.currentPage = val;
  531. var params = {
  532. handler_state2: this.people_state,
  533. page: this.currentPage,
  534. rows: this.pageSize,
  535. name: !this.keyWord ? null : this.keyWord,
  536. };
  537. if ((this.startTime != "") & (typeof this.startTime != "undefined")) {
  538. params.startTime = this.startTime;
  539. }
  540. if ((this.endTime != "") & (typeof this.endTime != "undefined")) {
  541. params.endTime = this.endTime;
  542. }
  543. this.get_list(params);
  544. },
  545. // 获取列表数据
  546. get_list(params) {
  547. this.loading = true;
  548. this.$axios
  549. .get("/bigData2/userqueryCz.action", {
  550. params: params,
  551. })
  552. .then((res) => {
  553. // console.log(res);
  554. if (res.status === 200) {
  555. res.data.rows.forEach((element) => {
  556. element.leixing = "";
  557. if (element.ishot === "1") {
  558. element.leixing = "发热人员";
  559. }
  560. if (element.iskey === "1") {
  561. element.leixing += "重点区域人员";
  562. }
  563. if (element.istoken === "1") {
  564. if (element.leixing === "") {
  565. element.leixing = "脱管人员";
  566. } else {
  567. element.leixing += ",脱管人员";
  568. }
  569. }
  570. if (element.handler_unit === "县指挥部防疫组") {
  571. element.handler_unit =
  572. element.handler_unit + "," + element.town;
  573. } else {
  574. element.handler_unit = "县指挥部防疫组," + element.town;
  575. }
  576. this.myArr.push({
  577. label: "",
  578. });
  579. return element;
  580. });
  581. this.tableData = res.data.rows;
  582. this.total = res.data.total;
  583. } else {
  584. this.$message.success("获取列表数据失败");
  585. }
  586. this.loading = false;
  587. })
  588. .catch((err) => {
  589. this.$message.error("数据请求异常:没有符合条件的数据");
  590. this.tableData = [];
  591. this.loading = false;
  592. });
  593. },
  594. // 点击编辑按钮事件
  595. handleThemeModifyClick(row) {
  596. // console.log(row);
  597. this.form.uuid = row.uuid;
  598. this.form.id = row.id;
  599. this.form.sm_time = row.sm_time;
  600. this.form.handler_message = "";
  601. this.form.message_commit = "";
  602. this.dialogModifyThemeFormVisible = true;
  603. // this.formThemeModify = JSON.parse(JSON.stringify(row));
  604. // if (row.enable === "是") {
  605. // this.formThemeModify.enable = "1";
  606. // } else {
  607. // this.formThemeModify.enable = "2";
  608. // }
  609. },
  610. modifyRowThemeAction(formName) {
  611. this.$refs[formName].validate(async (valid) => {
  612. if (valid) {
  613. this.dialogModifyThemeFormVisible3 = true;
  614. } else {
  615. console.log("提交失败!!");
  616. return false;
  617. }
  618. });
  619. },
  620. async getSubmit(formName) {
  621. this.$refs[formName].validate(async (valid) => {
  622. if (valid) {
  623. let res = await this.$axios({
  624. url: "/diseaseRight/adminInfo/login",
  625. method: "post",
  626. params: this.form2,
  627. });
  628. if (res.data.success) {
  629. let result = await this.$axios({
  630. url: "/bigData2/userupdateHands.action",
  631. method: "post",
  632. params: this.form,
  633. });
  634. // console.log(result);
  635. if (result.data.code == 200) {
  636. this.$message.success(result.data.msg);
  637. } else {
  638. this.$message.error(result.data.msg);
  639. }
  640. this.dialogModifyThemeFormVisible3 = false;
  641. this.dialogModifyThemeFormVisible = false;
  642. this.handleCurrentChange(1);
  643. } else {
  644. this.$message.error(res.data.message);
  645. }
  646. } else {
  647. console.log("提交失败!!");
  648. return false;
  649. }
  650. });
  651. },
  652. // 点击记录按钮事件
  653. async deleteTitle(row) {
  654. this.dialogModifyThemeFormVisible2 = true;
  655. this.tableData2 = [];
  656. this.loading_Record = true;
  657. let params = {
  658. uuid: row.uuid,
  659. };
  660. let res = await this.$axios({
  661. url: "/bigData2/userqueryRecordsByU.action",
  662. method: "post",
  663. params,
  664. });
  665. // console.log(res);
  666. if (res.data.code == 200) {
  667. this.tableData2 = res.data.data.reverse();
  668. } else {
  669. console.log("获取 操作记录 失败");
  670. }
  671. this.loading_Record = false;
  672. },
  673. // 点击轨迹详情按钮事件
  674. guiXiang(row) {
  675. this.temObj = { ...row };
  676. this.dialogModifyThemeFormVisible4 = true;
  677. this.uuid_Path = row.uuid;
  678. this.sm_time_Path = row.sm_time;
  679. this.currentPage_path = 1;
  680. this.getPathData();
  681. },
  682. // 获取轨迹详情数据
  683. async getPathData() {
  684. this.loading_path = true;
  685. this.tableData4 = [];
  686. this.total_path = null;
  687. let params = {
  688. uuid: this.uuid_Path,
  689. sm_time: this.sm_time_Path,
  690. page: this.currentPage_path,
  691. rows: this.pageSize_path,
  692. };
  693. let res = await this.$axios({
  694. url: "/bigData2/userqueryGuijiPage.action",
  695. method: "post",
  696. params,
  697. });
  698. // console.log(res);
  699. if (res.status == 200) {
  700. if (params.page == 1) {
  701. this.tableData4 = res.data.rows;
  702. if (this.tableData4) {
  703. this.tableData4.unshift(this.temObj);
  704. }else{
  705. this.tableData4=[]
  706. this.tableData4.push(this.temObj)
  707. }
  708. } else {
  709. this.tableData4 = res.data.rows;
  710. }
  711. this.total_path = res.data.total;
  712. this.currentPage_path = params.page;
  713. } else {
  714. console.log("获取 轨迹详情 失败");
  715. }
  716. this.loading_path = false;
  717. },
  718. // 服务器端导出excel
  719. exportServerExcel() {
  720. var params = {};
  721. if (
  722. (this.people_value != "") &
  723. (typeof this.people_value != "undefined")
  724. ) {
  725. for (var i = 0; i < this.people_value.length; i++) {
  726. if (this.people_value[i] === "1") {
  727. params.iskey = 1;
  728. } else if (this.people_value[i] === "2") {
  729. params.istoken = 1;
  730. } else if (this.people_value[i] === "3") {
  731. params.ishot = 1;
  732. }
  733. }
  734. }
  735. if (
  736. (this.people_state != "") &
  737. (typeof this.people_state != "undefined")
  738. ) {
  739. for (var i = 0; i < this.people_state.length; i++) {
  740. if (this.people_state[i] === "1") {
  741. params.handler_state2 = 0;
  742. } else if (this.people_state[i] === "2") {
  743. params.handler_state2 = 1;
  744. }
  745. }
  746. }
  747. if ((this.color_value != "") & (typeof this.color_value != "undefined")) {
  748. if (this.color_value === "1") {
  749. params.sm_color = "红码";
  750. } else if (this.color_value === "2") {
  751. params.sm_color = "黄码";
  752. } else if (this.color_value === "3") {
  753. params.sm_color = "绿码";
  754. }
  755. }
  756. if ((this.startTime != "") & (typeof this.startTime != "undefined")) {
  757. params.startTime = this.startTime;
  758. }
  759. if ((this.endTime != "") & (typeof this.endTime != "undefined")) {
  760. params.endTime = this.endTime;
  761. }
  762. var _this = this;
  763. _this.$axios
  764. .post("/bigData2/usertoExcel.action", {
  765. data: params,
  766. })
  767. .then((res) => {
  768. // console.log(res.data);
  769. if (res.data.code === 200) {
  770. const a = document.createElement("a");
  771. a.setAttribute("target", "_blank");
  772. a.setAttribute("href", res.data.downurl);
  773. a.click();
  774. } else {
  775. _this.$message.success("【导出】地址无效!");
  776. }
  777. })
  778. .catch((err) => {
  779. // console.log(err);
  780. _this.$message.error("【导出】异常: " + err);
  781. });
  782. },
  783. // 导出客户端的表格数据
  784. exportExcel(param) {
  785. /* generate workbook object from table */
  786. var xlsxParam = {
  787. raw: true,
  788. }; // 导出的内容只做解析,不进行格式转换
  789. var wb = XLSX.utils.table_to_book(
  790. document.querySelector("#exportTab"),
  791. xlsxParam
  792. );
  793. /* get binary string as output */
  794. var wbout = XLSX.write(wb, {
  795. bookType: "xlsx",
  796. bookSST: true,
  797. type: "array",
  798. });
  799. try {
  800. FileSaver.saveAs(
  801. new Blob([wbout], {
  802. type: "application/octet-stream",
  803. }),
  804. "重点人员_导出数据_" +
  805. param +
  806. this.startTime +
  807. "~" +
  808. this.endTime +
  809. ".xlsx"
  810. );
  811. } catch (e) {
  812. if (typeof console !== "undefined") {
  813. console.log(e, wbout);
  814. }
  815. }
  816. return wbout;
  817. },
  818. // 选择起止日期
  819. dateChange(val) {
  820. this.startTime = val[0];
  821. this.endTime = val[1];
  822. this.handleCurrentChange(1);
  823. },
  824. // 处置情况
  825. stateChange(val) {
  826. this.people_state = val;
  827. this.handleCurrentChange(1);
  828. },
  829. // 处理情況
  830. handleShowDialog(index, row) {
  831. var _this = this;
  832. _this.handlerMsg = _this.myArr[index].label;
  833. _this
  834. .$confirm("是否现在处理?", "提示", {
  835. confirmButtonText: "处理",
  836. cancelButtonText: "暂不处理",
  837. type: "warning",
  838. showInput: true,
  839. inputPlaceholder: "请输入处置详情",
  840. })
  841. .then((_) => {
  842. if (_.action == "confirm") {
  843. var params = {
  844. uuid: row.uuid,
  845. id: row.id,
  846. handler_message: _this.handlerMsg,
  847. sm_time: _this.tableData[index].sm_time,
  848. message_commit: _.value,
  849. };
  850. _this.$axios
  851. .get("/bigData2/userupdateHand.action", {
  852. params: params,
  853. })
  854. .then((res) => {
  855. // console.log(res.data);
  856. if (res.data.code === 200 && res.data.msg == "更新成功") {
  857. _this.$message.success("【处理】成功!");
  858. this.myArr = [];
  859. _this.handleCurrentChange();
  860. // 滚动到之前位置
  861. setTimeout(() => {
  862. _this.$refs.tableList.bodyWrapper.scrollTop =
  863. (_this.$refs.tableList.bodyWrapper.scrollHeight /
  864. _this.tableData.length) *
  865. (index - 1);
  866. }, 1000);
  867. } else {
  868. _this.$message.error(res.data.msg);
  869. }
  870. })
  871. .catch((err) => {
  872. // console.log(err);
  873. _this.$message.error("【处理】请求异常: " + err);
  874. });
  875. }
  876. })
  877. .catch((_) => {
  878. _this.$message.warning("【处理】请求被取消!");
  879. this.$set(this.myArr[index], "label", "");
  880. });
  881. },
  882. // 改变每页条数
  883. handleSizeChange(val) {
  884. this.pageSize = val;
  885. this.handleCurrentChange();
  886. },
  887. // 搜索框搜索回调
  888. handleSearch() {
  889. if (this.keyWord) {
  890. this.handleCurrentChange(1);
  891. }
  892. },
  893. // 搜索框清空回调
  894. handleClear() {
  895. this.handleCurrentChange(1);
  896. },
  897. // 轨迹详情弹窗换页逻辑
  898. handleCurrentChange_path(val) {
  899. this.currentPage_path = val;
  900. this.getPathData();
  901. },
  902. },
  903. };
  904. </script>
  905. <style scoped>
  906. @import url("zhongdianrenyuan.css");
  907. </style>