工资卡见证页面完善

This commit is contained in:
BianLzhaoMin 2025-08-15 17:22:25 +08:00
parent a8afeff8d6
commit 1befb6f59e
4 changed files with 51 additions and 87 deletions

View File

@ -2,9 +2,9 @@ import request from '@/utils/request'
import requestFormData from '@/utils/request_formdata'
// 工资卡见证 人员工资卡列表接口
export const getPersonContractListAPI = (data) => {
export const getPersonWageCardListAPI = (data) => {
return request({
url: '/bmw/workerContract/list',
url: '/bmw/workerWageCard/list',
method: 'get',
params: data,
})
@ -28,17 +28,17 @@ export const getContractDetailListAPI = (data) => {
}
// 工资卡见证 工资卡上传接口
export const uploadContractAPI = (data) => {
export const uploadWageCardAPI = (data) => {
return requestFormData({
url: `/bmw/workerContract/edit`,
url: '/bmw/workerWageCard/edit',
method: 'post',
data,
})
}
// 工资卡见证 查询工资卡详情
export const getContractDetailLookFileAPI = (id) => {
export const getWageCarDetailLookFileAPI = (id) => {
return request({
url: `/bmw/workerContract/lookFile/${id}`,
url: `/bmw/workerWageCard/lookFile/${id}`,
method: 'post',
})
}

View File

@ -22,14 +22,14 @@ export const formLabel = [
},
{
f_label: '银行卡号',
f_model: 'phone',
f_model: 'bankCardCode',
f_type: 'ipt',
f_width: '180px',
isShow: false, // 是否展示label
},
{
f_label: '状态',
f_model: 'einStatus',
f_model: 'isUpload',
f_type: 'sel',
f_width: '180px',
isShow: false, // 是否展示label
@ -40,7 +40,7 @@ export const formLabel = [
},
{
label: '未上传',
value: '2',
value: '0',
},
], // 状态列表
},
@ -49,20 +49,20 @@ export const formLabel = [
export const columnsList = [
{ t_props: 'name', t_label: '姓名' },
{ t_props: 'idNumber', t_label: '身份证' },
{ t_props: 'contractCode', t_label: '联系方式' },
{ t_props: 'proName', t_label: '银行卡号' },
{ t_props: 'phone', t_label: '联系方式' },
{ t_props: 'bankCardCode', t_label: '银行卡号' },
{
t_props: 'subName',
t_props: 'bankName',
t_label: '银行名称',
},
{ t_props: 'teamName', t_label: '银行支行名称' },
{ t_props: 'bankBranchName', t_label: '银行支行名称' },
{
t_label: '工资卡见证',
t_slot: 'view',
},
{
t_label: '状态',
t_slot: 'isSign',
t_slot: 'isUpload',
},
{
t_props: 'updateTime',

View File

@ -7,7 +7,7 @@
:showRightTools="true"
:columnsList="columnsList"
ref="wageCardWitnessTableRef"
:request-api="getPersonContractListAPI"
:request-api="getPersonWageCardListAPI"
>
<template slot="btn" slot-scope="{ queryParams }">
<el-button
@ -22,12 +22,12 @@
</template>
<!-- 上传状态 -->
<template slot="isSign" slot-scope="{ data }">
<el-tag size="mini" type="danger" v-if="data.isSign == 0">
未上传
</el-tag>
<el-tag size="mini" type="success" v-if="data.isSign == 1">
已上传
<template slot="isUpload" slot-scope="{ data }">
<el-tag
size="mini"
:type="data.isUpload == 0 ? 'danger' : 'success'"
>
{{ data.isUpload == 0 ? '未上传' : '已上传' }}
</el-tag>
</template>
@ -44,21 +44,11 @@
</template>
<template slot="handle" slot-scope="{ data }">
<!-- <el-button
plain
size="mini"
type="primary"
icon="el-icon-edit"
@click="onHandleViewContractDetailsList(data)"
>
详情
</el-button> -->
<el-button
plain
size="mini"
type="primary"
icon="el-icon-upload"
v-if="data.einStatus == 1"
@click="onHandleUploadWageCard(data)"
>
修改
@ -114,7 +104,10 @@ import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel'
import WageCardUpload from './wage-card-upload' //
import { formLabel, columnsList, dialogConfig } from './config'
import { getPersonContractListAPI } from '@/api/construction-person/red-green-light-mange/contract-witness'
import {
getPersonWageCardListAPI,
getWageCarDetailLookFileAPI,
} from '@/api/construction-person/red-green-light-mange/wage-card-witness'
export default {
name: 'WageCardWitness',
components: {
@ -128,7 +121,7 @@ export default {
formLabel,
columnsList,
dialogConfig,
getPersonContractListAPI,
getPersonWageCardListAPI,
queryDetailsId: '', // id
einStatus: 1, //
formType: 1, //
@ -141,16 +134,13 @@ export default {
electronicSignature: 'electronicSignature',
},
contractImgList: [
'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
], //
contractImgList: [], //
}
},
methods: {
//
onHandleExportWageCard(queryParams) {
console.log(queryParams, '导出参数')
// console.log(queryParams, '')
// this.download(
// '/xxx/xxx',
// {
@ -160,33 +150,13 @@ export default {
// )
},
//
onHandleDeletePersonEntry(data) {
this.$confirm('确定删除该人员吗?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
const res = await deleteEntryPersonAPI({
id: data.id,
})
if (res.code === 200) {
this.$modal.msgSuccess('删除成功')
this.$refs.wageCardWitnessTableRef.getTableList() //
}
})
.catch(() => {
console.log('取消')
})
},
//
onHandleUploadWageCard(data) {
console.log(data, '上传工资卡')
// this.queryDetailsId = data.id
if (data.isSign == 1) {
this.dialogConfig.outerTitle = '工资卡见证'
this.dialogConfig.minHeight = ''
this.dialogConfig.maxHeight = ''
this.dialogConfig.outerWidth = '60%'
if (data.isUpload == 1) {
this.$confirm(
'当前已上传工资卡信息,是否要重新上传,重新上传将会覆盖原数据?',
'温馨提示',
@ -199,29 +169,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 = '60%'
this.dialogConfig.outerVisible = true
// 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 = '70%'
this.dialogConfig.outerVisible = true
}
},
//
onHandleViewWageCardImg(data) {
async onHandleViewWageCardImg(data) {
const { data: res } = await getWageCarDetailLookFileAPI(data.id)
this.contractImgList = res
.filter((item) => item.sourceType != 5)
.map((item) => item.lsUrl)
this.dialogConfig.outerTitle = '工资卡图片详情'
this.dialogConfig.minHeight = '500px'
this.dialogConfig.maxHeight = '500px'
@ -236,7 +200,7 @@ export default {
this.$refs.wageCardWitnessTableRef.getTableList()
this.handleCloseDialogOuter()
} catch (error) {
console.log('表单提交失败', error)
// console.log('', error)
}
},

View File

@ -106,9 +106,9 @@ import UploadImg from '@/components/UploadImg'
import UploadImgFormData from '@/components/UploadImgFormData'
import UploadFileFormData from '@/components/UploadFileFormData'
import {
uploadContractAPI,
uploadWageCardAPI,
getContractDetailAPI,
} from '@/api/construction-person/red-green-light-mange/contract-witness'
} from '@/api/construction-person/red-green-light-mange/wage-card-witness'
export default {
name: 'AddOrEditForm',
props: {
@ -195,7 +195,7 @@ export default {
//
fieldsList.forEach((field) => {
if (!this.contractInfoForm[field]) {
if (!this.salaryCardInfoForm[field]) {
emptyFieldCount++
} else {
filledFieldCount++
@ -244,9 +244,9 @@ export default {
//
if (status === 'partial') {
this.$modal.msgError(
'请完善合同见证中的必填信息(除附件外)后再提交',
'请完善工资卡见证中的必填信息(除附件外)后再提交',
)
return reject(new Error('合同信息未完善'))
return reject(new Error('工资卡信息未完善'))
}
//
@ -269,9 +269,9 @@ export default {
const filesList = []
const formData = new FormData()
this.contractImageList.forEach((item) => {
this.bankImageList.forEach((item) => {
item.fileList.forEach((file) => {
filesList.push({ type: item.type, name: 'contract' })
filesList.push({ type: item.type, name: 'wageCard' })
formData.append('files', file.raw)
})
})
@ -280,17 +280,17 @@ export default {
// 3. APIreject
try {
const res = await uploadContractAPI(formData)
const res = await uploadWageCardAPI(formData)
if (res.code === 200) {
this.$modal.msgSuccess('合同上传成功')
this.$modal.msgSuccess('工资卡信息上传成功')
resolve()
} else {
this.$modal.msgError(res.msg)
reject()
}
} catch (err) {
this.$modal.msgError('合同上传失败,请重试')
this.$modal.msgError('工资卡信息上传失败,请重试')
reject(err)
}
})
@ -326,7 +326,7 @@ export default {
//
async getContractDetail() {
console.log(this.queryDetailsId, 'queryDetailsId 合同详情')
// console.log(this.queryDetailsId, 'queryDetailsId ')
const { data: res } = await getContractDetailAPI(
this.queryDetailsId,
)