index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. <template>
  2. <div class="recognize-main">
  3. <template>
  4. <!-- 退卡人员信息 -->
  5. <div>
  6. <div>
  7. <el-row>
  8. <el-col class="infomation_content" :span="18">
  9. <div class="infomation_prompt">
  10. 今日进站信息概览:登记信息共计{{ companyCount }}条,人数共计{{
  11. personsCount
  12. }}人次
  13. </div>
  14. <div class="infomation_data_line"></div>
  15. <div>
  16. <el-table
  17. height="70vh"
  18. :data="personComingList"
  19. style="width: 100%"
  20. :key="refreKey"
  21. :default-sort="{ prop: 'field001', order: 'descending' }"
  22. >
  23. <el-table-column align="center" prop="field003" label="单位">
  24. </el-table-column>
  25. <el-table-column
  26. align="center"
  27. prop="field006"
  28. label="进站目的"
  29. >
  30. </el-table-column>
  31. <el-table-column align="center" prop="field002" label="领队">
  32. </el-table-column>
  33. <el-table-column
  34. align="center"
  35. prop="field005"
  36. label="联系电话"
  37. >
  38. </el-table-column>
  39. <el-table-column
  40. sortable
  41. align="center"
  42. prop="field001"
  43. label="进站时间"
  44. >
  45. </el-table-column>
  46. <el-table-column
  47. sortable
  48. align="center"
  49. prop="field013"
  50. label="离站时间"
  51. >
  52. </el-table-column>
  53. <el-table-column
  54. align="center"
  55. prop="field007"
  56. label="总人数"
  57. >
  58. </el-table-column>
  59. <el-table-column
  60. align="center"
  61. prop="field008"
  62. label="同行人员"
  63. >
  64. </el-table-column>
  65. <el-table-column align="center" label="操作">
  66. <template slot-scope="scope">
  67. <el-button
  68. v-if="!scope.row.field013"
  69. type="primary"
  70. size="medium "
  71. @click="handleClick(scope.row, 3)"
  72. >离站</el-button
  73. >
  74. </template>
  75. </el-table-column>
  76. </el-table>
  77. </div>
  78. </el-col>
  79. <el-col class="infomation_content" :span="6">
  80. <div class="infomation_prompt">
  81. 今日发出未收回卡{{ inList.length }}张
  82. </div>
  83. <div class="infomation_data_line"></div>
  84. <div>
  85. <el-table
  86. height="70vh"
  87. :data="inList"
  88. style="width: 100%"
  89. :key="refreKey"
  90. >
  91. <el-table-column align="center" prop="field001" label="姓名">
  92. </el-table-column>
  93. <el-table-column align="center" label="在站">
  94. <template slot-scope="scope">
  95. {{ scope.row ? "未还卡" : "还卡" }}
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. </div>
  100. </el-col>
  101. </el-row>
  102. </div>
  103. </div>
  104. </template>
  105. </div>
  106. </template>
  107. <script>
  108. import BaseTableList from "@/views/components/base/BaseTableList";
  109. import { getDataList, updateDataList } from "@/API/report";
  110. import Dayjs from "dayjs";
  111. export default {
  112. name: "recognize",
  113. components: {
  114. BaseTableList,
  115. },
  116. data() {
  117. return {
  118. url: "",
  119. showIframe: true,
  120. stepProcessInfomation: [
  121. {
  122. step: 1,
  123. propName: "人员姓名:",
  124. prop: "name",
  125. prompt: "请说出或点击输入你的姓名。",
  126. },
  127. {
  128. step: 2,
  129. propName: "工作单位:",
  130. prop: "company",
  131. prompt: "请说出或点击输入你的工作单位。",
  132. },
  133. {
  134. step: 3,
  135. propName: "身份证号:",
  136. prop: "cardNumber",
  137. prompt: "请说出或点击输入你的身份证号。",
  138. },
  139. {
  140. step: 4,
  141. propName: "联系电话:",
  142. prop: "tel",
  143. prompt: "请说出或点击输入你的联系电话。",
  144. },
  145. {
  146. step: 5,
  147. propName: "退卡卡号:",
  148. prop: "label",
  149. prompt: "请说出或点击输入你的卡号。",
  150. },
  151. ],
  152. infomation: {
  153. name: "",
  154. company: "",
  155. cardNumber: "",
  156. tel: "",
  157. label: "",
  158. },
  159. cameraInfo: {
  160. id: "1",
  161. },
  162. personComingList: [{}],
  163. personBindList: [{}],
  164. personUnbindList: [{}],
  165. inList: [{}],
  166. refreKey: 1,
  167. companyCount: 0,
  168. personsCount: 0,
  169. };
  170. },
  171. watch: {
  172. "$route.query.path": {
  173. handler(newVal, oldVal) {
  174. // console.log(newVal);
  175. this.showIframe = false;
  176. if (newVal) {
  177. this.url = newVal;
  178. }
  179. this.$nextTick(() => {
  180. this.showIframe = true;
  181. });
  182. },
  183. deep: true,
  184. immediate: true,
  185. },
  186. },
  187. mounted() {
  188. this.getComingDataList();
  189. this.getBindList().then(() => {
  190. this.getUnbindList();
  191. });
  192. },
  193. methods: {
  194. async getComingDataList() {
  195. try {
  196. const params = {
  197. sql: "select CAST(id as char) as id,field001,field002,field003,field004,field005,field006,field007,field008,field009,field010,field011,field012,field013 from custom_table_person_coming_records where TO_DAYS(field001) = TO_DAYS(NOW())", //登记时间
  198. };
  199. const res = await getDataList(params);
  200. this.personComingList = res.data.content;
  201. this.companyCount = this.personComingList.length;
  202. this.personsCount = 0;
  203. this.personComingList.forEach((e) => {
  204. this.personsCount += Number(e.field007);
  205. });
  206. console.log("入场登记报表sql", params, res);
  207. this.refreKey++;
  208. } catch (err) {
  209. console.log(err);
  210. }
  211. },
  212. async getBindList() {
  213. try {
  214. const params = {
  215. sql: "select CAST(id as char) as id,field001,field002,field003,field004,field005,field006,field007 from custom_table_bind_card_records where TO_DAYS(BaseCreateTime) = TO_DAYS(NOW())", //登记时间
  216. };
  217. const res = await getDataList(params);
  218. this.personBindList = res.data.content;
  219. // this.companyCount = this.personComingList.length;
  220. // this.personsCount = 0;
  221. // this.personComingList.forEach((e) => {
  222. // this.personsCount += Number(e.field007);
  223. // });
  224. console.log("今日绑卡", params, res);
  225. this.refreKey++;
  226. } catch (err) {
  227. console.log(err);
  228. }
  229. },
  230. async getUnbindList() {
  231. try {
  232. const params = {
  233. sql: "select CAST(id as char) as id,field001,field002,field003,field004,field005 from custom_table_unbind_card_records where TO_DAYS(BaseCreateTime) = TO_DAYS(NOW())", //登记时间
  234. };
  235. const res = await getDataList(params);
  236. this.personUnbindList = res.data.content;
  237. // 过滤标记
  238. for (let i = 0; i < this.personUnbindList.length; i++) {
  239. const e = this.personUnbindList[i];
  240. for (let j = 0; j < this.personBindList.length; j++) {
  241. const bind = this.personBindList[j];
  242. if (bind.field001 === e.field001 && bind.field004 === e.field004) {
  243. this.personBindList[j].in = true;
  244. }
  245. }
  246. }
  247. //过滤显示
  248. this.inList = this.personBindList.filter((e) => !e.in);
  249. // console.log(
  250. // "在站",
  251. // this.personBindList,
  252. // this.personUnbindList,
  253. // this.inList
  254. // );
  255. this.refreKey++;
  256. } catch (err) {
  257. console.log(err);
  258. }
  259. },
  260. async saveComingRecord(data) {
  261. try {
  262. const res = await updateDataList(data);
  263. console.log("入场登记报表保存离站时间", data, res);
  264. this.refreKey++;
  265. } catch (err) {
  266. console.log(err);
  267. }
  268. },
  269. handleClick(data, type) {
  270. console.log("退卡了哦!", data);
  271. if (type) {
  272. switch (type) {
  273. case 1:
  274. console.log("退卡", data);
  275. let dialogConfig = {
  276. dialogId: "risk_" + data.id,
  277. show: true, //是否显示
  278. title: "退卡",
  279. width: 600, //px宽度
  280. height: 320, //px高度
  281. center: true, //是否居中定位
  282. zIndex: 10,
  283. data,
  284. };
  285. this.$store.dispatch("dialog/addRiskDialog", dialogConfig);
  286. break;
  287. case 2:
  288. console.log("确认退卡", data);
  289. this.$store.dispatch("dialog/addRiskDialog", dialogConfig);
  290. break;
  291. case 3:
  292. data.pageId = "842348058862690304";
  293. data.field013 = Dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss");
  294. console.log("确认离站", data);
  295. this.saveComingRecord(data);
  296. break;
  297. default:
  298. break;
  299. }
  300. }
  301. },
  302. },
  303. };
  304. </script>
  305. <style>
  306. .el-input__inner {
  307. height: 120px;
  308. }
  309. </style>
  310. <style lang="less" scoped>
  311. .recognize-main {
  312. width: 100%;
  313. height: 100%;
  314. padding: 100px 30px 40px;
  315. pointer-events: auto;
  316. color: #fff;
  317. .infomation_content {
  318. color: #fff;
  319. padding: 6px;
  320. height: 100%;
  321. .infomation_prompt {
  322. font-size: 40px;
  323. margin-top: 40px;
  324. margin-left: 20px;
  325. }
  326. .infomation_prop {
  327. margin-top: 100px;
  328. width: 100%;
  329. height: 100px;
  330. display: flex;
  331. justify-content: center;
  332. align-items: center;
  333. font-size: 60px;
  334. }
  335. .infomation_data_line {
  336. margin-top: 40px;
  337. }
  338. .infomation_table {
  339. height: 195px;
  340. overflow-y: scroll;
  341. }
  342. .infomation_data {
  343. width: 100%;
  344. display: flex;
  345. justify-content: left;
  346. flex-wrap: wrap;
  347. font-size: 50px;
  348. .infomation_data_content {
  349. margin-top: 2%;
  350. margin-left: 12%;
  351. width: 35%;
  352. height: 100px;
  353. justify-content: center;
  354. align-items: flex-start;
  355. }
  356. .infomation_data_content2 {
  357. margin-top: 2%;
  358. margin-left: 8%;
  359. width: 41%;
  360. height: 100px;
  361. display: flex;
  362. justify-content: center;
  363. align-items: center;
  364. }
  365. }
  366. .infomation_button {
  367. width: 100%;
  368. display: flex;
  369. justify-content: center;
  370. align-items: center;
  371. margin-top: 2%;
  372. margin-left: 20%;
  373. }
  374. }
  375. }
  376. </style>