代码完善
This commit is contained in:
parent
c2aa920725
commit
b50e6f9305
|
|
@ -3,16 +3,7 @@ import request from '@/utils/request'
|
||||||
// 新增和修改标段工程
|
// 新增和修改标段工程
|
||||||
export const addAndEditLotLotProjectAPI = (data) => {
|
export const addAndEditLotLotProjectAPI = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/bmw/pmOrg/addOrUpdateProject',
|
url: '/bmw/pmProject/addOrUpdateProject',
|
||||||
method: 'POST',
|
|
||||||
data,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改标段工程
|
|
||||||
export const editLotLotProjectAPI = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/project/***',
|
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
|
|
@ -29,7 +20,7 @@ export const deleteLotLotProjectAPI = (id) => {
|
||||||
// 获取标段工程列表
|
// 获取标段工程列表
|
||||||
export const getLotLotProjectListAPI = (data) => {
|
export const getLotLotProjectListAPI = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/project/***',
|
url: '/bmw/pmProject/list',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: data,
|
params: data,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -188,6 +188,8 @@ export default {
|
||||||
|
|
||||||
// 文件发生变化
|
// 文件发生变化
|
||||||
handleChange(file, fileList) {
|
handleChange(file, fileList) {
|
||||||
|
console.log(file, fileList, 'file, fileList')
|
||||||
|
|
||||||
this.$emit('update:fileList', fileList)
|
this.$emit('update:fileList', fileList)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,12 @@ import { getMainProjectListCommonFun } from '@/utils/getCommonData'
|
||||||
export default {
|
export default {
|
||||||
name: 'AddOrEditForm',
|
name: 'AddOrEditForm',
|
||||||
dicts: ['project_status', 'project_type', 'voltage_level'],
|
dicts: ['project_status', 'project_type', 'voltage_level'],
|
||||||
|
props: {
|
||||||
|
editFormData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
// 自定义校验规则 判断竣工结束时间是否大于开工开始时间
|
// 自定义校验规则 判断竣工结束时间是否大于开工开始时间
|
||||||
const validatePlanEndTime = (rule, value, callback) => {
|
const validatePlanEndTime = (rule, value, callback) => {
|
||||||
|
|
@ -226,8 +232,8 @@ export default {
|
||||||
|
|
||||||
proStatus: '0', // 工程状态 默认为0 在建
|
proStatus: '0', // 工程状态 默认为0 在建
|
||||||
proAddress: '', // 工程地址
|
proAddress: '', // 工程地址
|
||||||
startTime: '', // 开工时间
|
startTime: null, // 开工时间
|
||||||
endTime: '', // 竣工时间
|
endTime: null, // 竣工时间
|
||||||
lon: '', // 项目部经度
|
lon: '', // 项目部经度
|
||||||
lat: '', // 项目部纬度
|
lat: '', // 项目部纬度
|
||||||
},
|
},
|
||||||
|
|
@ -365,18 +371,24 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
console.log(this.addOrEditForm)
|
console.log(this.addOrEditForm)
|
||||||
|
|
||||||
// const API =
|
const params = {
|
||||||
// this.formType === 1
|
...this.addOrEditForm,
|
||||||
// ? addLotLotProjectAPI
|
}
|
||||||
// : editLotLotProjectAPI
|
|
||||||
|
if (this.formType === 1) {
|
||||||
|
delete params.id
|
||||||
|
}
|
||||||
|
|
||||||
const res = await addAndEditLotLotProjectAPI(
|
const res = await addAndEditLotLotProjectAPI(
|
||||||
this.addOrEditForm,
|
this.addOrEditForm,
|
||||||
)
|
)
|
||||||
console.log(res, '新增或修改结果')
|
console.log(res, '新增或修改结果')
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
resolve()
|
resolve()
|
||||||
|
this.$modal.msgSuccess('新增成功')
|
||||||
} else {
|
} else {
|
||||||
reject(new Error(res.message))
|
reject(new Error(res.msg))
|
||||||
|
this.$modal.msgError(res.msg)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
reject(new Error('表单验证失败'))
|
reject(new Error('表单验证失败'))
|
||||||
|
|
@ -390,5 +402,52 @@ export default {
|
||||||
this.$refs.addOrEditFormRef.resetFields()
|
this.$refs.addOrEditFormRef.resetFields()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
editFormData: {
|
||||||
|
handler(newVal) {
|
||||||
|
if (Object.keys(newVal).length > 0) {
|
||||||
|
// this.addOrEditForm = newVal
|
||||||
|
console.log(newVal, 'newVal')
|
||||||
|
|
||||||
|
const {
|
||||||
|
mainProId,
|
||||||
|
orgId,
|
||||||
|
proName,
|
||||||
|
simpleName,
|
||||||
|
proType,
|
||||||
|
volLevel,
|
||||||
|
isShanghai,
|
||||||
|
proStatus,
|
||||||
|
proAddress,
|
||||||
|
startTime,
|
||||||
|
endTime,
|
||||||
|
lon,
|
||||||
|
lat,
|
||||||
|
id,
|
||||||
|
} = newVal
|
||||||
|
|
||||||
|
this.addOrEditForm = {
|
||||||
|
mainProId,
|
||||||
|
orgId,
|
||||||
|
proName,
|
||||||
|
simpleName,
|
||||||
|
proType,
|
||||||
|
volLevel,
|
||||||
|
isShanghai,
|
||||||
|
proStatus,
|
||||||
|
proAddress,
|
||||||
|
startTime,
|
||||||
|
endTime,
|
||||||
|
lon,
|
||||||
|
lat,
|
||||||
|
id,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@ export const formLabel = [
|
||||||
]
|
]
|
||||||
|
|
||||||
export const columnsList = [
|
export const columnsList = [
|
||||||
{ t_props: 'projectName', t_label: '所属总工程' },
|
{ t_props: 'mainProName', t_label: '所属总工程' },
|
||||||
{ t_props: 'xmb', t_label: '所属项目部' },
|
{ t_props: 'orgName', t_label: '所属项目部' },
|
||||||
{ t_props: 'proName', t_label: '工程名称' },
|
{ t_props: 'proName', t_label: '工程名称' },
|
||||||
{ t_props: 'proType', t_label: '工程类型' },
|
{ t_props: 'proType', t_label: '工程类型' },
|
||||||
{ t_props: 'volLevel', t_label: '电压等级' },
|
{ t_props: 'volLevel', t_label: '电压等级' },
|
||||||
|
|
@ -41,36 +41,6 @@ export const columnsList = [
|
||||||
{ t_props: 'proStatus', t_label: '状态' },
|
{ t_props: 'proStatus', t_label: '状态' },
|
||||||
]
|
]
|
||||||
|
|
||||||
export const testTableList = [
|
|
||||||
{
|
|
||||||
projectName: '总工程名称',
|
|
||||||
level: '等级3',
|
|
||||||
xmb: 'xxx项目部',
|
|
||||||
name: '110kv工程',
|
|
||||||
type: '基建变电',
|
|
||||||
address: '安徽省合肥市110k工程',
|
|
||||||
status: '在建',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
projectName: '总工程名称21',
|
|
||||||
level: '等级3',
|
|
||||||
xmb: 'xxx项目部',
|
|
||||||
name: '110kv工程',
|
|
||||||
type: '基建变电',
|
|
||||||
address: '安徽省合肥市110k工程',
|
|
||||||
status: '在建',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
projectName: '总工程名称3',
|
|
||||||
level: '等级3',
|
|
||||||
xmb: 'xxx项目部',
|
|
||||||
name: '110kv工程',
|
|
||||||
type: '基建变电',
|
|
||||||
address: '安徽省合肥市110k工程',
|
|
||||||
status: '在建',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
export const dialogConfig = {
|
export const dialogConfig = {
|
||||||
outerVisible: false,
|
outerVisible: false,
|
||||||
outerTitle: '',
|
outerTitle: '',
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,8 @@
|
||||||
:formLabel="formLabel"
|
:formLabel="formLabel"
|
||||||
:showOperation="true"
|
:showOperation="true"
|
||||||
:showRightTools="true"
|
:showRightTools="true"
|
||||||
ref="allProjectTableRef"
|
ref="lotProjectTableRef"
|
||||||
:columnsList="columnsList"
|
:columnsList="columnsList"
|
||||||
:testTableList="testTableList"
|
|
||||||
:request-api="getLotLotProjectListAPI"
|
:request-api="getLotLotProjectListAPI"
|
||||||
>
|
>
|
||||||
<template slot="btn" slot-scope="{ queryParams }">
|
<template slot="btn" slot-scope="{ queryParams }">
|
||||||
|
|
@ -78,7 +77,10 @@
|
||||||
@closeDialogOuter="handleCloseDialogOuter"
|
@closeDialogOuter="handleCloseDialogOuter"
|
||||||
>
|
>
|
||||||
<template slot="outerContent">
|
<template slot="outerContent">
|
||||||
<AddOrEditForm ref="addOrEditFormContentRef" />
|
<AddOrEditForm
|
||||||
|
:editFormData="editFormData"
|
||||||
|
ref="addOrEditLotProjectFormRef"
|
||||||
|
/>
|
||||||
|
|
||||||
<el-row class="dialog-footer-btn">
|
<el-row class="dialog-footer-btn">
|
||||||
<el-button size="medium" @click="handleCloseDialogOuter">
|
<el-button size="medium" @click="handleCloseDialogOuter">
|
||||||
|
|
@ -101,7 +103,7 @@
|
||||||
import TableModel from '@/components/TableModel'
|
import TableModel from '@/components/TableModel'
|
||||||
import DialogModel from '@/components/DialogModel'
|
import DialogModel from '@/components/DialogModel'
|
||||||
import AddOrEditForm from './add-or-edit-form'
|
import AddOrEditForm from './add-or-edit-form'
|
||||||
import { formLabel, columnsList, dialogConfig, testTableList } from './config'
|
import { formLabel, columnsList, dialogConfig } from './config'
|
||||||
import {
|
import {
|
||||||
deleteLotLotProjectAPI,
|
deleteLotLotProjectAPI,
|
||||||
getLotLotProjectListAPI,
|
getLotLotProjectListAPI,
|
||||||
|
|
@ -120,7 +122,8 @@ export default {
|
||||||
formLabel,
|
formLabel,
|
||||||
columnsList,
|
columnsList,
|
||||||
dialogConfig,
|
dialogConfig,
|
||||||
testTableList,
|
editFormData: {},
|
||||||
|
|
||||||
getLotLotProjectListAPI,
|
getLotLotProjectListAPI,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -134,6 +137,43 @@ export default {
|
||||||
onHandleAddOrEditAllProject(type, data) {
|
onHandleAddOrEditAllProject(type, data) {
|
||||||
this.dialogConfig.outerTitle =
|
this.dialogConfig.outerTitle =
|
||||||
type === 1 ? '新增标段工程' : '修改标段工程'
|
type === 1 ? '新增标段工程' : '修改标段工程'
|
||||||
|
|
||||||
|
if (type === 2) {
|
||||||
|
const {
|
||||||
|
mainProId,
|
||||||
|
orgId,
|
||||||
|
proName,
|
||||||
|
simpleName,
|
||||||
|
proType,
|
||||||
|
volLevel,
|
||||||
|
isShanghai,
|
||||||
|
proStatus,
|
||||||
|
proAddress,
|
||||||
|
startTime,
|
||||||
|
endTime,
|
||||||
|
lon,
|
||||||
|
lat,
|
||||||
|
id,
|
||||||
|
} = data
|
||||||
|
this.editFormData = {
|
||||||
|
mainProId,
|
||||||
|
orgId,
|
||||||
|
proName,
|
||||||
|
simpleName,
|
||||||
|
proType,
|
||||||
|
volLevel,
|
||||||
|
isShanghai,
|
||||||
|
proStatus,
|
||||||
|
proAddress,
|
||||||
|
startTime,
|
||||||
|
endTime,
|
||||||
|
lon,
|
||||||
|
lat,
|
||||||
|
id,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.editFormData = {}
|
||||||
|
}
|
||||||
this.dialogConfig.outerVisible = true
|
this.dialogConfig.outerVisible = true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -203,10 +243,12 @@ export default {
|
||||||
|
|
||||||
// 确定按钮
|
// 确定按钮
|
||||||
async onHandleConfirmAddOrEdit() {
|
async onHandleConfirmAddOrEdit() {
|
||||||
this.$refs.addOrEditFormContentRef.formType =
|
// this.$refs.addOrEditLotProjectFormRef.formType =
|
||||||
this.dialogConfig.outerTitle === '新增标段工程' ? 1 : 2
|
// this.dialogConfig.outerTitle === '新增标段工程' ? 1 : 2
|
||||||
try {
|
try {
|
||||||
await this.$refs.addOrEditFormContentRef.onHandleConfirmAddOrEditFun()
|
await this.$refs.addOrEditLotProjectFormRef.onHandleConfirmAddOrEditFun()
|
||||||
|
this.handleCloseDialogOuter()
|
||||||
|
this.$refs.lotProjectTableRef.getTableList() // 更新列表
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('表单提交失败', error)
|
console.log('表单提交失败', error)
|
||||||
}
|
}
|
||||||
|
|
@ -214,7 +256,7 @@ export default {
|
||||||
|
|
||||||
// 关闭弹框
|
// 关闭弹框
|
||||||
handleCloseDialogOuter() {
|
handleCloseDialogOuter() {
|
||||||
this.$refs.addOrEditFormContentRef.resetForm()
|
this.$refs.addOrEditLotProjectFormRef.resetForm()
|
||||||
this.dialogConfig.outerVisible = false
|
this.dialogConfig.outerVisible = false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,331 @@
|
||||||
|
<template>
|
||||||
|
<!-- 新增或修改标段工程表单 -->
|
||||||
|
<div>
|
||||||
|
<!-- 合同信息表单 -->
|
||||||
|
<el-form
|
||||||
|
label-width="140px"
|
||||||
|
ref="contractInfoFormRef"
|
||||||
|
:model="contractInfoForm"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="合同见证照片" prop="businessLicense">
|
||||||
|
<div style="display: flex; gap: 10px">
|
||||||
|
<div
|
||||||
|
class="contract-img-box"
|
||||||
|
v-for="item in contractImageList"
|
||||||
|
:key="item.title"
|
||||||
|
>
|
||||||
|
<UploadImgFormData
|
||||||
|
:key="item.title"
|
||||||
|
:limit="1"
|
||||||
|
:file-size="10"
|
||||||
|
:multiple="true"
|
||||||
|
:is-detail="formType === 2"
|
||||||
|
:file-type="['jpg', 'png', 'jpeg']"
|
||||||
|
:file-list.sync="item.fileList"
|
||||||
|
:is-uploaded="item.fileList.length >= 1"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<span> {{ item.title }} </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="合同编号" prop="contractCode">
|
||||||
|
<el-input
|
||||||
|
clearable
|
||||||
|
placeholder="请输入合同编号"
|
||||||
|
v-model="contractInfoForm.contractCode"
|
||||||
|
/>
|
||||||
|
</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-input
|
||||||
|
clearable
|
||||||
|
placeholder="请输入工资核定标准"
|
||||||
|
v-model="contractInfoForm.wageCriterion"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="附件" prop="phone">
|
||||||
|
<!-- <el-input
|
||||||
|
clearable
|
||||||
|
placeholder="请输入附件"
|
||||||
|
v-model="contractInfoForm.phone"
|
||||||
|
/> -->
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import UploadImg from '@/components/UploadImg'
|
||||||
|
import UploadImgFormData from '@/components/UploadImgFormData'
|
||||||
|
import {
|
||||||
|
uploadContractAPI,
|
||||||
|
getContractDetailAPI,
|
||||||
|
} from '@/api/construction-person/red-green-light-mange/contract-witness'
|
||||||
|
export default {
|
||||||
|
name: 'AddOrEditForm',
|
||||||
|
props: {
|
||||||
|
queryDetailsId: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
einStatus: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
formType: {
|
||||||
|
type: Number,
|
||||||
|
default: 1,
|
||||||
|
},
|
||||||
|
|
||||||
|
workerId: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: '', // 人员id
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
UploadImg,
|
||||||
|
UploadImgFormData,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 合同信息表单
|
||||||
|
contractInfoForm: {
|
||||||
|
contractCode: '', // 合同编号
|
||||||
|
contractTermType: '以完成一定工作为期限的合同', // 合同期限类型
|
||||||
|
contractStartDate: '', // 合同签订日期
|
||||||
|
contractStopDate: '', // 合同终止日期
|
||||||
|
wageApprovedWay: '天', // 工资核定方式
|
||||||
|
wageCriterion: '', // 工资核定标准
|
||||||
|
},
|
||||||
|
|
||||||
|
addOrEditForm: {
|
||||||
|
name: '', // 姓名
|
||||||
|
idNumber: '', // 身份证号
|
||||||
|
sex: '', // 性别
|
||||||
|
birthday: '', // 出生日期
|
||||||
|
nation: '', // 民族
|
||||||
|
issuingAuthority: '', // 签发机关
|
||||||
|
startTime: '', // 生效日期
|
||||||
|
endTime: '', // 失效日期
|
||||||
|
address: '', // 身份证住址
|
||||||
|
subName: '', // 分包商名称
|
||||||
|
legalRepresentative: '', // 法定代表人
|
||||||
|
phone: '', // 联系电话
|
||||||
|
businessAddress: '', // 营业住址
|
||||||
|
|
||||||
|
businessLicense: [], // 营业执照
|
||||||
|
electronicStamp: [], // 电子公章
|
||||||
|
idCard: [], // 身份证正反面
|
||||||
|
electronicSignature: [], // 电子签名/法人印章
|
||||||
|
},
|
||||||
|
contractImageList: [
|
||||||
|
{
|
||||||
|
title: '人员手持合同照',
|
||||||
|
type: 1,
|
||||||
|
fileList: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '工作内容页',
|
||||||
|
type: 2,
|
||||||
|
fileList: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '薪酬约定页',
|
||||||
|
type: 3,
|
||||||
|
fileList: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '本人签名页',
|
||||||
|
type: 4,
|
||||||
|
fileList: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '其他照片',
|
||||||
|
type: 5,
|
||||||
|
fileList: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 确定按钮
|
||||||
|
onHandleConfirmAddOrEditFun() {
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
console.log(this.contractImageList, 'contractImageList')
|
||||||
|
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 入场工程选择
|
||||||
|
onChangeProId(val) {
|
||||||
|
this.keyInfoForm.proName = this.proSelectList.find(
|
||||||
|
(item) => item.value === val,
|
||||||
|
).label
|
||||||
|
},
|
||||||
|
// 工种选择
|
||||||
|
onChangePostId(val) {
|
||||||
|
this.keyInfoForm.postName = this.postSelectList.find(
|
||||||
|
(item) => item.value === val,
|
||||||
|
).label
|
||||||
|
},
|
||||||
|
// 入场分包选择
|
||||||
|
onChangeSubId(val) {
|
||||||
|
this.keyInfoForm.subName = this.subSelectList.find(
|
||||||
|
(item) => item.value === val,
|
||||||
|
).label
|
||||||
|
},
|
||||||
|
// 入场班组选择
|
||||||
|
onChangeTeamId(val) {
|
||||||
|
this.keyInfoForm.teamName = this.teamSelectList.find(
|
||||||
|
(item) => item.value === val,
|
||||||
|
).label
|
||||||
|
},
|
||||||
|
|
||||||
|
// 重置表单
|
||||||
|
resetForm() {},
|
||||||
|
|
||||||
|
// 获取合同详情
|
||||||
|
async getContractDetail() {
|
||||||
|
console.log(this.queryDetailsId, 'queryDetailsId 合同详情')
|
||||||
|
const { data: res } = await getContractDetailAPI(
|
||||||
|
this.queryDetailsId,
|
||||||
|
)
|
||||||
|
|
||||||
|
if (res.length > 0) {
|
||||||
|
const {
|
||||||
|
contractCode,
|
||||||
|
contractTermType,
|
||||||
|
contractStartDate,
|
||||||
|
contractStopDate,
|
||||||
|
wageApprovedWay,
|
||||||
|
wageCriterion,
|
||||||
|
} = res[0]
|
||||||
|
|
||||||
|
this.contractInfoForm = {
|
||||||
|
contractCode,
|
||||||
|
contractTermType,
|
||||||
|
contractStartDate,
|
||||||
|
contractStopDate,
|
||||||
|
wageApprovedWay,
|
||||||
|
wageCriterion,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/styles/variables.scss';
|
||||||
|
.contract-img-box {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 14px;
|
||||||
|
color: $red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
>
|
>
|
||||||
<template slot="outerContent">
|
<template slot="outerContent">
|
||||||
<template v-if="dialogConfig.outerTitle === '合同见证'">
|
<template v-if="dialogConfig.outerTitle === '合同见证'">
|
||||||
<AddOrEditForm
|
<ContractWitnessUpload
|
||||||
:formType="formType"
|
:formType="formType"
|
||||||
:workerId="workerId"
|
:workerId="workerId"
|
||||||
:einStatus="einStatus"
|
:einStatus="einStatus"
|
||||||
|
|
@ -123,7 +123,7 @@
|
||||||
<script>
|
<script>
|
||||||
import TableModel from '@/components/TableModel'
|
import TableModel from '@/components/TableModel'
|
||||||
import DialogModel from '@/components/DialogModel'
|
import DialogModel from '@/components/DialogModel'
|
||||||
import AddOrEditForm from './add-or-edit-form' // 合同上传
|
import ContractWitnessUpload from './contract-witness-upload' // 合同上传
|
||||||
import ContractDetailsList from './contract-details-list.vue' // 合同详情列表
|
import ContractDetailsList from './contract-details-list.vue' // 合同详情列表
|
||||||
import { formLabel, columnsList, dialogConfig } from './config'
|
import { formLabel, columnsList, dialogConfig } from './config'
|
||||||
import { getPersonContractListAPI } from '@/api/construction-person/red-green-light-mange/contract-witness'
|
import { getPersonContractListAPI } from '@/api/construction-person/red-green-light-mange/contract-witness'
|
||||||
|
|
@ -132,8 +132,8 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
TableModel,
|
TableModel,
|
||||||
DialogModel,
|
DialogModel,
|
||||||
AddOrEditForm,
|
|
||||||
ContractDetailsList,
|
ContractDetailsList,
|
||||||
|
ContractWitnessUpload,
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
export const formLabel = [
|
||||||
|
{
|
||||||
|
f_label: '姓名',
|
||||||
|
f_model: 'name',
|
||||||
|
f_type: 'ipt',
|
||||||
|
f_width: '180px',
|
||||||
|
isShow: false, // 是否展示label
|
||||||
|
},
|
||||||
|
{
|
||||||
|
f_label: '身份证',
|
||||||
|
f_model: 'idNumber',
|
||||||
|
f_type: 'ipt',
|
||||||
|
f_width: '180px',
|
||||||
|
isShow: false, // 是否展示label
|
||||||
|
},
|
||||||
|
{
|
||||||
|
f_label: '联系方式',
|
||||||
|
f_model: 'phone',
|
||||||
|
f_type: 'ipt',
|
||||||
|
f_width: '180px',
|
||||||
|
isShow: false, // 是否展示label
|
||||||
|
},
|
||||||
|
{
|
||||||
|
f_label: '银行卡号',
|
||||||
|
f_model: 'phone',
|
||||||
|
f_type: 'ipt',
|
||||||
|
f_width: '180px',
|
||||||
|
isShow: false, // 是否展示label
|
||||||
|
},
|
||||||
|
{
|
||||||
|
f_label: '状态',
|
||||||
|
f_model: 'einStatus',
|
||||||
|
f_type: 'sel',
|
||||||
|
f_width: '180px',
|
||||||
|
isShow: false, // 是否展示label
|
||||||
|
f_selList: [
|
||||||
|
{
|
||||||
|
label: '已上传',
|
||||||
|
value: '1',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '未上传',
|
||||||
|
value: '2',
|
||||||
|
},
|
||||||
|
], // 状态列表
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
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: 'subName',
|
||||||
|
t_label: '银行名称',
|
||||||
|
},
|
||||||
|
{ t_props: 'teamName', t_label: '银行支行名称' },
|
||||||
|
{
|
||||||
|
t_label: '工资卡见证',
|
||||||
|
t_slot: 'view',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
t_label: '状态',
|
||||||
|
t_slot: 'isSign',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
t_props: 'updateTime',
|
||||||
|
t_label: '更新时间',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
export const dialogConfig = {
|
||||||
|
outerVisible: false,
|
||||||
|
outerTitle: '',
|
||||||
|
outerWidth: '80%',
|
||||||
|
minHeight: '',
|
||||||
|
maxHeight: '',
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,265 @@
|
||||||
<template>
|
<template>
|
||||||
|
<!-- 施工人员 ---- 红绿灯管理 ---- 工资卡见证 -->
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<h1>工资卡见证</h1>
|
<TableModel
|
||||||
|
:formLabel="formLabel"
|
||||||
|
:showOperation="true"
|
||||||
|
:showRightTools="true"
|
||||||
|
:columnsList="columnsList"
|
||||||
|
ref="wageCardWitnessTableRef"
|
||||||
|
:request-api="getPersonContractListAPI"
|
||||||
|
>
|
||||||
|
<template slot="btn" slot-scope="{ queryParams }">
|
||||||
|
<el-button
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-download"
|
||||||
|
@click="onHandleExportWageCard(queryParams)"
|
||||||
|
>
|
||||||
|
导出
|
||||||
|
</el-button>
|
||||||
|
</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">
|
||||||
|
已上传
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- 查看 -->
|
||||||
|
|
||||||
|
<template slot="view" slot-scope="{ data }">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="onHandleViewWageCardImg(data)"
|
||||||
|
>
|
||||||
|
查看
|
||||||
|
</el-button>
|
||||||
|
</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)"
|
||||||
|
>
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</TableModel>
|
||||||
|
|
||||||
|
<DialogModel
|
||||||
|
:dialogConfig="dialogConfig"
|
||||||
|
@closeDialogOuter="handleCloseDialogOuter"
|
||||||
|
>
|
||||||
|
<template slot="outerContent">
|
||||||
|
<template v-if="dialogConfig.outerTitle === '工资卡见证'">
|
||||||
|
<WageCardUpload
|
||||||
|
:formType="formType"
|
||||||
|
:workerId="workerId"
|
||||||
|
:einStatus="einStatus"
|
||||||
|
ref="uploadContractContentRef"
|
||||||
|
:queryDetailsId="queryDetailsId"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-row class="dialog-footer-btn">
|
||||||
|
<el-button
|
||||||
|
size="medium"
|
||||||
|
@click="handleCloseDialogOuter"
|
||||||
|
>
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="medium"
|
||||||
|
type="primary"
|
||||||
|
@click="onHandleConfirmAddOrEdit"
|
||||||
|
>
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-if="dialogConfig.outerTitle === '工资卡图片详情'">
|
||||||
|
<el-image
|
||||||
|
:src="contractImgList[0]"
|
||||||
|
:preview-src-list="contractImgList"
|
||||||
|
style="width: 454px; height: 390px"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</DialogModel>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {}
|
import TableModel from '@/components/TableModel'
|
||||||
</script>
|
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'
|
||||||
|
export default {
|
||||||
|
name: 'WageCardWitness',
|
||||||
|
components: {
|
||||||
|
TableModel,
|
||||||
|
DialogModel,
|
||||||
|
WageCardUpload,
|
||||||
|
},
|
||||||
|
|
||||||
<style></style>
|
data() {
|
||||||
|
return {
|
||||||
|
formLabel,
|
||||||
|
columnsList,
|
||||||
|
dialogConfig,
|
||||||
|
getPersonContractListAPI,
|
||||||
|
queryDetailsId: '', // 查询详情id
|
||||||
|
einStatus: 1, // 在场状态
|
||||||
|
formType: 1, // 表单类型
|
||||||
|
workerId: '', // 人员id
|
||||||
|
|
||||||
|
slots: {
|
||||||
|
businessLicense: 'businessLicense',
|
||||||
|
idCard: 'idCard',
|
||||||
|
electronicStamp: 'electronicStamp',
|
||||||
|
electronicSignature: 'electronicSignature',
|
||||||
|
},
|
||||||
|
|
||||||
|
contractImgList: [
|
||||||
|
'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
|
||||||
|
'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
|
||||||
|
], // 合同图片列表
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 导出按钮
|
||||||
|
onHandleExportWageCard(queryParams) {
|
||||||
|
console.log(queryParams, '导出参数')
|
||||||
|
// this.download(
|
||||||
|
// '/xxx/xxx',
|
||||||
|
// {
|
||||||
|
// ...queryParams,
|
||||||
|
// },
|
||||||
|
// '合同信息.xlsx',
|
||||||
|
// )
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增或修改
|
||||||
|
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('确定删除该人员吗?', '温馨提示', {
|
||||||
|
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.$confirm(
|
||||||
|
'当前已上传工资卡信息,是否要重新上传,重新上传将会覆盖原数据?',
|
||||||
|
'温馨提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.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.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 = '80%'
|
||||||
|
this.dialogConfig.outerVisible = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查看合同图片详情
|
||||||
|
onHandleViewWageCardImg(data) {
|
||||||
|
this.dialogConfig.outerTitle = '工资卡图片详情'
|
||||||
|
this.dialogConfig.minHeight = '500px'
|
||||||
|
this.dialogConfig.maxHeight = '500px'
|
||||||
|
this.dialogConfig.outerWidth = '500px'
|
||||||
|
this.dialogConfig.outerVisible = true
|
||||||
|
},
|
||||||
|
|
||||||
|
// 确定按钮
|
||||||
|
async onHandleConfirmAddOrEdit() {
|
||||||
|
try {
|
||||||
|
await this.$refs.uploadContractContentRef.onHandleConfirmAddOrEditFun()
|
||||||
|
this.$refs.wageCardWitnessTableRef.getTableList()
|
||||||
|
this.handleCloseDialogOuter()
|
||||||
|
} catch (error) {
|
||||||
|
console.log('表单提交失败', error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 关闭弹框
|
||||||
|
handleCloseDialogOuter() {
|
||||||
|
this.dialogConfig.outerVisible = false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue