From 05873b87c0f58bcaf9d9073c0a8cd1955b3a4336 Mon Sep 17 00:00:00 2001 From: Jack <1638169491@qq.com> Date: Wed, 27 Jul 2022 16:16:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../personModule/laborComponent.vue | 2217 +++++++++-------- 1 file changed, 1117 insertions(+), 1100 deletions(-) diff --git a/src/views/projectFront/laborManage/personModule/laborComponent.vue b/src/views/projectFront/laborManage/personModule/laborComponent.vue index 7199a76c..9c7e2842 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 }}
@@ -138,7 +138,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 }})
@@ -184,14 +184,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') }}
@@ -214,10 +214,10 @@ 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') }} - 下发通行设备 -
+ 下发通行设备 +
{{ - $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') }} @@ -384,12 +390,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 }}
@@ -400,11 +406,11 @@ @@ -412,15 +418,15 @@ @@ -435,7 +441,7 @@ class="operationText" @click="workerExitBtn(scope.row, 1)" v-if="scope.row.inserviceType == 1" - >{{ $t("message.laborMange.bowOutWith") }}{{ $t('message.laborMange.bowOutWith') }} @@ -497,17 +503,14 @@ >{{ $t("message.laborDev.uploadToOuter") }}
--> -
+
{{ $t("message.laborDev.uploadToOuter") }}{{ $t('message.laborDev.uploadToOuter') }}
@@ -527,13 +530,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') }}
@@ -816,7 +819,7 @@ :file-list="aptitudeFileList" > {{ - $t("message.laborMange.clickOnTheUpload") + $t('message.laborMange.clickOnTheUpload') }} @@ -835,7 +838,7 @@ :file-list="logoFileList" > {{ - $t("message.laborMange.clickOnTheUpload") + $t('message.laborMange.clickOnTheUpload') }} @@ -848,14 +851,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') }}
@@ -1021,10 +1024,10 @@ :disabled="titleType == 'detail'" > {{ - $t("message.laborMange.man") + $t('message.laborMange.man') }} {{ - $t("message.laborMange.female") + $t('message.laborMange.female') }} @@ -1144,7 +1147,7 @@ :disabled="titleType == 'detail'" @change="checkboxLongTerm" style="margin-left: 10px" - >{{ $t("message.laborMange.longTime") }}{{ $t('message.laborMange.longTime') }} @@ -1432,7 +1435,10 @@ - + - + --> - + {{$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') }} @@ -1788,7 +1800,7 @@
* - {{ $t("message.laborMange.IdCardHead") }} + {{ $t('message.laborMange.IdCardHead') }}
{{ - $t("message.laborMange.clickOnTheUpload") + $t('message.laborMange.clickOnTheUpload') }} @@ -1850,7 +1862,7 @@
* - {{ $t("message.laborMange.spotFaceCollection") }} + {{ $t('message.laborMange.spotFaceCollection') }}
{{ - $t("message.laborMange.clickOnTheUpload") + $t('message.laborMange.clickOnTheUpload') }} @@ -1881,7 +1893,7 @@
{{ - $t("message.laborMange.imgHint") + $t('message.laborMange.imgHint') }} @@ -1892,7 +1904,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') }} @@ -2013,14 +2025,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') }} @@ -2049,8 +2061,8 @@ { required: true, message: $t('message.laborMange.pleaseSelectMoveTo'), - trigger: 'change', - }, + trigger: 'change' + } ]" > {{ $t("message.laborMange.cancel") }}{{ $t('message.laborMange.cancel') }} {{ $t("message.laborMange.confirm") }}{{ $t('message.laborMange.confirm') }} @@ -2143,10 +2155,10 @@ @@ -2179,25 +2191,31 @@ @click="cropperDialog = false" icon="el-icon-circle-close" size="medium" - >{{ $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') + }}: +
{{$t("message.laborMange.confirm")}} - {{$t("message.laborMange.cancel")}}{{ $t('message.laborMange.confirm') }} + {{ + $t('message.laborMange.cancel') + }}
@@ -2262,96 +2280,96 @@ import { checkImgLibraryApi, updateByIdWorkerInfo, sendBatchWokerApi -} from "@/assets/js/api/laborPerson"; +} from '@/assets/js/api/laborPerson' import axios from 'axios' 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' export default { components: { - VueCropper, + VueCropper }, data() { return { - radio: "", - key:false,//判断是否显示一件下发按钮 + 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, @@ -2359,56 +2377,56 @@ 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', 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: "", + personSerial: '' }, //人员录入校验 - personFormRules: this.$t("message.laborMange.personFormRules2"), + personFormRules: this.$t('message.laborMange.personFormRules2'), //显示的文件列表 examinationFile: [], //体检报告 @@ -2425,8 +2443,8 @@ export default { batchMoveDialog: false, //批量移动弹窗 //批量移动表单 batchMoveForm: { - teamId: "", - enterpriseId: "", + teamId: '', + enterpriseId: '' }, moveTeamList: [], // 选择移动的班组的列表 showTeamList: false, //显示班组列表 @@ -2436,247 +2454,254 @@ 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.forEach((item2)=>{ - if(item2.actionCode == 'akey_issued'){ - this.key = true + data.menuList.forEach((item) => { + if (item.actionList) { + item.actionList.forEach((item2) => { + if (item2.actionCode == 'akey_issued') { + this.key = true } else { this.key = false } - console.log('this.key',this.key) + 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: { 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 = 1 - this.isSzProject = res.result[0].isSzProject; //1是 0否 + this.isSzProject = res.result[0].isSzProject //1是 0否 // console.log(res.result[0].isSzProject) - }); + }) }, exportM() { window.location.href = this.$http.defaults.baseURL + - "xmgl/download/exporExcelWorkerTemplate?projectSn=" + - this.projectSn; + 'xmgl/download/exporExcelWorkerTemplate?projectSn=' + + this.projectSn }, // 下发通行设备 - passEquipment(){ - sendBatchWokerApi({projectSn: this.projectSn,personType:'1',userId: this.$store.state.userInfo.userId,enterpriseId: this.checkedId}).then((res)=>{ + passEquipment() { + sendBatchWokerApi({ + projectSn: this.projectSn, + personType: '1', + userId: this.$store.state.userInfo.userId, + enterpriseId: this.checkedId + }).then((res) => { // console.log('下发通行设备',res) - if(res.code == 200 ){ + if (res.code == 200) { this.$message({ - message: '操作成功,已在后台下发,请稍后查看!', - type: 'success' - }); + message: '操作成功,已在后台下发,请稍后查看!', + type: 'success' + }) } }) }, handleChangeE(file, fileList) { // console.log(file) - this.fileTemp = file.raw; - console.log(file); + this.fileTemp = file.raw + console.log(file) if (this.fileTemp) { // console.log(this.fileTemp.type) 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() { - this.$message.success(this.$t("message.laborMange.hint6")); //登录成功! - this.refreshBtn(); + this.$message.success(this.$t('message.laborMange.hint6')) //登录成功! + this.refreshBtn() }, 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) { // console.log('全选',val); if (val) { debugger - 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.ufaceDevAllList = res.result 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}).then(res=>{ - this.$message.success('已执行人员下发命令'); - this.getTableData(); + issuePersonFn() { + batchSendWorkerInfoApi({ + projectSn: this.$store.state.projectSn, + personType: 1 + }).then((res) => { + 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=" + - this.tableParameter.codeState; + '&codeState=' + + this.tableParameter.codeState }, 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) { @@ -2684,28 +2709,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 - : ""; + : '' 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() { @@ -2713,104 +2738,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]) 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) { @@ -2823,76 +2848,76 @@ 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(() => { // this.$message({ // type: "info", // message: "已取消删除", // }); - }); + }) }, /**--------------------------------------------右侧函数------------------------------------------------------------------ */ @@ -2900,68 +2925,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.checkedTeamId = type !== 1 ? 0 : this.checkedTeamId // console.log(this.checkedTeamId); - this.teamListData = res.result; - this.tableParameter.projectSn = this.projectSn; - this.getTableData(); + this.teamListData = 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 } }, @@ -2969,357 +2994,356 @@ 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(() => { // this.$message({ // type: "info", // message: "已取消删除", // }); - }); + }) }, //获取 班组的表格数据 -- 班组详情 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: "", - }; - if (this.attendRulesList.length > 0) { - this.personForm.ruleId = this.attendRulesList[0].id; - } else { - this.personForm.ruleId = ""; + personSerial: '' } - this.getUfaceDevList(); + if (this.attendRulesList.length > 0) { + this.personForm.ruleId = this.attendRulesList[0].id + } else { + this.personForm.ruleId = '' + } + 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); + 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)) { this.$message.error( - this.$t("message.laborMange.correctCellPhoneNumber") - ); - return; + this.$t('message.laborMange.correctCellPhoneNumber') + ) + return } if (!checkPhone(this.personForm.emergentPhone)) { this.$message.error( this.$t( - "message.laborMange.pleaseEnterTheCorrectEmergencyContactNumber" + 'message.laborMange.pleaseEnterTheCorrectEmergencyContactNumber' ) - ); - return; + ) + return } - if (this.personForm.idCardUpPhotoUrl == "") { + if (this.personForm.idCardUpPhotoUrl == '') { this.$message.error( - this.$t("message.laborMange.pleaseUploadTheNationalEmblemOfIdCard") - ); - return; + this.$t('message.laborMange.pleaseUploadTheNationalEmblemOfIdCard') + ) + return } - if (this.personForm.idCardDownPhotoUrl == "") { + if (this.personForm.idCardDownPhotoUrl == '') { this.$message.error( - this.$t("message.laborMange.pleaseUploadYourIDCardPortrait") - ); - return; + this.$t('message.laborMange.pleaseUploadYourIDCardPortrait') + ) + return } this.$refs[formName].validate((valid) => { if (valid) { - if (this.personForm.idCardBigPhotoUrl == "") { + if (this.personForm.idCardBigPhotoUrl == '') { this.$message.error( - this.$t("message.laborMange.pleaseUploadYourIDPhoto") - ); - return; - } else if (this.personForm.fieldAcquisitionUrl == "") { + this.$t('message.laborMange.pleaseUploadYourIDPhoto') + ) + return + } else 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.userId = this.$store.state.userInfo.userId if (this.personForm.ufaceDevId.length > 0) { - console.log('this.personForm.ufaceDevId',this.personForm.ufaceDevId) - data.ufaceDevId = this.personForm.ufaceDevId.join(","); + console.log( + 'this.personForm.ufaceDevId', + this.personForm.ufaceDevId + ) + 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) + id: id + } + console.log('isUploadHousing', json) updateByIdWorkerInfo(json).then((res) => { // if (res.code == 200) { // this.$message.success(this.$t("message.laborMange.modifySuccess")); @@ -3332,185 +3356,185 @@ export default { // this.idCardUpPhotoFile = []; //身份证头像 // this.fieldAcquisitionFile = []; //现场采集人脸 // } - }); + }) }, //编辑 人员信息 按钮 editWorkerInfo(value, type) { - console.log('当前行',value) - if(value.isUploadHousing){ + console.log('当前行', value) + if (value.isUploadHousing) { this.personForm.isUploadHousing = 1 - }else{ - this.personForm.isUploadHousing = 0 + } else { + 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(); - setTimeout(() => { - 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 = ""; + personSerial: '' } - this.personForm.sex = Number(value.sex); - this.personForm.inserviceType = type == 2 ? 1 : value.inserviceType; - this.personForm.longTerm = value.longTerm == 1 ? true : false; + this.getUfaceDevList() + setTimeout(() => { + 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.sex = Number(value.sex) + this.personForm.inserviceType = type == 2 ? 1 : value.inserviceType + this.personForm.longTerm = value.longTerm == 1 ? true : false //体检报告 let arr1 = - value.examinationImage != "" && value.examinationImage.split(","); - let newArr1 = []; + value.examinationImage != '' && value.examinationImage.split(',') + let newArr1 = [] if (arr1.length > 1) { for (let i in arr1) { - let a = arr1[i].split("*"); - newArr1.push({ name: a[0], url: a[1] }); + let a = arr1[i].split('*') + newArr1.push({ name: a[0], url: a[1] }) } } else { - if (value.examinationImage != "") { - let a = arr1[0].split("*"); - newArr1.push({ name: a[0], url: a[1] }); + if (value.examinationImage != '') { + let a = arr1[0].split('*') + newArr1.push({ name: a[0], url: a[1] }) } } - this.examinationFile = value.examinationImage != "" ? newArr1 : []; //体检报告 + this.examinationFile = value.examinationImage != '' ? newArr1 : [] //体检报告 //合同附件 - let arr2 = value.contractImage != "" && value.contractImage.split(","); - let newArr2 = []; + let arr2 = value.contractImage != '' && value.contractImage.split(',') + let newArr2 = [] if (arr2.length > 1) { for (let i in arr2) { - let a = arr2[i].split("*"); - newArr2.push({ name: a[0], url: a[1] }); + let a = arr2[i].split('*') + newArr2.push({ name: a[0], url: a[1] }) } } else { - if (value.contractImage != "") { - let a = arr2[0].split("*"); - newArr2.push({ name: a[0], url: a[1] }); + if (value.contractImage != '') { + let a = arr2[0].split('*') + newArr2.push({ name: a[0], url: a[1] }) } } - this.contractFile = value.contractImage != "" ? newArr2 : []; //合同附件 + this.contractFile = value.contractImage != '' ? newArr2 : [] //合同附件 //从业资格证书 - let arr3 = value.employmentCard != "" && value.employmentCard.split(","); - let newArr3 = []; + let arr3 = value.employmentCard != '' && value.employmentCard.split(',') + let newArr3 = [] if (arr3.length > 1) { for (let i in arr3) { - let a = arr3[i].split("*"); - newArr3.push({ name: a[0], url: a[1] }); + let a = arr3[i].split('*') + newArr3.push({ name: a[0], url: a[1] }) } } else { - if (value.employmentCard != "") { - let a = arr3[0].split("*"); - newArr3.push({ name: a[0], url: a[1] }); + if (value.employmentCard != '') { + let a = arr3[0].split('*') + newArr3.push({ name: a[0], url: a[1] }) } } - this.employmentFile = value.employmentCard != "" ? newArr3 : []; //从业资格证书 + this.employmentFile = value.employmentCard != '' ? newArr3 : [] //从业资格证书 //身份证头像 this.idCardUpPhotoFile = - value.idCardBigPhotoUrl != "" + value.idCardBigPhotoUrl != '' ? [{ name: value.idCardBigPhotoUrl, url: value.idCardBigPhotoUrl }] - : []; //身份证头像 + : [] //身份证头像 //现场采集人脸 this.fieldAcquisitionFile = - value.fieldAcquisitionUrl != "" + value.fieldAcquisitionUrl != '' ? [ { name: value.fieldAcquisitionUrl, - url: value.fieldAcquisitionUrl, - }, + url: value.fieldAcquisitionUrl + } ] - : []; //现场采集人脸 + : [] //现场采集人脸 this.idCardUpPhotoUrlFile = - value.idCardUpPhotoUrl != "" + value.idCardUpPhotoUrl != '' ? [{ name: value.idCardUpPhotoUrl, url: value.idCardUpPhotoUrl }] - : []; //身份证国徽 + : [] //身份证国徽 this.idCardDownPhotoUrlFile = - value.idCardDownPhotoUrl != "" + value.idCardDownPhotoUrl != '' ? [{ name: value.idCardDownPhotoUrl, url: value.idCardDownPhotoUrl }] - : []; //身份证人像 + : [] //身份证人像 }, // 删除 人员信息 removeWorkerInfo(value) { 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(() => { // this.$message({ // type: "info", // message: "已取消删除", // }); - }); + }) }, //查看 人员信息 详情 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) // this.personDialogTitle = this.$t("message.laborMange.crewInfoDetail"); // this.titleType = "detail"; // this.personForm = { @@ -3631,100 +3655,98 @@ export default { //列表数据 退场按钮 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.companyDiagram.hint8")); - return false; + this.$message.error(this.$t('message.companyDiagram.hint8')) + return false } } else { // if(type==7){ @@ -3736,733 +3758,728 @@ export default { // }else{ // return true; // } - 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 == 6) { - this.personForm.idCardBigPhotoUrl = obj.url; - this.idCardUpPhotoFile = [obj]; + this.personForm.idCardBigPhotoUrl = obj.url + this.idCardUpPhotoFile = [obj] } else if (type == 7) { // console.log(file, file2) - let imgStatus = file2.size / 1024 < 500; + let imgStatus = file2.size / 1024 < 500 if (!imgStatus) { - this.cropperOption.img = this.$store.state.FILEURL + obj.url; - this.cropperDialog = true; + this.cropperOption.img = this.$store.state.FILEURL + obj.url + this.cropperDialog = true } else { if (this.isSzProject == 1) { - this.checkImgLibrary(file.data[0].imageUrl); + this.checkImgLibrary(file.data[0].imageUrl) } else { - this.checkFace(file.data[0].imageUrl); + this.checkFace(file.data[0].imageUrl) } } // console.log(file.data[0].imageUrl) // this.cropperOption.img = this.$store.state.FILEURL + obj.url; // this.cropperDialog = true; } 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 // this.$message.error('未匹配到照片!') } - 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) => { if (res.code == 200) { - let val = res.result; + 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; + 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 } 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')) } - }); - }, - }, -}; + }) + } + } +}