人员入场优化

This commit is contained in:
BianLzhaoMin 2025-08-16 15:00:50 +08:00
parent e3491325f8
commit cb3bb05701
6 changed files with 168 additions and 310 deletions

View File

@ -9,31 +9,6 @@ export const teamEntryAndExitAPI = (data) => {
data,
})
}
// 班组出场
export const teamExitAPI = (data) => {
return request({
url: '/project/***',
method: 'POST',
data,
})
}
// 修改班组入场信息
export const editTeamEntryAPI = (data) => {
return request({
url: '/project/***',
method: 'POST',
data,
})
}
// 删除班组入场信息
export const deleteTeamEntryAPI = (id) => {
return request({
url: `/project/****/${id}`,
method: 'DELETE',
})
}
// 获取班组入场信息列表
export const getTeamEntryListAPI = (data) => {

View File

@ -26,17 +26,17 @@ export const formLabel = [
]
export const columnsList = [
{ t_props: 'projectName', t_label: '分包商名称' },
{ t_props: 'xmb', t_label: '班组名称' },
{ t_props: 'name', t_label: '班组入场工程名称' },
{ t_props: 'type', t_label: '出入场状态' },
{ t_props: 'subName', t_label: '分包商名称' },
{ t_props: 'teamName', t_label: '班组名称' },
{ t_props: 'proName', t_label: '班组入场工程名称' },
{ t_props: 'teamEinStatus', t_label: '出入场状态' },
{
t_props: 'businessLicense',
t_props: 'teamEinTime',
t_label: '入场时间',
},
{ t_props: 'idCard', t_label: '出场时间', t_slot: 'idCard' },
{ t_props: 'teamExitTime', t_label: '出场时间' },
{
t_props: 'electronicStamp',
t_props: 'contractFile',
t_label: '施工组承诺书',
},
]

View File

@ -1,8 +1,14 @@
<template>
<!-- 新增或修改标段工程表单 -->
<!-- 班组出入场表单 -->
<div>
<div class="tip-text" style="margin-bottom: 20px" v-if="formType === 2">
说明分包商出场需此分包合同下的班组全部出场后操作
<br />
<br />
检测到分包下存在2个班组12名施工人员未出场
</div>
<el-form
label-width="180px"
label-width="220px"
ref="addOrEditFormRef"
:model="addOrEditForm"
:rules="addOrEditFormRules"
@ -14,6 +20,7 @@
style="width: 100%"
@change="onChangeSubIdFun"
v-model="addOrEditForm.subId"
:disabled="formType === 2"
>
<el-option
:key="item.value"
@ -32,6 +39,7 @@
style="width: 100%"
@change="onChangeTeamIdFun"
v-model="addOrEditForm.teamId"
:disabled="formType === 2"
>
<el-option
:key="item.value"
@ -50,6 +58,7 @@
style="width: 100%"
@change="onChangeProIdFun"
v-model="addOrEditForm.proId"
:disabled="formType === 2"
>
<el-option
:key="item.value"
@ -61,13 +70,38 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="formType === 2">
<el-col :span="24">
<el-form-item
prop="businessLicense"
label="农民工工资已支付完成承诺书"
>
<UploadFileFormData
:limit="3"
:file-size="20"
:multiple="true"
uploadTip="身份证、银行卡扫描件,承诺书、劳动合同或用工协议扫描件"
:file-list.sync="addOrEditForm.businessLicense"
:file-type="[
'jpg',
'png',
'jpeg',
'pdf',
'doc',
'docx',
]"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</template>
<script>
import UploadImg from '@/components/UploadImg'
import { teamEntryAndExitAPI } from '@/api/basic-manage/sub-manage/sub-base-info'
import UploadFileFormData from '@/components/UploadFileFormData'
import { teamEntryAndExitAPI } from '@/api/basic-manage/team-manage/team-entry-and-exit'
import {
getLotProjectSelectListCommonFun,
getSubSelectListCommonFun,
@ -77,17 +111,30 @@ export default {
name: 'AddOrEditForm',
components: {
UploadImg,
UploadFileFormData,
},
props: {
formType: {
type: Number,
default: 1,
},
editFormData: {
type: Object,
default: () => {},
},
},
data() {
return {
addOrEditForm: {
id: '',
subId: '',
proId: '',
teamId: '',
subName: '',
proName: '',
teamName: '',
teamEinStatus: 1,
teamEinStatus: '',
businessLicense: [],
},
addOrEditFormRules: {
subId: [
@ -111,6 +158,13 @@ export default {
trigger: 'blur',
},
],
businessLicense: [
{
required: true,
trigger: 'blur',
message: '请上传农民工工资已支付完成承诺书',
},
],
},
subSelectList: [],
@ -124,17 +178,54 @@ export default {
return new Promise((resolve, reject) => {
this.$refs.addOrEditFormRef.validate(async (valid) => {
if (valid) {
const {
id,
subId,
proId,
teamId,
subName,
proName,
teamName,
teamEinStatus,
businessLicense,
} = this.addOrEditForm
const params = {
subId,
proId,
teamId,
subName,
proName,
teamName,
teamEinStatus: this.formType,
}
if (id) {
params.id = id
}
const formData = new FormData()
formData.append(
'params',
JSON.stringify(this.addOrEditForm),
)
const fileMsg = []
businessLicense.forEach((e) => {
fileMsg.push({
type: 1,
name: '施工班组承诺书',
})
formData.append('files', e.raw)
})
formData.append('params', JSON.stringify(params))
formData.append('fileMsg', JSON.stringify(fileMsg))
const res = await teamEntryAndExitAPI(formData)
console.log(res, '新增或修改结果')
if (res.code === 200) {
this.$modal.msgSuccess(
this.formType === 1 ? '入场成功' : '出场成功',
)
resolve()
} else {
reject(new Error(res.message))
this.$modal.msgError(res.msg)
reject(new Error(res.msg))
}
} else {
reject(new Error('表单验证失败'))
@ -191,5 +282,17 @@ export default {
}
})
},
watch: {
editFormData: {
handler(newVal) {
if (Object.keys(newVal).length > 0) {
Object.assign(this.addOrEditForm, newVal)
}
},
deep: true,
immediate: true,
},
},
}
</script>

View File

@ -1,178 +0,0 @@
<template>
<!-- 新增或修改标段工程表单 -->
<div>
<el-form
label-width="220px"
ref="addOrEditFormRef"
:model="addOrEditForm"
:rules="addOrEditFormRules"
>
<el-row>
<el-col :span="24">
<el-form-item label="分包商合同名称" prop="htName">
<el-input
clearable
disabled
placeholder="请输入分包商合同名称"
v-model="addOrEditForm.htName"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="分包名称" prop="subName">
<el-input
clearable
disabled
placeholder="请输入分包名称"
v-model="addOrEditForm.subName"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="工程名称" prop="projectName">
<el-input
clearable
disabled
placeholder="请输入工程名称"
v-model="addOrEditForm.projectName"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="出场日期" prop="exitDate">
<el-date-picker
type="date"
style="width: 100%"
value-format="yyyy-MM-dd"
placeholder="请选择出场日期"
v-model="addOrEditForm.exitDate"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item
prop="businessLicense"
label="农民工工资已支付完成承诺书"
>
<UploadImg
:limit="30"
:file-size="10"
:multiple="true"
:file-type="['jpg', 'png', 'jpeg']"
:upload-file-url="uploadFileUrl"
:file-list.sync="addOrEditForm.businessLicense"
:is-uploaded="
addOrEditForm.businessLicense.length >= 2
"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</template>
<script>
import UploadImg from '@/components/UploadImg'
import {
addSubBaseInfoAPI,
editSubBaseInfoAPI,
} from '@/api/basic-manage/sub-manage/sub-base-info'
export default {
name: 'AddOrEditForm',
components: {
UploadImg,
},
data() {
return {
formType: 1,
uploadFileUrl:
process.env.VUE_APP_BASE_API + '/system/file/uploadFiles',
addOrEditForm: {
htName: '',
subName: '',
projectName: '',
entryDate: '',
businessLicense: [],
},
addOrEditFormRules: {
htName: [
{
required: true,
message: '请输入分包商合同名称',
trigger: 'blur',
},
],
subName: [
{
required: true,
message: '请输入分包商名称',
trigger: 'blur',
},
],
projectName: [
{
required: true,
message: '请输入工程名称',
trigger: 'blur',
},
],
entryDate: [
{
required: true,
message: '请选择入场日期',
trigger: 'blur',
},
],
businessLicense: [
{
required: true,
message: '请上传法定代表人授权委托书',
trigger: 'blur',
},
],
},
}
},
methods: {
//
onHandleConfirmAddOrEditFun() {
return new Promise((resolve, reject) => {
this.$refs.addOrEditFormRef.validate(async (valid) => {
if (valid) {
console.log(this.addOrEditForm)
// const API =
// this.formType === 1
// ? addSubBaseInfoAPI
// : editSubBaseInfoAPI
// const res = await API(this.addOrEditForm)
// console.log(res, '')
// if (res.code === 200) {
// resolve()
// } else {
// reject(new Error(res.message))
// }
} else {
reject(new Error('表单验证失败'))
}
})
})
},
//
resetForm() {
this.$refs.addOrEditFormRef.resetFields()
},
},
}
</script>

View File

@ -5,7 +5,7 @@
:formLabel="formLabel"
:showOperation="true"
:showRightTools="true"
ref="allProjectTableRef"
ref="teamEntryTableRef"
:columnsList="columnsList"
:request-api="getTeamEntryListAPI"
>
@ -25,7 +25,7 @@
size="mini"
type="primary"
icon="el-icon-plus"
@click="onHandleAddOrEditAllProject(1, null)"
@click="onHandleEntryAndExit(1, null)"
>
新增
</el-button>
@ -51,30 +51,10 @@
size="mini"
type="success"
icon="el-icon-check"
@click="onHandleExit(data)"
@click="onHandleEntryAndExit(2, data)"
>
出场
</el-button>
<el-button
plain
size="mini"
type="primary"
icon="el-icon-edit"
@click="onHandleAddOrEditAllProject(2, data)"
>
修改
</el-button>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="onHandleDeleteAllProject(data)"
>
删除
</el-button>
<el-button size="mini" type="primary" icon="el-icon-view">
详情
</el-button>
</template>
</TableModel>
@ -83,11 +63,11 @@
@closeDialogOuter="handleCloseDialogOuter"
>
<template slot="outerContent">
<AddOrEditForm
ref="addOrEditFormContentRef"
v-if="dialogConfig.outerTitle !== '出场'"
<EntryAndExitForm
:formType="formType"
:editFormData="editFormData"
ref="teamEntryAndExitFormRef"
/>
<ExitForm ref="exitFormContentRef" v-else />
<el-row class="dialog-footer-btn">
<el-button size="medium" @click="handleCloseDialogOuter">
@ -109,20 +89,20 @@
<script>
import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel'
import AddOrEditForm from './add-or-edit-form'
import ExitForm from './exit-form'
import EntryAndExitForm from './entry-and-exit-form'
import { formLabel, columnsList, dialogConfig } from './config'
import {
deleteTeamEntryAPI,
getTeamEntryListAPI,
} from '@/api/basic-manage/team-manage/team-entry-and-exit'
export default {
name: 'TeamEntryAndExit',
components: {
TableModel,
DialogModel,
AddOrEditForm,
ExitForm,
EntryAndExitForm,
},
data() {
@ -130,9 +110,9 @@ export default {
formLabel,
columnsList,
dialogConfig,
formType: 1,
editFormData: {},
getTeamEntryListAPI,
slots: {
idCard: 'idCard',
},
@ -144,50 +124,34 @@ export default {
console.log(queryParams, '导出')
},
//
onHandleAddOrEditAllProject(type, data) {
this.dialogConfig.outerTitle =
type === 1 ? '新增标段工程' : '修改标段工程'
//
onHandleEntryAndExit(type, data) {
this.formType = type
this.dialogConfig.outerTitle = type === 1 ? '班组入场' : '班组出场'
if (type === 2) {
const { subId, proId, teamId, id, subName, proName, teamName } =
data
this.editFormData = {
id,
subId,
proId,
teamId,
subName,
proName,
teamName,
}
} else {
this.editFormData = {}
}
this.dialogConfig.outerVisible = true
},
//
onHandleDeleteAllProject(data) {
this.$confirm('确定删除该工程吗?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
const res = await deleteSubBaseInfoAPI(data.id)
console.log(res, '删除结果')
if (res.code === 200) {
this.$msgSuccess('删除成功')
this.$refs.allProjectTableRef.getTableList() //
}
})
.catch(() => {
console.log('取消')
})
},
//
onHandleExit(data) {
this.dialogConfig.outerTitle = '出场'
this.dialogConfig.outerVisible = true
},
//
async onHandleConfirmAddOrEdit() {
try {
if (this.dialogConfig.outerTitle === '新增标段工程') {
this.$refs.addOrEditFormContentRef.formType =
this.dialogConfig.outerTitle === '新增标段工程' ? 1 : 2
await this.$refs.addOrEditFormContentRef.onHandleConfirmAddOrEditFun()
}
if (this.dialogConfig.outerTitle === '出场') {
await this.$refs.exitFormContentRef.onHandleConfirmAddOrEditFun()
}
await this.$refs.teamEntryAndExitFormRef.onHandleConfirmAddOrEditFun()
this.handleCloseDialogOuter()
this.$refs.teamEntryTableRef.getTableList()
} catch (error) {
console.log('表单提交失败', error)
}
@ -195,12 +159,6 @@ export default {
//
handleCloseDialogOuter() {
//
if (this.dialogConfig.outerTitle === '新增标段工程') {
this.$refs.addOrEditFormContentRef.resetForm()
} else if (this.dialogConfig.outerTitle === '出场') {
this.$refs.exitFormContentRef.resetForm()
}
this.dialogConfig.outerVisible = false
},
},

View File

@ -1021,19 +1021,19 @@ export default {
fileIdList.join(',')
}
}
this.bankImageList.forEach((item) => {
item.fileList.forEach((j) => {
if (!j.id) {
formData.append('files', j.raw)
fileMsg.push({
type: item.type,
name: item.name,
})
}
})
})
}
this.bankImageList.forEach((item) => {
item.fileList.forEach((j) => {
if (!j.id) {
formData.append('files', j.raw)
fileMsg.push({
type: item.type,
name: item.name,
})
}
})
})
}
if (status_2 === 'partial') {