This commit is contained in:
parent
4d894bb3cf
commit
fc3e8a9bfa
|
|
@ -30,7 +30,16 @@ export const getLotLotProjectListAPI = (data) => {
|
||||||
// 标段工程完工操作
|
// 标段工程完工操作
|
||||||
export const completeLotLotProjectAPI = (data) => {
|
export const completeLotLotProjectAPI = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/project/***',
|
url: '/bmw/pmProject/getPeoNum',
|
||||||
|
method: 'POST',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取标段工程人员数量
|
||||||
|
export const getLotLotProjectPeoNumAPI = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/bmw/pmProject/getPeoNum',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,8 @@ import { formLabel, columnsList, dialogConfig } from './config'
|
||||||
import {
|
import {
|
||||||
deleteLotLotProjectAPI,
|
deleteLotLotProjectAPI,
|
||||||
getLotLotProjectListAPI,
|
getLotLotProjectListAPI,
|
||||||
completeLotLotProjectAPI,
|
getLotLotProjectPeoNumAPI,
|
||||||
|
addAndEditLotLotProjectAPI,
|
||||||
} from '@/api/basic-manage/project-manage/lot-project'
|
} from '@/api/basic-manage/project-manage/lot-project'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
@ -189,6 +190,18 @@ export default {
|
||||||
|
|
||||||
// 完工
|
// 完工
|
||||||
onHandleCompleteAllProject(data) {
|
onHandleCompleteAllProject(data) {
|
||||||
|
getLotLotProjectPeoNumAPI({
|
||||||
|
proId: data.id,
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res, 'res数量')
|
||||||
|
const { perNum } = res.data
|
||||||
|
|
||||||
|
if (perNum > 0) {
|
||||||
|
this.$modal.msgError(
|
||||||
|
`该标段工程下还有 ${perNum} 人未出场,请先将人员全部出场后,再操作此项。`,
|
||||||
|
)
|
||||||
|
return
|
||||||
|
} else {
|
||||||
const h = this.$createElement
|
const h = this.$createElement
|
||||||
this.$msgbox({
|
this.$msgbox({
|
||||||
title: '完工确认',
|
title: '完工确认',
|
||||||
|
|
@ -219,16 +232,20 @@ export default {
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
const res = await completeLotLotProjectAPI(data.id)
|
const res = await addAndEditLotLotProjectAPI({
|
||||||
|
id: data.id,
|
||||||
|
proStatus: '4',
|
||||||
|
})
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.$msgSuccess('完工成功')
|
this.$msgSuccess('完工成功')
|
||||||
this.$refs.allProjectTableRef.getTableList() // 更新列表
|
this.$refs.lotProjectTableRef.getTableList() // 更新列表
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
// console.log('取消')
|
// console.log('取消')
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 初始化工程类型
|
// 初始化工程类型
|
||||||
|
|
|
||||||
|
|
@ -596,6 +596,9 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const validateContractStartDate = (rule, value, callback) => {
|
const validateContractStartDate = (rule, value, callback) => {
|
||||||
|
if (!value) {
|
||||||
|
return callback()
|
||||||
|
}
|
||||||
if (value >= this.contractInfoForm.contractStopDate) {
|
if (value >= this.contractInfoForm.contractStopDate) {
|
||||||
callback(new Error('合同签订日期不能大于合同终止日期'))
|
callback(new Error('合同签订日期不能大于合同终止日期'))
|
||||||
}
|
}
|
||||||
|
|
@ -603,11 +606,28 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
const validateContractStopDate = (rule, value, callback) => {
|
const validateContractStopDate = (rule, value, callback) => {
|
||||||
|
if (!value) {
|
||||||
|
return callback()
|
||||||
|
}
|
||||||
if (value <= this.contractInfoForm.contractStartDate) {
|
if (value <= this.contractInfoForm.contractStartDate) {
|
||||||
callback(new Error('合同终止日期不能小于合同签订日期'))
|
callback(new Error('合同终止日期不能小于合同签订日期'))
|
||||||
}
|
}
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const validateStartTime = (rule, value, callback) => {
|
||||||
|
if (value >= this.idCardInfoForm.endTime) {
|
||||||
|
callback(new Error('生效日期不能大于失效日期'))
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
|
||||||
|
const validateEndTime = (rule, value, callback) => {
|
||||||
|
if (value <= this.idCardInfoForm.startTime) {
|
||||||
|
callback(new Error('失效日期不能小于生效日期'))
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
// 身份证读卡器表单
|
// 身份证读卡器表单
|
||||||
idCardReaderForm: {
|
idCardReaderForm: {
|
||||||
|
|
@ -645,8 +665,8 @@ export default {
|
||||||
contractInfoForm: {
|
contractInfoForm: {
|
||||||
contractCode: '', // 合同编号
|
contractCode: '', // 合同编号
|
||||||
contractTermType: '以完成一定工作为期限的合同', // 合同期限类型
|
contractTermType: '以完成一定工作为期限的合同', // 合同期限类型
|
||||||
contractStartDate: '', // 合同签订日期
|
contractStartDate: null, // 合同签订日期
|
||||||
contractStopDate: '', // 合同终止日期
|
contractStopDate: null, // 合同终止日期
|
||||||
wageApprovedWay: '天', // 工资核定方式
|
wageApprovedWay: '天', // 工资核定方式
|
||||||
wageCriterion: '', // 工资核定标准
|
wageCriterion: '', // 工资核定标准
|
||||||
},
|
},
|
||||||
|
|
@ -802,6 +822,10 @@ export default {
|
||||||
trigger: 'change',
|
trigger: 'change',
|
||||||
message: '请选择生效日期',
|
message: '请选择生效日期',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
validator: validateStartTime,
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
endTime: [
|
endTime: [
|
||||||
{
|
{
|
||||||
|
|
@ -809,6 +833,10 @@ export default {
|
||||||
trigger: 'change',
|
trigger: 'change',
|
||||||
message: '请选择失效日期',
|
message: '请选择失效日期',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
validator: validateEndTime,
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
address: [
|
address: [
|
||||||
{
|
{
|
||||||
|
|
@ -873,12 +901,18 @@ export default {
|
||||||
// 合同信息表单校验
|
// 合同信息表单校验
|
||||||
contractInfoFormRules: {
|
contractInfoFormRules: {
|
||||||
contractStartDate: [
|
contractStartDate: [
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
validator: validateContractStartDate,
|
validator: validateContractStartDate,
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
contractStopDate: [
|
contractStopDate: [
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
validator: validateContractStopDate,
|
validator: validateContractStopDate,
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
|
|
@ -972,6 +1006,9 @@ export default {
|
||||||
// 2. 身份证表单验证通过后,验证关键信息表单
|
// 2. 身份证表单验证通过后,验证关键信息表单
|
||||||
this.$refs.keyInfoFormRef.validate(async (valid2) => {
|
this.$refs.keyInfoFormRef.validate(async (valid2) => {
|
||||||
if (valid2) {
|
if (valid2) {
|
||||||
|
this.$refs.contractInfoFormRef.validate(
|
||||||
|
async (valid3) => {
|
||||||
|
if (valid3) {
|
||||||
const fieldsToCheck_1 = [
|
const fieldsToCheck_1 = [
|
||||||
'contractCode', // 合同编号
|
'contractCode', // 合同编号
|
||||||
'wageCriterion', // 工资核定标准
|
'wageCriterion', // 工资核定标准
|
||||||
|
|
@ -1015,7 +1052,10 @@ export default {
|
||||||
// 人脸图片
|
// 人脸图片
|
||||||
faceImg.forEach((item) => {
|
faceImg.forEach((item) => {
|
||||||
if (!item.id) {
|
if (!item.id) {
|
||||||
formData.append('files', item.raw)
|
formData.append(
|
||||||
|
'files',
|
||||||
|
item.raw,
|
||||||
|
)
|
||||||
fileMsg.push({
|
fileMsg.push({
|
||||||
type: 1,
|
type: 1,
|
||||||
name: 'faceImg',
|
name: 'faceImg',
|
||||||
|
|
@ -1027,16 +1067,24 @@ export default {
|
||||||
status_1 === 'all_filled' &&
|
status_1 === 'all_filled' &&
|
||||||
!this.isEditContract
|
!this.isEditContract
|
||||||
) {
|
) {
|
||||||
params.bmWorkerContract = this.contractInfoForm
|
params.bmWorkerContract =
|
||||||
this.contractImageList.forEach((item) => {
|
this.contractInfoForm
|
||||||
item.fileList.forEach((j) => {
|
this.contractImageList.forEach(
|
||||||
formData.append('files', j.raw)
|
(item) => {
|
||||||
|
item.fileList.forEach(
|
||||||
|
(j) => {
|
||||||
|
formData.append(
|
||||||
|
'files',
|
||||||
|
j.raw,
|
||||||
|
)
|
||||||
fileMsg.push({
|
fileMsg.push({
|
||||||
type: item.type,
|
type: item.type,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
})
|
})
|
||||||
})
|
},
|
||||||
})
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status_1 === 'partial') {
|
if (status_1 === 'partial') {
|
||||||
|
|
@ -1044,7 +1092,9 @@ export default {
|
||||||
'请完善合同见证中的必填信息(除附件外)后再提交',
|
'请完善合同见证中的必填信息(除附件外)后再提交',
|
||||||
)
|
)
|
||||||
|
|
||||||
return reject(new Error('合同信息未完善'))
|
return reject(
|
||||||
|
new Error('合同信息未完善'),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
if (status_2 === 'all_filled') {
|
if (status_2 === 'all_filled') {
|
||||||
params.bmWorkerWageCard =
|
params.bmWorkerWageCard =
|
||||||
|
|
@ -1052,16 +1102,25 @@ export default {
|
||||||
|
|
||||||
if (this.queryDetailsId) {
|
if (this.queryDetailsId) {
|
||||||
let reserveFileList = []
|
let reserveFileList = []
|
||||||
this.bankImageList.forEach((item) => {
|
this.bankImageList.forEach(
|
||||||
item.fileList.forEach((j) => {
|
(item) => {
|
||||||
|
item.fileList.forEach(
|
||||||
|
(j) => {
|
||||||
if (j.id) {
|
if (j.id) {
|
||||||
reserveFileList.push(j.id)
|
reserveFileList.push(
|
||||||
|
j.id,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
})
|
},
|
||||||
})
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
if (reserveFileList.length > 0) {
|
if (
|
||||||
fileIdList = this.editUploadFileList
|
reserveFileList.length > 0
|
||||||
|
) {
|
||||||
|
fileIdList =
|
||||||
|
this.editUploadFileList
|
||||||
.filter(
|
.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
!reserveFileList.includes(
|
!reserveFileList.includes(
|
||||||
|
|
@ -1077,23 +1136,22 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bankImageList.forEach((item) => {
|
this.bankImageList.forEach(
|
||||||
item.fileList.forEach((j) => {
|
(item) => {
|
||||||
|
item.fileList.forEach(
|
||||||
|
(j) => {
|
||||||
if (!j.id) {
|
if (!j.id) {
|
||||||
formData.append('files', j.raw)
|
formData.append(
|
||||||
|
'files',
|
||||||
|
j.raw,
|
||||||
|
)
|
||||||
fileMsg.push({
|
fileMsg.push({
|
||||||
type: item.type,
|
type: item.type,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
},
|
||||||
})
|
)
|
||||||
|
|
||||||
this.$refs.contractInfoFormRef.validate(
|
|
||||||
(valid) => {
|
|
||||||
if (!valid) {
|
|
||||||
reject(new Error('合同信息未完善'))
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -1103,14 +1161,19 @@ export default {
|
||||||
'请完善工资卡见证中的必填信息(除附件外)后再提交',
|
'请完善工资卡见证中的必填信息(除附件外)后再提交',
|
||||||
)
|
)
|
||||||
|
|
||||||
return reject(new Error('工资卡信息未完善'))
|
return reject(
|
||||||
|
new Error('工资卡信息未完善'),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
status_2 === 'all_empty' &&
|
status_2 === 'all_empty' &&
|
||||||
this.queryDetailsId
|
this.queryDetailsId
|
||||||
) {
|
) {
|
||||||
if (this.editUploadFileList.length > 0) {
|
if (
|
||||||
|
this.editUploadFileList.length >
|
||||||
|
0
|
||||||
|
) {
|
||||||
params.bmWorkerWageCard.delIds =
|
params.bmWorkerWageCard.delIds =
|
||||||
this.editUploadFileList
|
this.editUploadFileList
|
||||||
.map((j) => j.id)
|
.map((j) => j.id)
|
||||||
|
|
@ -1118,8 +1181,14 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
formData.append('params', JSON.stringify(params))
|
formData.append(
|
||||||
formData.append('fileMsg', JSON.stringify(fileMsg))
|
'params',
|
||||||
|
JSON.stringify(params),
|
||||||
|
)
|
||||||
|
formData.append(
|
||||||
|
'fileMsg',
|
||||||
|
JSON.stringify(fileMsg),
|
||||||
|
)
|
||||||
|
|
||||||
const API = this.queryDetailsId
|
const API = this.queryDetailsId
|
||||||
? editEntryPersonAPI
|
? editEntryPersonAPI
|
||||||
|
|
@ -1137,6 +1206,13 @@ export default {
|
||||||
this.$modal.msgError(res.msg)
|
this.$modal.msgError(res.msg)
|
||||||
reject(new Error(res.msg))
|
reject(new Error(res.msg))
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
reject(
|
||||||
|
new Error('合同信息表单验证失败'),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
// 关键信息表单验证失败
|
// 关键信息表单验证失败
|
||||||
reject(new Error('关键信息表单验证失败'))
|
reject(new Error('关键信息表单验证失败'))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue