分包商页面完善 工资卡见证页面初步完善

This commit is contained in:
BianLzhaoMin 2025-08-15 11:25:39 +08:00
parent fc5c10a3bc
commit 40454371ea
10 changed files with 310 additions and 249 deletions

View File

@ -20,10 +20,11 @@ export const editSubBaseInfoAPI = (data) => {
}
// 删除分包商基础信息
export const deleteSubBaseInfoAPI = (id) => {
export const deleteSubBaseInfoAPI = (data) => {
return request({
url: `/project/****/${id}`,
method: 'DELETE',
url: '/bmw/pmSub/delSub',
method: 'POST',
data,
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
import requestFormData from '@/utils/request_formdata'
// 工资卡见证 人员工资卡列表接口
export const getPersonContractListAPI = (data) => {
return request({
url: '/bmw/workerContract/list',
method: 'get',
params: data,
})
}
// 工资卡见证 获取工资卡详情接口
export const getContractDetailAPI = (id) => {
return request({
url: `/bmw/workerContract/${id}`,
method: 'get',
})
}
// 工资卡见证 获取工资卡详情列表接口(历史工资卡信息)
export const getContractDetailListAPI = (data) => {
return request({
url: `/bmw/workerContract/workerList`,
method: 'get',
params: data,
})
}
// 工资卡见证 工资卡上传接口
export const uploadContractAPI = (data) => {
return requestFormData({
url: `/bmw/workerContract/edit`,
method: 'post',
data,
})
}
// 工资卡见证 查询工资卡详情
export const getContractDetailLookFileAPI = (id) => {
return request({
url: `/bmw/workerContract/lookFile/${id}`,
method: 'post',
})
}

View File

@ -21,7 +21,7 @@
clearable
:maxlength="item.f_max || 50"
v-if="item.f_type === 'ipt'"
v-model="queryParams[item.f_model]"
v-model.trim="queryParams[item.f_model]"
:placeholder="`请输入${item.f_label}`"
:style="{ width: item.f_width || '240px' }"
/>

View File

@ -125,6 +125,12 @@ export default {
components: {
UploadImgFormData,
},
props: {
editFormData: {
type: Object,
default: () => {},
},
},
data() {
return {
formType: 1,
@ -207,8 +213,6 @@ export default {
return new Promise((resolve, reject) => {
this.$refs.addOrEditFormRef.validate(async (valid) => {
if (valid) {
console.log(this.addOrEditForm)
//
const {
businessLicense,
@ -296,5 +300,34 @@ export default {
this.$refs.addOrEditFormRef.resetFields()
},
},
watch: {
editFormData: {
handler(newVal) {
if (Object.keys(newVal).length > 0) {
Object.assign(this.addOrEditForm, newVal)
// const {
// subName,
// legalPerson,
// legalPersonPhone,
// subAddress,
// id,
// } = newVal
// this.addOrEditForm.subName = subName
// this.addOrEditForm.legalPerson = legalPerson
// this.addOrEditForm.legalPersonPhone = legalPersonPhone
// this.addOrEditForm.subAddress = subAddress
// this.addOrEditForm.id = id
// this.addOrEditForm.businessLicense = []
// this.addOrEditForm.electronicStamp = []
// this.addOrEditForm.idCard = []
// this.addOrEditForm.electronicSignature = []
}
},
deep: true,
immediate: true,
},
},
}
</script>

View File

@ -1,7 +1,7 @@
export const formLabel = [
{
f_label: '关键词',
f_model: 'keyword',
f_model: 'keyWord',
f_type: 'ipt',
isShow: false, // 是否展示label
},

View File

@ -32,8 +32,8 @@
</template>
<!-- 标段工程数量 -->
<template :slot="item" slot-scope="{ data }" v-for="item in slots">
</template>
<!-- <template :slot="item" slot-scope="{ data }" v-for="item in slots">
</template> -->
<template slot="handle" slot-scope="{ data }">
<el-button
@ -61,8 +61,10 @@
@closeDialogOuter="handleCloseDialogOuter"
>
<template slot="outerContent">
<AddOrEditForm ref="addOrEditFormContentRef" />
<AddOrEditForm
ref="addOrEditFormContentRef"
:editFormData="editFormData"
/>
<el-row class="dialog-footer-btn">
<el-button size="medium" @click="handleCloseDialogOuter">
取消
@ -102,9 +104,8 @@ export default {
formLabel,
columnsList,
dialogConfig,
editFormData: {},
getSubBaseInfoListAPI,
slots: {
businessLicense: 'businessLicense',
idCard: 'idCard',
@ -116,13 +117,37 @@ export default {
methods: {
//
onHandleExportSubBaseInfo(queryParams) {
console.log(queryParams, '导出')
this.download(
'/bmw/pmSub/export',
{
...queryParams,
},
`分包商列表.xlsx`,
)
},
//
onHandleAddOrEditSubBaseInfo(type, data) {
this.dialogConfig.outerTitle =
type === 1 ? '新增标段工程' : '修改标段工程'
type === 1 ? '新增分包商' : '修改分包商'
if (type === 2) {
const {
subName,
legalPerson,
legalPersonPhone,
subAddress,
id,
} = data
this.editFormData = {
subName,
legalPerson,
legalPersonPhone,
subAddress,
id,
}
}
this.dialogConfig.outerVisible = true
},
@ -134,22 +159,22 @@ export default {
type: 'warning',
})
.then(async () => {
const res = await deleteSubBaseInfoAPI(data.id)
const res = await deleteSubBaseInfoAPI({
id: data.id,
})
console.log(res, '删除结果')
if (res.code === 200) {
this.$msgSuccess('删除成功')
this.$refs.allProjectTableRef.getTableList() //
this.$modal.msgSuccess('删除成功')
this.$refs.subBaseInfoTableRef.getTableList() //
}
})
.catch(() => {
console.log('取消')
// console.log('')
})
},
//
async onHandleConfirmAddOrEdit() {
this.$refs.addOrEditFormContentRef.formType =
this.dialogConfig.outerTitle === '新增标段工程' ? 1 : 2
try {
await this.$refs.addOrEditFormContentRef.onHandleConfirmAddOrEditFun()
this.handleCloseDialogOuter()

View File

@ -265,77 +265,6 @@ export default {
},
//
onHandleConfirmAddOrEditFun() {
// return new Promise(async (resolve, reject) => {
// const status = this.checkFormStatus()
// if (status === 'all_filled') {
// params.bmWorkerContract = this.contractInfoForm
// }
// if (status === 'partial') {
// this.$modal.msgError(
// '',
// )
// return reject(new Error(''))
// }
// if (status === 'all_empty') {
// await new Promise((resolve, reject) => {
// this.$confirm(
// '',
// '',
// )
// .then(() => {
// resolve()
// })
// .catch(() => {
// reject()
// })
// })
// .then(() => {
// return resolve()
// })
// .catch(() => {
// return reject()
// })
// }
// const params = {
// ...this.contractInfoForm,
// workerId: this.workerId,
// }
// // ()
// if (this.queryDetailsId) {
// params.id = this.queryDetailsId
// }
// const filesList = []
// const formData = new FormData()
// this.contractImageList.forEach((item) => {
// item.fileList.forEach((file) => {
// filesList.push({
// type: item.type,
// name: 'contract',
// })
// formData.append('files', file.raw)
// })
// })
// formData.append('params', JSON.stringify(params))
// formData.append('fileMsg', JSON.stringify(filesList))
// const res = await uploadContractAPI(formData)
// console.log(res, 'res ')
// if (res.code === 200) {
// this.$modal.msgSuccess('')
// resolve()
// } else {
// this.$modal.msgError(res.msg)
// reject()
// }
// })
return new Promise(async (resolve, reject) => {
const status = this.checkFormStatus()
@ -349,11 +278,6 @@ export default {
params.id = this.queryDetailsId
}
//
if (status === 'all_filled') {
params.bmWorkerContract = this.contractInfoForm
}
//
if (status === 'partial') {
this.$modal.msgError(

View File

@ -72,8 +72,8 @@ export const columnsList = [
export const dialogConfig = {
outerVisible: false,
outerTitle: '',
outerWidth: '80%',
outerTitle: '工资卡见证',
outerWidth: '60%',
minHeight: '',
maxHeight: '',
}

View File

@ -160,22 +160,6 @@ export default {
// )
},
//
onHandleAddOrEditPersonEntry(type, data) {
this.dialogConfig.outerTitle = type === 1 ? '新增人员' : '修改人员'
this.formType = type
if (type === 2) {
this.queryDetailsId = data.id
this.einStatus = data.einStatus
this.dialogConfig.outerVisible = true
this.$nextTick(() => {
this.$refs.uploadContractContentRef.getEntryPersonDetail()
})
} else {
this.dialogConfig.outerVisible = true
}
},
//
onHandleDeletePersonEntry(data) {
this.$confirm('确定删除该人员吗?', '温馨提示', {
@ -215,23 +199,23 @@ export default {
.then(async () => {
this.workerId = data.workerId
this.queryDetailsId = data.id
this.dialogConfig.outerTitle = '工资卡见证'
this.dialogConfig.minHeight = ''
this.dialogConfig.maxHeight = ''
this.dialogConfig.outerWidth = '80%'
// this.dialogConfig.outerTitle = ''
// this.dialogConfig.minHeight = ''
// this.dialogConfig.maxHeight = ''
// this.dialogConfig.outerWidth = '60%'
this.dialogConfig.outerVisible = true
this.$nextTick(() => {
this.$refs.uploadContractContentRef.getContractDetail()
})
// this.$nextTick(() => {
// this.$refs.uploadContractContentRef.getContractDetail()
// })
})
.catch(() => {})
} else {
this.workerId = data.workerId
this.queryDetailsId = ''
this.dialogConfig.outerTitle = '工资卡见证'
this.dialogConfig.minHeight = ''
this.dialogConfig.maxHeight = ''
this.dialogConfig.outerWidth = '80%'
// this.dialogConfig.outerTitle = ''
// this.dialogConfig.minHeight = ''
// this.dialogConfig.maxHeight = ''
// this.dialogConfig.outerWidth = '70%'
this.dialogConfig.outerVisible = true
}
},

View File

@ -1,33 +1,46 @@
<template>
<!-- 新增或修改标段工程表单 -->
<div>
<!-- 合同信息表单 -->
<!-- 工资卡信息表单 -->
<el-form
label-width="140px"
ref="contractInfoFormRef"
:model="contractInfoForm"
ref="salaryCardInfoFormRef"
:model="salaryCardInfoForm"
>
<TitleTip
titleText="工资卡见证"
borderBottom="none"
padding="24px 10px"
backgroundColor="#f8fafc"
justifyContent="flex-start"
>
<template>
<span class="tip-text"> (生产工资册之前必须完善) </span>
</template>
</TitleTip>
<el-row>
<el-col :span="24">
<el-form-item label="合同见证照片" prop="businessLicense">
<el-form-item label="工资卡见证照片">
<div style="display: flex; gap: 10px">
<div
class="contract-img-box"
v-for="item in contractImageList"
v-for="item in bankImageList"
:key="item.title"
>
<UploadImgFormData
:key="item.title"
:limit="1"
:file-size="10"
:file-size="20"
:multiple="true"
v-if="item.type != 5"
:is-detail="formType === 2"
:file-type="['jpg', 'png', 'jpeg']"
:file-list.sync="item.fileList"
:file-type="['jpg', 'png', 'jpeg']"
:is-uploaded="item.fileList.length >= 1"
/>
<span> {{ item.title }} </span>
<span v-if="item.type != 5">
{{ item.title }}
</span>
</div>
</div>
</el-form-item>
@ -36,84 +49,51 @@
<el-row>
<el-col :span="12">
<el-form-item label="合同编号" prop="contractCode">
<el-form-item label="银行卡号" prop="bankCardCode">
<el-input
clearable
placeholder="请输入合同编号"
v-model="contractInfoForm.contractCode"
placeholder="请输入银行卡号"
v-model="salaryCardInfoForm.bankCardCode"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="合同期限类型" prop="contractTermType">
<el-radio-group
size="mini"
v-model="contractInfoForm.contractTermType"
>
<el-radio-button
label="以完成一定工作为期限的合同"
/>
<el-radio-button label="固定期限合同" />
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="合同签订日期" prop="contractStartDate">
<el-date-picker
type="date"
style="width: 100%"
value-format="yyyy-MM-dd"
placeholder="请选择合同签订日期"
v-model="contractInfoForm.contractStartDate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="合同终止日期" prop="contractStopDate">
<el-date-picker
type="date"
style="width: 100%"
value-format="yyyy-MM-dd"
placeholder="请选择合同终止日期"
v-model="contractInfoForm.contractStopDate"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="工资核定方式" prop="wageApprovedWay">
<el-radio-group
size="mini"
v-model="contractInfoForm.wageApprovedWay"
>
<el-radio-button label="天" />
<el-radio-button label="月" />
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工资核定标准" prop="wageCriterion">
<el-form-item label="银行名称" prop="bankName">
<el-input
clearable
placeholder="请输入工资核定标准"
v-model="contractInfoForm.wageCriterion"
placeholder="请输入银行名称"
v-model="salaryCardInfoForm.bankName"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="附件" prop="phone">
<!-- <el-input
<el-col :span="12">
<el-form-item label="附件">
<UploadFileFormData
:limit="3"
:file-size="20"
:multiple="true"
uploadTip="身份证、银行卡扫描件,承诺书、劳动合同或用工协议扫描件"
:file-list.sync="bankImageList[4].fileList"
:file-type="[
'jpg',
'png',
'jpeg',
'pdf',
'doc',
'docx',
]"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="银行支行名称" prop="bankBranchName">
<el-input
clearable
placeholder="请输入附件"
v-model="contractInfoForm.phone"
/> -->
placeholder="请输入银行支行名称"
v-model="salaryCardInfoForm.bankBranchName"
/>
</el-form-item>
</el-col>
</el-row>
@ -124,6 +104,7 @@
<script>
import UploadImg from '@/components/UploadImg'
import UploadImgFormData from '@/components/UploadImgFormData'
import UploadFileFormData from '@/components/UploadFileFormData'
import {
uploadContractAPI,
getContractDetailAPI,
@ -152,96 +133,165 @@ export default {
components: {
UploadImg,
UploadImgFormData,
UploadFileFormData,
},
data() {
return {
//
contractInfoForm: {
contractCode: '', //
contractTermType: '以完成一定工作为期限的合同', //
contractStartDate: '', //
contractStopDate: '', //
wageApprovedWay: '天', //
wageCriterion: '', //
//
salaryCardInfoForm: {
bankCardCode: '', //
bankName: '', //
bankBranchName: '', //
},
addOrEditForm: {
name: '', //
idNumber: '', //
sex: '', //
birthday: '', //
nation: '', //
issuingAuthority: '', //
startTime: '', //
endTime: '', //
address: '', //
subName: '', //
legalRepresentative: '', //
phone: '', //
businessAddress: '', //
businessLicense: [], //
electronicStamp: [], //
idCard: [], //
electronicSignature: [], // /
},
contractImageList: [
bankImageList: [
{
title: '人员手持合同照',
title: '手持银行卡、承诺书',
type: 1,
name: 'bank',
fileList: [],
},
{
title: '工作内容页',
title: '银行卡照片',
type: 2,
name: 'bank',
fileList: [],
},
{
title: '薪酬约定页',
title: '个人工资卡承诺书',
type: 3,
name: 'bank',
fileList: [],
},
{
title: '本人签名页',
title: '其它照片',
type: 4,
name: 'bank',
fileList: [],
},
{
title: '其他照片',
title: '附件',
type: 5,
name: 'bank',
fileList: [],
},
],
}
},
methods: {
//
checkFormStatus() {
//
const fieldsList = [
'bankCardCode', //
'bankName', //
'bankBranchName', //
]
const imageFieldsToCheck = this.bankImageList.slice(0, -1) //
//
let emptyFieldCount = 0
let filledFieldCount = 0
//
fieldsList.forEach((field) => {
if (!this.contractInfoForm[field]) {
emptyFieldCount++
} else {
filledFieldCount++
}
})
//
imageFieldsToCheck.forEach((item) => {
if (item.fileList.length === 0) {
emptyFieldCount++
} else {
filledFieldCount++
}
})
//
if (
emptyFieldCount ===
fieldsList.length + imageFieldsToCheck.length
) {
return 'all_empty' //
} else if (
filledFieldCount ===
fieldsList.length + imageFieldsToCheck.length
) {
return 'all_filled' //
} else {
return 'partial' //
}
},
//
onHandleConfirmAddOrEditFun() {
return new Promise(async (resolve, reject) => {
console.log(this.contractImageList, 'contractImageList')
const status = this.checkFormStatus()
const params = {
...this.contractInfoForm,
// 1. params
let params = {
...this.salaryCardInfoForm,
workerId: this.workerId,
}
// ()
// ID
if (this.queryDetailsId) {
params.id = this.queryDetailsId
}
const formData = new FormData()
formData.append('params', JSON.stringify(params))
formData.append('files', JSON.stringify(this.contractImageList))
//
if (status === 'partial') {
this.$modal.msgError(
'请完善合同见证中的必填信息(除附件外)后再提交',
)
return reject(new Error('合同信息未完善'))
}
const res = await uploadContractAPI(formData)
console.log(res, 'res 合同上传')
if (res.code === 200) {
this.$modal.msgSuccess('合同上传成功')
resolve()
} else {
this.$modal.msgError(res.msg)
reject()
//
if (status === 'all_empty') {
await new Promise((innerResolve, innerReject) => {
this.$confirm(
'当前合同信息为空,确定后将关闭该上传页面',
'温馨提示',
)
.then(() => innerResolve())
.catch(() => innerReject())
})
.then(() => resolve('isClose'))
.catch(() => reject())
return
}
// all_filled
const filesList = []
const formData = new FormData()
this.contractImageList.forEach((item) => {
item.fileList.forEach((file) => {
filesList.push({ type: item.type, name: 'contract' })
formData.append('files', file.raw)
})
})
formData.append('params', JSON.stringify(params))
formData.append('fileMsg', JSON.stringify(filesList))
// 3. APIreject
try {
const res = await uploadContractAPI(formData)
if (res.code === 200) {
this.$modal.msgSuccess('合同上传成功')
resolve()
} else {
this.$modal.msgError(res.msg)
reject()
}
} catch (err) {
this.$modal.msgError('合同上传失败,请重试')
reject(err)
}
})
},