index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="68px"
  9. >
  10. <el-form-item prop="offduty">
  11. <el-select v-model="ipDi" placeholder="请选择考勤地址" clearable>
  12. <el-option
  13. v-for="item in ipList"
  14. :key="item.id"
  15. :label="item.ip"
  16. :value="item.ip"
  17. >
  18. </el-option>
  19. </el-select>
  20. </el-form-item>
  21. <!-- <el-form-item prop="offduty">
  22. <el-select
  23. v-model="queryParams.offduty"
  24. placeholder="请选择是否在职"
  25. clearable
  26. >
  27. <el-option
  28. v-for="item in renList"
  29. :key="item.dictValue"
  30. :label="item.dictLabel"
  31. :value="item.dictValue"
  32. >
  33. </el-option>
  34. </el-select>
  35. </el-form-item> -->
  36. <el-form-item>
  37. <el-button size="btr" @click="handleQuery">搜索</el-button>
  38. <el-button size="btr" @click="resetQuery">重置</el-button>
  39. </el-form-item>
  40. </el-form>
  41. <el-row :gutter="10" class="mb8"> </el-row>
  42. <el-table
  43. v-loading="loading"
  44. :data="bdglevenList"
  45. :header-cell-style="{ background: '#003C69', color: 'white' }"
  46. >
  47. <!-- <el-table-column label="序号" align="center" prop="id" /> -->
  48. <el-table-column label="序号" type="index" width="50" align="center">
  49. <template scope="scope">
  50. <span>{{
  51. (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
  52. }}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="编号" align="center" prop="pin" />
  56. <el-table-column label="姓名" align="center" prop="name" />
  57. <el-table-column
  58. label="单位"
  59. align="center"
  60. prop="deptname"
  61. show-overflow-tooltip
  62. />
  63. <el-table-column label="手机号码" align="center" prop="mobile" />
  64. <el-table-column label="办公电话" align="center" prop="telephone" />
  65. <el-table-column label="状态" align="center" prop="status">
  66. <template slot-scope="scope">
  67. <span v-if="scope.row.status == 0">在职</span>
  68. <span v-else>离职</span>
  69. </template>
  70. </el-table-column>
  71. </el-table>
  72. <pagination
  73. v-show="total > 0"
  74. :total="total"
  75. :page.sync="queryParams.pageNum"
  76. :limit.sync="queryParams.pageSize"
  77. @pagination="getList"
  78. />
  79. </div>
  80. </template>
  81. <script>
  82. import axios from "axios";
  83. import { getDicts } from "@/api/system/dict/data";
  84. import { getDept } from "@/api/grassrootsregistration/bdglmeeting";
  85. import { listIpaddressconfig } from "@/api/access/accessControl";
  86. // 导入树形结构
  87. import Treeselect from "@riophae/vue-treeselect";
  88. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  89. export default {
  90. name: "access",
  91. components: {
  92. Treeselect,
  93. },
  94. data() {
  95. return {
  96. // 查询参数
  97. queryParams: {
  98. number: 0,
  99. pageNum: 1,
  100. pageSize: 10,
  101. },
  102. bdglevenList: [],
  103. // 显示搜索条件
  104. showSearch: true,
  105. // 遮罩层
  106. loading: false,
  107. // 总条数
  108. total: 0,
  109. // 人员数据
  110. renList: [],
  111. // 弹出层标题
  112. title: "",
  113. // 是否显示弹出层
  114. open: false,
  115. form: {},
  116. rules: {
  117. name: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
  118. email: [
  119. { required: true, message: "请输入邮箱地址", trigger: "blur" },
  120. {
  121. type: "email",
  122. message: "请输入正确的邮箱地址",
  123. trigger: ["blur", "change"],
  124. },
  125. ],
  126. },
  127. // 树形结构列表
  128. deptOptions: [],
  129. // 考勤机ipList
  130. ipList: [],
  131. ipDi: null,
  132. // 192.168.5.188:85
  133. };
  134. },
  135. created() {
  136. // 获取列表
  137. this.getTiem();
  138. // 字典在位情况
  139. getDicts("sys_zai").then((res) => {
  140. this.renList = res.data;
  141. });
  142. listIpaddressconfig().then((res) => {
  143. this.ipList = res.rows;
  144. });
  145. },
  146. methods: {
  147. // 表单重置
  148. reset() {
  149. this.form = {};
  150. this.resetForm("form");
  151. },
  152. // 取消按钮
  153. cancel() {
  154. this.open = false;
  155. this.reset();
  156. },
  157. // 获取部门列表
  158. getBuMeng() {
  159. getDept().then((res) => {
  160. this.deptOptions = res.data;
  161. });
  162. },
  163. // 获取人员
  164. getTiem() {
  165. this.getList(this.queryParams.number);
  166. },
  167. // 点击搜索
  168. handleQuery() {
  169. this.getList(this.queryParams.number);
  170. },
  171. // 重置
  172. resetQuery() {
  173. // this.getTiem();
  174. this.ipDi=null;
  175. },
  176. getList(number) {
  177. this.loading = true;
  178. axios
  179. .post(
  180. `http://${this.ipDi}/api/v2/employee/get/?key=2633p84hnnlavzcy9afjcbtj1jdnega0ftscjkka6h7a`,
  181. {
  182. number,
  183. }
  184. )
  185. .then((res) => {
  186. this.loading = false;
  187. this.bdglevenList = res.data.data.items;
  188. this.total = res.data.data.items.length;
  189. });
  190. },
  191. },
  192. };
  193. </script>
  194. <style scoped>
  195. /* 对话框背景颜色 */
  196. ::v-deep .el-dialog {
  197. background: #004d86 !important;
  198. width: 800px !important;
  199. }
  200. ::v-deep .el-textarea__inner {
  201. width: 920px;
  202. height: 104px;
  203. margin: auto;
  204. }
  205. ::v-deep .el-dialog__header {
  206. border-bottom: 1px solid #718a9d;
  207. }
  208. ::v-deep .el-dialog__title {
  209. color: #fff;
  210. font: 18px;
  211. }
  212. ::v-deep .el-dialog__headerbtn .el-dialog__close {
  213. color: #fff;
  214. }
  215. ::v-deep .el-form-item__label {
  216. font: 16px;
  217. color: #fff;
  218. width: 100px !important;
  219. }
  220. ::v-deep .el-input__inner {
  221. /* width: 200px !important;
  222. height: 36px; */
  223. background: transparent;
  224. color: #fff;
  225. border: 1px solid white !important;
  226. }
  227. /* 基本信息背景 */
  228. .jiben {
  229. width: 720px;
  230. height: 32px;
  231. background-image: url(../../../images/小标题底.png);
  232. background-size: 100%;
  233. margin-bottom: 25px;
  234. color: #fff;
  235. padding-left: 16px;
  236. line-height: 32px;
  237. }
  238. /*调整表单间距 */
  239. ::v-deep .el-form-item__content {
  240. width: 200px;
  241. }
  242. ::v-deep .el-input__inner {
  243. cursor: pointer !important;
  244. }
  245. /* 底部确定取消按钮 */
  246. ::v-deep .el-dialog__footer {
  247. padding: 18px 50px !important;
  248. margin-right: 77px !important;
  249. }
  250. ::v-deep .el-dialog__body {
  251. margin: 10px 0px 20px 51px;
  252. padding-top: 20px !important;
  253. box-sizing: border-box;
  254. /* padding: 30px 12px 30px 28px; */
  255. }
  256. .contents {
  257. padding: 0px 40px !important;
  258. }
  259. /* 下拉菜单 */
  260. .el-dropdown-link {
  261. cursor: pointer;
  262. color: #409eff;
  263. }
  264. .el-icon-arrow-down {
  265. font-size: 12px;
  266. }
  267. /* 下拉菜单字体/背景颜色 */
  268. .el-select-dropdown__item.hover,
  269. .el-select-dropdown__item:hover {
  270. background-color: #004d86;
  271. color: #111;
  272. }
  273. .el-select-dropdown__item {
  274. color: #111;
  275. }
  276. /* 时间选择 */
  277. ::v-deep .el-input--small .el-input__inner {
  278. width: 200px;
  279. height: 36px;
  280. line-height: 36px;
  281. }
  282. .el-date-editor.el-input {
  283. width: 200px;
  284. height: 36px;
  285. line-height: 36px;
  286. }
  287. ::v-deep .el-date-editor.el-input .el-input__inner {
  288. height: 36px;
  289. line-height: 36px;
  290. }
  291. /* 单位框背景颜色 */
  292. ::v-deep .vue-treeselect__control {
  293. background: transparent !important;
  294. color: #fff;
  295. }
  296. /* 单位下拉菜单选中字体颜色 */
  297. ::v-deep .vue-treeselect__single-value {
  298. color: #fff !important;
  299. }
  300. /* 分页按钮 */
  301. ::v-deep .el-pagination.is-background .el-pager li {
  302. background-color: #004d86;
  303. color: #fff;
  304. }
  305. ::v-deep .el-pagination.is-background .btn-next {
  306. background-color: #004d86;
  307. color: #fff;
  308. }
  309. /* 底部确定取消按钮 */
  310. ::v-deep .el-dialog__footer {
  311. padding: 18px 50px;
  312. margin-right: 42px;
  313. }
  314. ::v-deep .el-dialog__body {
  315. padding: none !important;
  316. }
  317. /* 小手样式 */
  318. ::v-deep .el-table__cell {
  319. cursor: pointer;
  320. }
  321. .el-button--mini {
  322. width: 80px !important;
  323. border: 1px solid transparent;
  324. padding: 3px 8px;
  325. font-size: 14px;
  326. line-height: 1.5;
  327. border-radius: 3px;
  328. color: #fff;
  329. background-color: #1890ff;
  330. }
  331. /* ::v-deep .el-table__body tr.hover-row > td.el-table__cell {
  332. background-color: none;
  333. } */
  334. ::v-deep .el-table .el-table__body .el-table__row.hover-row td {
  335. background-color: #004d86;
  336. }
  337. ::v-deep .el-table__fixed-right {
  338. height: 100% !important;
  339. }
  340. ::v-deep .box {
  341. background-color: #ffba00 !important;
  342. }
  343. ::v-deep .el-input.is-disabled .el-input__inner {
  344. background-color: transparent;
  345. color: #fff;
  346. }
  347. </style>