+
重试
@@ -2189,22 +2198,22 @@
:total="Number(total)"
background
> -->
-
@@ -2244,103 +2253,103 @@ import {
sendBatchWokerApi,
importImgDataApi,
xmglXzHikvisionSyncGetNewestList,
- xmglXzHikvisionSyncRetryAPI
-} from '@/assets/js/api/laborPerson'
+ xmglXzHikvisionSyncRetryAPI,
+} from "@/assets/js/api/laborPerson";
import {
selectUserDevAuthorityByUserIdApi,
- exporExcelWorkerTemplateApi
-} from '@/assets/js/api/configManage'
+ exporExcelWorkerTemplateApi,
+} from "@/assets/js/api/configManage";
import {
checkPhone,
CheckSocialCreditCode,
- IdentityCodeValid
-} from '@/assets/js/util.js'
-import { getProjectConfigListApi } from '@/assets/js/api/project.js'
-import { VueCropper } from 'vue-cropper'
+ IdentityCodeValid,
+} from "@/assets/js/util.js";
+import { getProjectConfigListApi } from "@/assets/js/api/project.js";
+import { VueCropper } from "vue-cropper";
-import { apiUploadImage } from '@/assets/js/api/common'
-import lrz from 'lrz'
+import { apiUploadImage } from "@/assets/js/api/common";
+import lrz from "lrz";
export default {
components: {
- VueCropper
+ VueCropper,
},
- data () {
+ data() {
return {
issuePointList: [],
typeRadio: 1,
refreshPage: true, //静默刷新
- radio: '',
+ radio: "",
key: false, //判断是否显示一件下发按钮
COMPANY: COMPANY,
isCheckeedData: true, //判断一键下发是否有数据选中
ufaceDevAllList: [], //所有人脸设备
uGroupAllList: [], //所有分组
projectSn: null, //projectSn 项目sn
- uploadUrl: '', //文件上传地址
- fileUrl: '', //文件上传地址
+ uploadUrl: "", //文件上传地址
+ fileUrl: "", //文件上传地址
showImgList: false,
// ------------------------------------------------------------------
- enterpriseName: '', //劳务公司名称 || 企业名称
+ enterpriseName: "", //劳务公司名称 || 企业名称
enterpriseListData: [], //企业列表 || 劳务公司列表
checkedId: 0, //选中的企业
//新增企业表单
enterpriseForm: {
- name: '',
- bankcardnumber: '', //银行卡号
- bankname: '', // 开户行
- businessLicenseEndDate: '', // 营业执照截止日期
- businessNumber: '', //营业执照注册号
- enterpriseAddress: '', //企业地址
- enterpriseEmail: '', //企业邮箱
- enterpriseLegalPerson: '', //法定代表人
- enterpriseName: '', //企业名称
- enterpriseProperty: '', //单位性质 1.国有企业 2三资企业 3集体企业 4私营企业
- enterpriseQualificationUrl: '', //企业资质图片地址
- enterpriseSafeAllow: '', //企业安全生产许可证
- enterpriseTypeId: '', //企业类型Id
- legalPersonTel: '', //法人电话
- logo: '', //logo
- projectSn: '', //项目Sn
- qualificationNumber: '', //资质证书号
- registerPersonPhoneTel: '', //注册人电话
- registeredCapital: '', //注册资金
- socialCode: '' //社会统一信用代码
+ name: "",
+ bankcardnumber: "", //银行卡号
+ bankname: "", // 开户行
+ businessLicenseEndDate: "", // 营业执照截止日期
+ businessNumber: "", //营业执照注册号
+ enterpriseAddress: "", //企业地址
+ enterpriseEmail: "", //企业邮箱
+ enterpriseLegalPerson: "", //法定代表人
+ enterpriseName: "", //企业名称
+ enterpriseProperty: "", //单位性质 1.国有企业 2三资企业 3集体企业 4私营企业
+ enterpriseQualificationUrl: "", //企业资质图片地址
+ enterpriseSafeAllow: "", //企业安全生产许可证
+ enterpriseTypeId: "", //企业类型Id
+ legalPersonTel: "", //法人电话
+ logo: "", //logo
+ projectSn: "", //项目Sn
+ qualificationNumber: "", //资质证书号
+ registerPersonPhoneTel: "", //注册人电话
+ registeredCapital: "", //注册资金
+ socialCode: "", //社会统一信用代码
},
//校验新增企业表单
- enterpriseFormRules: this.$t('message.laborMange.enterpriseFormRules'),
+ enterpriseFormRules: this.$t("message.laborMange.enterpriseFormRules"),
//民族
- nationList: this.$t('message.laborMange.nationList'),
+ nationList: this.$t("message.laborMange.nationList"),
imgFileList: [], // 照片文件列表
aptitudeFileList: [], //资质照片列表
logoFileList: [], //logo 文件列表
enterpriseTypeList: [], //新增企业 企业类型下拉
bigImageDialog: false, //查看大图
- bigImageUrl: '', //大图地址
- enterpriseDialogTitle: this.$t('message.laborMange.theNewEnterprise'), // 用于判断 是新增 还是编辑 修改字段要谨慎啊
+ bigImageUrl: "", //大图地址
+ enterpriseDialogTitle: this.$t("message.laborMange.theNewEnterprise"), // 用于判断 是新增 还是编辑 修改字段要谨慎啊
addEnterpriseDialog: false, //新增企业 弹窗
/*-------------------
-----------------------右边数据字段----------------
---------------*/
- teamDialogTitle: this.$t('message.laborMange.theNewTeam'),
+ teamDialogTitle: this.$t("message.laborMange.theNewTeam"),
addTeamDialog: false, // 新增班组 弹窗
//班组信息
teamForm: {
- describeValue: '', //描述
- leaderIdCard: '', //负责人身份证号
- leaderName: '', //负责人姓名
- leaderPhone: '', //负责人手机号
- teamName: '', //班组名称
- teamType: '', //班组类型
- workerTypeId: '', //工种id
- specialTeam: 0 //是否是特殊班组 0否,1是
+ describeValue: "", //描述
+ leaderIdCard: "", //负责人身份证号
+ leaderName: "", //负责人姓名
+ leaderPhone: "", //负责人手机号
+ teamName: "", //班组名称
+ teamType: "", //班组类型
+ workerTypeId: "", //工种id
+ specialTeam: 0, //是否是特殊班组 0否,1是
},
specialTeam: 0,
//班组校验
- teamFormRules: this.$t('message.laborMange.teamFormRules'),
+ teamFormRules: this.$t("message.laborMange.teamFormRules"),
workerTypeList: [], // 班组 工种
- showEnterpriseName: '', //头部的企业名称
+ showEnterpriseName: "", //头部的企业名称
teamListData: {}, // 班组列表
checkedTeamId: 0, //选中的班组id
pageSize: 10,
@@ -2348,59 +2357,59 @@ export default {
total: 0,
//请求表格参数
tableParameter: {
- idCard: '',
+ idCard: "",
personType: 1,
- projectSn: '',
- teamId: '',
- workerName: '',
- inserviceType: '',
- enterDate: '',
- codeState: ''
+ projectSn: "",
+ teamId: "",
+ workerName: "",
+ inserviceType: "",
+ enterDate: "",
+ codeState: "",
},
tableListData: [], //表格数据
- personDialogTitle: this.$t('message.laborMange.personnelEntry'),
- titleType: 'add',
+ personDialogTitle: this.$t("message.laborMange.personnelEntry"),
+ titleType: "add",
imgImportDialog: false, //照片导入 弹窗
addPersonDialog: false, //人员录入 弹窗
//人员表单字段
personForm: {
- workerName: '',
- sex: '',
- idCard: '',
- birthday: '',
- enterDate: '',
- nation: '',
- nativePlace: '',
- isUploadHousing: '',
- issuingAuthorityForIdcard: '',
- idCardEndDate: '',
+ workerName: "",
+ sex: "",
+ idCard: "",
+ birthday: "",
+ enterDate: "",
+ nation: "",
+ nativePlace: "",
+ isUploadHousing: "",
+ issuingAuthorityForIdcard: "",
+ idCardEndDate: "",
longTerm: false,
- phoneNumber: '',
- emergentPerson: '',
- emergentPhone: '',
- inserviceType: '',
- politicsStatus: '',
- marry: '',
- payRollBankName: '',
- payRollBankNumber: '',
- educational: '',
- blood: '',
- examinationImage: '',
- contractImage: '',
- employmentCard: '',
- idCardBigPhotoUrl: '',
- fieldAcquisitionUrl: '',
+ phoneNumber: "",
+ emergentPerson: "",
+ emergentPhone: "",
+ inserviceType: "",
+ politicsStatus: "",
+ marry: "",
+ payRollBankName: "",
+ payRollBankNumber: "",
+ educational: "",
+ blood: "",
+ examinationImage: "",
+ contractImage: "",
+ employmentCard: "",
+ idCardBigPhotoUrl: "",
+ fieldAcquisitionUrl: "",
personType: 1,
- idCardUpPhotoUrl: '',
- idCardDownPhotoUrl: '',
- ruleId: '',
+ idCardUpPhotoUrl: "",
+ idCardDownPhotoUrl: "",
+ ruleId: "",
ufaceDevId: [],
ufaceDevGroupId: [],
- personSerial: '',
- locationCardno: '' //人员定位标签号
+ personSerial: "",
+ locationCardno: "", //人员定位标签号
},
//人员录入校验
- personFormRules: this.$t('message.laborMange.personFormRules2'),
+ personFormRules: this.$t("message.laborMange.personFormRules2"),
//显示的文件列表
examinationFile: [], //体检报告
@@ -2417,8 +2426,8 @@ export default {
batchMoveDialog: false, //批量移动弹窗
//批量移动表单
batchMoveForm: {
- teamId: '',
- enterpriseId: ''
+ teamId: "",
+ enterpriseId: "",
},
moveTeamList: [], // 选择移动的班组的列表
showTeamList: false, //显示班组列表
@@ -2428,116 +2437,116 @@ export default {
webSocket: null,
instrUmentScreenDialog: false,
- umentScreenUrl: '',
- base64Type: 'data:image/jpeg;base64,',
+ umentScreenUrl: "",
+ base64Type: "data:image/jpeg;base64,",
isUploadToHouse: false, //是否显示上传到住建局按钮
attendRulesList: [],
- enterpriseTypeId: '',
+ enterpriseTypeId: "",
cropperOption: {
- outputType: 'png',
- img: '',
+ outputType: "png",
+ img: "",
autoCropWidth: 300, // 默认生成截图框宽度
- autoCropHeight: 360 // 默认生成截图框高度
+ autoCropHeight: 360, // 默认生成截图框高度
},
cropperDialog: false,
enterpriseTreeData: [],
- defaultId: '',
+ defaultId: "",
isIndeterminate2: false,
isIndeterminate3: false,
checkAllFaceDev: false,
checkAllGroupDev: false,
- fileTemp: '',
+ fileTemp: "",
imgRadiolist: [],
- isSzProject: '',
+ isSzProject: "",
issueTeamDialog: false,
issuePage: {
pageNo: 1,
- pageSize: 10
+ pageSize: 10,
},
- whoId:''
- }
+ whoId: "",
+ };
},
- created () {
- this.projectSn = this.$store.state.projectSn
- this.uploadUrl = this.$store.state.UPLOADURL
- this.fileUrl = this.$store.state.FILEURL
- let data = JSON.parse(sessionStorage.getItem('vuex'))
+ created() {
+ this.projectSn = this.$store.state.projectSn;
+ this.uploadUrl = this.$store.state.UPLOADURL;
+ this.fileUrl = this.$store.state.FILEURL;
+ let data = JSON.parse(sessionStorage.getItem("vuex"));
// console.log('vuex信息',data)
- data.menuList.forEach(item => {
+ data.menuList.forEach((item) => {
if (item.actionList) {
- item.actionList.find(item2 => {
- if (item2.actionCode == 'akey_issued') {
- this.key = true
+ item.actionList.find((item2) => {
+ if (item2.actionCode == "akey_issued") {
+ this.key = true;
}
// console.log('this.key', this.key)
- })
+ });
}
- })
- if (sessionStorage.getItem('personPage')) {
- this.page = JSON.parse(sessionStorage.getItem('personPage'))
+ });
+ if (sessionStorage.getItem("personPage")) {
+ this.page = JSON.parse(sessionStorage.getItem("personPage"));
}
- if (sessionStorage.getItem('companyPage')) {
- this.checkedId = JSON.parse(sessionStorage.getItem('companyPage'))
+ if (sessionStorage.getItem("companyPage")) {
+ this.checkedId = JSON.parse(sessionStorage.getItem("companyPage"));
}
- this.getConfig()
+ this.getConfig();
- this.getProjectList()
- this.getAttendRuleList()
- this.getHierarchyEnterpriseList()
- this.getUfaceDevList()
- this.getUGroupDevList()
- this.getProjectConfig()
+ this.getProjectList();
+ this.getAttendRuleList();
+ this.getHierarchyEnterpriseList();
+ this.getUfaceDevList();
+ this.getUGroupDevList();
+ this.getProjectConfig();
},
- mounted () {
+ mounted() {
// this.webSocket = new WebSocket("ws://127.0.0.1:1818");
- this.getEnterpriseType()
+ this.getEnterpriseType();
},
computed: {
- headers () {
+ headers() {
return {
- Authorization: this.$store.state.userInfo.token
- }
- }
+ Authorization: this.$store.state.userInfo.token,
+ };
+ },
},
methods: {
- handleImportSuccess (response, file, fileList) {
- console.log(response, file, fileList)
- this.imgFileList = fileList
- console.log(this.imgFileList)
+ handleImportSuccess(response, file, fileList) {
+ console.log(response, file, fileList);
+ this.imgFileList = fileList;
+ console.log(this.imgFileList);
},
- handleImportExceed (files, fileList) {
+ handleImportExceed(files, fileList) {
/*this.$message.warning(
`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
files.length + fileList.length
} 个文件`
);*/
this.$message.warning(
- this.$t('message.docManage.dialog_upload_files.limitingChoice')
- ) //当前限制选择 1 个文件
+ this.$t("message.docManage.dialog_upload_files.limitingChoice")
+ ); //当前限制选择 1 个文件
},
- handleUpload (fileData, type) {
- const file = fileData.file
+ handleUpload(fileData, type) {
+ const file = fileData.file;
// 压缩图片
- lrz(file, { quality: 1 }).then(result => {
- const formData = new FormData()
- formData.append('files', result.file)
+ lrz(file, { quality: 1 }).then((result) => {
+ const formData = new FormData();
+ formData.append("files", result.file);
// 图片上传
- apiUploadImage(formData).then(res => {
- if (res.code == 200 || res.status == 'SUCCESS') {
- const imgInfo = res.data[0]
+ apiUploadImage(formData).then((res) => {
+ if (res.code == 200 || res.status == "SUCCESS") {
+ const imgInfo = res.data[0];
switch (type) {
- case 'idCardAvatar': // 身份证头像
- this.personForm.idCardBigPhotoUrl = imgInfo.imageUrl
+ case "idCardAvatar": // 身份证头像
+ this.personForm.idCardBigPhotoUrl = imgInfo.imageUrl;
this.idCardUpPhotoFile = [
- { name: imgInfo.filename, url: imgInfo.imageUrl }
- ]
- break
- case 'livesFace': // 现场采集人脸
+ { name: imgInfo.filename, url: imgInfo.imageUrl },
+ ];
+ break;
+ case "livesFace": // 现场采集人脸
this.cropperOption.img =
- this.$store.state.FILEURL + imgInfo.imageUrl
- this.cropperDialog = true
+ this.$store.state.FILEURL + imgInfo.imageUrl;
+ this.cropperDialog = true;
// let imgStatus = result.file.size / 1024 < 500
// if (!imgStatus) {
// this.cropperOption.img =
@@ -2550,147 +2559,149 @@ export default {
// this.checkFace(imgInfo.imageUrl)
// }
// }
- break
+ break;
}
}
- })
- })
+ });
+ });
},
- checkImg () {
- console.log(this.radio)
- this.imgRadiolist.forEach(item => {
+ checkImg() {
+ console.log(this.radio);
+ this.imgRadiolist.forEach((item) => {
if (this.radio == item.personSerial) {
- this.personForm.personSerial = this.radio
- this.personForm.fieldAcquisitionUrl = item.imageUrl
- this.fieldAcquisitionFile = [{ name: '', url: item.imageUrl }]
+ this.personForm.personSerial = this.radio;
+ this.personForm.fieldAcquisitionUrl = item.imageUrl;
+ this.fieldAcquisitionFile = [{ name: "", url: item.imageUrl }];
}
- })
- this.showImgList = false
+ });
+ this.showImgList = false;
},
// 判断是否为深圳项目
- getProjectConfig () {
- getProjectConfigListApi({ projectSn: this.projectSn }).then(res => {
- this.isSzProject = res.result[0].isSzProject //1是 0否
- })
+ getProjectConfig() {
+ getProjectConfigListApi({ projectSn: this.projectSn }).then((res) => {
+ this.isSzProject = res.result[0].isSzProject; //1是 0否
+ });
},
- exportM () {
+ exportM() {
window.location.href =
this.$http.defaults.baseURL +
- 'xmgl/download/exporExcelWorkerTemplate?projectSn=' +
- this.projectSn
+ "xmgl/download/exporExcelWorkerTemplate?projectSn=" +
+ this.projectSn;
},
// 导入照片弹窗
- importImgOpen () {
- this.imgFileList = []
- this.imgImportDialog = true
+ importImgOpen() {
+ this.imgFileList = [];
+ this.imgImportDialog = true;
},
// 下发通行设备
- passEquipment () {
+ passEquipment() {
sendBatchWokerApi({
projectSn: this.projectSn,
- personType: '1',
+ personType: "1",
userId: this.$store.state.userInfo.userId,
- enterpriseId: this.checkedId
- }).then(res => {
+ enterpriseId: this.checkedId,
+ }).then((res) => {
if (res.code == 200) {
this.$message({
- message: '操作成功,已在后台下发,请稍后查看!',
- type: 'success'
- })
+ message: "操作成功,已在后台下发,请稍后查看!",
+ type: "success",
+ });
}
- })
+ });
},
- handleChangeE (file, fileList) {
- this.fileTemp = file.raw
- console.log(file)
+ handleChangeE(file, fileList) {
+ this.fileTemp = file.raw;
+ console.log(file);
if (this.fileTemp) {
if (
this.fileTemp.type ==
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ||
- this.fileTemp.type == 'application/vnd.ms-excel'
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ||
+ this.fileTemp.type == "application/vnd.ms-excel"
) {
} else {
- this.$message.error(this.$t('message.laborMange.hint5'))
+ this.$message.error(this.$t("message.laborMange.hint5"));
}
}
},
- handleSuccessE (file) {
- this.refreshPage = false
- console.log('==========', file)
+ handleSuccessE(file) {
+ this.refreshPage = false;
+ console.log("==========", file);
if (file.code == 200) {
- this.$message.success(file.message) //导入成功
- this.refreshBtn()
- this.getTeamList()
+ this.$message.success(file.message); //导入成功
+ this.refreshBtn();
+ this.getTeamList();
} else {
- this.$message.error(file.message)
+ this.$message.error(file.message);
}
this.$nextTick(() => {
- this.refreshPage = true
- })
+ this.refreshPage = true;
+ });
},
- handleErrorE () {
- this.$message.error(this.$t('message.laborMange.hint7'))
- this.refreshBtn()
+ handleErrorE() {
+ this.$message.error(this.$t("message.laborMange.hint7"));
+ this.refreshBtn();
},
- handleUfaceDevChange (val) {
- let checkedCount = val.length
- let allCheckList = []
+ handleUfaceDevChange(val) {
+ let checkedCount = val.length;
+ let allCheckList = [];
for (let i = 0; i < this.ufaceDevAllList.length; i++) {
if (!this.ufaceDevAllList[i].disabled) {
- allCheckList.push(this.ufaceDevAllList[i])
+ allCheckList.push(this.ufaceDevAllList[i]);
}
}
- this.checkAllFaceDev = checkedCount === allCheckList.length
+ this.checkAllFaceDev = checkedCount === allCheckList.length;
this.isIndeterminate2 =
- checkedCount > 0 && checkedCount < allCheckList.length
+ checkedCount > 0 && checkedCount < allCheckList.length;
},
- handleUGroupChange (val) {
- let checkedCount = val.length
- let allCheckList = []
+ handleUGroupChange(val) {
+ let checkedCount = val.length;
+ let allCheckList = [];
for (let i = 0; i < this.uGroupAllList.length; i++) {
if (!this.uGroupAllList[i].disabled) {
- allCheckList.push(this.uGroupAllList[i])
+ allCheckList.push(this.uGroupAllList[i]);
}
}
- this.checkAllGroupDev = checkedCount === allCheckList.length
+ this.checkAllGroupDev = checkedCount === allCheckList.length;
this.isIndeterminate3 =
- checkedCount > 0 && checkedCount < allCheckList.length
+ checkedCount > 0 && checkedCount < allCheckList.length;
},
- handleCheckAllChangeFace (val) {
+ handleCheckAllChangeFace(val) {
if (val) {
- this.personForm.ufaceDevId = []
- this.ufaceDevAllList.forEach(item => {
- this.personForm.ufaceDevId.push(item.id)
- })
+ this.personForm.ufaceDevId = [];
+ this.ufaceDevAllList.forEach((item) => {
+ this.personForm.ufaceDevId.push(item.id);
+ });
} else {
// this.ufaceDevAllList = []
- this.personForm.ufaceDevId = []
+ this.personForm.ufaceDevId = [];
}
- this.isIndeterminate2 = false
+ this.isIndeterminate2 = false;
},
- handleCheckAllChangeGroup (val) {
+ handleCheckAllChangeGroup(val) {
if (val) {
- this.personForm.ufaceDevGroupId = []
- this.uGroupAllList.forEach(item => {
- this.personForm.ufaceDevGroupId.push(item.id)
- })
+ this.personForm.ufaceDevGroupId = [];
+ this.uGroupAllList.forEach((item) => {
+ this.personForm.ufaceDevGroupId.push(item.id);
+ });
} else {
- this.personForm.ufaceDevGroupId = []
+ this.personForm.ufaceDevGroupId = [];
}
- this.isIndeterminate2 = false
+ this.isIndeterminate2 = false;
},
// 获取所有分组
- getUGroupDevList () {
- getGroupListApi({ projectSn: this.projectSn }).then(res => {
- console.log(res)
+ getUGroupDevList() {
+ getGroupListApi({ projectSn: this.projectSn }).then((res) => {
+ console.log(res);
if (res.code == 200) {
- this.uGroupAllList = res.result
- console.log(this.uGroupAllList, 123456)
- this.personForm.ufaceDevGroupId = [...this.personForm.ufaceDevGroupId]
+ this.uGroupAllList = res.result;
+ console.log(this.uGroupAllList, 123456);
+ this.personForm.ufaceDevGroupId = [
+ ...this.personForm.ufaceDevGroupId,
+ ];
if (this.$store.state.userInfo.accountType == 6) {
- this.uGroupAllList.forEach(item => {
- item.disabled = true
- })
+ this.uGroupAllList.forEach((item) => {
+ item.disabled = true;
+ });
// selectUserDevAuthorityByUserIdApi({
// userId: this.$store.state.userInfo.userId,
// devType: "1",
@@ -2713,255 +2724,255 @@ export default {
// });
}
}
- })
+ });
},
// 获取所有人脸设备
- getUfaceDevList () {
- ufaceDevList({ projectSn: this.projectSn }).then(res => {
- console.log(res)
+ getUfaceDevList() {
+ ufaceDevList({ projectSn: this.projectSn }).then((res) => {
+ console.log(res);
if (res.code == 200) {
- this.ufaceDevAllList = res.result
- this.personForm.ufaceDevId = [...this.personForm.ufaceDevId]
+ this.ufaceDevAllList = res.result;
+ this.personForm.ufaceDevId = [...this.personForm.ufaceDevId];
if (this.$store.state.userInfo.accountType == 6) {
- this.ufaceDevAllList.forEach(item => {
- item.disabled = true
- })
+ this.ufaceDevAllList.forEach((item) => {
+ item.disabled = true;
+ });
selectUserDevAuthorityByUserIdApi({
userId: this.$store.state.userInfo.userId,
- devType: '1'
- }).then(res => {
+ devType: "1",
+ }).then((res) => {
if (res.code == 200) {
- let arr = res.result.devId.split(',')
- let id = ''
- this.personForm.ufaceDevId = []
+ let arr = res.result.devId.split(",");
+ let id = "";
+ this.personForm.ufaceDevId = [];
for (let i = 0; i < arr.length; i++) {
- console.log(parseInt(arr[i]))
- this.personForm.ufaceDevId.push(parseInt(arr[i]))
- id = parseInt(arr[i])
+ console.log(parseInt(arr[i]));
+ this.personForm.ufaceDevId.push(parseInt(arr[i]));
+ id = parseInt(arr[i]);
for (let j = 0; j < this.ufaceDevAllList.length; j++) {
if (this.ufaceDevAllList[j].id == id) {
- this.ufaceDevAllList[j].disabled = false
+ this.ufaceDevAllList[j].disabled = false;
}
}
}
}
- })
+ });
}
}
- })
+ });
},
//一键下发
- issuePersonFn () {
+ issuePersonFn() {
batchSendWorkerInfoApi({
projectSn: this.$store.state.projectSn,
- personType: 1
- }).then(res => {
- this.$message.success('已执行人员下发命令')
- this.getTableData()
- })
+ personType: 1,
+ }).then((res) => {
+ this.$message.success("已执行人员下发命令");
+ this.getTableData();
+ });
},
//单个人员下发
- issuePersonOneFn (workerId) {
- sendWorkerInfoByIdApi({ workerId: workerId }).then(res => {
- this.$message.success(this.$t('message.laborMange.hint4'))
- })
+ issuePersonOneFn(workerId) {
+ sendWorkerInfoByIdApi({ workerId: workerId }).then((res) => {
+ this.$message.success(this.$t("message.laborMange.hint4"));
+ });
},
- changRuleId (val) {
- console.log(val)
+ changRuleId(val) {
+ console.log(val);
},
//获取考勤规则列表
- getAttendRuleList () {
+ getAttendRuleList() {
workerAttendanceRuleList({ projectSn: this.$store.state.projectSn }).then(
- result => {
- this.attendRulesList = result.result
- console.log(result.result)
+ (result) => {
+ this.attendRulesList = result.result;
+ console.log(result.result);
}
- )
+ );
},
- exportFn () {
+ exportFn() {
window.location.href =
this.$http.defaults.baseURL +
- 'xmgl/download/exporZipWorkerInfo?idCard=' +
+ "xmgl/download/exporZipWorkerInfo?idCard=" +
this.tableParameter.idCard +
- '&projectSn=' +
+ "&projectSn=" +
this.tableParameter.projectSn +
- '&teamId=' +
+ "&teamId=" +
this.tableParameter.teamId +
- '&workerName=' +
+ "&workerName=" +
this.tableParameter.workerName +
- '&personType=' +
+ "&personType=" +
this.tableParameter.personType +
- '&enterDate=' +
+ "&enterDate=" +
this.tableParameter.enterDate +
- '&codeState=' +
+ "&codeState=" +
this.tableParameter.codeState +
- '&enterpriseId=' +
- this.checkedId
+ "&enterpriseId=" +
+ this.checkedId;
},
- getConfig () {
+ getConfig() {
getProjectUfaceConfigInfo({
- projectSn: this.$store.state.projectSn
- }).then(result => {
+ projectSn: this.$store.state.projectSn,
+ }).then((result) => {
if (result.success) {
if (result.result) {
- this.isUploadToHouse = result.result.housing ? true : false
+ this.isUploadToHouse = result.result.housing ? true : false;
}
}
- })
+ });
},
//获取企业 || 劳务公司 列表
- getProjectList (type) {
+ getProjectList(type) {
let data = {
projectSn: this.projectSn,
enterpriseName: this.enterpriseName,
userEnterpriseId: this.$store.state.userInfo.userEnterpriseId,
- enterpriseTypeId: this.enterpriseTypeId
- }
- getEnterpriseInfoList(data).then(res => {
- console.log(res, '执行')
+ enterpriseTypeId: this.enterpriseTypeId,
+ };
+ getEnterpriseInfoList(data).then((res) => {
+ console.log(res, "执行");
if (res.code == 200) {
- this.enterpriseListData = res.result
+ this.enterpriseListData = res.result;
// this.$set(this, 'enterpriseListData', res.result)
- console.log(this.enterpriseListData)
+ console.log(this.enterpriseListData);
this.checkedId = this.checkedId
? this.checkedId
: res.result.length > 0
? res.result[0].id
- : ''
+ : "";
this.showEnterpriseName =
- res.result.length > 0 ? res.result[0].enterpriseName : ''
+ res.result.length > 0 ? res.result[0].enterpriseName : "";
- this.getTeamList()
- this.getHierarchyEnterpriseList()
+ this.getTeamList();
+ this.getHierarchyEnterpriseList();
} else {
- this.$message.error(this.$t('message.laborMange.queryFails'))
+ this.$message.error(this.$t("message.laborMange.queryFails"));
}
- })
+ });
},
// 获取企业分级列表
- getHierarchyEnterpriseList () {
+ getHierarchyEnterpriseList() {
let data = {
projectSn: this.projectSn,
enterpriseName: this.enterpriseName,
userEnterpriseId: this.$store.state.userInfo.userEnterpriseId,
- enterpriseTypeId: this.enterpriseTypeId
- }
- selectHierarchyEnterpriseListApi(data).then(res => {
+ enterpriseTypeId: this.enterpriseTypeId,
+ };
+ selectHierarchyEnterpriseListApi(data).then((res) => {
if (res.code == 200) {
- console.log(res)
- this.enterpriseTreeData = res.result
+ console.log(res);
+ this.enterpriseTreeData = res.result;
this.$nextTick(() => {
- this.checkeEnterprise(res.result[0])
+ this.checkeEnterprise(res.result[0]);
if (this.checkedId) {
- this.$refs['treeNode'].setCurrentKey(this.checkedId.toString())
+ this.$refs["treeNode"].setCurrentKey(this.checkedId.toString());
} else {
- this.$refs['treeNode'].setCurrentKey(res.result[0].id.toString())
+ this.$refs["treeNode"].setCurrentKey(res.result[0].id.toString());
}
- })
- console.log(this.defaultId)
+ });
+ console.log(this.defaultId);
}
- })
+ });
},
// 切换 选择 企业 || 劳务公司
- checkeEnterprise (value) {
- this.checkedId = value.id
- this.showEnterpriseName = value.enterpriseName
- this.page = 1
- sessionStorage.setItem('personPage', 1)
- sessionStorage.setItem('companyPage', value.id)
- this.$refs.multipleTable.toggleRowSelection([], false)
- this.getTeamList()
- this.checkedTeamId = 0
- this.tableParameter.teamId = ''
+ checkeEnterprise(value) {
+ this.checkedId = value.id;
+ this.showEnterpriseName = value.enterpriseName;
+ this.page = 1;
+ sessionStorage.setItem("personPage", 1);
+ sessionStorage.setItem("companyPage", value.id);
+ this.$refs.multipleTable.toggleRowSelection([], false);
+ this.getTeamList();
+ this.checkedTeamId = 0;
+ this.tableParameter.teamId = "";
this.batchMoveForm = {
- teamId: '',
- enterpriseId: ''
- }
- this.$refs.multipleTable.bodyWrapper.scrollTop = 0
+ teamId: "",
+ enterpriseId: "",
+ };
+ this.$refs.multipleTable.bodyWrapper.scrollTop = 0;
},
//编辑企业 || 劳务公司 信息
- editEnterpriseInfo (value) {
- this.addEnterpriseDialog = true
- this.enterpriseDialogTitle = this.$t('message.laborMange.editEnterprise')
- this.enterpriseForm = JSON.parse(JSON.stringify(value))
- this.getEnterpriseType()
+ editEnterpriseInfo(value) {
+ this.addEnterpriseDialog = true;
+ this.enterpriseDialogTitle = this.$t("message.laborMange.editEnterprise");
+ this.enterpriseForm = JSON.parse(JSON.stringify(value));
+ this.getEnterpriseType();
//资质file
this.aptitudeFileList =
- value.enterpriseQualificationUrl != ''
+ value.enterpriseQualificationUrl != ""
? [JSON.parse(this.enterpriseForm.enterpriseQualificationUrl)]
- : []
+ : [];
//logo
this.logoFileList =
- value.logo != '' ? [JSON.parse(this.enterpriseForm.logo)] : []
+ value.logo != "" ? [JSON.parse(this.enterpriseForm.logo)] : [];
setTimeout(() => {
- this.$refs.enterpriseDialog.scrollTop = 0
- this.$refs['enterpriseForm'].clearValidate()
- }, 120)
+ this.$refs.enterpriseDialog.scrollTop = 0;
+ this.$refs["enterpriseForm"].clearValidate();
+ }, 120);
},
//新增企业 按钮
- addEnterpriseBtn () {
- window._paq.push(['trackEvent', '点击', '新增企业', '添加企业信息'])
+ addEnterpriseBtn() {
+ window._paq.push(["trackEvent", "点击", "新增企业", "添加企业信息"]);
this.enterpriseForm = {
- name: '',
- bankcardnumber: '', //银行卡号
- bankname: '', // 开户行
- businessLicenseEndDate: '', // 营业执照截止日期
- businessNumber: '', //营业执照注册号
- enterpriseAddress: '', //企业地址
- enterpriseEmail: '', //企业邮箱
- enterpriseLegalPerson: '', //法定代表人
- enterpriseName: '', //企业名称
- enterpriseProperty: '', //单位性质 1.国有企业 2三资企业 3集体企业 4私营企业
- enterpriseQualificationUrl: '', //企业资质图片地址
- enterpriseSafeAllow: '', //企业安全生产许可证
- enterpriseTypeId: '', //企业类型Id
- legalPersonTel: '', //法人电话
- logo: '', //logo
- projectSn: '', //项目Sn
- qualificationNumber: '', //资质证书号
- registerPersonPhoneTel: '', //注册人电话
- registeredCapital: '', //注册资金
- socialCode: '' //社会统一信用代码
- }
- this.aptitudeFileList = [] //资质照片列表
- this.logoFileList = [] //logo 文件列表
- this.addEnterpriseDialog = true
+ name: "",
+ bankcardnumber: "", //银行卡号
+ bankname: "", // 开户行
+ businessLicenseEndDate: "", // 营业执照截止日期
+ businessNumber: "", //营业执照注册号
+ enterpriseAddress: "", //企业地址
+ enterpriseEmail: "", //企业邮箱
+ enterpriseLegalPerson: "", //法定代表人
+ enterpriseName: "", //企业名称
+ enterpriseProperty: "", //单位性质 1.国有企业 2三资企业 3集体企业 4私营企业
+ enterpriseQualificationUrl: "", //企业资质图片地址
+ enterpriseSafeAllow: "", //企业安全生产许可证
+ enterpriseTypeId: "", //企业类型Id
+ legalPersonTel: "", //法人电话
+ logo: "", //logo
+ projectSn: "", //项目Sn
+ qualificationNumber: "", //资质证书号
+ registerPersonPhoneTel: "", //注册人电话
+ registeredCapital: "", //注册资金
+ socialCode: "", //社会统一信用代码
+ };
+ this.aptitudeFileList = []; //资质照片列表
+ this.logoFileList = []; //logo 文件列表
+ this.addEnterpriseDialog = true;
this.enterpriseDialogTitle = this.$t(
- 'message.laborMange.theNewEnterprise'
- )
+ "message.laborMange.theNewEnterprise"
+ );
setTimeout(() => {
- this.$refs['enterpriseForm'].clearValidate()
- this.$refs.enterpriseDialog.scrollTop = 0
- }, 120)
+ this.$refs["enterpriseForm"].clearValidate();
+ this.$refs.enterpriseDialog.scrollTop = 0;
+ }, 120);
},
//新增企业 -- 企业类型下拉
- getEnterpriseType () {
- let data = {}
- getEnterpriseTypeList(data).then(res => {
+ getEnterpriseType() {
+ let data = {};
+ getEnterpriseTypeList(data).then((res) => {
if (res.code == 200) {
- this.enterpriseTypeList = res.result
+ this.enterpriseTypeList = res.result;
}
- })
+ });
},
// 导入照片数据
- saveImportFn () {
+ saveImportFn() {
if (this.imgFileList.length == 0) {
- this.$message.success('请先导入文件')
- return
+ this.$message.success("请先导入文件");
+ return;
}
- let data = new FormData() //new出来的对象
- data.append('file', this.imgFileList[0].raw)
- data.append('projectSn', this.$store.state.projectSn)
- importImgDataApi(data).then(res => {
+ let data = new FormData(); //new出来的对象
+ data.append("file", this.imgFileList[0].raw);
+ data.append("projectSn", this.$store.state.projectSn);
+ importImgDataApi(data).then((res) => {
if (res.success) {
- this.$message.success('操作成功')
- this.imgImportDialog = false
- this.getTableData()
+ this.$message.success("操作成功");
+ this.imgImportDialog = false;
+ this.getTableData();
}
- })
+ });
},
//新增企业 保存
- saveEnterpriseFn (formName) {
+ saveEnterpriseFn(formName) {
// if (!checkPhone(this.enterpriseForm.legalPersonTel)) {
// this.$message.error("请输入正确的法人电话");
// return;
@@ -2971,371 +2982,373 @@ export default {
// return;
// }
if (!CheckSocialCreditCode(this.enterpriseForm.socialCode)) {
- this.$message.error(this.$t('message.laborMange.creditCode'))
- return
+ this.$message.error(this.$t("message.laborMange.creditCode"));
+ return;
}
- this.$refs[formName].validate(valid => {
+ this.$refs[formName].validate((valid) => {
if (valid) {
- this.enterpriseForm.projectSn = this.projectSn
+ this.enterpriseForm.projectSn = this.projectSn;
if (
this.enterpriseDialogTitle ==
- this.$t('message.laborMange.theNewEnterprise')
+ this.$t("message.laborMange.theNewEnterprise")
) {
//新增 请求
- setEnterpriseInfo(this.enterpriseForm).then(res => {
+ setEnterpriseInfo(this.enterpriseForm).then((res) => {
if (res.code == 200) {
- this.$message.success(res.message)
- this.addEnterpriseDialog = false
- this.getProjectList()
- this.resetForm(formName)
+ this.$message.success(res.message);
+ this.addEnterpriseDialog = false;
+ this.getProjectList();
+ this.resetForm(formName);
}
- })
+ });
} else {
//编辑 请求
- editEnterpriseInfo(this.enterpriseForm).then(res => {
+ editEnterpriseInfo(this.enterpriseForm).then((res) => {
if (res.code == 200) {
this.$message.success(
- this.$t('message.laborMange.modifySuccess')
- )
- this.resetForm(formName)
- this.addEnterpriseDialog = false
- this.getProjectList()
+ this.$t("message.laborMange.modifySuccess")
+ );
+ this.resetForm(formName);
+ this.addEnterpriseDialog = false;
+ this.getProjectList();
}
- })
+ });
}
} else {
- return false
+ return false;
}
- })
+ });
},
//删除 企业
- deleteEnterpriseInfo (value) {
+ deleteEnterpriseInfo(value) {
this.$confirm(
- this.$t('message.laborMange.deleteHint'),
- this.$t('message.laborMange.hint'),
+ this.$t("message.laborMange.deleteHint"),
+ this.$t("message.laborMange.hint"),
{
- confirmButtonText: this.$t('message.laborMange.confirm'),
- cancelButtonText: this.$t('message.laborMange.cancel'),
- type: 'warning'
+ confirmButtonText: this.$t("message.laborMange.confirm"),
+ cancelButtonText: this.$t("message.laborMange.cancel"),
+ type: "warning",
}
)
.then(() => {
let data = {
projectSn: this.projectSn,
- enterpriseId: value.id
- }
- deleteEnterprise(data).then(res => {
+ enterpriseId: value.id,
+ };
+ deleteEnterprise(data).then((res) => {
if (res.code == 200) {
this.$message({
- type: 'success',
- message: this.$t('message.laborMange.deleteSuccess')
- })
- this.getProjectList()
- this.checkedId = ''
+ type: "success",
+ message: this.$t("message.laborMange.deleteSuccess"),
+ });
+ this.getProjectList();
+ this.checkedId = "";
}
- })
+ });
})
- .catch(console.log)
+ .catch(console.log);
},
/**--------------------------------------------右侧函数------------------------------------------------------------------ */
//获取企业的 - 班组列表
- getTeamList (type) {
+ getTeamList(type) {
let data = {
enterpriseId: this.checkedId,
- projectSn: this.projectSn
- }
- getTeamInfoList(data).then(res => {
+ projectSn: this.projectSn,
+ };
+ getTeamInfoList(data).then((res) => {
if (res.code == 200) {
- this.checkedTeamId = type !== 1 ? 0 : this.checkedTeamId
- this.teamListData = res.result
- console.log('==============', res.result)
- this.tableParameter.projectSn = this.projectSn
- this.getTableData()
+ this.checkedTeamId = type !== 1 ? 0 : this.checkedTeamId;
+ this.teamListData = res.result;
+ console.log("==============", res.result);
+ this.tableParameter.projectSn = this.projectSn;
+ this.getTableData();
}
- })
+ });
},
//新增 班组 按钮
- addTeamBtn () {
- window._paq.push(['trackEvent', '点击', '新增班组', '新增班组信息'])
- this.addTeamDialog = true
- this.teamDialogTitle = this.$t('message.laborMange.theNewTeam')
+ addTeamBtn() {
+ window._paq.push(["trackEvent", "点击", "新增班组", "新增班组信息"]);
+ this.addTeamDialog = true;
+ this.teamDialogTitle = this.$t("message.laborMange.theNewTeam");
this.teamForm = {
- describeValue: '', //描述
- leaderIdCard: '', //负责人身份证号
- leaderName: '', //负责人姓名
- leaderPhone: '', //负责人手机号
- teamName: '', //班组名称
- teamType: '', //班组类型
- workerTypeId: '' //工种id
- }
+ describeValue: "", //描述
+ leaderIdCard: "", //负责人身份证号
+ leaderName: "", //负责人姓名
+ leaderPhone: "", //负责人手机号
+ teamName: "", //班组名称
+ teamType: "", //班组类型
+ workerTypeId: "", //工种id
+ };
setTimeout(() => {
- this.$refs['teamForm'].clearValidate()
- }, 120)
- this.getWorkerTypeListData()
+ this.$refs["teamForm"].clearValidate();
+ }, 120);
+ this.getWorkerTypeListData();
},
//获取工种
- getWorkerTypeListData () {
+ getWorkerTypeListData() {
let data = {
- projectSn: this.projectSn
- }
- getWorkerTypeList(data).then(res => {
+ projectSn: this.projectSn,
+ };
+ getWorkerTypeList(data).then((res) => {
if (res.code == 200) {
- this.workerTypeList = res.result
+ this.workerTypeList = res.result;
}
- })
+ });
},
//选择工种设置班组名称
- changeWorkerType (value) {
+ changeWorkerType(value) {
for (let i in this.workerTypeList) {
if (this.workerTypeList[i].id == value) {
- if (this.teamForm.teamName.indexOf('-') != -1) {
+ if (this.teamForm.teamName.indexOf("-") != -1) {
this.teamForm.teamName =
- this.workerTypeList[i].typeName + '-' + this.teamForm.leaderName
+ this.workerTypeList[i].typeName + "-" + this.teamForm.leaderName;
} else {
this.teamForm.teamName =
- this.workerTypeList[i].typeName + '-' + this.teamForm.leaderName
+ this.workerTypeList[i].typeName + "-" + this.teamForm.leaderName;
}
}
}
},
//输入负责人名称时
- changeLeaderName (value) {
- if (this.teamForm.teamName != '') {
- let arr = this.teamForm.teamName.split('-')
- this.teamForm.teamName = arr[0] + '-' + value
+ changeLeaderName(value) {
+ if (this.teamForm.teamName != "") {
+ let arr = this.teamForm.teamName.split("-");
+ this.teamForm.teamName = arr[0] + "-" + value;
}
},
//新增 班组 保存
- saveTeamFn (formName) {
+ saveTeamFn(formName) {
if (!checkPhone(this.teamForm.leaderPhone)) {
this.$message.error(
- this.$t('message.laborMange.correctCellPhoneNumber')
- )
- return
+ this.$t("message.laborMange.correctCellPhoneNumber")
+ );
+ return;
}
if (!IdentityCodeValid(this.teamForm.leaderIdCard)) {
- this.$message.error(this.$t('message.laborMange.correctCellIdCard'))
- return
+ this.$message.error(this.$t("message.laborMange.correctCellIdCard"));
+ return;
}
if (this.teamForm.workerTypeId == 385) {
- this.teamForm.specialTeam = 1
+ this.teamForm.specialTeam = 1;
} else {
- this.teamForm.specialTeam = 0
+ this.teamForm.specialTeam = 0;
}
- this.$refs[formName].validate(valid => {
+ this.$refs[formName].validate((valid) => {
if (valid) {
if (
- this.teamDialogTitle == this.$t('message.laborMange.theNewTeam')
+ this.teamDialogTitle == this.$t("message.laborMange.theNewTeam")
) {
- this.teamForm.projectSn = this.projectSn
- this.teamForm.enterpriseId = this.checkedId
- addTeamInfo(this.teamForm).then(res => {
+ this.teamForm.projectSn = this.projectSn;
+ this.teamForm.enterpriseId = this.checkedId;
+ addTeamInfo(this.teamForm).then((res) => {
if (res.code == 200) {
- this.$message.success(this.$t('message.laborMange.saveSuccess'))
- this.getTeamList()
- this.addTeamDialog = false
- this.resetForm(formName)
+ this.$message.success(
+ this.$t("message.laborMange.saveSuccess")
+ );
+ this.getTeamList();
+ this.addTeamDialog = false;
+ this.resetForm(formName);
}
- })
+ });
} else {
- editTeamInfo(this.teamForm).then(res => {
+ editTeamInfo(this.teamForm).then((res) => {
if (res.code == 200) {
- this.$message.success(res.message)
- this.addTeamDialog = false
- this.getTeamList()
- this.resetForm(formName)
+ this.$message.success(res.message);
+ this.addTeamDialog = false;
+ this.getTeamList();
+ this.resetForm(formName);
}
- })
+ });
}
} else {
- return false
+ return false;
}
- })
+ });
},
- parseCode (code) {
+ parseCode(code) {
if (code == 0) {
- return ['info', this.$t('message.laborMange.codeless')]
+ return ["info", this.$t("message.laborMange.codeless")];
} else if (code == 1) {
- return ['danger', this.$t('message.laborMange.redCode')]
+ return ["danger", this.$t("message.laborMange.redCode")];
} else if (code == 2) {
- return ['warning', this.$t('message.laborMange.yellowCode')]
+ return ["warning", this.$t("message.laborMange.yellowCode")];
} else if (code == 3) {
- return ['success', this.$t('message.laborMange.greenCode')]
+ return ["success", this.$t("message.laborMange.greenCode")];
}
},
//隐藏 班组列表
- hideTeamList () {
+ hideTeamList() {
if (this.showTeamList) {
- this.showTeamList = false
+ this.showTeamList = false;
}
},
//切换 班组
- switchoverTeam (id, specialTeam) {
- window._paq.push(['trackEvent', '点击', '切换班组', '切换班组'])
- this.checkedTeamId = id
- this.page = 1
- this.$refs.multipleTable.toggleRowSelection([], false)
- this.$refs.multipleTable.bodyWrapper.scrollTop = 0
+ switchoverTeam(id, specialTeam) {
+ window._paq.push(["trackEvent", "点击", "切换班组", "切换班组"]);
+ this.checkedTeamId = id;
+ this.page = 1;
+ this.$refs.multipleTable.toggleRowSelection([], false);
+ this.$refs.multipleTable.bodyWrapper.scrollTop = 0;
if (id === 0) {
- this.tableParameter.teamId = ''
+ this.tableParameter.teamId = "";
} else {
for (let i in this.teamListData.list) {
if (this.teamListData.list[i].id == id) {
- this.tableParameter.teamId = this.teamListData.list[i].id
+ this.tableParameter.teamId = this.teamListData.list[i].id;
}
}
}
- this.specialTeam = specialTeam
- this.getTableData()
+ this.specialTeam = specialTeam;
+ this.getTableData();
},
//编辑 班组 按钮
- editTeamInfo (value) {
- this.teamDialogTitle = this.$t('message.laborMange.editorialTeam')
- this.addTeamDialog = true
+ editTeamInfo(value) {
+ this.teamDialogTitle = this.$t("message.laborMange.editorialTeam");
+ this.addTeamDialog = true;
setTimeout(() => {
- this.$refs['teamForm'].clearValidate()
- }, 120)
- this.teamForm = JSON.parse(JSON.stringify(value))
- this.getWorkerTypeListData()
+ this.$refs["teamForm"].clearValidate();
+ }, 120);
+ this.teamForm = JSON.parse(JSON.stringify(value));
+ this.getWorkerTypeListData();
},
//删除班组
- deleteTeamInfo (value) {
+ deleteTeamInfo(value) {
this.$confirm(
- this.$t('message.laborMange.deleteHint'),
- this.$t('message.laborMange.hint'),
+ this.$t("message.laborMange.deleteHint"),
+ this.$t("message.laborMange.hint"),
{
- confirmButtonText: this.$t('message.laborMange.confirm'),
- cancelButtonText: this.$t('message.laborMange.cancel'),
- type: 'warning'
+ confirmButtonText: this.$t("message.laborMange.confirm"),
+ cancelButtonText: this.$t("message.laborMange.cancel"),
+ type: "warning",
}
)
.then(() => {
let data = {
- id: value.id
- }
- deleteTeamInfo(data).then(res => {
+ id: value.id,
+ };
+ deleteTeamInfo(data).then((res) => {
if (res.code == 200) {
this.$message({
- type: 'success',
- message: this.$t('message.laborMange.deleteSuccess')
- })
- this.getTeamList()
+ type: "success",
+ message: this.$t("message.laborMange.deleteSuccess"),
+ });
+ this.getTeamList();
}
- })
+ });
})
- .catch(console.log)
+ .catch(console.log);
},
//获取 班组的表格数据 -- 班组详情
- getTableData () {
- let data = this.tableParameter
- data.pageNo = this.page
- data.pageSize = this.pageSize
- data.enterpriseId = this.checkedId
- getWorkerInfoList(data).then(res => {
+ getTableData() {
+ let data = this.tableParameter;
+ data.pageNo = this.page;
+ data.pageSize = this.pageSize;
+ data.enterpriseId = this.checkedId;
+ getWorkerInfoList(data).then((res) => {
if (res.code == 200) {
- this.tableListData = res.result.records
- console.log('------------', res.result.records)
- let boole = true
+ this.tableListData = res.result.records;
+ console.log("------------", res.result.records);
+ let boole = true;
for (let i in res.result.records) {
if (res.result.records[i].inserviceType == 1) {
- boole = false
+ boole = false;
}
}
this.checkAllStatus =
- this.tableListData.length == 0 ? true : boole ? true : false
- this.total = res.result.total
+ this.tableListData.length == 0 ? true : boole ? true : false;
+ this.total = res.result.total;
}
- })
+ });
},
//人员录入 按钮
- personnelEntry () {
- this.personDialogTitle = this.$t('message.laborMange.personnelEntry')
- this.titleType = 'add'
- this.addPersonDialog = true
+ personnelEntry() {
+ this.personDialogTitle = this.$t("message.laborMange.personnelEntry");
+ this.titleType = "add";
+ this.addPersonDialog = true;
this.personForm = {
- workerName: '',
- sex: '',
- idCard: '',
- birthday: '',
- enterDate: '',
- nation: '',
- nativePlace: '',
- issuingAuthorityForIdcard: '',
- idCardEndDate: '',
+ workerName: "",
+ sex: "",
+ idCard: "",
+ birthday: "",
+ enterDate: "",
+ nation: "",
+ nativePlace: "",
+ issuingAuthorityForIdcard: "",
+ idCardEndDate: "",
longTerm: false,
- phoneNumber: '',
- emergentPerson: '',
- emergentPhone: '',
+ phoneNumber: "",
+ emergentPerson: "",
+ emergentPhone: "",
inserviceType: 1,
- politicsStatus: '',
- marry: '',
- payRollBankName: '',
- payRollBankNumber: '',
- educational: '',
- blood: '',
- examinationImage: '',
- contractImage: '',
- employmentCard: '',
- idCardBigPhotoUrl: '',
- fieldAcquisitionUrl: '',
+ politicsStatus: "",
+ marry: "",
+ payRollBankName: "",
+ payRollBankNumber: "",
+ educational: "",
+ blood: "",
+ examinationImage: "",
+ contractImage: "",
+ employmentCard: "",
+ idCardBigPhotoUrl: "",
+ fieldAcquisitionUrl: "",
personType: 1,
- idCardUpPhotoUrl: '',
- idCardDownPhotoUrl: '',
+ idCardUpPhotoUrl: "",
+ idCardDownPhotoUrl: "",
ufaceDevId: [],
ufaceDevGroupId: [],
- personSerial: ''
- }
+ personSerial: "",
+ };
if (this.attendRulesList.length > 0) {
- this.personForm.ruleId = this.attendRulesList[0].id
+ this.personForm.ruleId = this.attendRulesList[0].id;
} else {
- this.personForm.ruleId = ''
+ this.personForm.ruleId = "";
}
- this.getUfaceDevList()
+ this.getUfaceDevList();
setTimeout(() => {
- this.$refs['personForm'].clearValidate()
- this.$refs.personDialog.scrollTop = 0
- }, 120)
- this.examinationFile = [] //体检报告
- this.contractFile = [] //合同附件
- this.employmentFile = [] //从业资格证书
- this.idCardUpPhotoFile = [] //身份证头像
- this.fieldAcquisitionFile = []
- this.idCardUpPhotoUrlFile = [] // 身份证国徽面
- this.idCardDownPhotoUrlFile = [] // 身份证人像面
+ this.$refs["personForm"].clearValidate();
+ this.$refs.personDialog.scrollTop = 0;
+ }, 120);
+ this.examinationFile = []; //体检报告
+ this.contractFile = []; //合同附件
+ this.employmentFile = []; //从业资格证书
+ this.idCardUpPhotoFile = []; //身份证头像
+ this.fieldAcquisitionFile = [];
+ this.idCardUpPhotoUrlFile = []; // 身份证国徽面
+ this.idCardDownPhotoUrlFile = []; // 身份证人像面
// 默认全选设备
- this.checkAllFaceDev = true
- this.checkAllGroupDev = false
- this.ufaceDevAllList.map(item => {
- this.personForm.ufaceDevId.push(item.id)
- })
+ this.checkAllFaceDev = true;
+ this.checkAllGroupDev = false;
+ this.ufaceDevAllList.map((item) => {
+ this.personForm.ufaceDevId.push(item.id);
+ });
},
// 有效日期 长期 按钮
- checkboxLongTerm (value) {
+ checkboxLongTerm(value) {
if (this.personForm.longTerm) {
- this.$refs['personForm'].clearValidate('idCardEndDate')
+ this.$refs["personForm"].clearValidate("idCardEndDate");
}
this.personForm.idCardEndDate = this.personForm.longTerm
- ? ''
- : this.personForm.idCardEndDate
+ ? ""
+ : this.personForm.idCardEndDate;
},
// 新增 || 编辑 人员录入 保存按钮
- savePersonFn (formName) {
- this.personForm.isUploadHousing = this.personForm.isUploadHousing ? 1 : 0
- console.log('进场确定参数', this.personForm)
- console.log('进场确定参数', IdentityCodeValid(this.personForm.idCard))
+ savePersonFn(formName) {
+ this.personForm.isUploadHousing = this.personForm.isUploadHousing ? 1 : 0;
+ console.log("进场确定参数", this.personForm);
+ console.log("进场确定参数", IdentityCodeValid(this.personForm.idCard));
// 身份证校验
if (!IdentityCodeValid(this.personForm.idCard)) {
- this.$message.error(this.$t('message.laborMange.correctCellIdCard'))
- return
+ this.$message.error(this.$t("message.laborMange.correctCellIdCard"));
+ return;
}
// 电话校验
// if (!checkPhone(this.personForm.phoneNumber)) {
@@ -3366,7 +3379,7 @@ export default {
// return
// }
- this.$refs[formName].validate(valid => {
+ this.$refs[formName].validate((valid) => {
if (valid) {
// 身份证头像和现场人脸采集校验
// if (this.personForm.idCardBigPhotoUrl == '') {
@@ -3381,1144 +3394,1152 @@ export default {
// return
// }
// 现场人脸采集校验
- if (this.personForm.fieldAcquisitionUrl == '') {
+ if (this.personForm.fieldAcquisitionUrl == "") {
this.$message.error(
- this.$t('message.laborMange.pleaseUploadPhotosOfTheScene')
- )
- return
+ this.$t("message.laborMange.pleaseUploadPhotosOfTheScene")
+ );
+ return;
}
- if (this.personForm.ruleId == '') {
- this.personForm.ruleId = 0
+ if (this.personForm.ruleId == "") {
+ this.personForm.ruleId = 0;
}
//新增
if (!this.personForm.id) {
- let data = { ...this.personForm }
- data.projectSn = this.projectSn
- data.teamId = this.checkedTeamId
- data.enterpriseId = this.checkedId
- data.longTerm = this.personForm.longTerm ? 1 : 0
- data.registerType = 1
- data.devType = this.typeRadio
- data.userId = this.$store.state.userInfo.userId
+ let data = { ...this.personForm };
+ data.projectSn = this.projectSn;
+ data.teamId = this.checkedTeamId;
+ data.enterpriseId = this.checkedId;
+ data.longTerm = this.personForm.longTerm ? 1 : 0;
+ data.registerType = 1;
+ data.devType = this.typeRadio;
+ data.userId = this.$store.state.userInfo.userId;
if (this.$store.state.userInfo.accountType == 6) {
- data.accountType = 2
+ data.accountType = 2;
} else {
- data.accountType = 1
+ data.accountType = 1;
}
if (this.personForm.ufaceDevId.length > 0 && data.devType == 1) {
- data.ufaceDevId = this.personForm.ufaceDevId.join(',')
- data.ufaceDevGroupId = ''
+ data.ufaceDevId = this.personForm.ufaceDevId.join(",");
+ data.ufaceDevGroupId = "";
} else {
- data.ufaceDevId = ''
+ data.ufaceDevId = "";
}
if (
this.personForm.ufaceDevGroupId.length > 0 &&
data.devType == 2
) {
- data.ufaceDevGroupId = this.personForm.ufaceDevGroupId.join(',')
- data.ufaceDevId = ''
+ data.ufaceDevGroupId = this.personForm.ufaceDevGroupId.join(",");
+ data.ufaceDevId = "";
} else {
- data.ufaceDevGroupId = ''
+ data.ufaceDevGroupId = "";
}
- addWorkerInfo(data).then(res => {
- if (res.code == 200) {
- this.$message.success(this.$t('message.laborMange.saveSuccess'))
- this.getTeamList(1)
- this.addPersonDialog = false
- this.resetForm(formName)
- this.examinationFile = [] //体检报告
- this.contractFile = [] //合同附件
- this.employmentFile = [] //从业资格证书
- this.idCardUpPhotoFile = [] //身份证头像
- this.fieldAcquisitionFile = [] //现场采集人脸
- }
- })
- //编辑
- } else {
- let data = { ...this.personForm }
- data.longTerm = this.personForm.longTerm ? 1 : 0
- data.registerType = 1
- data.devType = this.typeRadio
- // 跟杨珊对接需要再再次进场时多传入一个新的字段
- data.reEntry = 1
- data.userId = this.$store.state.userInfo.userId
- if (this.personForm.ufaceDevId.length > 0 && data.devType == 1) {
- data.ufaceDevId = this.personForm.ufaceDevId.join(',')
- data.ufaceDevGroupId = ''
- } else {
- data.ufaceDevId = ''
- }
- if (
- this.personForm.ufaceDevGroupId.length > 0 &&
- data.devType == 2
- ) {
- data.ufaceDevGroupId = this.personForm.ufaceDevGroupId.join(',')
- data.ufaceDevId = ''
- } else {
- data.ufaceDevGroupId = ''
- }
- if (this.$store.state.userInfo.accountType == 6) {
- data.accountType = 2
- } else {
- data.accountType = 1
- }
- delete data.addTime
- editWorkerInfo(data).then(res => {
+ addWorkerInfo(data).then((res) => {
if (res.code == 200) {
this.$message.success(
- this.$t('message.laborMange.modifySuccess')
- )
- this.getTeamList(1)
- this.addPersonDialog = false
- this.resetForm(formName)
- this.examinationFile = [] //体检报告
- this.contractFile = [] //合同附件
- this.employmentFile = [] //从业资格证书
- this.idCardUpPhotoFile = [] //身份证头像
- this.fieldAcquisitionFile = [] //现场采集人脸
+ this.$t("message.laborMange.saveSuccess")
+ );
+ this.getTeamList(1);
+ this.addPersonDialog = false;
+ this.resetForm(formName);
+ this.examinationFile = []; //体检报告
+ this.contractFile = []; //合同附件
+ this.employmentFile = []; //从业资格证书
+ this.idCardUpPhotoFile = []; //身份证头像
+ this.fieldAcquisitionFile = []; //现场采集人脸
}
- })
+ });
+ //编辑
+ } else {
+ let data = { ...this.personForm };
+ data.longTerm = this.personForm.longTerm ? 1 : 0;
+ data.registerType = 1;
+ data.devType = this.typeRadio;
+ // 跟杨珊对接需要再再次进场时多传入一个新的字段
+ data.reEntry = 1;
+ data.userId = this.$store.state.userInfo.userId;
+ if (this.personForm.ufaceDevId.length > 0 && data.devType == 1) {
+ data.ufaceDevId = this.personForm.ufaceDevId.join(",");
+ data.ufaceDevGroupId = "";
+ } else {
+ data.ufaceDevId = "";
+ }
+ if (
+ this.personForm.ufaceDevGroupId.length > 0 &&
+ data.devType == 2
+ ) {
+ data.ufaceDevGroupId = this.personForm.ufaceDevGroupId.join(",");
+ data.ufaceDevId = "";
+ } else {
+ data.ufaceDevGroupId = "";
+ }
+ if (this.$store.state.userInfo.accountType == 6) {
+ data.accountType = 2;
+ } else {
+ data.accountType = 1;
+ }
+ delete data.addTime;
+ editWorkerInfo(data).then((res) => {
+ if (res.code == 200) {
+ this.$message.success(
+ this.$t("message.laborMange.modifySuccess")
+ );
+ this.getTeamList(1);
+ this.addPersonDialog = false;
+ this.resetForm(formName);
+ this.examinationFile = []; //体检报告
+ this.contractFile = []; //合同附件
+ this.employmentFile = []; //从业资格证书
+ this.idCardUpPhotoFile = []; //身份证头像
+ this.fieldAcquisitionFile = []; //现场采集人脸
+ }
+ });
}
} else {
this.$message.error(
- this.$t('message.laborMange.ThereAreRequiredFieldsLeftUnfilled')
- )
- return false
+ this.$t("message.laborMange.ThereAreRequiredFieldsLeftUnfilled")
+ );
+ return false;
}
- })
+ });
},
- uploadToHouseFn (value, id) {
- console.log('value', value)
+ uploadToHouseFn(value, id) {
+ console.log("value", value);
var json = {
isUploadHousing: value ? 1 : 0,
- id: id
- }
- console.log('isUploadHousing', json)
- updateByIdWorkerInfo(json).then(console.log)
+ id: id,
+ };
+ console.log("isUploadHousing", json);
+ updateByIdWorkerInfo(json).then(console.log);
},
//编辑 人员信息 按钮
- editWorkerInfo (value, type) {
- console.log('当前行', value)
+ editWorkerInfo(value, type) {
+ console.log("当前行", value);
if (value.isUploadHousing) {
- this.personForm.isUploadHousing = 1
+ this.personForm.isUploadHousing = 1;
} else {
- this.personForm.isUploadHousing = 0
+ this.personForm.isUploadHousing = 0;
}
- this.personDialogTitle = this.$t('message.laborMange.editCrewInfo')
- this.titleType = 'edit'
+ this.personDialogTitle = this.$t("message.laborMange.editCrewInfo");
+ this.titleType = "edit";
this.personForm = {
- workerName: '',
- sex: '',
- idCard: '',
- birthday: '',
- enterDate: '',
- nation: '',
- nativePlace: '',
- issuingAuthorityForIdcard: '',
- idCardEndDate: '',
+ workerName: "",
+ sex: "",
+ idCard: "",
+ birthday: "",
+ enterDate: "",
+ nation: "",
+ nativePlace: "",
+ issuingAuthorityForIdcard: "",
+ idCardEndDate: "",
longTerm: false,
- phoneNumber: '',
- emergentPerson: '',
- emergentPhone: '',
+ phoneNumber: "",
+ emergentPerson: "",
+ emergentPhone: "",
inserviceType: 2,
- politicsStatus: '',
- marry: '',
- payRollBankName: '',
- payRollBankNumber: '',
- educational: '',
- blood: '',
- examinationImage: '',
- contractImage: '',
- employmentCard: '',
- idCardBigPhotoUrl: '',
- fieldAcquisitionUrl: '',
+ politicsStatus: "",
+ marry: "",
+ payRollBankName: "",
+ payRollBankNumber: "",
+ educational: "",
+ blood: "",
+ examinationImage: "",
+ contractImage: "",
+ employmentCard: "",
+ idCardBigPhotoUrl: "",
+ fieldAcquisitionUrl: "",
personType: 1,
- idCardUpPhotoUrl: '',
- idCardDownPhotoUrl: '',
+ idCardUpPhotoUrl: "",
+ idCardDownPhotoUrl: "",
ufaceDevId: [],
ufaceDevGroupId: [],
- personSerial: ''
- }
- this.getUfaceDevList()
+ personSerial: "",
+ };
+ this.getUfaceDevList();
setTimeout(() => {
- this.$refs['personForm'].clearValidate()
- this.$refs.personDialog.scrollTop = 0
- }, 120)
- this.addPersonDialog = true
- this.personForm = JSON.parse(JSON.stringify(value))
+ this.$refs["personForm"].clearValidate();
+ this.$refs.personDialog.scrollTop = 0;
+ }, 120);
+ this.addPersonDialog = true;
+ this.personForm = JSON.parse(JSON.stringify(value));
if (value.ufaceDevId) {
- this.personForm.ufaceDevId = value.ufaceDevId.split(',')
- this.handleUfaceDevChange(this.personForm.ufaceDevId) // 做一下全选按钮的选中与否
+ this.personForm.ufaceDevId = value.ufaceDevId.split(",");
+ this.handleUfaceDevChange(this.personForm.ufaceDevId); // 做一下全选按钮的选中与否
} else {
- this.personForm.ufaceDevId = []
- this.handleUfaceDevChange(this.personForm.ufaceDevId) // 做一下全选按钮的选中与否
+ this.personForm.ufaceDevId = [];
+ this.handleUfaceDevChange(this.personForm.ufaceDevId); // 做一下全选按钮的选中与否
}
if (value.ufaceDevGroupId) {
- this.personForm.ufaceDevGroupId = value.ufaceDevGroupId.split(',')
- this.handleUGroupChange(this.personForm.ufaceDevGroupId) // 做一下全选按钮的选中与否
+ this.personForm.ufaceDevGroupId = value.ufaceDevGroupId.split(",");
+ this.handleUGroupChange(this.personForm.ufaceDevGroupId); // 做一下全选按钮的选中与否
} else {
- this.personForm.ufaceDevGroupId = []
- this.handleUGroupChange(this.personForm.ufaceDevGroupId) // 做一下全选按钮的选中与否
+ this.personForm.ufaceDevGroupId = [];
+ this.handleUGroupChange(this.personForm.ufaceDevGroupId); // 做一下全选按钮的选中与否
}
if (this.personForm.ruleId == 0) {
- this.personForm.ruleId = ''
+ this.personForm.ruleId = "";
}
- this.personForm.sex = Number(value.sex)
- this.personForm.inserviceType = type == 2 ? 1 : value.inserviceType
- this.personForm.longTerm = value.longTerm == 1 ? true : false
+ this.personForm.sex = Number(value.sex);
+ this.personForm.inserviceType = type == 2 ? 1 : value.inserviceType;
+ this.personForm.longTerm = value.longTerm == 1 ? true : false;
//体检报告
let arr1 =
- value.examinationImage != '' && value.examinationImage.split(',')
- let newArr1 = []
+ value.examinationImage != "" && value.examinationImage.split(",");
+ let newArr1 = [];
if (arr1.length > 1) {
for (let i in arr1) {
- let a = arr1[i].split('*')
- newArr1.push({ name: a[0], url: a[1] })
+ let a = arr1[i].split("*");
+ newArr1.push({ name: a[0], url: a[1] });
}
} else {
- if (value.examinationImage != '') {
- let a = arr1[0].split('*')
- newArr1.push({ name: a[0], url: a[1] })
+ if (value.examinationImage != "") {
+ let a = arr1[0].split("*");
+ newArr1.push({ name: a[0], url: a[1] });
}
}
- this.examinationFile = value.examinationImage != '' ? newArr1 : [] //体检报告
+ this.examinationFile = value.examinationImage != "" ? newArr1 : []; //体检报告
//合同附件
- let arr2 = value.contractImage != '' && value.contractImage.split(',')
- let newArr2 = []
+ let arr2 = value.contractImage != "" && value.contractImage.split(",");
+ let newArr2 = [];
if (arr2.length > 1) {
for (let i in arr2) {
- let a = arr2[i].split('*')
- newArr2.push({ name: a[0], url: a[1] })
+ let a = arr2[i].split("*");
+ newArr2.push({ name: a[0], url: a[1] });
}
} else {
- if (value.contractImage != '') {
- let a = arr2[0].split('*')
- newArr2.push({ name: a[0], url: a[1] })
+ if (value.contractImage != "") {
+ let a = arr2[0].split("*");
+ newArr2.push({ name: a[0], url: a[1] });
}
}
- this.contractFile = value.contractImage != '' ? newArr2 : [] //合同附件
+ this.contractFile = value.contractImage != "" ? newArr2 : []; //合同附件
//从业资格证书
- let arr3 = value.employmentCard != '' && value.employmentCard.split(',')
- let newArr3 = []
+ let arr3 = value.employmentCard != "" && value.employmentCard.split(",");
+ let newArr3 = [];
if (arr3.length > 1) {
for (let i in arr3) {
- let a = arr3[i].split('*')
- newArr3.push({ name: a[0], url: a[1] })
+ let a = arr3[i].split("*");
+ newArr3.push({ name: a[0], url: a[1] });
}
} else {
- if (value.employmentCard != '') {
- let a = arr3[0].split('*')
- newArr3.push({ name: a[0], url: a[1] })
+ if (value.employmentCard != "") {
+ let a = arr3[0].split("*");
+ newArr3.push({ name: a[0], url: a[1] });
}
}
- this.employmentFile = value.employmentCard != '' ? newArr3 : [] //从业资格证书
+ this.employmentFile = value.employmentCard != "" ? newArr3 : []; //从业资格证书
//身份证头像
this.idCardUpPhotoFile =
- value.idCardBigPhotoUrl != ''
+ value.idCardBigPhotoUrl != ""
? [{ name: value.idCardBigPhotoUrl, url: value.idCardBigPhotoUrl }]
- : [] //身份证头像
+ : []; //身份证头像
//现场采集人脸
this.fieldAcquisitionFile =
- value.fieldAcquisitionUrl != ''
+ value.fieldAcquisitionUrl != ""
? [
{
name: value.fieldAcquisitionUrl,
- url: value.fieldAcquisitionUrl
- }
+ url: value.fieldAcquisitionUrl,
+ },
]
- : [] //现场采集人脸
+ : []; //现场采集人脸
this.idCardUpPhotoUrlFile =
- value.idCardUpPhotoUrl != ''
+ value.idCardUpPhotoUrl != ""
? [{ name: value.idCardUpPhotoUrl, url: value.idCardUpPhotoUrl }]
- : [] //身份证国徽
+ : []; //身份证国徽
this.idCardDownPhotoUrlFile =
- value.idCardDownPhotoUrl != ''
+ value.idCardDownPhotoUrl != ""
? [{ name: value.idCardDownPhotoUrl, url: value.idCardDownPhotoUrl }]
- : [] //身份证人像
+ : []; //身份证人像
},
// 删除 人员信息
- removeWorkerInfo (value) {
+ removeWorkerInfo(value) {
this.$confirm(
- this.$t('message.laborMange.deleteHint'),
- this.$t('message.laborMange.hint'),
+ this.$t("message.laborMange.deleteHint"),
+ this.$t("message.laborMange.hint"),
{
- confirmButtonText: this.$t('message.laborMange.confirm'),
- cancelButtonText: this.$t('message.laborMange.cancel'),
- type: 'warning'
+ confirmButtonText: this.$t("message.laborMange.confirm"),
+ cancelButtonText: this.$t("message.laborMange.cancel"),
+ type: "warning",
}
)
.then(() => {
let data = {
- id: value.id
- }
- deleteWorkerInfo(data).then(res => {
+ id: value.id,
+ };
+ deleteWorkerInfo(data).then((res) => {
if (res.code == 200) {
this.$message({
- type: 'success',
- message: this.$t('message.laborMange.deleteSuccess')
- })
+ type: "success",
+ message: this.$t("message.laborMange.deleteSuccess"),
+ });
this.page =
this.page > 1 && this.tableListData.length == 1
? this.page - 1
- : this.page
- this.getTeamList(1)
+ : this.page;
+ this.getTeamList(1);
}
- })
+ });
})
- .catch(console.log)
+ .catch(console.log);
},
//查看 人员信息 详情
- viewDetails (value) {
+ viewDetails(value) {
this.$router.push({
- path: '/project/labor/personDetails',
+ path: "/project/labor/personDetails",
query: {
- id: value.id
- }
- })
- localStorage.setItem('showPersonModule', 1)
+ id: value.id,
+ },
+ });
+ localStorage.setItem("showPersonModule", 1);
},
//列表数据 退场按钮
- workerExitBtn (value, type) {
+ workerExitBtn(value, type) {
// type == 1 单条数据操作 2 批量操作
- let arr = []
+ let arr = [];
if (type == 2 && this.checkedWorker.length > 0) {
for (let i in this.checkedWorker) {
- arr.push(this.checkedWorker[i].id)
+ arr.push(this.checkedWorker[i].id);
}
}
let data = {
- workerIdStr: type == 1 ? value.id : arr.join(',')
- }
+ workerIdStr: type == 1 ? value.id : arr.join(","),
+ };
this.$confirm(
- this.$t('message.laborMange.bowOutWithHint'),
- this.$t('message.laborMange.hint'),
+ this.$t("message.laborMange.bowOutWithHint"),
+ this.$t("message.laborMange.hint"),
{
- confirmButtonText: this.$t('message.laborMange.confirm'),
- cancelButtonText: this.$t('message.laborMange.cancel'),
- type: 'warning'
+ confirmButtonText: this.$t("message.laborMange.confirm"),
+ cancelButtonText: this.$t("message.laborMange.cancel"),
+ type: "warning",
}
).then(() => {
- updateWorkerExit(data).then(res => {
+ updateWorkerExit(data).then((res) => {
if (res.code == 200) {
- this.getTeamList()
+ this.getTeamList();
this.$message({
- type: 'success',
- message: this.$t('message.laborMange.bowOutWitSuccess')
- })
+ type: "success",
+ message: this.$t("message.laborMange.bowOutWitSuccess"),
+ });
}
- })
- })
+ });
+ });
},
//切换每页显示数量
- handleSizeChange (val) {
- this.pageSize = val
- this.getTableData()
+ handleSizeChange(val) {
+ this.pageSize = val;
+ this.getTableData();
},
//换页
- handleCurrentChange (val) {
- this.page = val
- sessionStorage.setItem('personPage', val)
- this.getTableData()
- this.$refs.multipleTable.bodyWrapper.scrollTop = 0
+ handleCurrentChange(val) {
+ this.page = val;
+ sessionStorage.setItem("personPage", val);
+ this.getTableData();
+ this.$refs.multipleTable.bodyWrapper.scrollTop = 0;
},
-
-
//功能开发中
- inDevelopment () {
- this.$message.warning(this.$t('message.laborMange.functionalDevelopment'))
+ inDevelopment() {
+ this.$message.warning(
+ this.$t("message.laborMange.functionalDevelopment")
+ );
},
//查询按钮
- inquireBtn () {
- window._paq.push(['trackEvent', '点击', '查询', '查询人员信息'])
- this.page = 1
- this.getTableData()
+ inquireBtn() {
+ window._paq.push(["trackEvent", "点击", "查询", "查询人员信息"]);
+ this.page = 1;
+ this.getTableData();
},
//刷新按钮
- refreshBtn () {
- window._paq.push(['trackEvent', '点击', '刷新', '刷新人员信息'])
- this.page = 1
- this.tableParameter.idCard = ''
- this.tableParameter.workerName = ''
- this.tableParameter.inserviceType = ''
- this.tableParameter.enterDate = ''
- this.tableParameter.codeState = ''
- this.getTableData()
+ refreshBtn() {
+ window._paq.push(["trackEvent", "点击", "刷新", "刷新人员信息"]);
+ this.page = 1;
+ this.tableParameter.idCard = "";
+ this.tableParameter.workerName = "";
+ this.tableParameter.inserviceType = "";
+ this.tableParameter.enterDate = "";
+ this.tableParameter.codeState = "";
+ this.getTableData();
},
//清空表单
- resetForm (formName) {
- this.aptitudeFileList = []
- this.logoFileList = []
- this.$refs[formName].resetFields()
+ resetForm(formName) {
+ this.aptitudeFileList = [];
+ this.logoFileList = [];
+ this.$refs[formName].resetFields();
},
// 文件上传 之前
- handleBeforeUpload (file, type) {
+ handleBeforeUpload(file, type) {
if (
- file.type != 'image/jpeg' &&
- file.type != 'image/png' &&
- file.type != 'image/jpg' &&
- file.type != 'image/bmp'
+ file.type != "image/jpeg" &&
+ file.type != "image/png" &&
+ file.type != "image/jpg" &&
+ file.type != "image/bmp"
) {
- this.$message.error(this.$t('message.companyDiagram.uploadMsg')) //只能上传图片
- return false
+ this.$message.error(this.$t("message.companyDiagram.uploadMsg")); //只能上传图片
+ return false;
} else if (type == 7) {
if (
- file.type != 'image/jpeg' &&
- file.type != 'image/jpg'
+ file.type != "image/jpeg" &&
+ file.type != "image/jpg"
// file.type != "image/png"
) {
- this.$message.error(this.$t('message.laborMange.hint8')) //"请上传jpg、jpeg格式图片"
- return false
+ this.$message.error(this.$t("message.laborMange.hint8")); //"请上传jpg、jpeg格式图片"
+ return false;
}
}
- return true
+ return true;
},
//删除 身份证头像 或 现场采集照片
- shutIconBtn (type) {
+ shutIconBtn(type) {
if (type == 0) {
- this.personForm.idCardBigPhotoUrl = ''
- this.idCardUpPhotoFile = []
+ this.personForm.idCardBigPhotoUrl = "";
+ this.idCardUpPhotoFile = [];
} else if (type == 1) {
- this.personForm.fieldAcquisitionUrl = ''
- this.fieldAcquisitionFile = []
- this.personForm.personSerial = ''
- this.radio = ''
+ this.personForm.fieldAcquisitionUrl = "";
+ this.fieldAcquisitionFile = [];
+ this.personForm.personSerial = "";
+ this.radio = "";
} else if (type == 2) {
- this.personForm.idCardUpPhotoUrl = ''
- this.idCardUpPhotoFile = []
+ this.personForm.idCardUpPhotoUrl = "";
+ this.idCardUpPhotoFile = [];
} else if (type == 3) {
- this.personForm.idCardDownPhotoUrl = ''
- this.idCardDownPhotoUrlFile = []
+ this.personForm.idCardDownPhotoUrl = "";
+ this.idCardDownPhotoUrlFile = [];
}
},
//删除上传文件
- handleRemove (file, type) {
- if (file.status == 'ready') {
+ handleRemove(file, type) {
+ if (file.status == "ready") {
} else {
- this.$message.success(this.$t('message.laborMange.deleteSuccess'))
+ this.$message.success(this.$t("message.laborMange.deleteSuccess"));
if (type == 1) {
- this.enterpriseForm.enterpriseQualificationUrl = ''
+ this.enterpriseForm.enterpriseQualificationUrl = "";
} else if (type == 2) {
- this.enterpriseForm.logo = ''
+ this.enterpriseForm.logo = "";
} else if (type == 3) {
- let newArr = []
- let arrJoin = []
+ let newArr = [];
+ let arrJoin = [];
for (let i = 0; i < this.examinationFile.length; i++) {
if (file.uid == this.examinationFile[i].uid) {
- this.examinationFile.splice(i, 1)
- newArr = this.examinationFile
+ this.examinationFile.splice(i, 1);
+ newArr = this.examinationFile;
}
}
if (newArr.length > 0) {
for (let j = 0; j < newArr.length; j++) {
let data =
- this.examinationFile[j].name + '*' + this.examinationFile[j].url
- arrJoin.push(data)
+ this.examinationFile[j].name +
+ "*" +
+ this.examinationFile[j].url;
+ arrJoin.push(data);
}
} else {
- arrJoin = newArr
+ arrJoin = newArr;
}
- this.personForm.examinationImage = arrJoin.join(',')
+ this.personForm.examinationImage = arrJoin.join(",");
} else if (type == 4) {
- let newArr = []
- let arrJoin = []
+ let newArr = [];
+ let arrJoin = [];
for (let i = 0; i < this.contractFile.length; i++) {
if (file.uid == this.contractFile[i].uid) {
- this.contractFile.splice(i, 1)
- newArr = this.contractFile
+ this.contractFile.splice(i, 1);
+ newArr = this.contractFile;
}
}
if (newArr.length > 0) {
for (let j = 0; j < newArr.length; j++) {
let data =
- this.contractFile[j].name + '*' + this.contractFile[j].url
- arrJoin.push(data)
+ this.contractFile[j].name + "*" + this.contractFile[j].url;
+ arrJoin.push(data);
}
} else {
- arrJoin = newArr
+ arrJoin = newArr;
}
- this.personForm.contractImage = arrJoin.join(',')
+ this.personForm.contractImage = arrJoin.join(",");
} else if (type == 5) {
- let newArr = []
- let arrJoin = []
+ let newArr = [];
+ let arrJoin = [];
for (let i = 0; i < this.employmentFile.length; i++) {
if (file.uid == this.employmentFile[i].uid) {
- this.employmentFile.splice(i, 1)
- newArr = this.employmentFile
+ this.employmentFile.splice(i, 1);
+ newArr = this.employmentFile;
}
}
if (newArr.length > 0) {
for (let j = 0; j < newArr.length; j++) {
let data =
- this.employmentFile[j].name + '*' + this.employmentFile[j].url
- arrJoin.push(data)
+ this.employmentFile[j].name + "*" + this.employmentFile[j].url;
+ arrJoin.push(data);
}
} else {
- arrJoin = newArr
+ arrJoin = newArr;
}
- this.personForm.employmentCard = arrJoin.join(',')
+ this.personForm.employmentCard = arrJoin.join(",");
} else if (type == 6) {
- this.personForm.idCardBigPhotoUrl = ''
+ this.personForm.idCardBigPhotoUrl = "";
} else if (type == 7) {
- this.personForm.fieldAcquisitionUrl = ''
+ this.personForm.fieldAcquisitionUrl = "";
} else if (type == 8) {
- this.personForm.idCardUpPhotoUrl = ''
+ this.personForm.idCardUpPhotoUrl = "";
} else if (type == 9) {
- this.personForm.idCardDownPhotoUrl = ''
+ this.personForm.idCardDownPhotoUrl = "";
}
}
},
//上传成功
- handleSuccess (file, type, file2) {
- console.log(file, type, file2)
+ handleSuccess(file, type, file2) {
+ console.log(file, type, file2);
// 新增企业 type == 1 资质照片; 2 logo;
// 人员录入 type == 3 体检报告; 4 合同附件; 5 从业资格证书; 6 身份证头像; 7 现场采集人脸; 8 身份证国徽面; 9 身份证人像面
- if (file.code == 200 || file.status == 'SUCCESS') {
+ if (file.code == 200 || file.status == "SUCCESS") {
// this.$message.success(this.$t("message.laborMange.uploadSuccessful"));
- let obj = {}
+ let obj = {};
for (let i in file.data) {
- obj = { name: file.data[i].filename, url: file.data[i].imageUrl }
+ obj = { name: file.data[i].filename, url: file.data[i].imageUrl };
}
if (type == 1) {
- this.enterpriseForm.enterpriseQualificationUrl = JSON.stringify(obj)
- this.aptitudeFileList = [obj]
+ this.enterpriseForm.enterpriseQualificationUrl = JSON.stringify(obj);
+ this.aptitudeFileList = [obj];
} else if (type == 2) {
- this.enterpriseForm.logo = JSON.stringify(obj)
- this.logoFileList = [obj]
+ this.enterpriseForm.logo = JSON.stringify(obj);
+ this.logoFileList = [obj];
} else if (type == 3) {
- this.examinationFile.push(obj)
- let arrJoin = []
+ this.examinationFile.push(obj);
+ let arrJoin = [];
for (let i in this.examinationFile) {
let data =
- this.examinationFile[i].name + '*' + this.examinationFile[i].url
- arrJoin.push(data)
+ this.examinationFile[i].name + "*" + this.examinationFile[i].url;
+ arrJoin.push(data);
}
- this.personForm.examinationImage = arrJoin.join(',')
+ this.personForm.examinationImage = arrJoin.join(",");
} else if (type == 4) {
- this.contractFile.push(obj)
- let arrJoin = []
+ this.contractFile.push(obj);
+ let arrJoin = [];
for (let i in this.contractFile) {
let data =
- this.contractFile[i].name + '*' + this.contractFile[i].url
- arrJoin.push(data)
+ this.contractFile[i].name + "*" + this.contractFile[i].url;
+ arrJoin.push(data);
}
- this.personForm.contractImage = arrJoin.join(',')
+ this.personForm.contractImage = arrJoin.join(",");
} else if (type == 5) {
- this.employmentFile.push(obj)
- let arrJoin = []
+ this.employmentFile.push(obj);
+ let arrJoin = [];
for (let i in this.employmentFile) {
let data =
- this.employmentFile[i].name + '*' + this.employmentFile[i].url
- arrJoin.push(data)
+ this.employmentFile[i].name + "*" + this.employmentFile[i].url;
+ arrJoin.push(data);
}
- this.personForm.employmentCard = arrJoin.join(',')
+ this.personForm.employmentCard = arrJoin.join(",");
} else if (type == 8) {
- console.log('身份证正面上传', file)
+ console.log("身份证正面上传", file);
let data = {
name: file.data[0].filename,
- url: file.data[0].imageUrl
- }
- this.discernId(file.data[0].imageUrl, 2)
- this.personForm.idCardUpPhotoUrl = data.url
- this.idCardUpPhotoUrlFile = [data]
+ url: file.data[0].imageUrl,
+ };
+ this.discernId(file.data[0].imageUrl, 2);
+ this.personForm.idCardUpPhotoUrl = data.url;
+ this.idCardUpPhotoUrlFile = [data];
if (this.personForm.idCardDownPhotoUrl) {
- this.$refs['personForm'].clearValidate('idCardUpPhotoUrl')
+ this.$refs["personForm"].clearValidate("idCardUpPhotoUrl");
}
} else if (type == 9) {
let data = {
name: file.data[0].filename,
- url: file.data[0].imageUrl
- }
- this.discernId(file.data[0].imageUrl, 1)
- this.personForm.idCardDownPhotoUrl = data.url
- this.idCardDownPhotoUrlFile = [data]
+ url: file.data[0].imageUrl,
+ };
+ this.discernId(file.data[0].imageUrl, 1);
+ this.personForm.idCardDownPhotoUrl = data.url;
+ this.idCardDownPhotoUrlFile = [data];
if (this.personForm.idCardUpPhotoUrl) {
- this.$refs['personForm'].clearValidate('idCardUpPhotoUrl')
+ this.$refs["personForm"].clearValidate("idCardUpPhotoUrl");
}
}
} else {
//清空
- this.$message.error(file.message)
+ this.$message.error(file.message);
if (type == 1) {
- this.aptitudeFileList = []
+ this.aptitudeFileList = [];
} else if (type == 2) {
- this.logoFileList = []
+ this.logoFileList = [];
} else if (type == 3) {
- this.examinationFile = []
+ this.examinationFile = [];
} else if (type == 4) {
- this.contractFile = []
+ this.contractFile = [];
} else if (type == 5) {
- this.employmentFile = []
+ this.employmentFile = [];
} else if (type == 6) {
- this.idCardUpPhotoFile = []
+ this.idCardUpPhotoFile = [];
} else if (type == 7) {
- this.fieldAcquisitionFile = []
+ this.fieldAcquisitionFile = [];
} else if (type == 8) {
- this.idCardUpPhotoUrlFile = []
+ this.idCardUpPhotoUrlFile = [];
} else if (type == 9) {
- this.idCardDownPhotoUrlFile = []
+ this.idCardDownPhotoUrlFile = [];
}
}
},
// 人员照片库比对
- checkImgLibrary (url) {
- console.log(url)
+ checkImgLibrary(url) {
+ console.log(url);
checkImgLibraryApi({ fileUrl: url, projectSn: this.projectSn }).then(
- res => {
+ (res) => {
if (res.result && res.result.length > 0) {
- this.imgRadiolist = res.result
- this.radio = res.result[0].personSerial
- this.showImgList = true
- this.cropperDialog = false
+ this.imgRadiolist = res.result;
+ this.radio = res.result[0].personSerial;
+ this.showImgList = true;
+ this.cropperDialog = false;
} else {
- this.personForm.personSerial = ''
- this.personForm.fieldAcquisitionUrl = url
- this.fieldAcquisitionFile = [{ name: '', url: url }]
- this.cropperDialog = false
+ this.personForm.personSerial = "";
+ this.personForm.fieldAcquisitionUrl = url;
+ this.fieldAcquisitionFile = [{ name: "", url: url }];
+ this.cropperDialog = false;
}
- console.log(res, '-----人员库照片查询')
+ console.log(res, "-----人员库照片查询");
}
- )
+ );
},
//人脸监测、
- checkFace (url) {
- checkFaceApi({ fileUrl: url }).then(res => {
+ checkFace(url) {
+ checkFaceApi({ fileUrl: url }).then((res) => {
if (res.result.checkType == 1) {
- this.personForm.fieldAcquisitionUrl = url
- this.fieldAcquisitionFile = [{ name: '', url: url }]
- this.cropperDialog = false
+ this.personForm.fieldAcquisitionUrl = url;
+ this.fieldAcquisitionFile = [{ name: "", url: url }];
+ this.cropperDialog = false;
} else {
- this.$message.error(res.result.message)
+ this.$message.error(res.result.message);
}
- })
+ });
},
//保存截图
- saveMapUrlFn () {
- this.$refs.cropper.startCrop()
- var _this = this
- this.$refs.cropper.getCropBlob(data => {
- const isLt2M = data.size / 1024 < 500
+ saveMapUrlFn() {
+ this.$refs.cropper.startCrop();
+ var _this = this;
+ this.$refs.cropper.getCropBlob((data) => {
+ const isLt2M = data.size / 1024 < 500;
if (!isLt2M) {
- this.$message.error(this.$t('message.laborMange.hint9'))
- return
+ this.$message.error(this.$t("message.laborMange.hint9"));
+ return;
}
- var param = new FormData()
- param.append('files', data, 'image.png')
+ var param = new FormData();
+ param.append("files", data, "image.png");
_this.$http
- .post('/upload/image', param, {
+ .post("/upload/image", param, {
headers: {
- 'Content-Type': 'multipart/form-data'
- }
+ "Content-Type": "multipart/form-data",
+ },
})
- .then(res => {
- console.log('aaaaa', res)
- if (res.data.status == 'SUCCESS') {
+ .then((res) => {
+ console.log("aaaaa", res);
+ if (res.data.status == "SUCCESS") {
if (this.isSzProject == 1) {
- this.checkImgLibrary(res.data.data[0].imageUrl)
+ this.checkImgLibrary(res.data.data[0].imageUrl);
} else {
- this.checkFace(res.data.data[0].imageUrl)
+ this.checkFace(res.data.data[0].imageUrl);
}
}
- })
- })
+ });
+ });
},
// 超出 上传文件 数量
- handleExceed (file, type) {
+ handleExceed(file, type) {
this.$message.error(
- this.$t('message.laborMange.uploadLimitHasBeenReached')
- )
+ this.$t("message.laborMange.uploadLimitHasBeenReached")
+ );
},
//查看图片
- handlePreview (file, type) {
+ handlePreview(file, type) {
if (type === 0) {
- this.bigImageDialog = true
- this.bigImageUrl = file
+ this.bigImageDialog = true;
+ this.bigImageUrl = file;
} else {
// 新增企业 type == 1 资质照片; 2 logo;
// 人员录入 type == 3 体检报告; 4 合同附件; 5 从业资格证书; 6 身份证头像; 7 现场采集人脸;
- let fileType = null
+ let fileType = null;
if (file.response) {
- let url = file.response.data[0]
- fileType = url.imageUrl.split('.')[1]
+ let url = file.response.data[0];
+ fileType = url.imageUrl.split(".")[1];
} else {
- fileType = file.url.split('.')[1]
+ fileType = file.url.split(".")[1];
}
if (
- fileType != 'jpg' &&
- fileType != 'jpeg' &&
- fileType != 'png' &&
- fileType != 'bmp' &&
- fileType != 'gif'
+ fileType != "jpg" &&
+ fileType != "jpeg" &&
+ fileType != "png" &&
+ fileType != "bmp" &&
+ fileType != "gif"
) {
- window.open(this.fileUrl + file.url)
+ window.open(this.fileUrl + file.url);
//type== 0 直接查看列表中的图片
} else {
- this.bigImageDialog = true
+ this.bigImageDialog = true;
this.bigImageUrl = file.response
? this.fileUrl + file.response.data[0].imageUrl
- : this.fileUrl + file.url
+ : this.fileUrl + file.url;
}
}
},
//上传失败
- handleError (file, type) {
- this.$message.error(this.$t('message.laborMange.pleaseReupload'))
+ handleError(file, type) {
+ this.$message.error(this.$t("message.laborMange.pleaseReupload"));
},
//点击全选时
- handleCheckAllChange (val) {
- let checkedLst = val ? this.tableListData : []
- this.isIndeterminate = false
+ handleCheckAllChange(val) {
+ let checkedLst = val ? this.tableListData : [];
+ this.isIndeterminate = false;
for (let i in this.tableListData) {
if (checkedLst.length > 0 && this.tableListData[i].inserviceType == 1) {
this.$refs.multipleTable.toggleRowSelection(
this.tableListData[i],
true
- )
+ );
} else {
this.$refs.multipleTable.toggleRowSelection(
this.tableListData[i],
false
- )
+ );
}
}
},
// 获取 多选 选中的 数据
- handleCheckedCitiesChange (value) {
+ handleCheckedCitiesChange(value) {
if (value.length == 0) {
- this.$refs.multipleTable.toggleRowSelection([], false)
- this.checkAll = false
- this.isIndeterminate = false
- this.checkedWorker = []
+ this.$refs.multipleTable.toggleRowSelection([], false);
+ this.checkAll = false;
+ this.isIndeterminate = false;
+ this.checkedWorker = [];
} else {
- this.checkedWorker = value
- let checkedCount = value.length
- this.checkAll = checkedCount === this.tableListData.length
+ this.checkedWorker = value;
+ let checkedCount = value.length;
+ this.checkAll = checkedCount === this.tableListData.length;
this.isIndeterminate =
- checkedCount > 0 && checkedCount < this.tableListData.length
+ checkedCount > 0 && checkedCount < this.tableListData.length;
}
},
// 离职状态 不能多选
- selectEnable (row, rowIndex) {
+ selectEnable(row, rowIndex) {
if (row.inserviceType == 1) {
- return true
+ return true;
} else {
- return false
+ return false;
}
},
//批量移动按钮
- batchMove () {
- this.batchMoveDialog = true
+ batchMove() {
+ this.batchMoveDialog = true;
this.batchMoveForm = {
- teamId: '',
- enterpriseId: ''
- }
+ teamId: "",
+ enterpriseId: "",
+ };
setTimeout(() => {
- this.$refs['batchMoveForm'].clearValidate()
- }, 120)
- this.changeMoveCompany(this.checkedId)
+ this.$refs["batchMoveForm"].clearValidate();
+ }, 120);
+ this.changeMoveCompany(this.checkedId);
},
//选择批量移动的 公司时
- changeMoveCompany (value) {
- this.batchMoveForm.teamId = ''
+ changeMoveCompany(value) {
+ this.batchMoveForm.teamId = "";
let data = {
enterpriseId: value,
- projectSn: this.projectSn
- }
- getTeamInfoList(data).then(res => {
+ projectSn: this.projectSn,
+ };
+ getTeamInfoList(data).then((res) => {
if (res.code == 200) {
- this.moveTeamList = res.result
+ this.moveTeamList = res.result;
}
- })
+ });
},
//批量移动 保存按钮
- saveBatchMove (formName) {
- this.$refs[formName].validate(valid => {
+ saveBatchMove(formName) {
+ this.$refs[formName].validate((valid) => {
if (valid) {
- let data = this.batchMoveForm
- let arr = []
+ let data = this.batchMoveForm;
+ let arr = [];
if (this.checkedWorker.length > 0) {
for (let i in this.checkedWorker) {
- arr.push(this.checkedWorker[i].id)
+ arr.push(this.checkedWorker[i].id);
}
}
- data.workerIdStr = arr.join(',')
- updateWorkerTeam(data).then(res => {
+ data.workerIdStr = arr.join(",");
+ updateWorkerTeam(data).then((res) => {
if (res.code == 200) {
- this.batchMoveDialog = false
- this.$message.success(this.$t('message.laborMange.mobileSuccess'))
- this.getTeamList()
- this.resetForm(formName)
+ this.batchMoveDialog = false;
+ this.$message.success(
+ this.$t("message.laborMange.mobileSuccess")
+ );
+ this.getTeamList();
+ this.resetForm(formName);
}
- })
+ });
} else {
- return false
+ return false;
}
- })
+ });
},
//新增 人员 输入身份证 自动获取 出身日期 性别
- changeIdCard (value) {
+ changeIdCard(value) {
if (value.length < 18) {
this.$message.error(
- this.$t('message.laborMange.PleaseEnterYourFullIDNumber')
- )
- return
+ this.$t("message.laborMange.PleaseEnterYourFullIDNumber")
+ );
+ return;
} else {
- let birth = this.getBirth(value)
- let sex = this.getSex(value)
- this.personForm.sex = Number(sex)
- this.personForm.birthday = birth
+ let birth = this.getBirth(value);
+ let sex = this.getSex(value);
+ this.personForm.sex = Number(sex);
+ this.personForm.birthday = birth;
}
},
// 获取 出生日期
- getBirth (idCard) {
- var birthday = ''
- if (idCard != null && idCard != '') {
+ getBirth(idCard) {
+ var birthday = "";
+ if (idCard != null && idCard != "") {
if (idCard.length == 15) {
- birthday = '19' + idCard.slice(6, 12)
+ birthday = "19" + idCard.slice(6, 12);
} else if (idCard.length == 18) {
- birthday = idCard.slice(6, 14)
+ birthday = idCard.slice(6, 14);
}
- birthday = birthday.replace(/(.{4})(.{2})/, '$1-$2-')
+ birthday = birthday.replace(/(.{4})(.{2})/, "$1-$2-");
//通过正则表达式来指定输出格式为:1990-01-01
}
- return birthday
+ return birthday;
},
//获取 性别 男女
- getSex (idCard) {
- var sexStr = ''
+ getSex(idCard) {
+ var sexStr = "";
if (parseInt(idCard.slice(-2, -1)) % 2 == 1) {
- sexStr = '1'
+ sexStr = "1";
} else {
- sexStr = '2'
+ sexStr = "2";
}
- return sexStr
+ return sexStr;
},
//下载插件
- downloadPlugIn () {
- window.open('http://139.159.226.224:9000/itbgp/file/IDCamera1.0.rar')
+ downloadPlugIn() {
+ window.open("http://139.159.226.224:9000/itbgp/file/IDCamera1.0.rar");
},
//打开摄像头
- turnOnTheCamera (type) {
- var ws = new WebSocket('ws://127.0.0.1:1818')
- this.webSocket = ws
- ws.onopen = event => {
- this.onopen(event, type)
- }
+ turnOnTheCamera(type) {
+ var ws = new WebSocket("ws://127.0.0.1:1818");
+ this.webSocket = ws;
+ ws.onopen = (event) => {
+ this.onopen(event, type);
+ };
- ws.onmessage = event => {
- this.onmessage(event, type)
- }
+ ws.onmessage = (event) => {
+ this.onmessage(event, type);
+ };
- ws.onerror = this.onerror
+ ws.onerror = this.onerror;
},
//发送链接设备请求
- onopen (event, type) {
+ onopen(event, type) {
if (type == 1) {
// 识别身份证
- this.webSocket.send('ReadCard(1001,C:\\Doccamera\\)')
+ this.webSocket.send("ReadCard(1001,C:\\Doccamera\\)");
} else if (type == 2) {
//打开人脸 摄像头
- this.webSocket.send('OpenFaceFrame(1)')
- this.webSocket.send('vSetResolutionEx(2,3)')
- this.webSocket.send('bStartPlay2')
+ this.webSocket.send("OpenFaceFrame(1)");
+ this.webSocket.send("vSetResolutionEx(2,3)");
+ this.webSocket.send("bStartPlay2");
} else {
//文件 打开识别摄像头
- this.webSocket.send('OpenFaceFrame(0)')
- this.webSocket.send('vSetResolutionEx(2,3)')
- this.webSocket.send('bStartPlay')
+ this.webSocket.send("OpenFaceFrame(0)");
+ this.webSocket.send("vSetResolutionEx(2,3)");
+ this.webSocket.send("bStartPlay");
}
},
//接收服务器返回的信息
- onmessage (event, type) {
+ onmessage(event, type) {
//结束通讯
if (
- event.data.indexOf('BeginbStopPlaytrueEndbStopPlay') >= 0 ||
- event.data.indexOf('BeginbStopPlayfalseEndbStopPlay') >= 0 ||
- event.data.indexOf('BeginbStartPlayfalseEndbStartPlay') >= 0 ||
- event.data.indexOf('BeginbStartPlay2falseEndbStartPlay2') >= 0 ||
- event.data.indexOf('BeginOpenFaceFrametrueEndOpenFaceFrame') >= 0
+ event.data.indexOf("BeginbStopPlaytrueEndbStopPlay") >= 0 ||
+ event.data.indexOf("BeginbStopPlayfalseEndbStopPlay") >= 0 ||
+ event.data.indexOf("BeginbStartPlayfalseEndbStartPlay") >= 0 ||
+ event.data.indexOf("BeginbStartPlay2falseEndbStartPlay2") >= 0 ||
+ event.data.indexOf("BeginOpenFaceFrametrueEndOpenFaceFrame") >= 0
) {
- this.instrUmentScreenDialog = false
- return
+ this.instrUmentScreenDialog = false;
+ return;
} else if (
- event.data.indexOf('BeginbStopPlaytrueEndbStopPlay') == -1 &&
- event.data.indexOf('BeginReadCard') == -1
+ event.data.indexOf("BeginbStopPlaytrueEndbStopPlay") == -1 &&
+ event.data.indexOf("BeginReadCard") == -1
) {
- this.instrUmentScreenDialog = true
+ this.instrUmentScreenDialog = true;
}
- if (event.data.indexOf('BeginReadCard') >= 0) {
+ if (event.data.indexOf("BeginReadCard") >= 0) {
//获取身份证信息
- if (event.data == 'BeginReadCardEndReadCard') {
+ if (event.data == "BeginReadCardEndReadCard") {
this.$message.error(
- this.$t('message.laborMange.failedToObtainIdentityInformation')
- )
- return
+ this.$t("message.laborMange.failedToObtainIdentityInformation")
+ );
+ return;
} else {
// 截取掉 多余的字符
let data = JSON.parse(
- event.data.replace('BeginReadCard', '').replace('EndReadCard', '')
- )
+ event.data.replace("BeginReadCard", "").replace("EndReadCard", "")
+ );
//身份证 人脸照片
- this.uploadFile(data.PhotoB64, 1)
+ this.uploadFile(data.PhotoB64, 1);
//身份证 国徽面
- this.uploadFile(data.BackB64, 2)
+ this.uploadFile(data.BackB64, 2);
//身份证 人像面
- this.uploadFile(data.FrontB64, 3)
- this.$refs['personForm'].clearValidate()
- this.personForm.nativePlace = data.Address
- this.personForm.issuingAuthorityForIdcard = data.Agency
+ this.uploadFile(data.FrontB64, 3);
+ this.$refs["personForm"].clearValidate();
+ this.personForm.nativePlace = data.Address;
+ this.personForm.issuingAuthorityForIdcard = data.Agency;
this.personForm.nation =
- data.Folk + this.$t('message.laborMange.clan')
- this.personForm.workerName = data.Name
- this.personForm.idCard = data.IdNo
+ data.Folk + this.$t("message.laborMange.clan");
+ this.personForm.workerName = data.Name;
+ this.personForm.idCard = data.IdNo;
//截取身份证有效日期
- let date = data.Valid.split('-')
- this.personForm.idCardEndDate = date[1] == '长期' ? '' : date[1]
- this.personForm.longTerm = date[1] == '长期' ? true : false
- this.changeIdCard(data.IdNo)
+ let date = data.Valid.split("-");
+ this.personForm.idCardEndDate = date[1] == "长期" ? "" : date[1];
+ this.personForm.longTerm = date[1] == "长期" ? true : false;
+ this.changeIdCard(data.IdNo);
}
- } else if (event.data.indexOf('BeginBase64') >= 0) {
+ } else if (event.data.indexOf("BeginBase64") >= 0) {
if (type == 2) {
- this.$message.success(this.$t('message.laborMange.takePhotosSuccess'))
+ this.$message.success(
+ this.$t("message.laborMange.takePhotosSuccess")
+ );
// 上传的是现场采集照片
- let url = JSON.parse(JSON.stringify(event.data.substring(11)))
- this.uploadFile(url, 4)
+ let url = JSON.parse(JSON.stringify(event.data.substring(11)));
+ this.uploadFile(url, 4);
} else if (type == 5) {
//合同附件
if (this.contractFile.length >= 3) {
this.$message.error(
- this.$t('message.laborMange.uploadLimitHasBeenReached')
- )
- return
+ this.$t("message.laborMange.uploadLimitHasBeenReached")
+ );
+ return;
} else {
this.$message.success(
- this.$t('message.laborMange.takePhotosSuccess')
- )
- let url = JSON.parse(JSON.stringify(event.data.substring(11)))
- this.uploadFile(url, 5)
+ this.$t("message.laborMange.takePhotosSuccess")
+ );
+ let url = JSON.parse(JSON.stringify(event.data.substring(11)));
+ this.uploadFile(url, 5);
}
} else if (type == 6) {
//从业资格证书
if (this.employmentFile.length >= 3) {
this.$message.error(
- this.$t('message.laborMange.uploadLimitHasBeenReached')
- )
- return
+ this.$t("message.laborMange.uploadLimitHasBeenReached")
+ );
+ return;
} else {
this.$message.success(
- this.$t('message.laborMange.takePhotosSuccess')
- )
- let url = JSON.parse(JSON.stringify(event.data.substring(11)))
- this.uploadFile(url, 6)
+ this.$t("message.laborMange.takePhotosSuccess")
+ );
+ let url = JSON.parse(JSON.stringify(event.data.substring(11)));
+ this.uploadFile(url, 6);
}
} else if (type == 7) {
//体检报告
if (this.examinationFile.length >= 3) {
this.$message.error(
- this.$t('message.laborMange.uploadLimitHasBeenReached')
- )
- return
+ this.$t("message.laborMange.uploadLimitHasBeenReached")
+ );
+ return;
} else {
this.$message.success(
- this.$t('message.laborMange.takePhotosSuccess')
- )
- let url = JSON.parse(JSON.stringify(event.data.substring(11)))
- this.uploadFile(url, 7)
+ this.$t("message.laborMange.takePhotosSuccess")
+ );
+ let url = JSON.parse(JSON.stringify(event.data.substring(11)));
+ this.uploadFile(url, 7);
}
}
} else {
//显示的图像
- this.umentScreenUrl = this.base64Type + event.data
+ this.umentScreenUrl = this.base64Type + event.data;
}
},
- onerror () {
- this.$message.error(this.$t('message.laborMange.failedToConnectDevice'))
+ onerror() {
+ this.$message.error(this.$t("message.laborMange.failedToConnectDevice"));
},
//保存 并 关闭
- onclose (type) {
+ onclose(type) {
if (type == 1) {
- this.webSocket.send('sGetBase64')
+ this.webSocket.send("sGetBase64");
} else if (type == 2) {
- this.webSocket.send('bStopPlay')
+ this.webSocket.send("bStopPlay");
}
},
//上传现场采集照片发到服务器
- uploadFile (url, type) {
- let param = new FormData() //创建form对象
+ uploadFile(url, type) {
+ let param = new FormData(); //创建form对象
// if(url.endsWidth('EndBase64')){
- url = url.replace('EndBase64', '')
+ url = url.replace("EndBase64", "");
// }
- param.append('base64Image', this.base64Type + url) //通过append向form对象添加数据
+ param.append("base64Image", this.base64Type + url); //通过append向form对象添加数据
this.$http({
- url: '/upload/uploadBase64',
- method: 'post',
+ url: "/upload/uploadBase64",
+ method: "post",
data: param,
headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
- }
- }).then(res => {
- if ((res.status = 'SUCCESS')) {
+ "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
+ },
+ }).then((res) => {
+ if ((res.status = "SUCCESS")) {
if (type == 1) {
- this.personForm.idCardBigPhotoUrl = res.data.data.imageUrl
+ this.personForm.idCardBigPhotoUrl = res.data.data.imageUrl;
} else if (type == 2) {
- this.personForm.idCardUpPhotoUrl = res.data.data.imageUrl
+ this.personForm.idCardUpPhotoUrl = res.data.data.imageUrl;
} else if (type == 3) {
- this.personForm.idCardDownPhotoUrl = res.data.data.imageUrl
+ this.personForm.idCardDownPhotoUrl = res.data.data.imageUrl;
} else if (type == 4) {
- this.personForm.fieldAcquisitionUrl = res.data.data.imageUrl
+ this.personForm.fieldAcquisitionUrl = res.data.data.imageUrl;
} else if (type == 5) {
let arr =
- this.personForm.contractImage != ''
- ? this.personForm.contractImage.split(',')
- : []
+ this.personForm.contractImage != ""
+ ? this.personForm.contractImage.split(",")
+ : [];
let newUrl =
- this.$t('message.laborMange.contract') +
+ this.$t("message.laborMange.contract") +
(arr.length + 1) +
- '*' +
- res.data.data.imageUrl
+ "*" +
+ res.data.data.imageUrl;
let data = {
- name: this.$t('message.laborMange.contract') + (arr.length + 1),
- url: res.data.data.imageUrl
- }
- arr.push(newUrl)
- this.personForm.contractImage = arr.join(',')
- this.contractFile.push(data)
+ name: this.$t("message.laborMange.contract") + (arr.length + 1),
+ url: res.data.data.imageUrl,
+ };
+ arr.push(newUrl);
+ this.personForm.contractImage = arr.join(",");
+ this.contractFile.push(data);
} else if (type == 6) {
let arr =
- this.personForm.employmentCard != ''
- ? this.personForm.employmentCard.split(',')
- : []
+ this.personForm.employmentCard != ""
+ ? this.personForm.employmentCard.split(",")
+ : [];
let newUrl =
- this.$t('message.laborMange.certificate') +
+ this.$t("message.laborMange.certificate") +
(arr.length + 1) +
- '*' +
- res.data.data.imageUrl
+ "*" +
+ res.data.data.imageUrl;
let data = {
name:
- this.$t('message.laborMange.certificate') + (arr.length + 1),
- url: res.data.data.imageUrl
- }
- arr.push(newUrl)
- this.personForm.employmentCard = arr.join(',')
- this.employmentFile.push(data)
+ this.$t("message.laborMange.certificate") + (arr.length + 1),
+ url: res.data.data.imageUrl,
+ };
+ arr.push(newUrl);
+ this.personForm.employmentCard = arr.join(",");
+ this.employmentFile.push(data);
} else if (type == 7) {
let arr =
- this.personForm.examinationImage != ''
- ? this.personForm.examinationImage.split(',')
- : []
+ this.personForm.examinationImage != ""
+ ? this.personForm.examinationImage.split(",")
+ : [];
let newUrl =
- this.$t('message.laborMange.physical') +
+ this.$t("message.laborMange.physical") +
(arr.length + 1) +
- '*' +
- res.data.data.imageUrl
+ "*" +
+ res.data.data.imageUrl;
let data = {
- name: this.$t('message.laborMange.physical') + (arr.length + 1),
- url: res.data.data.imageUrl
- }
- arr.push(newUrl)
- this.personForm.examinationImage = arr.join(',')
- this.examinationFile.push(data)
+ name: this.$t("message.laborMange.physical") + (arr.length + 1),
+ url: res.data.data.imageUrl,
+ };
+ arr.push(newUrl);
+ this.personForm.examinationImage = arr.join(",");
+ this.examinationFile.push(data);
}
} else {
this.$message.error(
- this.$t('message.laborMange.PhotoUploadingToServerFailed')
- )
+ this.$t("message.laborMange.PhotoUploadingToServerFailed")
+ );
}
- })
+ });
},
//身份证识别
- discernId (url, type) {
+ discernId(url, type) {
let data = {
imageUrl: this.fileUrl + url,
- side: type
- }
- getIdCardInfoApi(data).then(res => {
- console.log('返回值', res)
+ side: type,
+ };
+ getIdCardInfoApi(data).then((res) => {
+ console.log("返回值", res);
if (res.code == 200) {
- console.log('成了吗', res)
- let val = res.result
+ console.log("成了吗", res);
+ let val = res.result;
if (type == 1) {
this.personForm.nation =
- val.ethnicity + this.$t('message.laborMange.clan')
- this.personForm.sex = val.sex == '男' ? 1 : 2
- this.personForm.workerName = val.name
- this.personForm.birthday = val.birth
- this.personForm.nativePlace = val.address
- this.personForm.idCard = val.number
+ val.ethnicity + this.$t("message.laborMange.clan");
+ this.personForm.sex = val.sex == "男" ? 1 : 2;
+ this.personForm.workerName = val.name;
+ this.personForm.birthday = val.birth;
+ this.personForm.nativePlace = val.address;
+ this.personForm.idCard = val.number;
} else {
- this.personForm.issuingAuthorityForIdcard = val.issue
+ this.personForm.issuingAuthorityForIdcard = val.issue;
this.personForm.idCardEndDate =
- val.valid_to != '长期' ? val.valid_to : ''
- this.personForm.longTerm = val.valid_to == '长期' ? true : false
+ val.valid_to != "长期" ? val.valid_to : "";
+ this.personForm.longTerm = val.valid_to == "长期" ? true : false;
}
} else {
- this.$message.error(this.$t('message.laborMange.hint10'))
+ this.$message.error(this.$t("message.laborMange.hint10"));
}
- })
+ });
},
- tableRowClassName ({ row, rowIndex }) {
+ tableRowClassName({ row, rowIndex }) {
if (row.sendSuccessStatus === 1) {
- return 'green2'
+ return "green2";
}
if (row.sendSuccessStatus === 2) {
- return 'red2'
+ return "red2";
}
if (row.sendSuccessStatus === 3) {
- return 'yellow2'
+ return "yellow2";
}
},
- async issueTeamEvent (id) {
- this.issueTeamDialog = true
-this.whoId = id
- this.getNewestList()
+ async issueTeamEvent(id) {
+ this.issueTeamDialog = true;
+ this.whoId = id;
+ this.getNewestList();
},
- async getNewestList(){
+ async getNewestList() {
const res = await xmglXzHikvisionSyncGetNewestList({
// pageNo:this.issuePage.pageNo,
// pageSize:this.issuePage.pageSize,
- whoId: this.whoId
- })
- console.log(res, '---------------------')
- this.issuePointList = res.result
+ whoId: this.whoId,
+ });
+ console.log(res, "---------------------");
+ this.issuePointList = res.result;
},
- async retryEvent(id){
- const res = await xmglXzHikvisionSyncRetryAPI({
- id:id
-})
-console.log(res);
- }
- }
-}
+ async retryEvent(id) {
+ const res = await xmglXzHikvisionSyncRetryAPI({
+ id: id,
+ });
+ console.log(res);
+ },
+ },
+};