diff --git a/src/assets/js/api/carManage.js b/src/assets/js/api/carManage.js index 095bda3a..68a0f675 100644 --- a/src/assets/js/api/carManage.js +++ b/src/assets/js/api/carManage.js @@ -41,6 +41,7 @@ export const getCarPassRecordListApi = data => post('xmgl/carPassRecord/getCarPa export const getCarPassRecordListByPageApi = data => post('xmgl/carPassRecord/list', data);//分页列表查询车辆通行记录信息 +export const pullCarDataApi = data => post('xmgl/hikvision/getCrossRecords', data);//同步车辆通行数据 diff --git a/src/assets/js/api/laborPerson.js b/src/assets/js/api/laborPerson.js index 4c3e030a..14ab8113 100644 --- a/src/assets/js/api/laborPerson.js +++ b/src/assets/js/api/laborPerson.js @@ -21,6 +21,8 @@ export const updateWorkerExit = data => post('xmgl/workerInfo/updateWorkerExit', export const updateWorkerTeam = data => post('xmgl/workerInfo/updateWorkerTeam', data); //人员批量移动 export const deleteWorkerInfo = data => post('xmgl/workerInfo/delete', data); //删除 人员 信息 export const sendBatchWokerApi = data => post('xmgl/ufaceDev/sendBatchWokerDev', data); // 下发通行人员 +export const pullMemberDataApi = data => post('xmgl/hikvision/getDoorEvents', data); // 拉取人员通行数据 + //详情 export const getWorkerInfoData = data => post('xmgl/workerInfo/viewWorkerInfoDetail', data); //获取 人员 详细所有信息 export const addContractApi = data => post('xmgl/workerContract/add', data); //新增合同信息 diff --git a/src/views/projectFront/carManage/realTimeData.vue b/src/views/projectFront/carManage/realTimeData.vue index 491992d5..b8240a54 100644 --- a/src/views/projectFront/carManage/realTimeData.vue +++ b/src/views/projectFront/carManage/realTimeData.vue @@ -42,6 +42,12 @@ {{$t('message.deviceManage.query')}} + 同步车辆通行数据 @@ -97,16 +103,74 @@ > + + +
+
+ 同步车辆通行数据 +
?
+
此处可同步海康ISC平台的通行数据
+
+
+
+ + + + + + +
+ +
+
\ No newline at end of file diff --git a/src/views/projectFront/laborManage/attendanceManage/attendanceManage.vue b/src/views/projectFront/laborManage/attendanceManage/attendanceManage.vue index dff2b5ee..b4e528ee 100644 --- a/src/views/projectFront/laborManage/attendanceManage/attendanceManage.vue +++ b/src/views/projectFront/laborManage/attendanceManage/attendanceManage.vue @@ -8,7 +8,8 @@ size="medium" > - @@ -28,53 +29,70 @@ - - - - - + - {{ $t("message.laborMange.inquire") }} + {{ + $t("message.laborMange.refresh") + }} {{ $t("message.laborMange.refresh")}}{{ + $t("message.laborMange.export") + + $t("message.laborMange.detailData") + }} + {{ + $t("message.laborMange.export") + $t("message.laborMange.monthData") + }} + {{ $t("message.laborMange.recountData") }} + {{ + $t("message.laborMange.attendPrint") + }} + 拉取通行数据 - {{$t("message.laborMange.export")+$t("message.laborMange.detailData")}} - {{$t("message.laborMange.export")+$t("message.laborMange.monthData")}} - {{$t("message.laborMange.recountData")}} - {{$t("message.laborMange.attendPrint")}} @@ -262,64 +306,61 @@ > - + - + - - + - - + - - - + @@ -388,6 +429,60 @@ + + +
+
+ 同步人员通行数据 +
?
+
此处可同步海康ISC平台的通行数据
+
+
+
+ + + + + + +
+ +
+
-
- - - - - - - - - -
- + :modal-append-to-body="false" + :title=" + selectDateType == 1 + ? $t('message.laborMange.hint1') + : $t('message.laborMange.hint2') + " + :visible.sync="exportDialog" + width="667px" + > +
+ + + + + + + +
@@ -444,12 +545,15 @@ import scroll from "vue-seamless-scroll"; import { getPageListData, - getSelectDateilApi,getAfreshMonthAttendanceStatisticsApi,attendFsdApi + getSelectDateilApi, + getAfreshMonthAttendanceStatisticsApi, + attendFsdApi, } from "@/assets/js/api/attendanceManage"; import { getDepartmentInfoList, getTeamInfoList, - getEnterpriseInfoList + getEnterpriseInfoList, + pullMemberDataApi } from "@/assets/js/api/laborPerson"; export default { name: "attendanceManage", @@ -458,33 +562,38 @@ export default { }, data() { return { - printPdf:"", - nucleicAcidResultsList:{ - 0:"未知", - 1:"阴性", - 2:"阳性" + tipShow: false, + timeRange: [], + printPdf: "", + nucleicAcidResultsList: { + 0: "未知", + 1: "阴性", + 2: "阳性", }, - healthCodelist:{ - 0:"无", - 1:"红码", - 2:"黄码", - 3:"绿码" + healthCodelist: { + 0: "无", + 1: "红码", + 2: "黄码", + 3: "绿码", }, - vaccinationFrequencyltsList:{ - 0:"未接种", - 1:"接种一针", - 2:"接种两针", - 3:"接种三针" + vaccinationFrequencyltsList: { + 0: "未接种", + 1: "接种一针", + 2: "接种两针", + 3: "接种三针", }, - exportDialog:false, - exportDateArr:[], - inserviceTypeOptions:[{ - name: this.$t('message.laborMange.onJob'), - id: 1 - },{ - name: this.$t('message.laborMange.dimission'), - id: 2 - }], + exportDialog: false, + exportDateArr: [], + inserviceTypeOptions: [ + { + name: this.$t("message.laborMange.onJob"), + id: 1, + }, + { + name: this.$t("message.laborMange.dimission"), + id: 2, + }, + ], fileUrl: "", page: 1, pageSize: 10, @@ -493,10 +602,10 @@ export default { workerName: "", personType: "", monthTime: "", - enterpriseId:"", - teamId:"", - departmentId:"", - inserviceType: 1 + enterpriseId: "", + teamId: "", + departmentId: "", + inserviceType: 1, }, projectSn: "", tableData: [], @@ -507,10 +616,11 @@ export default { dateilList: [], showTime: 31, bigImageDialog: false, - enterpriseListData:[], - teamListData:[], - departmentListData:[], - selectDateType:1,//1是选择导出时间段 2是选择重新计算考勤的时间段 + enterpriseListData: [], + teamListData: [], + departmentListData: [], + selectDateType: 1, //1是选择导出时间段 2是选择重新计算考勤的时间段 + imgImportDialog: false, }; }, created() { @@ -523,39 +633,71 @@ export default { this.projectSn = this.$store.state.projectSn; this.getListData(); this.fileUrl = this.$store.state.FILEURL; - this.getCompanyList() - this.getTeamList() + this.getCompanyList(); + this.getTeamList(); }, methods: { + // 确认拉取数据 + confirmPullData(){ + if(!this.timeRange || this.timeRange.length == 0){ + this.$message.error("请先选择时间段"); + return; + } + let reqeustData = { + projectSn: this.projectSn, + startTime: this.timeRange[0], + endTime: this.timeRange[1] + } + pullMemberDataApi(reqeustData).then((res) => { + if (res.code == 200) { + this.$message({ + message: res.message, + type: "success", + }); + this.imgImportDialog = false; + } + }); + }, + /// 打开拉取通行数据弹窗 + openPullDialog() { + this.timeRange = []; + this.imgImportDialog = true; + }, //考勤打印 - attendancePrint(){ - console.log('参数',this.formInline) - this.printPdf = this.$http.defaults.baseURL + 'xmgl/workerWagesPayment/attendancePdf?monthTime=' + - this.formInline.monthTime +'&personType=' + this.formInline.personType + '&projectSn=' + this.$store.state.projectSn - +'&enterpriseId='+this.formInline.enterpriseId - +'&teamId='+this.formInline.teamId + attendancePrint() { + console.log("参数", this.formInline); + this.printPdf = + this.$http.defaults.baseURL + + "xmgl/workerWagesPayment/attendancePdf?monthTime=" + + this.formInline.monthTime + + "&personType=" + + this.formInline.personType + + "&projectSn=" + + this.$store.state.projectSn + + "&enterpriseId=" + + this.formInline.enterpriseId + + "&teamId=" + + this.formInline.teamId; // console.log('路径', this.printPdf ) }, // 导入考勤数据 - importAttendanceData(){ - - }, + importAttendanceData() {}, //获取所属 企业下拉 getCompanyList() { let data = { projectSn: this.projectSn, - enterpriseName: '', - userEnterpriseId: this.$store.state.userInfo.userEnterpriseId + enterpriseName: "", + userEnterpriseId: this.$store.state.userInfo.userEnterpriseId, }; getEnterpriseInfoList(data).then((res) => { this.enterpriseListData = res.result; }); }, - //获取 部门 列表 + //获取 部门 列表 getDepartmentList() { let data = { - enterpriseId:this.formInline.enterpriseId, + enterpriseId: this.formInline.enterpriseId, projectSn: this.projectSn, }; getDepartmentInfoList(data).then((res) => { @@ -572,46 +714,82 @@ export default { this.teamListData = res.result.list; }); }, - changeCompany(){ - this.formInline.departmentId='' - this.formInline.teamId='' - this.getDepartmentList() - this.getTeamList() + changeCompany() { + this.formInline.departmentId = ""; + this.formInline.teamId = ""; + this.getDepartmentList(); + this.getTeamList(); }, //导出详细数据 - exportFn(){ - console.log(this.exportDateArr) - if(!this.exportDateArr||this.exportDateArr.length==0){ - this.$message.error(this.$t('message.laborMange.pleaseChoose')+this.$t('message.laborMange.timeFrame')) - return false + exportFn() { + console.log(this.exportDateArr); + if (!this.exportDateArr || this.exportDateArr.length == 0) { + this.$message.error( + this.$t("message.laborMange.pleaseChoose") + + this.$t("message.laborMange.timeFrame") + ); + return false; } - if(this.selectDateType==1){ - window.location.href = this.$http.defaults.baseURL + 'xmgl/download/exportExcelWorkerAttendance?projectSn=' + this.projectSn + - '&endTime=' + this.exportDateArr[1] + '&startTime=' + this.exportDateArr[0] + '&personType=' + this.formInline.personType + '&workerName=' + this.formInline.workerName+'&userEnterpriseId='+this.$store.state.userInfo.userEnterpriseId+ - '&enterpriseId='+this.formInline.enterpriseId+'&teamId='+this.formInline.teamId+'&departmentId='+this.formInline.departmentId+'&inserviceType='+this.formInline.inserviceType - - }else{ + if (this.selectDateType == 1) { + window.location.href = + this.$http.defaults.baseURL + + "xmgl/download/exportExcelWorkerAttendance?projectSn=" + + this.projectSn + + "&endTime=" + + this.exportDateArr[1] + + "&startTime=" + + this.exportDateArr[0] + + "&personType=" + + this.formInline.personType + + "&workerName=" + + this.formInline.workerName + + "&userEnterpriseId=" + + this.$store.state.userInfo.userEnterpriseId + + "&enterpriseId=" + + this.formInline.enterpriseId + + "&teamId=" + + this.formInline.teamId + + "&departmentId=" + + this.formInline.departmentId + + "&inserviceType=" + + this.formInline.inserviceType; + } else { let data = { userId: this.$store.state.userInfo.userId, projectSn: this.projectSn, - startTime:this.exportDateArr[0], - endTime:this.exportDateArr[1] + startTime: this.exportDateArr[0], + endTime: this.exportDateArr[1], }; getAfreshMonthAttendanceStatisticsApi(data).then((res) => { - this.$message.success(this.$t('message.laborMange.hint3')) + this.$message.success(this.$t("message.laborMange.hint3")); }); } - this.exportDialog=false - + this.exportDialog = false; }, //导出月份数据 - exportMonthlyData(){ - window.location.href = this.$http.defaults.baseURL + 'xmgl/download/exportExcelMonthWorkerAttendanceStatistics?projectSn=' + this.projectSn + - '&monthTime='+ this.formInline.monthTime + '&personType=' + this.formInline.personType + '&workerName=' + this.formInline.workerName+'&userEnterpriseId='+this.$store.state.userInfo.userEnterpriseId+ - '&enterpriseId='+this.formInline.enterpriseId+'&teamId='+this.formInline.teamId+'&departmentId='+this.formInline.departmentId+'&inserviceType='+this.formInline.inserviceType; + exportMonthlyData() { + window.location.href = + this.$http.defaults.baseURL + + "xmgl/download/exportExcelMonthWorkerAttendanceStatistics?projectSn=" + + this.projectSn + + "&monthTime=" + + this.formInline.monthTime + + "&personType=" + + this.formInline.personType + + "&workerName=" + + this.formInline.workerName + + "&userEnterpriseId=" + + this.$store.state.userInfo.userEnterpriseId + + "&enterpriseId=" + + this.formInline.enterpriseId + + "&teamId=" + + this.formInline.teamId + + "&departmentId=" + + this.formInline.departmentId + + "&inserviceType=" + + this.formInline.inserviceType; }, - //查询 列表信息 getListData() { let data = this.formInline; @@ -630,8 +808,8 @@ export default { } } this.showTime = date > 0 ? date : this.showTime; - this.number=0 - this.dateilList=[] + this.number = 0; + this.dateilList = []; } }); }, @@ -660,9 +838,9 @@ export default { refresh() { this.formInline.workerName = ""; this.formInline.personType = ""; - this.formInline.enterpriseId='' - this.formInline.teamId='' - this.formInline.departmentId='' + this.formInline.enterpriseId = ""; + this.formInline.teamId = ""; + this.formInline.departmentId = ""; let date = new Date(); let year = date.getFullYear(); let month = date.getMonth() + 1; @@ -687,7 +865,7 @@ export default { }; \ No newline at end of file +// 通行数据拉取弹窗样式 +.title-set { + display: flex; + align-items: center; + .line { + width: 0px; + height: 15px; + border-radius: 3px; + border: 2px solid #5c81ee; + margin-right: 10px; + } + >span{ + margin-right: 5px; + } + .question-icon{ + border: 1px solid #676C7C; + border-radius: 50%; + width: 10px; + height: 10px; + text-align: center; + line-height: 10px; + font-size: 12px; + } + .tip-text{ + font-size: 14px; + margin-left: 5px; + } +} + diff --git a/src/views/projectFront/laborManage/attendanceManage/attendanceRules.vue b/src/views/projectFront/laborManage/attendanceManage/attendanceRules.vue index a946d74b..f1fedfb6 100644 --- a/src/views/projectFront/laborManage/attendanceManage/attendanceRules.vue +++ b/src/views/projectFront/laborManage/attendanceManage/attendanceRules.vue @@ -2,8 +2,15 @@
@@ -29,7 +36,7 @@ width="15px" height="15px" /> - {{ $t('message.workType.edit') }} + {{ $t("message.workType.edit") }}
- {{ $t('message.workType.delete') }} + {{ $t("message.workType.delete") }}
@@ -154,14 +161,14 @@ @click="closeBtn" icon="el-icon-circle-close" size="medium" - >{{ $t('message.personnelPosition.cancel') }} + >{{ $t("message.personnelPosition.cancel") }} {{ $t('message.personnelPosition.determine') }} + >{{ $t("message.personnelPosition.determine") }} @@ -176,11 +183,12 @@ import { workerAttendanceRuleEdit, workerAttendanceRuleDelete, } from "@/assets/js/api/laborPerson"; - +import { getProjectDetail, editProjectInfo } from "@/assets/js/api/baseInfo"; export default { data() { return { - title: '', + radioVal: 0, + title: "", dialogVisible: false, workerList: [], workerInfo: { @@ -221,8 +229,32 @@ export default { }, mounted() { this.getWorker(); + this.getProjectDetailFn(); }, methods: { + // 切换清零配置 + changeSelect() { + let reqeustData = { + projectSn: this.$store.state.projectSn, + enableWorkerAttendanceZero: this.radioVal, + }; + editProjectInfo(reqeustData).then((res) => { + if (res.success) { + this.$message.success("操作成功"); + } + }); + }, + // 查询是否清零配置 + getProjectDetailFn() { + let reqeustData = { + projectSn: this.$store.state.projectSn, + }; + getProjectDetail(reqeustData).then((res) => { + if (res && res.result) { + this.radioVal = res.result.enableWorkerAttendanceZero; + } + }); + }, getWorker() { workerAttendanceRuleList({ projectSn: this.$store.state.projectSn }).then( (result) => { @@ -234,7 +266,7 @@ export default { ); }, addBefore() { - this.title = "新增考勤规则" + this.title = "新增考勤规则"; this.dialogVisible = true; (this.workerInfo = { ruleName: "", @@ -252,21 +284,21 @@ export default { }); }, editBefore(worker) { - this.title = "编辑考勤规则" + this.title = "编辑考勤规则"; this.dialogVisible = true; this.$nextTick(() => { this.$refs.form.clearValidate(); }); // console.log('编辑前的内容', worker) - this.workerInfo = JSON.parse(JSON.stringify(worker)) + this.workerInfo = JSON.parse(JSON.stringify(worker)); }, - deleteBefore(worker) { }, + deleteBefore(worker) {}, deleteWorker(worker) { this.$confirm( this.$t("message.personnelPosition.beaconManage.table.confirmText") + - "【" + - worker.ruleName + - "】?", + "【" + + worker.ruleName + + "】?", this.$t("message.personnelPosition.beaconManage.table.Tips"), { confirmButtonText: this.$t( @@ -289,7 +321,7 @@ export default { }); this.getWorker(); }) - .catch(() => { }); + .catch(() => {}); }, closeBtn() { this.dialogVisible = false; @@ -310,7 +342,7 @@ export default { workerAttendanceRuleEdit(this.workerInfo).then((result) => { if (result.success) { this.getWorker(); - this.workerInfo = {} + this.workerInfo = {}; this.dialogVisible = false; this.$message.success(result.message); } @@ -329,4 +361,19 @@ export default { ::v-deep .el-input__inner { line-height: 1px !important; } - \ No newline at end of file +.flex() { + display: flex; + align-items: center; +} +.search-box { + .flex(); + margin-left: 30px; + span { + margin-right: 8px; + font-size: 14px; + } + /deep/.el-radio-group { + margin-top: 2px; + } +} + diff --git a/src/views/projectFront/laborManage/personDetails.vue b/src/views/projectFront/laborManage/personDetails.vue index 4a0870f8..c99dd761 100644 --- a/src/views/projectFront/laborManage/personDetails.vue +++ b/src/views/projectFront/laborManage/personDetails.vue @@ -2050,23 +2050,53 @@ - + +
+ + + +
+ -
+ - + { + const isLt2M = data.size / 1024 < 500; + if (!isLt2M) { + this.$message.error(this.$t("message.laborMange.hint9")); + return; + } + var param = new FormData(); + param.append("files", data, "image.png"); + _this.$http + .post("/upload/image", param, { + headers: { + "Content-Type": "multipart/form-data", + }, + }) + .then((res) => { + console.log("aaaaa", res); + // if (res.data.status == "SUCCESS") { + // // this.checkFace(res.data.data[0].imageUrl) + // if (this.isSzProject == 1) { + // this.checkImgLibrary(res.data.data[0].imageUrl); + // } else { + // this.checkFace(res.data.data[0].imageUrl); + // } + // } + if (res.data.status == "SUCCESS") { + if(this.cropperEditTitle = "现场采集照裁剪"){ + this.workerInfo.fieldAcquisitionUrl = res.data.data[0].imageUrl; + } else if(this.cropperEditTitle = "身份证头像裁剪"){ + this.workerInfo.idCardBigPhotoUrl = res.data.data[0].imageUrl; + } + this.dialogVisible = false; + } + }); + }); + }, //保存截图 saveMapUrlFn() { this.$refs.cropper.startCrop(); @@ -2822,7 +2898,13 @@ export default { fileType == "webp" || fileType == "jpeg" ) { - this.dialogImageUrl = this.fileUrl + file.url; + // this.dialogImageUrl = this.fileUrl + file.url; + this.cropperEditOption.img = this.fileUrl + file.url; + if(type == 1){ + this.cropperEditTitle = "现场采集照裁剪" + } else if(type == 8){ + this.cropperEditTitle = "身份证头像裁剪" + } this.dialogVisible = true; } else if (name != {}) { let url = this.$http.defaults.baseURL + 'xmgl/upload/getRenameFile?fileUrl=' + this.fileUrl + itemUrl + '&fileName=' + itemName diff --git a/src/views/projectFront/laborManage/personModule/laborComponent.vue b/src/views/projectFront/laborManage/personModule/laborComponent.vue index 09898460..cb9181d5 100644 --- a/src/views/projectFront/laborManage/personModule/laborComponent.vue +++ b/src/views/projectFront/laborManage/personModule/laborComponent.vue @@ -7,8 +7,8 @@ {{ $t('message.laborMange.theNewEnterprise') }}{{ $t("message.laborMange.theNewEnterprise") }}
- {{ $t('message.laborMange.crewInfo') }} + {{ $t("message.laborMange.crewInfo") }}
- {{ $t('message.laborMange.team') }}: + {{ $t("message.laborMange.team") }}: {{ teamListData.totalTeamNum }} - {{ $t('message.laborMange.crew') }}: + {{ $t("message.laborMange.crew") }}: {{ teamListData.totalWorkerNum }}
@@ -100,7 +100,7 @@ class="team_addBtn" @click="addTeamBtn" v-if="enterpriseListData.length > 0" - >{{ $t('message.laborMange.theNewTeam') }}{{ $t("message.laborMange.theNewTeam") }}
-
{{ $t('message.laborMange.allTheTeam') }}
+
{{ $t("message.laborMange.allTheTeam") }}
({{ teamListData.totalWorkerNum }})
@@ -146,14 +146,14 @@ src="@/assets/images/icon-edit.png" style="margin-right: 5px" /> - {{ $t('message.laborMange.edit') }} + {{ $t("message.laborMange.edit") }}
- {{ $t('message.laborMange.delete') }} + {{ $t("message.laborMange.delete") }}
@@ -176,13 +176,13 @@ size="medium" @click="personnelEntry" :disabled="checkedTeamId === 0" - >{{ $t('message.laborMange.personnelEntry') }}{{ $t("message.laborMange.personnelEntry") }} {{ - $t('message.laborMange.export') + $t('message.laborMange.template') + $t("message.laborMange.export") + $t("message.laborMange.template") }} {{ - $t('message.laborMange.bulkImport') + $t("message.laborMange.bulkImport") }} + 下发通行设备
@@ -215,6 +222,7 @@ :model="tableParameter" size="medium" class="demo-form-inline" + style="margin-left: 5px;" > {{ - $t('message.laborMange.inquire') + $t("message.laborMange.inquire") }} {{ - $t('message.laborMange.refresh') + $t("message.laborMange.refresh") }} {{ - $t('message.laborMange.export') + $t("message.laborMange.export") }} {{ $t('message.laborMange.aKeyIssued') }}{{ $t("message.laborMange.aKeyIssued") }} @@ -356,12 +364,12 @@
{{ scope.row.sex == 1 - ? $t('message.laborMange.man') - : $t('message.laborMange.female') + ? $t("message.laborMange.man") + : $t("message.laborMange.female") }} {{ scope.row.age - }}{{ $t('message.laborMange.age') }} {{ scope.row.nation }}
@@ -372,11 +380,11 @@ @@ -384,15 +392,15 @@ @@ -407,7 +415,7 @@ class="operationText" @click="workerExitBtn(scope.row, 1)" v-if="scope.row.inserviceType == 1" - >{{ $t('message.laborMange.bowOutWith') }}{{ $t("message.laborMange.bowOutWith") }} {{ $t('message.laborMange.toPlayAgain') }}{{ $t("message.laborMange.toPlayAgain") }}
- {{ $t('message.laborMange.delete') }} + {{ $t("message.laborMange.delete") }}
{{ $t('message.laborMange.aKeyIssued') }}{{ $t("message.laborMange.aKeyIssued") }}
@@ -460,7 +468,7 @@ @change=" uploadToHouseFn(scope.row.isUploadHousing, scope.row.id) " - >{{ $t('message.laborDev.uploadToOuter') }}{{ $t("message.laborDev.uploadToOuter") }} @@ -480,13 +488,13 @@ class="table_wrap_btn" :disabled="checkedWorker.length <= 0" @click="batchMove" - >{{ $t('message.laborMange.batchMobile') }}{{ $t("message.laborMange.batchMobile") }} {{ $t('message.laborMange.batchBowOutWith') }}{{ $t("message.laborMange.batchBowOutWith") }}
@@ -506,7 +514,66 @@
- + + +
+
+ +
+ 向目标组织下批量导入人员正面免冠照,导入前建议使用人脸照片预处理工具进行质量清洗,并确认照片对应的人员信息是否存在。 +
+
+
+ 导入文件: +
+ + +
+ 将文件拖到此处,或点击上传 +
+
+
+
+
+ 支持导入200MB以内的ZIP文件,建议文件中包含照片的数量在1000张以内; + 照片命名规则为姓名_证件号码jpg,需露出眉毛和眼睛;单张照片文件大小10 + KB~200 KB。 +
+
+ 选择文件后将自动上传并进行数据校验 +
+ +
+
{{ - $t('message.laborMange.clickOnTheUpload') + $t("message.laborMange.clickOnTheUpload") }} @@ -790,7 +857,7 @@ :file-list="logoFileList" > {{ - $t('message.laborMange.clickOnTheUpload') + $t("message.laborMange.clickOnTheUpload") }} @@ -803,14 +870,14 @@ @click="addEnterpriseDialog = false" icon="el-icon-circle-close" size="medium" - >{{ $t('message.laborMange.cancel') }}{{ $t("message.laborMange.cancel") }} {{ $t('message.laborMange.confirm') }}{{ $t("message.laborMange.confirm") }} @@ -878,7 +945,7 @@ {{ - $t('message.laborMange.man') + $t("message.laborMange.man") }} {{ - $t('message.laborMange.female') + $t("message.laborMange.female") }} @@ -1099,7 +1166,7 @@ :disabled="titleType == 'detail'" @change="checkboxLongTerm" style="margin-left: 10px" - >{{ $t('message.laborMange.longTime') }}{{ $t("message.laborMange.longTime") }} @@ -1199,7 +1266,7 @@ style="width: 100%" v-if=" titleType != 'detail' || - (personForm.marry && titleType == 'detail') + (personForm.marry && titleType == 'detail') " :disabled="titleType == 'detail'" > @@ -1274,7 +1341,7 @@ :disabled="titleType == 'detail'" v-if=" titleType != 'detail' || - (personForm.educational && titleType == 'detail') + (personForm.educational && titleType == 'detail') " > @@ -1359,7 +1426,7 @@ style="width: 100%" v-if=" titleType != 'detail' || - (personForm.politicsStatus && titleType == 'detail') + (personForm.politicsStatus && titleType == 'detail') " :disabled="titleType == 'detail'" > @@ -1410,7 +1477,7 @@ style="width: 100%" v-if=" titleType != 'detail' || - (personForm.ruleId && titleType == 'detail') + (personForm.ruleId && titleType == 'detail') " @change="changRuleId" :disabled="titleType == 'detail'" @@ -1431,8 +1498,11 @@ - - + + @@ -1445,7 +1515,7 @@ :indeterminate="isIndeterminate2" v-model="checkAllFaceDev" @change="handleCheckAllChangeFace" - >{{ $t('message.laborMange.checkAll') }}{{ $t("message.laborMange.checkAll") }} {{ $t('message.laborMange.idCardInformation') }}{{ $t("message.laborMange.idCardInformation") }} {{ $t('message.laborMange.turnCamera') }}{{ $t("message.laborMange.turnCamera") }} {{ $t('message.laborMange.highBeatDownload') }}{{ $t("message.laborMange.highBeatDownload") }} @@ -1530,7 +1600,7 @@
- {{ $t('message.laborMange.IdCardHead') }} + {{ $t("message.laborMange.IdCardHead") }}
@@ -1565,7 +1635,7 @@ type="primary" v-if="titleType != 'detail'" >{{ - $t('message.laborMange.clickOnTheUpload') + $t("message.laborMange.clickOnTheUpload") }} @@ -1595,7 +1665,7 @@ * - {{ $t('message.laborMange.spotFaceCollection') }} + {{ $t("message.laborMange.spotFaceCollection") }} {{ - $t('message.laborMange.clickOnTheUpload') + $t("message.laborMange.clickOnTheUpload") }} @@ -1635,7 +1705,7 @@
{{ - $t('message.laborMange.imgHint') + $t("message.laborMange.imgHint") }} @@ -1646,7 +1716,7 @@ @click="addPersonDialog = false" icon="el-icon-circle-close" size="medium" - >{{ $t('message.laborMange.cancel') }}{{ $t("message.laborMange.cancel") }} {{ $t('message.laborMange.confirm') }}{{ $t("message.laborMange.confirm") }} @@ -1768,14 +1838,14 @@ @click="addTeamDialog = false" icon="el-icon-circle-close" size="medium" - >{{ $t('message.laborMange.cancel') }}{{ $t("message.laborMange.cancel") }} {{ $t('message.laborMange.confirm') }}{{ $t("message.laborMange.confirm") }} @@ -1854,14 +1924,14 @@ @click="batchMoveDialog = false" icon="el-icon-circle-close" size="medium" - >{{ $t('message.laborMange.cancel') }}{{ $t("message.laborMange.cancel") }} {{ $t('message.laborMange.confirm') }}{{ $t("message.laborMange.confirm") }} @@ -1898,15 +1968,15 @@
- + {{ $t('message.personnelPosition.cancel') }} + >{{ $t("message.personnelPosition.cancel") }} {{ $t('message.personnelPosition.determine') }} + >{{ $t("message.personnelPosition.determine") }} - + *{{ - $t('message.laborMange.pleaseChoose') + - $t('message.laborMange.picture') + $t("message.laborMange.pleaseChoose") + + $t("message.laborMange.picture") }}: @@ -1980,10 +2050,10 @@ icon="el-icon-circle-check" type="primary" @click="checkImg" - >{{ $t('message.laborMange.confirm') }}{{ $t("message.laborMange.confirm") }} {{ - $t('message.laborMange.cancel') + $t("message.laborMange.cancel") }} @@ -2020,100 +2090,100 @@ import { ufaceDevList, checkImgLibraryApi, updateByIdWorkerInfo, - sendBatchWokerApi -} from '@/assets/js/api/laborPerson' + sendBatchWokerApi, +} 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() { return { refreshPage: true, //静默刷新 - radio: '', + radio: "", key: false, //判断是否显示一件下发按钮 COMPANY: COMPANY, isCheckeedData: true, //判断一键下发是否有数据选中 ufaceDevAllList: [], //所有人脸设备 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"), 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, @@ -2121,57 +2191,58 @@ 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: [], - personSerial: '', - locationCardno:'',//人员定位标签号 + personSerial: "", + locationCardno: "", //人员定位标签号 }, //人员录入校验 - personFormRules: this.$t('message.laborMange.personFormRules2'), + personFormRules: this.$t("message.laborMange.personFormRules2"), //显示的文件列表 examinationFile: [], //体检报告 @@ -2188,8 +2259,8 @@ export default { batchMoveDialog: false, //批量移动弹窗 //批量移动表单 batchMoveForm: { - teamId: '', - enterpriseId: '' + teamId: "", + enterpriseId: "", }, moveTeamList: [], // 选择移动的班组的列表 showTeamList: false, //显示班组列表 @@ -2199,295 +2270,302 @@ 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, checkAllFaceDev: false, - fileTemp: '', + fileTemp: "", imgRadiolist: [], - isSzProject: '' - } + isSzProject: "", + }; }, 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')) + 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) => { if (item.actionList) { item.actionList.find((item2) => { - if (item2.actionCode == 'akey_issued') { - this.key = true + 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.getProjectConfig() + this.getProjectList(); + this.getAttendRuleList(); + this.getHierarchyEnterpriseList(); + this.getUfaceDevList(); + this.getProjectConfig(); }, mounted() { // this.webSocket = new WebSocket("ws://127.0.0.1:1818"); - this.getEnterpriseType() + this.getEnterpriseType(); }, computed: { headers() { return { - Authorization: this.$store.state.userInfo.token - } - } + Authorization: this.$store.state.userInfo.token, + }; + }, }, methods: { handleUpload(fileData, type) { - const file = fileData.file + const file = fileData.file; // 压缩图片 lrz(file, { quality: 1 }).then((result) => { - const formData = new FormData() - formData.append('files', result.file) + 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] + 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': // 现场采集人脸 - let imgStatus = result.file.size / 1024 < 500 - if (!imgStatus) { - this.cropperOption.img = - this.$store.state.FILEURL + imgInfo.imageUrl - this.cropperDialog = true - } else { - if (this.isSzProject == 1) { - this.checkImgLibrary(imgInfo.imageUrl) - } else { - this.checkFace(imgInfo.imageUrl) - } - } - break + { name: imgInfo.filename, url: imgInfo.imageUrl }, + ]; + break; + case "livesFace": // 现场采集人脸 + this.cropperOption.img = + this.$store.state.FILEURL + imgInfo.imageUrl; + this.cropperDialog = true; + // let imgStatus = result.file.size / 1024 < 500 + // if (!imgStatus) { + // this.cropperOption.img = + // this.$store.state.FILEURL + imgInfo.imageUrl + // this.cropperDialog = true + // } else { + // if (this.isSzProject == 1) { + // this.checkImgLibrary(imgInfo.imageUrl) + // } else { + // this.checkFace(imgInfo.imageUrl) + // } + // } + break; } } - }) - }) + }); + }); }, checkImg() { - console.log(this.radio) + 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否 - }) + this.isSzProject = res.result[0].isSzProject; //1是 0否 + }); }, exportM() { window.location.href = this.$http.defaults.baseURL + - 'xmgl/download/exporExcelWorkerTemplate?projectSn=' + - this.projectSn + "xmgl/download/exporExcelWorkerTemplate?projectSn=" + + this.projectSn; + }, + // 导入照片弹窗 + importImgOpen() { + this.imgImportDialog = true; }, // 下发通行设备 passEquipment() { sendBatchWokerApi({ projectSn: this.projectSn, - personType: '1', + personType: "1", userId: this.$store.state.userInfo.userId, - enterpriseId: this.checkedId + 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) + 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) + 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() + this.$message.error(this.$t("message.laborMange.hint7")); + this.refreshBtn(); }, handleUfaceDevChange(val) { - let checkedCount = val.length - let allCheckList = [] + 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; }, handleCheckAllChangeFace(val) { if (val) { - this.personForm.ufaceDevId = [] + this.personForm.ufaceDevId = []; this.ufaceDevAllList.forEach((item) => { - this.personForm.ufaceDevId.push(item.id) - }) + this.personForm.ufaceDevId.push(item.id); + }); } else { // this.ufaceDevAllList = [] - this.personForm.ufaceDevId = [] + this.personForm.ufaceDevId = []; } - this.isIndeterminate2 = false + this.isIndeterminate2 = false; }, // 获取所有人脸设备 getUfaceDevList() { ufaceDevList({ projectSn: this.projectSn }).then((res) => { - console.log(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 - }) + item.disabled = true; + }); selectUserDevAuthorityByUserIdApi({ userId: this.$store.state.userInfo.userId, - devType: '1' + 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() { batchSendWorkerInfoApi({ projectSn: this.$store.state.projectSn, - personType: 1 + personType: 1, }).then((res) => { - this.$message.success('已执行人员下发命令') - this.getTableData() - }) + this.$message.success("已执行人员下发命令"); + this.getTableData(); + }); }, //单个人员下发 issuePersonOneFn(workerId) { sendWorkerInfoByIdApi({ workerId: workerId }).then((res) => { - this.$message.success(this.$t('message.laborMange.hint4')) - }) + this.$message.success(this.$t("message.laborMange.hint4")); + }); }, changRuleId(val) { - console.log(val) + console.log(val); }, //获取考勤规则列表 getAttendRuleList() { workerAttendanceRuleList({ projectSn: this.$store.state.projectSn }).then( (result) => { - this.attendRulesList = result.result - console.log(result.result) + this.attendRulesList = result.result; + console.log(result.result); } - ) + ); }, 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() { getProjectUfaceConfigInfo({ - projectSn: this.$store.state.projectSn + 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) { @@ -2495,28 +2573,28 @@ export default { projectSn: this.projectSn, enterpriseName: this.enterpriseName, userEnterpriseId: this.$store.state.userInfo.userEnterpriseId, - enterpriseTypeId: this.enterpriseTypeId - } + enterpriseTypeId: this.enterpriseTypeId, + }; getEnterpriseInfoList(data).then((res) => { - console.log(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 - : '' + ? 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() { @@ -2524,104 +2602,104 @@ export default { projectSn: this.projectSn, enterpriseName: this.enterpriseName, userEnterpriseId: this.$store.state.userInfo.userEnterpriseId, - enterpriseTypeId: this.enterpriseTypeId - } + 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 = '' + 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() + 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', '点击', '新增企业', '添加企业信息']) + 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 = {} + let data = {}; getEnterpriseTypeList(data).then((res) => { if (res.code == 200) { - this.enterpriseTypeList = res.result + this.enterpriseTypeList = res.result; } - }) + }); }, //新增企业 保存 saveEnterpriseFn(formName) { @@ -2634,71 +2712,71 @@ 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) => { 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) => { 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) => { 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) { 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 - } + 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); }, /**--------------------------------------------右侧函数------------------------------------------------------------------ */ @@ -2706,68 +2784,68 @@ export default { getTeamList(type) { let data = { enterpriseId: this.checkedId, - projectSn: this.projectSn - } + 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') + 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() { let data = { - projectSn: this.projectSn - } + projectSn: this.projectSn, + }; getWorkerTypeList(data).then((res) => { if (res.code == 200) { - this.workerTypeList = res.result + this.workerTypeList = res.result; } - }) + }); }, //选择工种设置班组名称 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 + if (this.teamForm.teamName != "") { + let arr = this.teamForm.teamName.split("-"); + this.teamForm.teamName = arr[0] + "-" + value; } }, @@ -2775,222 +2853,224 @@ export default { 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) => { 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 + 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) => { 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) { 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() { 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 + 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 + 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) { 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 - } + 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 + 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 + 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: [], - 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 = []; // 身份证人像面 }, // 有效日期 长期 按钮 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) + this.personForm.isUploadHousing = this.personForm.isUploadHousing ? 1 : 0; + console.log("进场确定参数", this.personForm); // 身份证校验 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)) { @@ -3036,1078 +3116,1088 @@ 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.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.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.ufaceDevId = this.personForm.ufaceDevId.join(',') + data.ufaceDevId = this.personForm.ufaceDevId.join(","); } else { - data.ufaceDevId = '' + data.ufaceDevId = ""; } 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 = [] //现场采集人脸 + 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 + let data = this.personForm; + data.longTerm = this.personForm.longTerm ? 1 : 0; + data.registerType = 1; // 跟杨珊对接需要再再次进场时多传入一个新的字段 - data.reEntry = 1 - data.userId = this.$store.state.userInfo.userId + data.reEntry = 1; + data.userId = this.$store.state.userInfo.userId; if (this.personForm.ufaceDevId.length > 0) { console.log( - 'this.personForm.ufaceDevId', + "this.personForm.ufaceDevId", this.personForm.ufaceDevId - ) - data.ufaceDevId = this.personForm.ufaceDevId.join(',') + ); + data.ufaceDevId = this.personForm.ufaceDevId.join(","); } else { - data.ufaceDevId = '' + data.ufaceDevId = ""; } if (this.$store.state.userInfo.accountType == 6) { - data.accountType = 2 + data.accountType = 2; } else { - data.accountType = 1 + data.accountType = 1; } - delete data.addTime + 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 = [] //现场采集人脸 + 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) + 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) + 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: [], - 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 (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 - } - ] - : [] //现场采集人脸 + { + name: 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) { 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 - } + 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) { 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) { // 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) => { 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() + this.pageSize = val; + this.getTableData(); }, //换页 handleCurrentChange(val) { - this.page = val - sessionStorage.setItem('personPage', val) - this.getTableData() - this.$refs.multipleTable.bodyWrapper.scrollTop = 0 + this.page = val; + sessionStorage.setItem("personPage", val); + this.getTableData(); + this.$refs.multipleTable.bodyWrapper.scrollTop = 0; }, //功能开发中 inDevelopment() { - this.$message.warning(this.$t('message.laborMange.functionalDevelopment')) + this.$message.warning( + this.$t("message.laborMange.functionalDevelopment") + ); }, //查询按钮 inquireBtn() { - window._paq.push(['trackEvent', '点击', '查询', '查询人员信息']) - this.page = 1 - this.getTableData() + 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() + 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() + this.aptitudeFileList = []; + this.logoFileList = []; + this.$refs[formName].resetFields(); }, // 文件上传 之前 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) { 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') { + 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) + 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) + console.log(url); checkImgLibraryApi({ fileUrl: url, projectSn: this.projectSn }).then( (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) => { 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.startCrop(); + var _this = this; this.$refs.cropper.getCropBlob((data) => { - const isLt2M = data.size / 1024 < 500 + 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') { + 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) { this.$message.error( - this.$t('message.laborMange.uploadLimitHasBeenReached') - ) + this.$t("message.laborMange.uploadLimitHasBeenReached") + ); }, //查看图片 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')) + this.$message.error(this.$t("message.laborMange.pleaseReupload")); }, //点击全选时 handleCheckAllChange(val) { - let checkedLst = val ? this.tableListData : [] - this.isIndeterminate = false + 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) { 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) { if (row.inserviceType == 1) { - return true + return true; } else { - return false + return false; } }, //批量移动按钮 batchMove() { - this.batchMoveDialog = true + 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 = '' + this.batchMoveForm.teamId = ""; let data = { enterpriseId: value, - projectSn: this.projectSn - } + 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) => { 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(',') + 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) { 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 != '') { + 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 = '' + 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') + 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 + var ws = new WebSocket("ws://127.0.0.1:1818"); + this.webSocket = ws; ws.onopen = (event) => { - this.onopen(event, type) - } + this.onopen(event, type); + }; ws.onmessage = (event) => { - this.onmessage(event, type) - } + this.onmessage(event, type); + }; - ws.onerror = this.onerror + ws.onerror = this.onerror; }, //发送链接设备请求 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) { //结束通讯 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')) + this.$message.error(this.$t("message.laborMange.failedToConnectDevice")); }, //保存 并 关闭 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对象 + 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' - } + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", + }, }).then((res) => { - if ((res.status = 'SUCCESS')) { + 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) { let data = { imageUrl: this.fileUrl + url, - side: type - } + side: type, + }; getIdCardInfoApi(data).then((res) => { - console.log('返回值', 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")); } - }) - } - } -} + }); + }, + }, +};