This commit is contained in:
BianLzhaoMin 2025-08-18 18:06:23 +08:00
parent 4d894bb3cf
commit fc3e8a9bfa
3 changed files with 299 additions and 197 deletions

View File

@ -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,
}) })

View File

@ -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('')
}) })
}
})
}, },
// //

View File

@ -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('关键信息表单验证失败'))