@ -1,7 +1,6 @@
< template >
< div class = "p-2" >
< transition :enter-active-class = "proxy?.animate.searchAnimate.enter"
:leave-active-class = "proxy?.animate.searchAnimate.leave" >
< transition :enter-active-class = "proxy?.animate.searchAnimate.enter" :leave-active-class = "proxy?.animate.searchAnimate.leave" >
< div v-show = "showSearch" class="mb-[10px]" >
< el -card shadow = "hover" >
< el-form ref = "queryFormRef" :model = "queryParams" :inline = "true" >
@ -46,43 +45,59 @@
< template # header >
< el-row :gutter = "10" class = "mb8" >
< el-col :span = "1.5" >
< el-button type = "primary" plain icon = "Plus" @click ="handleAdd"
v-hasPermi = "['contractor:constructionUser:add']" > 新增 < / el -button >
< el-button type = "primary" plain icon = "Plus" @click ="handleAdd" v-hasPermi = "['contractor:constructionUser:add']" > 新增 < / el -button >
< / el-col >
< el-col :span = "1.5" >
< el-button type = "danger" plain icon = "Delete" :disabled = "multiple" @click ="handleDelete()"
v-hasPermi = "['contractor:constructionUser:remove']" >
< el-button
type = "danger"
plain
icon = "Delete"
:disabled = "multiple"
@click ="handleDelete()"
v-hasPermi = "['contractor:constructionUser:remove']"
>
删除
< / el-button >
< / el-col >
< el-col :span = "1.5" >
< el-button type = "warning" plain icon = "Download" @click ="handleExport"
v-hasPermi = "['contractor:constructionUser:export']" > 导出
< el-button type = "warning" plain icon = "Download" @click ="handleExport" v-hasPermi = "['contractor:constructionUser:export']"
> 导出
< / el-button >
< / el-col >
< el-col :span = "1.5" >
< el-button type = "warning" plain icon = "Edit" :disabled = "multiple" @click ="statusDialog = true" > 用户状态编辑
< / el -button >
< el-button type = "warning" plain icon = "Edit" :disabled = "multiple" @click ="statusDialog = true" > 用户状态编辑 < / el -button >
< / el-col >
< el-col :span = "1.5" >
< el-switch v-model = "playCardStatus" class="ml-2" inline -prompt
style = "--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" :loading = "playCardLoding "
@change ="handlePlayCardStatus" inactive -text = " 一键关闭打卡 " active -text = " 一键开启打卡 " / >
< el-switch
v-model = "playCardStatus "
class = "ml-2"
inline -prompt
style = "--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
:loading = "playCardLoding"
@change ="handlePlayCardStatus"
inactive -text = " 一键关闭打卡 "
active -text = " 一键开启打卡 "
/ >
< / el-col >
< el-row @mouseover ="informationStatus = true" :gutter = "10" @mouseout ="informationStatus = false" >
< el -col :span = "1.5" >
< el-button type = "success" plain > 员工资料 < / el-button >
< / el-col >
< el-col :span = "1.5" v-show = "informationStatus" >
< el -button type = "primary" plain icon = "Edit" @click ="downloadTemplate"
v-hasPermi = "['contractor:constructionUserFile:download']" > 下载资料模板
< el -button type = "primary" plain icon = "Edit" @click ="downloadTemplate" v-hasPermi = "['contractor:constructionUserFile:download']"
> 下载资料模板
< / el-button >
< / el-col >
< el-col :span = "1.5" v-show = "informationStatus" >
< file -upload v-model = "filePath" isImportInfo :isShowTip="false"
uploadUrl = "/project/constructionUserFile/upload/zip" :limit = "1" :file-size = "50" >
< el-button type = "warning" plain icon = "Edit"
v-hasPermi = "['contractor:constructionUserFile:upload']" > 导入员工资料 < / el -button >
< file -upload
v-model = "filePath"
isImportInfo
:isShowTip = "false"
uploadUrl = "/project/constructionUserFile/upload/zip"
:limit = "1"
:file-size = "50"
>
< el-button type = "warning" plain icon = "Edit" v-hasPermi = "['contractor:constructionUserFile:upload']" > 导入员工资料 < / el -button >
< / file-upload >
< / el-col >
< / el-row >
@ -120,9 +135,18 @@
< / el-table-column >
< el-table-column label = "打卡状态" align = "center" prop = "clock" >
< template # default = "scope" >
< el-switch v-model = "scope.row.clock" class="ml-2" inline -prompt
style = "--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" active -text = " 开启 " inactive -text = " 禁用 "
:loading = "playCardLoding" active -value = " 0 " inactive -value = " 1 " @change ="handleClockStatus(scope.row)" / >
< el-switch
v-model = "scope.row.clock"
class = "ml-2"
inline -prompt
style = "--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
active -text = " 开启 "
inactive -text = " 禁用 "
:loading = "playCardLoding"
active -value = " 0 "
inactive -value = " 1 "
@change ="handleClockStatus(scope.row)"
/ >
< / template >
< / el-table-column >
< el-table-column label = "薪水" align = "center" min -width = " 180 " >
@ -131,8 +155,7 @@
{ { scope . row . salary ? scope . row . salary : scope . row . standardSalary } }
( < dict-tag :options = "wage_measure_unit_type" :value = "scope.row.wageMeasureUnit" > < / dict-tag > )
< / span >
< div class = "text-blue text-sm cursor-pointer" @click ="openSalaryDialog(scope.row)" > {{ scope.row.salary ?
' 取消变更 ' : ' 变更 ' }} < / div >
< div class = "text-blue text-sm cursor-pointer" @click ="openSalaryDialog(scope.row)" > {{ scope.row.salary ? ' 取消变更 ' : ' 变更 ' }} < / div >
< / template >
< / el -table -column >
< el-table-column label = "入场时间" align = "center" prop = "entryDate" min -width = " 180 " / >
@ -146,30 +169,31 @@
< el-table-column label = "操作" align = "center" class -name = " small -padding fixed -width " fixed = "right" min -width = " 300 " >
< template # default = "scope" >
< el-space wrap >
< el-button link type = "primary" icon = "View" @click ="handleShowDrawer(scope.row)"
v-hasPermi = "['contractor:constructionUser:query']" >
< el-button link type = "primary" icon = "View" @click ="handleShowDrawer(scope.row)" v-hasPermi = "['contractor:constructionUser:query']" >
详情
< / el -button >
< el-button link type = "success" icon = "Edit" @click ="handleUpdate(scope.row)"
v-hasPermi = "['contractor:constructionUser:edit']" >
< el-button link type = "success" icon = "Edit" @click ="handleUpdate(scope.row)" v-hasPermi = "['contractor:constructionUser:edit']" >
修改
< / el -button >
< el-button link type = "warning" icon = "Female" @click ="handlePlayCard(scope.row)" > 打卡 < / el -button >
< el-button link type = "danger" icon = "Avatar" @click ="handleJoinBlacklist(scope.row)"
v-hasPermi = "['contractor:constructionBlacklist:add']" >
< el-button
link
type = "danger"
icon = "Avatar"
@click ="handleJoinBlacklist(scope.row)"
v-hasPermi = "['contractor:constructionBlacklist:add']"
>
黑名单
< / el-button >
<!-- < el-button link type = "primary" icon = "Switch" @click ="handleToggle(scope.row)" > 切换人脸 < / el -button > -- >
< el-button link type = "primary" icon = "Switch" @click ="handleChange(scope.row)" > 人员迁移 < / el -button >
< el-button link type = "primary" icon = "Switch" @click ="handleAssign(scope.row)" > 分配班组 < / el -button >
< el-button link type = "primary" icon = "ChatLineSquare" @click ="handleExit(scope.row)" > 入退场记录 < / el -button >
< el-button link type = "danger" icon = "Delete" @click ="handleDelete(scope.row)"
v-hasPermi = "['contractor:constructionUser:remove']" >
< el-button link type = "danger" icon = "Delete" @click ="handleDelete(scope.row)" v-hasPermi = "['contractor:constructionUser:remove']" >
删除
< / el -button >
< el-tooltip content = "红点:部分上传,绿点:已上传,无点:未上传" placement = "right" effect = "dark" >
< el-badge : is -dot = " scope.row.fileUploadStatus ! = ' 1 ' "
:type = "uploadStatusColor(scope.row.fileUploadStatus)" >
< el-badge : is -dot = " scope.row.fileUploadStatus ! = ' 1 ' " :type = "uploadStatusColor(scope.row.fileUploadStatus)" >
< el-button link type = "primary" icon = "FolderAdd" @click ="handleUpload(scope.row)" > 文件上传 < / el -button >
< / el-badge >
< / el-tooltip >
@ -178,8 +202,7 @@
< / el-table-column >
< / el-table >
< pagination v-show = "total > 0" :total="total" v-model:page="queryParams.pageNum"
v -model :limit = "queryParams.pageSize" @pagination ="getList" / >
< pagination v-show = "total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" / >
< / el-card >
<!-- 添加或修改施工人员对话框 -- >
< el-dialog draggable :title = "dialog.title" v-model = "dialog.visible" width="930px" append -to -body >
@ -194,12 +217,12 @@
< / div >
< div class = "el-col el-col-12" >
< el-form-item label = "身份证正面图片" prop = "sfzFrontPic" >
< image-upload v-model = "form.sfzFrontPic" :limit="1" :is-show-tip="false" / >
< image-upload v-model = "form.sfzFrontPic" :limit="1" :is-show-tip="false" :idCardType="'front'" @success="handleUploadSuccess" / >
< / el-form-item >
< / div >
< div class = "el-col el-col-12" >
< el-form-item label = "身份证背面图片" prop = "sfzBackPic" >
< image-upload v-model = "form.sfzBackPic" :limit="1" :is-show-tip="false" / >
< image-upload v-model = "form.sfzBackPic" :limit="1" :is-show-tip="false" :idCardType="'back'" @success="handleUploadSuccessBack" / >
< / el-form-item >
< / div >
< div class = "el-col el-col-12" >
@ -231,14 +254,12 @@
< / div >
< div class = "el-col el-col-12" >
< el-form-item label = "身份证有效开始期" prop = "sfzStart" >
< el-date-picker clearable v-model = "form.sfzStart" type="date" value-format="YYYY-MM-DD"
placeholder = "请输入身份证有效开始期" / >
< el-date-picker clearable v-model = "form.sfzStart" type="date" value-format="YYYY-MM-DD" placeholder="请输入身份证有效开始期" / >
< / el-form-item >
< / div >
< div class = "el-col el-col-12" >
< el-form-item label = "身份证有效结束期" prop = "sfzEnd" >
< el-date-picker clearable v-model = "form.sfzEnd" type="date" value-format="YYYY-MM-DD"
placeholder = "请输入身份证有效结束期" / >
< el-date-picker clearable v-model = "form.sfzEnd" type="date" value-format="YYYY-MM-DD" placeholder="请输入身份证有效结束期" / >
< / el-form-item >
< / div >
< div class = "el-col el-col-12" >
@ -248,8 +269,7 @@
< / div >
< div class = "el-col el-col-12" >
< el-form-item label = "身份证出生日期" prop = "sfzBirth" >
< el-date-picker clearable v-model = "form.sfzBirth" type="date" value-format="YYYY-MM-DD"
placeholder = "请输入身份证出生日期" / >
< el-date-picker clearable v-model = "form.sfzBirth" type="date" value-format="YYYY-MM-DD" placeholder="请输入身份证出生日期" / >
< / el-form-item >
< / div >
< div class = "el-col el-col-12" >
@ -264,7 +284,7 @@
< div class = "el-row" >
< div class = "el-col el-col-24" >
< el-form-item label = "银行图片" prop = "yhkPic" >
< image-upload v-model = "form.yhkPic" :limit="1" :is-show-tip="false" / >
< image-upload v-model = "form.yhkPic" :limit="1" :is-show-tip="false" :idCardType="'bank'" @success="handleUploadSuccessBank" / >
< / el-form-item >
< / div >
< div class = "el-col el-col-12" >
@ -302,16 +322,14 @@
< div class = "el-col el-col-12" >
< el-form-item label = "打卡" prop = "clock" >
< el-select v-model = "form.clock" clearable placeholder="请选择打卡状态" >
< el -option v-for = "item in user_clock_type" :key="item.value" :label="item.label"
:value = "item.value" / >
< el -option v-for = "item in user_clock_type" :key="item.value" :label="item.label" :value="item.value" / >
< / el-select >
< / el-form-item >
< / div >
< div class = "el-col el-col-12" >
< el-form-item label = "结算方式" prop = "wageMeasureUnit" >
< el-select v-model = "form.wageMeasureUnit" clearable placeholder="请选择结算方式" >
< el -option v-for = "item in wage_measure_unit_type" :key="item.value" :label="item.label"
:value = "item.value" / >
< el -option v-for = "item in wage_measure_unit_type" :key="item.value" :label="item.label" :value="item.value" / >
< / el-select >
< / el-form-item >
< / div >
@ -340,8 +358,7 @@
< / el-select >
< / el-form-item >
< el-form-item label = "分包单位" label -width = " 130px " >
< el-select v-model = "skipObject.contractorId" :disabled="!skipObject.projectId" placeholder="请选择分包单位"
style = "width: 240px" >
< el-select v-model = "skipObject.contractorId" :disabled="!skipObject.projectId" placeholder="请选择分包单位" style="width: 240px" >
< el -option v-for = "item in contractorList" :key="item.id" :label="item.name" :value="item.id" / >
< / el-select >
< / el-form-item >
@ -356,8 +373,7 @@
< div class = "image_upload" v-for = "(item, index) in uploadPath" :key="item.value" >
< div class = "title" > { { item . label } } < / div >
< div class = "file_upload_all" v-if = "item.value != 7" >
< file -upload v-model = "item.path" isConstruction :isShowTip="false" :limit="10" :file-type="['pdf']"
:file-size = "50" / >
< file -upload v-model = "item.path" isConstruction :isShowTip="false" :limit="10" :file-type="['pdf']" :file-size="50" / >
< / div >
< / div >
< template # footer >
@ -376,7 +392,8 @@
< / el-form >
< / div >
< template # footer >
< span > < el-button type = "primary" @click ="submitForm" > 保存 < / el -button >
< span
> < el-button type = "primary" @click ="submitForm" > 保存 < / el -button >
< el-button @click ="showFaceDrawer = false" > 取消 < / el -button >
< / span >
< / template >
@ -388,7 +405,8 @@
< / el-select >
< / el-form-item >
< template # footer >
< span > < el-button type = "primary" @click ="handleEdit" > 保存 < / el -button >
< span
> < el-button type = "primary" @click ="handleEdit" > 保存 < / el -button >
< el-button @click ="statusDialog = false" > 取消 < / el -button >
< / span >
< / template >
@ -412,8 +430,8 @@
< el-timeline-item color = "rgb(255, 73, 73)" >
< div class = "mb" > { { '退场时间:' + item . entryDate } } < / div >
< div class = "pl-xl" >
< span class = "text-coolgray font-bold" > 退场文件 : < image-preview v-for = "itm in item.pathUrl" :src="itm"
width = "100px" class = "mr" / > < / span > < br / >
< span class = "text-coolgray font-bold" > 退场文件 : < image-preview v-for = "itm in item.pathUrl" :src="itm" width="100px" class="mr" / > < / s p a n
>< br / >
< p class = "mt text-coolgray" >
备注 : < span class = "text-blue" > { { item . remark } } < / span >
< / p >
@ -441,8 +459,11 @@
< el-date-picker v-model = "monthValue" type="month" placeholder="请选择月份" @change="handleMonth" / >
< / template >
< template # date -cell = " { data } " >
< div class = "w100% h100% position-relative m-0 monthDay" : class = "data.isSelected ? 'is-selected' : ''"
@click ="handleViewPlayCard(playCardIdx(data), data)" >
< div
class = "w100% h100% position-relative m-0 monthDay"
: class = "data.isSelected ? 'is-selected' : ''"
@click ="handleViewPlayCard(playCardIdx(data), data)"
>
{ { data . day . split ( '-' ) . slice ( 1 ) . join ( '-' ) } }
< div : style = "{ background: playCardColor(data) }" v-if = "playCardIdx(data) != -1" > < / div >
< / div >
@ -461,8 +482,12 @@
< / el-select >
< / el-form-item >
< el-form-item label = "班组" label -width = " 130px " >
< el-select v-model = "personnelAllocationObject.teamId" :disabled="!personnelAllocationObject.projectId" placeholder="请选择分包单位"
style = "width: 240px" >
< el-select
v-model = "personnelAllocationObject.teamId"
:disabled = "!personnelAllocationObject.projectId"
placeholder = "请选择分包单位"
style = "width: 240px"
>
< el-option v-for = "item in teamList" :key="item.id" :label="item.teamName" :value="item.id" / >
< / el-select >
< / el-form-item >
@ -586,7 +611,7 @@ const personnelAllocationObject = reactive({
memberId : null ,
projectId : '' ,
teamId : '' ,
postId : '' ,
postId : ''
} ) ;
const contractorList = ref < Array < skipTeamType > > ( [ ] ) ;
@ -706,7 +731,35 @@ const uploadPath = computed(() => {
console . log ( list ) ;
return list ;
} ) ;
//身份证正面上传成功
const handleUploadSuccess = ( data : any ) => {
console . log ( '上传成功返回的数据:' , data ) ;
// 这里可以处理返回的数据
form . value . userName = data . name ;
form . value . sex = data . gender == '男' ? 2 : 3 ;
form . value . nation = data . nation ;
form . value . sfzNumber = data . citizenIdentification ;
form . value . sfzSite = data . address ;
form . value . sfzBirth = formatDate ( data . birth ) ;
} ;
//身份证反面面上传成功
const handleUploadSuccessBack = ( data : any ) => {
console . log ( '上传成功返回的数据:' , data ) ;
form . value . sfzStart = formatDate ( data . issuingDate ) ;
form . value . sfzEnd = formatDate ( data . expiryDate ) ;
} ;
//银行卡上传成功
const handleUploadSuccessBank = ( data : any ) => {
console . log ( '上传成功返回的数据:' , data ) ;
form . value . yhkNumber = data . bankCardNumber ;
} ;
//格式化时间
const formatDate = ( date : any ) => {
const year = date . substring ( 0 , 4 ) ;
const month = date . substring ( 4 , 6 ) ;
const day = date . substring ( 6 , 8 ) ;
return ` ${ year } - ${ month } - ${ day } ` ;
} ;
// 获取项目列表
const getProjectList = async ( ) => {
const res = await ProjectList ( { } ) ;
@ -1117,7 +1170,6 @@ const handleAssign = async (row: ConstructionUserVO) => {
const selectProject1 = ( e : any ) => {
// 请求班组
getTeamList ( personnelAllocationObject . projectId ) ;
} ;
const getTeamList = async ( projectId ) => {
const res = await TeamList ( {