| | |
| | | <el-col :span="24"> |
| | | <basic-container |
| | | :class="[ |
| | | $store.state.control.windowWidth >= 1024 ? 'tooRowSearch' : '', |
| | | $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '', |
| | | ]" |
| | | > |
| | | <avue-crud |
| | | class="tablesss" |
| | | :key="option.height" |
| | | :option="option" |
| | | :search.sync="search" |
| | | :table-loading="loading" |
| | |
| | | :type="type" |
| | | v-if="permission.securityGuard_delete && row.status != 2" |
| | | @click.stop="rowStatus(row)" |
| | | >离职登记 |
| | | >离职 |
| | | </el-button> |
| | | <el-button |
| | | icon="el-icon-edit" |
| | |
| | | </el-col> |
| | | <div |
| | | :class="[ |
| | | 'downSFZ', |
| | | $store.state.control.windowWidth >= 1024 |
| | | ? 'downSFZqudong' |
| | | : 'downSFZqudongS', |
| | |
| | | getUserPractitionersInfo, |
| | | updatePaperTime, |
| | | getzhiwen, //指纹 |
| | | checkAccountByUser, |
| | | } from "@/api/system/user"; |
| | | import { securityApply } from "@/api/accreditationRecords/accreditationRecords"; |
| | | import { getList } from "@/api/securityGuard/securityGuard"; |
| | | import { getDeptLazyTree } from "@/api/system/dept"; |
| | | import { getInformationDetails } from "@/api/securityUnit/securityUnit"; |
| | | import { getRoleTree, getRoleDetail } from "@/api/system/role"; |
| | | import { mapGetters } from "vuex"; |
| | | import website from "@/config/website"; |
| | |
| | | import { securityFormPageColumn } from "./data"; |
| | | import { mapState } from "vuex"; |
| | | import Qs from "qs"; |
| | | import { MessageBox } from 'element-ui'; |
| | | import { MessageBox } from "element-ui"; |
| | | //加载指纹类 |
| | | import Client from "./Client"; |
| | | |
| | |
| | | function trim(str) { |
| | | return str.replace(/(^\s*)|(\s*$)/g, ""); |
| | | } |
| | | /** |
| | | * 身份证号码账号校验 |
| | | */ |
| | | let useBack = ""; |
| | | function checkAccount(idCard, callback) { |
| | | var data = { |
| | | cardid: idCard, |
| | | }; |
| | | if (window.deptIdss) { |
| | | data["deptId"] = window.deptIdss; |
| | | } |
| | | //调用接口校验 |
| | | if (useBack != idCard) { |
| | | useBack = idCard; |
| | | checkAccountByUser(data) |
| | | .then((res) => { |
| | | useBack = "ok"; |
| | | callback(); |
| | | }) |
| | | .catch((error) => { |
| | | callback("当前身份证号码已录入!"); |
| | | }); |
| | | } else if (useBack == "ok") { |
| | | callback(); |
| | | } else { |
| | | console.log("cf"); |
| | | callback(new Error("当前身份证号码已录入!")); |
| | | } |
| | | } |
| | | const validatePassCardid = (rule, value, callback) => { |
| | | let ok = false; |
| | | if (value.length == 18) { |
| | |
| | | } |
| | | |
| | | if (ok) { |
| | | callback(); |
| | | // console.log(this.nowCell,123456); |
| | | if(this.type==1 || this.nowCell==2){ |
| | | //修改不校验身份证hao |
| | | callback(); |
| | | }else{ |
| | | //调用接口进行账户重复校验 |
| | | checkAccount(value, callback); |
| | | } |
| | | |
| | | } else { |
| | | callback(new Error("身份证错误")); |
| | | } |
| | |
| | | callback(); |
| | | } |
| | | }; |
| | | // let table = document.getElementsByClassName("tablesss"); |
| | | // let heard = table[0].getElementsByClassName("avue-crud__search"); |
| | | // let usNum = |
| | | // this.windowWidth <= 1376 && this.windowHeight <= 778 ? 170 : 332; |
| | | // // that.option.height = +h - (+heard[0].clientHeight + 332); |
| | | // let optionHeight = +this.windowHeight - (+heard[0].clientHeight + +usNum); |
| | | return { |
| | | sort: "", |
| | | type:2, |
| | | sortName: "", |
| | | nowCell: "", //空为手动,2为身份证设备读取 |
| | | // 表格数据 |
| | | defaults: {}, |
| | |
| | | }, |
| | | }, |
| | | choiceList: [], |
| | | deptIdss: "", |
| | | option: { |
| | | searchIndex: 5, //收缩展示数量 |
| | | searchIcon: true, //搜索是否收缩 |
| | | height: "auto", |
| | | calcHeight: 80, |
| | | tip: true, |
| | |
| | | }, |
| | | indexWidth: 55, |
| | | searchMenuSpan: 6, |
| | | |
| | | stripe: true, |
| | | border: true, |
| | | delBtn: true, |
| | |
| | | }, |
| | | canvasOption: { |
| | | text: " ", |
| | | ratio: 0.1, |
| | | ratio: 1.0, |
| | | }, |
| | | action: "/api/blade-resource/oss/endpoint/put-files", |
| | | tip: "上传身份证一寸近期彩色正面免冠图象, (358像素(宽) × 441像素(高)、分辨率350dpi)且不超过500kb", |
| | | tip: "上传近期一寸彩色正面免冠图象, (358像素(宽) × 441像素(高)、分辨率350dpi)且不小于30kb,不超过500kb", |
| | | span: 12, |
| | | // row: true, |
| | | prop: "avatar", |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择", |
| | | message: "请选择是否有持证", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | |
| | | label: "保安员证编号", |
| | | prop: "securitynumber", |
| | | hide: true, |
| | | display: true, |
| | | rules: [ |
| | | { |
| | | required: false, |
| | | message: "请输入保安员证编号", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "发证日期", |
| | | // prop: "paperTime", |
| | | // hide: true, |
| | | // type: "date", |
| | | // format: "yyyy-MM-dd", |
| | | // valueFormat: "yyyy-MM-dd", |
| | | // }, |
| | | { |
| | | label: "电子邮箱", |
| | | label: "保安证书照片", |
| | | prop: "email", |
| | | type: "upload", |
| | | listType: "picture-img", |
| | | display: true, |
| | | propsHttp: { |
| | | res: "data", |
| | | url: "url", |
| | | }, |
| | | canvasOption: { |
| | | text: " ", |
| | | ratio: 1.0, |
| | | }, |
| | | action: "/api/blade-resource/oss/endpoint/put-files", |
| | | tip: "上传jpg,png格式图片,大小不超过2M", |
| | | span: 12, |
| | | }, |
| | | // { |
| | | // label: "籍贯", |
| | | // prop: "nativeplace", |
| | | // }, |
| | | { |
| | | label: "民族", |
| | | prop: "nation", |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | tablevisible: true, |
| | | isNotChangeSize: true, //取消表格loging |
| | | }; |
| | | }, |
| | | watch: { |
| | | windowHeight() { |
| | | let that = this; |
| | | that.isNotChangeSize = false; //取消表格loging |
| | | let d = { |
| | | fn: function (h) { |
| | | let table = document.getElementsByClassName("tablesss"); |
| | | let heard = table[0].getElementsByClassName("avue-crud__search"); |
| | | let usNum = |
| | | that.windowWidth <= 1376 || that.windowHeight <= 778 ? 170 : 302; |
| | | // // that.option.height = +h - (+heard[0].clientHeight + 332); |
| | | // alert(h); |
| | | let doit = (height) => { |
| | | let hs = height || h; |
| | | // alert(hs); |
| | | // alert(heard[0].clientHeight); |
| | | // alert(usNum); |
| | | that.option.height = +hs - (+heard[0].clientHeight + +usNum); |
| | | that.$nextTick(() => { |
| | | that.refreshChange(); |
| | | setTimeout(() => { |
| | | let d = { |
| | | that: this, |
| | | otherclass: ["downSFZ"], |
| | | haveOpen: true, |
| | | }; |
| | | //刷新表格后再次调整按钮 |
| | | that.$store.dispatch("TABLE_CHANGEBUTPOSITION", d); |
| | | that.isNotChangeSize = true; //恢复表格loging |
| | | }, 10); |
| | | }); |
| | | }; |
| | | if (that.option.height == "auto") { |
| | | //解决第一次未渲染成功会报错的问题 |
| | | setTimeout(() => { |
| | | // console.log( |
| | | // document |
| | | // .getElementsByClassName("tablesss")[0] |
| | | // .getElementsByClassName("avue-crud__search") |
| | | // ); |
| | | doit(window.innerHeight); |
| | | }, 150); |
| | | } else { |
| | | doit(); |
| | | } |
| | | }, |
| | | }; |
| | | this.$store.dispatch("WHchangeHight", d); |
| | | }, |
| | | radio() { |
| | | if (this.radio) { |
| | | this.SFZloding = true; |
| | |
| | | this.initData(this.form.tenantId); |
| | | } |
| | | }, |
| | | "form.deptId": { |
| | | handler(val) { |
| | | if (val) { |
| | | window.deptIdss = val; |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | "form.hold": { |
| | | handler(val) { |
| | | var securitynumbercolumn = this.findObject( |
| | | this.option.group, |
| | | "securitynumber" |
| | | ); |
| | | var emailcolumn = this.findObject(this.option.group, "email"); |
| | | // console.log(val,1234); |
| | | if (val == 1) { |
| | | securitynumbercolumn.display = true; |
| | | securitynumbercolumn.rules = [ |
| | | { |
| | | required: true, |
| | | message: "请输入保安员证编号", |
| | | trigger: "blur", |
| | | }, |
| | | ]; |
| | | emailcolumn.display = true; |
| | | } else { |
| | | securitynumbercolumn.display = false; |
| | | securitynumbercolumn.rules = [ |
| | | { |
| | | required: false, |
| | | message: "请输入保安员证编号", |
| | | trigger: "blur", |
| | | }, |
| | | ]; |
| | | emailcolumn.display = false; |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | "form.fingerprint"() { |
| | | let that = this; |
| | | if (this.form.fingerprint != undefined) { |
| | |
| | | isoks: isoks, |
| | | }); |
| | | } |
| | | |
| | | setTimeout(() => { |
| | | // if() |
| | | var doZhiwen = () => { |
| | | if (!this.form.id) { |
| | | sets(false); |
| | | return; |
| | |
| | | } |
| | | } |
| | | }); |
| | | }, 1800); |
| | | }; |
| | | |
| | | setTimeout(() => { |
| | | // var iframeDom = document.getElementById("zhiwen"); |
| | | // console.log(iframeDom,111111); |
| | | // iframeDom.onload = function () { |
| | | // doZhiwen(); |
| | | // }; |
| | | doZhiwen(); |
| | | }, 2800); |
| | | } else { |
| | | that.isopen = false; |
| | | } |
| | |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | ...mapGetters(["userInfo", "permission", "windowHeight", "windowWidth"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.securityGuard_add, false), |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | // let d = { |
| | | // that: this, |
| | | // otherclass: ["downSFZ"], |
| | | // haveOpen: true, |
| | | // flowHeight: 332, |
| | | // }; |
| | | // this.$store.dispatch("TABLE_CHANGEBUTPOSITION", d); |
| | | // console.log((this.$refs.crud._props.option.height = 200)); |
| | | this.changeButsPosition("TABLE_CHANGEBUTPOSITION"); |
| | | // this.option.column[0].hide = true |
| | | // 非保安单位模式默认加载管理组数据 |
| | | if (!website.tenantMode) { |
| | |
| | | // this.olondSFZ(); //检查身份证设备是否存在 |
| | | }, |
| | | methods: { |
| | | changeButsPosition(val) { |
| | | let d = { |
| | | that: this, |
| | | otherclass: ["downSFZ"], |
| | | haveOpen: true, |
| | | from: "mounted", |
| | | }; |
| | | // 开始就适应高度 |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | this.$store.dispatch("TABLE_CHANGEBUTPOSITION", d); |
| | | }, |
| | | openccc() { |
| | | console.log(this.zhiwenImg); |
| | | // console.log(this.zhiwenChart); |
| | |
| | | }; |
| | | updatePaperTime(data); |
| | | }, |
| | | rowClickSelf(row) { |
| | | this.$router.push({ |
| | | path: "/securityUnitChild", |
| | | query: { fromSecunityGuardId: row }, |
| | | }); |
| | | rowClickSelf(deptId) { |
| | | var data = { |
| | | departmentid:deptId |
| | | } |
| | | getInformationDetails(data).then((res) => { |
| | | var obj = res.data.data; |
| | | var data = JSON.stringify(obj); |
| | | this.$router.push({ |
| | | path: "/securityUnitChild", |
| | | query: { data: data }, |
| | | }); |
| | | }) |
| | | }, |
| | | nodeClick(data) { |
| | | this.treeDeptId = data.id; |
| | |
| | | return securityApply(data); |
| | | }) |
| | | .then(() => { |
| | | // this.$refs.crud.toggleSelection(); |
| | | this.$refs.crud.toggleSelection(); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | |
| | | return securityApply(data); |
| | | }) |
| | | .then(() => { |
| | | // this.$refs.crud.toggleSelection(); |
| | | this.$refs.crud.toggleSelection(); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | |
| | | }, |
| | | selectionClear() { |
| | | // this.selectionList = []; |
| | | this.sort = ""; |
| | | this.sortName = ""; |
| | | // this.$refs.crud.toggleSelection(); |
| | | }, |
| | | handleDelete() { |
| | |
| | | var that = this; |
| | | // console.log(type, 123); |
| | | this.beginSFZ(); |
| | | if (["edit"].includes(type)) { |
| | | this.type = 1; |
| | | } |
| | | if (["add"].includes(type)) { |
| | | this.type = 2; |
| | | } |
| | | if (["edit", "view"].includes(type)) { |
| | | getUser(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | |
| | | }, |
| | | //排序 |
| | | sortChange(value) { |
| | | console.log(value, 51151515); |
| | | // console.log(value, 51151515); |
| | | if (value.order == "ascending") { |
| | | this.sort = "asc"; |
| | | } |
| | | if (value.order == "descending") { |
| | | this.sort = "desc"; |
| | | } |
| | | this.sortName = value.prop; |
| | | //字段匹配 |
| | | if (value.prop == "sexs") { |
| | | this.sortName = "sex"; |
| | | } |
| | | if (value.prop == "examinationType") { |
| | | this.sortName = "examination_type"; |
| | | } |
| | | if (value.prop == "userType") { |
| | | this.sortName = "user_type"; |
| | | } |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | if (this.isNotChangeSize) { |
| | | this.loading = true; |
| | | } |
| | | params = this.search; |
| | | var that = this; |
| | | //获取当前登录人员的角色信息 |
| | |
| | | "/api/blade-system/dept/security_lazy-tree"; |
| | | } |
| | | |
| | | if (this.sort) { |
| | | params["sort"] = this.sort; |
| | | } |
| | | if (this.sortName) { |
| | | params["sortName"] = this.sortName; |
| | | } |
| | | |
| | | let values = { |
| | | ...params, |
| | | }; |
| | |
| | | ...that.query, |
| | | }; |
| | | |
| | | that.loading = true; |
| | | getList(page.currentPage, page.pageSize, values).then((res) => { |
| | | const data = res.data.data; |
| | | that.page.total = data.total; |
| | |
| | | //照片上传拦截 |
| | | uploadBefore(file, done, loading, column) { |
| | | //如果你想修改file文件,由于上传的file是只读文件,必须复制新的file才可以修改名字,完后赋值到done函数里,如果不修改的话直接写done()即可 |
| | | if (file.type.indexOf("image/") == -1) { |
| | | MessageBox.alert("上传图片格式错误,请上传图片类型,如:JPG,PNG后缀的文件。") |
| | | loading(); |
| | | return false; |
| | | } |
| | | let data = window.URL.createObjectURL(new Blob([file])); |
| | | this.filename = file; |
| | | this.option.img = data; |
| | | //判断文件大小 |
| | | const isLt1M = file.size >= 30*1024 && file.size <= 500*1024; |
| | | if (!isLt1M) { |
| | | MessageBox.alert("上传图片大小必须大于30KB,且小于500KB!") |
| | | loading(); |
| | | return false; |
| | | //判断角色 |
| | | if (this.userInfo.role_name != "administrator") { |
| | | if (file.type.indexOf("image/") == -1) { |
| | | MessageBox.alert( |
| | | "上传图片格式错误,请上传图片类型,如:JPG,PNG后缀的文件。" |
| | | ); |
| | | loading(); |
| | | return false; |
| | | } |
| | | let data = window.URL.createObjectURL(new Blob([file])); |
| | | this.filename = file; |
| | | this.option.img = data; |
| | | //判断文件大小 |
| | | const isLt1M = file.size >= 30 * 1024 && file.size <= 500 * 1024; |
| | | if (!isLt1M) { |
| | | MessageBox.alert("上传图片大小必须大于30KB,且小于500KB!"); |
| | | loading(); |
| | | return false; |
| | | } |
| | | done(); |
| | | return isLt1M; |
| | | } |
| | | done(); |
| | | return isLt1M; |
| | | }, |
| | | }, |
| | | }; |